better ssh config
This commit is contained in:
parent
04d8b6a183
commit
44b9c4bf35
4 changed files with 13 additions and 10 deletions
|
@ -41,7 +41,7 @@ ENABLE_NOTIFY_MAIL = true
|
||||||
DISABLE_REGISTRATION = true
|
DISABLE_REGISTRATION = true
|
||||||
ENABLE_CAPTCHA = false
|
ENABLE_CAPTCHA = false
|
||||||
REQUIRE_SIGNIN_VIEW = false
|
REQUIRE_SIGNIN_VIEW = false
|
||||||
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
|
ENABLE_REVERSE_PROXY_AUTHENTICATION = true
|
||||||
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = true
|
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = true
|
||||||
|
|
||||||
[picture]
|
[picture]
|
||||||
|
|
|
@ -120,8 +120,8 @@ ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini"
|
ynh_exec_warn_less ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini"
|
||||||
|
|
||||||
chmod 640 "$final_path/app.ini"
|
chmod 640 "$final_path/custom/conf/app.ini"
|
||||||
chown $app:$app "$final_path/app.ini"
|
chown $app:$app "$final_path/custom/conf/app.ini"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
|
|
|
@ -91,8 +91,11 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring system user..." --weight=1
|
ynh_script_progression --message="Configuring system user..." --weight=1
|
||||||
|
|
||||||
|
datadir=/home/yunohost.app/$app
|
||||||
|
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create --username=$app --home_dir=$final_path --groups ssh.app
|
ynh_system_user_create --username=$app --home_dir=$datadir --groups ssh.app --use_shell
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -100,7 +103,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path --groups ssh.app
|
||||||
ynh_script_progression --message="Installing sources files..." --weight=10
|
ynh_script_progression --message="Installing sources files..." --weight=10
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
ynh_setup_source --dest-dir=$final_path --source-id=$YNH_ARCH
|
ynh_setup_source --dest_dir=$final_path --source_id=$YNH_ARCH
|
||||||
|
|
||||||
mkdir -p "$final_path/custom/conf"
|
mkdir -p "$final_path/custom/conf"
|
||||||
|
|
||||||
|
@ -120,9 +123,6 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
ynh_script_progression --message="Creating a data directory..." --weight=1
|
||||||
|
|
||||||
datadir=/home/yunohost.app/$app
|
|
||||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
|
||||||
|
|
||||||
if [ -e "$datadir" ]; then
|
if [ -e "$datadir" ]; then
|
||||||
old_data_dir_path="$datadir$(date '+%Y%m%d.%H%M%S')"
|
old_data_dir_path="$datadir$(date '+%Y%m%d.%H%M%S')"
|
||||||
ynh_print_warn "A data directory already exist. Data was renamed to $old_data_dir_path"
|
ynh_print_warn "A data directory already exist. Data was renamed to $old_data_dir_path"
|
||||||
|
@ -164,7 +164,10 @@ ynh_add_systemd_config
|
||||||
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
||||||
|
|
||||||
# Configure logrotate
|
# Configure logrotate
|
||||||
ynh_use_logrotate --logfile "/var/log/$app"
|
ynh_use_logrotate --logfile "/var/log/$app/forgejo.log"
|
||||||
|
|
||||||
|
chown $app:$app /var/log/$app
|
||||||
|
chmod u=rwX,g=rX,o= "/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
|
|
|
@ -63,7 +63,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path" --groups ssh.app
|
ynh_system_user_create --username=$app --home_dir="$datadir" --groups ssh.app --use_shell
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
|
|
Loading…
Reference in a new issue