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

WIP gitlab pages

This commit is contained in:
Kay0u 2023-12-27 23:30:00 +01:00
parent 38002d202f
commit 003ff55341
No known key found for this signature in database
GPG key ID: AE1DCADB6415A156
7 changed files with 48 additions and 15 deletions

View file

@ -1892,8 +1892,8 @@ nginx['listen_https'] = false
################################################################################
##! Define to enable GitLab Pages
# pages_external_url "http://pages.example.com/"
# gitlab_pages['enable'] = false
pages_external_url "https://__PAGES_URL__/"
gitlab_pages['enable'] = __PAGES_ENABLE__
##! Configure to expose GitLab Pages on external IP address, serving the HTTP
# gitlab_pages['external_http'] = []
@ -1939,7 +1939,7 @@ nginx['listen_https'] = false
# gitlab_pages['sentry_environment'] = 'production'
##! Listen for requests forwarded by reverse proxy
# gitlab_pages['listen_proxy'] = "localhost:8090"
gitlab_pages['listen_proxy'] = "localhost:__PORT_PAGES__"
# gitlab_pages['redirect_http'] = true
# gitlab_pages['use_http2'] = true
@ -2070,7 +2070,7 @@ nginx['listen_https'] = false
# }
# Experimental - Enable namespace in path
# gitlab_pages['namespace_in_path'] = false
gitlab_pages['namespace_in_path'] = true
################################################################################
## GitLab Pages NGINX
@ -2083,7 +2083,12 @@ nginx['listen_https'] = false
# `pages_nginx['some_setting']` and should be set separately.
# Below you can find settings that are exclusive to "GitLab Pages NGINX"
# pages_nginx['enable'] = true
pages_nginx['enable'] = true
pages_nginx['listen_https'] = false
pages_nginx['listen_http'] = true
pages_nginx['listen_port'] = __PORT_NGINX_PAGES__
pages_nginx['listen_addresses'] = ['127.0.0.1']
# gitlab_rails['pages_path'] = "/var/opt/gitlab/gitlab-rails/shared/pages"

View file

@ -53,6 +53,14 @@ ram.runtime = "2000M"
type = "boolean"
default = false
[install.pages_enable]
type = "boolean"
default = false
[install.pages_url]
type = "domain"
optional = true
[resources]
# [resources.sources]
# [resources.sources.main]
@ -77,6 +85,8 @@ ram.runtime = "2000M"
main.default = 8080
puma.default = 8081
sidekiq.default = 8082
pages.default = 8083
nginx_pages.default = 8084
[resources.apt]
packages = "openssh-server"

View file

