mirror of
https://github.com/YunoHost-Apps/discourse_ynh.git
synced 2024-09-03 18:26:18 +02:00
cleaning
This commit is contained in:
parent
4bce726b7d
commit
2d9c51835e
6 changed files with 10 additions and 85 deletions
|
@ -1,28 +0,0 @@
|
|||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
is_public=1
|
||||
admin="john"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
# 2.8.8~ynh1
|
||||
upgrade=1 from_commit=ec974723113fa8f984af8ab47d1cc99765ae6c2f
|
||||
backup_restore=1
|
||||
# Activate multi-instance test only if you have more than 2Gb RAM!
|
||||
multi_instance=0
|
||||
port_already_use=0
|
||||
change_url=1
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=ec974723113fa8f984af8ab47d1cc99765ae6c2f
|
||||
name=2.8.8~ynh1
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
ruby_version="3.1"
|
||||
|
||||
nodejs_version="16"
|
||||
nodejs_version="18"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
|
|
@ -90,9 +90,9 @@ redis_db=$(ynh_redis_get_free_db)
|
|||
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
|
||||
relative_url_root=${path%/}
|
||||
|
||||
ynh_add_config --template="../conf/discourse_defaults.conf" --destination="$install_dir/config/discourse.conf"
|
||||
ynh_add_config --template="discourse_defaults.conf" --destination="$install_dir/config/discourse.conf"
|
||||
|
||||
ynh_add_config --template="../conf/settings.yml" --destination="$install_dir/plugins/discourse-ldap-auth/config/settings.yml"
|
||||
ynh_add_config --template="settings.yml" --destination="$install_dir/plugins/discourse-ldap-auth/config/settings.yml"
|
||||
|
||||
# Disable svgo worker
|
||||
echo "svgo: false" > $install_dir/.image_optim.yml
|
||||
|
@ -104,7 +104,7 @@ ynh_script_progression --message="Setting up Unicorn..."
|
|||
|
||||
# Set a secret value
|
||||
secret="$(ynh_string_random)"
|
||||
ynh_add_config --template="../conf/secrets.yml" --destination="$install_dir/config/secrets.yml"
|
||||
ynh_add_config --template="secrets.yml" --destination="$install_dir/config/secrets.yml"
|
||||
|
||||
pushd "$install_dir"
|
||||
ynh_use_ruby
|
||||
|
|
|
@ -22,42 +22,17 @@ then
|
|||
yunohost service remove $app
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STOP AND REMOVE SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping and removing the systemd service..."
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing logrotate configuration..."
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE REDIS DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the redis database..."
|
||||
|
||||
ynh_redis_remove_db "$redis_db"
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..."
|
||||
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..."
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_nodejs
|
||||
ynh_remove_ruby
|
||||
|
|
|
@ -28,7 +28,6 @@ ynh_script_progression --message="Restoring the app main directory..."
|
|||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
|
@ -43,13 +42,6 @@ ynh_script_progression --message="Reinstalling dependencies..."
|
|||
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
|
@ -76,21 +68,13 @@ ynh_package_autoremove
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the logrotate configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --log "$install_dir/log/unicorn.stderr.log" "$install_dir/log/unicorn.stdout.log" "$install_dir/log/production.log"
|
||||
|
||||
#=================================================
|
||||
|
@ -104,14 +88,8 @@ else
|
|||
unicorn_workers=3
|
||||
fi
|
||||
ynh_app_setting_set --app=$app --key=unicorn_workers --value=$unicorn_workers
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="$install_dir/log/unicorn.stderr.log" --line_match="INFO -- : worker=$((unicorn_workers-1)) ready"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="$install_dir/log/unicorn.stderr.log" --line_match="INFO -- : worker=$((unicorn_workers-1)) ready"
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -167,9 +167,9 @@ then
|
|||
|
||||
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
relative_url_root=${path%/}
|
||||
ynh_add_config --template="../conf/discourse_defaults.conf" --destination="$install_dir/config/discourse.conf"
|
||||
ynh_add_config --template="discourse_defaults.conf" --destination="$install_dir/config/discourse.conf"
|
||||
|
||||
ynh_add_config --template="../conf/settings.yml" --destination="$install_dir/plugins/discourse-ldap-auth/config/settings.yml"
|
||||
ynh_add_config --template="settings.yml" --destination="$install_dir/plugins/discourse-ldap-auth/config/settings.yml"
|
||||
|
||||
# Disable svgo worker
|
||||
echo "svgo: false" > $install_dir/.image_optim.yml
|
||||
|
@ -191,7 +191,7 @@ then
|
|||
ynh_store_file_checksum --file="$unicorn_config_file"
|
||||
|
||||
secret="$(ynh_string_random)"
|
||||
ynh_add_config --template="../conf/secrets.yml" --destination="$install_dir/config/secrets.yml"
|
||||
ynh_add_config --template="secrets.yml" --destination="$install_dir/config/secrets.yml"
|
||||
|
||||
# Set permissions to app files
|
||||
chmod 750 "$install_dir"
|
||||
|
|
Loading…
Add table
Reference in a new issue