1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/metabase_ynh.git synced 2024-09-03 19:46:00 +02:00
This commit is contained in:
ericgaspar 2021-11-17 19:59:38 +01:00
parent 43bc4348ce
commit 598888f5f1
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 50 additions and 61 deletions

View file

@ -13,7 +13,6 @@
upgrade=1
backup_restore=1
multi_instance=0
port_already_use=0
change_url=0
;;; Options
Email=

View file

@ -1,24 +1,19 @@
location / {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:__PORT__;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_pass http://127.0.0.1:__PORT__;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
#WebSocket Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
#WebSocket Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}

View file

@ -21,7 +21,7 @@
"url": ""
},
"requirements": {
"yunohost": ">= 4.2.0"
"yunohost": ">= 4.3.0"
},
"multi_instance": false,
"services": [

View file

@ -81,7 +81,7 @@ ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
ynh_script_progression --message="Configuring system user..." --weight=2
# Create a system user
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -126,16 +126,12 @@ chown $app "/etc/default/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Create log directory
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
chown -R $app /var/log/$app
# Setup logrotate
ynh_use_logrotate --specific_user=$app/$app
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -96,14 +96,10 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#=================================================
# HANDLE LOG FILES AND LOGROTATE
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
chown $app -R /var/log/$app
# Restore logrotate configuration
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================

View file

@ -30,6 +30,29 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up Streama before upgrading (may take a while)..." --weight=2
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=20
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -55,27 +78,12 @@ if ynh_legacy_permissions_exists; then
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Backing up Streama before upgrading (may take a while)..." --weight=2
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=20
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -132,13 +140,8 @@ chown $app "/etc/default/$app"
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=3
# Create log directory
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
chown -R $app /var/log/$app
# Setup logrotate
ynh_use_logrotate --specific_user=$app/$app
ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST