From 864958888e10640a70ced106302c579242752b9b Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Mon, 15 Aug 2022 17:15:13 +0200 Subject: [PATCH 1/7] log_file="${log_path}/${app}.log" --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index eb4830b..faab65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -34,7 +34,7 @@ default_from_email="${app}@${domain}" public_path=/var/www/$app final_path=/opt/yunohost/$app log_path=/var/log/$app -log_file="${log_path}/django_example_ynh.log" +log_file="${log_path}/${app}.log" #================================================= # COMMON VARIABLES From 78d9ce54205b6d030afd5b36a764f5712d2d764e Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Mon, 15 Aug 2022 17:15:24 +0200 Subject: [PATCH 2/7] use generic comments --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 85b33ea..3480b9f 100755 --- a/scripts/install +++ b/scripts/install @@ -228,7 +228,7 @@ then fi #================================================= -# Start django_example_ynh via systemd +# Start the app server via systemd #================================================= ynh_script_progression --message="Starting django_example_ynh's services..." --weight=5 diff --git a/scripts/upgrade b/scripts/upgrade index dd78304..d211280 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -207,7 +207,7 @@ chmod o-rwx "$public_path" chmod o-rwx "$final_path" #================================================= -# Start django_example_ynh via systemd +# Start the app server via systemd #================================================= ynh_script_progression --message="Starting django_example_ynh's services..." --weight=5 From e0b23c010c9cb07af4745e436497ab8e942d75db Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Mon, 15 Aug 2022 17:15:31 +0200 Subject: [PATCH 3/7] Bugfix change_url --- scripts/change_url | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 326e707..5bb62fb 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,7 +30,11 @@ final_path=$(ynh_app_setting_get --app="$app" --key=final_path) log_path=$(ynh_app_setting_get --app="$app" --key=log_path) port=$(ynh_app_setting_get --app="$app" --key=port) + db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd) +db_name=$(ynh_sanitize_dbid --db_name="$app") +db_user=$db_name + redis_db=$(ynh_app_setting_get --app="$app" --key=redis_db) #------------------------------------------------- From 84c5bea309d80db845ab222c8e0e077d9f74bff5 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Tue, 23 Aug 2022 17:45:29 +0200 Subject: [PATCH 4/7] Change to type "email" It exists already: https://github.com/YunoHost/issues/issues/2054 --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 0061ee3..921a8cb 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -9,13 +9,13 @@ services = ["__APP__"] [main.config.default_from_email] ask = "from email" - type = "string" + type = "email" help = "Default email address to use for various automated emails." bind = "default_from_email:__FINALPATH__/settings.py" [main.config.admin_email] ask = "ADMIN email" - type = "string" + type = "email" help = "EMail address for error emails." bind = "admin_email:__FINALPATH__/settings.py" From efa160ac1bb40989bf2dcfc8c592ff39d5d39bee Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Tue, 23 Aug 2022 17:48:05 +0200 Subject: [PATCH 5/7] Speedup CI by cache "~/.cache/" --- .github/workflows/pytest.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6e1050a..64df660 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -27,6 +27,11 @@ jobs: with: python-version: '${{ matrix.python-version }}' + - uses: actions/cache@v2 + with: + path: ~/.cache/ + key: dot-cache-files + - name: 'Install package' run: | pip3 install poetry From 6bb52aef8cd0a70d3e848b98248e5f3f25e0b0df Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Tue, 23 Aug 2022 17:48:18 +0200 Subject: [PATCH 6/7] ynh_exec_as() exists --- scripts/_common.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index faab65e..24083aa 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -85,17 +85,3 @@ ynh_redis_remove_db() { redis-cli -n "$db" flushall } -#================================================= - -# Execute a command as another user -# usage: ynh_exec_as USER COMMAND [ARG ...] -ynh_exec_as() { - local USER=$1 - shift 1 - - if [[ $USER = $(whoami) ]]; then - eval "$@" - else - sudo -u "$USER" "$@" - fi -} From 4a86b144f662cad34dc77b1c6c2c835cff0d0e69 Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Tue, 23 Aug 2022 17:48:44 +0200 Subject: [PATCH 7/7] Change ynh_script_progression to more generic wording --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3480b9f..751ca6f 100755 --- a/scripts/install +++ b/scripts/install @@ -230,7 +230,7 @@ fi #================================================= # Start the app server via systemd #================================================= -ynh_script_progression --message="Starting django_example_ynh's services..." --weight=5 +ynh_script_progression --message="Starting the application..." --weight=5 ynh_systemd_action --service_name="$app" --action="start" diff --git a/scripts/upgrade b/scripts/upgrade index d211280..08bb3a3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -209,7 +209,7 @@ chmod o-rwx "$final_path" #================================================= # Start the app server via systemd #================================================= -ynh_script_progression --message="Starting django_example_ynh's services..." --weight=5 +ynh_script_progression --message="Starting the application..." --weight=5 ynh_systemd_action --service_name="$app" --action="start"