stockholm/lass/2configs/websites/domsen.nix

258 lines
6.8 KiB
Nix
Raw Normal View History

2016-04-09 12:21:39 +00:00
{ config, pkgs, lib, ... }:
2015-12-12 17:21:50 +00:00
2016-03-23 12:45:06 +00:00
let
2016-10-20 19:40:11 +00:00
inherit (import <stockholm/lib>)
genid
2018-08-09 12:38:06 +00:00
genid_uint31
;
inherit (import <stockholm/lass/2configs/websites/util.nix> {inherit lib pkgs;})
2016-04-09 12:21:39 +00:00
servePage
2016-04-11 14:50:22 +00:00
serveOwncloud
serveWordpress;
2016-04-09 12:21:39 +00:00
msmtprc = pkgs.writeText "msmtprc" ''
account localhost
host localhost
account default: localhost
'';
sendmail = pkgs.writeDash "msmtp" ''
exec ${pkgs.msmtp}/bin/msmtp --read-envelope-from -C ${msmtprc} "$@"
'';
2016-03-23 12:45:06 +00:00
in {
2015-12-12 17:21:50 +00:00
imports = [
2017-08-01 18:47:34 +00:00
./default.nix
./sqlBackup.nix
(servePage [ "reich-gebaeudereinigung.de" "www.reich-gebaeudereinigung.de" ])
(servePage [
"freemonkey.art"
"www.freemonkey.art"
])
2016-12-26 13:18:08 +00:00
(serveOwncloud [ "o.ubikmedia.de" ])
(serveWordpress [
"ubikmedia.de"
"apanowicz.de"
"nirwanabluete.de"
"aldonasiech.com"
"ubikmedia.eu"
2016-06-30 07:17:08 +00:00
"youthtube.xyz"
"joemisch.com"
2017-12-15 20:33:56 +00:00
"weirdwednesday.de"
"www.apanowicz.de"
"www.nirwanabluete.de"
"www.aldonasiech.com"
"www.ubikmedia.eu"
2016-06-30 07:17:08 +00:00
"www.youthtube.xyz"
"www.ubikmedia.de"
2018-03-18 20:35:27 +00:00
"www.joemisch.com"
2017-12-15 20:33:56 +00:00
"www.weirdwednesday.de"
"aldona2.ubikmedia.de"
"apanowicz.ubikmedia.de"
"cinevita.ubikmedia.de"
"factscloud.ubikmedia.de"
"illucloud.ubikmedia.de"
"joemisch.ubikmedia.de"
"karlaskop.ubikmedia.de"
"nb.ubikmedia.de"
"youthtube.ubikmedia.de"
"weirdwednesday.ubikmedia.de"
"freemonkey.ubikmedia.de"
"jarugadesign.ubikmedia.de"
2018-03-18 20:35:27 +00:00
"crypto4art.ubikmedia.de"
])
2016-04-09 12:21:39 +00:00
];
2015-12-12 17:21:50 +00:00
services.mysql.ensureDatabases = [ "ubikmedia_de" "o_ubikmedia_de" ];
services.mysql.ensureUsers = [
{ ensurePermissions = { "ubikmedia_de.*" = "ALL"; }; name = "nginx"; }
{ ensurePermissions = { "o_ubikmedia_de.*" = "ALL"; }; name = "nginx"; }
];
2016-12-26 13:18:08 +00:00
services.nginx.virtualHosts."ubikmedia.de".locations."/piwika".extraConfig = ''
try_files $uri $uri/ /index.php?$args;
'';
lass.mysqlBackup.config.all.databases = [
"ubikmedia_de"
"o_ubikmedia_de"
];
2016-04-11 14:50:49 +00:00
services.phpfpm.phpOptions = ''
sendmail_path = ${sendmail} -t
upload_max_filesize = 100M
post_max_size = 100M
file_uploads = on
'';
2019-01-04 15:35:09 +00:00
services.nextcloud = {
enable = true;
hostName = "o.xanf.org";
config = {
adminpassFile = toString <secrets> + "/nextcloud_pw";
};
2019-04-07 17:24:41 +00:00
https = true;
2019-01-04 15:35:09 +00:00
nginx.enable = true;
};
services.nginx.virtualHosts."o.xanf.org" = {
enableACME = true;
forceSSL = true;
};
# MAIL STUFF
# TODO: make into its own module
services.dovecot2 = {
enable = true;
mailLocation = "maildir:~/Mail";
sslServerCert = "/var/lib/acme/lassul.us/fullchain.pem";
sslServerKey = "/var/lib/acme/lassul.us/key.pem";
};
krebs.iptables.tables.filter.INPUT.rules = [
{ predicate = "-p tcp --dport pop3s"; target = "ACCEPT"; }
{ predicate = "-p tcp --dport imaps"; target = "ACCEPT"; }
];
krebs.exim-smarthost = {
authenticators.PLAIN = ''
driver = plaintext
public_name = PLAIN
2019-04-17 18:16:06 +00:00
server_condition = ''${run{/run/wrappers/bin/shadow_verify_arg ${config.lass.usershadow.pattern} $auth2 $auth3}{yes}{no}}
'';
authenticators.LOGIN = ''
driver = plaintext
public_name = LOGIN
server_prompts = "Username:: : Password::"
server_condition = ''${run{${config.lass.usershadow.path}/bin/verify_arg ${config.lass.usershadow.pattern} $auth1 $auth2}{yes}{no}}
'';
internet-aliases = [
{ from = "dominik@apanowicz.de"; to = "dominik_a@gmx.de"; }
{ from = "dma@ubikmedia.de"; to = "domsen"; }
{ from = "dma@ubikmedia.eu"; to = "domsen"; }
2017-10-26 17:16:24 +00:00
{ from = "mail@habsys.de"; to = "domsen"; }
{ from = "mail@habsys.eu"; to = "domsen"; }
2017-07-31 11:49:43 +00:00
{ from = "bruno@apanowicz.de"; to = "bruno"; }
{ from = "mail@jla-trading.com"; to = "jla-trading"; }
{ from = "jms@ubikmedia.eu"; to = "jms"; }
{ from = "ms@ubikmedia.eu"; to = "ms"; }
2017-02-05 08:35:31 +00:00
{ from = "ubik@ubikmedia.eu"; to = "domsen, jms, ms"; }
2018-05-14 20:09:50 +00:00
{ from = "akayguen@freemonkey.art"; to ="akayguen"; }
2018-07-13 14:34:36 +00:00
{ from = "bui@freemonkey.art"; to ="bui"; }
2018-12-16 15:36:13 +00:00
{ from = "kontakt@alewis.de"; to ="klabusterbeere"; }
{ from = "testuser@lassul.us"; to = "testuser"; }
{ from = "testuser@ubikmedia.eu"; to = "testuser"; }
];
sender_domains = [
"jla-trading.com"
"ubikmedia.eu"
"ubikmedia.de"
"alewis.de"
];
ssl_cert = "/var/lib/acme/lassul.us/fullchain.pem";
ssl_key = "/var/lib/acme/lassul.us/key.pem";
};
2019-01-22 15:32:18 +00:00
users.users.UBIK-SFTP = {
uid = genid_uint31 "UBIK-SFTP";
home = "/home/UBIK-SFTP";
useDefaultShell = true;
createHome = true;
};
2018-11-20 00:15:56 +00:00
users.users.xanf = {
uid = genid_uint31 "xanf";
home = "/home/xanf";
useDefaultShell = true;
createHome = true;
};
users.users.domsen = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "domsen";
description = "maintenance acc for domsen";
home = "/home/domsen";
useDefaultShell = true;
extraGroups = [ "nginx" "download" ];
createHome = true;
};
2017-07-31 11:49:43 +00:00
users.users.bruno = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "bruno";
2017-07-31 11:49:43 +00:00
home = "/home/bruno";
useDefaultShell = true;
createHome = true;
};
users.users.jla-trading = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "jla-trading";
home = "/home/jla-trading";
useDefaultShell = true;
createHome = true;
};
users.users.jms = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "jms";
home = "/home/jms";
useDefaultShell = true;
createHome = true;
};
users.users.ms = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "ms";
home = "/home/ms";
useDefaultShell = true;
createHome = true;
};
users.users.testuser = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "testuser";
home = "/home/testuser";
useDefaultShell = true;
createHome = true;
};
2018-05-14 20:09:50 +00:00
users.users.akayguen = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "akayguen";
2018-05-14 20:09:50 +00:00
home = "/home/akayguen";
useDefaultShell = true;
createHome = true;
};
2018-07-13 14:34:36 +00:00
users.users.bui = {
2018-08-09 12:38:06 +00:00
uid = genid_uint31 "bui";
2018-07-13 14:34:36 +00:00
home = "/home/bui";
useDefaultShell = true;
createHome = true;
};
2018-12-16 15:36:13 +00:00
users.users.klabusterbeere = {
uid = genid_uint31 "klabusterbeere";
home = "/home/klabusterbeere";
useDefaultShell = true;
createHome = true;
};
2019-04-07 17:24:16 +00:00
krebs.on-failure.plans.restic-backups-domsen = {};
2019-01-22 15:32:48 +00:00
services.restic.backups.domsen = {
initialize = true;
2019-04-11 13:43:25 +00:00
extraOptions = [ "sftp.command='ssh efOVcMWSZ@wilhelmstr2.duckdns.org -S none -v -p 52222 -i ${toString <secrets> + "/ssh.id_ed25519"} -s sftp'" ];
repository = "sftp:efOVcMWSZ@wilhelmstr2.duckdns.org:/mnt/UBIK-9TB-Pool/BACKUP/XXXX-MAX-UND-ANDERES";
2019-01-22 15:32:48 +00:00
passwordFile = toString <secrets> + "/domsen_backup_pw";
2019-04-07 17:24:16 +00:00
timerConfig = { OnCalendar = "00:05"; RandomizedDelaySec = "5h"; };
2019-01-22 15:32:48 +00:00
paths = [
"/srv/http"
"/home/domsen/Mail"
"/home/ms/Mail"
"/home/klabusterbeere/Mail"
"/home/jms/Mail"
"/home/bruno/Mail"
"/home/akayguen/Mail"
"/backups/sql_dumps"
];
};
2015-12-12 17:21:50 +00:00
}