1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab_ynh.git synced 2024-09-03 18:36:35 +02:00

Merge pull request #40 from YunoHost-Apps/client_max_body_size

Add default client_max_body_size
This commit is contained in:
Kayou 2019-04-01 19:06:05 +02:00 committed by GitHub
commit 0fadaefc36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 4 deletions

View file

@ -20,6 +20,7 @@ EOS
nginx['listen_port'] = __PORT__
nginx['listen_https'] = false
nginx['listen_addresses'] = ["0.0.0.0", "[::]"] # listen on all IPv4 and IPv6 addresses
nginx['client_max_body_size'] = '__CLIENT_MAX_BODY_SIZE__'
unicorn['port'] = __PORTUNICORN__

View file

@ -1,9 +1,11 @@
location __PATH__/ {
proxy_pass http://localhost:__PORT__;
proxy_pass http://localhost:__PORT__;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size __CLIENT_MAX_BODY_SIZE__;
include conf.d/yunohost_panel.conf.inc;
proxy_set_header Accept-Encoding "";
}

View file

@ -32,6 +32,7 @@ config_path=$(ynh_app_setting_get $app config_path)
port=$(ynh_app_setting_get "$app" web_port)
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
unicorn_worker_processes=$(ynh_app_setting_get "$app" unicorn_worker_processes)
client_max_body_size=$(ynh_app_setting_get "$app" client_max_body_size)
#=================================================
# CHECK THE SYNTAX OF THE PATHS
@ -79,7 +80,7 @@ if [ $change_path -eq 1 ]; then
domain="$old_domain"
path_url="$new_path"
# Create a dedicated nginx config
ynh_add_nginx_config
ynh_add_nginx_config $client_max_body_size
fi
# Change the domain for nginx
@ -113,6 +114,7 @@ ynh_replace_string "__GENERATED_EXTERNAL_URL__" "https://$domain${path_url%/}" "
ynh_replace_string "__PORT__" "$port" "$config_path/gitlab.rb"
ynh_replace_string "__PORTUNICORN__" "$portUnicorn" "$config_path/gitlab.rb"
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$config_path/gitlab.rb"
ynh_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
ynh_store_file_checksum "$config_path/gitlab.rb"

View file

@ -66,6 +66,9 @@ else
unicorn_worker_processes=2
fi
# Could be an option?
client_max_body_size="250m"
path_url=$(ynh_normalize_url_path $path_url)
# Register (book) web path
@ -84,6 +87,7 @@ ynh_app_setting_set $app final_path $final_path
ynh_app_setting_set $app config_path $config_path
ynh_app_setting_set $app architecture $architecture
ynh_app_setting_set $app unicorn_worker_processes $unicorn_worker_processes
ynh_app_setting_set $app client_max_body_size $client_max_body_size
#=================================================
# STANDARD MODIFICATIONS
@ -122,6 +126,7 @@ ynh_replace_string "__GENERATED_EXTERNAL_URL__" "https://$domain${path_url%/}" "
ynh_replace_string "__PORT__" "$port" "$config_path/gitlab.rb"
ynh_replace_string "__PORTUNICORN__" "$portUnicorn" "$config_path/gitlab.rb"
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$config_path/gitlab.rb"
ynh_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
@ -168,7 +173,7 @@ fi
ynh_print_info "Configuring nginx web server..."
# Create a dedicated nginx config
ynh_add_nginx_config
ynh_add_nginx_config $client_max_body_size
#=================================================
# SPECIFIC SETUP

View file

@ -29,6 +29,7 @@ port=$(ynh_app_setting_get "$app" web_port)
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
architecture=$(ynh_app_setting_get "$app" architecture)
unicorn_worker_processes=$(ynh_app_setting_get "$app" unicorn_worker_processes)
client_max_body_size=$(ynh_app_setting_get "$app" client_max_body_size)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
@ -86,6 +87,11 @@ if [ -z "$architecture" ]; then
ynh_app_setting_set $app architecture $architecture
fi
# If client_max_body_size doesn't exist, create it
if [ -z "$client_max_body_size" ]; then
client_max_body_size="250m"
fi
# If domain doesn't exist, retrieve it
if [ -z "$domain" ]; then
domain=$(grep "external_url" "/etc/gitlab/gitlab.rb" | cut -d'/' -f3) # retrieve $domain from conf file
@ -168,6 +174,7 @@ ynh_replace_string "__GENERATED_EXTERNAL_URL__" "https://$domain${path_url%/}" "
ynh_replace_string "__PORT__" "$port" "$config_path/gitlab.rb"
ynh_replace_string "__PORTUNICORN__" "$portUnicorn" "$config_path/gitlab.rb"
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$config_path/gitlab.rb"
ynh_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
ynh_store_file_checksum "$config_path/gitlab.rb"
@ -210,7 +217,7 @@ fi
ynh_print_info "Configuring nginx web server..."
# Create a dedicated nginx config
ynh_add_nginx_config
ynh_add_nginx_config $client_max_body_size
#=================================================
# GENERIC FINALIZATION