1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/emailpoubelle_ynh.git synced 2024-09-03 18:26:29 +02:00

Mise à niveau pour package check

This commit is contained in:
Krakinou 2019-04-13 15:11:19 +02:00
parent 4e16de44b9
commit 71ce4c7276
5 changed files with 30 additions and 26 deletions

View file

@ -51,7 +51,10 @@
"en": "Choose an admin user for emailpoubelle",
"fr": "Choisissez un administrateur pour emailpoubelle"
},
"example": "homer"
"example": "homer",
"help": {
"en": "Admin user can access to the control panel, block and remove all redirection and reset any settings",
"fr": "L'administrateur peut accéder au panneau de controle, bloquer et supprimer les redirections ainsi que réinitialiser les réglages"},
},
{
"name": "password",
@ -69,7 +72,10 @@
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": false
"default": false,
"help": {
"en": "The app can be accessed outside Yunohost and anyone will be able to create a trash email adress"
"fr": "L'application sera accessible en dehors de yunohost et n'importe qui pourra y créer une adresse poubelle"},
}
]
}

View file

@ -71,7 +71,7 @@ locale-gen
ynh_print_info "Downloading sources to $final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
sudo cp ../conf/index_source.php $final_path/www/index.php
cp ../conf/index_source.php $final_path/www/index.php
ynh_replace_string "Template-exemple" "$domain" $final_path/www/index.php
#Temporaire - mettre en config
@ -92,7 +92,7 @@ ynh_app_setting_set $app mysqlpwd $db_pwd
ynh_print_ON
#configuring with given settings
sudo cp $final_path/conf-dist.php $final_path/conf.php
cp $final_path/conf-dist.php $final_path/conf.php
#Update various conf : domain, database, user and password
ynh_replace_string "exemple.fr" "$domain" $final_path/conf.php
ynh_replace_string "exemple.com" "$domain" $final_path/conf.php
@ -108,7 +108,7 @@ ynh_replace_string "motdepassedefou" "$db_pwd" $f
ynh_replace_string "define('ADMIN_PASSWORD', 'admin');" "define('ADMIN_PASSWORD', '$password');" $final_path/conf.php
ynh_print_ON
#setting conf file not world-readable (dude, there is a plain-text password !)
sudo chmod o-r $final_path/conf.php
chmod o-r $final_path/conf.php
#initialize database (databasename = db_user)
ynh_print_OFF
ynh_mysql_create_db $db_user $db_user $db_pwd
@ -120,18 +120,18 @@ cp -R ../sources/hooks/conf_regen/98-postfix_emailpoubelle /usr/share/yunohost/h
yunohost service regen-conf postfix
#create the virtual aliases file
sudo touch $final_path/var/virtual
sudo postmap $final_path/var/virtual
sudo chown -R www-data:www-data $final_path
touch $final_path/var/virtual
postmap $final_path/var/virtual
chown -R www-data:www-data $final_path
#create an alias for deleted junk adresses
sudo cp /etc/aliases /etc/aliases.emailpoubelle.bak #backup it
sudo echo "devnull:/dev/null" | sudo tee -a /etc/aliases
sudo newaliases
cp /etc/aliases /etc/aliases.emailpoubelle.bak #backup it
echo "devnull:/dev/null" | tee -a /etc/aliases
newaliases
#adding cronjob for removing expired email addresses
sudo cp -a ../conf/$app.cron /etc/cron.d/$app
sudo chmod 644 /etc/cron.d/$app
cp -a ../conf/$app.cron /etc/cron.d/$app
chmod 644 /etc/cron.d/$app
# Create a dedicated nginx config
ynh_add_nginx_config
@ -150,6 +150,6 @@ fi
# Restart services
systemctl reload nginx
systemctl reload postfix
sudo service php* reload
sudo yunohost app ssowatconf
service php* reload
yunohost app ssowatconf

View file

@ -4,27 +4,25 @@ source _common.sh
source /usr/share/yunohost/helpers
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
db_user==$db_name
root_pwd=$(sudo cat /etc/yunohost/mysql)
#remove php-geoip
ynh_remove_app_dependencies
#removing emailpoubelle database
ynh_mysql_remove_db $db_user $db_name
#removing emailpoubelle directory
sudo rm -rf /var/www/emailpoubelle
ynh_secure_remove /var/www/$app
#removing nginx conf
sudo rm -f /etc/nginx/conf.d/$domain.d/emailpoubelle.conf
ynh_remove_nginx_config
#removing aliases
sudo sed -i "/devnull:\/dev\/null/d" /etc/aliases
sudo newaliases
sed -i "/devnull:\/dev\/null/d" /etc/aliases
newaliases
# Remove hook for postfix conf
ynh_secure_remove "/usr/share/yunohost/hooks/conf_regen/98-postfix_emailpoubelle"
#remove cronjob
sudo rm -f /etc/cron.d/emailpoubelle
rm -f /etc/cron.d/emailpoubelle
yunohost service regen-conf postfix
sudo service nginx reload
sudo yunohost app ssowatconf
service nginx reload
yunohost app ssowatconf

View file

@ -96,7 +96,7 @@ ynh_restore_file "/etc/cron.d/$app"
#=================================================
# RELOAD NGINX & ALIASES
#=================================================
sudo newaliases
newaliases
systemctl reload nginx
systemctl restart php7.0-fpm
systemctl reload postfix

View file

@ -126,4 +126,4 @@ chown -R www-data:www-data $final_path
systemctl restart php7.0-fpm
systemctl reload nginx
systemctl reload postfix
sudo yunohost app ssowatconf
yunohost app ssowatconf