1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lstu_ynh.git synced 2024-09-03 19:36:12 +02:00

Add templates

This commit is contained in:
ericgaspar 2021-06-21 22:48:35 +02:00
parent 19d634fa77
commit c69f59bf4f
No known key found for this signature in database
GPG key ID: 574F281483054D44
9 changed files with 18 additions and 27 deletions

2
.gitignore vendored
View file

@ -1,2 +0,0 @@
*~
*.swp

View file

@ -1,7 +0,0 @@
language: python
before_install:
- git clone https://github.com/YunoHost/package_linter /tmp/package_linter
script:
- /tmp/package_linter/package_linter.py ./

3
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,3 @@
## Configuration
How to configure this app: a plain file at `/var/www/lstu/lstu.conf` with SSH.

3
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,3 @@
## Configuration
Comment configurer cette application : un fichier simple à `/var/www/lstu/lstu.conf` avec SSH.

View file

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -8,6 +8,13 @@
}, },
"version": "0.23-0~ynh1", "version": "0.23-0~ynh1",
"url": "https://lstu.fr", "url": "https://lstu.fr",
"upstream": {
"license": "WTFPL",
"website": "https://lstu.fr",
"demo": "https://lstu.fr",
"admindoc": "https://framagit.org/fiat-tux/hat-softwares/lstu/wikis/home",
"code": "https://framagit.org/fiat-tux/hat-softwares/lstu"
},
"license": "WTFPL", "license": "WTFPL",
"maintainer": { "maintainer": {
"name": "frju365", "name": "frju365",

View file

@ -49,7 +49,7 @@ ynh_app_setting_set $app hashed_password $hashed_password
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_systemd_action -n $app -a reload -l "Reloaded Shortened URLs service." -p "systemd" ynh_systemd_action --service_name=$app --action="reload" --log_path="systemd" --line_match="Server available at"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -48,7 +48,7 @@ ynh_app_setting_set $app theme $theme
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_systemd_action -n $app -a reload -l "Reloaded Shortened URLs service." -p "systemd" ynh_systemd_action --service_name=$app --action="reload" --log_path="systemd" --line_match="Server available at"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -50,25 +50,12 @@ fi
# MOVE TO PUBLIC OR PRIVATE # MOVE TO PUBLIC OR PRIVATE
#================================================= #=================================================
ynh_backup_if_checksum_is_different "$final_path/lstu.conf"
cp conf/lstu.conf.template "${final_path}/lstu.conf"
ynh_replace_string "__DOMAIN__" "$domain" "${final_path}/lstu.conf"
ynh_replace_string "__PATH__" "$path_url" "${final_path}/lstu.conf"
ynh_replace_string "__PORT__" "$port" "${final_path}/lstu.conf"
ynh_replace_string "__DB_NAME__" "$db_name" "${final_path}/lstu.conf"
ynh_replace_string "__DB_USER__" "$db_user" "${final_path}/lstu.conf"
ynh_replace_string "__DB_PWD__" "$db_pwd" "${final_path}/lstu.conf"
ynh_replace_string "__SELECTED_THEME__" "$theme" "${final_path}/lstu.conf"
ynh_replace_string "__PASSWORD_HASHED__" "$hashed_password" "${final_path}/lstu.conf"
ynh_replace_string "__SECRET__" "$secret" "${final_path}/lstu.conf"
if [ $is_public -eq 0 ]; if [ $is_public -eq 0 ];
then then
ynh_replace_string "__IS_PUBLIC__" "" "${final_path}/lstu.conf" ynh_add_config --template="../conf/lstu.conf.ldap" --destination="$final_path/lstu.conf"
else else
ynh_replace_string "__IS_PUBLIC__" "#" "${final_path}/lstu.conf" ynh_add_config --template="../conf/lstu.conf.template" --destination="$final_path/lstu.conf"
fi fi
ynh_store_file_checksum "${final_path}/lstu.conf"
if [ $is_public -eq 0 ]; then if [ $is_public -eq 0 ]; then
public_private="private" public_private="private"
@ -100,7 +87,7 @@ ynh_app_setting_set $app is_public $is_public
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_systemd_action -n $app -a reload -l "Reloaded Shortened URLs service." -p "systemd" ynh_systemd_action --service_name=$app --action="reload" --log_path="systemd" --line_match="Server available at"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT