mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Fix
This commit is contained in:
parent
8747bf0f03
commit
b6eb640e48
4 changed files with 20 additions and 22 deletions
|
@ -64,9 +64,9 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SUPERVISOR SERVICE
|
# STOP SUPERVISOR SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a supervisor service..."
|
ynh_script_progression --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_supervisor_action --service_name="${app}-horizon" --action="stop" --log_path="/var/log/$app/${app}-horizon.log"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
|
@ -118,11 +118,11 @@ popd
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SUPERVISOR SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a supervisor service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="systemd" --line_match="success: ${app}-horizon"
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
|
@ -26,8 +26,7 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
app_key=$(ynh_string_random --length=32 | base64)
|
app_key="base64:$(ynh_string_random --length=32 | base64)"
|
||||||
app_key="base64:$app_key"
|
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -73,22 +72,17 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating a PostgreSQL database..."
|
ynh_script_progression --message="Creating a PostgreSQL database..."
|
||||||
|
|
||||||
ynh_psql_test_if_first_run
|
|
||||||
|
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_string_random --length=32)
|
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
ynh_psql_test_if_first_run
|
||||||
|
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
|
||||||
# Initialize database and store postgres password for upgrade
|
|
||||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE REDIS DATABASE
|
# CONFIGURE REDIS DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Creating a Redis database..."
|
||||||
|
|
||||||
# Configure redis
|
|
||||||
redis_db=$(ynh_redis_get_free_db)
|
redis_db=$(ynh_redis_get_free_db)
|
||||||
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
|
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
|
||||||
|
|
||||||
|
@ -187,6 +181,8 @@ popd
|
||||||
ynh_script_progression --message="Installing the cron file..."
|
ynh_script_progression --message="Installing the cron file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||||
|
chown root: "/etc/cron.d/$app"
|
||||||
|
chmod 644 "/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -206,9 +202,9 @@ ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
yunohost service add $app --description="Ethical photo sharing platform" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Ethical photo sharing platform" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SUPERVISOR SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting $app service..."
|
ynh_script_progression --message="Starting systemd service..."
|
||||||
|
|
||||||
# Start a supervisor service
|
# Start a supervisor service
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
|
@ -221,8 +217,6 @@ ynh_script_progression --message="Configuring permissions..."
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
# Everyone can access the app.
|
|
||||||
# The "main" permission is automatically created before the install script.
|
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -134,9 +134,9 @@ ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
yunohost service add $app --description="Ethical photo sharing platform" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Ethical photo sharing platform" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SUPERVISOR SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a supervisor service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
|
|
||||||
|
@ -146,6 +146,8 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
ynh_script_progression --message="Restoring the logrotate configuration..."
|
ynh_script_progression --message="Restoring the logrotate configuration..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
chown root: "/etc/cron.d/$app"
|
||||||
|
chmod 644 "/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -201,6 +201,8 @@ chown -R $app: "/var/log/$app/"
|
||||||
ynh_script_progression --message="Upgrading cron file..."
|
ynh_script_progression --message="Upgrading cron file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||||
|
chown root: "/etc/cron.d/$app"
|
||||||
|
chmod 644 "/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SUPERVISOR
|
# SETUP SUPERVISOR
|
||||||
|
@ -228,7 +230,7 @@ ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
yunohost service add $app --description="Ethical photo sharing platform" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Ethical photo sharing platform" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SUPERVISOR SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue