OP#414 add user control
This commit is contained in:
@@ -23,6 +23,7 @@ Installation
|
||||
|
||||
Configuration
|
||||
|
||||
- install required system user
|
||||
- manage directory structure
|
||||
- manage configuration files
|
||||
- file system permissions
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
class confdroid_gitea::firewall::iptables (
|
||||
|
||||
) inherits confdroid_gitea::params {
|
||||
if $ga_use_firewall == true {
|
||||
if ($ga_use_firewall == true) and ($ga_host_fqdn == $fqdn) {
|
||||
firewall { "${ga_order_prefix}${ga_http_port} allow gitea http port ${ga_http_port}":
|
||||
proto => 'tcp',
|
||||
dport => $ga_http_port,
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
class confdroid_gitea::main::dirs (
|
||||
|
||||
) inherits confdroid_gitea::params {
|
||||
require confdroid_gitea::main::files
|
||||
require confdroid_gitea::main::user
|
||||
}
|
||||
|
||||
@@ -6,5 +6,15 @@
|
||||
class confdroid_gitea::main::files (
|
||||
|
||||
) inherits confdroid_gitea::params {
|
||||
require confdroid_gitea::main::user
|
||||
if $ga_host_fqdn == $fqdn {
|
||||
require confdroid_gitea::main::dirs
|
||||
|
||||
file { "${ga_working_dir}/gitea":
|
||||
ensure => 'file',
|
||||
mode => '0755',
|
||||
owner => $ga_user,
|
||||
group => $ga_user,
|
||||
source => "${ga_dl_url}/gitea/${ga_dl_version}/gitea-${ga_dl_version}-linux-amd64",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
## confdroid_gitea::main::install.pp
|
||||
# Module name: confdroid_gitea
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary manages the installation for the confdroid_gitea Puppet module.
|
||||
##############################################################################
|
||||
class confdroid_gitea::main::install (
|
||||
|
||||
) inherits confdroid_gitea::params {
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
class confdroid_gitea::main::service (
|
||||
|
||||
) inherits confdroid_gitea::params {
|
||||
require confdroid_gitea::firewall::iptables
|
||||
require confdroid_gitea::main::dirs
|
||||
if $ga_host_fqdn == $fqdn {
|
||||
require confdroid_gitea::firewall::iptables
|
||||
require confdroid_gitea::main::files
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,12 @@
|
||||
class confdroid_gitea::main::user (
|
||||
|
||||
) inherits confdroid_gitea::params {
|
||||
require confdroid_gitea::main::install
|
||||
if $ga_host_fqdn == $fqdn {
|
||||
user { $ga_user:
|
||||
ensure => 'present',
|
||||
managehome => true,
|
||||
shell => '/bin/false',
|
||||
system => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,21 @@
|
||||
# @param [String] ga_http_port The main port number for Gitea.
|
||||
# @param [String] ga_ssh_port The SSH port number for Gitea.
|
||||
# @param [String] ga_order_prefix The order prefix for firewall rules.
|
||||
# @param [String] ga_host_fqdn The FQDN for the Gitea host.
|
||||
# @param [String] ga_working_dir The working directory for Gitea.
|
||||
# @param [String] ga_dl_url The download URL for Gitea.
|
||||
# @param [String] ga_dl_version The version of Gitea to download.
|
||||
# @param [String] ga_user The system user for Gitea.
|
||||
##############################################################################
|
||||
class confdroid_gitea::params (
|
||||
|
||||
# main
|
||||
String $ga_host_fqdn = 'gitea.example.net',
|
||||
String $ga_working_dir = '/opt/gitea',
|
||||
String $ga_dl_url = 'https://dl.gitea.com/gitea',
|
||||
String $ga_dl_version = '1.25.4',
|
||||
String $ga_user = 'git',
|
||||
|
||||
# firewall
|
||||
Boolean $ga_use_firewall = true,
|
||||
String $ga_http_port = '3000',
|
||||
|
||||
Reference in New Issue
Block a user