Maniack Crudelis
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
66 additions and
12 deletions
-
check_process
-
scripts/actions/create_database
-
scripts/actions/public_private
-
scripts/actions/remove_database
-
scripts/actions/sftp
-
scripts/config
|
|
|
@ -6,6 +6,18 @@ |
|
|
|
password="myreallystrengthpassword" |
|
|
|
is_public=1 (PUBLIC|public=1|private=0) |
|
|
|
with_mysql=1 |
|
|
|
; Actions |
|
|
|
with_sftp=1|0 |
|
|
|
is_public=1|0 |
|
|
|
; Config_panel |
|
|
|
main.sftp.sftp=1|0 |
|
|
|
main.sftp.password=password1 |
|
|
|
main.is_public.is_public=1|0 |
|
|
|
main.overwrite_files.overwrite_nginx=1|0 |
|
|
|
main.overwrite_files.overwrite_phpfpm=1|0 |
|
|
|
main.php_fpm_config.footprint=low|medium|high |
|
|
|
main.php_fpm_config.free_footprint=20 |
|
|
|
main.php_fpm_config.usage=low|medium|high |
|
|
|
; Checks |
|
|
|
pkg_linter=1 |
|
|
|
setup_sub_dir=1 |
|
|
|
@ -19,6 +31,8 @@ |
|
|
|
multi_instance=1 |
|
|
|
port_already_use=0 |
|
|
|
change_url=1 |
|
|
|
actions=1 |
|
|
|
config_panel=1 |
|
|
|
;; Test without sftp |
|
|
|
; Manifest |
|
|
|
domain="domain.tld" (DOMAIN) |
|
|
|
|
|
|
|
@ -9,15 +9,22 @@ |
|
|
|
source scripts/_common.sh |
|
|
|
source /usr/share/yunohost/helpers |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# MANAGE SCRIPT FAILURE |
|
|
|
#================================================= |
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script |
|
|
|
ynh_abort_if_errors |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# RETRIEVE ARGUMENTS |
|
|
|
#================================================= |
|
|
|
|
|
|
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} |
|
|
|
|
|
|
|
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql) |
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path) |
|
|
|
|
|
|
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# CHECK IF ARGUMENTS ARE CORRECT |
|
|
|
#================================================= |
|
|
|
|
|
|
|
@ -9,6 +9,13 @@ |
|
|
|
source scripts/_common.sh |
|
|
|
source /usr/share/yunohost/helpers |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# MANAGE SCRIPT FAILURE |
|
|
|
#================================================= |
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script |
|
|
|
ynh_abort_if_errors |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# RETRIEVE ARGUMENTS |
|
|
|
#================================================= |
|
|
|
|
|
|
|
@ -10,13 +10,20 @@ source scripts/_common.sh |
|
|
|
source /usr/share/yunohost/helpers |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# RETRIEVE ARGUMENTS |
|
|
|
# MANAGE SCRIPT FAILURE |
|
|
|
#================================================= |
|
|
|
|
|
|
|
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql) |
|
|
|
# Exit if an error occurs during the execution of the script |
|
|
|
ynh_abort_if_errors |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# RETRIEVE ARGUMENTS |
|
|
|
#================================================= |
|
|
|
|
|
|
|
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} |
|
|
|
|
|
|
|
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql) |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# CHECK IF ARGUMENTS ARE CORRECT |
|
|
|
#================================================= |
|
|
|
|
|
|
|
@ -9,6 +9,13 @@ |
|
|
|
source scripts/_common.sh |
|
|
|
source /usr/share/yunohost/helpers |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# MANAGE SCRIPT FAILURE |
|
|
|
#================================================= |
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script |
|
|
|
ynh_abort_if_errors |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# RETRIEVE ARGUMENTS |
|
|
|
#================================================= |
|
|
|
|
|
|
|
@ -8,6 +8,7 @@ |
|
|
|
|
|
|
|
source _common.sh |
|
|
|
source /usr/share/yunohost/helpers |
|
|
|
source _ynh_add_fpm_config |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# RETRIEVE ARGUMENTS |
|
|
|
@ -33,6 +34,8 @@ with_sftp="${YNH_CONFIG_MAIN_SFTP_SFTP:-$old_with_sftp}" |
|
|
|
# sftp password |
|
|
|
is_password_exist=0 |
|
|
|
ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password) |
|
|
|
if [ -n "$YNH_CONFIG_MAIN_SFTP_PASSWORD" ] |
|
|
|
then |
|
|
|
if [ -n "$password" ] |
|
|
|
then |
|
|
|
ynh_print_warn --message="A password already exist, it will not be replaced." |
|
|
|
@ -43,6 +46,7 @@ else |
|
|
|
# Otherwise, get the new password |
|
|
|
password="$YNH_CONFIG_MAIN_SFTP_PASSWORD" |
|
|
|
fi |
|
|
|
fi |
|
|
|
ynh_print_ON |
|
|
|
|
|
|
|
|
|
|
|
@ -144,6 +148,14 @@ apply_config() { |
|
|
|
if [ "$fpm_usage" != "$old_fpm_usage" ] || [ "$fpm_footprint" != "$old_fpm_footprint" ] |
|
|
|
then |
|
|
|
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint |
|
|
|
|
|
|
|
user=$(ynh_app_setting_get --app=$app --key=user) |
|
|
|
# use $user instead of $app as user that run the fpm processes |
|
|
|
finalphpconf="/etc/php/7.0/fpm/pool.d/$app.conf" |
|
|
|
ynh_replace_string --match_string="^user = .*" --replace_string="user = $user" --target_file="$finalphpconf" |
|
|
|
ynh_replace_string --match_string="^group = .*" --replace_string="group = $user" --target_file="$finalphpconf" |
|
|
|
|
|
|
|
ynh_systemd_action --service_name=php7.0-fpm --action=reload |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
|