1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
This commit is contained in:
ericgaspar 2020-09-17 08:37:00 +02:00
parent e23e0e2df7
commit fd5ee72906
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 27 additions and 35 deletions

View file

@ -1,5 +1,7 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
alias __FINALPATH__/; alias __FINALPATH__/;
if ($scheme = http) { if ($scheme = http) {
@ -10,9 +12,9 @@ location __PATH__/ {
try_files $uri $uri/ /index.php; try_files $uri $uri/ /index.php;
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
if ($request_uri ~ "\/movim\/\?infos") { #if ($request_uri ~ "\/movim\/\?infos") {
return 403; # return 403;
} #}
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php__PHPVERSION__-fpm-__NAME__.sock;
@ -39,22 +41,7 @@ location __PATH__/ {
proxy_send_timeout 14400s; proxy_send_timeout 14400s;
# (14400s is 4h) # (14400s is 4h)
} }
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }
location ~ /\.ht {
deny all;
}
location ^~ /movim/log/ {
return 403;
}
location ^~ /movim/config/ {
return 403;
}
location ^~ /movim/?infos {
return 403;
}

View file

@ -7,9 +7,12 @@ Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__FINALPATH__ WorkingDirectory=__FINALPATH__
ExecStart=/usr/bin/php daemon.php start --url=https://__DOMAIN__/__PATH__ --port=__PORT__ ExecStart=/usr/bin/php __FINALPATH__/daemon.php start --url=https://__DOMAIN__/__PATH__ --port=__PORT__
StandardOutput=syslog StandardOutput=syslog
SyslogIdentifier=__APP__ SyslogIdentifier=__APP__
PIDFile=/run/movim.pid PIDFile=/run/movim.pid
Restart=on-failure Restart=on-failure
RestartSec=10 RestartSec=10
[Install]
WantedBy=multi-user.target

View file

@ -61,13 +61,13 @@ ynh_app_setting_set --app=$app --key=ssoenabled --value=$ssoenabled
ynh_script_progression --message="Configuring firewall..." --weight=2 ynh_script_progression --message="Configuring firewall..." --weight=2
# Find a free port # Find a free port
port=$(ynh_find_port 9537) port=$(ynh_find_port --port=9537)
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --time --weight=1 ynh_script_progression --message="Installing dependencies..." --weight=1
# Install packages # Install packages
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -93,7 +93,7 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --datab
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --time --weight=1 ynh_script_progression --message="Setting up source files..." --weight=4
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
@ -103,7 +103,7 @@ git clone https://github.com/movim/movim.git "$final_path" --quiet
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." --time --weight=1 ynh_script_progression --message="Configuring NGINX web server..." --weight=11
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -111,7 +111,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." --time --weight=1 ynh_script_progression --message="Configuring system user..." --weight=3
# Create a system user # Create a system user
ynh_system_user_create --username=$app ynh_system_user_create --username=$app
@ -119,7 +119,7 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
#ynh_replace_string --match_string="YHTZ" --replace_string="$timezone" --target_file=../conf/php-fpm.conf #ynh_replace_string --match_string="YHTZ" --replace_string="$timezone" --target_file=../conf/php-fpm.conf
@ -130,7 +130,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
# SET CONFIGURATION FILE # SET CONFIGURATION FILE
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Modifying a config file..." --weight=1
cp ../conf/db.example.inc.php $final_path/config/db.inc.php cp ../conf/db.example.inc.php $final_path/config/db.inc.php
@ -204,12 +204,14 @@ ynh_add_systemd_config
# find "${final_path}/" -type d -print0 | xargs -0 chmod 0755 # find "${final_path}/" -type d -print0 | xargs -0 chmod 0755
# chmod 400 "${final_path}/config/db.inc.php" # chmod 400 "${final_path}/config/db.inc.php"
chown www-data $final_path && chown www-data $final_path/public && chmod u+rwx $final_path chown www-data $final_path
chown www-data $final_path/public
chmod u+rwx $final_path
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log" yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log"
@ -238,7 +240,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -246,4 +248,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --time --last ynh_script_progression --message="Installation of $app completed" --last

View file

@ -79,7 +79,7 @@ chown -R root: $final_path
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -126,9 +126,9 @@ ynh_systemd_action --service_name=$app --action="start" #--log_path="/var/log/$a
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 ynh_script_progression --message="Reloading nginx web server and PHP-FPM..." --time --weight=1
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================

View file

@ -204,7 +204,7 @@ fi
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_replace_string --match_string="__URL__" --replace_string="${domain}${path_url}" --target_file=../conf/systemd.service # ynh_replace_string --match_string="__URL__" --replace_string="${domain}${path_url}" --target_file=../conf/systemd.service
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service
ynh_add_systemd_config ynh_add_systemd_config