--- /dev/null
+<!DOCTYPE html>
+<html lang='en'>
+ <head>
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
+ <title>This instance is now closed - Discourse</title>
+ <style>
+ body {
+ text-align: center;
+ background: #f9f9f9;
+ font-family: sans-serif;
+ }
+ img {
+ max-width: 235px;
+ width: 100%;
+ }
+ h1 {
+ font-size: 20px;
+ font-weight: 400;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <img alt='Discourse capitaines' src='/discourse.png'>
+ <h1>Sorry, this instance is closed now.</h1>
+ </div>
+ </body>
+</html>
{ lib, pkgs, config, ... }:
let
- cfg = config.myServices.websites.capitaines.production;
- env = config.myEnv.websites.capitaines;
- webappName = "capitaines_mastodon";
- root = "/run/current-system/webapps/${webappName}";
- siteDir = ./mastodon_static;
+ cfg = config.myServices.websites.capitaines.production;
+ env = config.myEnv.websites.capitaines;
in {
options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website";
config = lib.mkIf cfg.enable {
- myServices.websites.webappDirs."${webappName}" = siteDir;
-
- services.websites.env.production.vhostConfs.capitaines_mastodon = {
+ myServices.websites.webappDirs.capitaines_mastodon = ./mastodon_static;
+ services.websites.env.production.vhostConfs.capitaines_mastodon = let
+ root = "/run/current-system/webapps/capitaines_mastodon";
+ in {
certName = "capitaines";
certMainHost = "mastodon.capitaines.fr";
hosts = [ "mastodon.capitaines.fr" ];
];
};
+ myServices.websites.webappDirs.capitaines_discourse = ./discourse_static;
+ services.websites.env.production.vhostConfs.capitaines_discourse = let
+ root = "/run/current-system/webapps/capitaines_discourse";
+ in {
+ certName = "capitaines";
+ addToCerts = true;
+ hosts = [ "discourse.capitaines.fr" ];
+ root = root;
+ extraConfig = [
+ ''
+ ErrorDocument 404 /index.html
+ <Directory ${root}>
+ DirectoryIndex index.html
+ Options Indexes FollowSymLinks MultiViews Includes
+ Require all granted
+ </Directory>
+ ''
+ ];
+ };
+
services.websites.env.production.vhostConfs.capitaines = {
certName = "capitaines";
addToCerts = true;