1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/libreerp_ynh.git synced 2024-09-03 19:36:13 +02:00

Apply last example_ynh

This commit is contained in:
yalh76 2022-06-15 02:10:40 +02:00
parent 54f2820459
commit 2772f4fd23
6 changed files with 74 additions and 65 deletions

View file

@ -4,9 +4,10 @@
domain="domain.tld"
version="14"
oca=0
admin_password="testpassw0rD"
lang="en_US"
tz="Etc/GMT"
admin="john"
admin_password="testpassw0rD"
; Checks
pkg_linter=1
setup_sub_dir=0

View file

@ -1,51 +1,51 @@
location / {
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
try_files $uri @__APP__;
try_files $uri @__APP__;
}
location @__APP__ {
proxy_pass http://127.0.0.1:__PORT__;
client_max_body_size 50M;
client_body_timeout 60m;
fastcgi_read_timeout 60m;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
location @__APP__ {
proxy_pass http://127.0.0.1:__PORT__;
client_max_body_size 50M;
client_body_timeout 60m;
fastcgi_read_timeout 60m;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
}
location /longpolling {
proxy_pass http://127.0.0.1:__PORT_CHAT__;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
proxy_pass http://127.0.0.1:__PORT_CHAT__;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
}
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
}

View file

@ -37,10 +37,6 @@
"name": "domain",
"type": "domain"
},
{
"name": "admin",
"type": "user"
},
{
"name": "version",
"type": "string",
@ -60,14 +56,6 @@
"fr": "Désirez vous installer OCA à la place des sources de LibreERP (pas encore implémenté)"
}
},
{
"name": "admin_password",
"type": "password",
"ask": {
"en": "Choose a strong master admin password",
"fr": "Choisissez un mot de passe maître fort pour l'administration"
}
},
{
"name": "lang",
"type": "string",
@ -86,6 +74,18 @@
"fr": "Choisissez un fuseau horaire"
},
"default": "Etc/UTC"
},
{
"name": "admin",
"type": "user"
},
{
"name": "admin_password",
"type": "password",
"ask": {
"en": "Choose a strong master admin password",
"fr": "Choisissez un mot de passe maître fort pour l'administration"
}
}
]
}

View file

@ -25,12 +25,12 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
admin=$YNH_APP_ARG_ADMIN
export app_version=$YNH_APP_ARG_VERSION
oca=$YNH_APP_ARG_OCA
admin_password=$YNH_APP_ARG_ADMIN_PASSWORD
lang=$YNH_APP_ARG_LANG
tz=$YNH_APP_ARG_TZ
admin=$YNH_APP_ARG_ADMIN
admin_password=$YNH_APP_ARG_ADMIN_PASSWORD
export app=$YNH_APP_INSTANCE_NAME

View file

@ -57,13 +57,6 @@ test ! -d $final_path \
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@ -95,6 +88,13 @@ ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# ADD SWAP
#=================================================

View file

@ -100,6 +100,14 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================