@ -33,6 +33,14 @@ fi
# Could be an option?
client_max_body_size="250m"
# Remove https and http from page_url
# sets extended pattern matching options in the bash shell
shopt -s extglob
pages_url=${pages_url#http?(s)://}
shopt -u extglob
# Remove trailing /
pages_url=${pages_url%/}
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
@ -121,6 +129,9 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config client_max_body_size
# TODO: Get the app id, to be able to remove the right app in the remove scrip
yunohost app install redirect --label gitlab-pages --args "domain=$pages_url&path=/&redirect_type=public_proxy&redirect_path=http://127.0.0.1:$port_nginx_pages"
#=================================================
# SPECIFIC SETUP
#=================================================
@ -154,7 +165,7 @@ usermod -a -G "ssh.app" "git"
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/puma/current" "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-monitor/current" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current"
yunohost service add "gitlab-runsvdir" --log "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-exporter/current" "/var/log/$app/gitlab-kas/current" "/var/log/$app/gitlab-pages/current" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/application_json.log" "/var/log/$app/gitlab-rails/audit_json.log" "/var/log/$app/gitlab-rails/auth.log" "/var/log/$app/gitlab-rails/database_load_balancing.log" "/var/log/$app/gitlab-rails/exceptions_json.log" "/var/log/$app/gitlab-rails/graphql_json.log" "/var/log/$app/gitlab-rails/grpc.log" "/var/log/$app/gitlab-rails/importer.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/service_measurement.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/gitlab-rails/sidekiq_client.log" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/nginx/gitlab_pages_access.log" "/var/log/$app/nginx/gitlab_pages_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/puma/current" "/var/log/$app/puma/puma_stdout.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current" "/var/log/$app/sidekiq/current"
#=================================================
# RELOAD NGINX

View file

@ -51,6 +51,8 @@ ynh_script_progression --message="Removing NGINX web server configuration" --wei
# Remove the dedicated NGINX config
ynh_remove_nginx_config
yunohost app remove redirect
#=================================================
# SPECIFIC REMOVE
#=================================================

View file

@ -97,7 +97,7 @@ fi
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/puma/current" "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-monitor/current" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current"
yunohost service add "gitlab-runsvdir" --log "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-exporter/current" "/var/log/$app/gitlab-kas/current" "/var/log/$app/gitlab-pages/current" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/application_json.log" "/var/log/$app/gitlab-rails/audit_json.log" "/var/log/$app/gitlab-rails/auth.log" "/var/log/$app/gitlab-rails/database_load_balancing.log" "/var/log/$app/gitlab-rails/exceptions_json.log" "/var/log/$app/gitlab-rails/graphql_json.log" "/var/log/$app/gitlab-rails/grpc.log" "/var/log/$app/gitlab-rails/importer.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/service_measurement.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/gitlab-rails/sidekiq_client.log" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/nginx/gitlab_pages_access.log" "/var/log/$app/nginx/gitlab_pages_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/puma/current" "/var/log/$app/puma/puma_stdout.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current" "/var/log/$app/sidekiq/current"
#=================================================
# WAITING GITLAB

View file

@ -304,7 +304,7 @@ fi
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/puma/current" "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-monitor/current" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current"
yunohost service add "gitlab-runsvdir" --log "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-exporter/current" "/var/log/$app/gitlab-kas/current" "/var/log/$app/gitlab-pages/current" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/application_json.log" "/var/log/$app/gitlab-rails/audit_json.log" "/var/log/$app/gitlab-rails/auth.log" "/var/log/$app/gitlab-rails/database_load_balancing.log" "/var/log/$app/gitlab-rails/exceptions_json.log" "/var/log/$app/gitlab-rails/graphql_json.log" "/var/log/$app/gitlab-rails/grpc.log" "/var/log/$app/gitlab-rails/importer.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/service_measurement.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/gitlab-rails/sidekiq_client.log" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/nginx/gitlab_pages_access.log" "/var/log/$app/nginx/gitlab_pages_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/puma/current" "/var/log/$app/puma/puma_stdout.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current" "/var/log/$app/sidekiq/current"
#=================================================
# WAITING GITLAB

View file

@ -125,19 +125,24 @@ EOS"
sed -i "/^# EOS/r "<(echo "$ldap_conf") $conf_file
# Change ssh port
sed -i "s/# gitlab_rails\['gitlab_shell_ssh_port'\] = 22/gitlab_rails['gitlab_shell_ssh_port'] = __SSH_PORT__/" $conf_file
sed -i "s/^# gitlab_rails\['gitlab_shell_ssh_port'\] = 22/gitlab_rails['gitlab_shell_ssh_port'] = __SSH_PORT__/" $conf_file
# Change puma settings
sed -i "s/# puma\['port'\] = .*/puma['port'] = __PORT_PUMA__/" $conf_file
sed -i "s/^# puma\['port'\] = .*/puma['port'] = __PORT_PUMA__/" $conf_file
# Change sidekiq settings
sed -i "s/# sidekiq\['listen_port'\] = .*/sidekiq['listen_port'] = __PORT_SIDEKIQ__/" $conf_file
sed -i "s/^# sidekiq\['listen_port'\] = .*/sidekiq['listen_port'] = __PORT_SIDEKIQ__/" $conf_file
# Change nginx settings
sed -i "s/# nginx\['client_max_body_size'\] = .*/nginx['client_max_body_size'] = '__CLIENT_MAX_BODY_SIZE__'/" $conf_file
sed -i "s/# nginx\['listen_port'\] = .*/nginx['listen_port'] = __PORT__/" $conf_file
sed -i "s/# nginx\['listen_https'\] = .*/nginx['listen_https'] = false/" $conf_file
sed -i "s/^# nginx\['client_max_body_size'\] = .*/nginx['client_max_body_size'] = '__CLIENT_MAX_BODY_SIZE__'/" $conf_file
sed -i "s/^# nginx\['listen_port'\] = .*/nginx['listen_port'] = __PORT__/" $conf_file
sed -i "s/^# nginx\['listen_https'\] = .*/nginx['listen_https'] = false/" $conf_file
# Change modify kernel parameters settings
sed -i "s/# package\['modify_kernel_parameters'\] = .*/package['modify_kernel_parameters'] = __MODIFY_KERNEL_PARAMETERS__/" $conf_file
sed -i "s/^# package\['modify_kernel_parameters'\] = .*/package['modify_kernel_parameters'] = __MODIFY_KERNEL_PARAMETERS__/" $conf_file
# Change the gitlab page settings
sed -i "s/^# pages_external_url \".*\"/pages_external_url \"__PAGES_URL__\"/" $conf_file
sed -i "s/^# gitlab_pages\['enable'\] = .*/gitlab_pages\['enable'\] = __PAGES_ENABLE__/" $conf_file
sed -i "s/^# gitlab_pages\['namespace_in_path'\] = .*/gitlab_pages\['namespace_in_path'\] = true/" $conf_file
fi