summaryrefslogtreecommitdiff
path: root/epistemia
diff options
context:
space:
mode:
authorVineet Kumar <git@vineetk.net>2026-05-13 21:38:01 -0400
committerVineet Kumar <git@vineetk.net>2026-05-13 21:39:43 -0400
commit777c5b354ed57b4ed9053a4f578e1003547e24c0 (patch)
tree01d53e700d14c4f439c82331ef88bba0aabe80be /epistemia
parent0b4ce3d54bdd79aa0e10ce2bf81d6195746a44ea (diff)
saklas: bring back main services
Diffstat (limited to 'epistemia')
-rw-r--r--epistemia/systems/saklas.scm200
1 files changed, 194 insertions, 6 deletions
diff --git a/epistemia/systems/saklas.scm b/epistemia/systems/saklas.scm
index 70ca0a1..059eba6 100644
--- a/epistemia/systems/saklas.scm
+++ b/epistemia/systems/saklas.scm
@@ -305,8 +305,7 @@ table inet filter {
305 `(("resolv.conf" 305 `(("resolv.conf"
306 ,(plain-file "resolv.conf" 306 ,(plain-file "resolv.conf"
307 (string-append 307 (string-append
308 ;"nameserver 127.0.0.1\n" 308 "nameserver 127.0.0.1\n"
309 "nameserver 9.9.9.9\n"
310 "search epistemia\n"))))) 309 "search epistemia\n")))))
311 (service (fail2ban-jail-service 310 (service (fail2ban-jail-service
312 openssh-service-type 311 openssh-service-type
@@ -352,18 +351,207 @@ server:
352 local-data: \"hastur.epistemia. 86400 IN AAAA fd00:b0ba:cafe:babe::3\" 351 local-data: \"hastur.epistemia. 86400 IN AAAA fd00:b0ba:cafe:babe::3\"
353 local-data: \"iphonebob.epistemia. 86400 IN A 10.0.13.4\" 352 local-data: \"iphonebob.epistemia. 86400 IN A 10.0.13.4\"
354 local-data: \"iphonebob.epistemia. 86400 IN AAAA fd00:b0ba:cafe:babe::4\" 353 local-data: \"iphonebob.epistemia. 86400 IN AAAA fd00:b0ba:cafe:babe::4\"
355 local-data: \"lab.epistemia. 86400 IN A 10.0.13.5\"
356 local-data: \"lab.epistemia. 86400 IN AAAA fd00:b0ba:cafe:babe::5\"
357 local-zone: \"saklas.epistemia.\" redirect 354 local-zone: \"saklas.epistemia.\" redirect
358 local-zone: \"demiurge.epistemia.\" redirect 355 local-zone: \"demiurge.epistemia.\" redirect
359 local-zone: \"hastur.epistemia.\" redirect 356 local-zone: \"hastur.epistemia.\" redirect
360 local-zone: \"iphonebob.epistemia.\" redirect 357 local-zone: \"iphonebob.epistemia.\" redirect
361 local-zone: \"lab.epistemia.\" redirect
362 358
363rpz: 359rpz:
364 name: \"hagezi.ultimate\" 360 name: \"hagezi.ultimate\"
365 zonefile: \"hagezi.ultimate\" 361 zonefile: \"hagezi.ultimate\"
366 url: https://raw.githubusercontent.com/hagezi/dns-blocklists/main/rpz/ultimate.txt")))) 362 url: https://raw.githubusercontent.com/hagezi/dns-blocklists/main/rpz/ultimate.txt")))
363 (service wireguard-service-type
364 (wireguard-configuration
365 (interface "wg1")
366 (addresses '("10.0.13.1/24" "fd00:b0ba:cafe:babe::1/64 "))
367 (port 51820)
368 (bootstrap-private-key? #f)
369 (private-key "/run/secrets/wg1_saklas")
370 (peers
371 (list
372 (wireguard-peer
373 (name "demiurge.epistemia")
374 (public-key "FMLvbSxY6vA8CRV4S1vl4+pMeCr/kR9n0G5w9buNqh4=")
375 (allowed-ips '("10.0.13.2/32" "fd00:b0ba:cafe:babe::2/128"))
376 (keep-alive 25))
377 (wireguard-peer
378 (name "hastur.epistemia")
379 (public-key "1ketYziRhoUmpbrj/60O5DYbcPacvmEoFQqa/NntSnc=")
380 (allowed-ips '("10.0.13.3/32" "fd00:b0ba:cafe:babe::3/128"))
381 (keep-alive 25))
382 (wireguard-peer
383 (name "iphonebob.epistemia")
384 (public-key "Xn0EmeRZdpMejBgzr98mYtb/2f5O58GAzQLNZV/SS30=")
385 (allowed-ips '("10.0.13.4/32" "fd00:b0ba:cafe:babe::4/128"))
386 (keep-alive 25))
387 (wireguard-peer
388 (name "lab.epistemia")
389 (public-key "iMDEwvXjPAlQH8ZCmP63FM5ICYIFIX5XIyGxjnXoNVE=")
390 (allowed-ips '("10.0.13.5/32" "fd00:b0ba:cafe:babe::5/128"))
391 (keep-alive 25))))))
392 (service certbot-service-type
393 (certbot-configuration
394 (email "postmaster@vineetk.net")
395 (certificates
396 (list
397 (certificate-configuration
398 (deploy-hook (program-file
399 "import-prosody-certs"
400 #~(begin
401 (let ((prosodyctl (string-append #$prosody "/bin/prosodyctl")))
402 (system* prosodyctl "--root" "cert" "import" "/etc/certs")))))
403 (domains '("vineetk.net"
404 "git.vineetk.net"
405 "mail.vineetk.net"
406 "u.vineetk.net"
407 "xmpp.vineetk.net")))
408 (certificate-configuration
409 (domains '("13f0.net"
410 "m.13f0.net"
411 ;"snac.13f0.net"
412 )))
413 (certificate-configuration
414 (domains '("vinbiz.ca")))))))
415 (service nginx-service-type
416 (nginx-configuration
417 (server-blocks
418 (list (nginx-server-configuration
419 (server-name '("vineetk.net"))
420 (listen '("443 ssl"))
421 (ssl-certificate "/etc/certs/vineetk.net/fullchain.pem")
422 (ssl-certificate-key "/etc/certs/vineetk.net/privkey.pem")
423 (root "/var/www/site_vineetk")
424 (raw-content (list "include " %nginx-badboi ";")))
425 (nginx-server-configuration
426 (server-name '("13f0.net"))
427 (listen '("443 ssl"))
428 (ssl-certificate "/etc/certs/13f0.net/fullchain.pem")
429 (ssl-certificate-key "/etc/certs/13f0.net/privkey.pem")
430 (root "/var/www/site_13f0")
431 (raw-content (list "include " %nginx-badboi ";")))
432 (nginx-server-configuration
433 (server-name '("vinbiz.ca"))
434 (listen '("443 ssl"))
435 (ssl-certificate "/etc/certs/vinbiz.ca/fullchain.pem")
436 (ssl-certificate-key "/etc/certs/vinbiz.ca/privkey.pem")
437 (root "/var/www/site_vinbiz")
438 (raw-content (list "include " %nginx-badboi ";")))))))
439 ;; git folder needs to be readable by nginx/cgit, gets reset to 700 on reconfigure otherwise
440 (simple-service 'git-home-permissions
441 activation-service-type
442 #~(when (file-exists? "/data/src/bare")
443 (chmod "/data/src/bare" #o775)))
444 (service cgit-service-type
445 (cgit-configuration
446 (enable-index-links? #t)
447 (enable-log-filecount? #t)
448 (enable-log-linecount? #t)
449 (enable-git-config? #t)
450 (remove-suffix? #t)
451 (root-desc "")
452 (root-title "Vineet's git repos")
453 (repository-directory "/data/src/bare")
454 (section-from-path 1)
455 (side-by-side-diffs? #t)
456 (nginx
457 (list
458 (nginx-server-configuration
459 (server-name '("git.vineetk.net"))
460 (listen '("443 ssl"))
461 (root cgit)
462 (try-files (list "$uri" "@cgit"))
463 (ssl-certificate "/etc/certs/vineetk.net/fullchain.pem")
464 (ssl-certificate-key "/etc/certs/vineetk.net/privkey.pem")
465 (raw-content (list "include" %nginx-badboi ";"))
466 (locations
467 (list
468 (nginx-location-configuration
469 (uri "@cgit")
470 (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;"
471 "fastcgi_param PATH_INFO $uri;"
472 "fastcgi_param QUERY_STRING $args;"
473 "fastcgi_param HTTP_HOST $server_name;"
474 "fastcgi_pass 127.0.0.1:9000;"))))))))))
475 (service prosody-service-type
476 (prosody-configuration
477 (admins '("vin@vineetk.net"))
478 (allow-registration? #f)
479 (c2s-require-encryption? #t)
480 (s2s-require-encryption? #t)
481 (s2s-secure-auth? #t)
482 (authentication "internal_hashed")
483 (plugin-paths (list prosody-cloud-notify))
484 (modules-enabled
485 ;; list from https://github.com/monal-im/Monal/wiki/Considerations-for-XMPP-server-admins#prosody
486 (cons* "sasl_ssdp"
487 ;; TODO update prosody to 13
488 ;; "sasl2"
489 ;; "sasl2_bind2"
490 ;; "sasl2_sm"
491 ;; "sasl2_fast"
492 "muc_notifications"
493 "smacks"
494 "mam"
495 "csi_simple"
496 "cloud_notify"
497 "bookmarks"
498 %default-modules-enabled))
499 ;; I don't want my syslog flooded. can't control changes either in service yet
500 (log "/var/lib/prosody/prosody.log")
501 (virtualhosts
502 (list
503 (virtualhost-configuration
504 (domain "vineetk.net"))))))
505 (service opensmtpd-service-type
506 (opensmtpd-configuration
507 (config-file %opensmtpd-config)))
508 (service dovecot-service-type
509 (dovecot-configuration
510 (listen '("*" "::"))
511 (mail-location "maildir:/var/vmail/%d/%n")
512 (mail-uid "vmail")
513 (mail-gid "vmail")
514 (ssl? "required")
515 (ssl-cert "</etc/certs/vineetk.net/fullchain.pem")
516 (ssl-key "</etc/certs/vineetk.net/privkey.pem")
517 (namespaces
518 (list (namespace-configuration
519 (name "inbox")
520 (inbox? #t)
521 (location "")
522 (prefix "")
523 (mailboxes
524 (list (mailbox-configuration
525 (name "Drafts")
526 (special-use '("\\Drafts")))
527 (mailbox-configuration
528 (name "Junk")
529 (special-use '("\\Junk")))
530 (mailbox-configuration
531 (name "Sent")
532 (special-use '("\\Sent")))
533 (mailbox-configuration
534 (name "Trash")
535 (special-use '("\\Trash"))))))))
536 (passdbs
537 (list (passdb-configuration
538 (driver "passwd-file")
539 (args '("scheme=CRYPT" "username_format=%u" "/run/secrets/saklas_smtpd_passwd")))))
540 (userdbs
541 (list (userdb-configuration
542 (driver "static")
543 (args '("uid=vmail" "gid=vmail" "home=/var/vmail/%d/%n")))))
544 (protocols
545 (list (protocol-configuration (name "imap"))
546 (protocol-configuration (name "lmtp"))))
547 (services
548 (list (service-configuration
549 (kind "lmtp")
550 (listeners
551 (list (unix-listener-configuration
552 (path "lmtp")
553 (group "vmail")
554 (user "vmail"))))))))))
367 %base-services) 555 %base-services)
368 (guix-service-type config => 556 (guix-service-type config =>
369 (guix-configuration 557 (guix-configuration