diff --git a/README.md b/README.md index 5cbfccd..98ce024 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ YunoRunner is our own CI runner for YunoHost Apps #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/yunorunner%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/yunorunner/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/yunorunner%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/yunorunner/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/yunorunner.svg)](https://ci-apps.yunohost.org/ci/apps/yunorunner/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/yunorunner.svg)](https://ci-apps-arm.yunohost.org/ci/apps/yunorunner/) ## Limitations @@ -42,11 +42,11 @@ YunoRunner is our own CI runner for YunoHost Apps ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/yunorunner_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/yunorunner_ynh_core/tree/testing). To try the testing branch, please proceed like that. ``` -sudo yunohost app install https://github.com/YunoHost-Apps/yunorunner_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/yunorunner_ynh_core/tree/testing --debug or -sudo yunohost app upgrade yunorunner -u https://github.com/YunoHost-Apps/yunorunner_ynh/tree/testing --debug +sudo yunohost app upgrade yunorunner -u https://github.com/YunoHost-Apps/yunorunner_ynh_core/tree/testing --debug ``` diff --git a/check_process b/check_process index 598da93..03d9e18 100644 --- a/check_process +++ b/check_process @@ -16,6 +16,8 @@ # upgrade=1 from_commit=04cb5f0ec18def9d50fa861c16d491275843b9e7 # 041120 # upgrade=1 from_commit=7b3acfc9b28b6ed33a1590ae16261d7dd3b5b06a + # 2021-03-05~ynh1 + upgrade=1 from_commit=f0e9373aa2403bf04f84c67646ac5d34376b7959 backup_restore=1 multi_instance=1 port_already_use=1 (4242) @@ -29,3 +31,5 @@ Notification=down manifest_arg=domain=DOMAIN&path=PATH& ; commit=7b3acfc9b28b6ed33a1590ae16261d7dd3b5b06a name=041120 + ; commit=f0e9373aa2403bf04f84c67646ac5d34376b7959 + name=2021-03-05~ynh1 diff --git a/manifest.json b/manifest.json index 958067d..3530445 100644 --- a/manifest.json +++ b/manifest.json @@ -10,6 +10,9 @@ "url": "https://github.com/YunoHost/yunorunner", "license": "GPL-3.0-or-later", "maintainer": { + "name": "" + }, + "previous_maintainer": { "name": "Maniack Crudelis", "email": "maniackc_dev@crudelis.fr" }, @@ -25,19 +28,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for YunoRunner", - "fr": "Choisissez un nom de domaine pour YunoRunner" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for YunoRunner", - "fr": "Choisissez un chemin pour YunoRunner" - }, "example": "/yunorunner", "default": "/yunorunner" } diff --git a/scripts/change_url b/scripts/change_url index 0b2af13..ba60148 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." diff --git a/scripts/install b/scripts/install index 33abf31..4cb2ff6 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,14 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -79,6 +87,10 @@ pushd "$final_path" git reset --quiet --hard FETCH_HEAD popd +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:$app "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -87,14 +99,6 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # SPECIFIC SETUP #================================================= @@ -111,6 +115,16 @@ pushd $final_path venv/bin/pip install 'websockets>=6.0,<7.0' popd +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a config file..." + +ynh_add_config --template="yunorunner.config.py" --destination="$final_path/config.py" + +chmod 400 "$final_path/config.py" +chown $app:$app "$final_path/config.py" + #================================================= # SETUP SYSTEMD #================================================= @@ -119,23 +133,8 @@ ynh_script_progression --message="Configuring a systemd service..." # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# CONFIGURE YUNORUNNER -#================================================= -ynh_script_progression --message="Configuring YunoRunner..." - -ynh_add_config --template="yunorunner.config.py" --destination="$final_path/config.py" - #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set permissions to app files -chown -R $app:root $final_path - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/remove b/scripts/remove index da93eb5..c561c2c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -75,7 +75,7 @@ then fi #================================================= -# GENERIC FINALISATION +# GENERIC FINALIZATION #================================================= # REMOVE DEDICATED USER #================================================= diff --git a/scripts/restore b/scripts/restore index f2ba14e..dc2d712 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -56,13 +56,6 @@ 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 APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -72,12 +65,15 @@ ynh_script_progression --message="Recreating the dedicated system user..." ynh_system_user_create --username=$app #================================================= -# RESTORE USER RIGHTS +# RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring user rights..." +ynh_script_progression --message="Restoring the app main directory..." -# Restore permissions on app files -chown -R $app:root $final_path +ynh_restore_file --origin_path="$final_path" + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:$app "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index e4c1921..392ee1a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -96,6 +96,14 @@ ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped YunoRunner CI" +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -111,6 +119,10 @@ then popd fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:$app "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -126,14 +138,6 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # SPECIFIC UPGRADE #================================================= @@ -150,30 +154,26 @@ pushd $final_path venv/bin/pip install 'websockets>=6.0,<7.0' popd +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a config file..." + +ynh_add_config --template="yunorunner.config.py" --destination="$final_path/config.py" + +chmod 400 "$final_path/config.py" +chown $app:$app "$final_path/config.py" + #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Upgrading systemd configuration..." +# Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# CONFIGURE YUNORUNNER -#================================================= -ynh_script_progression --message="Configuring YunoRunner..." - -ynh_add_config --template="yunorunner.config.py" --destination="$final_path/config.py" - #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set permissions on app files -chown -R $app:root $final_path - #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================