;;; Tyreunom's system administration and configuration tools. ;;; ;;; Copyright © 2019 Julien Lepiller ;;; ;;; This program is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation, either version 3 of the License, or ;;; (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . (use-modules (gnu)) (use-modules (gnu system)) (use-modules (gnu bootloader) (gnu bootloader grub)) (use-modules (gnu services dns)) (use-modules (gnu services web)) (use-modules (config certbot) (config dns) (config mail) (config network) (config os)) (operating-system (inherit (tyreunom-os "hermes")) (bootloader (bootloader-configuration (target "/dev/sda") (bootloader grub-bootloader))) (file-systems (cons (file-system (mount-point "/") (device (uuid "27798665-5606-4fde-8da8-cc371e603892")) (type "ext4")) %base-file-systems)) (services (append (list hermes-network-service (service nginx-service-type) (service knot-service-type (knot-configuration (zones (list lepiller-master-zone ipv4-reverse-master-zone ipv6-reverse-master-zone)))) (certbot-service `(("lepiller.eu" "www.lepiller.eu" "smtp.lepiller.eu"))) (simple-service 'lepiller-http-server nginx-service-type (list (nginx-server-configuration (ssl-certificate "/etc/letsencrypt/live/lepiller.eu/fullchain.pem") (ssl-certificate-key "/etc/letsencrypt/live/lepiller.eu/privkey.pem") (listen '("443 ssl http2" "[::]:443 ssl http2")) (server-name '("lepiller.eu" "www.lepiller.eu")) (root "/srv/http/lepiller/site") (index '("index.$language_suffix.html" "index.html")) (try-files '("$uri.$language_suffix.html" "$uri" "$uri/" "=404")) (raw-content '("set $first_language $http_accept_language;" "if ($http_accept_language ~* '(en|eo|fr)') {" " set $first_language $1;" "}" "set $language_suffix $first_language;" "if ($cookie_language) {" " set $language_suffix $cookie_language;" "}" "if ($uri ~ \\.en.html$) {" " set $language_suffix 'en';" "}" "if ($uri ~ \\.eo.html$) {" " set $language_suffix 'eo';" "}" "if ($uri ~ \\.fr.html$) {" " set $language_suffix 'fr';" "}" "if ($uri ~ (.*).html) {" " set $my_uri $1.$language_suffix.html;" "}" "location ~ \\.html$ {" " add_header Set-Cookie language=$language_suffix;" " expires off;" " add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';" " try_files $my_uri $uri $uri/ =404;" "}" "error_page 404 /404;"))))) (simple-service 'default-http-server nginx-service-type (list (nginx-server-configuration (ssl-certificate "/etc/letsencrypt/live/lepiller.eu/fullchain.pem") (ssl-certificate-key "/etc/letsencrypt/live/lepiller.eu/privkey.pem") (listen '("443 ssl http2" "[::]:443 ssl http2")) (server-name '(default))(root "/srv/http/default"))))) (lepiller-mail-services #:interface "ens18" #:domain "lepiller.eu") (server-services "hermes"))))