diff --git a/conf/diacamma_script.py b/conf/diacamma_script.py new file mode 100644 index 0000000..5514403 --- /dev/null +++ b/conf/diacamma_script.py @@ -0,0 +1,4 @@ +from lucterios.CORE.parameters import Params + +Params.setvalue('mailing-smtpserver', 'localhost') +Params.setvalue('mailing-smtpport', 1025) diff --git a/conf/extra_diacamma.json b/conf/extra_diacamma.json index ce795b5..9299e29 100644 --- a/conf/extra_diacamma.json +++ b/conf/extra_diacamma.json @@ -1,7 +1,7 @@ { "LANGUAGE_CODE":"__LANGUAGE__", "USE_X_FORWARDED_HOST":true, - "FORCE_SCRIPT_NAME":"/__APP__", + "FORCE_SCRIPT_NAME":"__PATH__", "LDAP_SERVERS": [{"host": "127.0.0.1", "port": 389, "use_ssl": false, "get_info": "NONE"}], "LDAP_ENGINE" : "OpenLDAP", "LDAP_AUTHENTICATION" : "ANONYMOUS", diff --git a/conf/extra_url b/conf/extra_url new file mode 100644 index 0000000..3922091 --- /dev/null +++ b/conf/extra_url @@ -0,0 +1,3 @@ +# Pypi server + +https://pypi.diacamma.org diff --git a/manifest.toml b/manifest.toml index cba3eea..8fc5be4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -11,7 +11,7 @@ version = "23.12.15.16~ynh1" maintainers = ["Laurent Gay"] [upstream] -license = "GNU General Public License v3.0" +license = " GPL-3.0-or-later" website = "https://www.diacamma.org" demo = "https://asso.diacamma.org" code = "https://github.com/Diacamma2" diff --git a/scripts/_common.sh b/scripts/_common.sh index 692fa9c..4a4f8a1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -26,12 +26,12 @@ function refresh_collect() { pushd $install_dir venv/bin/python3 manage_inst-${app}.py collectstatic --noinput -l - rm -rf inst-${app}/static/static - rm -rf inst-${app}/static/tmp - rm -rf inst-${app}/static/usr - rm -rf inst-${app}/static/__pycache__ - rm -rf inst-${app}/static/settings.py - rm -rf inst-${app}/static/__init__.py + ynh_secure_remove inst-${app}/static/static + ynh_secure_remove inst-${app}/static/tmp + ynh_secure_remove inst-${app}/static/usr + ynh_secure_remove inst-${app}/static/__pycache__ + ynh_secure_remove inst-${app}/static/settings.py + ynh_secure_remove inst-${app}/static/__init__.py chown -R ${app}:www-data . chmod 750 . popd @@ -40,11 +40,7 @@ function refresh_collect() function check_params() { pushd $install_dir - echo " -from lucterios.CORE.parameters import Params -Params.setvalue('mailing-smtpserver', 'localhost') -Params.setvalue('mailing-smtpport', 1025) -" > /tmp/diacamma_script.py + ynh_add_config --template="../conf/diacamma_script.py" --destination="/tmp/diacamma_script.py" venv/bin/python3 manage_inst-${app}.py shell < /tmp/diacamma_script.py venv/bin/lucterios_admin.py security -n inst-${app} -e "MODE=0" popd diff --git a/scripts/install b/scripts/install index 2765707..78906cc 100644 --- a/scripts/install +++ b/scripts/install @@ -10,9 +10,9 @@ ynh_script_progression --message="Installing app..." --weight=5 pushd $install_dir python3 -m venv venv -if [ "$develop" == "true" ] +if [ $develop -eq 1 ] then - echo "https://pypi.diacamma.org" > extra_url + ynh_add_config --template="../conf/extra_url" --destination="./extra_url" pip_option='--extra-index-url "https://pypi.diacamma.org"' else pip_option='' diff --git a/scripts/restore b/scripts/restore index 6c8cd50..9a0e1c6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -45,7 +45,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -yunohost service add $app --log="/var/log/$app/$app.log" +yunohost service add ${app} --log="/var/log/${app}/${app}.log" ynh_restore_file --origin_path="/etc/logrotate.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index 9543ac7..13d4c50 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,7 +34,7 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add $app --log="/var/log/$app/$app.log" +yunohost service add ${app} --log="/var/log/${app}/${app}.log" ynh_use_logrotate --non-append