mirror of
https://github.com/YunoHost-Apps/timeoff_ynh.git
synced 2024-09-03 20:35:59 +02:00
Fix
This commit is contained in:
parent
c43c06811b
commit
71abaa72ff
11 changed files with 27031 additions and 356 deletions
|
@ -2,6 +2,7 @@
|
|||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
language="fr"
|
||||
is_public=1
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
"application_sender_email" : "timeoff@__DOMAIN__",
|
||||
"email_transporter" : {
|
||||
"host" : "localhost",
|
||||
"port" : 25
|
||||
"port" : 25,
|
||||
},
|
||||
"ga_analytics_on" : false,
|
||||
"crypto_secret" : "!2~`HswpPPLa22+=±§sdq qwe,appp qwwokDF_",
|
||||
"application_domain" : "http://__DOMAIN__",
|
||||
"promotion_website_domain" : "http://timeoff.management"
|
||||
"promotion_website_domain" : "http://timeoff.management",
|
||||
"locale_code_for_sorting": "__LANGUAGE__"
|
||||
}
|
||||
|
|
14
conf/db.json
14
conf/db.json
|
@ -1,6 +1,18 @@
|
|||
{
|
||||
"production": {
|
||||
"dialect": "sqlite",
|
||||
"storage": "./db.production.sqlite"
|
||||
"storage": "./db.production.sqlite",
|
||||
"logging": false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*{
|
||||
"production": {
|
||||
"username": "__DB_NAME__",
|
||||
"password": "__DB_PWD__",
|
||||
"database": "__DB_NAME__",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql"
|
||||
}
|
||||
}*/
|
||||
|
|
27306
conf/localisation.json
27306
conf/localisation.json
File diff suppressed because it is too large
Load diff
|
@ -4,9 +4,9 @@ location __PATH__/ {
|
|||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
proxy_pass http://127.0.0.1:__PORT__/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_buffering off;
|
||||
proxy_pass http://127.0.0.1:__PORT__/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_buffering off;
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
|
|
|
@ -38,6 +38,16 @@
|
|||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "language",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose the application language",
|
||||
"fr": "Choisissez la langue de l'application"
|
||||
},
|
||||
"choices": ["cs", "de", "fr", "en"],
|
||||
"default": "fr"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
|
@ -48,6 +49,13 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
|
||||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_print_info --message="Backing up the MySQL database..."
|
||||
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -21,6 +21,7 @@ ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est dét
|
|||
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url=$YNH_APP_ARG_PATH
|
||||
language=$YNH_APP_ARG_LANGUAGE
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -43,6 +44,7 @@ ynh_script_progression --message="Storing installation settings..."
|
|||
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=language --value=$language
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -71,6 +73,16 @@ ynh_script_progression --message="Configuring system user..."
|
|||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# CREATE A MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a MySQL database..."
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
|
|
@ -18,6 +18,8 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
|
@ -25,7 +27,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
|||
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
||||
#=================================================
|
||||
|
||||
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
|
||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||
then
|
||||
ynh_script_progression --message="Removing $app service..."
|
||||
|
@ -40,6 +42,14 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
|
|||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the MySQL database..."
|
||||
|
||||
# Remove a database if it exists, along with the associated user
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
|
|
|
@ -26,6 +26,8 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -89,6 +91,15 @@ chown admin -R $install_log
|
|||
# Restore logrotate configuration
|
||||
ynh_restore_file "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the MySQL database..."
|
||||
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
|
|
|
@ -20,6 +20,8 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
|
Loading…
Add table
Reference in a new issue