1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/coin_ynh.git synced 2024-09-03 18:16:26 +02:00

Merge pull request #39 from YunoHost-Apps/new_jinja_helper

Add jinja helper for apps
This commit is contained in:
Alexandre Aubin 2024-06-29 23:51:01 +02:00 committed by GitHub
commit 5c9a5166bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 10 deletions

View file

@ -7,7 +7,8 @@ DEBUG = TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['{{ domain }}']
URL_PREFIX = '{{ prefix }}'
# Prefix is hard coded for now as the app can only be installed on whole domain
URL_PREFIX = ''
STATIC_ROOT = '{{ install_dir }}/static'
NOTIFICATION_EMAILS = ['{{ email }}']
DEFAULT_FROM_EMAIL = 'notifier@{{ domain }}'

View file

@ -17,7 +17,7 @@ website = "https://code.ffdn.org/FFDN/coin"
code = "https://code.ffdn.org/ffdn/coin"
[integration]
yunohost = ">= 11.2.0"
yunohost = ">= 11.2.13"
architectures = "all"
multi_instance = false
ldap = false

View file

@ -7,9 +7,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
ynh_change_url_nginx_config
ynh_backup_if_checksum_is_different --file="$install_dir/coin/settings_local.py"
ynh_render_template ../conf/local.py.j2 "$install_dir/coin/settings_local.py"
ynh_store_file_checksum --file="$install_dir/coin/settings_local.py"
ynh_add_config --jinja --template=local.py.j2 --destination="$install_dir/coin/settings_local.py"
chmod 400 "$install_dir/coin/settings_local.py"
chown $app "$install_dir/coin/settings_local.py"

View file

@ -3,7 +3,7 @@
source _common.sh
source /usr/share/yunohost/helpers
export secret=$(ynh_string_random 24)
secret=$(ynh_string_random 24)
ynh_app_setting_set --app=$app --key=secret --value=$secret
#=================================================
@ -37,10 +37,7 @@ popd
#=================================================
ynh_script_progression --message="Configuring application..."
export prefix="${path#"/"}/"
prefix=${prefix%"/"}
ynh_render_template ../conf/local.py.j2 "$install_dir/coin/settings_local.py"
ynh_store_file_checksum --file="$install_dir/coin/settings_local.py"
ynh_add_config --jinja --template=local.py.j2 --destination="$install_dir/coin/settings_local.py"
chmod 400 "$install_dir/coin/settings_local.py"
chown $app "$install_dir/coin/settings_local.py"