From 0406947a698cd7b1380c3a91616aa4fcd957370e Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 3 Mar 2023 11:24:16 +0100 Subject: [PATCH 01/26] convert packaging v1 to v2 [untested] --- check_process | 31 ------------- manifest.json | 66 ---------------------------- manifest.toml | 72 +++++++++++++++++++++++++++++++ scripts/_common.sh | 6 --- scripts/backup | 22 +--------- scripts/change_url | 87 +++---------------------------------- scripts/install | 69 +---------------------------- scripts/remove | 28 +----------- scripts/restore | 42 +----------------- scripts/upgrade | 105 +-------------------------------------------- tests.toml | 8 ++++ 11 files changed, 92 insertions(+), 444 deletions(-) delete mode 100644 check_process delete mode 100644 manifest.json create mode 100644 manifest.toml create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index 83f543a..0000000 --- a/check_process +++ /dev/null @@ -1,31 +0,0 @@ -# See here for more informations -# https://github.com/YunoHost/package_check#syntax-check_process-file -;; Test complet - ; Manifest - domain="domain.tld" (DOMAIN) - path="/gitlab" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) - use_web_account=0 - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - upgrade=1 from_commit=2cc84310aeff7055342b445c1aee01d4183d5ae2 - upgrade=1 from_commit=7c352aff3fb13fc425d76716477c28db5d54ac99 - backup_restore=1 - multi_instance=0 - port_already_use=1 (8080) - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=2cc84310aeff7055342b445c1aee01d4183d5ae2 - name=11.6.3 - ; commit=7c352aff3fb13fc425d76716477c28db5d54ac99 - name=12.9.2 diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 30a7dbb..0000000 --- a/manifest.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "GitLab", - "id": "gitlab", - "packaging_format": 1, - "version": "15.9.1~ynh1", - "description": { - "en": "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features", - "fr": "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD" - }, - "url": "https://gitlab.com", - "upstream": { - "license": "MIT", - "website": "https://gitlab.com", - "demo": "https://gitlab.com/explore", - "admindoc": "https://docs.gitlab.com/", - "code": "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab", - "cpe": "cpe:2.3:a:gitlab:gitlab" - }, - "license": "MIT", - "maintainer": { - "name": "kay0u", - "email": "pierre@kayou.io" - }, - "requirements": { - "yunohost": ">= 4.2.3" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "default": "/gitlab" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If your GitLab instance is public, anyone can see your public repositories.", - "fr": "Si votre instance GitLab est publique, tout le monde pourra voir vos dépôts publics." - }, - "default": true - }, - { - "name": "use_web_account", - "type": "boolean", - "ask": { - "en": "Authorize account creation from GitLab web interface", - "fr": "Autoriser la création de compte depuis l'interface web de GitLab ?" - }, - "default": false - } - ] - } -} \ No newline at end of file diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..4098df1 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,72 @@ +packaging_format = 2 + +id = "gitlab" +name = "GitLab" +description.en = "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features" +description.fr = "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD" + +version = "15.9.1~ynh1" + +maintainers = ["kay0u"] + +[upstream] +license = "MIT" +website = "https://gitlab.com" +demo = "https://gitlab.com/explore" +admindoc = "https://docs.gitlab.com/" +code = "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 4.2.3" +architectures = ["amd64", "armhf", "arm64"] +multi_instance = false +ldap = true +sso = false +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/gitlab" + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + + [install.init_main_permission] + help.en = "If your GitLab instance is public, anyone can see your public repositories." + help.fr = "Si votre instance GitLab est publique, tout le monde pourra voir vos dépôts publics." + type = "group" + default = "visitors" + + [install.use_web_account] + ask.en = "Authorize account creation from GitLab web interface" + ask.fr = "Autoriser la création de compte depuis l'interface web de GitLab ?" + type = "boolean" + default = false + +[resources] + [resources.system_user] + + [resources.install_dir] + dir = "/opt/__APP__" + + [resources.permissions] + main.url = "/" + + [resources.ports] + main.default = 8080 + puma.default = 8081 + sidekiq.default = 8082 + + [resources.apt] + packages = "openssh-server" diff --git a/scripts/_common.sh b/scripts/_common.sh index 0981cca..db8801d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# SET ALL CONSTANTS -#================================================= - -pkg_dependencies="openssh-server" - #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 3f40d60..b5cae11 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,27 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -config_path=$(ynh_app_setting_get --app=$app --key=config_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -57,6 +36,7 @@ ynh_backup --src_path="/var/opt/$app/backups/last_gitlab_backup.tar" # BACKUP CONF FILES #================================================= +config_path=/etc/$app ynh_backup --src_path="$config_path/gitlab-secrets.json" ynh_backup --src_path="$config_path/gitlab.rb" ynh_backup --src_path="$config_path/gitlab-persistent.rb" diff --git a/scripts/change_url b/scripts/change_url index 7d17bec..1bdcb33 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -8,48 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -# Needed for helper "ynh_add_nginx_config" -config_path=$(ynh_app_setting_get --app=$app --key=config_path) -port=$(ynh_app_setting_get --app="$app" --key=web_port) -puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port) -sidekiq_port=$(ynh_app_setting_get --app="$app" --key=sidekiq_port) -puma_worker_processes=$(ynh_app_setting_get --app="$app" --key=puma_workers) -puma_min_threads=$(ynh_app_setting_get --app="$app" --key=puma_min_threads) -puma_max_threads=$(ynh_app_setting_get --app="$app" --key=puma_max_threads) -client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size) - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ]; then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ]; then - change_path=1 -fi #================================================= # STANDARD MODIFICATIONS @@ -58,35 +16,12 @@ fi #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +#doc in: https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab -if [ $change_path -eq 1 ]; then - ynh_script_progression --message="Changing path..." --weight=4 +gitlab-ctl stop puma +gitlab-ctl stop sidekiq - #doc in: https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab - - gitlab-ctl stop puma - gitlab-ctl stop sidekiq - - # Make a backup of the original nginx config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated nginx config - ynh_add_nginx_config client_max_body_size -fi - -# Change the domain for nginx -if [ $change_domain -eq 1 ]; then - ynh_script_progression --message="Changing domain..." --weight=4 - - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi +ynh_change_url_nginx_config #================================================= # SPECIFIC MODIFICATIONS @@ -111,11 +46,10 @@ ynh_script_progression --message="Configure GitLab..." --weight=28 mkdir -p $config_path ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") - domain="$new_domain" -path_url="$new_path" +path="$new_path" -generated_external_url="https://$domain${path_url%/}" +generated_external_url="https://$domain${path%/}" ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb" @@ -132,15 +66,6 @@ ynh_script_progression --message="Waiting for GitLab..." --weight=15 ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300 -#================================================= -# GENERIC FINALISATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --action=reload --service_name=nginx - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 5b09460..e9ed661 100644 --- a/scripts/install +++ b/scripts/install @@ -9,38 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - ynh_exec_warn_less ynh_secure_remove --file="$tempdir" - - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC -use_web_account=$YNH_APP_ARG_USE_WEB_ACCOUNT -admin=$YNH_APP_ARG_ADMIN - -app=$YNH_APP_INSTANCE_NAME - #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 config_path=/etc/$app -final_path=/opt/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Detect the system architecture if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then @@ -59,47 +33,17 @@ fi # Could be an option? client_max_body_size="250m" -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=use_web_account --value=$use_web_account -ynh_app_setting_set --app=$app --key=final_path --value=$final_path -ynh_app_setting_set --app=$app --key=config_path --value=$config_path ynh_app_setting_set --app=$app --key=architecture --value=$architecture ynh_app_setting_set --app=$app --key=client_max_body_size --value=$client_max_body_size - ynh_app_setting_set --app=$app --key=overwrite_nginx --value="1" #================================================= # STANDARD MODIFICATIONS -#================================================= -# FIND A PORT -#================================================= -ynh_script_progression --message="Find internal port..." --weight=1 - -# Find free ports -port=$(ynh_find_port --port=8080) -puma_port=$(ynh_find_port --port=$(($port + 1))) -sidekiq_port=$(ynh_find_port --port=$(($puma_port + 1))) - -ynh_app_setting_set --app=$app --key=web_port --value=$port -ynh_app_setting_set --app=$app --key=puma_port --value=$puma_port -ynh_app_setting_set --app=$app --key=sidekiq_port --value=$sidekiq_port - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=5 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # DEFINE THE NUMBER OF WORKERS USED #================================================= @@ -174,7 +118,7 @@ chmod 640 "$config_path/gitlab-persistent.rb" ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") -generated_external_url="https://$domain${path_url%/}" +generated_external_url="https://$domain${path%/}" ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb" @@ -235,20 +179,9 @@ usermod -a -G "ssh.app" "git" 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" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ]; then - ynh_permission_update --permission="main" --add="visitors" -fi - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --action=reload --service_name=nginx diff --git a/scripts/remove b/scripts/remove index 9f5c60b..85c9d04 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,22 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 - -app=$YNH_APP_INSTANCE_NAME - -port=$(ynh_app_setting_get --app="$app" --key=web_port) -portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -config_path=$(ynh_app_setting_get --app=$app --key=config_path) - -# Used by ynh_remove_nginx_config -domain=$(ynh_app_setting_get --app="$app" --key=domain) - -#================================================= # STANDARD REMOVE #================================================= # REMOVE SERVICE FROM ADMIN PANEL @@ -51,21 +35,12 @@ ynh_script_progression --message="Removing GitLab" --weight=4 dpkg --remove gitlab-ce -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies" --weight=3 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory" --weight=1 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +config_path=/etc/$app ynh_secure_remove --file="$config_path" #================================================= @@ -103,7 +78,6 @@ ynh_secure_remove --file="/var/opt/$app" ynh_secure_remove --file="/var/log/$app" # Remove swap - ynh_del_swap #================================================= diff --git a/scripts/restore b/scripts/restore index 799759b..877a895 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,39 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - ynh_exec_warn_less ynh_secure_remove --file="$tempdir" - - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -config_path=$(ynh_app_setting_get --app=$app --key=config_path) -puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port) -architecture=$(ynh_app_setting_get --app="$app" --key=architecture) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -51,14 +18,6 @@ test ! -d $final_path || ynh_die --message="There is already a directory: $final ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=5 - -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies - #================================================= # ADD SWAP IF NEEDED #================================================= @@ -84,6 +43,7 @@ fi #================================================= ynh_script_progression --message="Restoring configuration files of GitLab..." --weight=1 +config_path=/etc/$app ynh_restore_file --origin_path="$config_path/gitlab-secrets.json" ynh_restore_file --origin_path="$config_path/gitlab.rb" ynh_restore_file --origin_path="$config_path/gitlab-persistent.rb" diff --git a/scripts/upgrade b/scripts/upgrade index 73e86da..8a0df5b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,27 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= - -app=$YNH_APP_INSTANCE_NAME - -# Retrieve app settings -domain=$(ynh_app_setting_get --app="$app" --key=domain) -path_url=$(ynh_app_setting_get --app="$app" --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -config_path=$(ynh_app_setting_get --app=$app --key=config_path) -port=$(ynh_app_setting_get --app="$app" --key=web_port) -puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port) -sidekiq_port=$(ynh_app_setting_get --app="$app" --key=sidekiq_port) -architecture=$(ynh_app_setting_get --app="$app" --key=architecture) -puma_worker_processes=$(ynh_app_setting_get --app="$app" --key=puma_workers) -puma_min_threads=$(ynh_app_setting_get --app="$app" --key=puma_min_threads) -puma_max_threads=$(ynh_app_setting_get --app="$app" --key=puma_max_threads) -client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size) -overwrite_nginx=$(ynh_app_setting_get --app="$app" --key=overwrite_nginx) - #================================================= # CHECK VERSION #================================================= @@ -40,17 +19,7 @@ upgrade_type=$(ynh_check_app_version_changed) # ENSURE DOWNWARD COMPATIBILITY #================================================= -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/opt/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path -fi - -# If config_path doesn't exist, create it -if [ -z "$config_path" ]; then - config_path=/etc/$app - ynh_app_setting_set --app=$app --key=config_path --value=$config_path -fi +config_path=/etc/$app if [ -z "$puma_max_threads" ] || [ -z "$puma_min_threads" ]; then # If the server has less than 2GB of RAM @@ -91,82 +60,13 @@ if [ -z "$client_max_body_size" ]; then ynh_app_setting_set --app=$app --key=client_max_body_size --value=$client_max_body_size fi -# If overwrite_nginx doesn't exist, create it -if [ -z "$overwrite_nginx" ]; then - overwrite_nginx=1 - ynh_app_setting_set --app=$app --key=overwrite_nginx --value=$overwrite_nginx -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 - if [ ${domain: -1} == "'" ]; then # if the last char of $domain is ' remove it - domain=${domain:0:-1} - fi - ynh_app_setting_set --app=$app --key=domain --value=$domain -fi - -# If path_url doesn't exist, retrieve it -if [ -z "$path_url" ]; then - path_url=$(grep "location" "/etc/nginx/conf.d/${domain}.d/gitlab.conf" | cut -d' ' -f2) - path_url=$(ynh_normalize_url_path $path_url) - ynh_app_setting_set --app=$app --key=path --value=path_url -fi - -# If port doesn't exist, retrieve it -if [ -z "$port" ]; then - port=$(grep -F "nginx['listen_port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3) - ynh_app_setting_set --app=$app --key=web_port --value=$port -fi - -# If port doesn't exist, retrieve it -if [ -z "$puma_port" ]; then - if [ -z "$(ynh_app_setting_get --app="$app" --key=unicorn_port)" ]; then - puma_port=$(grep -F "unicorn['port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3) - else - puma_port=$(ynh_app_setting_get --app="$app" --key=unicorn_port) - fi - ynh_app_setting_set --app=$app --key=puma_port --value=$puma_port - ynh_app_setting_delete --app=$app --key=unicorn_port -fi - -if [ -z "$sidekiq_port" ]; then - sidekiq_port=$(ynh_find_port $(($puma_port + 1))) - ynh_app_setting_set --app=$app --key=sidekiq_port --value=$sidekiq_port -fi - # if this source file exist, remove it if [ -e "/etc/apt/sources.list.d/gitlab-ce.list" ]; then ynh_secure_remove --file="/etc/apt/sources.list.d/gitlab-ce.list" fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - ynh_exec_warn_less ynh_secure_remove --file="$tempdir" - - ynh_clean_check_starting - - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=5 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # DEFINE THE NUMBER OF WORKERS USED #================================================= @@ -222,7 +122,7 @@ done mkdir -p $config_path ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") -generated_external_url="https://$domain${path_url%/}" +generated_external_url="https://$domain${path%/}" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -415,7 +315,6 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --action=reload --service_name=nginx diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..4935608 --- /dev/null +++ b/tests.toml @@ -0,0 +1,8 @@ +test_format = 1.0 + +[default] + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + test_upgrade_from.7c352aff3fb13fc425d76716477c28db5d54ac99.name = "Upgrade from 12.9.2" \ No newline at end of file From d1d354971ce7ef1338046a2bd04151398ebaf5a7 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 4 Mar 2023 23:12:11 +0100 Subject: [PATCH 02/26] fix ports --- conf/gitlab.13.rb | 4 ++-- conf/gitlab.rb | 4 ++-- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- upgrade-versions.sh | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/conf/gitlab.13.rb b/conf/gitlab.13.rb index 53dbd7d..45a5f65 100644 --- a/conf/gitlab.13.rb +++ b/conf/gitlab.13.rb @@ -1010,7 +1010,7 @@ puma['max_threads'] = __PUMA_MAX_THREADS__ ### Advanced settings # puma['listen'] = '127.0.0.1' -puma['port'] = __PUMA_PORT__ +puma['port'] = __PORT_PUMA__ # puma['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket' # puma['somaxconn'] = 1024 @@ -1066,7 +1066,7 @@ puma['port'] = __PUMA_PORT__ # sidekiq['metrics_enabled'] = true # sidekiq['exporter_log_enabled'] = false # sidekiq['listen_address'] = "localhost" -sidekiq['listen_port'] = __SIDEKIQ_PORT__ +sidekiq['listen_port'] = __PORT_SIDEKIQ__ ################################################################################ ## gitlab-shell diff --git a/conf/gitlab.rb b/conf/gitlab.rb index 479c2b1..044fd00 100644 --- a/conf/gitlab.rb +++ b/conf/gitlab.rb @@ -1058,7 +1058,7 @@ puma['max_threads'] = __PUMA_MAX_THREADS__ ### Advanced settings # puma['listen'] = '127.0.0.1' -puma['port'] = __PUMA_PORT__ +puma['port'] = __PORT_PUMA__ # puma['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket' # puma['somaxconn'] = 1024 @@ -1132,7 +1132,7 @@ puma['port'] = __PUMA_PORT__ # sidekiq['exporter_tls_cert_path'] = "" # sidekiq['exporter_tls_key_path'] = "" # sidekiq['listen_address'] = "localhost" -sidekiq['listen_port'] = __SIDEKIQ_PORT__ +sidekiq['listen_port'] = __PORT_SIDEKIQ__ ##! Specifies where health-check endpoints should be made available for Sidekiq processes. ##! Defaults to the same settings as for Prometheus metrics (see above). diff --git a/scripts/change_url b/scripts/change_url index 1bdcb33..8dbe772 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -64,7 +64,7 @@ gitlab-ctl reconfigure #================================================= ynh_script_progression --message="Waiting for GitLab..." --weight=15 -ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300 +ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300 #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index e9ed661..cb6fa79 100644 --- a/scripts/install +++ b/scripts/install @@ -190,7 +190,7 @@ ynh_systemd_action --action=reload --service_name=nginx #================================================= ynh_script_progression --message="Restarting GitLab..." --weight=15 -ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300 +ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300 #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 877a895..7dfe258 100644 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,7 @@ yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/applica #================================================= ynh_script_progression --message="Waiting for GitLab..." --weight=14 -ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300 +ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300 #================================================= # CHECK THE RESTORED DATA diff --git a/scripts/upgrade b/scripts/upgrade index 8a0df5b..aee1a30 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -309,7 +309,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Restarting GitLab..." --weight=15 - ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$puma_port" --timeout=300 + ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300 fi #================================================= diff --git a/upgrade-versions.sh b/upgrade-versions.sh index ff7b262..62fa5ff 100755 --- a/upgrade-versions.sh +++ b/upgrade-versions.sh @@ -138,10 +138,10 @@ EOS" sed -i "s/# puma\['worker_processes'\] = .*/puma['worker_processes'] = __PUMA_WORKER_PROCESSES__/" $conf_file sed -i "s/# puma\['min_threads'\] = .*/puma['min_threads'] = __PUMA_MIN_THREADS__/" $conf_file sed -i "s/# puma\['max_threads'\] = .*/puma['max_threads'] = __PUMA_MAX_THREADS__/" $conf_file - sed -i "s/# puma\['port'\] = .*/puma['port'] = __PUMA_PORT__/" $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'] = __SIDEKIQ_PORT__/" $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 From 3182f646fd92d69980f5fb0e5682e87e3b48edbd Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 29 Mar 2023 11:33:09 +0200 Subject: [PATCH 03/26] Update manifest.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 1aa7f90..7ea29e8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,7 +19,7 @@ cpe = "???" # FIXME: optional but recommended if relevant, this is meant to cont fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 4.2.3" +yunohost = ">= 11.1.15" architectures = ["amd64", "armhf", "arm64"] multi_instance = false ldap = true From 94d3b8ddd13a21f1d76fb482496a7d6f793bab41 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 30 Mar 2023 10:41:18 +0200 Subject: [PATCH 04/26] various bug fixes --- conf/arm.src.default | 2 +- doc/DESCRIPTION.md | 1 + doc/DESCRIPTION_fr.md | 1 + manifest.toml | 11 +++++++++++ scripts/change_url | 1 + scripts/install | 4 ++++ scripts/restore | 2 ++ scripts/upgrade | 1 + scripts/upgrade.d/upgrade.14.first.sh | 5 ----- scripts/upgrade.d/upgrade.14.last.sh | 5 ----- scripts/upgrade.d/upgrade.15.first.sh | 5 ----- scripts/upgrade.d/upgrade.last.sh | 16 +++------------- upgrade-versions.sh | 9 +-------- 13 files changed, 26 insertions(+), 37 deletions(-) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md diff --git a/conf/arm.src.default b/conf/arm.src.default index 395db91..09a5abd 100644 --- a/conf/arm.src.default +++ b/conf/arm.src.default @@ -1,4 +1,4 @@ -SOURCE_URL=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/buster/gitlab-ce___GITLAB_VERSION__-ce.0_armhf.deb/download.deb +SOURCE_URL=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_armhf.deb/download.deb SOURCE_SUM=__GITLAB_SOURCE_SHA256__ SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=__GITLAB_FILENAME__ diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..d2f5f30 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..0562b17 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 7ea29e8..a2874f5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -55,6 +55,17 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = false [resources] +# [resources.sources] +# [resources.sources.main] +# extract = false +# rename = "gitlab-ce-15.10.0.deb" +# amd64.url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/bullseye/gitlab-ce_15.10.0-ce.0_amd64.deb/download.deb" +# amd64.sha256 = "c8f5aca04549d3f9ba636ca67e76e9bf2b5a6a249a4a16d79365d17856a53d4d" +# armhf.url = "https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/bullseye/gitlab-ce_15.10.0-ce.0_armhf.deb/download.deb" +# armhf.sha256 = "a7a195bf8a74e6ca688de2debe23c0cd5482d989377dcaf7042df484731e10cc" +# arm64.url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/bullseye/gitlab-ce_15.10.0-ce.0_arm64.deb/download.deb" +# arm64.sha256 = "63d29c92eb956631a478735a6c692bbb315c898b2041b2f545c12302b230c97f" + [resources.system_user] [resources.install_dir] diff --git a/scripts/change_url b/scripts/change_url index 8dbe772..2cd24cb 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -44,6 +44,7 @@ done #================================================= ynh_script_progression --message="Configure GitLab..." --weight=28 +config_path=/etc/$app mkdir -p $config_path ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") domain="$new_domain" diff --git a/scripts/install b/scripts/install index cb6fa79..c1942a1 100644 --- a/scripts/install +++ b/scripts/install @@ -134,8 +134,12 @@ tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=$architecture +chmod 755 $install_dir + ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename +ynh_secure_remove --file="$tempdir" + #================================================= # NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 7dfe258..eab7c67 100644 --- a/scripts/restore +++ b/scripts/restore @@ -44,6 +44,8 @@ fi ynh_script_progression --message="Restoring configuration files of GitLab..." --weight=1 config_path=/etc/$app +chmod 755 $install_dir + ynh_restore_file --origin_path="$config_path/gitlab-secrets.json" ynh_restore_file --origin_path="$config_path/gitlab.rb" ynh_restore_file --origin_path="$config_path/gitlab-persistent.rb" diff --git a/scripts/upgrade b/scripts/upgrade index aee1a30..2f45aa7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= config_path=/etc/$app +chmod 755 $install_dir if [ -z "$puma_max_threads" ] || [ -z "$puma_min_threads" ]; then # If the server has less than 2GB of RAM diff --git a/scripts/upgrade.d/upgrade.14.first.sh b/scripts/upgrade.d/upgrade.14.first.sh index 78e49c7..a150dce 100644 --- a/scripts/upgrade.d/upgrade.14.first.sh +++ b/scripts/upgrade.d/upgrade.14.first.sh @@ -18,11 +18,6 @@ if [ "$architecture" = "x86-64" ]; then elif [ "$architecture" = "arm64" ]; then gitlab_source_sha256=$gitlab_arm64_buster_source_sha256 elif [ "$architecture" = "arm" ]; then - # If the version for arm doesn't exist, then use an older one - if [ -z "$gitlab_arm_buster_source_sha256" ]; then - gitlab_version="14.0.11" - gitlab_arm_buster_source_sha256="5f1de707c840e4a518e99c89b0e90a5c21c32cac91e853f1e12ef054696100dd" - fi gitlab_source_sha256=$gitlab_arm_buster_source_sha256 fi diff --git a/scripts/upgrade.d/upgrade.14.last.sh b/scripts/upgrade.d/upgrade.14.last.sh index 79b160d..a67d193 100644 --- a/scripts/upgrade.d/upgrade.14.last.sh +++ b/scripts/upgrade.d/upgrade.14.last.sh @@ -32,11 +32,6 @@ elif [ "$architecture" = "arm64" ]; then gitlab_source_sha256=$gitlab_arm64_buster_source_sha256 fi elif [ "$architecture" = "arm" ]; then - # If the version for arm doesn't exist, then use an older one - if [ -z "$gitlab_arm_buster_source_sha256" ]; then - gitlab_version="14.10.5" - gitlab_arm_buster_source_sha256="24a1c3089bc2836591a153a38a04ae8e0f8807d7e877e5d7fa64987f84699d56" - fi gitlab_source_sha256=$gitlab_arm_buster_source_sha256 fi diff --git a/scripts/upgrade.d/upgrade.15.first.sh b/scripts/upgrade.d/upgrade.15.first.sh index 1c3fb0c..31e81ad 100644 --- a/scripts/upgrade.d/upgrade.15.first.sh +++ b/scripts/upgrade.d/upgrade.15.first.sh @@ -32,11 +32,6 @@ elif [ "$architecture" = "arm64" ]; then gitlab_source_sha256=$gitlab_arm64_buster_source_sha256 fi elif [ "$architecture" = "arm" ]; then - # If the version for arm doesn't exist, then use an older one - if [ -z "$gitlab_arm_buster_source_sha256" ]; then - gitlab_version="15.0.4" - gitlab_arm_buster_source_sha256="49a1d860eb533baa3e2037b0dd73ada0e5c6709ac4c9d53db2d045bc385f0292" - fi gitlab_source_sha256=$gitlab_arm_buster_source_sha256 fi diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 446b89b..6ca8f65 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -11,8 +11,8 @@ gitlab_x86_64_buster_source_sha256="223b4c3eafd3edf44d9b8153f834c24aface03ea7585 gitlab_arm64_bullseye_source_sha256="63d29c92eb956631a478735a6c692bbb315c898b2041b2f545c12302b230c97f" gitlab_arm64_buster_source_sha256="8a29a50bab93d7bbd2bfcfbd968c051739a20d2750c3cee0da2d676738928a77" -gitlab_arm_buster_source_sha256="60f4c441e8f6f25934d6be3bcb9a8fe058b05b7076e7087a18ff747f9afa4b3a" gitlab_arm_bullseye_source_sha256="a7a195bf8a74e6ca688de2debe23c0cd5482d989377dcaf7042df484731e10cc" +gitlab_arm_buster_source_sha256="60f4c441e8f6f25934d6be3bcb9a8fe058b05b7076e7087a18ff747f9afa4b3a" architecture=$(ynh_app_setting_get --app="$app" --key=architecture) @@ -35,20 +35,10 @@ elif [ "$architecture" = "arm64" ]; then elif [ "$architecture" = "arm" ]; then if [ "$gitlab_debian_version" = "bullseye" ] then - # If the version for arm doesn't exist, then use an older one - if [ -z "$gitlab_arm_buster_source_sha256" ]; then - gitlab_version="15.10.0" - gitlab_arm_buster_source_sha256="60f4c441e8f6f25934d6be3bcb9a8fe058b05b7076e7087a18ff747f9afa4b3a" - fi - gitlab_source_sha256=$gitlab_arm_buster_source_sha256 + gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256 elif [ "$gitlab_debian_version" = "buster" ] then - # If the version for arm doesn't exist, then use an older one - if [ -z "$gitlab_arm_bullseye_source_sha256" ]; then - gitlab_version="15.10.0" - gitlab_arm_bullseye_source_sha256="a7a195bf8a74e6ca688de2debe23c0cd5482d989377dcaf7042df484731e10cc" - fi - gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256 + gitlab_source_sha256=$gitlab_arm_buster_source_sha256 fi fi diff --git a/upgrade-versions.sh b/upgrade-versions.sh index 62fa5ff..6608850 100755 --- a/upgrade-versions.sh +++ b/upgrade-versions.sh @@ -47,14 +47,7 @@ do echo url: $url echo sha256: $new_sha256 - # Only replace the first occurrence - sed -i -e "0,/gitlab_arm_${debian_version}_source_sha256=\".*\"/s//gitlab_arm_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file - - # if new_sha256 exists for arm, then replace the backup version/sha256 for this arch - if [ -n "$new_sha256" ]; then - sed -i -e "s/gitlab_version=\"[^0-9.]*[0-9.]*[0-9.]\"/gitlab_version=\"$version\"/" $gitlab_directory/scripts/upgrade.d/$file - sed -i -e "s/gitlab_arm_${debian_version}_source_sha256=\".*\"/gitlab_arm_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file - fi + sed -i -e "s/gitlab_arm_${debian_version}_source_sha256=\".*\"/gitlab_arm_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file done From 42cbd4e2bdab63d5b74b85492cc19f21f6b9e029 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 6 Jun 2023 12:03:04 +0200 Subject: [PATCH 05/26] puma_workers -> puma_worker_processes --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index cee2fab..97ee35a 100644 --- a/scripts/install +++ b/scripts/install @@ -67,7 +67,7 @@ else puma_max_threads=4 fi -ynh_app_setting_set --app=$app --key=puma_workers --value=$puma_worker_processes +ynh_app_setting_set --app=$app --key=puma_worker_processes --value=$puma_worker_processes ynh_app_setting_set --app=$app --key=puma_max_threads --value=$puma_max_threads ynh_app_setting_set --app=$app --key=puma_min_threads --value=$puma_min_threads diff --git a/scripts/upgrade b/scripts/upgrade index dc01e7c..305251b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,7 +82,7 @@ else puma_worker_processes=$(( $(nproc) > 2 ? $(($(nproc) - 1)) : 2 )) fi -ynh_app_setting_set --app=$app --key=puma_workers --value=$puma_worker_processes +ynh_app_setting_set --app=$app --key=puma_worker_processes --value=$puma_worker_processes #================================================= # ADD SWAP IF NEEDED From c0839409ad730e4dd7996bb515be2f26ecbb02dd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 4 Jul 2023 06:23:58 +0000 Subject: [PATCH 06/26] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9124137..d791581 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features -**Shipped version:** 16.1.1~ynh1 +**Shipped version:** 16.0.1~ynh1 **Demo:** https://gitlab.com/explore diff --git a/README_fr.md b/README_fr.md index f21b763..617f5b1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD -**Version incluse :** 16.1.1~ynh1 +**Version incluse :** 16.0.1~ynh1 **Démo :** https://gitlab.com/explore From 2e64b4c5eeea009a155bbe097405cefd7810bc8a Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 4 Jul 2023 08:27:03 +0200 Subject: [PATCH 07/26] 16.1.1 in manifest.toml --- manifest.toml | 2 +- scripts/upgrade.d/upgrade.last.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e00f74a..b55487d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "GitLab" description.en = "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features" description.fr = "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD" -version = "16.0.1~ynh1" +version = "16.1.1~ynh1" maintainers = ["kay0u"] diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 786014c..687db8d 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -19,6 +19,10 @@ gitlab_arm_buster_source_sha256="4a2e40b602797121780676197570093814d035281034ff3 architecture=$(ynh_app_setting_get --app="$app" --key=architecture) +# Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection +# ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256 +# gitlab_source_sha256=${!ref} + if [ "$architecture" = "x86-64" ]; then if [ "$gitlab_debian_version" = "bookworm" ] then From 8da448e80cc77b2a7e6e0537fae0369ee1079ce6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 4 Jul 2023 06:27:11 +0000 Subject: [PATCH 08/26] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d791581..9124137 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features -**Shipped version:** 16.0.1~ynh1 +**Shipped version:** 16.1.1~ynh1 **Demo:** https://gitlab.com/explore diff --git a/README_fr.md b/README_fr.md index 617f5b1..f21b763 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD -**Version incluse :** 16.0.1~ynh1 +**Version incluse :** 16.1.1~ynh1 **Démo :** https://gitlab.com/explore From 0b343c207420f721cd835af377bf43f67e79a6eb Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 4 Jul 2023 13:30:13 +0200 Subject: [PATCH 09/26] fix upgrade --- scripts/upgrade | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 305251b..cd8a2e7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,24 @@ upgrade_type=$(ynh_check_app_version_changed) # ENSURE DOWNWARD COMPATIBILITY #================================================= +if [ -n $(ynh_app_setting_get --app=$app --key=puma_port) ] +then + ynh_app_setting_set --app=$app --key=port_puma --value=$(ynh_app_setting_get --app=$app --key=puma_port) + ynh_app_setting_delete --app=$app --key=puma_port +fi + +if [ -n $(ynh_app_setting_get --app=$app --key=sidekiq_port) ] +then + ynh_app_setting_set --app=$app --key=port_sidekiq --value=$(ynh_app_setting_get --app=$app --key=sidekiq_port) + ynh_app_setting_delete --app=$app --key=sidekiq_port +fi + +if [ -n $(ynh_app_setting_get --app=$app --key=web_port) ] +then + ynh_app_setting_set --app=$app --key=port --value=$(ynh_app_setting_get --app=$app --key=web_port) + ynh_app_setting_delete --app=$app --key=web_port +fi + config_path=/etc/$app chmod 755 $install_dir From d1cfb2510c2eeae4dad672fcbc0de3bcb7f5cf87 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 4 Jul 2023 14:50:15 +0200 Subject: [PATCH 10/26] fix the migration from packaging v1 to v2 --- scripts/upgrade | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index cd8a2e7..50dbe28 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,18 +19,6 @@ upgrade_type=$(ynh_check_app_version_changed) # ENSURE DOWNWARD COMPATIBILITY #================================================= -if [ -n $(ynh_app_setting_get --app=$app --key=puma_port) ] -then - ynh_app_setting_set --app=$app --key=port_puma --value=$(ynh_app_setting_get --app=$app --key=puma_port) - ynh_app_setting_delete --app=$app --key=puma_port -fi - -if [ -n $(ynh_app_setting_get --app=$app --key=sidekiq_port) ] -then - ynh_app_setting_set --app=$app --key=port_sidekiq --value=$(ynh_app_setting_get --app=$app --key=sidekiq_port) - ynh_app_setting_delete --app=$app --key=sidekiq_port -fi - if [ -n $(ynh_app_setting_get --app=$app --key=web_port) ] then ynh_app_setting_set --app=$app --key=port --value=$(ynh_app_setting_get --app=$app --key=web_port) From 59a6543a7778040cb42e3317d185eb5ba86bcf77 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 4 Jul 2023 15:43:25 +0200 Subject: [PATCH 11/26] $http_host -> $host --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index dd9067e..bc86126 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,7 +14,7 @@ location __PATH__/ { proxy_pass http://localhost:__PORT__; - proxy_set_header Host $http_host; + proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; From 92ac205710536f60c1a790d11d6ea04e1329cd52 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 31 Jul 2023 00:56:17 +0200 Subject: [PATCH 12/26] Update cpe and disk/ram usage. Replace disclaimer.md by admin.md --- doc/{DISCLAIMER.md => ADMIN.md} | 9 --------- doc/ADMIN_fr.md | 6 ++++++ doc/DISCLAIMER_fr.md | 15 --------------- manifest.toml | 11 +++++------ 4 files changed, 11 insertions(+), 30 deletions(-) rename doc/{DISCLAIMER.md => ADMIN.md} (53%) create mode 100644 doc/ADMIN_fr.md delete mode 100644 doc/DISCLAIMER_fr.md diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 53% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md index a5251a0..b65bff5 100644 --- a/doc/DISCLAIMER.md +++ b/doc/ADMIN.md @@ -4,12 +4,3 @@ How to configure GitLab: - With the GitLab admin panel. - By editing the configuration file `/etc/gitlab/gitlab-persistent.rb` (use `sudo gitlab-ctl reconfigure` after any modification of this file). - -### Multi-users support - -* Are LDAP and HTTP auth supported? **Yes** -* Can the app be used by multiple users? **Yes** - -### Limitations - -* GitLab is not compatible with 32-bit architectures. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md new file mode 100644 index 0000000..4600559 --- /dev/null +++ b/doc/ADMIN_fr.md @@ -0,0 +1,6 @@ +### Configuration + +Comment configurer GitLab : + +- Avec le panneau d'administration de GitLab. +- En éditant le fichier de configuration `/etc/gitlab/gitlab-persistent.rb` et en éxécutant la commande `sudo gitlab-ctl reconfigure` pour réactualiser la configuration. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md deleted file mode 100644 index ece504b..0000000 --- a/doc/DISCLAIMER_fr.md +++ /dev/null @@ -1,15 +0,0 @@ -### Configuration - -Comment configurer GitLab : - -- Avec le panneau d'administration de GitLab. -- En éditant le fichier de configuration `/etc/gitlab/gitlab-persistent.rb` et en éxécutant la commande `sudo gitlab-ctl reconfigure` pour réactualiser la configuration. - -### Support multi-utilisateurs - -* L'authentification LDAP et HTTP est-elle prise en charge ? **Oui** -* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** - -### Limitations - -* L'application GitLab n'est pas compatible avec les architectures 32-bit. diff --git a/manifest.toml b/manifest.toml index 9fc37ac..6bc8974 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,18 +15,17 @@ website = "https://gitlab.com" demo = "https://gitlab.com/explore" admindoc = "https://docs.gitlab.com/" code = "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. +cpe = "cpe:2.3:a:gitlab:gitlab:*:*:*:*:community:*:*:*" [integration] -yunohost = ">= 11.1.15" +yunohost = ">= 11.2.3" architectures = ["amd64", "armhf", "arm64"] multi_instance = false ldap = true sso = false -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +disk = "500M" +ram.build = "3000M" +ram.runtime = "2000M" [install] [install.domain] From 344653329e53c7ed04b4ab0a01300f93f1dee5e1 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 30 Jul 2023 22:57:00 +0000 Subject: [PATCH 13/26] Auto-update README --- README.md | 18 ------------------ README_fr.md | 18 ------------------ 2 files changed, 36 deletions(-) diff --git a/README.md b/README.md index 3b98646..21e8fb9 100644 --- a/README.md +++ b/README.md @@ -26,24 +26,6 @@ Git-repository manager providing wiki, issue-tracking and CI/CD pipeline feature ![Screenshot of GitLab](./doc/screenshots/GitLab_running_11.0_(2018-07).png) -## Disclaimers / important information - -### Configuration - -How to configure GitLab: - -- With the GitLab admin panel. -- By editing the configuration file `/etc/gitlab/gitlab-persistent.rb` (use `sudo gitlab-ctl reconfigure` after any modification of this file). - -### Multi-users support - -* Are LDAP and HTTP auth supported? **Yes** -* Can the app be used by multiple users? **Yes** - -### Limitations - -* GitLab is not compatible with 32-bit architectures. - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 7bb5282..ae4fb81 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,24 +26,6 @@ Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bu ![Capture d’écran de GitLab](./doc/screenshots/GitLab_running_11.0_(2018-07).png) -## Avertissements / informations importantes - -### Configuration - -Comment configurer GitLab : - -- Avec le panneau d'administration de GitLab. -- En éditant le fichier de configuration `/etc/gitlab/gitlab-persistent.rb` et en éxécutant la commande `sudo gitlab-ctl reconfigure` pour réactualiser la configuration. - -### Support multi-utilisateurs - -* L'authentification LDAP et HTTP est-elle prise en charge ? **Oui** -* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** - -### Limitations - -* L'application GitLab n'est pas compatible avec les architectures 32-bit. - ## Documentations et ressources * Site officiel de l’app : From b95129e4c8d501f90befaeaaa7f91502ba04cdcb Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 11 Aug 2023 17:29:11 +0200 Subject: [PATCH 14/26] Update manifest --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 6bc8974..adb6ff3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "GitLab" description.en = "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features" description.fr = "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD" -version = "16.2.1~ynh1" +version = "16.2.4~ynh1" maintainers = ["kay0u"] From 880830abbfb77292efac099602b012f339f02bca Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 11 Aug 2023 15:29:18 +0000 Subject: [PATCH 15/26] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 21e8fb9..32183bd 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features -**Shipped version:** 16.2.1~ynh1 +**Shipped version:** 16.2.4~ynh1 **Demo:** https://gitlab.com/explore diff --git a/README_fr.md b/README_fr.md index ae4fb81..bb9caaf 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD -**Version incluse :** 16.2.1~ynh1 +**Version incluse :** 16.2.4~ynh1 **Démo :** https://gitlab.com/explore From a39569e4f78fd1e2c8adf64413a6ea03dc24844a Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 11 Aug 2023 17:41:05 +0200 Subject: [PATCH 16/26] Remove old manifest --- manifest.json | 66 --------------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 manifest.json diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 3dff897..0000000 --- a/manifest.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "GitLab", - "id": "gitlab", - "packaging_format": 1, - "version": "16.2.4~ynh1", - "description": { - "en": "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features", - "fr": "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD" - }, - "url": "https://gitlab.com", - "upstream": { - "license": "MIT", - "website": "https://gitlab.com", - "demo": "https://gitlab.com/explore", - "admindoc": "https://docs.gitlab.com/", - "code": "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab", - "cpe": "cpe:2.3:a:gitlab:gitlab" - }, - "license": "MIT", - "maintainer": { - "name": "kay0u", - "email": "pierre@kayou.io" - }, - "requirements": { - "yunohost": ">= 4.2.3" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "default": "/gitlab" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If your GitLab instance is public, anyone can see your public repositories.", - "fr": "Si votre instance GitLab est publique, tout le monde pourra voir vos dépôts publics." - }, - "default": true - }, - { - "name": "use_web_account", - "type": "boolean", - "ask": { - "en": "Authorize account creation from GitLab web interface", - "fr": "Autoriser la création de compte depuis l'interface web de GitLab ?" - }, - "default": false - } - ] - } -} \ No newline at end of file From 72c840621b506c27b79f08a354c88e9fd37989b9 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 25 Aug 2023 11:45:48 +0200 Subject: [PATCH 17/26] fix upgrade-version script --- upgrade-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade-versions.sh b/upgrade-versions.sh index a90a0c1..b045eb3 100755 --- a/upgrade-versions.sh +++ b/upgrade-versions.sh @@ -53,7 +53,7 @@ done if [[ "$(basename $file)" == upgrade.last.sh ]]; then # Update manifest - sed -i -e "s/\"version\": \"[^0-9.]*[0-9.]*[0-9.]~ynh[0-9.]\"/\"version\": \"$version~ynh1\"/" $gitlab_directory/manifest.json + sed -i -e "s/version = \"[^0-9.]*[0-9.]*[0-9.]~ynh[0-9.]\"/version = \"$version~ynh1\"/" $gitlab_directory/manifest.toml # Don't, it's autogenerated now ## Update readme From 460b5cbad53636d339317fd1f9a3f537cafe389b Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 25 Aug 2023 11:45:58 +0200 Subject: [PATCH 18/26] 16.3.0 --- conf/gitlab.rb | 92 +------------------------------ manifest.toml | 2 +- scripts/upgrade.d/upgrade.last.sh | 18 +++--- 3 files changed, 13 insertions(+), 99 deletions(-) diff --git a/conf/gitlab.rb b/conf/gitlab.rb index 01e85f0..4eb59fa 100644 --- a/conf/gitlab.rb +++ b/conf/gitlab.rb @@ -2004,8 +2004,8 @@ nginx['listen_https'] = false # gitlab_kas['enable'] = true ##! Agent configuration for GitLab KAS -# gitlab_kas['agent_configuration_poll_period'] = 20 -# gitlab_kas['agent_gitops_poll_period'] = 20 +# gitlab_kas['agent_configuration_poll_period'] = 300 +# gitlab_kas['agent_gitops_poll_period'] = 300 # gitlab_kas['agent_gitops_project_info_cache_ttl'] = 300 # gitlab_kas['agent_gitops_project_info_cache_error_ttl'] = 60 # gitlab_kas['agent_info_cache_ttl'] = 300 @@ -2399,93 +2399,6 @@ nginx['listen_https'] = false # To completely disable prometheus, and all of it's exporters, set to false # prometheus_monitoring['enable'] = true -################################################################################ -## Grafana Dashboards -##! Docs: https://docs.gitlab.com/ee/administration/monitoring/prometheus/#prometheus-as-a-grafana-data-source -################################################################################ - -# grafana['enable'] = false -# grafana['enable_deprecated_service'] = false -# grafana['log_directory'] = '/var/log/gitlab/grafana' -# grafana['log_group'] = nil -# grafana['home'] = '/var/opt/gitlab/grafana' -# grafana['admin_password'] = 'admin' -# grafana['allow_user_sign_up'] = false -# grafana['basic_auth_enabled'] = false -# grafana['disable_login_form'] = true -# grafana['gitlab_application_id'] = 'GITLAB_APPLICATION_ID' -# grafana['gitlab_secret'] = 'GITLAB_SECRET' -# grafana['env_directory'] = '/opt/gitlab/etc/grafana/env' -# grafana['allowed_groups'] = [] -# grafana['gitlab_auth_sign_up'] = true -# grafana['env'] = { -# 'SSL_CERT_DIR' => "#{node['package']['install-dir']}/embedded/ssl/certs/" -# } -# grafana['metrics_enabled'] = false -# grafana['metrics_basic_auth_username'] = 'grafana_metrics' # default: nil -# grafana['metrics_basic_auth_password'] = 'please_set_a_unique_password' # default: nil -# grafana['alerting_enabled'] = false - -### SMTP Configuration -# -# See: http://docs.grafana.org/administration/configuration/#smtp -# -# grafana['smtp'] = { -# 'enabled' => true, -# 'host' => 'localhost:25', -# 'user' => nil, -# 'password' => nil, -# 'cert_file' => nil, -# 'key_file' => nil, -# 'skip_verify' => false, -# 'from_address' => 'admin@grafana.localhost', -# 'from_name' => 'Grafana', -# 'ehlo_identity' => 'dashboard.example.com', -# 'startTLS_policy' => nil -# } - -# Grafana usage reporting defaults to gitlab_rails['usage_ping_enabled'] -# grafana['reporting_enabled'] = true - -### Dashboards -# -# See: http://docs.grafana.org/administration/provisioning/#dashboards -# -# NOTE: Setting this will override the default. -# -# grafana['dashboards'] = [ -# { -# 'name' => 'GitLab Omnibus', -# 'orgId' => 1, -# 'folder' => 'GitLab Omnibus', -# 'type' => 'file', -# 'disableDeletion' => true, -# 'updateIntervalSeconds' => 600, -# 'options' => { -# 'path' => '/opt/gitlab/embedded/service/grafana-dashboards', -# } -# } -# ] - -### Datasources -# -# See: http://docs.grafana.org/administration/provisioning/#example-datasource-config-file -# -# NOTE: Setting this will override the default. -# -# grafana['datasources'] = [ -# { -# 'name' => 'GitLab Omnibus', -# 'type' => 'prometheus', -# 'access' => 'proxy', -# 'url' => 'http://localhost:9090' -# } -# ] - -##! Advanced settings. Should be changed only if absolutely needed. -# grafana['http_addr'] = 'localhost' -# grafana['http_port'] = 3000 - ################################################################################ ## Gitaly ##! Docs: https://docs.gitlab.com/ee/administration/gitaly/configure_gitaly.html @@ -2742,6 +2655,7 @@ nginx['listen_https'] = false # letsencrypt['auto_renew_minute'] = nil # Should be a number or cron expression, if specified. # letsencrypt['auto_renew_day_of_month'] = "*/4" # letsencrypt['auto_renew_log_directory'] = '/var/log/gitlab/lets-encrypt' +# letsencrypt['alt_names'] = [] ##! Turn off automatic init system detection. To skip init detection in ##! non-docker containers. Recommended not to change. diff --git a/manifest.toml b/manifest.toml index adb6ff3..392c4cf 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "GitLab" description.en = "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features" description.fr = "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD" -version = "16.2.4~ynh1" +version = "16.3.0~ynh1" maintainers = ["kay0u"] diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 1d2d130..4995771 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,21 +1,21 @@ #!/bin/bash -gitlab_version="16.2.4" +gitlab_version="16.3.0" # sha256sum found here: https://packages.gitlab.com/gitlab gitlab_debian_version="$(lsb_release -sc)" -gitlab_x86_64_bookworm_source_sha256="61ed818dc013289379298d7e73c6aa19869cac7072599370ea9315fe81d3c87a" -gitlab_x86_64_bullseye_source_sha256="9fa5ab656a95b5d9666af3747e8ea90bc51e935da2f31d9d03b516f833a74730" -gitlab_x86_64_buster_source_sha256="bc8851cdf4c912f83af7de4f0413f965f26e0f98a98ec2ea04f5dc9b71be977b" +gitlab_x86_64_bookworm_source_sha256="a8ad48f975a51edd47156a097554ad145cb6ca7458e7e2625a395db10c3a2e67" +gitlab_x86_64_bullseye_source_sha256="c768c9f82ffc5a9a11074970627c5f832eb416e5290ba878c7a4989900f1702a" +gitlab_x86_64_buster_source_sha256="89a5fb54f1e4ea27541e86e629916b5223db43c3582a52201d70f26fad649b52" -gitlab_arm64_bookworm_source_sha256="f13220dfa473185996fa265244ebdf6d7b6bc8b0e61aa4a15d0edc3300e04e20" -gitlab_arm64_bullseye_source_sha256="dbb79862f79f7611d074ef194d6c96254a94e0b7f739732ea7c1e16c264c36b4" -gitlab_arm64_buster_source_sha256="cdba0c8be878594356954f53fc26a084dcb409b3a775c88ec9811605f23f23fe" +gitlab_arm64_bookworm_source_sha256="04a1b984b1b29ffe4ce1cbc7b4bb7b206de70552f4322d3bc9a2013ae2c641ec" +gitlab_arm64_bullseye_source_sha256="05d418d7d736af480dea73955175bf1e2becdfdb1a7467e4e3ffa86b55b29f31" +gitlab_arm64_buster_source_sha256="96d0aebf79d0f8efd630ef4a05d9e48f7a4436e600fd24ad312da8d8527f285b" gitlab_arm_bookworm_source_sha256="" -gitlab_arm_bullseye_source_sha256="053a89316fef0f5e91d91cd9b5872b24fbda9716e26ebbfdb0a2cf6d23d930ba" -gitlab_arm_buster_source_sha256="b09ef8072f80458f7ac6aec7e7c2b5d1193e75df5eeef18c0e4728a11ba6fb17" +gitlab_arm_bullseye_source_sha256="50ca0bdc687bfab76cd117dcc9dffa6ce6496c00e962c4e8f21354f74ed952f3" +gitlab_arm_buster_source_sha256="2a4e6e6708e0310251e3af71d670861ab8b787a12c7916b25c79b54b373b4f87" architecture=$(ynh_app_setting_get --app="$app" --key=architecture) From 32ffb1c6e679cecde9ff078dbc26f47ade72c7df Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 25 Aug 2023 09:46:07 +0000 Subject: [PATCH 19/26] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32183bd..0ead04b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features -**Shipped version:** 16.2.4~ynh1 +**Shipped version:** 16.3.0~ynh1 **Demo:** https://gitlab.com/explore diff --git a/README_fr.md b/README_fr.md index bb9caaf..e1c54e2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD -**Version incluse :** 16.2.4~ynh1 +**Version incluse :** 16.3.0~ynh1 **Démo :** https://gitlab.com/explore From 6011a0f63ea8227187f2a0e610d35a0ad5f8fe35 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 25 Aug 2023 12:03:35 +0200 Subject: [PATCH 20/26] update 15.last version to fix a migration issue --- scripts/upgrade.d/upgrade.15.last.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade.d/upgrade.15.last.sh b/scripts/upgrade.d/upgrade.15.last.sh index 052013c..cd12d32 100644 --- a/scripts/upgrade.d/upgrade.15.last.sh +++ b/scripts/upgrade.d/upgrade.15.last.sh @@ -1,18 +1,18 @@ #!/bin/bash -gitlab_version="15.11.5" +gitlab_version="15.11.13" # sha256sum found here: https://packages.gitlab.com/gitlab gitlab_debian_version="$(lsb_release -sc)" -gitlab_x86_64_bullseye_source_sha256="1cc7b52bf8380368321b6aed6eaea6aa08d6f1eca2f11317db0cc64a82c815de" -gitlab_x86_64_buster_source_sha256="49af6b95b9c9eec501e2d8d9d46b89d7958464d7a467892cdaf7e8e435f6b2ce" +gitlab_x86_64_bullseye_source_sha256="5c3cbe468cca4f1c90a53d59ffaeac147cb72c46eb5c48c4a3c235217c66d28d" +gitlab_x86_64_buster_source_sha256="f8fd655c4e034c79ce2b2920f36b9a9aa6e796fde9861467e74e9de0fe87cabd" -gitlab_arm64_bullseye_source_sha256="7712859bc457b262cb33c0ca04c17f7f32013592bc1c96fa86a9621d538f68bc" -gitlab_arm64_buster_source_sha256="0b633b20f05794d703ebf21d641be2a00fdcb1b7ac4d3a9ff5326b66fae14f68" +gitlab_arm64_bullseye_source_sha256="82dbb4b1084b6599b4cc01b085a70ae0a53b837be10573696ddd9dc51f337a65" +gitlab_arm64_buster_source_sha256="725176c1dded56fc97ebf9c5eb4f1a1866302e5609c45934228a0226d919bb3e" -gitlab_arm_buster_source_sha256="838c832db002b3db16d52f92f2d1390737e43ad81dff78b185829d01ce4e2096" -gitlab_arm_bullseye_source_sha256="fdbe645ef18cfeeef2fc15c9979c6ced35f6717873538b2ade934e3e24b1dd51" +gitlab_arm_buster_source_sha256="562a6db5270847d5aafb7e6c216746b9b9da22e5074bd431b6bd6444f89a768f" +gitlab_arm_bullseye_source_sha256="cdd8cad053f8faa6cc33efda5e77e8698eec0c019c20b316ac19c5cb008022b0" architecture=$(ynh_app_setting_get --app="$app" --key=architecture) From fd1fd01254724b3dec47e3d403a4f2480f82ec8e Mon Sep 17 00:00:00 2001 From: Kayou Date: Sat, 26 Aug 2023 00:23:05 +0200 Subject: [PATCH 21/26] Update manifest.toml Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 392c4cf..8398f6a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -43,7 +43,7 @@ ram.runtime = "2000M" [install.init_main_permission] help.en = "If your GitLab instance is public, anyone can see your public repositories." - help.fr = "Si votre instance GitLab est publique, tout le monde pourra voir vos dépôts publics." + help.fr = "Si votre instance GitLab est définie sur visiteurs, tout le monde pourra voir vos dépôts publics." type = "group" default = "visitors" From cebb615773dec262b0b3e7f007e08ca4132859fd Mon Sep 17 00:00:00 2001 From: Kayou Date: Sat, 26 Aug 2023 00:23:12 +0200 Subject: [PATCH 22/26] Update manifest.toml Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 8398f6a..044030a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -42,7 +42,7 @@ ram.runtime = "2000M" type = "user" [install.init_main_permission] - help.en = "If your GitLab instance is public, anyone can see your public repositories." + help.en = "If your GitLab instance is set to visitors, anyone can see your public repositories." help.fr = "Si votre instance GitLab est définie sur visiteurs, tout le monde pourra voir vos dépôts publics." type = "group" default = "visitors" From c7ae50a5962cf6efce3b76b2183fc748d934c82d Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 28 Aug 2023 10:42:28 +0200 Subject: [PATCH 23/26] remove unnecessary code in remove script --- scripts/remove | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/scripts/remove b/scripts/remove index 85c9d04..0ec93c2 100644 --- a/scripts/remove +++ b/scripts/remove @@ -51,21 +51,6 @@ ynh_script_progression --message="Removing NGINX web server configuration" --wei # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# CLOSE A PORT -#================================================= - -# These ports are no longer open but were in previous versions -if yunohost firewall list | grep -q "\- $port$"; then - ynh_script_progression --message="Closing port $port" --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - -if yunohost firewall list | grep -q "\- $portPuma$"; then - ynh_script_progression --message="Closing port $portPuma" --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $portPuma -fi - #================================================= # SPECIFIC REMOVE #================================================= From 3bfdba374358607235d7f2ede792e769087b9cd8 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 28 Aug 2023 10:44:59 +0200 Subject: [PATCH 24/26] fix cpe --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 392c4cf..8971ef4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,7 +15,7 @@ website = "https://gitlab.com" demo = "https://gitlab.com/explore" admindoc = "https://docs.gitlab.com/" code = "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab" -cpe = "cpe:2.3:a:gitlab:gitlab:*:*:*:*:community:*:*:*" +cpe = "cpe:2.3:a:gitlab:gitlab" [integration] yunohost = ">= 11.2.3" From d58ea0798c3fd5342ec326b86f75035c4b27dc21 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 28 Aug 2023 10:47:02 +0200 Subject: [PATCH 25/26] add upgrade path link --- scripts/upgrade.d/upgrade.last.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 4995771..eb8bd2e 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -2,6 +2,7 @@ gitlab_version="16.3.0" +# Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/ # sha256sum found here: https://packages.gitlab.com/gitlab gitlab_debian_version="$(lsb_release -sc)" From 09c5d5c5f19e9472d7ee55e4e2cc3051391e7bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:00:42 +0200 Subject: [PATCH 26/26] typos --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 97ee35a..228decb 100644 --- a/scripts/install +++ b/scripts/install @@ -87,7 +87,7 @@ fi if [ $swap_needed -gt 0 ]; then ynh_script_progression --message="Adding $swap_needed Mo to swap..." if ! ynh_add_swap --size=$swap_needed; then - ynh_print_warn --message="Please add $swap_needed Mo to swap to make Gitlab work properly" + ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly" fi fi diff --git a/scripts/restore b/scripts/restore index eab7c67..6229acd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,7 +34,7 @@ fi if [ $swap_needed -gt 0 ]; then ynh_script_progression --message="Adding $swap_needed Mo to swap..." if ! ynh_add_swap --size=$swap_needed; then - ynh_print_warn --message="Please add $swap_needed Mo to swap to make Gitlab work properly" + ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly" fi fi diff --git a/scripts/upgrade b/scripts/upgrade index 50dbe28..7a4d3db 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,7 +51,7 @@ if [ -z "$architecture" ]; then elif [ -n "$(uname -m | grep x86_64)" ]; then architecture="x86-64" elif [ -n "$(uname -m | grep 86)" ]; then - ynh_die "Gitlab is not compatible with x86 architecture" + ynh_die "GitLab is not compatible with x86 architecture" elif [ -n "$(uname -m | grep arm)" ]; then architecture="arm" else @@ -106,7 +106,7 @@ fi if [ $swap_needed -gt 0 ]; then ynh_script_progression --message="Adding $swap_needed Mo to swap..." if ! ynh_add_swap --size=$swap_needed; then - ynh_print_warn --message="Please add $swap_needed Mo to swap to make Gitlab work properly" + ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly" fi fi