1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00
This commit is contained in:
ericgaspar 2021-11-21 12:30:06 +01:00
parent 37168da572
commit a93ec8dda9
No known key found for this signature in database
GPG key ID: 574F281483054D44
8 changed files with 58 additions and 36 deletions

View file

@ -3,4 +3,3 @@ SOURCE_SUM=90ca90c4afa37dadc8a4743b5cb111b20cda5f983ce073c2c0bebdce64fa822a
SOURCE_SUM_PRG=sha256sum
ARCH_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=

View file

@ -7,30 +7,24 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
# Path to source
alias __FINALPATH__/;
# Path to source
alias __FINALPATH__/;
index index.php;
if (!-e $request_filename)
{
rewrite ^(.+)$ __PATH__/index.php?q=$1 last;
}
index index.php;
if (!-e $request_filename) {
rewrite ^(.+)$ __PATH__/index.php?q=$1 last;
}
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
client_max_body_size 30m;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
client_max_body_size 30m;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;

View file

@ -24,7 +24,7 @@
"email": "maniackc_dev@crudelis.fr"
}],
"requirements": {
"yunohost": ">= 4.2.4"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [
@ -36,8 +36,7 @@
"install" : [
{
"name": "domain",
"type": "domain",
"example": "domain.org"
"type": "domain"
},
{
"name": "path",
@ -47,8 +46,7 @@
},
{
"name": "admin",
"type": "user",
"example": "john"
"type": "user"
},
{
"name": "language",

View file

@ -6,7 +6,7 @@
YNH_PHP_VERSION="7.3"
extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-ssh2 php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-ldap"
pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-ssh2 php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-ldap"
#=================================================
# EXPERIMENTAL HELPERS

View file

@ -59,12 +59,19 @@ ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1
ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# CREATE A MYSQL DATABASE
#=================================================
ynh_script_progression --message="Creating a MySQL database..."
ynh_script_progression --message="Creating a MySQL database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
@ -108,7 +115,7 @@ else
usage=high
fi
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$usage --footprint=medium --package="$extra_php_dependencies"
ynh_add_fpm_config --usage=$usage --footprint=medium
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
@ -120,7 +127,7 @@ ynh_script_progression --message="Configuring WordPress..."
cp ../conf/wp-config.php $final_path/wp-config.php
# Change variables in Wordpress configuration
ynh_replace_string --match_string="__DB_USER__" --replace_string=$db_name --target_file=$final_path/wp-config.php
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file=$final_path/wp-config.php
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$final_path/wp-config.php
for i in 1 2 3 4 5 6 7 8

View file

@ -30,10 +30,18 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=2
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..."
ynh_script_progression --message="Removing app main directory..." --weight=2
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -41,7 +49,7 @@ ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..."
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config
ynh_remove_nginx_config

View file

@ -99,7 +99,7 @@ chmod 640 $final_path/wp-config.php
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies"
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
#=================================================
# RESTORE THE FAIL2BAN CONFIGURATION
@ -110,9 +110,18 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE CRON
#=================================================
ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file "/etc/cron.d/$app"

View file

@ -183,6 +183,13 @@ then
ynh_add_nginx_config
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -200,7 +207,7 @@ if [ $overwrite_phpfpm -eq 1 ]
then
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies"
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
fi
#=================================================