Merge pull request #11 from YunoHost-Apps/testing

master <- testing
This commit is contained in:
Jens Diemer 2022-08-24 07:52:45 +02:00 committed by GitHub
commit a840802d26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 21 deletions

View file

@ -27,6 +27,11 @@ jobs:
with: with:
python-version: '${{ matrix.python-version }}' python-version: '${{ matrix.python-version }}'
- uses: actions/cache@v2
with:
path: ~/.cache/
key: dot-cache-files
- name: 'Install package' - name: 'Install package'
run: | run: |
pip3 install poetry pip3 install poetry

View file

@ -9,13 +9,13 @@ services = ["__APP__"]
[main.config.default_from_email] [main.config.default_from_email]
ask = "from email" ask = "from email"
type = "string" type = "email"
help = "Default email address to use for various automated emails." help = "Default email address to use for various automated emails."
bind = "default_from_email:__FINALPATH__/settings.py" bind = "default_from_email:__FINALPATH__/settings.py"
[main.config.admin_email] [main.config.admin_email]
ask = "ADMIN email" ask = "ADMIN email"
type = "string" type = "email"
help = "EMail address for error emails." help = "EMail address for error emails."
bind = "admin_email:__FINALPATH__/settings.py" bind = "admin_email:__FINALPATH__/settings.py"

View file

@ -34,7 +34,7 @@ default_from_email="${app}@${domain}"
public_path=/var/www/$app public_path=/var/www/$app
final_path=/opt/yunohost/$app final_path=/opt/yunohost/$app
log_path=/var/log/$app log_path=/var/log/$app
log_file="${log_path}/django_example_ynh.log" log_file="${log_path}/${app}.log"
#================================================= #=================================================
# COMMON VARIABLES # COMMON VARIABLES
@ -85,17 +85,3 @@ ynh_redis_remove_db() {
redis-cli -n "$db" flushall 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
}

View file

@ -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) log_path=$(ynh_app_setting_get --app="$app" --key=log_path)
port=$(ynh_app_setting_get --app="$app" --key=port) port=$(ynh_app_setting_get --app="$app" --key=port)
db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd) 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) redis_db=$(ynh_app_setting_get --app="$app" --key=redis_db)
#------------------------------------------------- #-------------------------------------------------

View file

@ -228,9 +228,9 @@ then
fi 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 ynh_script_progression --message="Starting the application..." --weight=5
ynh_systemd_action --service_name="$app" --action="start" ynh_systemd_action --service_name="$app" --action="start"

View file

@ -207,9 +207,9 @@ chmod o-rwx "$public_path"
chmod o-rwx "$final_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 ynh_script_progression --message="Starting the application..." --weight=5
ynh_systemd_action --service_name="$app" --action="start" ynh_systemd_action --service_name="$app" --action="start"