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

Merge pull request #90 from YunoHost-Apps/testing

Testing
This commit is contained in:
Kayou 2020-01-02 13:28:52 +08:00 committed by GitHub
commit b73167447c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 251 deletions

View file

@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
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. 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.
**Shipped version:** 12.5.4 **Shipped version:** 12.6.0
## Screenshots ## Screenshots

View file

@ -124,6 +124,7 @@ external_url '__GENERATED_EXTERNAL_URL__'
# gitlab_rails['ci_archive_traces_cron_worker_cron'] = "17 * * * *" # gitlab_rails['ci_archive_traces_cron_worker_cron'] = "17 * * * *"
# gitlab_rails['repository_check_worker_cron'] = "20 * * * *" # gitlab_rails['repository_check_worker_cron'] = "20 * * * *"
# gitlab_rails['admin_email_worker_cron'] = "0 0 * * 0" # gitlab_rails['admin_email_worker_cron'] = "0 0 * * 0"
# gitlab_rails['personal_access_tokens_expiring_worker_cron'] = "0 1 * * *"
# gitlab_rails['repository_archive_cache_worker_cron'] = "0 * * * *" # gitlab_rails['repository_archive_cache_worker_cron'] = "0 * * * *"
# gitlab_rails['pages_domain_verification_cron_worker'] = "*/15 * * * *" # gitlab_rails['pages_domain_verification_cron_worker'] = "*/15 * * * *"
# gitlab_rails['pages_domain_ssl_renewal_cron_worker'] = "*/10 * * * *" # gitlab_rails['pages_domain_ssl_renewal_cron_worker'] = "*/10 * * * *"
@ -209,11 +210,13 @@ external_url '__GENERATED_EXTERNAL_URL__'
# gitlab_rails['incoming_email_ssl'] = true # gitlab_rails['incoming_email_ssl'] = true
# gitlab_rails['incoming_email_start_tls'] = false # gitlab_rails['incoming_email_start_tls'] = false
#### Incoming Mailbox Settings #### Incoming Mailbox Settings (via `mail_room`)
####! The mailbox where incoming mail will end up. Usually "inbox". ####! The mailbox where incoming mail will end up. Usually "inbox".
# gitlab_rails['incoming_email_mailbox_name'] = "inbox" # gitlab_rails['incoming_email_mailbox_name'] = "inbox"
####! The IDLE command timeout. ####! The IDLE command timeout.
# gitlab_rails['incoming_email_idle_timeout'] = 60 # gitlab_rails['incoming_email_idle_timeout'] = 60
####! The file name for internal `mail_room`JSON logfile
# gitlab_rails['incoming_email_log_file'] = "/var/log/gitlab/mailroom/mail_room_json.log"
### Job Artifacts ### Job Artifacts
# gitlab_rails['artifacts_enabled'] = true # gitlab_rails['artifacts_enabled'] = true
@ -505,6 +508,13 @@ gitlab_rails['gitlab_shell_ssh_port'] = __SSH_PORT__
# 'bantime' => 3600 # 'bantime' => 3600
# } # }
# Prioritize the Admin Area protected paths throttle settings over the
# deprecated Omnibus-managed protected paths throttle. This allows you to keep
# gitlab_rails['rack_attack_git_basic_auth'] enabled to run the Git and
# container registry failed authentication ban.
# See https://gitlab.com/gitlab-org/gitlab/issues/37093
# gitlab_rails['rack_attack_admin_area_protected_paths_enabled'] = true
###! **We do not recommend changing these directories.** ###! **We do not recommend changing these directories.**
# gitlab_rails['dir'] = "/var/opt/gitlab/gitlab-rails" # gitlab_rails['dir'] = "/var/opt/gitlab/gitlab-rails"
# gitlab_rails['log_directory'] = "/var/log/gitlab/gitlab-rails" # gitlab_rails['log_directory'] = "/var/log/gitlab/gitlab-rails"
@ -1636,6 +1646,7 @@ nginx['listen_https'] = false
# postgres_exporter['env'] = { # postgres_exporter['env'] = {
# 'SSL_CERT_DIR' => "/opt/gitlab/embedded/ssl/certs/" # 'SSL_CERT_DIR' => "/opt/gitlab/embedded/ssl/certs/"
# } # }
# postgres_exporter['sslmode'] = nil
################################################################################ ################################################################################
## Prometheus PgBouncer exporter (EE only) ## Prometheus PgBouncer exporter (EE only)
@ -1810,16 +1821,39 @@ grafana['enable'] = false
# praefect['prometheus_listen_addr'] = "localhost:9652" # praefect['prometheus_listen_addr'] = "localhost:9652"
# praefect['logging_level'] = "warn" # praefect['logging_level'] = "warn"
# praefect['logging_format'] = "json" # praefect['logging_format'] = "json"
# praefect['storage_nodes'] = { # praefect['virtual_storages'] = {
# 'praefect' => { # 'default' => {
# 'address' => 'tcp://12:23:56:78', # 'praefect-internal-0' => {
# 'address' => 'tcp://10.23.56.78:8075',
# 'token' => 'abc123' # 'token' => 'abc123'
# }, # },
# 'praefect-2' => { # 'praefect-internal-1' => {
# 'address' => 'tcp://praefect2.internal', # 'address' => 'tcp://10.76.23.31:8075',
# 'token' => 'xyz456' # 'token' => 'xyz456'
# } # }
# },
# 'alternative' => {
# 'praefect-internal-2' => {
# 'address' => 'tcp://10.34.1.16:8075',
# 'token' => 'abc321'
# },
# 'praefect-internal-3' => {
# 'address' => 'tcp://10.23.18.6:8075',
# 'token' => 'xyz890'
# } # }
# }
# }
# praefect['sentry_dsn'] = "https://<key>:<secret>@sentry.io/<project>"
# praefect['sentry_environment'] = "production"
# praefect['database_host'] = 'postgres.internal'
# praefect['database_port'] = 5432
# praefect['database_user'] = 'praefect'
# praefect['database_password'] = 'secret'
# praefect['database_dbname'] = 'praefect_production'
# praefect['database_sslmode'] = 'disable'
# praefect['database_sslcert'] = '/path/to/client-cert'
# praefect['database_sslkey'] = '/path/to/client-key'
# praefect['database_sslrootcert'] = '/path/to/rootcert'
################################################################################ ################################################################################
# Storage check # Storage check

