Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
- Puppet >= 5.10.0 < 8.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'h0tw1r3-gitea', '2.0.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-gitea
Setup
This module downloads a pre-built binary from the Gitea project releases
page. No external package repositories are required. You can choose to install
Gitea with default settings, or customize them using the
custom_configuration
class parameter.
Examples
The simplest use case is to rely on defaults. This can be done by simply including the class:
include gitea
To install a specific version, you must provide the sha256 checksum:
class { 'gitea':
version => '1.17.0',
checksum => 'bc4a8e1f5d5f64d4be2e50c387de08d07c062aecdba2f742c2f61c20accfcc46',
}
Custom configuration example:
class { 'gitea':
custom_configuration => {
'' => {
'APP_NAME' => 'Internal Code Projects',
},
'server' => {
'ROOT_URL' => 'https://example.com/git/',
},
'ui' => {
'SHOW_USER_EMAIL' => 'false',
'MAX_DISPLAY_FILE_SIZE' => '4194304',
},
'ui.meta' => {
'DESCRIPTION' => 'My self-hosted code project service',
'KEYWORDS' => 'git,self-hosted',
},
'indexer' => {
'REPO_INDEXER_ENABLED' => true,
},
'cache' => {
'ADAPTER' => 'redis',
'HOST' => 'network=tcp,addr=127.0.0.1:6379,db=0,pool_size=100,idle_timeout=180',
},
'session' => {
'PROVIDER' => 'redis',
'PROVIDER_CONFIG' => 'network=tcp,addr=127.0.0.1:6379,db=0,pool_size=100,idle_timeout=180',
},
}
}
If you need to support custom files, use the gitea::custom::file
resource:
gitea::custom::file { 'public/css/custom.css':
source => 'puppet:///modules/profile/gitea/custom.css',
}
gitea::custom::file { 'public/img/logo.svg':
source => 'puppet:///modules/profile/gitea/logo.svg',
}
Tests
When submitting pull requests, please make sure that the module documentation, test cases, and syntax checks pass.
Use the PDK to validate and execute tests:
pdk validate
pdk test unit
Use the PDK to update the reference documentation.
pdk bundle exec rake strings:generate:reference
Acknowledgements
lThis module was forked from kogitoapp/gitea and is NOT compatible.
Reference
Table of Contents
Classes
Public Classes
gitea
: main class includes all other classes
Private Classes
gitea::config
: manages configuration filesgitea::install
: download and install giteagitea::service
: manage service stategitea::service::user
: creates gitea service user
Defined types
gitea::custom::file
: gitea custom file
Functions
gitea::archive_resource
gitea::installed_version
: https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md#the-4x-api
Classes
gitea
Install Gitea, a painless self-hosted Git service. Review module hiera for default parameter values.
- See also
Examples
Basic usage
include gitea
Install current supported release
class { 'gitea':
ensure => 'installed',
}
Install latest release and keep upgraded
class { 'gitea':
ensure => 'latest',
}
Install specific supported version
class { 'gitea':
ensure => '1.18.0',
}
Install specific version not directly supported
class { 'gitea':
ensure => '1.17.0',
checksum => 'bc4a8e1f5d5f64d4be2e50c387de08d07c062aecdba2f742c2f61c20accfcc46',
}
Parameters
The following parameters are available in the gitea
class:
manage_user
manage_group
manage_home
owner
group
home
proxy
base_url
ensure
checksum
work_path
default_configuration
custom_configuration
manage_service
service_epp
tmpfile_epp
robots_txt
run_path
manage_user
Data type: Boolean
Should we manage provisioning the user?
manage_group
Data type: Boolean
Should we manage provisioning the group?
manage_home
Data type: Boolean
Should we manage provisioning the home directory?
owner
Data type: String
The user owning gitea
group
Data type: String
The group owning gitea
home
Data type: Optional[String]
Qualified path to the user home directory
proxy
Data type: Optional[String]
Download gitea release via specified proxy
base_url
Data type: String
Download base URL
ensure
Data type: Variant[Pattern[/\d+\.\d+\.\d+/],Enum['latest','installed']]
Version of gitea to install, 'installed', or 'latest'
checksum
Data type: Optional[String]
Checksum for the release binary
Default value: undef
work_path
Data type: String
Target directory for the gitea installation
default_configuration
Data type: Hash
Settings for configuring Gitea. A simple working configuration is provided (see hiera). Generally this parameter should NOT be provided. Instead set the custom_configuration parameter to override built-in defaults.
custom_configuration
Data type: Hash
Override default configuration for configuring Gitea.
The value is merged with the default_configuration
parameter value.
manage_service
Data type: Boolean
Should we manage a service definition for Gitea?
service_epp
Data type: String
Path to service epp template file
tmpfile_epp
Data type: String
Path to tmpfile epp template file
robots_txt
Data type: String
Allows to provide a http://www.robotstxt.org/ file to restrict crawling
run_path
Data type: String
Path to service runtime path
Defined types
gitea::custom::file
Manage files in the Gitea CustomPath
folder
Examples
custom css
gitea::custom::file { 'public/css/custom.css':
content => file('profile/gitea/custom.css'),
}
custom logo
gitea::custom::file { 'public/img/logo.svg':
source => 'puppet:///modules/profile/gitea/logo.svg',
}
Parameters
The following parameters are available in the gitea::custom::file
defined type:
ensure
Data type: Optional[Variant[String,Boolean]]
Passed to File resource
Default value: undef
source
Data type: Variant[String,Undef]
Passed to File resource
Default value: undef
content
Data type: Variant[String,Undef]
Passed to File resource
Default value: undef
recurse
Data type: Variant[Boolean,Enum['remote']]
Passed to File resource
Default value: false
Functions
gitea::archive_resource
Type: Ruby 4.x API
The gitea::archive_resource function.
gitea::archive_resource(String $gitea_bin, String $base_url, Hash $checksums, String $version, Optional[Variant[String,Undef]] $checksum_value)
The gitea::archive_resource function.
Returns: Hash
gitea_bin
Data type: String
base_url
Data type: String
checksums
Data type: Hash
version
Data type: String
checksum_value
Data type: Optional[Variant[String,Undef]]
gitea::installed_version
Type: Ruby 4.x API
https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md#the-4x-api
gitea::installed_version(String $a)
https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md#the-4x-api
Returns: Variant[String,Undef]
a
Data type: String
Changelog
All notable changes to this project will be documented in this file.
Release 2.0.0 (2023-02-02)
Features
ensure
parameter acceptslatest
performs automatic incremental upgrades
Breaking Changes
version
class parameter changed toensure
Release 1.3.0 (2023-01-10)
Features
- Deploy Gitea 1.18.0
Fixes
- Manage owner of custom/app.ini
Release 1.0.0 (2022-11-21)
Features
- Initial release
This is an incompatible fork of the kogitoapp/gitea module.
Dependencies
- puppetlabs-stdlib (>= 4.14.0 < 9.0.0)
- puppetlabs-inifile (>= 4.2.0 < 6.0.0)
- puppet-archive (>= 4.5.0 < 7.0.0)
- puppet-extlib (>= 4.5.0 < 7.0.0)
- puppet-systemd (>= 3.10.0 < 4.0.0)
Copyright (c) 2022 Jeffrey Clark <https://github.com/h0tw1r3> Copyright (c) 2016-2019 Kogito UG <https://kogitoapp.com/> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.