summaryrefslogtreecommitdiff
path: root/modules/cgit/manifests
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-12 02:26:25 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-12 02:26:25 +0100
commitdd28dcf3d620a4ac7d0a1532b812213cf094cd3c (patch)
treea3fa8c8ef446de2bcc2f317bceb4bca868f7e0f0 /modules/cgit/manifests
parentMove webdav into profiles. (diff)
downloadwebdav_server-dd28dcf3d620a4ac7d0a1532b812213cf094cd3c.tar.gz
webdav_server-dd28dcf3d620a4ac7d0a1532b812213cf094cd3c.tar.xz
Revert "Move webdav into profiles."
It actually reverts the non-need for the nginx module webdav_ext. Since Omnifocus requires PROPFIND. This reverts commit edf6ffe8b399679ba28cc5e558a6838919dd1ee8.
Diffstat (limited to '')
-rw-r--r--modules/cgit/manifests/init.pp90
-rw-r--r--modules/cgit/manifests/nginx.pp84
2 files changed, 0 insertions, 174 deletions
diff --git a/modules/cgit/manifests/init.pp b/modules/cgit/manifests/init.pp
deleted file mode 100644
index 1444d0d..0000000
--- a/modules/cgit/manifests/init.pp
+++ /dev/null
@@ -1,90 +0,0 @@
-class cgit (
- String $root = '/var/www/cgit',
- String $filterpath = '/usr/lib/cgit/extra-filters',
- String $root_title,
- String $root_desc,
- String $about_filter,
- String $auth_filter,
- String $source_filter,
- String $scan_path,
- Array[String] $clone_url,
- Boolean $enable_http_clone = false,
- Array[String] $public_repos = [],
- Array[Struct[{
- name => String,
- pass => String }]] $users = [],
- Variant[Boolean, Enum['nginx']] $manage_server = false,
- Optional[String] $server_name = undef,
- Optional[String] $certname = undef,
- String $htpasswd = '/var/lib/nginx/cgit-htpasswd',
-) {
-
- # TODO figure out where CSS comes from
-
- ensure_packages([
- 'git',
- 'cgit',
- ], { ensure => installed })
-
- file { '/etc/cgitrc':
- ensure => file,
- content => epp('cgit/cgitrc.epp'),
- }
-
- file { "${root}/logo":
- ensure => directory,
- }
-
- file { "${root}/logo/logo.png":
- ensure => file,
- source => 'puppet:///modules/cgit/logo.png',
- }
-
- file { "${root}/logo/logo_large.png":
- ensure => file,
- source => 'puppet:///modules/cgit/logo_large.png',
- }
-
- file { "${root}/root_readme":
- ensure => file,
- source => 'puppet:///modules/cgit/root_readme',
- }
-
- file { dirname($filterpath):
- ensure => directory,
- }
-
- file { $filterpath:
- ensure => directory,
- }
-
- [$about_filter, $source_filter].each |$f| {
- file { "${filterpath}/${f}":
- ensure => file,
- source => "puppet:///modules/cgit/filters/${f}",
- mode => stdlib::extname($f) ? {
- '.lua' => '0444',
- default => '0555',
- },
- }
- }
-
- file { "${filterpath}/${auth_filter}":
- ensure => file,
- content => epp("cgit/${auth_filter}.epp"),
- mode => '0444',
- }
-
- if $manage_server {
- if $server_name == undef {
- fail('server_name must be set if manage_server is set')
- }
- }
-
- case $manage_server {
- false: {}
- 'nginx': {
- include ::cgit::nginx
- }
- }
-}
diff --git a/modules/cgit/manifests/nginx.pp b/modules/cgit/manifests/nginx.pp
deleted file mode 100644
index 329c21d..0000000
--- a/modules/cgit/manifests/nginx.pp
+++ /dev/null
@@ -1,84 +0,0 @@
-class cgit::nginx {
-
- if ($cgit::certname == undef) {
- nginx::resource::server { 'cgit':
- server_name => [ $cgit::server_name, ],
- access_log => 'absent',
- error_log => 'absent',
- index_files => [],
- try_files => [ '$uri', '@cgit' ],
- ssl => false,
- use_default_location => true,
- www_root => $cgit::root,
- }
- } else {
- nginx::resource::server { 'cgit':
- server_name => [ $cgit::server_name, ],
- access_log => 'absent',
- error_log => 'absent',
- index_files => [],
- try_files => [ '$uri', '@cgit' ],
- ssl => true,
- ssl_cert => "/etc/letsencrypt/live/${cgit::certname}/fullchain.pem",
- ssl_key => "/etc/letsencrypt/live/${cgit::certname}/privkey.pem",
- use_default_location => true,
- www_root => $cgit::root,
- ssl_redirect => true,
- }
- }
-
- nginx::resource::location { '@cgit':
- fastcgi_params => 'fastcgi_params',
- fastcgi_param => {
- 'SCRIPT_FILENAME' => '/usr/lib/cgit/cgit.cgi',
- 'PATH_INFO' => '$fastcgi_script_name',
- 'QUERY_STRING' => '$args',
- },
- ssl_only => $cgit::certname != undef,
- fastcgi => 'unix:/run/fcgiwrap.socket',
- server => [
- 'cgit',
- ],
- }
-
- file { $cgit::htpasswd:
- ensure => file,
- content => $cgit::users.map |$user| {
- [$user['name'], $user['pass']].join(':')
- }.join("\n")
- }
-
- nginx::resource::location {
- $cgit::public_repos.map |$repo| { "~ ^(/${repo}\\.git/.*)" }:
- server => 'cgit',
- ssl_only => $cgit::certname != undef,
- priority => 450,
- fastcgi => 'unix:/run/fcgiwrap.socket',
- fastcgi_params => 'fastcgi_params',
- fastcgi_param => {
- 'SCRIPT_FILENAME' => '/usr/lib/git-core/git-http-backend',
- 'GIT_PROJECT_ROOT' => $cgit::scan_path,
- 'GIT_HTTP_EXPORT_ALL' => '""',
- 'PATH_INFO' => '$1',
- }
- }
-
-
- nginx::resource::location { '~ (.*\.git/.*)':
- server => 'cgit',
- ssl_only => $cgit::certname != undef,
- location_cfg_append => {
- auth_basic => '"CGit login"',
- auth_basic_user_file => $cgit::htpasswd,
- },
- fastcgi => 'unix:/run/fcgiwrap.socket',
- fastcgi_params => 'fastcgi_params',
- fastcgi_param => {
- 'SCRIPT_FILENAME' => '/usr/lib/git-core/git-http-backend',
- 'GIT_PROJECT_ROOT' => $cgit::scan_path,
- 'GIT_HTTP_EXPORT_ALL' => '""',
- 'PATH_INFO' => '$1',
- }
- }
-
-}