Documentation by YARD 0.9.36
+Alphabetic Index
+ +Puppet Class Listing A-Z
+ + +
+
+
+
|
+
File Listing
+-
+
+
+
- README + + +
diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 348d4b4..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,124 +0,0 @@ -pipeline { - agent any - - post { - always { - deleteDir() /* clean up our workspace */ - } - success { - updateGitlabCommitStatus state: 'success' - } - failure { - updateGitlabCommitStatus state: 'failed' - step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'support@confdroid.com', sendToIndividuals: true]) - } - } - - options { - gitLabConnection('gitlab.confdroid.com') - } - - stages { - - stage('pull master') { - steps { - sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) { - sh ''' - git config user.name "Jenkins Server" - git config user.email jenkins@confdroid.com - # Ensure we're on the development branch (triggered by push) - git checkout development - # Create jenkins branch from development - git checkout -b jenkins-build-$BUILD_NUMBER - # Optionally merge master into jenkins to ensure compatibility - git merge origin/master --no-ff || { echo "Merge conflict detected"; exit 1; } - ''' - } - } - } - - stage('puppet parser') { - steps { - sh '''for file in $(find . -iname \'*.pp\'); do - /opt/puppetlabs/bin/puppet parser validate --color false --render-as s --modulepath=modules $file || exit 1; - done;''' - } - } - - stage('check templates') { - steps{ - sh '''for file in $(find . -iname \'*.erb\'); - do erb -P -x -T "-" $file | ruby -c || exit 1; - done;''' - } - } - - stage('puppet-lint') { - steps { - sh '''/usr/local/bin/puppet-lint . \\ - --no-variable_scope-check \\ - || { echo "Puppet lint failed"; exit 1; } - ''' - } - } - - stage('SonarScan') { - steps { - withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) { - sh ''' - /opt/sonar-scanner/bin/sonar-scanner \ - -Dsonar.projectKey=confdroid_gitea \ - -Dsonar.sources=. \ - -Dsonar.host.url=https://sonarqube.confdroid.com \ - -Dsonar.token=$SONAR_TOKEN - ''' - } - } - } - - stage('create Puppet documentation') { - steps { - sh '/opt/puppetlabs/bin/puppet strings' - } - } - - stage('update repo') { - steps { - sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) { - sh ''' - git config user.name "Jenkins Server" - git config user.email jenkins@confdroid.com - git rm -r --cached .vscode || echo "No .vscode to remove from git" - git add -A && git commit -am "Recommit for updates in build $BUILD_NUMBER" || echo "No changes to commit" - git push origin HEAD:master - ''' - } - } - } - - stage('Mirror to Gitea') { - steps { - withCredentials([usernamePassword( - credentialsId: 'Jenkins-gitea', - usernameVariable: 'GITEA_USER', - passwordVariable: 'GITEA_TOKEN')]) { - script { - // Checkout from GitLab (already done implicitly) - sh ''' - git checkout master - git pull origin master - git branch -D development - git branch -D jenkins-build-$BUILD_NUMBER - git rm -f Jenkinsfile - git rm -r --cached .vscode || echo "No .vscode to remove from git" - git commit --amend --no-edit --allow-empty - git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_gitea.git - git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ - push master --mirror - ''' - } - } - } - } - } -} \ No newline at end of file diff --git a/doc/_index.html b/doc/_index.html new file mode 100644 index 0000000..c9497da --- /dev/null +++ b/doc/_index.html @@ -0,0 +1,153 @@ + + +
+ + +
+
+
+
|
+
| t |
+ + + +6 +7 +8+ |
+
+ # File 'manifests/init.pp', line 6
+
+class confdroid_gitea {
+ include confdroid_gitea::params
+}
+ |
+
confdroid_gitea::firewall::iptables.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23+ |
+
+ # File 'manifests/firewall/iptables.pp', line 6
+
+class confdroid_gitea::firewall::iptables (
+
+) inherits confdroid_gitea::params {
+ 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,
+ jump => 'accept',
+ }
+ if $ga_start_ssh != false {
+ firewall { "${ga_order_prefix}${ga_ssh_port} allow gitea ssh port ${ga_ssh_port}":
+ proto => 'tcp',
+ dport => $ga_ssh_port,
+ jump => 'accept',
+ }
+ }
+ }
+}
+ |
+
confdroid_gitea::main::config.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15+ |
+
+ # File 'manifests/main/config.pp', line 6
+
+class confdroid_gitea::main::config (
+
+) inherits confdroid_gitea::params {
+ include confdroid_gitea::main::service
+
+ exec { 'systemd-daemon-reload':
+ command => '/bin/systemctl daemon-reload',
+ refreshonly => true,
+ }
+}
+ |
+
confdroid_gitea::main::dirs.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46+ |
+
+ # File 'manifests/main/dirs.pp', line 6
+
+class confdroid_gitea::main::dirs (
+
+) inherits confdroid_gitea::params {
+ if $ga_host_fqdn == $fqdn {
+ require confdroid_gitea::main::user
+ file { $ga_opt_dir:
+ ensure => 'directory',
+ mode => '0750',
+ owner => $ga_user,
+ group => $ga_user,
+ }
+
+ file { [
+ $ga_working_dir,
+ $ga_custom_dir,
+ $ga_data_dir,
+ $ga_log_dir,
+ $ga_tmp_dir,
+ $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',
+ owner => $ga_user,
+ group => $ga_user,
+ }
+ file { $ga_conf_dir:
+ ensure => 'directory',
+ mode => '0770',
+ owner => 'root',
+ group => $ga_user,
+ }
+ }
+}
+ |
+
confdroid_gitea::main::files.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44+ |
+
+ # File 'manifests/main/files.pp', line 6
+
+class confdroid_gitea::main::files (
+
+) inherits confdroid_gitea::params {
+ if $ga_host_fqdn == $fqdn {
+ require confdroid_gitea::main::dirs
+
+ file { "${ga_opt_dir}/gitea":
+ ensure => 'file',
+ mode => '0755',
+ owner => $ga_user,
+ group => $ga_user,
+ source => "${ga_dl_url}/${ga_dl_version}/gitea-${ga_dl_version}-linux-amd64",
+ }
+
+ file { '/usr/local/bin/gitea':
+ ensure => 'link',
+ owner => $ga_user,
+ group => $ga_user,
+ target => "${ga_opt_dir}/gitea",
+ }
+
+ file { $ga_config_file:
+ ensure => 'file',
+ owner => $ga_user,
+ group => $ga_user,
+ mode => '0640',
+ content => template($ga_config_erb),
+ }
+
+ file { $ga_service_file:
+ ensure => 'file',
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ content => template($ga_service_erb),
+ notify => Exec['systemd-daemon-reload'],
+ }
+ }
+}
+ |
+
confdroid_gitea::main::install.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14+ |
+
+ # File 'manifests/main/install.pp', line 6
+
+class confdroid_gitea::main::install (
+
+) inherits confdroid_gitea::params {
+ if $ga_host_fqdn == $fqdn {
+ package { $ga_reqpackages:
+ ensure => $ga_pkg_ensure,
+ }
+ }
+}
+ |
+
confdroid_gitea::main::service.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22+ |
+
+ # File 'manifests/main/service.pp', line 6
+
+class confdroid_gitea::main::service (
+
+) inherits confdroid_gitea::params {
+ if $ga_host_fqdn == $fqdn {
+ require confdroid_gitea::firewall::iptables
+ require confdroid_gitea::main::files
+
+ service { $ga_service_name:
+ ensure => 'running',
+ enable => true,
+ hasrestart => true,
+ hasstatus => true,
+ require => File[$ga_service_file],
+ subscribe => File[$ga_config_file],
+ }
+ }
+}
+ |
+
confdroid_gitea::main::user.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18+ |
+
+ # File 'manifests/main/user.pp', line 6
+
+class confdroid_gitea::main::user (
+
+) inherits confdroid_gitea::params {
+ if $ga_host_fqdn == $fqdn {
+ require confdroid_gitea::main::install
+ user { $ga_user:
+ ensure => 'present',
+ managehome => true,
+ shell => '/bin/false',
+ system => true,
+ }
+ }
+}
+ |
+
confdroid_gitea::params.pp Module name: confdroid_gitea Author: 12ww1160 (12ww1160@confdroid.com) @param [String] ga_admin_allow_create_organization Whether to allow admin to create organizations in Gitea.
+ +
+ + + +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167+ |
+
+ # File 'manifests/params.pp', line 73
+
+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,
+ String $ga_instance_name = 'Your Gitea Instance',
+ String $ga_lfs_jwt_secret = 'ChangeMeLFSJWTSecret',
+ Boolean $ga_use_proxy_protocol = false,
+ String $ga_public_url_detection = 'auto',
+ Boolean $ga_qos_enabled = true,
+ String $ga_qos_max_waiting = '100',
+ String $ga_qos_target_wait_time = '250ms',
+
+ # 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 = true,
+ 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',
+ String $ga_admin_allow_create_organization = 'true',
+ String $ga_internal_token = 'ChangeMeInternalToken',
+ String $ga_jwt_secret = 'ChangeMeJWTSecret',
+ # 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',
+
+) {
+# facts
+ $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_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"
+ $ga_config_erb = 'confdroid_gitea/app.ini.erb'
+ $ga_service_file = '/etc/systemd/system/gitea.service'
+ $ga_service_erb = 'confdroid_gitea/gitea_service.erb'
+
+# Service
+ $ga_service_name = 'gitea'
+
+# includes must be last
+ include confdroid_gitea::main::config
+}
+ |
+