diff --git a/README.md b/README.md index c6e84b7..2bb674c 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,60 @@ + + # GitLab for YunoHost -[![Integration level](https://dash.yunohost.org/integration/gitlab.svg)](https://dash.yunohost.org/appci/app/gitlab) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/gitlab.svg)](https://dash.yunohost.org/appci/app/gitlab) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.maintain.svg) [![Install GitLab with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitlab) *[Lire ce readme en français.](./README_fr.md)* -> *This package allow you to install GitLab quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +> *This package allows you to install GitLab quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -GitLab is a web-based Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features, using an open-source license, developed by GitLab Inc. +Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features. -**Shipped version:** 13.11.2 +**Shipped version:** 13.12.1~ynh1 + +**Demo:** https://gitlab.com/explore ## Screenshots -![](https://upload.wikimedia.org/wikipedia/commons/9/9a/GitLab_running_11.0_%282018-07%29.png) +![](./doc/screenshots/GitLab_running_11.0_(2018-07).png) -## Configuration +## 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). -## Documentation - - * Official documentation: https://docs.gitlab.com/ce/README.html - * YunoHost documentation: https://yunohost.org/#/app_gitlab - -## YunoHost specific features - -#### Multi-users support +### Multi-users support * Are LDAP and HTTP auth supported? **Yes** * Can the app be used by multiple users? **Yes** -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/gitlab/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/gitlab/) - -## Limitations +### Limitations * GitLab is not compatible with 32-bit architectures. -## Links +## Documentation and resources - * Report a bug: https://github.com/YunoHost-Apps/gitlab_ynh/issues - * App website: https://gitlab.com - * Upstream app repository: https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab-ce - * YunoHost website: https://yunohost.org/ +* Official app website: https://gitlab.com +* Official user documentation: https://yunohost.org/fr/app_gitlab +* Official admin documentation: https://docs.gitlab.com/ +* Upstream app code repository: https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab +* YunoHost documentation for this app: https://yunohost.org/app_gitlab +* Report a bug: https://github.com/YunoHost-Apps/gitlab_ynh/issues ---- +## Developer info -## Developers info - -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing). To try the testing branch, please proceed like that. ``` @@ -65,3 +62,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/gitlab_ynh/tree/testi or sudo yunohost app upgrade gitlab -u https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index a2b3475..d191b6f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,59 +1,52 @@ # GitLab pour YunoHost -[![Integration level](https://dash.yunohost.org/integration/gitlab.svg)](https://dash.yunohost.org/appci/app/gitlab) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.maintain.svg) -[![Installer GitLab pour YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitlab) +[![Niveau d'intégration](https://dash.yunohost.org/integration/gitlab.svg)](https://dash.yunohost.org/appci/app/gitlab) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gitlab.maintain.svg) +[![Installer GitLab avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitlab) -*[Read this readme in english.](./README.md)* +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* -> *Ce package vous permet d'installer GitLab rapidement et simplement sur un serveur YunoHost. +> *Ce package vous permet d'installer GitLab rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble -GitLab est un gestionnaire Web de dépôt Git fournissant des fonctionnalités de wiki, de rapports de bugs et de pipeline CI/CD. GitLab est une application open source développée par GitLab Inc. +Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD. -**Version incluse :** 13.11.2 +**Version incluse :** 13.12.1~ynh1 + +**Démo :** https://gitlab.com/explore ## Captures d'écran -![](https://upload.wikimedia.org/wikipedia/commons/9/9a/GitLab_running_11.0_%282018-07%29.png) +![](./doc/screenshots/GitLab_running_11.0_(2018-07).png) -## Configuration +## 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. -## Documentation - - * Documentation officielle : https://docs.gitlab.com/ce/README.html - * Documentation YunoHost : https://yunohost.org/#/app_gitlab_fr - -## Caractéristiques spécifiques YunoHost - -#### Support multi-utilisateurs +### 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** -#### Architectures supportées - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/gitlab/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/gitlab%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/gitlab/) - -## Limitations +### Limitations * L'application GitLab n'est pas compatible avec les architectures 32-bit. -## Liens +## Documentations et ressources - * Signaler un bug : https://github.com/YunoHost-Apps/gitlab_ynh/issues - * Site de l'application : https://gitlab.com - * Dépôt de l'application principale : https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab-ce - * Site web YunoHost : https://yunohost.org/ - ---- +* Site officiel de l'app : https://gitlab.com +* Documentation officielle utilisateur : https://yunohost.org/fr/app_gitlab +* Documentation officielle de l'admin : https://docs.gitlab.com/ +* Dépôt de code officiel de l'app : https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab +* Documentation YunoHost pour cette app : https://yunohost.org/app_gitlab +* Signaler un bug : https://github.com/YunoHost-Apps/gitlab_ynh/issues ## Informations pour les développeurs @@ -62,6 +55,8 @@ Merci de faire vos pull request sur la [branche testing](https://github.com/Yuno Pour essayer la branche testing, procédez comme suit. ``` sudo yunohost app install https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing --debug -or +ou sudo yunohost app upgrade gitlab -u https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing --debug ``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/conf/arm.src.default b/conf/arm.src.default index 9370a8f..09a5abd 100644 --- a/conf/arm.src.default +++ b/conf/arm.src.default @@ -1,6 +1,6 @@ -SOURCE_URL=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/__DEBIAN_VERSION__/gitlab-ce___VERSION__-ce.0_armhf.deb/download.deb -SOURCE_SUM=__SHA256_SUM__ +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=__SOURCE_FILENAME__ +SOURCE_FILENAME=__GITLAB_FILENAME__ SOURCE_EXTRACT=false SOURCE_FORMAT=deb diff --git a/conf/arm64.src.default b/conf/arm64.src.default index 89040e9..07782fc 100644 --- a/conf/arm64.src.default +++ b/conf/arm64.src.default @@ -1,6 +1,6 @@ -SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__DEBIAN_VERSION__/gitlab-ce___VERSION__-ce.0_arm64.deb/download.deb -SOURCE_SUM=__SHA256_SUM__ +SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_arm64.deb/download.deb +SOURCE_SUM=__GITLAB_SOURCE_SHA256__ SOURCE_SUM_PRG=sha256sum -SOURCE_FILENAME=__SOURCE_FILENAME__ +SOURCE_FILENAME=__GITLAB_FILENAME__ SOURCE_EXTRACT=false SOURCE_FORMAT=deb diff --git a/conf/gitlab.rb b/conf/gitlab.rb index 99e553a..53dbd7d 100644 --- a/conf/gitlab.rb +++ b/conf/gitlab.rb @@ -103,6 +103,7 @@ external_url '__GENERATED_EXTERNAL_URL__' # gitlab_rails['smtp_authentication'] = "login" # gitlab_rails['smtp_enable_starttls_auto'] = true # gitlab_rails['smtp_tls'] = false +# gitlab_rails['smtp_pool'] = false ###! **Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'** ###! Docs: http://api.rubyonrails.org/classes/ActionMailer/Base.html @@ -192,6 +193,8 @@ external_url '__GENERATED_EXTERNAL_URL__' # gitlab_rails['member_invitation_reminder_emails_worker_cron'] = "0 0 * * *" # gitlab_rails['user_status_cleanup_batch_worker_cron'] = "* * * * *" # gitlab_rails['namespaces_in_product_marketing_emails_worker_cron'] = "0 9 * * *" +# gitlab_rails['ssh_keys_expired_notification_worker_cron'] = "0 2 * * *" +# gitlab_rails['ssh_keys_expiring_soon_notification_worker_cron'] = "0 1 * * *" ### Webhook Settings ###! Number of seconds to wait for HTTP response after sending webhook HTTP POST @@ -886,6 +889,9 @@ gitlab_rails['gitlab_shell_ssh_port'] = __SSH_PORT__ # gitlab_workhorse['listen_addr'] = "/var/opt/gitlab/gitlab-workhorse/sockets/socket" # gitlab_workhorse['auth_backend'] = "http://localhost:8080" +##! Enable Redis keywatcher, if this setting is not present it defaults to true +# gitlab_workhorse['workhorse_keywatcher'] = true + ##! the empty string is the default in gitlab-workhorse option parser # gitlab_workhorse['auth_socket'] = "''" @@ -911,6 +917,9 @@ gitlab_rails['gitlab_shell_ssh_port'] = __SSH_PORT__ ##! Long polling duration for job requesting for runners # gitlab_workhorse['api_ci_long_polling_duration'] = "60s" +##! Propagate X-Request-Id if available. Workhorse will generate a random value otherwise. +# gitlab_workhorse['propagate_correlation_id'] = false + ##! Log format: default is json, can also be text or none. # gitlab_workhorse['log_format'] = "json" @@ -1013,7 +1022,7 @@ puma['port'] = __PUMA_PORT__ ### **Only change these settings if you understand well what they mean** ###! Docs: https://github.com/schneems/puma_worker_killer -# puma['per_worker_max_memory_mb'] = 850 +# puma['per_worker_max_memory_mb'] = 1024 # puma['exporter_enabled'] = false # puma['exporter_address'] = "127.0.0.1" @@ -1037,6 +1046,12 @@ puma['port'] = __PUMA_PORT__ # sidekiq['max_concurrency'] = 50 # sidekiq['min_concurrency'] = nil +##! GitLab allows route a job to a particular queue determined by an array of ##! routing rules. +##! Each routing rule is a tuple of queue selector query and corresponding queue. By default, +##! the routing rules are not configured (empty array) + +# sidekiq['routing_rules'] = [] + ##! Each entry in the queue_groups array denotes a group of queues that have to be processed by a ##! Sidekiq process. Multiple queues can be processed by the same process by ##! separating them with a comma within the group entry, a `*` will process all queues @@ -1433,7 +1448,7 @@ nginx['listen_https'] = false # nginx['sendfile'] = 'on' # nginx['tcp_nopush'] = 'on' # nginx['tcp_nodelay'] = 'on' -# nginx['gzip'] = "on" +# nginx['hide_server_tokens'] = 'off' # nginx['gzip_http_version'] = "1.0" # nginx['gzip_comp_level'] = "2" # nginx['gzip_proxied'] = "any" @@ -1615,11 +1630,11 @@ nginx['listen_https'] = false ##! Prometheus metrics for Pages docs: https://gitlab.com/gitlab-org/gitlab-pages/#enable-prometheus-metrics # gitlab_pages['metrics_address'] = ":9235" -##! Specifies the minimum SSL/TLS version ("ssl3", "tls1.0", "tls1.1" or "tls1.2") -# gitlab_pages['tls_min_version'] = "ssl3" +##! Specifies the minimum TLS version ("tls1.2" or "tls1.3") +# gitlab_pages['tls_min_version'] = "tls1.2" -##! Specifies the maximum SSL/TLS version ("ssl3", "tls1.0", "tls1.1" or "tls1.2") -# gitlab_pages['tls_max_version'] = "tls1.2" +##! Specifies the maximum TLS version ("tls1.2" or "tls1.3") +# gitlab_pages['tls_max_version'] = "tls1.3" ##! Pages access control # gitlab_pages['access_control'] = false @@ -1676,6 +1691,9 @@ nginx['listen_https'] = false ##! The maximum amount of time it takes to open a zip archive from the file system or object storage. # gitlab_pages['zip_open_timeout'] = "30s" +##! Enable serving content from disk instead of Object Storage +# gitlab_pages['enable_disk'] = nil + # gitlab_pages['env_directory'] = "/opt/gitlab/etc/gitlab-pages/env" # gitlab_pages['env'] = { # 'SSL_CERT_DIR' => "#{node['package']['install-dir']}/embedded/ssl/certs/" diff --git a/conf/x86-64.src.default b/conf/x86-64.src.default index f8e3b71..1faaa92 100644 --- a/conf/x86-64.src.default +++ b/conf/x86-64.src.default @@ -1,6 +1,6 @@ -SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__DEBIAN_VERSION__/gitlab-ce___VERSION__-ce.0_amd64.deb/download.deb -SOURCE_SUM=__SHA256_SUM__ +SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_amd64.deb/download.deb +SOURCE_SUM=__GITLAB_SOURCE_SHA256__ SOURCE_SUM_PRG=sha256sum -SOURCE_FILENAME=__SOURCE_FILENAME__ +SOURCE_FILENAME=__GITLAB_FILENAME__ SOURCE_EXTRACT=false SOURCE_FORMAT=deb diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..a5251a0 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,15 @@ +### 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. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..ece504b --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,15 @@ +### 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/doc/screenshots/GitLab_running_11.0_(2018-07).png b/doc/screenshots/GitLab_running_11.0_(2018-07).png new file mode 100644 index 0000000..7a46fb4 Binary files /dev/null and b/doc/screenshots/GitLab_running_11.0_(2018-07).png differ diff --git a/manifest.json b/manifest.json index 2e1ac97..77c18a8 100644 --- a/manifest.json +++ b/manifest.json @@ -2,12 +2,20 @@ "name": "GitLab", "id": "gitlab", "packaging_format": 1, - "version": "13.11.2~ynh1", + "version": "13.12.1~ynh1", "description": { - "en": "Git-repository manager.", - "fr": "Gestionnaire de dépôts Git." + "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/", + "userdoc": "https://yunohost.org/fr/app_gitlab", + "code": "https://gitlab.com/gitlab-org/omnibus-gitlab - https://gitlab.com/gitlab-org/gitlab" + }, "license": "MIT", "maintainer": { "name": "kay0u", @@ -25,38 +33,22 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for GitLab", - "fr": "Choisissez un nom de domaine pour GitLab" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for GitLab", - "fr": "Choisissez un chemin pour GitLab" - }, "example": "/gitlab", "default": "/gitlab" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" - }, "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": true }, { diff --git a/scripts/change_url b/scripts/change_url index 1669982..05a47b9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,8 +29,8 @@ 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) -portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port) -portSidekiq=$(ynh_app_setting_get --app="$app" --key=sidekiq_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) @@ -108,28 +108,15 @@ done #================================================= ynh_script_progression --message="Configure GitLab..." --weight=28 -ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb" - mkdir -p $config_path - -cp -f $YNH_APP_BASEDIR/conf/gitlab.rb "$config_path/gitlab.rb" ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") domain="$new_domain" path_url="$new_path" -ynh_replace_string --match_string="__GENERATED_EXTERNAL_URL__" --replace_string="https://$domain${path_url%/}" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_PORT__" --replace_string="$portPuma" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_WORKER_PROCESSES__" --replace_string="$puma_worker_processes" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_MIN_THREADS__" --replace_string="$puma_min_threads" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_MAX_THREADS__" --replace_string="$puma_max_threads" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__CLIENT_MAX_BODY_SIZE__" --replace_string="$client_max_body_size" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__SSH_PORT__" --replace_string="$ssh_port" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__SIDEKIQ_PORT__" --replace_string="$portSidekiq" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__MODIFY_KERNEL_PARAMETERS__" --replace_string="$modify_kernel_parameters" --target_file="$config_path/gitlab.rb" +generated_external_url="https://$domain${path_url%/}" -ynh_store_file_checksum --file="$config_path/gitlab.rb" +ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb" #================================================= # RECONFIGURE GITLAB @@ -142,7 +129,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:$portPuma" --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:$puma_port" --timeout=300 #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index bd54d05..f4a22c8 100644 --- a/scripts/install +++ b/scripts/install @@ -86,12 +86,12 @@ ynh_script_progression --message="Find internal port..." --weight=1 # Find free ports port=$(ynh_find_port --port=8080) -portPuma=$(ynh_find_port --port=$(($port + 1))) -portSidekiq=$(ynh_find_port --port=$(($portPuma + 1))) +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=$portPuma -ynh_app_setting_set --app=$app --key=sidekiq_port --value=$portSidekiq +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 @@ -169,27 +169,14 @@ ynh_script_progression --message="Preconfigure GitLab..." --weight=1 mkdir -p $config_path touch "$config_path/gitlab-persistent.rb" -chown admin: "$config_path/gitlab-persistent.rb" +chown root:root "$config_path/gitlab-persistent.rb" +chmod 640 "$config_path/gitlab-persistent.rb" -cp -f $YNH_APP_BASEDIR/conf/gitlab.rb "$config_path/gitlab.rb" ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") -ynh_replace_string --match_string="__GENERATED_EXTERNAL_URL__" --replace_string="https://$domain${path_url%/}" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_PORT__" --replace_string="$portPuma" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_WORKER_PROCESSES__" --replace_string="$puma_worker_processes" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_MIN_THREADS__" --replace_string="$puma_min_threads" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_MAX_THREADS__" --replace_string="$puma_max_threads" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__CLIENT_MAX_BODY_SIZE__" --replace_string="$client_max_body_size" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__SSH_PORT__" --replace_string="$ssh_port" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__SIDEKIQ_PORT__" --replace_string="$portSidekiq" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__MODIFY_KERNEL_PARAMETERS__" --replace_string="$modify_kernel_parameters" --target_file="$config_path/gitlab.rb" +generated_external_url="https://$domain${path_url%/}" -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= - -ynh_store_file_checksum --file="$config_path/gitlab.rb" +ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -197,11 +184,7 @@ ynh_store_file_checksum --file="$config_path/gitlab.rb" ynh_script_progression --message="Setting up source files..." --weight=50 source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh -cp $YNH_APP_BASEDIR/conf/$architecture.src.default $YNH_APP_BASEDIR/conf/$architecture.src -ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" -ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" -ynh_replace_string --match_string="__DEBIAN_VERSION__" --replace_string="$gitlab_debian_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" -ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_source_sha256" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" +ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src" tempdir="$(mktemp -d)" @@ -274,7 +257,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:$portPuma" --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:$puma_port" --timeout=300 #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 6ebdc2c..d54349d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,7 +33,7 @@ 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) -portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port) +puma_port=$(ynh_app_setting_get --app="$app" --key=puma_port) architecture=$(ynh_app_setting_get --app="$app" --key=architecture) #================================================= @@ -97,11 +97,7 @@ ynh_restore_file --origin_path="$config_path/gitlab-persistent.rb" ynh_script_progression --message="Reinstalling GitLab..." --weight=50 source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh -cp $YNH_APP_BASEDIR/conf/$architecture.src.default $YNH_APP_BASEDIR/conf/$architecture.src -ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" -ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" -ynh_replace_string --match_string="__DEBIAN_VERSION__" --replace_string="$gitlab_debian_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" -ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_source_sha256" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" +ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src" tempdir="$(mktemp -d)" @@ -149,7 +145,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:$portPuma" --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:$puma_port" --timeout=300 #================================================= # CHECK THE RESTORED DATA diff --git a/scripts/upgrade b/scripts/upgrade index 9399e24..6210aca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,12 +18,11 @@ 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) -is_public=$(ynh_app_setting_get --app="$app" --key=is_public) 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) -portPuma=$(ynh_app_setting_get --app="$app" --key=puma_port) -portSidekiq=$(ynh_app_setting_get --app="$app" --key=sidekiq_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) @@ -41,11 +40,6 @@ upgrade_type=$(ynh_check_app_version_changed) # ENSURE DOWNWARD COMPATIBILITY #================================================= -# Delete is_public if it exists -if [ ! -z $is_public ]; then - ynh_app_setting_delete --app=$app --key=is_public -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/opt/$app @@ -126,19 +120,19 @@ if [ -z "$port" ]; then fi # If port doesn't exist, retrieve it -if [ -z "$portPuma" ]; then +if [ -z "$puma_port" ]; then if [ -z "$(ynh_app_setting_get --app="$app" --key=unicorn_port)" ]; then - portPuma=$(grep -F "unicorn['port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3) + puma_port=$(grep -F "unicorn['port']" "/etc/gitlab/gitlab.rb" | cut -d' ' -f3) else - portPuma=$(ynh_app_setting_get --app="$app" --key=unicorn_port) + puma_port=$(ynh_app_setting_get --app="$app" --key=unicorn_port) fi - ynh_app_setting_set --app=$app --key=puma_port --value=$portPuma + ynh_app_setting_set --app=$app --key=puma_port --value=$puma_port ynh_app_setting_delete --app=$app --key=unicorn_port fi -if [ -z "$portSidekiq" ]; then - portSidekiq=$(ynh_find_port $(($portPuma + 1))) - ynh_app_setting_set --app=$app --key=sidekiq_port --value=$portSidekiq +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 @@ -265,11 +259,7 @@ then fi fi - cp $YNH_APP_BASEDIR/conf/$architecture.src.default $YNH_APP_BASEDIR/conf/$architecture.src - ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" - ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" - ynh_replace_string --match_string="__DEBIAN_VERSION__" --replace_string="$gitlab_debian_version" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" - ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_source_sha256" --target_file="$YNH_APP_BASEDIR/conf/$architecture.src" + ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src" tempdir="$(mktemp -d)" @@ -306,28 +296,16 @@ done #================================================= ynh_script_progression --message="Reconfigure GitLab..." --weight=13 -ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb" - mkdir -p $config_path - -cp -f $YNH_APP_BASEDIR/conf/gitlab.rb "$config_path/gitlab.rb" ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") -ynh_replace_string --match_string="__GENERATED_EXTERNAL_URL__" --replace_string="https://$domain${path_url%/}" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_PORT__" --replace_string="$portPuma" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_WORKER_PROCESSES__" --replace_string="$puma_worker_processes" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_MIN_THREADS__" --replace_string="$puma_min_threads" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__PUMA_MAX_THREADS__" --replace_string="$puma_max_threads" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__CLIENT_MAX_BODY_SIZE__" --replace_string="$client_max_body_size" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__SSH_PORT__" --replace_string="$ssh_port" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__SIDEKIQ_PORT__" --replace_string="$portSidekiq" --target_file="$config_path/gitlab.rb" -ynh_replace_string --match_string="__MODIFY_KERNEL_PARAMETERS__" --replace_string="$modify_kernel_parameters" --target_file="$config_path/gitlab.rb" +generated_external_url="https://$domain${path_url%/}" -ynh_store_file_checksum --file="$config_path/gitlab.rb" +ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb" touch "$config_path/gitlab-persistent.rb" -chown admin: "$config_path/gitlab-persistent.rb" +chown root:root "$config_path/gitlab-persistent.rb" +chmod 640 "$config_path/gitlab-persistent.rb" gitlab-ctl reconfigure @@ -362,7 +340,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:$portPuma" --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:$puma_port" --timeout=300 fi #================================================= diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 7dd5f58..5577683 100644 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/scripts/upgrade.d/upgrade.last.sh @@ -1,15 +1,15 @@ #!/bin/bash -gitlab_version="13.11.2" +gitlab_version="13.12.1" # sha256sum found here: https://packages.gitlab.com/gitlab gitlab_debian_version="buster" -gitlab_x86_64_buster_source_sha256="e58e667f61fc04b8debce9b34622158c5feb3308a5f38a99e6b06aaf99e37e8f" +gitlab_x86_64_buster_source_sha256="53f52edd4930c212398658ea48e2a2478d22e65bc63f0fc9d03bca8a25738fed" -gitlab_arm64_buster_source_sha256="598385a23b71fb2fab2654285e9e7f29005b03cb34874743e3be213df25c7a05" +gitlab_arm64_buster_source_sha256="a5e5dca6d47e53b0522c29d978b3f5f8bd23528acde46d13d559511147bc1b28" -gitlab_arm_buster_source_sha256="70f9b525a73a414a3f960d436f8a12d969ffc80801bc42958918bd1678aefa87" +gitlab_arm_buster_source_sha256="7bc001c164dc082e5a5887f3d8fb1234d9bfc474ddc21142f4103c9ddc567d03" architecture=$(ynh_app_setting_get --app="$app" --key=architecture)