From c4550e854d78c4e79da20d31b2a4ca0311b46857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 29 Jun 2021 22:29:16 +0200 Subject: Blog working. --- manifests/site.pp | 12 ++++-- modules/blog/files/footers/about.md | 11 +++++ modules/blog/files/footers/contact.md | 12 ++++++ modules/blog/files/footers/legal.md | 28 +++++++++++++ modules/blog/files/footers/qna.md | 13 ++++++ modules/blog/manifests/init.pp | 78 +++++++++++++++++++++++++++++++++++ 6 files changed, 150 insertions(+), 4 deletions(-) create mode 100644 modules/blog/files/footers/about.md create mode 100644 modules/blog/files/footers/contact.md create mode 100644 modules/blog/files/footers/legal.md create mode 100644 modules/blog/files/footers/qna.md create mode 100644 modules/blog/manifests/init.pp diff --git a/manifests/site.pp b/manifests/site.pp index a18bec7..1613c64 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -3,7 +3,8 @@ node 'hornquist.se' { 'cowsay', ], { ensure => installed }) - $cgit_root = '/var/www/cgit'; + $cgit_root = '/var/www/cgit' + $blog_root = '/var/www/blog' class { '::cgit': root => $cgit_root, @@ -20,6 +21,10 @@ node 'hornquist.se' { ], } + blog { 'Hugos blog': + root => "${blog_root}/hugo", + } + service { 'php7.4-fpm': ensure => running, enable => true, @@ -92,7 +97,7 @@ node 'hornquist.se' { ssl_cert => "/etc/letsencrypt/live/${certname}/fullchain.pem", ssl_key => "/etc/letsencrypt/live/${certname}/privkey.pem", use_default_location => false, - www_root => '/var/www/blog', + www_root => $blog_root, } nginx::resource::server { 'hornquist': @@ -231,7 +236,7 @@ node 'hornquist.se' { ], } - nginx::resource::location { '~ \.ht': + nginx::resource::location { '~ /\.ht': location_cfg_append => { deny => 'all' }, index_files => [], ssl => true, @@ -241,5 +246,4 @@ node 'hornquist.se' { 'userdir', ], } - } diff --git a/modules/blog/files/footers/about.md b/modules/blog/files/footers/about.md new file mode 100644 index 0000000..ffec622 --- /dev/null +++ b/modules/blog/files/footers/about.md @@ -0,0 +1,11 @@ +#About + +This is a blog and website written and maintained by Hugo Hornquist (me). + +I will primarily post computer related information, and mostly in Swedish. +Some entries might however be written in English to allow for a temporary larger audience. +The about pages are written in English for that reason (Hello! Non Swedes!). + +--- + +A (hopefully) up to date version of the source code for the website is available [here](//github.com/HugoNikanor/website-blog-2). However, be aware that any blog entries, the four files in the bottom bar as well as some other parts of the website are not included in that repository. diff --git a/modules/blog/files/footers/contact.md b/modules/blog/files/footers/contact.md new file mode 100644 index 0000000..651fec4 --- /dev/null +++ b/modules/blog/files/footers/contact.md @@ -0,0 +1,12 @@ +#Contact + +There are many ways to contact me, and most of them serve different purposes. + +All regular blog entries should have a comment field where you are more than welcome to write your thoughts. I do however reserve the full right to moderate the comments, and remove comments of an unacceptable nature (you are however free to disagree with me). + +I have an email address for other general contact at . + +A Twitter account is also present for twittery stuff. [@hugonikanor](//twitter.com/hugonikanor) + +Feel free to contact me in another way if you find out how, I can't however guarantee that I will answer your queries regardless of communications method. + diff --git a/modules/blog/files/footers/legal.md b/modules/blog/files/footers/legal.md new file mode 100644 index 0000000..87966c7 --- /dev/null +++ b/modules/blog/files/footers/legal.md @@ -0,0 +1,28 @@ +#Legal + +Website built by Hugo Hornquist (me), however, some parts are made by other people with their permission. + +###[Parsedown](//parsedown.org) +Parsedown is used for tracing the markdown files the entries are written in into proper html. +It is used under the MIT License, readable [here](https://raw.githubusercontent.com/erusev/parsedown/master/LICENSE.txt) + +###[imgur](//imgur.com) +Most images are hosted by imgur. You can read the appropriate terms of service [here](//imgur.com/tos). + +### [RSS Logo](//www.mozilla.org/en-US/foundation/feed-icon-guidelines/) +This is my public statement that I try to follow these guidelines. + +--- + +##Disclaimer + +Any text on this website is subject to change at any time. Everything that I write is in some way shape or form connected to me. Please refrain from being majorly offended by my opinions and remember that I have moderation capabilities. + +--- + +Upon pressing the following button you agree to give your soul to whatever form of devil you believe in. If a deity of required sort isn't available then you instead surrender your legally owned land to the former communist state. + +
+ +
+
diff --git a/modules/blog/files/footers/qna.md b/modules/blog/files/footers/qna.md new file mode 100644 index 0000000..baa611a --- /dev/null +++ b/modules/blog/files/footers/qna.md @@ -0,0 +1,13 @@ +#Questions and Answers + +**Q: Who are you?** +A: *Who knows, but I have a blog that you can read [here](https://www.youtube.com/watch?v=dQw4w9WgXcQ).* + +**Q: What comment system are you using?** +A: *My own comment system, available [here](//github.com/hugonikanor/website-comment-system)* + +**Q: Do you have an RSS feed?** +A: *[I do now!](./rss.php)* + +##Have a question? +If you have a question of your own you would like to see answered, [contact me](./?filename=contact.md). diff --git a/modules/blog/manifests/init.pp b/modules/blog/manifests/init.pp new file mode 100644 index 0000000..a639311 --- /dev/null +++ b/modules/blog/manifests/init.pp @@ -0,0 +1,78 @@ +define blog ( + String $root, +) { + 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', + } + + vcsrepo { "${root}/entries": + ensure => latest, + provider => git, + source => '/home/git/git/blog-entries.git', + revision => 'master', + owner => 'hugo', + group => 'www-data', + } + + file { "${root}/settings.php": + ensure => file, + content => @(EOF) + 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]}", + } + } + + + $files_ini = join($foot_files.map |$item| { + @("EOF") + files[] = ${item[0]} + title[] = ${item[1]} + | EOF + }) + + file { "${root}/special-files.ini": + ensure => file, + content => @("EOF") + ; FILE MANAGED BY PUPPET + ; + ; Which files on the website that are "special" + ; This basicly means that they shouldn't have comments + [footnote] + ${files_ini} + + [other] + files[] = list + files[] = entry-not-found.md + | EOF + } +} -- cgit v1.2.3