OP#414 finish main app.ini

This commit is contained in:
Arne Teuke
2026-02-04 17:15:25 +01:00
parent 68c4f48a59
commit 6c39347a5d
3 changed files with 162 additions and 29 deletions

View File

@@ -25,6 +25,12 @@ class confdroid_gitea::main::dirs (
$ga_git_dir,
$ga_repo_dir,
$ga_uploads_dir,
$ga_sessions_dir,
$ga_avatars_dir,
$ga_indexer_dir,
$ga_repo_avatars_dir,
$ga_attachments_dir,
$ga_lfs_dir,
]:
ensure => 'directory',
mode => '0750',

View File

@@ -20,46 +20,115 @@
# @param [Boolean] ga_disable_ssh Whether to disable SSH access in Gitea.
# @param [Boolean] ga_start_lfs Whether to start Git LFS support in Gitea.
# @param [Boolean] ga_start_ssh Whether to start SSH support in Gitea.
# @param [String] ga_db_type The database type for Gitea.
# @param [String] ga_db_host The database host for Gitea.
# @param [String] ga_db_port The database port for Gitea.
# @param [String] ga_db_name The database name for Gitea.
# @param [String] ga_db_user The database user for Gitea.
# @param [String] ga_db_password The database password for Gitea.
# @param [Boolean] ga_log_sql Whether to enable SQL query logging
# in Gitea.
# @param [String] ga_ssl_mode The SSL mode for the database connection
# in Gitea.
# @param [String] ga_log_mode The log mode for Gitea.
# @param [String] ga_log_level The log level for Gitea.
# @param [Boolean] ga_install_lock Whether to enable the install lock
# for Gitea.
# @param [String] ga_secret_key The secret key for Gitea.
# @param [String] ga_reverse_proxy_limit The reverse proxy limit
# for Gitea.
# @param [String] ga_reverse_proxy_trusted_proxies The trusted proxies for
# reverse proxy in Gitea.
# @param [Boolean] ga_disable_root_check Whether to disable the root check
# in Gitea.
# @param [Boolean] ga_disable_registration Whether to disable user
# registration in Gitea.
# @param [Boolean] ga_require_signin_view Whether to require sign-in to view
# in Gitea.
# @param [String] ga_admin_username The admin username for Gitea.
# @param [String] ga_admin_password The admin password for Gitea.
# @param [String] ga_admin_email The admin email for Gitea.
# @param [Boolean] ga_enable_packages Whether to allow packages registry
# in Gitea.
# @param [Boolean] ga_enable_registry Whether to allow container registry
# in Gitea.
# @param [String] ga_storage_type The storage type for Gitea.
# @param [String] ga_instance_name The instance name for Gitea.
##############################################################################
class confdroid_gitea::params (
# main
Array $ga_reqpackages = ['git', 'wget', 'tar'],
String $ga_pkg_ensure = 'present',
String $ga_host_fqdn = 'gitea.example.net',
String $ga_opt_dir = '/opt/gitea',
String $ga_dl_url = 'https://dl.gitea.com/gitea',
String $ga_dl_version = '1.25.4',
String $ga_user = 'git',
String $ga_domain = 'localhost',
String $ga_root_url = 'http://localhost:3000',
Boolean $ga_disable_ssh = false,
Boolean $ga_start_lfs = true,
Boolean $ga_start_ssh = false,
Array $ga_reqpackages = ['git', 'wget', 'tar'],
String $ga_pkg_ensure = 'present',
String $ga_host_fqdn = 'gitea.example.net',
String $ga_opt_dir = '/opt/gitea',
String $ga_dl_url = 'https://dl.gitea.com/gitea',
String $ga_dl_version = '1.25.4',
String $ga_user = 'git',
String $ga_domain = 'localhost',
String $ga_root_url = 'http://localhost:3000',
Boolean $ga_disable_ssh = false,
Boolean $ga_start_lfs = true,
Boolean $ga_start_ssh = false,
String $ga_instance_name = 'Your Gitea Instance',
# database
String $ga_db_type = 'postgres',
String $ga_db_host = 'localhost',
String $ga_db_port = '5432',
String $ga_db_name = 'gitea',
String $ga_db_user = 'ChangeMe',
String $ga_db_password = 'ChangeMe',
Boolean $ga_log_sql = false,
String $ga_ssl_mode = 'require',
# logging
String $ga_log_mode = 'file',
String $ga_log_level = 'info',
# security
Boolean $ga_install_lock = false,
String $ga_secret_key = 'ChangeMe1234567890',
String $ga_reverse_proxy_limit = '1',
String $ga_reverse_proxy_trusted_proxies = '*',
Boolean $ga_disable_root_check = true,
String $ga_admin_username = 'admin',
String $ga_admin_password = 'ChangeMeAdmin123!',
String $ga_admin_email = 'admin@example.com',
# service
Boolean $ga_disable_registration = false,
Boolean $ga_require_signin_view = false,
Boolean $ga_enable_packages = true,
Boolean $ga_enable_registry = true,
String $ga_storage_type = 'filesystem',
# firewall
Boolean $ga_use_firewall = true,
String $ga_http_port = '3000',
String $ga_ssh_port = '22',
String $ga_order_prefix = '50',
Boolean $ga_use_firewall = true,
String $ga_http_port = '3000',
String $ga_ssh_port = '22',
String $ga_order_prefix = '50',
) {
# facts
$fqdn = $facts['networking']['fqdn']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
$fqdn = $facts['networking']['fqdn']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
# directories
$ga_working_dir ='/var/lib/gitea'
$ga_custom_dir = "${ga_working_dir}/custom"
$ga_data_dir = "${ga_working_dir}/data"
$ga_log_dir = "${ga_working_dir}/log"
$ga_tmp_dir = "${ga_working_dir}/tmp"
$ga_conf_dir = '/etc/gitea'
$ga_git_dir = "${ga_data_dir}/git"
$ga_repo_dir = "${ga_git_dir}/repositories"
$ga_uploads_dir = "${ga_data_dir}/uploads"
$ga_working_dir ='/var/lib/gitea'
$ga_custom_dir = "${ga_working_dir}/custom"
$ga_data_dir = "${ga_working_dir}/data"
$ga_log_dir = "${ga_working_dir}/log"
$ga_tmp_dir = "${ga_working_dir}/tmp"
$ga_conf_dir = '/etc/gitea'
$ga_git_dir = "${ga_data_dir}/git"
$ga_repo_dir = "${ga_git_dir}/repositories"
$ga_uploads_dir = "${ga_data_dir}/uploads"
$ga_indexer_dir = "${ga_data_dir}/indexers"
$ga_sessions_dir = "${ga_data_dir}/sessions"
$ga_avatars_dir = "${ga_data_dir}/avatars"
$ga_repo_avatars_dir = "${ga_data_dir}/repo-avatars"
$ga_attachments_dir = "${ga_data_dir}/attachments"
$ga_lfs_dir = "${ga_data_dir}/lfs"
# files
$ga_config_file = "${ga_conf_dir}/app.ini"

View File

@@ -27,5 +27,63 @@ SSH_LISTEN_PORT = <%= @ga_ssh_port %>
LFS_START_SERVER = <%= @ga_start_lfs %>
START_SSH_SERVER = <%= @ga_start_ssh %>
[database]
DB_TYPE = <%= @ga_db_type %>
PATH = <%= @ga_data_dir %>/gitea.db
HOST = <%= @ga_db_host %>:<%= @ga_db_port %>
NAME = <%= @ga_db_name %>
USER = <%= @ga_db_user %>
PASSWD = <%= @ga_db_password %>
LOG_SQL = <%= @ga_log_sql %>
SSL_MODE = <%= @ga_ssl_mode %>
[indexer]
ISSUE_INDEXER_PATH = <%= @ga_indexer_dir %>/issues.bleve
COMMENT_INDEXER_PATH = <%= @ga_indexer_dir %>/comments.bleve
[session]
PROVIDER_CONFIG = <%= @ga_sessions_dir %>
[picture]
AVATAR_UPLOAD_PATH = <%= @ga_avatars_dir %>
REPOSITORY_AVATAR_UPLOAD_PATH = <%= @ga_repo_avatars_dir %>
[attachment]
PATH = <%= @ga_attachments_dir %>
[log]
ROOT_PATH = <%= @ga_log_dir %>
MODE = <%= @ga_log_mode %>
LEVEL = <%= @ga_log_level %>
[security]
INSTALL_LOCK = <%= @ga_install_lock %>
SECRET_KEY = <%= @ga_secret_key %>
REVERSE_PROXY_LIMIT = <%= @ga_reverse_proxy_limit %>
REVERSE_PROXY_TRUSTED_PROXIES = <%= @ga_reverse_proxy_trusted_proxies %>
DISABLE_ROOT_CHECK = <%= @ga_disable_root_check %>
[service]
DISABLE_REGISTRATION = <%= @ga_disable_registration %>
REQUIRE_SIGNIN_VIEW = <%= @ga_require_signin_view %>
[lfs]
PATH = <%= @ga_lfs_dir %>
[admin]
USER = <%= @ga_admin_username %>
PASSWORD = <%= @ga_admin_password %>
EMAIL = <%= @ga_admin_email %>
[packages]
ENABLE = <%= @ga_enable_packages %>
[registry]
ENABLED = <%= @ga_enable_registry %>
STORAGE_TYPE = <%= @ga_storage_type %>
[app]
NAME = <%= @ga_instance_name %>