mirror of
https://github.com/YunoHost-Apps/cryptpad_ynh.git
synced 2024-09-03 18:26:14 +02:00
Simplify conf
This commit is contained in:
parent
f37ee776fe
commit
e5f2973a56
5 changed files with 27 additions and 23 deletions
|
@ -15,7 +15,6 @@
|
||||||
upgrade=1 from_commit=ddbb3b36b8bcd00e573456bd9ad07b1aa5e41cb1
|
upgrade=1 from_commit=ddbb3b36b8bcd00e573456bd9ad07b1aa5e41cb1
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=0
|
multi_instance=0
|
||||||
incorrect_path=0
|
|
||||||
port_already_use=1
|
port_already_use=1
|
||||||
change_url=1
|
change_url=1
|
||||||
;;; Options
|
;;; Options
|
||||||
|
|
|
@ -142,7 +142,7 @@ module.exports = {
|
||||||
/* CryptPad will display a point of contact for your instance on its contact page
|
/* CryptPad will display a point of contact for your instance on its contact page
|
||||||
* (/contact.html) if you provide it below.
|
* (/contact.html) if you provide it below.
|
||||||
*/
|
*/
|
||||||
adminEmail: '__ADMIN_MAIL__',
|
adminEmail: '__EMAIL__',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* By default, CryptPad contacts one of our servers once a day.
|
* By default, CryptPad contacts one of our servers once a day.
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
location ^~ / {
|
location ^~ / {
|
||||||
|
|
||||||
# Force usage of https
|
# Force usage of https
|
||||||
if ($scheme = http) {
|
if ($scheme = http) {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass http://127.0.0.1:__PORT__;
|
proxy_pass http://127.0.0.1:__PORT__;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|
|
@ -27,6 +27,7 @@ domain=$YNH_APP_ARG_DOMAIN
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
path_url="/"
|
path_url="/"
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -49,8 +50,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path_url --value=$path_url
|
ynh_app_setting_set --app=$app --key=path_url --value=$path_url
|
||||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||||
|
|
||||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -113,15 +112,17 @@ ynh_add_systemd_config
|
||||||
# CONFIGURE CONFIG.JS
|
# CONFIGURE CONFIG.JS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Copy default configuration file
|
# # Copy default configuration file
|
||||||
mv "../conf/config.js" "$final_path/config/config.js"
|
# mv "../conf/config.js" "$final_path/config/config.js"
|
||||||
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js"
|
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js"
|
||||||
ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js"
|
# ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js"
|
||||||
ynh_replace_string --match_string="__ADMIN_MAIL__" --replace_string="$email" --target_file="$final_path/config/config.js"
|
# ynh_replace_string --match_string="__EMAIL__" --replace_string="$email" --target_file="$final_path/config/config.js"
|
||||||
|
|
||||||
# Store file checksum to detected user modifications on upgrade
|
# # Store file checksum to detected user modifications on upgrade
|
||||||
ynh_store_file_checksum "$final_path/config/config.js"
|
# ynh_store_file_checksum "$final_path/config/config.js"
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL CRYPTPAD
|
# INSTALL CRYPTPAD
|
||||||
|
|
|
@ -111,17 +111,19 @@ ynh_system_user_create --username=$app
|
||||||
# CONFIGURE CONFIG.JS
|
# CONFIGURE CONFIG.JS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different "$final_path/config/config.js"
|
# ynh_backup_if_checksum_is_different "$final_path/config/config.js"
|
||||||
|
|
||||||
# Copy default configuration file
|
# # Copy default configuration file
|
||||||
mv "../conf/config.js" "$final_path/config/config.js"
|
# mv "../conf/config.js" "$final_path/config/config.js"
|
||||||
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js"
|
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js"
|
||||||
ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js"
|
# ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js"
|
||||||
ynh_replace_string --match_string="__ADMIN_MAIL__" --replace_string="$email" --target_file="$final_path/config/config.js"
|
# ynh_replace_string --match_string="__EMAIL__" --replace_string="$email" --target_file="$final_path/config/config.js"
|
||||||
|
|
||||||
# Store file checksum to detected user modifications on upgrade
|
# # Store file checksum to detected user modifications on upgrade
|
||||||
ynh_store_file_checksum "$final_path/config/config.js"
|
# ynh_store_file_checksum "$final_path/config/config.js"
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL CRYPTPAD
|
# INSTALL CRYPTPAD
|
||||||
|
|
Loading…
Reference in a new issue