mirror of
https://github.com/YunoHost-Apps/emailpoubelle_ynh.git
synced 2024-09-03 18:26:29 +02:00
Add user
This commit is contained in:
parent
5b0e7fc69e
commit
a8a1d534d4
5 changed files with 60 additions and 11 deletions
|
@ -7,3 +7,15 @@ YNH_PHP_VERSION="7.3"
|
||||||
extra_php_dependencies="php-geoip php${YNH_PHP_VERSION}-cli"
|
extra_php_dependencies="php-geoip php${YNH_PHP_VERSION}-cli"
|
||||||
|
|
||||||
lang="fr_FR.UTF-8 en_US.UTF-8 it_IT.UTF-8"
|
lang="fr_FR.UTF-8 en_US.UTF-8 it_IT.UTF-8"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# PERSONAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# EXPERIMENTAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# FUTURE OFFICIAL HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
|
@ -62,6 +62,14 @@ done
|
||||||
|
|
||||||
locale-gen
|
locale-gen
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring system user..." --weight=1
|
||||||
|
|
||||||
|
# Create a system user
|
||||||
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
#INSTALL SOURCES
|
#INSTALL SOURCES
|
||||||
#===============================================
|
#===============================================
|
||||||
|
@ -77,9 +85,9 @@ ln -s $final_path/lang/fr $final_path/lang/fr_FR
|
||||||
ln -s $final_path/lang/it $final_path/lang/it_IT
|
ln -s $final_path/lang/it $final_path/lang/it_IT
|
||||||
ln -s $final_path/www/template-exemple $final_path/template-exemple
|
ln -s $final_path/www/template-exemple $final_path/template-exemple
|
||||||
|
|
||||||
#chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
#chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
#chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A MYSQL DATABASE
|
||||||
|
@ -109,7 +117,6 @@ yunohost tools regen-conf postfix
|
||||||
#create the virtual aliases file
|
#create the virtual aliases file
|
||||||
touch $final_path/var/virtual
|
touch $final_path/var/virtual
|
||||||
postmap $final_path/var/virtual
|
postmap $final_path/var/virtual
|
||||||
chown -R www-data:www-data $final_path
|
|
||||||
|
|
||||||
#create an alias for deleted junk adresses
|
#create an alias for deleted junk adresses
|
||||||
cp /etc/aliases /etc/aliases.emailpoubelle.bak #backup it
|
cp /etc/aliases /etc/aliases.emailpoubelle.bak #backup it
|
||||||
|
|
|
@ -85,4 +85,16 @@ yunohost tools regen-conf postfix
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
ynh_systemd_action --service_name=postfix --action=reload
|
ynh_systemd_action --service_name=postfix --action=reload
|
||||||
|
|
||||||
ynh_script_progression --message="Removal of $app completed"
|
#=================================================
|
||||||
|
# REMOVE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing the dedicated system user..."
|
||||||
|
|
||||||
|
# Delete a system user
|
||||||
|
ynh_system_user_delete --username=$app
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_script_progression --message="Removal of $app completed" --last
|
||||||
|
|
|
@ -48,6 +48,14 @@ test ! -d $final_path \
|
||||||
|
|
||||||
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RECREATE THE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||||
|
|
||||||
|
# Create the dedicated user (if not existing)
|
||||||
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -55,6 +63,10 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
ynh_restore_file --origin_path="$final_path"
|
||||||
|
|
||||||
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -106,7 +118,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reinstall cron job" --weight=1
|
ynh_script_progression --message="Reinstall cron job" --weight=1
|
||||||
|
|
||||||
ynh_restore_file "/etc/cron.d/$app"
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -67,6 +67,14 @@ if ynh_legacy_permissions_exists; then
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||||
|
|
||||||
|
# Create a dedicated user (if not existing)
|
||||||
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -112,11 +120,9 @@ cp -R ../sources/hooks/conf_regen/98-postfix_emailpoubelle /usr/share/yunohost/h
|
||||||
mv /etc/postfix/main.cf /etc/postfix/main.cf.emailpoubelle.bak
|
mv /etc/postfix/main.cf /etc/postfix/main.cf.emailpoubelle.bak
|
||||||
yunohost tools regen-conf postfix -f
|
yunohost tools regen-conf postfix -f
|
||||||
|
|
||||||
#=================================================
|
chmod 750 "$final_path"
|
||||||
# SECURE FILES AND DIRECTORIES
|
chmod -R o-rwx "$final_path"
|
||||||
#=================================================
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
chown -R www-data:www-data $final_path
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD SERVICES
|
# RELOAD SERVICES
|
||||||
|
|
Loading…
Add table
Reference in a new issue