Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 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
- Puppet >= 7.0.0 < 9.0.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'h0tw1r3-gitea', '3.2.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, which will install the latest
tested version in /opt/gitea
.
include gitea
To install a version that has not been tested with this module, you must provide the release sha256 checksum:
class { 'gitea':
version => '1.17.0',
checksum => 'bc4a8e1f5d5f64d4be2e50c387de08d07c062aecdba2f742c2f61c20accfcc46',
}
To customize the Gitea configuration, use the custom_configuration
parameter
(merged with defaults in common.yaml).
Refer to Gitea's Config Cheat Sheet for most settings and defaults.
Each section in the cheat sheet is labeled by a human name and the
config section in parentheses. The config section is a top level key
of the custom_configuration
hash, except DEFAULT which is an empty string.
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',
},
}
}
Custom files allow you to add themes, override built-in templates, or serve additional files.
Use the gitea::custom::file
resource to manage files in Gitea's custom
directory. Subdirectories are automatically created for you.
gitea::custom::file { 'public/assets/css/custom.css':
content => file('profile/gitea/custom.css'),
}
gitea::custom::file { 'public/assets/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 unit tests:
pdk validate
pdk test unit
Use the PDK to execute acceptance tests (requires docker):
pdk bundle exec rake acceptance
Use the PDK to update the reference documentation.
pdk bundle exec rake strings:generate:reference
Acknowledgements
This 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
: Returns source, checksum, and checksum_type params for downloading a gitea release with the archive resourcegitea::installed_version
: Returns the installed gitea version
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',
}
Install compatible build from URL
class { 'gitea':
ensure => 'https://codeberg.org/forgejo/forgejo/releases/download/v1.21.6-0/forgejo-1.21.6-0-linux-amd64',
checksum => 'e86f446236a287b9ba2c65f8ff7b0a9ea4f451a5ffc3134f416f751e1eecf97c',
}
Parameters
The following parameters are available in the gitea
class:
manage_user
manage_group
manage_home
owner
group
umask
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
umask
Data type: Pattern[/[0-7]{4}/]
UMask of service process
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'],Stdlib::HTTPUrl]
Version of gitea to install, 'installed', 'latest', or URL a to release binary
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[Enum['file','absent']]
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
Returns source, checksum, and checksum_type params for downloading a gitea release with the archive resource
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
Returns the installed gitea version
gitea::installed_version(String $a)
The gitea::installed_version function.
Returns: Variant[String,Undef]
a
Data type: String
Changelog
All notable changes to this project will be documented in this file.
Release 3.2.0 (2024-02-23)
Features
- Support installing directly from URL
Release 3.1.0 (2023-11-21)
Features
- Stage and check updates
- Service umask parameter
- Checksums added for releases up to 1.21.0
Release 3.0.0 (2023-07-23)
Features
- Gitea 1.20+ support
Fixes
- Idempotency on install
Breaking Changes
- Drop support for Puppet 6
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 (>= 8.5.0 < 10.0.0)
- puppetlabs-inifile (>= 6.0.0 < 8.0.0)
- puppet-archive (>= 7.0.0 < 8.0.0)
- puppet-extlib (>= 6.0.0 < 8.0.0)
- puppet-systemd (>= 5.0.0 < 7.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.