mirror of
https://github.com/YunoHost-Apps/emailpoubelle_ynh.git
synced 2024-09-03 18:26:29 +02:00
Merge pull request #4 from Krakinou/Testing
include SQL correction and nginx correction
This commit is contained in:
commit
bc3f24c8e5
6 changed files with 25 additions and 7 deletions
|
@ -28,7 +28,7 @@ TODO :
|
||||||
|
|
||||||
[ ] remove new locale on remove
|
[ ] remove new locale on remove
|
||||||
|
|
||||||
[ ] Why the flag don't show??
|
[X] Why the flag don't show??
|
||||||
|
|
||||||
[X] Implement Admin panel
|
[X] Implement Admin panel
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ location YNH_EXAMPLE_PATH {
|
||||||
# Path to source
|
# Path to source
|
||||||
alias YNH_EXAMPLE_ALIAS ;
|
alias YNH_EXAMPLE_ALIAS ;
|
||||||
# Example PHP configuration
|
# Example PHP configuration
|
||||||
index index.php;
|
index www/index.php;
|
||||||
try_files $uri $uri/ index.php;
|
try_files $uri $uri/ index.php;
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"fr": "Créez des adresses email jetables qui redirigent les mails vers votre adresse réelle"
|
"fr": "Créez des adresses email jetables qui redirigent les mails vers votre adresse réelle"
|
||||||
},
|
},
|
||||||
"url": "https://framagit.org/kepon/emailPoubellePhp/",
|
"url": "https://framagit.org/kepon/emailPoubellePhp/",
|
||||||
"version": "2.0~ynh2",
|
"version": "2.0~ynh3",
|
||||||
"license": "Beerware",
|
"license": "Beerware",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "krakinou",
|
"name": "krakinou",
|
||||||
|
|
|
@ -74,6 +74,7 @@ ynh_replace_string "Template-exemple" "$domain" $final_path/www/index.php
|
||||||
#Temporaire - mettre en config
|
#Temporaire - mettre en config
|
||||||
ln -s $final_path/lang/fr $final_path/lang/fr_FR
|
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
|
||||||
|
|
||||||
|
|
||||||
#===============================================
|
#===============================================
|
||||||
|
@ -121,7 +122,7 @@ sudo newaliases
|
||||||
|
|
||||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||||
sudo sed -i "s@YNH_EXAMPLE_PATH@$path_url@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_PATH@$path_url@g" ../conf/nginx.conf
|
||||||
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path/www/@g" ../conf/nginx.conf
|
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
# Handle root path, avoid double slash.
|
# Handle root path, avoid double slash.
|
||||||
|
|
|
@ -63,6 +63,13 @@ if [[ $?==0 ]]; then
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#change nginx.conf as per https://forum.yunohost.org/t/need-help-on-nginx-conf-cannot-access-resources/6342
|
||||||
|
ynh_replace_string "alias $finalpath/www/ ;" "alias $finalpath/ ;" /etc/yunohost/$domain.d/$app.conf
|
||||||
|
ynh_replace_string "index index.php;" "index www/ndex.php;" /etc/yunohost/$domain.d/$app.conf
|
||||||
|
|
||||||
|
#correct template name in index.php
|
||||||
|
ynh_replace_string "Template-exemple" "$domain" $final_path/www/index.php
|
||||||
|
|
||||||
#mysqlpwd setting was implemented in ynh2 - check if saved and if not implement
|
#mysqlpwd setting was implemented in ynh2 - check if saved and if not implement
|
||||||
db_pass=$(ynh_app_setting_get $app mysqlpwd)
|
db_pass=$(ynh_app_setting_get $app mysqlpwd)
|
||||||
if [ -z $db_pass]; then
|
if [ -z $db_pass]; then
|
||||||
|
@ -83,11 +90,15 @@ cp ../src/README.md $final_path/README.md
|
||||||
cp ../src/CHANGELOG.md $final_path/CHANGELOG.md
|
cp ../src/CHANGELOG.md $final_path/CHANGELOG.md
|
||||||
cp ../src/conf-dist.php $final_path/conf-dist.php
|
cp ../src/conf-dist.php $final_path/conf-dist.php
|
||||||
cp ../conf/index_source.php $final_path/www/index.php
|
cp ../conf/index_source.php $final_path/www/index.php
|
||||||
|
test -e $final_path/template-exemple
|
||||||
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
ln -s $final_path/www/template-exemple $final_path/template-exemple
|
||||||
|
fi
|
||||||
#Temporaire - mettre en config
|
#Temporaire - mettre en config
|
||||||
ln -s $final_path/lang/fr $final_path/lang/fr_FR
|
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
|
||||||
|
|
||||||
|
|
||||||
chown -R www-data:www-data $final_path
|
chown -R www-data:www-data $final_path
|
||||||
|
|
||||||
#adding php-cli for cron
|
#adding php-cli for cron
|
||||||
|
|
|
@ -79,7 +79,13 @@ function AjouterAlias($status, $alias,$email, $life, $comment) {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
UpdateVirtualDB();
|
UpdateVirtualDB();
|
||||||
|
if (preg_match('/^sqlite/', DB)) {
|
||||||
return $dbco->lastInsertId();
|
return $dbco->lastInsertId();
|
||||||
|
} else {
|
||||||
|
$stmt = $dbco->query("SELECT LAST_INSERT_ID()");
|
||||||
|
return $stmt->fetchColumn();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete email
|
// delete email
|
||||||
|
|
Loading…
Reference in a new issue