View file

@ -49,85 +49,6 @@
"default": true "default": true
} }
] ]
},
{
"name": "Backup strategy",
"id": "backup_strategy",
"help": "WARNING: If you disable one of these backup, it will not be restored in case of error, use this feature at your own risk",
"options": [
{
"name": "backup_db",
"ask": {
"en": "Should gitlab backup the database ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
},
{
"name": "backup_uploads",
"ask": {
"en": "Should gitlab backup attachments ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
},
{
"name": "backup_repositories",
"ask": {
"en": "Should gitlab backup git repositories data ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
},
{
"name": "backup_builds",
"ask": {
"en": "Should gitlab backup CI job output logs ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
},
{
"name": "backup_artifacts",
"ask": {
"en": "Should gitlab backup CI job artifacts ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
},
{
"name": "backup_lfs",
"ask": {
"en": "Should gitlab backup LFS objects ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
},
{
"name": "backup_registry",
"ask": {
"en": "Should gitlab backup container registry images ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
},
{
"name": "backup_pages",
"ask": {
"en": "Should gitlab backup pages content ?"
},
"help": "https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup",
"type": "boolean",
"default": true
}
]
} }
] ]
} }

View file

@ -2,7 +2,7 @@
"name": "Gitlab", "name": "Gitlab",
"id": "gitlab", "id": "gitlab",
"packaging_format": 1, "packaging_format": 1,
"version": "12.5.4~ynh1", "version": "12.6.0~ynh1",
"description": { "description": {
"en": "GitLab is a Git-repository manager.", "en": "GitLab is a Git-repository manager.",
"fr": "GitLab est un gestionnaire de dépôts Git." "fr": "GitLab est un gestionnaire de dépôts Git."

View file

@ -32,15 +32,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path) config_path=$(ynh_app_setting_get --app=$app --key=config_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
backup_db=$(ynh_app_setting_get --app="$app" --key=backup_db)
backup_uploads=$(ynh_app_setting_get --app="$app" --key=backup_uploads)
backup_repositories=$(ynh_app_setting_get --app="$app" --key=backup_repositories)
backup_builds=$(ynh_app_setting_get --app="$app" --key=backup_builds)
backup_artifacts=$(ynh_app_setting_get --app="$app" --key=backup_artifacts)
backup_lfs=$(ynh_app_setting_get --app="$app" --key=backup_lfs)
backup_registry=$(ynh_app_setting_get --app="$app" --key=backup_registry)
backup_pages=$(ynh_app_setting_get --app="$app" --key=backup_pages)
#================================================= #=================================================
# STANDARD BACKUP STEPS # STANDARD BACKUP STEPS
#================================================= #=================================================
@ -55,45 +46,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
ynh_script_progression --message="Backuping of Gitlab..." --weight=9 ynh_script_progression --message="Backuping of Gitlab..." --weight=9
to_skip=""
if [ $backup_db -eq 0 ]; then
to_skip="db,"$to_skip
fi
if [ $backup_uploads -eq 0 ]; then
to_skip="uploads,"$to_skip
fi
if [ $backup_repositories -eq 0 ]; then
to_skip="repositories,"$to_skip
fi
if [ $backup_builds -eq 0 ]; then
to_skip="builds,"$to_skip
fi
if [ $backup_artifacts -eq 0 ]; then
to_skip="artifacts,"$to_skip
fi
if [ $backup_lfs -eq 0 ]; then
to_skip="lfs,"$to_skip
fi
if [ $backup_registry -eq 0 ]; then
to_skip="registry,"$to_skip
fi
if [ $backup_pages -eq 0 ]; then
to_skip="pages,"$to_skip
fi
# Use gitlab-rake to backup # Use gitlab-rake to backup
# For the complete doc: https://docs.gitlab.com/ce/raketasks/backup_restore.html # For the complete doc: https://docs.gitlab.com/ce/raketasks/backup_restore.html
# For the filename: https://docs.gitlab.com/ce/raketasks/backup_restore.html#backup-filename # For the filename: https://docs.gitlab.com/ce/raketasks/backup_restore.html#backup-filename
# For the backup strategy: https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup gitlab-backup create BACKUP=last
gitlab-backup create BACKUP=last SKIP=$to_skip
ynh_backup --src_path="/var/opt/$app/backups/last_gitlab_backup.tar" ynh_backup --src_path="/var/opt/$app/backups/last_gitlab_backup.tar"

View file

@ -37,31 +37,6 @@ overwrite_nginx="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX:-$old_overwri
old_use_web_account="$(ynh_app_setting_get --app=$app --key=use_web_account)" old_use_web_account="$(ynh_app_setting_get --app=$app --key=use_web_account)"
use_web_account="${YNH_CONFIG_MAIN_USERS_USE_WEB_ACCOUNT:-$old_use_web_account}" use_web_account="${YNH_CONFIG_MAIN_USERS_USE_WEB_ACCOUNT:-$old_use_web_account}"
# backup_strategy
old_backup_db="$(ynh_app_setting_get --app=$app --key=backup_db)"
backup_db="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_DB:-$old_backup_db}"
old_backup_uploads="$(ynh_app_setting_get --app=$app --key=backup_uploads)"
backup_uploads="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_UPLOADS:-$old_backup_uploads}"
old_backup_repositories="$(ynh_app_setting_get --app=$app --key=backup_repositories)"
backup_repositories="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_REPOSITORIES:-$old_backup_repositories}"
old_backup_builds="$(ynh_app_setting_get --app=$app --key=backup_builds)"
backup_builds="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_BUILDS:-$old_backup_builds}"
old_backup_artifacts="$(ynh_app_setting_get --app=$app --key=backup_artifacts)"
backup_artifacts="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_ARTIFACTS:-$old_backup_artifacts}"
old_backup_lfs="$(ynh_app_setting_get --app=$app --key=backup_lfs)"
backup_lfs="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_LFS:-$old_backup_lfs}"
old_backup_registry="$(ynh_app_setting_get --app=$app --key=backup_registry)"
backup_registry="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_REGISTRY:-$old_backup_registry}"
old_backup_pages="$(ynh_app_setting_get --app=$app --key=backup_pages)"
backup_pages="${YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_PAGES:-$old_backup_pages}"
#================================================= #=================================================
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND # SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
#================================================= #=================================================
@ -75,22 +50,6 @@ show_config() {
ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx" ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx"
ynh_return "YNH_CONFIG_MAIN_USERS_USE_WEB_ACCOUNT=$use_web_account" ynh_return "YNH_CONFIG_MAIN_USERS_USE_WEB_ACCOUNT=$use_web_account"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_DB=$backup_db"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_UPLOADS=$backup_uploads"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_REPOSITORIES=$backup_repositories"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_BUILDS=$backup_builds"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_ARTIFACTS=$backup_artifacts"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_LFS=$backup_lfs"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_REGISTRY=$backup_registry"
ynh_return "YNH_CONFIG_MAIN_BACKUP_STRATEGY_BACKUP_PAGES=$backup_pages"
} }
#================================================= #=================================================
@ -106,23 +65,6 @@ apply_config() {
# Set overwrite_nginx # Set overwrite_nginx
ynh_app_setting_set --app=$app --key=overwrite_nginx --value="$overwrite_nginx" ynh_app_setting_set --app=$app --key=overwrite_nginx --value="$overwrite_nginx"
# Set backup_db
ynh_app_setting_set --app=$app --key=backup_db --value="$backup_db"
# Set backup_uploads
ynh_app_setting_set --app=$app --key=backup_uploads --value="$backup_uploads"
# Set backup_repositories
ynh_app_setting_set --app=$app --key=backup_repositories --value="$backup_repositories"
# Set backup_builds
ynh_app_setting_set --app=$app --key=backup_builds --value="$backup_builds"
# Set backup_artifacts
ynh_app_setting_set --app=$app --key=backup_artifacts --value="$backup_artifacts"
# Set backup_lfs
ynh_app_setting_set --app=$app --key=backup_lfs --value="$backup_lfs"
# Set backup_registry
ynh_app_setting_set --app=$app --key=backup_registry --value="$backup_registry"
# Set backup_pages
ynh_app_setting_set --app=$app --key=backup_pages --value="$backup_pages"
} }
#================================================= #=================================================

View file

@ -217,20 +217,6 @@ newuser.confirmation_token = nil
newuser.save newuser.save
ApplicationSetting.last.update_attributes(password_authentication_enabled_for_web: $use_web_account, signup_enabled: $use_web_account)" | gitlab-rails console ApplicationSetting.last.update_attributes(password_authentication_enabled_for_web: $use_web_account, signup_enabled: $use_web_account)" | gitlab-rails console
#=================================================
# DEFINE THE BACKUP STRATEGY: https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup
#=================================================
ynh_app_setting_set --app=$app --key=backup_db --value=1
ynh_app_setting_set --app=$app --key=backup_uploads --value=1
ynh_app_setting_set --app=$app --key=backup_repositories --value=1
ynh_app_setting_set --app=$app --key=backup_builds --value=1
ynh_app_setting_set --app=$app --key=backup_artifacts --value=1
ynh_app_setting_set --app=$app --key=backup_lfs --value=1
ynh_app_setting_set --app=$app --key=backup_registry --value=1
ynh_app_setting_set --app=$app --key=backup_pages --value=1
#================================================= #=================================================
# RECONFIGURE TO TAKE INTO ACCOUNT CHANGES # RECONFIGURE TO TAKE INTO ACCOUNT CHANGES
#================================================= #=================================================

View file

@ -33,15 +33,6 @@ unicorn_worker_processes=$(ynh_app_setting_get --app="$app" --key=unicorn_worker
client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size) 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) overwrite_nginx=$(ynh_app_setting_get --app="$app" --key=overwrite_nginx)
backup_db=$(ynh_app_setting_get --app="$app" --key=backup_db)
backup_uploads=$(ynh_app_setting_get --app="$app" --key=backup_uploads)
backup_repositories=$(ynh_app_setting_get --app="$app" --key=backup_repositories)
backup_builds=$(ynh_app_setting_get --app="$app" --key=backup_builds)
backup_artifacts=$(ynh_app_setting_get --app="$app" --key=backup_artifacts)
backup_lfs=$(ynh_app_setting_get --app="$app" --key=backup_lfs)
backup_registry=$(ynh_app_setting_get --app="$app" --key=backup_registry)
backup_pages=$(ynh_app_setting_get --app="$app" --key=backup_pages)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
@ -155,39 +146,6 @@ if [ -e "/etc/apt/sources.list.d/gitlab-ce.list" ]; then
ynh_secure_remove --file="/etc/apt/sources.list.d/gitlab-ce.list" ynh_secure_remove --file="/etc/apt/sources.list.d/gitlab-ce.list"
fi fi
# Define the backup strategy: https://docs.gitlab.com/ce/raketasks/backup_restore.html#excluding-specific-directories-from-the-backup
if [ -z "$backup_db" ]; then
ynh_app_setting_set --app=$app --key=backup_db --value=1
fi
if [ -z "$backup_uploads" ]; then
ynh_app_setting_set --app=$app --key=backup_uploads --value=1
fi
if [ -z "$backup_repositories" ]; then
ynh_app_setting_set --app=$app --key=backup_repositories --value=1
fi
if [ -z "$backup_builds" ]; then
ynh_app_setting_set --app=$app --key=backup_builds --value=1
fi
if [ -z "$backup_artifacts" ]; then
ynh_app_setting_set --app=$app --key=backup_artifacts --value=1
fi
if [ -z "$backup_lfs" ]; then
ynh_app_setting_set --app=$app --key=backup_lfs --value=1
fi
if [ -z "$backup_registry" ]; then
ynh_app_setting_set --app=$app --key=backup_registry --value=1
fi
if [ -z "$backup_pages" ]; then
ynh_app_setting_set --app=$app --key=backup_pages --value=1
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================

View file

@ -1,8 +1,8 @@
gitlab_version="12.5.4" gitlab_version="12.6.0"
gitlab_x86_64_source_sha256="f4322459222f65558d345ff048028e91fb21b40fd318eb702737103aa2b09c18" gitlab_x86_64_source_sha256="bedb43836d6f901ae72afec8aa0e94ac4ea99a70f9e652002eaf2f6289682dd3"
gitlab_arm_source_sha256="382890913a38f942f060c604248b3337e6c1da7ee59fb32737617963fb8ce5d4" gitlab_arm_source_sha256="2a2f4725a6231f416d7a804897ee96ecdcbce621e51e6092e8d95afcf58958b1"
gitlab_filename="gitlab-ce-${gitlab_version}.deb" gitlab_filename="gitlab-ce-${gitlab_version}.deb"