From 5ac98e4ad540b707c9e79995e8008f3447af1dab Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 24 Jul 2020 18:17:18 +0200 Subject: [PATCH] fix --- conf/systemd.service | 6 +----- scripts/_common.sh | 3 +-- scripts/install | 40 +++++++++++++++++++++++++++------------- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index edca92e..96cfc7b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,13 +7,9 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=/usr/bin/php daemon.php start --url=https://__URL__ --port=__PORT__ +ExecStart=/usr/bin/php daemon.php start --url=https://__DOMAIN__/__PATH__ --port=__PORT__ StandardOutput=syslog SyslogIdentifier=__APP__ [Install] WantedBy=multi-user.target - - - -#ExecStart=/usr/bin/php daemon.php start --url=https://__DOMAIN__/__PATH__ --port=__PORT__ \ No newline at end of file diff --git a/scripts/_common.sh b/scripts/_common.sh index 0b7c0c8..ab7368d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,8 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="postgresql " -#composer php-fpm php-curl php-mbstring php-imagick php-gd php-pgsql php-xml +pkg_dependencies="postgresql composer php-fpm php-curl php-mbstring php-imagick php-gd php-pgsql php-xml" #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index ff0e3a3..af79f63 100644 --- a/scripts/install +++ b/scripts/install @@ -148,9 +148,7 @@ ynh_store_file_checksum --file="$final_path/config/db.inc.php" # ) pushd "$final_path" || ynh_die - ynh_package_install movim - #composer install --no-interaction --quiet - #composer $app:migrate + composer install #--no-interaction --quiet popd || ynh_die #================================================= @@ -158,8 +156,8 @@ popd || ynh_die #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_replace_string --match_string="__URL__" --replace_string="${domain}${path_url}" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service +#ynh_replace_string --match_string="__URL__" --replace_string="${domain}${path_url}" --target_file=../conf/systemd.service +#ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service ynh_add_systemd_config @@ -191,17 +189,33 @@ ynh_add_systemd_config chown www-data $final_path && chown www-data $final_path/public && chmod u+rwx $final_path +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=2 + +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #--line_match="HTTP Server listening" + + #================================================= # SETUP SSOWAT #================================================= +ynh_script_progression --message="Configuring SSOwat..." --weight=1 -# SSOwat configuration -if [[ "$ssoenabled" = "No" ]]; then - ynh_app_setting_set "$app" skipped_uris "/" - (cd "$final_path" && php mud.php config --xmppwhitelist="$domain") - undo_sso_patch -else - ynh_app_setting_set "$app" unprotected_uris "/" +# Make app public if necessary or protect it +if [ $is_public -eq 1 ] +then + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= @@ -215,4 +229,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --time --last \ No newline at end of file +ynh_script_progression --message="Installation of $app completed" --time --last