mirror of
https://github.com/YunoHost-Apps/gitlab_ynh.git
synced 2024-09-03 18:36:35 +02:00
Use a new port for sidekiq
This commit is contained in:
parent
9727fd0ae9
commit
5874faf0f0
4 changed files with 16 additions and 6 deletions
|
@ -705,7 +705,7 @@ unicorn['port'] = __UNICORN_PORT__
|
||||||
sidekiq['concurrency'] = 5
|
sidekiq['concurrency'] = 5
|
||||||
# sidekiq['metrics_enabled'] = true
|
# sidekiq['metrics_enabled'] = true
|
||||||
# sidekiq['listen_address'] = "localhost"
|
# sidekiq['listen_address'] = "localhost"
|
||||||
# sidekiq['listen_port'] = 8082
|
sidekiq['listen_port'] = __SIDEKIQ_PORT__
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## gitlab-shell
|
## gitlab-shell
|
||||||
|
|
|
@ -31,6 +31,7 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
config_path=$(ynh_app_setting_get $app config_path)
|
config_path=$(ynh_app_setting_get $app config_path)
|
||||||
port=$(ynh_app_setting_get "$app" web_port)
|
port=$(ynh_app_setting_get "$app" web_port)
|
||||||
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
|
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
|
||||||
|
portSidekiq=$(ynh_app_setting_get "$app" sidekiq_port)
|
||||||
unicorn_worker_processes=$(ynh_app_setting_get "$app" unicorn_worker_processes)
|
unicorn_worker_processes=$(ynh_app_setting_get "$app" unicorn_worker_processes)
|
||||||
client_max_body_size=$(ynh_app_setting_get "$app" client_max_body_size)
|
client_max_body_size=$(ynh_app_setting_get "$app" client_max_body_size)
|
||||||
|
|
||||||
|
@ -117,6 +118,7 @@ ynh_replace_string "__UNICORN_PORT__" "$portUnicorn" "$config_path/gitlab.rb"
|
||||||
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$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_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
|
||||||
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
||||||
|
ynh_replace_string "__SIDEKIQ_PORT__" "$portSidekiq" "$config_path/gitlab.rb"
|
||||||
|
|
||||||
ynh_store_file_checksum "$config_path/gitlab.rb"
|
ynh_store_file_checksum "$config_path/gitlab.rb"
|
||||||
|
|
||||||
|
|
|
@ -92,19 +92,18 @@ ynh_app_setting_set $app client_max_body_size $client_max_body_size
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIND AND OPEN A PORT
|
# FIND A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Configuring firewall..."
|
ynh_print_info "Find internal port..."
|
||||||
|
|
||||||
# Find free ports
|
# Find free ports
|
||||||
port=$(ynh_find_port 8080)
|
port=$(ynh_find_port 8080)
|
||||||
portUnicorn=$(ynh_find_port $(($port + 1)))
|
portUnicorn=$(ynh_find_port $(($port + 1)))
|
||||||
|
portSidekiq=$(ynh_find_port $(($portUnicorn + 1)))
|
||||||
|
|
||||||
# Open these port
|
|
||||||
yunohost firewall allow --no-upnp TCP $port 2>&1
|
|
||||||
yunohost firewall allow --no-upnp TCP $portUnicorn 2>&1
|
|
||||||
ynh_app_setting_set $app web_port $port
|
ynh_app_setting_set $app web_port $port
|
||||||
ynh_app_setting_set $app unicorn_port $portUnicorn
|
ynh_app_setting_set $app unicorn_port $portUnicorn
|
||||||
|
ynh_app_setting_set $app sidekiq_port $portSidekiq
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
|
@ -129,6 +128,7 @@ ynh_replace_string "__UNICORN_PORT__" "$portUnicorn" "$config_path/gitlab.rb"
|
||||||
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$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_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
|
||||||
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
||||||
|
ynh_replace_string "__SIDEKIQ_PORT__" "$portSidekiq" "$config_path/gitlab.rb"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
|
|
|
@ -27,6 +27,7 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
config_path=$(ynh_app_setting_get $app config_path)
|
config_path=$(ynh_app_setting_get $app config_path)
|
||||||
port=$(ynh_app_setting_get "$app" web_port)
|
port=$(ynh_app_setting_get "$app" web_port)
|
||||||
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
|
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
|
||||||
|
portSidekiq=$(ynh_app_setting_get "$app" sidekiq_port)
|
||||||
architecture=$(ynh_app_setting_get "$app" architecture)
|
architecture=$(ynh_app_setting_get "$app" architecture)
|
||||||
unicorn_worker_processes=$(ynh_app_setting_get "$app" unicorn_worker_processes)
|
unicorn_worker_processes=$(ynh_app_setting_get "$app" unicorn_worker_processes)
|
||||||
client_max_body_size=$(ynh_app_setting_get "$app" client_max_body_size)
|
client_max_body_size=$(ynh_app_setting_get "$app" client_max_body_size)
|
||||||
|
@ -71,6 +72,12 @@ if [ -z "$unicorn_worker_processes" ]; then
|
||||||
ynh_app_setting_set $app unicorn_worker_processes $unicorn_worker_processes
|
ynh_app_setting_set $app unicorn_worker_processes $unicorn_worker_processes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$portSidekiq" ]; then
|
||||||
|
portSidekiq=$(ynh_find_port $(($portUnicorn + 1)))
|
||||||
|
|
||||||
|
ynh_app_setting_set $app sidekiq_port $portSidekiq
|
||||||
|
fi
|
||||||
|
|
||||||
# If architecture doesn't exist, create it
|
# If architecture doesn't exist, create it
|
||||||
if [ -z "$architecture" ]; then
|
if [ -z "$architecture" ]; then
|
||||||
# Detect the system architecture
|
# Detect the system architecture
|
||||||
|
@ -177,6 +184,7 @@ ynh_replace_string "__UNICORN_PORT__" "$portUnicorn" "$config_path/gitlab.rb"
|
||||||
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$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_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
|
||||||
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
||||||
|
ynh_replace_string "__SIDEKIQ_PORT__" "$portSidekiq" "$config_path/gitlab.rb"
|
||||||
|
|
||||||
ynh_store_file_checksum "$config_path/gitlab.rb"
|
ynh_store_file_checksum "$config_path/gitlab.rb"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue