From dd28dcf3d620a4ac7d0a1532b812213cf094cd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 12 Jan 2022 02:26:25 +0100 Subject: 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. --- modules/blog/manifests/init.pp | 42 ---------------- modules/blog/manifests/instance.pp | 99 -------------------------------------- 2 files changed, 141 deletions(-) delete mode 100644 modules/blog/manifests/init.pp delete mode 100644 modules/blog/manifests/instance.pp (limited to 'modules/blog/manifests') diff --git a/modules/blog/manifests/init.pp b/modules/blog/manifests/init.pp deleted file mode 100644 index 1ecce39..0000000 --- a/modules/blog/manifests/init.pp +++ /dev/null @@ -1,42 +0,0 @@ -class blog ( - String $blog_root, - Hash[String,Hash] $blogs = {}, - Optional[String] $domain = undef, - Optional[Array[String]] $domain_aliases = undef, -) { - create_resources(blog::instance, $blogs) - - if $domain { - $default = { - access_log => 'absent', - error_log => 'absent', - ssl => true, - ssl_cert => "/etc/letsencrypt/live/${certname}/fullchain.pem", - ssl_key => "/etc/letsencrypt/live/${certname}/privkey.pem", - use_default_location => false, - } - $domain_conf = { - server_name => [ $domain, ], - index_files => [ 'index.php', 'index.html', 'index.htm', ], - www_root => $blog::blog_root, - } - - $main_conf = { - "${safe_title} - server" => $default + $domain_conf, - } - - create_resources(nginx::resource::server, $main_conf) - - if $domain_aliases { - $alias_conf = { - "${safe_title} - aliases" => $default + { - server_name => $domain_aliases, - server_cfg_append => { - 'return' => '301 $scheme://blog.hornquist.se$request_uri', - }, - }, - } - create_resources(nginx::resource::server, $alias_conf) - } - } -} diff --git a/modules/blog/manifests/instance.pp b/modules/blog/manifests/instance.pp deleted file mode 100644 index adaa30d..0000000 --- a/modules/blog/manifests/instance.pp +++ /dev/null @@ -1,99 +0,0 @@ -define blog::instance ( - String $blog_title = $name, - String $author, - Boolean $has_comments = false, - String $subtitle = '', - Optional[String] $vcs_repo = undef, -) { - - $root = "${blog::blog_root}/${title}" - $safe_title = base64('encode', $blog_title) - - vcsrepo { $root: - ensure => latest, - provider => git, - source => 'https://github.com/HugoNikanor/website-blog-2.git', - revision => 'master', - # keep_local_changes => true, - owner => 'hugo', - group => 'www-data', - } - - if $vcs_repo { - vcsrepo { "${root}/entries": - ensure => latest, - provider => git, - source => $vcs_repo, - revision => 'master', - owner => 'hugo', - group => 'www-data', - } - } else { - file { "${root}/entries": - ensure => directory, - } - } - - file { "${root}/settings.php": - ensure => file, - content => epp('blog/settings.php.epp', { - author => $author, - title => $title, - subtitle => $subtitle, - has_comments => $has_comments, - }), - } - - file { "${root}/footnote": - ensure => directory, - recurse => true, - } - - $foot_files = [ - ['about.md', 'About'], - ['contact.md', 'Contact'], - ['legal.md', 'Legal'], - ['qna.md', '"Q&A"'], - ] - - $foot_files.each |$item| { - file { "${root}/footnote/${item[0]}": - source => "puppet:///modules/blog/footers/${item[0]}", - } - } - - file { "${root}/special-files.ini": - ensure => file, - content => $foot_files, - } - - $certname = lookup('certname') - - if $blog::domain { - - nginx::resource::location { "${safe_title} - server - /": - location => '/', - try_files => ['$uri', '$uri/', '=404'], - index_files => [], - ssl => true, - autoindex => on, - server => [ "${safe_title} - server", ] - } - - nginx::resource::location { "${safe_title} - server - php": - location => '~ \.php$', - fastcgi_params => 'snippets/fastcgi-php.conf', - fastcgi => 'unix:/run/php/php-fpm.sock', - ssl => true, - server => [ "${safe_title} - server", ], - } - - nginx::resource::location { "${safe_title} - server - ht": - location => '~ /\.ht', - location_cfg_append => { deny => 'all' }, - index_files => [], - ssl => true, - server => [ "${safe_title} - server", ], - } - } -} -- cgit v1.2.3