feat: refacter gitea profile

- move more data to hiera
- change how the custom_configuration is made
This commit is contained in:
2024-06-01 14:32:23 +10:00
parent 6a9580b199
commit 4bd3310ea8
3 changed files with 56 additions and 43 deletions
+15 -42
View File
@@ -1,7 +1,13 @@
# profiles::gitea::init
class profiles::gitea::init (
String $mysql_pass = '',
String $lfs_jwt_secret = '',
Hash $root = {},
Hash $server = {},
Hash $database = {},
Hash $repository = {},
Hash $session = {},
Hash $lfs = {},
Hash $ui = {},
) {
include profiles::nginx::simpleproxy
@@ -10,46 +16,13 @@ class profiles::gitea::init (
ensure => '1.22.0',
checksum => 'a31086f073cb9592d28611394b2de3655db515d961e4fdcf5b549cb40753ef3d',
custom_configuration => {
'' => {
'APP_NAME' => 'Gitea',
'RUN_USER' => 'git',
'RUN_MODE' => 'prod',
},
'repository' => {
'ROOT' => '/data/gitea/repos',
'FORCE_PRIVATE' => false,
'MAX_CREATION_LIMIT' => -1,
'DISABLE_HTTP_GIT' => false,
'DEFAULT_BRANCH' => 'main',
'DEFAULT_PRIVATE' => 'last',
},
'ui' => {
'SHOW_USER_EMAIL' => false,
},
'server' => {
'PROTOCOL' => 'http',
'DOMAIN' => 'git.query.consul',
'ROOT_URL' => 'https://git.query.consul',
'HTTP_ADDR' => '0.0.0.0',
'HTTP_PORT' => 3000,
'START_SSH_SERVER' => false,
'SSH_DOMAIN' => 'git.query.consul',
'SSH_PORT' => 2222,
'SSH_LISTEN_HOST' => '0.0.0.0',
'OFFLINE_MODE' => true,
'APP_DATA_PATH' => '/var/lib/gitea/data',
'SSH_LISTEN_PORT' => 22,
},
'database' => {
'DB_TYPE' => 'mysql',
'HOST' => 'mariadb-prod.service.au-syd1.consul:3306',
'NAME' => 'gitea',
'USER' => 'gitea',
'PASSWD' => Sensitive($mysql_pass),
'SSL_MODE' => 'disable',
'PATH' => '/var/lib/gitea/data/gitea.db',
'LOG_SQL' => false,
},
}
'' => $root,
server => $server,
database => $database,
repository => $repository,
session => $session,
lfs => $lfs,
ui => $ui,
},
}
}