OP#414 halfway through aoo config

This commit is contained in:
12ww1160
2026-02-04 12:12:33 +01:00
parent 9c8d601465
commit c354e462d1
4 changed files with 71 additions and 8 deletions

View File

@@ -22,6 +22,8 @@ class confdroid_gitea::main::dirs (
$ga_data_dir,
$ga_log_dir,
$ga_tmp_dir,
$ga_repo_dir,
$ga_uploads_dir,
]:
ensure => 'directory',
mode => '0750',
@@ -29,5 +31,12 @@ class confdroid_gitea::main::dirs (
group => $ga_user,
recurse => true,
}
file { $ga_conf_dir:
ensure => 'directory',
mode => '0770',
owner => 'root',
group => $ga_user,
recurse => true,
}
}
}

View File

@@ -16,5 +16,13 @@ class confdroid_gitea::main::files (
group => $ga_user,
source => "${ga_dl_url}/${ga_dl_version}/gitea-${ga_dl_version}-linux-amd64",
}
file { $ga_config_file:
ensure => 'file',
owner => $ga_user,
group => $ga_user,
mode => '0640',
content => template($ga_config_erb),
}
}
}

View File

@@ -13,6 +13,13 @@
# @param [String] ga_user The system user for Gitea.
# @param [Array] ga_reqpackages The required packages for Gitea.
# @param [String] ga_pkg_ensure The ensure state for required packages.
# @param [String] ga_domain The domain for the Gitea host.
# defaults to 'localhost'.
# @param [String] ga_root_url The root URL for Gitea.
# defaults to 'http://localhost:3000'.
# @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.
##############################################################################
class confdroid_gitea::params (
@@ -24,6 +31,11 @@ class confdroid_gitea::params (
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,
# firewall
Boolean $ga_use_firewall = true,
@@ -44,8 +56,13 @@ class confdroid_gitea::params (
$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_repo_dir = "${ga_data_dir}/git/repositories"
$ga_uploads_dir = "${ga_data_dir}/uploads"
# files
$ga_config_file = "${ga_conf_dir}/app.ini"
$ga_config_erb = 'confdroid_gitea/app.ini.erb'
# includes must be last
include confdroid_gitea::main::config

29
templates/app.ini.erb Normal file
View File

@@ -0,0 +1,29 @@
APP_NAME = Confdroid Git + Container Registry
RUN_MODE = prod
WORK_PATH = <%= @ga_working_dir %>
CUSTOM_PATH = <%= @ga_custom_dir %>
DATA_PATH = <%= @ga_data_dir %>
LOG_PATH = <%= @ga_log_dir %>
TMP_PATH = <%= @ga_tmp_dir %>
[repository]
ROOT = <%= @ga_repo_dir %>
[repository.local]
LOCAL_COPY_PATH = <%= @ga_tmp_dir %>/local-repository
[repository.upload]
TEMP_PATH = <%= @ga_uploads_dir %>
[server]
APP_DATA_PATH = <%= @ga_data_dir %>
DOMAIN = <%= @ga_domain %>
SSH_DOMAIN = <%= @ga_domain %>
HTTP_PORT = <%= @ga_http_port %>
ROOT_URL = <%= @ga_root_url %>
DISABLE_SSH = <%= @ga_disable_ssh %>
SSH_PORT = <%= @ga_ssh_port %>
SSH_LISTEN_PORT = <%= @ga_ssh_port %>
LFS_START_SERVER = <%= @ga_start_lfs %>
START_SSH_SERVER = <%= @ga_start_ssh_server %>