Compare commits

...

181 commits

Author SHA1 Message Date
Benjamin Yule Bädorf ec01fe5eea
test: add initial e2e test for nachtigall
Some checks failed
Flake checks / Check (pull_request) Failing after 3m23s
2024-08-25 12:34:07 +02:00
Benjamin Yule Bädorf 47c2e94e91
auth: add last login to keycloak, add docs 2024-08-25 12:31:04 +02:00
b12f 45b0500f0f
modules/backup: fix unitOptions usage
Some checks failed
Flake checks / Check (pull_request) Failing after 21s
2024-08-25 04:36:14 +02:00
b12f fbb9dd8f17
tests: fix website test
Some checks failed
Flake checks / Check (pull_request) Failing after 2m17s
2024-08-25 04:19:17 +02:00
teutat3s 6ac401da21
keycloak: remove unneeded insecure exception
Some checks failed
Flake checks / Check (pull_request) Failing after 2m10s
2024-08-25 02:42:56 +02:00
teutat3s 74f03555e5
style: format using nixfmt-rfc-style
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2024-08-25 02:42:03 +02:00
b12f e1dadd17ab
tests/keycloak: working base test without client 2024-08-25 02:38:40 +02:00
Hendrik Sokolowski 31eb82a4e7
raise memory assigned to test-nachtigall, auto-create database user for keycloak 2024-08-25 02:38:39 +02:00
Hendrik Sokolowski 6c9434d3a0
disable DHCP entirely 2024-08-25 02:38:39 +02:00
Hendrik Sokolowski 3451e9dead
drop explicit dependencies on postgres mounts 2024-08-25 02:38:39 +02:00
b12f c469a8a2dc
tests/keycloak: add non-working ssh config for clients 2024-08-25 02:38:39 +02:00
b12f eb337ddd47
tests/keycloak: certificate fetching with step-ca works 2024-08-25 02:38:39 +02:00
b12f f96b31a8a9
tests: add working test for website 2024-08-25 02:38:39 +02:00
teutat3s b6be95d032
Merge pull request 'Maintenance + security updates for element, forgejo, mastodon, matrix-synapse' (#221) from flake-updates into main
Reviewed-on: #221
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-08-24 01:11:41 +00:00
teutat3s 99308bfe24
Merge pull request 'secrets: ensure no final newline in editorconfig' (#220) from no-newline-for-secrets into main
Reviewed-on: #220
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-08-22 13:13:45 +00:00
teutat3s 50eb1d4f32
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 16m23s
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/3f1dae074a12feb7327b4bf43cbac0d124488bb7' (2024-07-30)
  → 'github:ryantm/agenix/f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41' (2024-08-10)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06)
  → 'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/883180e6550c1723395a3a342f830bfc5c371f6b' (2024-08-05)
  → 'github:nixos/nixpkgs/224042e9a3039291f22f4f2ded12af95a616cca0' (2024-08-21)
• Updated input 'unstable':
    'github:nixos/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04)
  → 'github:nixos/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21)
2024-08-22 11:59:47 +02:00
teutat3s c0fcf2352f
secrets: ensure no final newline
All checks were successful
Flake checks / Check (pull_request) Successful in 9m2s
2024-08-21 16:39:14 +02:00
teutat3s 3708d77d9b
Merge pull request 'Update docker, forgejo, systemd and others' (#219) from flake-updates into main
Reviewed-on: #219
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-07 11:55:29 +00:00
teutat3s 7f2bfd923f
loki: move data dir to /data disk with more room
All checks were successful
Flake checks / Check (pull_request) Successful in 4m33s
2024-08-07 10:19:53 +02:00
teutat3s 30d18c725a
revert: overlay for element-web and matrix-synapse
both packages now have the desired version available in nixos-24.05
2024-08-07 10:09:37 +02:00
teutat3s 387d97a2ea
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
  → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
• Updated input 'flake-parts/nixpkgs-lib':
    '5daf051448.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01)
  → 'a5d394176e.tar.gz?narHash=sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q%3D' (2024-08-01)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27)
  → 'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/12bf09802d77264e441f48e25459c10c93eada2e' (2024-07-29)
  → 'github:nixos/nixpkgs/883180e6550c1723395a3a342f830bfc5c371f6b' (2024-08-05)
• Updated input 'unstable':
    'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d' (2024-07-28)
  → 'github:nixos/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04)
2024-08-06 21:17:23 +02:00
teutat3s 6f2eeeb99e
Merge pull request 'Update element-web, matrix-synapse, nextcloud and misc packages' (#218) from flake-input-updates into main
Reviewed-on: #218
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-07-31 11:33:33 +00:00
teutat3s 21a28e1212
element-web, matrix-synapse: pull in updates early
All checks were successful
Flake checks / Check (pull_request) Successful in 15m10s
element-web 1.11.72 fixes support for Firefox ESR. Also get the latest
matrix-synapse version 1.112.0 while we're at it.
2024-07-31 11:45:58 +02:00
teutat3s c3bf5df1d8
flake.lock: Update
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6' (2024-07-09)
  → 'github:ryantm/agenix/3f1dae074a12feb7327b4bf43cbac0d124488bb7' (2024-07-30)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/cf297a8d248db6a455b60133f6c0029c04ebe50e' (2024-07-10)
  → 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/cab6539d198792f94fbac029e5a63523604fd172' (2024-07-06)
  → 'github:srid/nixos-flake/5734c1d9a5fe0bc8e8beaf389ad6227392ca0108' (2024-07-16)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/a046c1202e11b62cbede5385ba64908feb7bfac4' (2024-07-11)
  → 'github:nixos/nixpkgs/12bf09802d77264e441f48e25459c10c93eada2e' (2024-07-29)
• Updated input 'unstable':
    'github:nixos/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09)
  → 'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d' (2024-07-28)
2024-07-31 11:43:47 +02:00
b12f 563aa9ef46
Merge pull request 'RSS reader' (#217) from feat/tt-rss into main
Reviewed-on: #217
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-07-18 16:52:54 +00:00
teutat3s 8bf1e1d1a3
tt-rss: remove newlines from secrets
All checks were successful
Flake checks / Check (pull_request) Successful in 4m56s
using :set noeol nofixeol in neovim
2024-07-18 17:55:45 +02:00
teutat3s 79679720ff
tt-rss: lint with treefmt
All checks were successful
Flake checks / Check (pull_request) Successful in 7m11s
2024-07-18 17:49:29 +02:00
teutat3s 2b1a5d6f7f
secrets: revert rekey of non-related secrets
Some checks failed
Flake checks / Check (pull_request) Failing after 19s
2024-07-18 17:43:10 +02:00
teutat3s 5a84628e42
tt-rss: remove newlines from secrets
Some checks failed
Flake checks / Check (pull_request) Failing after 53s
using :set noeol nofixeol in neovim
2024-07-18 17:36:12 +02:00
teutat3s 0fc0c6d595
tt-rss: use git.tt-rss.org instead of gitlab
gitlab repo was throwing HTTP 500 errors
2024-07-18 17:35:05 +02:00
Benjamin Yule Bädorf 13c381ff3d
rss: fix auth build, fix nginx group rights, log to stdout
Some checks failed
Flake checks / Check (pull_request) Failing after 1m12s
2024-07-17 18:50:06 +02:00
Benjamin Yule Bädorf c59fac512e
secrets: rekey for nachtigalls tt-rss secrets 2024-07-17 18:49:36 +02:00
Benjamin Yule Bädorf 68be6b9303
tt-rss: fix secret paths, add plugin sha 2024-07-17 15:22:59 +02:00
Benjamin Yule Bädorf 8ce50bb73b
tt-rss: add pub.solar specific configuration 2024-07-17 15:22:58 +02:00
Benjamin Yule Bädorf cf830a9770
tt-rss: module init 2024-07-17 15:22:57 +02:00
teutat3s 0685d16d33
Merge pull request 'mediawiki: update to 1.42.1' (#216) from mediawiki-update into main
Reviewed-on: #216
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-07-17 13:09:03 +00:00
teutat3s e1e0faa592
docs: updates for mediawiki maintenances
All checks were successful
Flake checks / Check (pull_request) Successful in 8m7s
2024-07-15 18:51:15 +02:00
teutat3s 26e96dfac5
mediawiki: update to v1.42.1 2024-07-15 18:51:10 +02:00
teutat3s 730c6ccb61
Merge pull request 'Update element-web, php and misc' (#214) from flake-updates into main
Reviewed-on: #214
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-07-12 12:32:24 +00:00
teutat3s 35c554bbc3
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 11m36s
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/3a56735779db467538fb2e577eda28a9daacaca6' (2024-06-14)
  → 'github:ryantm/agenix/de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6' (2024-07-09)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/0f89b73f41eaa1dde67b291452c181d9a75f10dd' (2024-07-07)
  → 'github:lnl7/nix-darwin/cf297a8d248db6a455b60133f6c0029c04ebe50e' (2024-07-10)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7' (2024-07-07)
  → 'github:nixos/nixpkgs/a046c1202e11b62cbede5385ba64908feb7bfac4' (2024-07-11)
• Updated input 'unstable':
    'github:nixos/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03)
  → 'github:nixos/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09)
2024-07-12 09:47:57 +02:00
teutat3s 5e6784f21a
Merge pull request 'Maintenance updates forgejo, matrix-synapse, nextcloud' (#213) from flake-updates into main
Reviewed-on: #213
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-07-09 07:54:46 +00:00
teutat3s dfb523133e
mastodon: remove overlay for security update, new
All checks were successful
Flake checks / Check (pull_request) Successful in 17m24s
version landed in NixOS 24.05
2024-07-08 18:36:48 +02:00
teutat3s 70ae84272c
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01)
  → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
• Updated input 'flake-parts/nixpkgs-lib':
    'eb9ceca17d.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01)
  → '5daf051448.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01)
• Updated input 'home-manager':
    'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16)
  → 'github:nix-community/home-manager/e1391fb22e18a36f57e6999c7a9f966dc80ac073' (2024-07-03)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23)
  → 'github:lnl7/nix-darwin/0f89b73f41eaa1dde67b291452c181d9a75f10dd' (2024-07-07)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/8cefa1e7af06d366f5d3fd7c97e9edbf4d38c476' (2024-06-26)
  → 'github:srid/nixos-flake/cab6539d198792f94fbac029e5a63523604fd172' (2024-07-06)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/89c49874fb15f4124bf71ca5f42a04f2ee5825fd' (2024-06-26)
  → 'github:nixos/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7' (2024-07-07)
• Updated input 'nixpkgs-head':
    'github:nixos/nixpkgs/f2a40608e6b55661cac28e473e28b6208da53c01' (2024-07-04)
  → 'github:nixos/nixpkgs/acbecbb607c70bddfc5938b61cedbff3cfb1fc39' (2024-07-08)
• Updated input 'unstable':
    'github:nixos/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60' (2024-06-24)
  → 'github:nixos/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03)
2024-07-08 18:35:30 +02:00
teutat3s 9e2d9a06b3
Merge pull request 'security: update mastodon to 4.2.10' (#212) from mastodon-4.2.10 into main
Reviewed-on: #212
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-07-05 10:16:39 +00:00
teutat3s f8f67b8908
security: update mastodon to 4.2.10
All checks were successful
Flake checks / Check (pull_request) Successful in 13m1s
https://github.com/mastodon/mastodon/releases/tag/v4.2.10
* Fix incorrect permission checking on multiple API endpoints (GHSA-58x8-3qxw-6hm7)
* Fix incorrect authorship checking when processing some activities (CVE-2024-37903, GHSA-xjvf-fm67-4qc3)
* Fix ongoing streaming sessions not being invalidated when application tokens get revoked (GHSA-vp5r-5pgw-jwqx)
2024-07-05 12:03:14 +02:00
teutat3s 57a5ace727
Merge pull request 'flake updates, update grafana dashboard' (#211) from flake-updates into main
Reviewed-on: #211
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-07-04 11:07:27 +00:00
teutat3s 7ce66f38fc
grafana: update dashboard json, select nachtigall by default
All checks were successful
Flake checks / Check (pull_request) Successful in 5m37s
2024-07-02 19:04:52 +02:00
teutat3s b4dd570b2d
docs: use IPv4 for ZFS remote unlocking 2024-06-27 18:39:27 +02:00
teutat3s bdd4290e8d
flake.lock: Update
Flake lock file updates:

• Updated input 'nixos-flake':
    'github:srid/nixos-flake/6335b2f05f007b95ac2438b0a55498f9f20e73f7' (2024-06-22)
  → 'github:srid/nixos-flake/8cefa1e7af06d366f5d3fd7c97e9edbf4d38c476' (2024-06-26)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/dd457de7e08c6d06789b1f5b88fc9327f4d96309' (2024-06-19)
  → 'github:nixos/nixpkgs/89c49874fb15f4124bf71ca5f42a04f2ee5825fd' (2024-06-26)
• Updated input 'simple-nixos-mailserver/flake-compat':
    'github:edolstra/flake-compat/009399224d5e398d03b22badca40a37ac85412a1' (2022-11-17)
  → 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
• Updated input 'simple-nixos-mailserver/utils':
    'github:numtide/flake-utils/5021eac20303a61fafe17224c087f5519baed54d' (2020-11-14)
  → 'github:numtide/flake-utils/d465f4819400de7c8d874d50b982301f28a84605' (2024-02-28)
• Added input 'simple-nixos-mailserver/utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
• Updated input 'unstable':
    'github:nixos/nixpkgs/a71e967ef3694799d0c418c98332f7ff4cc5f6af' (2024-06-22)
  → 'github:nixos/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60' (2024-06-24)
2024-06-27 16:53:25 +02:00
teutat3s 0b0074a65b
Merge pull request 'flake: update to NixOS 24.05' (#203) from nixos-24.05 into main
Reviewed-on: #203
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-06-27 14:47:18 +00:00
teutat3s f5034c4e08
Merge pull request 'zfs: enable scrub once per month' (#210) from zfs-enable-scrub into main
Reviewed-on: #210
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-06-23 14:21:13 +00:00
teutat3s f0347b945c
Merge pull request 'Updates for element-web, forgejo, nextcloud, synapse and more' (#209) from flake-updates into main
Reviewed-on: #209
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-06-23 14:10:12 +00:00
teutat3s 2ebe4bd109
loki: fix invalid config max_look_back_period,
All checks were successful
Flake checks / Check (pull_request) Successful in 14m21s
seems no longer used in loki 3
2024-06-23 15:19:20 +02:00
teutat3s e90d923e91
flake: update simple-mailserver to nixos-24.05 2024-06-23 15:19:20 +02:00
teutat3s bc9ac6011e
flake: update to NixOS 24.05
Fix warnings:
trace: warning: The option `services.nextcloud.extraOptions' defined in `/nix/store/a53lc1l5wy9vbv1d3n93903dq0wjgvfj-source/flake.nix#nixosModules.nextcloud' has been renamed to `services.nextcloud.settings'.
trace: warning: The option `services.nextcloud.skeletonDirectory' defined in `/nix/store/a53lc1l5wy9vbv1d3n93903dq0wjgvfj-source/flake.nix#nixosModules.nextcloud' has been renamed to `services.nextcloud.settings.skeletondirectory'.
trace: warning: The option `services.nextcloud.config.overwriteProtocol' defined in `/nix/store/a53lc1l5wy9vbv1d3n93903dq0wjgvfj-source/flake.nix#nixosModules.nextcloud' has been renamed to `services.nextcloud.settings.overwriteprotocol'.
trace: warning: The option `services.matrix-synapse.sliding-sync' defined in `/nix/store/a53lc1l5wy9vbv1d3n93903dq0wjgvfj-source/flake.nix#nixosModules.matrix' has been renamed to `services.matrix-sliding-sync'.

Fix errors:
loki: fix config for version 3+
keycloak: declarative-user-profile feature is now enabled by default

error: A definition for option `programs.gnupg.agent.pinentryPackage' is not of type `null or package'. Definition values:
- In `/nix/store/a53lc1l5wy9vbv1d3n93903dq0wjgvfj-source/flake.nix#nixosModules.forgejo': "curses"
2024-06-23 15:19:18 +02:00
teutat3s 153ef69daf
metronom: enable ZFS auto scrub once per month
All checks were successful
Flake checks / Check (pull_request) Successful in 6m28s
2024-06-23 15:16:04 +02:00
teutat3s af5abfc712
nachtigall: enable ZFS auto scrub once per month 2024-06-23 15:14:30 +02:00
teutat3s 99f84268e7
nextcloud: fine tune for performance, following
All checks were successful
Flake checks / Check (pull_request) Successful in 4m1s
https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html
2024-06-23 15:01:37 +02:00
teutat3s f38aa289ea
matrix-synapse: enable more useful logging 2024-06-23 15:00:40 +02:00
teutat3s aa244087d3
forgejo: use latest version from unstable for security fixes
All checks were successful
Flake checks / Check (pull_request) Successful in 4m9s
error: Package ‘forgejo-1.20.6-1-unstable-2024-04-18’ in /nix/store/qk1dpz44db85rhd8lr4j6i2hkn9j5hg4-source/pkgs/applications/version-management/forgejo/default.nix:147 is marked as insecure, refusing to evaluate.

Known issues:
- Forgejo v1.20.x is EOL
- OAuth2 implementation does not always require authentication for public clients
2024-06-22 20:55:50 +02:00
teutat3s 002f6945dc
flake.lock: Update
Some checks failed
Flake checks / Check (pull_request) Failing after 4m0s
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/c2fc0762bbe8feb06a2e59a364fa81b3a57671c9' (2024-05-24)
  → 'github:ryantm/agenix/3a56735779db467538fb2e577eda28a9daacaca6' (2024-06-14)
• Updated input 'deploy-rs':
    'github:serokell/deploy-rs/b3ea6f333f9057b77efd9091119ba67089399ced' (2024-05-14)
  → 'github:serokell/deploy-rs/3867348fa92bc892eba5d9ddb2d7a97b9e127a8a' (2024-06-12)
• Updated input 'element-themes':
    'github:aaronraimist/element-themes/6ed3a981191cbd59f03ea530f16e096b9a4c278c' (2024-05-28)
  → 'github:aaronraimist/element-themes/3bc82abc3dd468dabc933f0f9d0b443ed97554a6' (2024-06-20)
• Updated input 'maunium-stickerpicker':
    'github:maunium/stickerpicker/47f17fde452b5e9f0c9e96ce0e2c878dd0574b7f?dir=web' (2024-05-18)
  → 'github:maunium/stickerpicker/333567f481e60443360aa7199d481e1a45b3a523?dir=web' (2024-06-19)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/c0d5b8c54d6828516c97f6be9f2d00c63a363df4' (2024-05-29)
  → 'github:lnl7/nix-darwin/29b3096a6e283d7e6779187244cb2a3942239fdf' (2024-06-17)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/aa9100167350cbdffaa272b0fd382d7c23606b86' (2024-05-22)
  → 'github:srid/nixos-flake/6335b2f05f007b95ac2438b0a55498f9f20e73f7' (2024-06-22)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446' (2024-05-31)
  → 'github:nixos/nixpkgs/03d771e513ce90147b65fe922d87d3a0356fc125' (2024-06-19)
• Updated input 'unstable':
    'github:nixos/nixpkgs/57610d2f8f0937f39dbd72251e9614b1561942d8' (2024-05-31)
  → 'github:nixos/nixpkgs/d603719ec6e294f034936c0d0dc06f689d91b6c3' (2024-06-20)
2024-06-22 20:35:27 +02:00
teutat3s 02af5fb8c9
Merge pull request 'postgresql: tune' (#208) from pg-tuning into main
Reviewed-on: #208
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-06-22 14:57:20 +00:00
teutat3s d21ae91c3e
postgresql: tune
All checks were successful
Flake checks / Check (pull_request) Successful in 13m50s
2024-06-22 16:42:38 +02:00
teutat3s 2a9686798f
Merge pull request 'centralize docs for SSH access' (#206) from update-docs into main
Reviewed-on: #206
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-06-13 15:38:41 +00:00
teutat3s c18a9da4e9
keycloak: update docs to use admin-cli client
All checks were successful
Flake checks / Check (pull_request) Successful in 3m29s
instead of ops user
2024-06-10 20:35:40 +02:00
teutat3s b687997390
docs: centralize SSH access docs 2024-06-10 20:35:40 +02:00
teutat3s bc3752683b
keycloak: add docs how to delete unverified accounts 2024-06-10 20:35:36 +02:00
teutat3s 1ae6d9ecfe
Merge pull request 'loki tuning, lock down SSH for tankstelle, tweak nextcloud SMTP settings' (#205) from misc-fixes into main
Reviewed-on: #205
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-06-10 10:41:57 +00:00
teutat3s e2691988bf
nextcloud: use port 465 and TLS/SSL for mail transfer
All checks were successful
Flake checks / Check (pull_request) Successful in 3m56s
2024-06-08 23:54:05 +02:00
teutat3s d3fedd84e9
loki: tune settings, enable cache 2024-06-08 23:53:43 +02:00
teutat3s d8866860d5
prometheus-node-exporter: use version 1.8.1 to fix
error message spamming logs
2024-06-08 23:52:53 +02:00
teutat3s e127c668f6
metronom, tankstelle: cleanup for SSH only via wireguard 2024-06-08 23:52:08 +02:00
teutat3s ba76973cc5
Merge pull request 'fix promtail host label' (#204) from fix-promtail-label into main
Reviewed-on: #204
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-06-06 17:50:08 +00:00
teutat3s 6ea916603c
networking: set networking.domain in core module
All checks were successful
Flake checks / Check (pull_request) Successful in 4m0s
2024-06-06 19:30:11 +02:00
teutat3s bae41b07a8
promtail: use hostName to set label 2024-06-06 19:29:42 +02:00
teutat3s 3b865a688c
Merge pull request 'Add metronom + tankstelle to grafana + loki' (#202) from monitor-metronom-tankstelle into main
Reviewed-on: #202
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-06-06 16:41:22 +00:00
teutat3s eaed05c834
style: apply treefmt
All checks were successful
Flake checks / Check (pull_request) Successful in 4m41s
2024-06-06 12:56:55 +02:00
teutat3s 9707edf2de
docs: add example for wireguard client config
Some checks failed
Flake checks / Check (pull_request) Failing after 38s
2024-06-06 12:54:31 +02:00
teutat3s 2fdfd3b80e
docs: fix syntax in example 2024-06-06 12:54:14 +02:00
teutat3s 4350cbf7c4
tankstelle: add promtail, prometheus node-exporter
for monitoring, configure wireguard between flora-6 and tankstelle
2024-06-06 12:53:49 +02:00
teutat3s b93608a8fa
metronom: add promtail, prometheus node-exporter
configure wireguard to push logs to and scrape metrics from flora-6

open firewall for node-exporter port on wg-ssh interface
2024-06-06 12:52:55 +02:00
teutat3s 6143f56c01
flake: use DNS hostnames for deploy-rs 2024-06-06 12:50:24 +02:00
teutat3s 008e14f2d2
mail: add missing NixOS module to metronom 2024-06-06 12:49:58 +02:00
teutat3s 509a40b829
Merge pull request 'update mastodon, matrix-synapse, nextcloud, php, ruby, and others' (#201) from chore/updates into main
Reviewed-on: #201
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-06-06 09:21:12 +00:00
teutat3s 6aa18b0a2c
flake: update inputs
All checks were successful
Flake checks / Check (pull_request) Successful in 14m32s
• Updated input 'element-themes':
    'github:aaronraimist/element-themes/2368b58c16d2c4aabb82a245f036d228cbb6e5f5' (2024-02-12)
  → 'github:aaronraimist/element-themes/6ed3a981191cbd59f03ea530f16e096b9a4c278c' (2024-05-28)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16)
  → 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01)
• Updated input 'flake-parts/nixpkgs-lib':
    '50eb7ecf4c.tar.gz?narHash=sha256-QBx10%2Bk6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94%3D' (2024-05-02)
  → 'eb9ceca17d.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01)
• Updated input 'home-manager':
    'github:nix-community/home-manager/2c78a57c544dd19b07442350727ced097e1aa6e6' (2024-05-26)
  → 'github:nix-community/home-manager/095ef64aa3b2ab4a4f1bf07f29997e21e3a5576a' (2024-06-04)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/0bea8222f6e83247dd13b055d83e64bce02ee532' (2024-05-24)
  → 'github:lnl7/nix-darwin/c0d5b8c54d6828516c97f6be9f2d00c63a363df4' (2024-05-29)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/46397778ef1f73414b03ed553a3368f0e7e33c2f' (2024-05-22)
  → 'github:nixos/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446' (2024-05-31)
• Updated input 'unstable':
    'github:nixos/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24)
  → 'github:nixos/nixpkgs/57610d2f8f0937f39dbd72251e9614b1561942d8' (2024-05-31)
2024-06-05 02:08:13 +02:00
teutat3s 10ed117dfe
Merge pull request 'loki, prometheus, promtail should connect via wireguard' (#200) from loki-prometheus-via-wireguard into main
Reviewed-on: #200
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-06-05 00:04:40 +00:00
teutat3s e93a56e594
nginx: use square brackets for IPv6 address
All checks were successful
Flake checks / Check (pull_request) Successful in 4m0s
2024-06-05 01:59:54 +02:00
teutat3s 27c239b985
loki: allow port 3100 in firewall for wg-ssh interface 2024-06-05 01:59:44 +02:00
teutat3s 61ea0ad7c2
networking: add internal IPv6 wireguard IPs to /etc/hosts
All checks were successful
Flake checks / Check (pull_request) Successful in 3m8s
2024-06-03 12:33:51 +02:00
teutat3s 8f1b932fdc
docs: update unlocking ZFS pool
All checks were successful
Flake checks / Check (pull_request) Successful in 3m43s
2024-06-03 12:30:08 +02:00
teutat3s 56f692740e
networking: use *.wg.pub.solar in /etc/hosts
instead of overriding IPs for existing DNS records, to reduce suprises
when DNS records are different depending on the host.

Add metronom + tankstelle internal wireguard IPs, too.
2024-06-03 12:28:33 +02:00
teutat3s 0286719dce
dns: add internal *.wg.pub.solar VPN records 2024-06-01 16:51:49 +02:00
teutat3s 20ebf92f1f
loki, promtail, prometheus: remove basic auth, use
wireguard to secure connections
2024-06-01 16:51:14 +02:00
teutat3s a10027ed21
Merge pull request 'Init mail.pub.solar' (#196) from feat/mail into main
Reviewed-on: #196
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-05-31 15:22:28 +00:00
teutat3s 8f46e22636
docs: updates for metronom / mail
All checks were successful
Flake checks / Check (pull_request) Successful in 4m8s
2024-05-31 16:52:04 +02:00
teutat3s 0038be3d2c
metronom: use wireguard IP for SSH, lock down SSH
port access to wireguard only
2024-05-31 16:52:04 +02:00
teutat3s 9a9dccf5bb
mail: move NixOS module to modules 2024-05-31 16:52:04 +02:00
teutat3s fcd9af314e
mail: update teutat3s password 2024-05-31 16:52:04 +02:00
teutat3s c5dfb472f8
style: treefmt 2024-05-31 16:52:04 +02:00
teutat3s 9d8026a31a
mail(treewide): update mail.greenbaum.zone -> mail.pub.solar 2024-05-31 16:52:04 +02:00
teutat3s 1ca1168d7a
mail: switch to mail.pub.solar 2024-05-31 16:52:04 +02:00
teutat3s a3f7afd7a0
docs: add metronom to deploy docs, style: format 2024-05-31 16:52:03 +02:00
teutat3s a424152f94
dns: add test mail records for metronom.pub.solar
DKIM, DMARC, SPF, MX
2024-05-31 16:52:03 +02:00
teutat3s b6f64a1e04
mail: add more @pub.solar mail accounts 2024-05-31 16:52:03 +02:00
teutat3s 9635367c82
dns: add metronom.pub.solar 2024-05-31 16:52:03 +02:00
Benjamin Yule Bädorf 3bcdd33b5a
deploy: use system from host configuration 2024-05-31 16:52:03 +02:00
Hendrik Sokolowski af233793fb
initial work on mail 2024-05-31 16:52:01 +02:00
teutat3s 6d8d34123f
Merge pull request 'ci: add self-hosted runner tankstelle' (#198) from feat/add-tankstelle into main
Reviewed-on: #198
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-05-31 14:49:20 +00:00
teutat3s 2b873f8d3e
Merge pull request 'alerts: alert for uptime after 90 days instead of 30 days' (#199) from alerts-tweak-uptime into main
Reviewed-on: #199
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-31 14:48:12 +00:00
teutat3s 941eff6d87
tankstelle: configure wireguard
All checks were successful
Flake checks / Check (pull_request) Successful in 2m30s
2024-05-30 19:17:21 +02:00
teutat3s b039dec111
ci: update results path to prevent garbage collection 2024-05-30 19:04:40 +02:00
teutat3s 5aa1276e85
ci: add nix to PATH 2024-05-30 19:04:40 +02:00
teutat3s cc70a740a1
ci: run actions runner as normal user 2024-05-30 19:04:40 +02:00
teutat3s 866785ef47
style: format using treefmt 2024-05-30 19:04:40 +02:00
teutat3s 692c152406
gitea-actions-runner: fix PATH in systemd 2024-05-30 19:04:40 +02:00
teutat3s e71cbfc461
ci: add self-hosted forgejo-actions-runner
wip: add git.pub.solar to /etc/hosts

ci: add devshell with Node.js for forgejo actions

ci: add PATH

ci: add HOME
2024-05-30 19:04:13 +02:00
Hendrik Sokolowski 946585d1ca
initial commit of tankstelle
Some checks failed
Flake checks / Check (pull_request) Failing after 1m38s
2024-05-29 14:08:59 +02:00
teutat3s 2eeef069a2
alerts: alert for uptime after 90 days instead
All checks were successful
Flake checks / Check (pull_request) Successful in 3m22s
2024-05-27 16:45:58 +02:00
teutat3s 1235a4f878
Merge pull request 'style: avoid usage of top-level "with lib;"' (#195) from style-avoid-top-level-lib into main
Reviewed-on: #195
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-27 10:03:43 +00:00
teutat3s 9113f995e9
Merge pull request 'Update matrix-synapse, docker and others' (#197) from chore/updates into main
Reviewed-on: #197
2024-05-26 18:45:07 +00:00
teutat3s 04ee83737d
flake: update inputs
All checks were successful
Flake checks / Check (pull_request) Successful in 8m39s
• Updated input 'agenix':
    'github:ryantm/agenix/8d37c5bdeade12b6479c85acd133063ab53187a0' (2024-05-09)
  → 'github:ryantm/agenix/c2fc0762bbe8feb06a2e59a364fa81b3a57671c9' (2024-05-24)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02)
  → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16)
• Updated input 'home-manager':
    'github:nix-community/home-manager/ab5542e9dbd13d0100f8baae2bc2d68af901f4b4' (2024-05-10)
  → 'github:nix-community/home-manager/2c78a57c544dd19b07442350727ced097e1aa6e6' (2024-05-26)
• Updated input 'maunium-stickerpicker':
    'github:maunium/stickerpicker/f59406a47a6778cd402e656ffb64f667335f665a?dir=web' (2022-11-15)
  → 'github:maunium/stickerpicker/47f17fde452b5e9f0c9e96ce0e2c878dd0574b7f?dir=web' (2024-05-18)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/de8b0d60d6fd34f35abffc46adc94ebaa6996ce2' (2024-05-14)
  → 'github:lnl7/nix-darwin/0bea8222f6e83247dd13b055d83e64bce02ee532' (2024-05-24)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/7b19503e7f8c7cc0884fc2fbd669c0cc2e05aef5' (2024-03-25)
  → 'github:srid/nixos-flake/aa9100167350cbdffaa272b0fd382d7c23606b86' (2024-05-22)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/44072e24566c5bcc0b7aa9178a0104f4cfffab19' (2024-05-12)
  → 'github:nixos/nixpkgs/46397778ef1f73414b03ed553a3368f0e7e33c2f' (2024-05-22)
• Updated input 'unstable':
    'github:nixos/nixpkgs/2057814051972fa1453ddfb0d98badbea9b83c06' (2024-05-12)
  → 'github:nixos/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24)
2024-05-26 19:05:23 +02:00
teutat3s a86ce80c47
Merge pull request 'backups: remove droppie' (#194) from backups-disable-droppie into main
Reviewed-on: #194
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-22 16:39:59 +00:00
teutat3s 708cf947de
backups: remove droppie
All checks were successful
Flake checks / Check (pull_request) Successful in 3m22s
There were no backups to droppie since December 2023. We can always add
it back, if desired.
2024-05-19 15:31:20 +02:00
teutat3s c015a1ec2e
style: avoid usage of top-level "with lib";
All checks were successful
Flake checks / Check (pull_request) Successful in 3m2s
See: https://github.com/NixOS/nixpkgs/issues/208242
2024-05-19 15:27:19 +02:00
teutat3s 39221b3874
Merge pull request 'fix: nachtigall wants keycloak' (#192) from fix/keycloak into main
Reviewed-on: #192
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-16 06:17:05 +00:00
teutat3s d7a6da30f5
Merge pull request 'backups: reduce chances for lock race' (#193) from backups-splay into main
Reviewed-on: #193
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-16 06:10:11 +00:00
teutat3s 67b9b84e01
backups: reduce chances for lock race
All checks were successful
Flake checks / Check (pull_request) Successful in 2m16s
Start one backup per hour each night
2024-05-15 21:00:41 +02:00
teutat3s 0cb89a9fe8
fix: nachtigall wants keycloak
All checks were successful
Flake checks / Check (pull_request) Successful in 3m24s
2024-05-15 19:20:06 +02:00
teutat3s 47c9424459
Merge pull request 'Add alertmanager config - part 2' (#189) from alertmanager into main
Reviewed-on: #189
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-15 15:23:59 +00:00
teutat3s e52324209f
alertmanager: fix SMTP secret
All checks were successful
Flake checks / Check (pull_request) Successful in 2m17s
2024-05-15 17:15:46 +02:00
teutat3s bd4241e71d
caddy: use alerts.pub.solar domain for vhost
All checks were successful
Flake checks / Check (pull_request) Successful in 20m47s
2024-05-15 16:17:54 +02:00
teutat3s d1a68a7c13
secrets: fix too open permissions 2024-05-15 16:01:44 +02:00
teutat3s 9245fa6797
alertmanager: finalize init 2024-05-15 16:01:44 +02:00
teutat3s a8a8155114
style: treefmt with nixfmt-rfc-style 2024-05-15 16:01:44 +02:00
Pablo Ovelleiro Corral 11f5557a7a
Add reverseproxy for alerts.pub.solar
Co-authored-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-05-15 16:01:43 +02:00
Pablo Ovelleiro Corral 2679b897a0
Autoformat dns.tf 2024-05-15 16:01:43 +02:00
Pablo Ovelleiro Corral 8b7f547276
Add dns entry 2024-05-15 16:01:43 +02:00
Pablo Ovelleiro Corral 7e2bcfc5cf
Add alertmanager config 2024-05-15 16:01:42 +02:00
teutat3s f9f2b45611
Merge pull request 'secrets: rekey for ryzensun' (#191) from chore/secrets-rekey into main
Reviewed-on: #191
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-15 14:00:54 +00:00
teutat3s ece7c42efc
Merge pull request 'maintenance: update element-web, glibc, nextcloud, php, others' (#190) from chore/updates into main
Reviewed-on: #190
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-15 13:22:24 +00:00
teutat3s f329fbe26d
secrets: rekey for ryzensun
All checks were successful
Flake checks / Check (pull_request) Successful in 10m54s
See #188
2024-05-15 00:22:39 +02:00
teutat3s c2df933174
ci: set pipefail
All checks were successful
Flake checks / Check (pull_request) Successful in 2m8s
Don't add inputs to gc roots
2024-05-15 00:02:51 +02:00
teutat3s 091256b67a
chore: bump flake inputs
Some checks failed
Flake checks / Check (pull_request) Failing after 5m52s
• Updated input 'agenix':
    'github:ryantm/agenix/24a7ea390564ccd5b39b7884f597cfc8d7f6f44e' (2024-04-26)
  → 'github:ryantm/agenix/8d37c5bdeade12b6479c85acd133063ab53187a0' (2024-05-09)
• Updated input 'deploy-rs':
    'github:serokell/deploy-rs/88b3059b020da69cbe16526b8d639bd5e0b51c8b' (2024-04-01)
  → 'github:serokell/deploy-rs/b3ea6f333f9057b77efd9091119ba67089399ced' (2024-05-14)
• Updated input 'home-manager':
    'github:nix-community/home-manager/86853e31dc1b62c6eeed11c667e8cdd0285d4411' (2024-04-25)
  → 'github:nix-community/home-manager/ab5542e9dbd13d0100f8baae2bc2d68af901f4b4' (2024-05-10)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/230a197063de9287128e2c68a7a4b0cd7d0b50a7' (2024-04-24)
  → 'github:lnl7/nix-darwin/de8b0d60d6fd34f35abffc46adc94ebaa6996ce2' (2024-05-14)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/651b4702e27a388f0f18e1b970534162dec09aff' (2024-05-04)
  → 'github:nixos/nixpkgs/44072e24566c5bcc0b7aa9178a0104f4cfffab19' (2024-05-12)
• Updated input 'unstable':
    'github:nixos/nixpkgs/25865a40d14b3f9cf19f19b924e2ab4069b09588' (2024-05-05)
  → 'github:nixos/nixpkgs/2057814051972fa1453ddfb0d98badbea9b83c06' (2024-05-12)
2024-05-14 18:32:04 +02:00
teutat3s 05be0ab39d
Merge pull request 'logins: add ryzensun to teutat3s logins' (#188) from logins/add-ryzensun into main
Reviewed-on: #188
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-14 12:07:27 +00:00
teutat3s 71f2b70725
Merge pull request 'style: update git-blame-ignore-revs' (#187) from chore/git-blame-ignore-revs into main
Reviewed-on: #187
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-14 12:07:19 +00:00
teutat3s c856130766
logins: add ryzensun to teutat3s logins
All checks were successful
Flake checks / Check (pull_request) Successful in 2m34s
2024-05-09 01:58:15 +02:00
teutat3s 12be57b04e
style: update git-blame-ignore-revs
All checks were successful
Flake checks / Check (pull_request) Successful in 2m34s
2024-05-08 23:14:34 +02:00
teutat3s 599e69fcaf
Merge pull request 'style: check formatting using nixpkgs standard and fail early in CI to enforce it' (#183) from ci/check-formatting into main
Reviewed-on: #183
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-05-08 21:00:50 +00:00
teutat3s 2ca0bd7c3e
style: run treefmt
All checks were successful
Flake checks / Check (pull_request) Successful in 2m36s
2024-05-08 22:57:07 +02:00
teutat3s affdc02afe
style: check formatting using nixpkgs standard and
fail early in CI to enforce it
2024-05-08 22:56:28 +02:00
teutat3s 5bfb7de44b
Merge pull request 'docs: add CONTRIBUTING' (#186) from docs/contributing into main
Reviewed-on: #186
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-05-08 20:38:35 +00:00
teutat3s 1184fcedb3
Merge pull request 'Add AGPL LICENSE' (#185) from init-license into main
Reviewed-on: #185
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-05-08 20:38:27 +00:00
b12f c7f6810e6c
Merge pull request 'refactor: use options for config parts' (#184) from refactor/config-options into main
Reviewed-on: #184
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-05-08 20:37:52 +00:00
teutat3s d47e1b9e2e
docs: add CONTRIBUTING
All checks were successful
Flake checks / Check (pull_request) Successful in 2m18s
2024-05-08 22:29:11 +02:00
teutat3s a5de110181
Add AGPL LICENSE
All checks were successful
Flake checks / Check (pull_request) Successful in 2m17s
2024-05-08 22:28:45 +02:00
Benjamin Yule Bädorf 68278ad983
refactor: use options for config parts
All checks were successful
Flake checks / Check (pull_request) Successful in 5m52s
This works towards having reusable modules

* `config.pub-solar-os.networking.domain` is used for the main domain
* `config.pub-solar-os.privacyPolicUrl` links towards the privacy policy
* `config.pub-solar-os.imprintUrl` links towards the imprint
* `config.pub-solar-os.auth.enable` enables the keycloak installation.
  This is needed because `config.pub-solar-os.auth` has to be available
  everywhere, but we do not want to install keycloak everywhere.
* `config.pub-solar-os.auth.realm` sets the keycloak realm name
2024-05-08 19:47:47 +02:00
teutat3s aa7ab4bc6b
Merge pull request 'matrix: init stickerpicker' (#181) from feat/matrix-stickerpicker into main
Reviewed-on: #181
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-05-07 18:57:41 +00:00
teutat3s ff9703e542
matrix: init stickerpicker
All checks were successful
Flake checks / Check (pull_request) Successful in 12m57s
2024-05-07 17:47:55 +02:00
teutat3s 9a3a00d25f
Merge pull request 'chore: update element-web, matrix-synapse and others' (#180) from chore/update-flake into main
Reviewed-on: #180
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-05-06 18:31:55 +00:00
teutat3s a91ff24a7d
chore: add results to gitignore
All checks were successful
Flake checks / Check (pull_request) Successful in 14m31s
2024-05-06 19:39:30 +02:00
teutat3s 5ffde90324
chore: bump flake inputs
• Updated input 'agenix':
    'github:ryantm/agenix/1381a759b205dff7a6818733118d02253340fd5e?narHash=sha256-/JdiT9t%2BzzjChc5qQiF%2BjhrVhRt8figYH29rZO7pFe4%3D' (2024-04-02)
  → 'github:ryantm/agenix/24a7ea390564ccd5b39b7884f597cfc8d7f6f44e?narHash=sha256-BtWQ2Th/jamO1SlD%2B2ASSW5Jaf7JhA/JLpQHk0Goqpg%3D' (2024-04-26)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/9126214d0a59633752a136528f5f3b9aa8565b7d?narHash=sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm%2BGpZNw%3D' (2024-04-01)
  → 'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e?narHash=sha256-yzcRNDoyVP7%2BSCNX0wmuDju1NUCt8Dz9%2BlyUXEI0dbI%3D' (2024-05-02)
• Updated input 'flake-parts/nixpkgs-lib':
    'github:NixOS/nixpkgs/d8fe5e6c92d0d190646fb9f1056741a229980089?dir=lib&narHash=sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk%3D' (2024-03-29)
  → '50eb7ecf4c.tar.gz?narHash=sha256-QBx10%2Bk6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94%3D' (2024-05-02)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/dd37924974b9202f8226ed5d74a252a9785aedf8?narHash=sha256-fFE3M0vCoiSwCX02z8VF58jXFRj9enYUSTqjyHAjrds%3D' (2024-04-24)
  → 'github:nixos/nixpkgs/651b4702e27a388f0f18e1b970534162dec09aff?narHash=sha256-tbg0MEuKaPcUrnmGCu4xiY5F%2B7LW2%2BECPKVAJd2HLwM%3D' (2024-05-04)
• Updated input 'unstable':
    'github:nixos/nixpkgs/572af610f6151fd41c212f897c71f7056e3fb518?narHash=sha256-cfh1hi%2B6muQMbi9acOlju3V1gl8BEaZBXBR9jQfQi4U%3D' (2024-04-23)
  → 'github:nixos/nixpkgs/25865a40d14b3f9cf19f19b924e2ab4069b09588?narHash=sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0%3D' (2024-05-05)
2024-05-06 19:39:16 +02:00
teutat3s def76f8776
Merge pull request 'Put modules into uniform folders - part 2' (#179) from auto-modules into main
Reviewed-on: #179
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-05-06 16:57:41 +00:00
teutat3s c738f2d41f
modules: remove leftover apps dir
All checks were successful
Flake checks / Check (pull_request) Successful in 18m22s
2024-04-30 00:57:46 +02:00
Pablo Ovelleiro Corral 512ab12de1
Put modules into uniform folders
All checks were successful
Flake checks / Check (pull_request) Successful in 6m2s
2024-04-28 19:17:09 +02:00
teutat3s 477e419312
Merge pull request 'refactor: Move all apps into modules' (#175) from refactor/modules into main
Reviewed-on: #175
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-04-28 16:28:28 +00:00
b12f 667824928b
Merge pull request 'Add official formatter to flake' (#176) from pinpox/infra:add-nixfmt into main
Reviewed-on: #176
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-04-28 16:15:25 +00:00
Benjamin Yule Bädorf ef94681e11
refactor: Move all apps into modules
All checks were successful
Flake checks / Check (pull_request) Successful in 6m5s
2024-04-28 18:07:28 +02:00
Pablo Ovelleiro Corral c7b743e4dd
Add official formatter to flake
All checks were successful
Flake checks / Check (pull_request) Successful in 6m2s
Allows running `nix fmt`, which will format using the official style as
agreed upon in nixpkgs
2024-04-28 17:54:09 +02:00
teutat3s f18fee25e4
Merge pull request 'Add .editorconfig file with tabs as indentation' (#172) from feat/add-editorconfig into main
Reviewed-on: #172
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-04-28 15:26:59 +00:00
Hendrik Sokolowski fee6ce74c7
Merge pull request 'docs: add rough documentation about obs-portal' (#173) from feat/obs-portal-nachtigall into main
Reviewed-on: #173
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-04-28 12:13:09 +00:00
Hendrik Sokolowski a278c178b0
docs: obs-portal: add prosaic sugar
All checks were successful
Flake checks / Check (pull_request) Successful in 6m12s
2024-04-28 02:03:03 +02:00
Hendrik Sokolowski 75c7e2dcf5
docs: add rough documentation about obs-portal
All checks were successful
Flake checks / Check (pull_request) Successful in 6m2s
2024-04-28 01:23:42 +02:00
teutat3s 41798a1cd6
Merge pull request 'obs-portal: init obs-portal on nachtigall' (#115) from feat/obs-portal-nachtigall into main
Reviewed-on: #115
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-04-27 23:14:50 +00:00
Hendrik Sokolowski 10c86c6b20
nachtigall: obs-portal: remove tiles mount
All checks were successful
Flake checks / Check (pull_request) Successful in 6m8s
2024-04-28 01:07:49 +02:00
Hendrik Sokolowski 1d6c5003e8
nachtigall: obs-portal: fix dependencies of docker network unit and portal 2024-04-28 01:05:43 +02:00
Hendrik Sokolowski fef1874938
update obs-portal dns target
All checks were successful
Flake checks / Check (pull_request) Successful in 6m11s
2024-04-27 22:45:26 +02:00
Hendrik Sokolowski c74394449d
remove git conflict heading 2024-04-27 22:45:21 +02:00
Benjamin Yule Bädorf d280b29394
obs-portal: init obs-portal on nachtigall
This follows the official installation instructions at https://github.com/openbikesensor/portal/blob/main/docs/production-deployment.md

Unfortunately, the postgres database needs to have postgis enabled, so
we'll have to start a second instance. To stay close to the official
deployment instructions, this is running in docker.

The secrets were taken from the old installation instance. During
initial installation, we'll need to import data from the old instance
into this one, which might take a while.
2024-04-27 22:45:07 +02:00
Benjamin Yule Bädorf c49e47dc30
Add .editorconfig file with tabs as indentation
All checks were successful
Flake checks / Check (pull_request) Successful in 5m50s
Just use tabs guys
2024-04-27 20:47:07 +02:00
teutat3s 5e34acd765
Merge pull request 'Revert "matrix-appservice-irc: remove unneeded syscall override"' (#171) from fix/matrix-appservice-irc into main
Reviewed-on: #171
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-04-27 13:50:46 +00:00
teutat3s 2fa3ccf28e
Revert "matrix-appservice-irc: remove unneeded syscall override"
All checks were successful
Flake checks / Check (pull_request) Successful in 5m49s
This reverts commit a11255b433.
2024-04-27 01:44:20 +02:00
188 changed files with 6350 additions and 2632 deletions

43
.editorconfig Normal file
View file

@ -0,0 +1,43 @@
# Editor configuration, see http://editorconfig.org
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2
# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = unset
charset = unset
indent_style = unset
indent_size = unset
[{.*,secrets}/**]
end_of_line = false
insert_final_newline = false
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.rom]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.py]
indent_size = 4
[*.md]
max_line_length = off
trim_trailing_whitespace = false

View file

@ -1,54 +1,23 @@
name: Flake checks name: Flake checks
on: [pull_request] on: [pull_request]
env:
USER: ci
jobs: jobs:
Check: Check:
runs-on: ubuntu-latest runs-on: self-hosted
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: https://code.forgejo.org/actions/checkout@v4 uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://github.com/nixbuild/nix-quick-install-action@v27 - name: Check formatting
with:
load_nixConfig: false
nix_conf: |
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
keep-outputs = true
- name: Calculate flake.lock hash
id: flake-lock-hash
run: | run: |
echo "hash=$(md5sum flake.lock | awk '{print $1}')" >> $GITHUB_OUTPUT nix --accept-flake-config --access-tokens '' develop --command treefmt --fail-on-change
- name: Restore and cache Nix store
uses: https://github.com/nix-community/cache-nix-action@v4.0.3
id: nix-store-cache
with:
key: cache-${{ runner.os }}-nix-store-${{ steps.flake-lock-hash.outputs.hash }}
restore-keys: |
cache-${{ runner.os }}-nix-store-
gc-linux: true
gc-max-store-size-linux: 10000000000
purge-caches: true
purge-key: cache-${{ runner.os }}-nix-store-
purge-created: true
purge-created-max-age: 42
- name: Prepare cachix
uses: https://github.com/cachix/cachix-action@v14
with:
name: pub-solar
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
useDaemon: false
- name: Run flake checks - name: Run flake checks
run: | run: |
set -exuo pipefail
# Prevent cache garbage collection by creating GC roots # Prevent cache garbage collection by creating GC roots
mkdir -p /var/lib/gitea-runner/tankstelle/.local/state/nix/results
for target in $(nix flake show --json --all-systems | jq ' for target in $(nix flake show --json --all-systems | jq '
.["nixosConfigurations"] | .["nixosConfigurations"] |
to_entries[] | to_entries[] |
@ -56,16 +25,7 @@ jobs:
' | tr -d '"' ' | tr -d '"'
); do ); do
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' \ nix --print-build-logs --verbose --accept-flake-config --access-tokens '' \
build --out-link ./result-$target ".#nixosConfigurations.${target}.config.system.build.toplevel" build --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/"$target" ".#nixosConfigurations.${target}.config.system.build.toplevel"
done done
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check
# Add GC roots for flake inputs, too
# https://github.com/NixOS/nix/issues/4250#issuecomment-1146878407
mkdir --parents "$NIX_USER_PROFILE_DIR"
gc_root_prefix="$NIX_USER_PROFILE_DIR"/infra-flake-
echo "Adding gcroots flake inputs with prefix $gc_root_prefix ..."
nix flake archive --json 2>/dev/null | jq --raw-output '.inputs | to_entries[] | "ln --force --symbolic --no-target-directory "+.value.path+" \"'"$gc_root_prefix"'"+.key+"\""' | while read -r line; do
eval "$line"
done

View file

@ -1,2 +1,4 @@
# Apply treewide formatting with treefmt
2ca0bd7c3e743e699edb6e9c09d48b7c9106a64d
# Apply treewide formatting with nixpkgs-fmt # Apply treewide formatting with nixpkgs-fmt
815033c764660e1468b1564a02570bad0f84f77a 815033c764660e1468b1564a02570bad0f84f77a

1
.gitignore vendored
View file

@ -4,3 +4,4 @@
.terraform .terraform
*.plan *.plan
result result
results

35
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,35 @@
# Contributing guide
Things you'll need:
- To create [Pull Requests](https://forgejo.org/docs/latest/user/pull-requests-and-git-flow/), you will need to register your [pub.solar ID](https://auth.pub.solar) first.
- For small changes, e.g. to documentation, you can directly edit files in the browser.
### Getting a development shell
First, get a local copy of this repository:
```
git clone https://git.pub.solar/pub-solar/infra.git
cd infra
```
then, install [the package manager nix](https://nixos.org/download).
Finally, run:
```
nix develop
```
This will install a development shell (devshell) with all required tools.
### Final checks before creating a Pull Request
Before creating a pull request, it's recommended to check the formatting:
```
treefmt
```
If you are a terminal-lover, the [AGit alternative](https://forgejo.org/docs/latest/user/agit-support/) to the web based Pull Request workflow might be interesting.

660
LICENSE.md Normal file
View file

@ -0,0 +1,660 @@
### GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
### Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains
free software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing
under this license.
The precise terms and conditions for copying, distribution and
modification follow.
### TERMS AND CONDITIONS
#### 0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public
License.
"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of
an exact copy. The resulting work is called a "modified version" of
the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user
through a computer network, with no transfer of a copy, is not
conveying.
An interactive user interface displays "Appropriate Legal Notices" to
the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
#### 1. Source Code.
The "source code" for a work means the preferred form of the work for
making modifications to it. "Object code" means any non-source form of
a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can
regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same
work.
#### 2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey,
without conditions so long as your license otherwise remains in force.
You may convey covered works to others for the sole purpose of having
them make modifications exclusively for you, or provide you with
facilities for running those works, provided that you comply with the
terms of this License in conveying all material for which you do not
control copyright. Those thus making or running the covered works for
you must do so exclusively on your behalf, under your direction and
control, on terms that prohibit them from making any copies of your
copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the
conditions stated below. Sublicensing is not allowed; section 10 makes
it unnecessary.
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such
circumvention is effected by exercising rights under this License with
respect to the covered work, and you disclaim any intention to limit
operation or modification of the work as a means of enforcing, against
the work's users, your or third parties' legal rights to forbid
circumvention of technological measures.
#### 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
#### 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these
conditions:
- a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
- b) The work must carry prominent notices stating that it is
released under this License and any conditions added under
section 7. This requirement modifies the requirement in section 4
to "keep intact all notices".
- c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
- d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
#### 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these
ways:
- a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
- b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding
Source from a network server at no charge.
- c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
- d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
- e) Convey the object code using peer-to-peer transmission,
provided you inform other peers where the object code and
Corresponding Source of the work are being offered to the general
public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal,
family, or household purposes, or (2) anything designed or sold for
incorporation into a dwelling. In determining whether a product is a
consumer product, doubtful cases shall be resolved in favor of
coverage. For a particular product received by a particular user,
"normally used" refers to a typical or common use of that class of
product, regardless of the status of the particular user or of the way
in which the particular user actually uses, or expects or is expected
to use, the product. A product is a consumer product regardless of
whether the product has substantial commercial, industrial or
non-consumer uses, unless such uses represent the only significant
mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to
install and execute modified versions of a covered work in that User
Product from a modified version of its Corresponding Source. The
information must suffice to ensure that the continued functioning of
the modified object code is in no case prevented or interfered with
solely because modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or
updates for a work that has been modified or installed by the
recipient, or for the User Product in which it has been modified or
installed. Access to a network may be denied when the modification
itself materially and adversely affects the operation of the network
or violates the rules and protocols for communication across the
network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
#### 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders
of that material) supplement the terms of this License with terms:
- a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
- b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
- c) Prohibiting misrepresentation of the origin of that material,
or requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
- d) Limiting the use for publicity purposes of names of licensors
or authors of the material; or
- e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
- f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions
of it) with contractual assumptions of liability to the recipient,
for any liability that these contractual assumptions directly
impose on those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; the
above requirements apply either way.
#### 8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
#### 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run
a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
#### 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
#### 11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned
or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within the
scope of its coverage, prohibits the exercise of, or is conditioned on
the non-exercise of one or more of the rights that are specifically
granted under this License. You may not convey a covered work if you
are a party to an arrangement with a third party that is in the
business of distributing software, under which you make payment to the
third party based on the extent of your activity of conveying the
work, and under which the third party grants, to any of the parties
who would receive the covered work from you, a discriminatory patent
license (a) in connection with copies of the covered work conveyed by
you (or copies made from those copies), or (b) primarily for and in
connection with specific products or compilations that contain the
covered work, unless you entered into that arrangement, or that patent
license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
#### 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under
this License and any other pertinent obligations, then as a
consequence you may not convey it at all. For example, if you agree to
terms that obligate you to collect a royalty for further conveying
from those to whom you convey the Program, the only way you could
satisfy both those terms and this License would be to refrain entirely
from conveying the Program.
#### 13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your
version supports such interaction) an opportunity to receive the
Corresponding Source of your version by providing access to the
Corresponding Source from a network server at no charge, through some
standard or customary means of facilitating copying of software. This
Corresponding Source shall include the Corresponding Source for any
work covered by version 3 of the GNU General Public License that is
incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
#### 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Affero General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever
published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions
of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
#### 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
#### 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#### 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
### How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively state
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper
mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for
the specific requirements.
You should also get your employer (if you work as a programmer) or
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. For more information on this, and how to apply and follow
the GNU AGPL, see <https://www.gnu.org/licenses/>.

View file

@ -6,6 +6,6 @@ The architecture we are working towards is a vast simplification of what it was
## Contributing ## Contributing
If you'd like to contribute, it makes sense to talk to the crew on Matrix via [#hakken](https://matrix.to/#/#hakken:pub.solar?via=chat.pub.solar). We can help figuring out how things work and can make sure your ideas fit the pub.solar philosophy. Of course [popping a pull request](https://docs.gitea.com/next/usage/pull-request#creating-a-pull-request) is always celebrated. If you'd like to contribute, it makes sense to talk to the crew on Matrix via [#hakken](https://matrix.to/#/#hakken:pub.solar?via=chat.pub.solar). We can help figuring out how things work and can make sure your ideas fit the pub.solar philosophy. Of course [popping a pull request](https://forgejo.org/docs/latest/user/pull-requests-and-git-flow/) is always celebrated.
To start, see [how to get a development shell](./docs/development-shell.md). To start, check our [contributing guide](./CONTRIBUTING.md).

View file

@ -14,7 +14,7 @@ People with admin access to the infrastructure are added to [`logins/admins.nix`
publicKey = <pubkey-string>; publicKey = <pubkey-string>;
allowedIPs = [ "10.7.6.<ip-address>/32" "fd00:fae:fae:fae:fae:<ip-address>::/96" ]; allowedIPs = [ "10.7.6.<ip-address>/32" "fd00:fae:fae:fae:fae:<ip-address>::/96" ];
} }
}]; ];
secretEncryptionKeys = { secretEncryptionKeys = {
<name> = <encryption-key-string>; <name> = <encryption-key-string>;
@ -30,6 +30,68 @@ SSH is not reachable from the open internet. Instead, SSH Port 22 is protected b
1. **SSH Public key**: self-explanatory. Add your public key to your user attrset under `sshPubKeys`. 1. **SSH Public key**: self-explanatory. Add your public key to your user attrset under `sshPubKeys`.
2. **Wireguard device**: each wireguard device has two parts: the public key and the IP addresses it should have in the wireguard network. The pub.solar wireguard network is spaced under `10.7.6.0/24` and `fd00:fae:fae:fae:fae::/80`. To add your device, it's best to choose a free number between 200 and 255 and use that in both the ipv4 and ipv6 ranges: `10.7.6.<ip-address>/32` `fd00:fae:fae:fae:fae:<ip-address>::/96`. For more information on how to generate keypairs, see [the NixOS Wireguard docs](https://nixos.wiki/wiki/WireGuard#Generate_keypair). 2. **Wireguard device**: each wireguard device has two parts: the public key and the IP addresses it should have in the wireguard network. The pub.solar wireguard network is spaced under `10.7.6.0/24` and `fd00:fae:fae:fae:fae::/80`. To add your device, it's best to choose a free number between 200 and 255 and use that in both the ipv4 and ipv6 ranges: `10.7.6.<ip-address>/32` `fd00:fae:fae:fae:fae:<ip-address>::/96`. For more information on how to generate keypairs, see [the NixOS Wireguard docs](https://nixos.wiki/wiki/WireGuard#Generate_keypair).
One can access our hosts using this domain scheme:
```
ssh barkeeper@<hostname>.wg.pub.solar
```
So, for example for `nachtigall`:
```
ssh barkeeper@nachtigall.wg.pub.solar
```
Example NixOS snippet for WireGuard client config
```
{
networking = {
wireguard.enable = true;
wg-quick.interfaces = {
wg-pub-solar = {
address = ["10.7.6.201/32"];
address = ["10.7.6.201/32" "fd00:fae:fae:fae:fae:201::/96"];
privateKeyFile = "/etc/wireguard/wg-pub-solar.privatekey";
peers = [
{ # nachtigall.pub.solar
publicKey = "qzNywKY9RvqTnDO8eLik75/SHveaSk9OObilDzv+xkk=";
allowedIPs = [ "10.7.6.1/32" "fd00:fae:fae:fae:fae:1::/96" ];
endpoint = "[2a01:4f8:172:1c25::1]:51820";
# Use this endpoint in IPv4 only networks
#endpoint = "138.201.80.102:51820";
persistentKeepalive = 15;
}
{ # flora-6.pub.solar
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [ "10.7.6.2/32" "fd00:fae:fae:fae:fae:2::/96" ];
endpoint = "80.71.153.210:51820";
persistentKeepalive = 15;
}
{ # metronom.pub.solar
publicKey = "zOSYGO7MfnOOUnzaTcWiKRQM0qqxR3JQrwx/gtEtHmo=";
allowedIPs = [ "10.7.6.3/32" "fd00:fae:fae:fae:fae:3::/96" ];
#endpoint = "[2a01:4f8:c2c:7082::]:51820";
# Use this endpoint in IPv4 only networks
endpoint = "49.13.236.167:51820";
persistentKeepalive = 15;
}
{ # tankstelle.pub.solar
publicKey = "iRTlY1lB7nPXf2eXzX8ZZDkfMmXyGjff5/joccbP8Cg=";
allowedIPs = [ "10.7.6.4/32" "fd00:fae:fae:fae:fae:4::/96" ];
endpoint = "[2001:4d88:1ffa:26::5]:51820";
# Use this endpoint in IPv4 only networks
#endpoint = "80.244.242.5:51820";
persistentKeepalive = 15;
}
];
};
};
};
}
```
# Secret encryption # Secret encryption
Deployment secrets are added to the repository in encrypted files. To be able to work with these encrypted files, your public key(s) will have to be added to your user attrset under `secretEncryptionKeys`. Deployment secrets are added to the repository in encrypted files. To be able to work with these encrypted files, your public key(s) will have to be added to your user attrset under `secretEncryptionKeys`.

View file

@ -0,0 +1,14 @@
# Automated account deletion
Per GDPR legislation, accounts should be automatically deleted after a period of inactivity. We discern between two different types of accounts:
1. Without verified email: should be deleted after 30 days without being activated
2. With verified email: should be deleted after 2 years of inactivity
Some services hold on to a session for a very long time. We'll have to query their APIs to see if the account is still in use:
* Matrix via the admin api: https://matrix-org.github.io/synapse/v1.48/admin_api/user_admin_api.html#query-current-sessions-for-a-user
* Mastodon via the admin api: https://docs.joinmastodon.org/methods/admin/accounts/#200-ok
* Nextcloud only gives the last login, not the last active time like a sync via `nextcloud-occ user:lastseen`
* Keycloak
* We can ignore Forgejo, since the sessions there are valid for a maximum of one year, regardless of how they got created

View file

@ -1,13 +1,16 @@
# Process for handling a deletion request # Process for handling a deletion request
### Keycloak ### Keycloak
Required:
- auth.pub.solar ops user credentials
- SSH access to host nachtigall
```
ssh barkeeper@nachtigall.pub.solar
sudo --user keycloak kcadm.sh config credentials --config /tmp/kcadm.config --server http://localhost:8080 --realm pub.solar --user ops Required:
- auth.pub.solar `admin-cli` service user credentials
- [SSH access to host `nachtigall`](./administrative-access.md#ssh-access)
Run each of the following after SSH'ing to `nachtigall`:
```
sudo --user keycloak kcadm.sh config credentials --config /tmp/kcadm.config --server http://localhost:8080 --realm pub.solar --client admin-cli
# Take note of user id in response from following command # Take note of user id in response from following command
sudo --user keycloak kcadm.sh get --config /tmp/kcadm.config users --realm pub.solar --query email=<email-address> sudo --user keycloak kcadm.sh get --config /tmp/kcadm.config users --realm pub.solar --query email=<email-address>
@ -20,42 +23,38 @@ sudo --user keycloak kcadm.sh update --config /tmp/kcadm.config users/2ec6f173-3
Docs: https://www.keycloak.org/docs/latest/server_admin/index.html#updating-a-user Docs: https://www.keycloak.org/docs/latest/server_admin/index.html#updating-a-user
### Nextcloud ### Nextcloud
``` ```
ssh barkeeper@nachtigall.pub.solar
nextcloud-occ user:delete <username> nextcloud-occ user:delete <username>
``` ```
Docs: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#user-commands-label Docs: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#user-commands-label
### Mastodon ### Mastodon
``` ```
ssh barkeeper@nachtigall.pub.solar
sudo -u mastodon mastodon-tootctl accounts delete --email <mail-address> sudo -u mastodon mastodon-tootctl accounts delete --email <mail-address>
``` ```
Docs: https://docs.joinmastodon.org/admin/tootctl/#accounts-delete Docs: https://docs.joinmastodon.org/admin/tootctl/#accounts-delete
### Forgejo ### Forgejo
``` ```
ssh barkeeper@nachtigall.pub.solar
sudo -u gitea gitea admin user delete --config /var/lib/forgejo/custom/conf/app.ini --purge --email <mail-address> sudo -u gitea gitea admin user delete --config /var/lib/forgejo/custom/conf/app.ini --purge --email <mail-address>
``` ```
Docs: https://forgejo.org/docs/latest/admin/command-line/#delete Docs: https://forgejo.org/docs/latest/admin/command-line/#delete
### Matrix ### Matrix
``` ```
ssh bartender@matrix.pub.solar -p 2020
curl --header "Authorization: Bearer <admin-access-token>" --request POST http://172.18.0.3:8008/_synapse/admin/v1/deactivate/@<username>:pub.solar --data '{"erase": true}' curl --header "Authorization: Bearer <admin-access-token>" --request POST http://172.18.0.3:8008/_synapse/admin/v1/deactivate/@<username>:pub.solar --data '{"erase": true}'
``` ```
Docs: https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#deactivate-account Docs: https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#deactivate-account
### OpenBikeSensor ### OpenBikeSensor
Not implemented, see: https://github.com/openbikesensor/portal/issues/95 Not implemented, see: https://github.com/openbikesensor/portal/issues/95

View file

@ -8,13 +8,21 @@ To deploy, make sure you have a [working development shell](./development-shell.
Then, run `deploy-rs` with the hostname of the server you want to deploy: Then, run `deploy-rs` with the hostname of the server you want to deploy:
For nachtigall.pub.solar: For nachtigall.pub.solar:
``` ```
deploy --targets '.#nachtigall' --magic-rollback false --auto-rollback false deploy --targets '.#nachtigall' --magic-rollback false --auto-rollback false --keep-result --result-path ./results
``` ```
For flora-6.pub.solar: For flora-6.pub.solar:
``` ```
deploy --targets '.#flora-6' --magic-rollback false --auto-rollback false deploy --targets '.#flora-6' --magic-rollback false --auto-rollback false --keep-result --result-path ./results
```
For metronom.pub.solar (aarch64-linux):
```
deploy --targets '.#metronom' --magic-rollback false --auto-rollback false --keep-result --result-path ./results --remote-build
``` ```
Usually we skip all rollback functionality, but if you want to deploy a change Usually we skip all rollback functionality, but if you want to deploy a change
@ -26,7 +34,13 @@ deployment, add the flag `--skip-checks` at the end of the command.
`--dry-activate` can be used to only put all files in place without switching, `--dry-activate` can be used to only put all files in place without switching,
to enable switching to the new config quickly at a later moment. to enable switching to the new config quickly at a later moment.
We use `--keep-result --result-path ./results` to keep the last `result`
symlink of each `deploy` from being garbage collected. That way, we keep builds
cached in the Nix store. This is optional and both flags can be removed if disk
space is a scarce resource on your machine.
You'll need to have SSH Access to the boxes to be able to run `deploy`. You'll need to have SSH Access to the boxes to be able to run `deploy`.
### Getting SSH access ### Getting SSH access
See [administrative-access.md](./administrative-access.md). See [administrative-access.md](./administrative-access.md).

View file

@ -1,18 +0,0 @@
# Getting a development shell
Clone this repository:
```
git clone https://git.pub.solar/pub-solar/infra.git
cd infra
```
then, install [the package manager nix](https://nixos.org/download).
Finally, run:
```
nix develop
```
This will install a development shell (devshell) with all required tools.

View file

@ -15,12 +15,15 @@ Please follow https://docs.greenbaum.cloud/en/devops/triton-cli.html for the det
You will need to setup the following [namecheap API credentials](https://www.namecheap.com/support/api/intro), You will need to setup the following [namecheap API credentials](https://www.namecheap.com/support/api/intro),
look for "namecheap API key" in the pub.solar Keepass database. look for "namecheap API key" in the pub.solar Keepass database.
``` ```
NAMECHEAP_API_KEY NAMECHEAP_API_KEY
NAMECHEAP_API_USER NAMECHEAP_API_USER
NAMECHEAP_USER_NAME NAMECHEAP_USER_NAME
``` ```
You will probably also need to add your external IP to the [API allow list](https://ap.www.namecheap.com/settings/tools/apiaccess/whitelisted-ips). You will probably also need to add your external IP to the [API allow list](https://ap.www.namecheap.com/settings/tools/apiaccess/whitelisted-ips).
``` ```
dig -4 ip @dns.toys dig -4 ip @dns.toys
``` ```
@ -35,16 +38,19 @@ terraform init
``` ```
Make your changes, e.g. in `dns.tf`. Make your changes, e.g. in `dns.tf`.
``` ```
$EDITOR dns.tf $EDITOR dns.tf
``` ```
Plan your changes using: Plan your changes using:
``` ```
terraform plan -out pub-solar-infra.plan terraform plan -out pub-solar-infra.plan
``` ```
After verification, apply your changes with: After verification, apply your changes with:
``` ```
terraform apply "pub-solar-infra.plan" terraform apply "pub-solar-infra.plan"
``` ```
@ -52,7 +58,9 @@ terraform apply "pub-solar-infra.plan"
### Useful links ### Useful links
We use the Manta remote backend to save the terraform state for collaboration. We use the Manta remote backend to save the terraform state for collaboration.
- https://www.terraform.io/language/v1.2.x/settings/backends/manta - https://www.terraform.io/language/v1.2.x/settings/backends/manta
Namecheap Terraform provider docs: Namecheap Terraform provider docs:
- https://registry.terraform.io/providers/namecheap/namecheap/latest/docs - https://registry.terraform.io/providers/namecheap/namecheap/latest/docs

View file

@ -0,0 +1,79 @@
# Delete accounts without verified email address
### Keycloak
Required:
- auth.pub.solar admin-cli service user credentials
- [SSH access to host `nachtigall`](../administrative-access.md#ssh-access)
Run following after SSH'ing to `nachtigall`.
Credentials for the following command are in keepass. Create a keycloak
config/credentials file at `/tmp/kcadm.config`:
```
sudo --user keycloak kcadm.sh config credentials \
--config /tmp/kcadm.config \
--server https://auth.pub.solar \
--realm pub.solar \
--client admin-cli
```
Get list of accounts without a verified email address:
```
sudo --user keycloak kcadm.sh get \
--config /tmp/kcadm.config \
users \
--realm pub.solar \
--query emailVerified=false \
> /tmp/keycloak-unverified-accounts
```
Review list of accounts, especially check `createdTimestamp` if any accounts
were created in the past 2 days. If so, delete those from the
`/tmp/keycloak-unverified-accounts` file.
```
createdTimestamps=( $( nix run nixpkgs#jq -- -r '.[].createdTimestamp' < /tmp/keycloak-unverified-accounts ) )
# timestamps are in nanoseconds since epoch, so we need to strip the last three digits
for timestamp in ${createdTimestamps[@]}; do date --date="@${timestamp::-3}"; done
vim /tmp/keycloak-unverified-accounts
```
Check how many accounts are going to be deleted:
```
jq -r '.[].id' < /tmp/keycloak-unverified-accounts | wc -l
```
```
jq -r '.[].id' < /tmp/keycloak-unverified-accounts > /tmp/keycloak-unverified-account-ids
```
Final check before deletion (dry-run):
```
for id in $(cat /tmp/keycloak-unverified-account-ids)
do
echo sudo --user keycloak kcadm.sh delete \
--config /tmp/kcadm.config \
users/$id \
--realm pub.solar
done
```
THIS WILL DELETE ACCOUNTS:
```
for id in $(cat /tmp/keycloak-unverified-account-ids)
do
sudo --user keycloak kcadm.sh delete \
--config /tmp/kcadm.config \
users/$id \
--realm pub.solar
done
```

View file

@ -1,12 +1,15 @@
# Process for getting a list of email addresses of all keycloak users # Process for getting a list of email addresses of all keycloak users
### Keycloak ### Keycloak
Required:
- auth.pub.solar ops user credentials
- SSH access to host nachtigall
```
ssh barkeeper@nachtigall.pub.solar
Required:
- auth.pub.solar admin-cli service user credentials
- [SSH access to host `nachtigall`](../administrative-access.md#ssh-access)
Run following after SSH'ing to `nachtigall`:
```
sudo --user keycloak kcadm.sh get users \ sudo --user keycloak kcadm.sh get users \
-r pub.solar \ -r pub.solar \
--offset 0 \ --offset 0 \

View file

@ -1,15 +1,18 @@
# Process for resetting keycloak user passwords # Process for resetting keycloak user passwords
### Keycloak ### Keycloak
Required:
- auth.pub.solar ops user credentials
- SSH access to host nachtigall
```
ssh barkeeper@nachtigall.pub.solar
Required:
- auth.pub.solar admin-cli service user credentials
- [SSH access to host `nachtigall`](../administrative-access.md#ssh-access)
Run the following after SSH'ing to `nachtigall`:
```
mkdir /tmp/keycloak-credential-reset mkdir /tmp/keycloak-credential-reset
sudo --user keycloak kcadm.sh config credentials --config /tmp/kcadm.config --server http://localhost:8080 --realm pub.solar --user ops sudo --user keycloak kcadm.sh config credentials --config /tmp/kcadm.config --server http://localhost:8080 --realm pub.solar --client admin-cli
sudo --user keycloak kcadm.sh get --config /tmp/kcadm.config users --realm pub.solar | jq --raw-output '.[] | .id' > /tmp/keycloak-credential-reset/all-uuids sudo --user keycloak kcadm.sh get --config /tmp/kcadm.config users --realm pub.solar | jq --raw-output '.[] | .id' > /tmp/keycloak-credential-reset/all-uuids

View file

@ -1,12 +1,15 @@
# Process for updating a keycloak realm via CLI # Process for updating a keycloak realm via CLI
### Keycloak ### Keycloak
Required:
- auth.pub.solar ops user credentials
- SSH access to host nachtigall
```
ssh barkeeper@nachtigall.pub.solar
Required:
- auth.pub.solar admin-cli service user credentials
- [SSH access to host `nachtigall`](../administrative-access.md#ssh-access)
Run the following after SSH'ing to `nachtigall`:
```
sudo -u keycloak kcadm.sh config credentials --config /tmp/kcadm.config --server http://localhost:8080 --realm master --user admin sudo -u keycloak kcadm.sh config credentials --config /tmp/kcadm.config --server http://localhost:8080 --realm master --user admin
sudo -u keycloak kcadm.sh get --config /tmp/kcadm.config realms/pub.solar sudo -u keycloak kcadm.sh get --config /tmp/kcadm.config realms/pub.solar

4
docs/mail.md Normal file
View file

@ -0,0 +1,4 @@
### Mail
mail.pub.solar aka metronom.pub.solar hosts our internal mails.
This is a small Hetzner cloud instance on https://console.hetzner.cloud.

View file

@ -4,28 +4,27 @@ See the [mediawiki-oidc-docker repository](https://git.pub.solar/pub-solar/media
for instructions on updating our customized mediawiki docker image. for instructions on updating our customized mediawiki docker image.
To deploy a new docker image to `nachtigall`, first bump the mediawiki version To deploy a new docker image to `nachtigall`, first bump the mediawiki version
of the docker image tag in `hosts/nachtigall/apps/mediawiki.nix` (search for of the docker image tag in `modules/mediawiki/default.nix` (search for
`image`). `image`).
Next, push your changes to https://git.pub.solar and get them reviewed and Next, push your changes to https://git.pub.solar and get them reviewed and
approved. approved.
After approval, create a fresh backup of the database and deploy the changes to After approval, create a fresh backup of the database and deploy the changes to
`nachtigall`: `nachtigall`. Run the following after [SSH'ing to `nachtigall`](./administrative-access.md#ssh-access):
``` ```
ssh barkeeper@nachtigall.pub.solar
sudo -u postgres pg_dump --create -Fc mediawiki > mediawiki-db-$(date +%F).dump sudo -u postgres pg_dump --create -Fc mediawiki > mediawiki-db-$(date +%F).dump
exit exit
``` ```
``` ```
deploy --targets '.#nachtigall' deploy --targets '.#nachtigall' --magic-rollback false --auto-rollback false --keep-result --result-path ./results
``` ```
Then, finalize the update by running the database migration script: Then, finalize the update by running the database migration script (in a [SSH](./administrative-access.md#ssh-access) shell on `nachtigall`):
``` ```
ssh barkeeper@nachtigall.pub.solar
docker exec -it mediawiki bash docker exec -it mediawiki bash
php maintenance/run.php update.php php maintenance/run.php update.php
``` ```

32
docs/obs-portal.md Normal file
View file

@ -0,0 +1,32 @@
# OpenBikeSensor Portal
## Docker Containers
- portal
- worker
- db
## Run database migrations
After an upgrade it is sometimes necessary to run database migrations or regenerate tiles.
```
docker exec -ti obs-portal tools/upgrade.py
```
## Dump database
Save database dump to `dump.sql` in the current working directory.
```
docker exec -ti --user postgres obs-portal-db pg_dump obs > dump.sql
```
## Restore database
Load database dump from `dump.sql` file.
`obs` database needs to exist before importing the dump.
```
cat dump.sql | docker exec -ti --user postgres obs-portal-db psql obs
```

View file

@ -1,3 +1 @@
# Reverting to an old version # Reverting to an old version

View file

@ -1,9 +0,0 @@
# Unlocking the root partition on boot
After a boot, the encrypted root partition will have to be unlocked. This is done by accessing the server via SSH with user root on port 2222.
```
ssh root@nachtigall.pub.solar -p2222
```
After connecting, paste the crypt passphrase you can find in the shared keepass. This will disconnect the SSH session right away and the server will keep booting into stage 2.

View file

@ -0,0 +1,20 @@
# Unlocking the ZFS pool on boot
After a reboot, the encrypted ZFS pool will have to be unlocked. This is done by
accessing the server via SSH as user `root` on port 2222.
Nachtigall:
```
ssh -4 root@nachtigall.pub.solar -p2222
```
Metronom:
```
ssh -4 root@metronom.pub.solar -p2222
```
After connecting, paste the encryption passphrase you can find in the shared
keepass. This will disconnect the SSH session immediately and the server will
continue to boot into stage 2.

View file

@ -14,11 +14,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1712079060, "lastModified": 1723293904,
"narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=", "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "1381a759b205dff7a6818733118d02253340fd5e", "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -27,6 +27,22 @@
"type": "github" "type": "github"
} }
}, },
"blobs": {
"flake": false,
"locked": {
"lastModified": 1604995301,
"narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=",
"owner": "simple-nixos-mailserver",
"repo": "blobs",
"rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265",
"type": "gitlab"
},
"original": {
"owner": "simple-nixos-mailserver",
"repo": "blobs",
"type": "gitlab"
}
},
"deploy-rs": { "deploy-rs": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -36,11 +52,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1711973905, "lastModified": 1718194053,
"narHash": "sha256-UFKME/N1pbUtn+2Aqnk+agUt8CekbpuqwzljivfIme8=", "narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=",
"owner": "serokell", "owner": "serokell",
"repo": "deploy-rs", "repo": "deploy-rs",
"rev": "88b3059b020da69cbe16526b8d639bd5e0b51c8b", "rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -52,6 +68,25 @@
"devshell": { "devshell": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1713532798,
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
"owner": "numtide",
"repo": "devshell",
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"devshell_2": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"keycloak-theme-pub-solar", "keycloak-theme-pub-solar",
"nixpkgs" "nixpkgs"
@ -71,14 +106,38 @@
"type": "github" "type": "github"
} }
}, },
"element-stickers": {
"inputs": {
"maunium-stickerpicker": [
"maunium-stickerpicker"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1714430716,
"narHash": "sha256-+WmgGbONe5u2wpvkUC5wNhYnrE6eziIv3Liq4pv7jro=",
"ref": "main",
"rev": "85716a9e30fb6fae47336ed0cae3d1425c80f17c",
"revCount": 6,
"type": "git",
"url": "https://git.pub.solar/pub-solar/maunium-stickerpicker-nix"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://git.pub.solar/pub-solar/maunium-stickerpicker-nix"
}
},
"element-themes": { "element-themes": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1707755689, "lastModified": 1718859621,
"narHash": "sha256-pMwrpZwLp7tw0nBbz/ENVJ2LoN9jIxEfjcq7OXoiKEw=", "narHash": "sha256-ZOOm6UFGNSkGrdwbG5saLAYgAPYJ7E80ogA40CaW+E4=",
"owner": "aaronraimist", "owner": "aaronraimist",
"repo": "element-themes", "repo": "element-themes",
"rev": "2368b58c16d2c4aabb82a245f036d228cbb6e5f5", "rev": "3bc82abc3dd468dabc933f0f9d0b443ed97554a6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -104,10 +163,44 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": {
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": { "locked": {
"lastModified": 1712014858, "lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
@ -144,6 +237,24 @@
"inputs": { "inputs": {
"systems": "systems_4" "systems": "systems_4"
}, },
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_5"
},
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
@ -158,7 +269,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": { "flake-utils_4": {
"locked": { "locked": {
"lastModified": 1653893745, "lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
@ -180,24 +291,47 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714043624, "lastModified": 1720042825,
"narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=", "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.11", "ref": "release-24.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"keycloak-theme-pub-solar": { "keycloak-event-listener": {
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
"flake-utils": "flake-utils_2", "flake-parts": "flake-parts_2",
"nixpkgs": [
"unstable"
]
},
"locked": {
"lastModified": 1714263025,
"narHash": "sha256-Uesrz49RwbG7sHgiHkkb5o364BN9WbuwroWxVXdcfvo=",
"ref": "main",
"rev": "fb569f474698b5711c208fd5b4b5880d64863587",
"revCount": 2,
"type": "git",
"url": "https://git.pub.solar/pub-solar/keycloak-event-listener"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://git.pub.solar/pub-solar/keycloak-event-listener"
}
},
"keycloak-theme-pub-solar": {
"inputs": {
"devshell": "devshell_2",
"flake-utils": "flake-utils_3",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@ -217,6 +351,25 @@
"url": "https://git.pub.solar/pub-solar/keycloak-theme" "url": "https://git.pub.solar/pub-solar/keycloak-theme"
} }
}, },
"maunium-stickerpicker": {
"flake": false,
"locked": {
"dir": "web",
"lastModified": 1718796561,
"narHash": "sha256-RKAAHve17lrJokgAPkM2k/E+f9djencwwg3Xcd70Yfw=",
"owner": "maunium",
"repo": "stickerpicker",
"rev": "333567f481e60443360aa7199d481e1a45b3a523",
"type": "github"
},
"original": {
"dir": "web",
"owner": "maunium",
"ref": "master",
"repo": "stickerpicker",
"type": "github"
}
},
"nix-darwin": { "nix-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -224,11 +377,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1713946171, "lastModified": 1724561770,
"narHash": "sha256-lc75rgRQLdp4Dzogv5cfqOg6qYc5Rp83oedF2t0kDp8=", "narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "230a197063de9287128e2c68a7a4b0cd7d0b50a7", "rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -240,11 +393,11 @@
}, },
"nixos-flake": { "nixos-flake": {
"locked": { "locked": {
"lastModified": 1711376798, "lastModified": 1721140942,
"narHash": "sha256-37wawZGSX/dD1rn7TwFJhUdpozC2VPEQXetpfpK/D+w=", "narHash": "sha256-iEqZGdnkG+Hm0jZhS59NJwEyB6z9caVnudWPGHZ/FAE=",
"owner": "srid", "owner": "srid",
"repo": "nixos-flake", "repo": "nixos-flake",
"rev": "7b19503e7f8c7cc0884fc2fbd669c0cc2e05aef5", "rev": "5734c1d9a5fe0bc8e8beaf389ad6227392ca0108",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -255,16 +408,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1713995372, "lastModified": 1704161960,
"narHash": "sha256-fFE3M0vCoiSwCX02z8VF58jXFRj9enYUSTqjyHAjrds=", "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dd37924974b9202f8226ed5d74a252a9785aedf8", "rev": "63143ac2c9186be6d9da6035fa22620018c85932",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "NixOS",
"ref": "nixos-23.11", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -286,6 +439,18 @@
} }
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": {
"lastModified": 1722555339,
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
}
},
"nixpkgs-lib_2": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1711703276, "lastModified": 1711703276,
@ -303,22 +468,69 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1724316499,
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"element-stickers": "element-stickers",
"element-themes": "element-themes", "element-themes": "element-themes",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"keycloak-event-listener": "keycloak-event-listener",
"keycloak-theme-pub-solar": "keycloak-theme-pub-solar", "keycloak-theme-pub-solar": "keycloak-theme-pub-solar",
"maunium-stickerpicker": "maunium-stickerpicker",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nixos-flake": "nixos-flake", "nixos-flake": "nixos-flake",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixpkgs-2205": "nixpkgs-2205", "nixpkgs-2205": "nixpkgs-2205",
"simple-nixos-mailserver": "simple-nixos-mailserver",
"triton-vmtools": "triton-vmtools", "triton-vmtools": "triton-vmtools",
"unstable": "unstable" "unstable": "unstable"
} }
}, },
"simple-nixos-mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat_2",
"nixpkgs": [
"unstable"
],
"nixpkgs-24_05": [
"nixpkgs"
],
"utils": "utils_2"
},
"locked": {
"lastModified": 1718084203,
"narHash": "sha256-Cx1xoVfSMv1XDLgKg08CUd1EoTYWB45VmB9XIQzhmzI=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "29916981e7b3b5782dc5085ad18490113f8ff63b",
"type": "gitlab"
},
"original": {
"owner": "simple-nixos-mailserver",
"ref": "nixos-24.05",
"repo": "nixos-mailserver",
"type": "gitlab"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -379,9 +591,39 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"triton-vmtools": { "triton-vmtools": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_4",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@ -405,11 +647,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1713895582, "lastModified": 1724224976,
"narHash": "sha256-cfh1hi+6muQMbi9acOlju3V1gl8BEaZBXBR9jQfQi4U=", "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "572af610f6151fd41c212f897c71f7056e3fb518", "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -436,6 +678,24 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"utils_2": {
"inputs": {
"systems": "systems_6"
},
"locked": {
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

124
flake.nix
View file

@ -1,7 +1,7 @@
{ {
inputs = { inputs = {
# Track channels with commits tested and built by hydra # Track channels with commits tested and built by hydra
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-2205.url = "github:nixos/nixpkgs/nixos-22.05"; nixpkgs-2205.url = "github:nixos/nixpkgs/nixos-22.05";
@ -9,7 +9,7 @@
nix-darwin.url = "github:lnl7/nix-darwin/master"; nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
@ -26,74 +26,120 @@
keycloak-theme-pub-solar.url = "git+https://git.pub.solar/pub-solar/keycloak-theme?ref=main"; keycloak-theme-pub-solar.url = "git+https://git.pub.solar/pub-solar/keycloak-theme?ref=main";
keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixpkgs"; keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixpkgs";
keycloak-event-listener.url = "git+https://git.pub.solar/pub-solar/keycloak-event-listener?ref=main";
keycloak-event-listener.inputs.nixpkgs.follows = "unstable";
triton-vmtools.url = "git+https://git.pub.solar/pub-solar/infra-vintage?ref=main&dir=vmtools"; triton-vmtools.url = "git+https://git.pub.solar/pub-solar/infra-vintage?ref=main&dir=vmtools";
triton-vmtools.inputs.nixpkgs.follows = "nixpkgs"; triton-vmtools.inputs.nixpkgs.follows = "nixpkgs";
element-themes.url = "github:aaronraimist/element-themes/master"; element-themes.url = "github:aaronraimist/element-themes/master";
element-themes.flake = false; element-themes.flake = false;
maunium-stickerpicker.url = "github:maunium/stickerpicker?ref=master&dir=web";
maunium-stickerpicker.flake = false;
element-stickers.url = "git+https://git.pub.solar/pub-solar/maunium-stickerpicker-nix?ref=main";
element-stickers.inputs.maunium-stickerpicker.follows = "maunium-stickerpicker";
element-stickers.inputs.nixpkgs.follows = "nixpkgs";
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
simple-nixos-mailserver.inputs.nixpkgs-24_05.follows = "nixpkgs";
simple-nixos-mailserver.inputs.nixpkgs.follows = "unstable";
}; };
outputs = inputs@{ self, ... }: outputs =
inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } { inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ]; systems = [
"x86_64-linux"
"aarch64-linux"
];
imports = [ imports = [
inputs.nixos-flake.flakeModule inputs.nixos-flake.flakeModule
./logins ./logins
./lib ./lib
./overlays ./overlays
./modules
./hosts ./hosts
]; ];
perSystem = { system, pkgs, config, ... }: { perSystem =
_module.args = { args@{
inherit inputs; system,
pkgs = import inputs.nixpkgs { pkgs,
inherit system; config,
overlays = [ lib,
inputs.agenix.overlays.default ...
}:
{
_module.args = {
inherit inputs;
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.agenix.overlays.default ];
};
unstable = import inputs.unstable { inherit system; };
master = import inputs.master { inherit system; };
};
packages = import ./tests ({ inherit inputs self; } // args);
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
deploy-rs
nixpkgs-fmt
agenix
age-plugin-yubikey
cachix
editorconfig-checker
nodePackages.prettier
nvfetcher
shellcheck
shfmt
treefmt
nixos-generators
inputs.nixpkgs-2205.legacyPackages.${system}.terraform
jq
]; ];
}; };
unstable = import inputs.unstable { inherit system; };
master = import inputs.master { inherit system; };
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
deploy-rs
nixpkgs-fmt
agenix
age-plugin-yubikey
cachix
editorconfig-checker
nodePackages.prettier
nvfetcher
shellcheck
shfmt
treefmt
nixos-generators
inputs.nixpkgs-2205.legacyPackages.${system}.terraform
jq
];
};
};
flake = devShells.ci = pkgs.mkShell { buildInputs = with pkgs; [ nodejs ]; };
let };
flake = let
username = "barkeeper"; username = "barkeeper";
in in
{ {
inherit username; inherit username;
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib; nixosModules = builtins.listToAttrs (
map (x: {
name = x;
value = import (./modules + "/${x}");
}) (builtins.attrNames (builtins.readDir ./modules))
);
checks = builtins.mapAttrs (
system: deployLib: deployLib.deployChecks self.deploy
) inputs.deploy-rs.lib;
formatter."x86_64-linux" = inputs.unstable.legacyPackages."x86_64-linux".nixfmt-rfc-style;
deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations { deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations {
nachtigall = { nachtigall = {
hostname = "10.7.6.1"; hostname = "nachtigall.wg.pub.solar";
sshUser = username; sshUser = username;
}; };
flora-6 = { flora-6 = {
hostname = "10.7.6.2"; hostname = "flora-6.wg.pub.solar";
sshUser = username;
};
metronom = {
hostname = "metronom.wg.pub.solar";
sshUser = username;
};
tankstelle = {
hostname = "tankstelle.wg.pub.solar";
sshUser = username; sshUser = username;
}; };
}; };

View file

@ -11,9 +11,49 @@
self.nixosModules.unlock-zfs-on-boot self.nixosModules.unlock-zfs-on-boot
self.nixosModules.core self.nixosModules.core
self.nixosModules.docker self.nixosModules.docker
self.nixosModules.backups
self.nixosModules.nginx
self.nixosModules.collabora
self.nixosModules.coturn
self.nixosModules.forgejo
self.nixosModules.keycloak
self.nixosModules.mailman
self.nixosModules.mastodon
self.nixosModules.nginx-mastodon
self.nixosModules.nginx-mastodon-files
self.nixosModules.mediawiki
self.nixosModules.nextcloud
self.nixosModules.nginx-prometheus-exporters
self.nixosModules.nginx-website
self.nixosModules.nginx-website-miom
self.nixosModules.opensearch
self.nixosModules.owncast
self.nixosModules.postgresql
self.nixosModules.prometheus-exporters
self.nixosModules.promtail
self.nixosModules.searx
self.nixosModules.tmate
self.nixosModules.tt-rss
self.nixosModules.obs-portal
self.nixosModules.matrix
self.nixosModules.matrix-irc
self.nixosModules.matrix-telegram
self.nixosModules.nginx-matrix
]; ];
}; };
nachtigall-test = {
imports = [
self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager
./nachtigall/test-vm.nix
self.nixosModules.overlays
self.nixosModules.core
self.nixosModules.docker
];
};
flora-6 = self.nixos-flake.lib.mkLinuxSystem { flora-6 = self.nixos-flake.lib.mkLinuxSystem {
imports = [ imports = [
self.inputs.agenix.nixosModules.default self.inputs.agenix.nixosModules.default
@ -21,6 +61,45 @@
./flora-6 ./flora-6
self.nixosModules.overlays self.nixosModules.overlays
self.nixosModules.core self.nixosModules.core
self.nixosModules.backups
self.nixosModules.keycloak
self.nixosModules.caddy
self.nixosModules.drone
self.nixosModules.forgejo-actions-runner
self.nixosModules.grafana
self.nixosModules.prometheus
self.nixosModules.loki
];
};
metronom = self.nixos-flake.lib.mkLinuxSystem {
imports = [
self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager
./metronom
self.nixosModules.overlays
self.nixosModules.unlock-zfs-on-boot
self.nixosModules.core
self.nixosModules.backups
self.nixosModules.mail
self.nixosModules.prometheus-exporters
self.nixosModules.promtail
self.inputs.simple-nixos-mailserver.nixosModule
];
};
tankstelle = self.nixos-flake.lib.mkLinuxSystem {
imports = [
self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager
./tankstelle
self.nixosModules.overlays
self.nixosModules.core
self.nixosModules.backups
self.nixosModules.prometheus-exporters
self.nixosModules.promtail
]; ];
}; };
}; };

View file

@ -1,59 +0,0 @@
{ config
, lib
, pkgs
, flake
, ...
}:
{
systemd.tmpfiles.rules = [
"d '/data/srv/www/os/download/' 0750 hakkonaut hakkonaut - -"
];
services.caddy = {
enable = lib.mkForce true;
group = "hakkonaut";
email = "admins@pub.solar";
enableReload = true;
globalConfig = lib.mkForce ''
grace_period 60s
'';
virtualHosts = {
"ci.pub.solar" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
reverse_proxy :4000
'';
};
"flora-6.pub.solar" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
basicauth * {
hakkonaut $2a$14$mmIAy/Ezm6YGohUtXa2mWeW6Bcw1MQXPhrRbz14jAD2iUu3oob/t.
}
reverse_proxy :${toString config.services.loki.configuration.server.http_listen_port}
'';
};
"grafana.pub.solar" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
reverse_proxy :${toString config.services.grafana.settings.server.http_port}
'';
};
"obs-portal.pub.solar" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
reverse_proxy obs-portal.svc.e5756d08-36fd-424b-f8bc-acdb92ca7b82.lev-1.int.greenbaum.zone:3000
'';
};
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
}

View file

@ -1,84 +0,0 @@
{ config
, lib
, pkgs
, flake
, ...
}: {
# source: https://gist.github.com/rickhull/895b0cb38fdd537c1078a858cf15d63e
# https://grafana.com/docs/loki/latest/configure/examples/#1-local-configuration-exampleyaml
services.loki = {
enable = true;
configuration = {
server.http_listen_port = 3100;
auth_enabled = false;
common = {
ring = {
instance_addr = "127.0.0.1";
kvstore = {
store = "inmemory";
};
};
replication_factor = 1;
path_prefix = "/var/lib/loki";
storage = {
filesystem = {
chunks_directory = "chunks/";
rules_directory = "rules/";
};
};
};
# Keep logs for 4 weeks
# https://grafana.com/docs/loki/latest/operations/storage/retention/
limits_config.retention_period = "4w";
compactor = {
shared_store = "filesystem";
compaction_interval = "10m";
retention_enabled = true;
retention_delete_delay = "2h";
retention_delete_worker_count = 150;
};
schema_config = {
configs = [{
from = "2020-05-15";
store = "boltdb-shipper";
object_store = "filesystem";
schema = "v11";
index = {
prefix = "index_";
period = "24h";
};
}];
};
};
};
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_port = 9080;
grpc_listen_port = 0;
};
positions = {
filename = "/tmp/positions.yaml";
};
clients = [{
url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
}];
scrape_configs = [{
job_name = "journal";
journal = {
max_age = "24h";
labels = {
job = "systemd-journal";
host = "flora-6";
};
};
relabel_configs = [{
source_labels = [ "__journal__systemd_unit" ];
target_label = "unit";
}];
}];
};
};
}

View file

@ -1,69 +0,0 @@
{ config
, lib
, pkgs
, flake
, ...
}: {
age.secrets.nachtigall-metrics-prometheus-basic-auth-password = {
file = "${flake.self}/secrets/nachtigall-metrics-prometheus-basic-auth-password.age";
mode = "600";
owner = "prometheus";
};
services.prometheus = {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
};
globalConfig = {
scrape_interval = "10s";
scrape_timeout = "9s";
};
scrapeConfigs = [
{
job_name = "node-exporter-http";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
labels = {
instance = "flora-6";
};
}];
}
{
job_name = "node-exporter-https";
scheme = "https";
metrics_path = "/metrics";
basic_auth = {
username = "hakkonaut";
password_file = "${config.age.secrets.nachtigall-metrics-prometheus-basic-auth-password.path}";
};
static_configs = [{
targets = [ "nachtigall.pub.solar" ];
labels = {
instance = "nachtigall";
};
}];
}
{
job_name = "matrix-synapse";
scheme = "https";
metrics_path = "/_synapse/metrics";
basic_auth = {
username = "hakkonaut";
password_file = "${config.age.secrets.nachtigall-metrics-prometheus-basic-auth-password.path}";
};
static_configs = [{
targets = [ "nachtigall.pub.solar" ];
labels = {
instance = "nachtigall";
};
}];
}
];
};
}

View file

@ -1,8 +1,9 @@
{ config {
, lib config,
, pkgs lib,
, flake pkgs,
, ... flake,
...
}: }:
let let
psCfg = config.pub-solar; psCfg = config.pub-solar;

View file

@ -1,20 +1,11 @@
{ ... }: { ... }:
{ {
imports = imports = [
[ # Include the results of the hardware scan.
# Include the results of the hardware scan. ./hardware-configuration.nix
./hardware-configuration.nix ./configuration.nix
./configuration.nix ./triton-vmtools.nix
./triton-vmtools.nix ./wireguard.nix
./wireguard.nix ];
./apps/caddy.nix
./apps/drone.nix
./apps/forgejo-actions-runner.nix
./apps/grafana.nix
./apps/prometheus.nix
./apps/loki.nix
];
} }

View file

@ -1,15 +1,23 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config {
, lib config,
, pkgs lib,
, modulesPath pkgs,
, ... modulesPath,
}: { ...
}:
{
imports = [ ]; imports = [ ];
boot.initrd.availableKernelModules = [ "ahci" "virtio_pci" "xhci_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = [
"ahci"
"virtio_pci"
"xhci_pci"
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View file

@ -1,7 +1,5 @@
{ pkgs { pkgs, flake, ... }:
, flake {
, ...
}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
flake.inputs.triton-vmtools.packages.${pkgs.system}.default flake.inputs.triton-vmtools.packages.${pkgs.system}.default
]; ];

View file

@ -2,7 +2,8 @@
config, config,
pkgs, pkgs,
flake, flake,
... }: ...
}:
{ {
networking.firewall.allowedUDPPorts = [ 51820 ]; networking.firewall.allowedUDPPorts = [ 51820 ];
@ -18,16 +19,39 @@
]; ];
privateKeyFile = config.age.secrets.wg-private-key.path; privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [ peers = flake.self.logins.admins.wireguardDevices ++ [
{ # nachtigall.pub.solar {
# nachtigall.pub.solar
endpoint = "138.201.80.102:51820"; endpoint = "138.201.80.102:51820";
publicKey = "qzNywKY9RvqTnDO8eLik75/SHveaSk9OObilDzv+xkk="; publicKey = "qzNywKY9RvqTnDO8eLik75/SHveaSk9OObilDzv+xkk=";
allowedIPs = [ "10.7.6.1/32" "fd00:fae:fae:fae:fae:1::/96" ]; allowedIPs = [
"10.7.6.1/32"
"fd00:fae:fae:fae:fae:1::/96"
];
}
{
# metronom.pub.solar
endpoint = "49.13.236.167:51820";
publicKey = "zOSYGO7MfnOOUnzaTcWiKRQM0qqxR3JQrwx/gtEtHmo=";
allowedIPs = [
"10.7.6.3/32"
"fd00:fae:fae:fae:fae:3::/96"
];
persistentKeepalive = 15;
}
{
# tankstelle.pub.solar
endpoint = "80.244.242.5:51820";
publicKey = "iRTlY1lB7nPXf2eXzX8ZZDkfMmXyGjff5/joccbP8Cg=";
allowedIPs = [
"10.7.6.4/32"
"fd00:fae:fae:fae:fae:4::/96"
];
} }
]; ];
}; };
}; };
services.openssh.listenAddresses = [ services.openssh.listenAddresses = [
{ {
addr = "10.7.6.2"; addr = "10.7.6.2";
port = 22; port = 22;

View file

@ -0,0 +1,13 @@
{ flake, ... }:
{
age.secrets."restic-repo-droppie" = {
file = "${flake.self}/secrets/restic-repo-droppie.age";
mode = "400";
owner = "root";
};
age.secrets."restic-repo-storagebox" = {
file = "${flake.self}/secrets/restic-repo-storagebox.age";
mode = "400";
owner = "root";
};
}

View file

@ -0,0 +1,39 @@
{
flake,
config,
pkgs,
...
}:
{
boot.loader.systemd-boot.enable = true;
boot.supportedFilesystems = [ "zfs" ];
boot.kernelParams = [
"boot.shell_on_fail=1"
"ip=dhcp"
];
boot.initrd.availableKernelModules = [ "igb" ];
# https://nixos.wiki/wiki/ZFS#declarative_mounting_of_ZFS_datasets
systemd.services.zfs-mount.enable = false;
services.zfs.autoScrub = {
enable = true;
pools = [ "root_pool" ];
};
# Declarative SSH private key
#age.secrets."metronom-root-ssh-key" = {
# file = "${flake.self}/secrets/metronom-root-ssh-key.age";
# path = "/root/.ssh/id_ed25519";
# mode = "400";
# owner = "root";
#};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "23.11"; # Did you read the comment?
}

View file

@ -0,0 +1,12 @@
{ flake, ... }:
{
imports = [
./hardware-configuration.nix
./configuration.nix
./networking.nix
./wireguard.nix
#./backups.nix
];
}

View file

@ -0,0 +1,48 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"usbhid"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "root_pool/root";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/2083-C68E";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,19 @@
{
config,
pkgs,
flake,
...
}:
{
networking.hostName = "metronom";
networking.extraHosts = ''
127.0.0.2 mail.pub.solar mail
::1 mail.pub.solar mail
'';
networking.hostId = "00000002";
networking.enableIPv6 = true;
networking.useDHCP = false;
networking.interfaces."enp1s0".useDHCP = true;
}

View file

@ -0,0 +1,54 @@
{
config,
pkgs,
flake,
...
}:
{
networking.firewall.allowedUDPPorts = [ 51820 ];
age.secrets.wg-private-key.file = "${flake.self}/secrets/metronom-wg-private-key.age";
networking.wireguard.interfaces = {
wg-ssh = {
listenPort = 51820;
mtu = 1300;
ips = [
"10.7.6.3/32"
"fd00:fae:fae:fae:fae:3::/96"
];
privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [
{
# flora-6.pub.solar
endpoint = "80.71.153.210:51820";
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [
"10.7.6.2/32"
"fd00:fae:fae:fae:fae:2::/96"
];
}
{
# nachtigall.pub.solar
endpoint = "138.201.80.102:51820";
publicKey = "qzNywKY9RvqTnDO8eLik75/SHveaSk9OObilDzv+xkk=";
allowedIPs = [
"10.7.6.1/32"
"fd00:fae:fae:fae:fae:1::/96"
];
}
];
};
};
services.openssh.listenAddresses = [
{
addr = "10.7.6.3";
port = 22;
}
{
addr = "[fd00:fae:fae:fae:fae:3::]";
port = 22;
}
];
}

View file

@ -30,7 +30,6 @@
}; };
}; };
# keycloak
services.keycloak = { services.keycloak = {
enable = true; enable = true;
database.passwordFile = config.age.secrets.keycloak-database-password.path; database.passwordFile = config.age.secrets.keycloak-database-password.path;
@ -44,6 +43,9 @@
themes = { themes = {
"pub.solar" = flake.inputs.keycloak-theme-pub-solar.legacyPackages.${pkgs.system}.keycloak-theme-pub-solar; "pub.solar" = flake.inputs.keycloak-theme-pub-solar.legacyPackages.${pkgs.system}.keycloak-theme-pub-solar;
}; };
plugins = [
flake.inputs.keycloak-event-listener.packages.${pkgs.system}.keycloak-event-listener
];
}; };
services.restic.backups.keycloak-droppie = { services.restic.backups.keycloak-droppie = {

View file

@ -1,40 +0,0 @@
version: 1
formatters:
precise:
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
filters:
context:
(): synapse.util.logcontext.LoggingContextFilter
request: ""
handlers:
console:
class: logging.StreamHandler
formatter: precise
filters: [context]
loggers:
synapse:
level: WARNING
synapse.storage.SQL:
# beware: increasing this to DEBUG will make synapse log sensitive
# information such as access tokens.
level: WARNING
synapse.http.matrixfederationclient:
level: CRITICAL
synapse.federation.sender.per_destination_queue:
level: CRITICAL
synapse.handlers.device:
level: CRITICAL
synapse.replication.tcp.handler:
level: CRITICAL
shared_secret_authenticator:
level: INFO
root:
level: WARNING
handlers: [console]

View file

@ -1,32 +0,0 @@
{ config, flake, lib, ... }:
let
# Find element in list config.services.matrix-synapse.settings.listeners
# that sets type = "metrics"
listenerWithMetrics = lib.findFirst
(listener:
listener.type == "metrics")
(throw "Found no matrix-synapse.settings.listeners.*.type containing string metrics")
config.services.matrix-synapse.settings.listeners
;
synapseMetricsPort = "${toString listenerWithMetrics.port}";
in
{
age.secrets.nachtigall-metrics-nginx-basic-auth = {
file = "${flake.self}/secrets/nachtigall-metrics-nginx-basic-auth.age";
mode = "600";
owner = "nginx";
};
services.nginx.virtualHosts = {
"nachtigall.pub.solar" = {
enableACME = true;
addSSL = true;
basicAuthFile = "${config.age.secrets.nachtigall-metrics-nginx-basic-auth.path}";
locations."/metrics" = {
proxyPass = "http://127.0.0.1:${toString(config.services.prometheus.exporters.node.port)}";
};
locations."/_synapse/metrics" = {
proxyPass = "http://127.0.0.1:${synapseMetricsPort}";
};
};
};
}

View file

@ -1,17 +0,0 @@
{ ... }:
{
services.postgresql = {
enable = true;
enableTCPIP = true;
};
systemd.services.postgresql = {
after = [
"var-lib-postgresql.mount"
];
requisite = [
"var-lib-postgresql.mount"
];
};
}

View file

@ -1,46 +0,0 @@
{ config
, lib
, pkgs
, flake
, ...
}: {
age.secrets.nachtigall-metrics-prometheus-basic-auth-password = {
file = "${flake.self}/secrets/nachtigall-metrics-prometheus-basic-auth-password.age";
mode = "600";
owner = "promtail";
};
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_port = 9080;
grpc_listen_port = 0;
};
positions = {
filename = "/tmp/positions.yaml";
};
clients = [{
url = "https://flora-6.pub.solar/loki/api/v1/push";
basic_auth = {
username = "hakkonaut";
password_file = "${config.age.secrets.nachtigall-metrics-prometheus-basic-auth-password.path}";
};
}];
scrape_configs = [{
job_name = "journal";
journal = {
max_age = "24h";
labels = {
job = "systemd-journal";
host = "nachtigall";
};
};
relabel_configs = [{
source_labels = [ "__journal__systemd_unit" ];
target_label = "unit";
}];
}];
};
};
}

View file

@ -1,4 +1,5 @@
{ flake, ... }: { { flake, ... }:
{
age.secrets."restic-repo-droppie" = { age.secrets."restic-repo-droppie" = {
file = "${flake.self}/secrets/restic-repo-droppie.age"; file = "${flake.self}/secrets/restic-repo-droppie.age";
mode = "400"; mode = "400";

View file

@ -1,8 +1,10 @@
{ flake {
, config flake,
, pkgs config,
, ... pkgs,
}: { ...
}:
{
# Use GRUB2 as the boot loader. # Use GRUB2 as the boot loader.
# We don't use systemd-boot because Hetzner uses BIOS legacy boot. # We don't use systemd-boot because Hetzner uses BIOS legacy boot.
boot.loader.systemd-boot.enable = false; boot.loader.systemd-boot.enable = false;
@ -11,15 +13,11 @@
efiSupport = false; efiSupport = false;
mirroredBoots = [ mirroredBoots = [
{ {
devices = [ devices = [ "/dev/disk/by-id/nvme-SAMSUNG_MZVL21T0HCLR-00B00_S676NF0R517371" ];
"/dev/disk/by-id/nvme-SAMSUNG_MZVL21T0HCLR-00B00_S676NF0R517371"
];
path = "/boot1"; path = "/boot1";
} }
{ {
devices = [ devices = [ "/dev/disk/by-id/nvme-KXG60ZNV1T02_TOSHIBA_Z9NF704ZF9ZL" ];
"/dev/disk/by-id/nvme-KXG60ZNV1T02_TOSHIBA_Z9NF704ZF9ZL"
];
path = "/boot2"; path = "/boot2";
} }
]; ];
@ -37,6 +35,11 @@
# https://nixos.wiki/wiki/ZFS#declarative_mounting_of_ZFS_datasets # https://nixos.wiki/wiki/ZFS#declarative_mounting_of_ZFS_datasets
systemd.services.zfs-mount.enable = false; systemd.services.zfs-mount.enable = false;
services.zfs.autoScrub = {
enable = true;
pools = [ "root_pool" ];
};
# Declarative SSH private key # Declarative SSH private key
age.secrets."nachtigall-root-ssh-key" = { age.secrets."nachtigall-root-ssh-key" = {
file = "${flake.self}/secrets/nachtigall-root-ssh-key.age"; file = "${flake.self}/secrets/nachtigall-root-ssh-key.age";
@ -45,6 +48,22 @@
owner = "root"; owner = "root";
}; };
age.secrets.keycloak-database-password = {
file = "${flake.self}/secrets/keycloak-database-password.age";
mode = "600";
#owner = "keycloak";
};
pub-solar-os.auth = {
enable = true;
database-password-file = config.age.secrets.keycloak-database-password.path;
};
pub-solar-os.backups.stores.storagebox = {
passwordFile = config.age.secrets."restic-repo-storagebox".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
};
# This value determines the NixOS release with which your system is to be # This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database # compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you # servers. You should change this only after NixOS release notes say you

View file

@ -1,41 +1,13 @@
{ flake, ... }: { flake, ... }:
{ {
imports = imports = [
[ # Include the results of the hardware scan.
# Include the results of the hardware scan. ./hardware-configuration.nix
./hardware-configuration.nix ./configuration.nix
./configuration.nix
./networking.nix ./networking.nix
./wireguard.nix ./wireguard.nix
./backups.nix ./backups.nix
./apps/nginx.nix ];
./apps/collabora.nix
./apps/coturn.nix
./apps/forgejo.nix
./apps/keycloak.nix
./apps/mailman.nix
./apps/mastodon.nix
./apps/mediawiki.nix
./apps/nextcloud.nix
./apps/nginx-mastodon.nix
./apps/nginx-mastodon-files.nix
./apps/nginx-prometheus-exporters.nix
./apps/nginx-website.nix
./apps/nginx-website-miom.nix
./apps/opensearch.nix
./apps/owncast.nix
./apps/postgresql.nix
./apps/prometheus-exporters.nix
./apps/promtail.nix
./apps/searx.nix
./apps/tmate.nix
./apps/matrix/irc.nix
./apps/matrix/mautrix-telegram.nix
./apps/matrix/synapse.nix
./apps/nginx-matrix.nix
];
} }

View file

@ -1,54 +1,54 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "nvme" ]; boot.initrd.availableKernelModules = [
"ahci"
"nvme"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "root_pool/root";
device = "root_pool/root"; fsType = "zfs";
fsType = "zfs"; };
};
fileSystems."/var/lib" = fileSystems."/var/lib" = {
{ device = "root_pool/data";
device = "root_pool/data"; fsType = "zfs";
fsType = "zfs"; };
};
fileSystems."/var/lib/postgresql" = fileSystems."/var/lib/postgresql" = {
{ device = "root_pool/data/postgresql";
device = "root_pool/data/postgresql"; fsType = "zfs";
fsType = "zfs"; };
};
fileSystems."/var/lib/docker" = fileSystems."/var/lib/docker" = {
{ device = "root_pool/data/docker";
device = "root_pool/data/docker"; fsType = "zfs";
fsType = "zfs"; };
};
fileSystems."/boot1" = fileSystems."/boot1" = {
{ device = "/dev/disk/by-uuid/5493-EFF5";
device = "/dev/disk/by-uuid/5493-EFF5"; fsType = "vfat";
fsType = "vfat"; };
};
fileSystems."/boot2" = fileSystems."/boot2" = {
{ device = "/dev/disk/by-uuid/5494-BA1E";
device = "/dev/disk/by-uuid/5494-BA1E"; fsType = "vfat";
fsType = "vfat"; };
};
swapDevices = [ ]; swapDevices = [ ];

View file

@ -2,11 +2,11 @@
config, config,
pkgs, pkgs,
flake, flake,
... }: ...
}:
{ {
networking.hostName = "nachtigall"; networking.hostName = "nachtigall";
networking.domain = "pub.solar";
networking.hostId = "00000001"; networking.hostId = "00000001";
# Network (Hetzner uses static IP assignments, and we don't use DHCP here) # Network (Hetzner uses static IP assignments, and we don't use DHCP here)
@ -24,5 +24,8 @@
} }
]; ];
networking.defaultGateway = "138.201.80.65"; networking.defaultGateway = "138.201.80.65";
networking.defaultGateway6 = { address = "fe80::1"; interface = "enp35s0"; }; networking.defaultGateway6 = {
address = "fe80::1";
interface = "enp35s0";
};
} }

View file

@ -0,0 +1,54 @@
{ flake, lib, ... }:
{
imports =
[
./backups.nix
./apps/nginx.nix
./apps/collabora.nix
./apps/coturn.nix
./apps/forgejo.nix
./apps/keycloak.nix
./apps/mailman.nix
./apps/mastodon.nix
./apps/mediawiki.nix
./apps/nextcloud.nix
./apps/nginx-mastodon.nix
./apps/nginx-mastodon-files.nix
./apps/nginx-prometheus-exporters.nix
./apps/nginx-website.nix
./apps/nginx-website-miom.nix
./apps/opensearch.nix
./apps/owncast.nix
./apps/postgresql.nix
./apps/prometheus-exporters.nix
./apps/promtail.nix
./apps/searx.nix
./apps/tmate.nix
./apps/matrix/irc.nix
./apps/matrix/mautrix-telegram.nix
./apps/matrix/synapse.nix
./apps/nginx-matrix.nix
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
security.acme.defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
security.acme.preliminarySelfsigned = true;
networking.useDHCP = true;
networking.interfaces."enp35s0".ipv4.addresses = [
{
address = "10.0.0.1";
prefixLength = 26;
}
];
networking.interfaces."enp35s0".ipv6.addresses = [
{
address = "2a01:4f8:172:1c25::1";
prefixLength = 64;
}
];
}

View file

@ -2,7 +2,8 @@
config, config,
pkgs, pkgs,
flake, flake,
... }: ...
}:
{ {
networking.firewall.allowedUDPPorts = [ 51820 ]; networking.firewall.allowedUDPPorts = [ 51820 ];
@ -18,16 +19,29 @@
]; ];
privateKeyFile = config.age.secrets.wg-private-key.path; privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [ peers = flake.self.logins.admins.wireguardDevices ++ [
{ # flora-6.pub.solar {
# flora-6.pub.solar
endpoint = "80.71.153.210:51820"; endpoint = "80.71.153.210:51820";
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU="; publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [ "10.7.6.2/32" "fd00:fae:fae:fae:fae:2::/96" ]; allowedIPs = [
"10.7.6.2/32"
"fd00:fae:fae:fae:fae:2::/96"
];
}
{
# tankstelle.pub.solar
endpoint = "80.244.242.5:51820";
publicKey = "iRTlY1lB7nPXf2eXzX8ZZDkfMmXyGjff5/joccbP8Cg=";
allowedIPs = [
"10.7.6.4/32"
"fd00:fae:fae:fae:fae:4::/96"
];
} }
]; ];
}; };
}; };
services.openssh.listenAddresses = [ services.openssh.listenAddresses = [
{ {
addr = "10.7.6.1"; addr = "10.7.6.1";
port = 22; port = 22;

View file

@ -0,0 +1,13 @@
{ flake, ... }:
{
age.secrets."restic-repo-droppie" = {
file = "${flake.self}/secrets/restic-repo-droppie.age";
mode = "400";
owner = "root";
};
age.secrets."restic-repo-storagebox" = {
file = "${flake.self}/secrets/restic-repo-storagebox.age";
mode = "400";
owner = "root";
};
}

View file

@ -0,0 +1,16 @@
{
flake,
config,
pkgs,
...
}:
{
imports = [ ./hardware-configuration.nix ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,13 @@
{ flake, ... }:
{
imports = [
./hardware-configuration.nix
./configuration.nix
./networking.nix
./forgejo-actions-runner.nix
./wireguard.nix
#./backups.nix
];
}

View file

@ -0,0 +1,62 @@
{
config,
lib,
pkgs,
flake,
...
}:
{
age.secrets.tankstelle-forgejo-actions-runner-token = {
file = "${flake.self}/secrets/tankstelle-forgejo-actions-runner-token.age";
mode = "440";
};
# Trust docker bridge interface traffic
# Needed for the docker runner to communicate with the act_runner cache
networking.firewall.trustedInterfaces = [ "br-+" ];
users.users.gitea-runner = {
home = "/var/lib/gitea-runner/tankstelle";
useDefaultShell = true;
group = "gitea-runner";
# Required to interact with nix daemon
extraGroups = [ "wheel" ];
isSystemUser = true;
};
users.groups.gitea-runner = { };
systemd.tmpfiles.rules = [ "d '/var/lib/gitea-runner' 0750 gitea-runner gitea-runner - -" ];
systemd.services."gitea-runner-tankstelle" = {
serviceConfig.DynamicUser = lib.mkForce false;
path = with pkgs; [
coreutils
bash
coreutils
curl
gawk
gitMinimal
gnused
nodejs
wget
cachix
jq
nix
];
};
# forgejo actions runner
# https://forgejo.org/docs/latest/admin/actions/
# https://docs.gitea.com/usage/actions/quickstart
services.gitea-actions-runner = {
package = pkgs.forgejo-runner;
instances."tankstelle" = {
enable = true;
name = config.networking.hostName;
url = "https://git.pub.solar";
tokenFile = config.age.secrets.tankstelle-forgejo-actions-runner-token.path;
labels = [ "self-hosted:host://-self-hosted" ];
};
};
}

View file

@ -0,0 +1,41 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/17531ffc-46bd-4259-8287-2dea73804b5b";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/AF98-AA5C";
fsType = "vfat";
};
swapDevices = [ { device = "/dev/disk/by-uuid/7aee04b5-1ef9-43de-acb4-70ac1238b58a"; } ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,38 @@
{
config,
pkgs,
flake,
...
}:
{
networking = {
hostName = "tankstelle";
enableIPv6 = true;
defaultGateway = {
address = "80.244.242.1";
interface = "enp1s0";
};
defaultGateway6 = {
address = "2001:4d88:1ffa:26::1";
interface = "enp1s0";
};
nameservers = [
"95.129.51.51"
"80.244.244.244"
];
interfaces."enp1s0" = {
ipv4.addresses = [
{
address = "80.244.242.5";
prefixLength = 29;
}
];
ipv6.addresses = [
{
address = "2001:4d88:1ffa:26::5";
prefixLength = 64;
}
];
};
};
}

View file

@ -0,0 +1,54 @@
{
config,
pkgs,
flake,
...
}:
{
networking.firewall.allowedUDPPorts = [ 51820 ];
age.secrets.wg-private-key.file = "${flake.self}/secrets/tankstelle-wg-private-key.age";
networking.wireguard.interfaces = {
wg-ssh = {
listenPort = 51820;
mtu = 1300;
ips = [
"10.7.6.4/32"
"fd00:fae:fae:fae:fae:4::/96"
];
privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [
{
# nachtigall.pub.solar
endpoint = "138.201.80.102:51820";
publicKey = "qzNywKY9RvqTnDO8eLik75/SHveaSk9OObilDzv+xkk=";
allowedIPs = [
"10.7.6.1/32"
"fd00:fae:fae:fae:fae:1::/96"
];
}
{
# flora-6.pub.solar
endpoint = "80.71.153.210:51820";
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [
"10.7.6.2/32"
"fd00:fae:fae:fae:fae:2::/96"
];
}
];
};
};
services.openssh.listenAddresses = [
{
addr = "10.7.6.4";
port = 22;
}
{
addr = "[fd00:fae:fae:fae:fae:4::]";
port = 22;
}
];
}

View file

@ -1,16 +1,16 @@
let let
lock = builtins.fromJSON (builtins.readFile builtins.path { lock = builtins.fromJSON (
path = ../../flake.lock; builtins.readFile builtins.path {
name = "lockPath"; path = ../../flake.lock;
}); name = "lockPath";
}
);
flake = flake =
import import
( (fetchTarball {
fetchTarball { url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; sha256 = lock.nodes.flake-compat.locked.narHash;
sha256 = lock.nodes.flake-compat.locked.narHash; })
}
)
{ {
src = builtins.path { src = builtins.path {
path = ../../.; path = ../../.;

View file

@ -1,8 +1,13 @@
{ self, lib, inputs, ... }: { {
self,
lib,
inputs,
...
}:
{
# Configuration common to all Linux systems # Configuration common to all Linux systems
flake = { flake = {
lib = lib = let
let
callLibs = file: import file { inherit lib; }; callLibs = file: import file { inherit lib; };
in in
rec { rec {

View file

@ -1,75 +1,80 @@
/* /*
* The contents of this file are adapted from digga The contents of this file are adapted from digga
* https://github.com/divnix/digga https://github.com/divnix/digga
*
* Licensed under the MIT license Licensed under the MIT license
*/ */
{ lib, inputs }: { lib, inputs }:
let let
# https://github.com/serokell/deploy-rs#overall-usage getFqdn =
system = "x86_64-linux"; c:
pkgs = import inputs.nixpkgs { inherit system; };
deployPkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.deploy-rs.overlay
(self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; })
];
};
getFqdn = c:
let let
net = c.config.networking; net = c.config.networking;
fqdn = fqdn =
if (net ? domain) && (net.domain != null) if (net ? domain) && (net.domain != null) then "${net.hostName}.${net.domain}" else net.hostName;
then "${net.hostName}.${net.domain}"
else net.hostName;
in in
fqdn; fqdn;
in in
{ {
mkDeployNodes = systemConfigurations: extraConfig: mkDeployNodes =
systemConfigurations: extraConfig:
/* /*
* *
Synopsis: mkNodes _systemConfigurations_ _extraConfig_ Synopsis: mkNodes _systemConfigurations_ _extraConfig_
Generate the `nodes` attribute expected by deploy-rs Generate the `nodes` attribute expected by deploy-rs
where _systemConfigurations_ are `nodes`. where _systemConfigurations_ are `nodes`.
_systemConfigurations_ should take the form of a flake's _systemConfigurations_ should take the form of a flake's
_nixosConfigurations_. Note that deploy-rs does not currently support _nixosConfigurations_. Note that deploy-rs does not currently support
deploying to darwin hosts. deploying to darwin hosts.
_extraConfig_, if specified, will be merged into each of the _extraConfig_, if specified, will be merged into each of the
nodes' configurations. nodes' configurations.
Example _systemConfigurations_ input: Example _systemConfigurations_ input:
``` ```
{ {
hostname-1 = { hostname-1 = {
fastConnection = true; fastConnection = true;
sshOpts = [ "-p" "25" ]; sshOpts = [ "-p" "25" ];
}; };
hostname-2 = { hostname-2 = {
sshOpts = [ "-p" "19999" ]; sshOpts = [ "-p" "19999" ];
sshUser = "root"; sshUser = "root";
}; };
} }
``` ```
* *
*/ */
lib.recursiveUpdate lib.recursiveUpdate (lib.mapAttrs (_: c: {
(lib.mapAttrs hostname = getFqdn c;
( profiles.system =
_: c: { let
hostname = getFqdn c; system = c.pkgs.system;
profiles.system = {
user = "root"; # Unmodified nixpkgs
path = deployPkgs.deploy-rs.lib.activate.nixos c; pkgs = import inputs.nixpkgs { inherit system; };
};
} # nixpkgs with deploy-rs overlay but force the nixpkgs package
) deployPkgs = import inputs.nixpkgs {
systemConfigurations) inherit system;
extraConfig; overlays = [
inputs.deploy-rs.overlay # or deploy-rs.overlays.default
(self: super: {
deploy-rs = {
inherit (pkgs) deploy-rs;
lib = super.deploy-rs.lib;
};
})
];
};
in
{
user = "root";
path = deployPkgs.deploy-rs.lib.activate.nixos c;
};
}) systemConfigurations) extraConfig;
} }

View file

@ -10,7 +10,10 @@
{ {
# tuxnix # tuxnix
publicKey = "fTvULvdsc92binFaBV+uWwFi33bi8InShcaPnoxUZEA="; publicKey = "fTvULvdsc92binFaBV+uWwFi33bi8InShcaPnoxUZEA=";
allowedIPs = [ "10.7.6.203/32" "fd00:fae:fae:fae:fae:203::/96" ]; allowedIPs = [
"10.7.6.203/32"
"fd00:fae:fae:fae:fae:203::/96"
];
} }
]; ];
}; };
@ -27,9 +30,13 @@
} // sshPubKeys; } // sshPubKeys;
wireguardDevices = [ wireguardDevices = [
{ # stroopwafel {
# stroopwafel
publicKey = "NNb7T8Jmn+V2dTZ8T6Fcq7hGomHGDckKoV3kK2oAhSE="; publicKey = "NNb7T8Jmn+V2dTZ8T6Fcq7hGomHGDckKoV3kK2oAhSE=";
allowedIPs = [ "10.7.6.200/32" "fd00:fae:fae:fae:fae:200::/96" ]; allowedIPs = [
"10.7.6.200/32"
"fd00:fae:fae:fae:fae:200::/96"
];
} }
]; ];
}; };
@ -42,9 +49,13 @@
secretEncryptionKeys = sshPubKeys; secretEncryptionKeys = sshPubKeys;
wireguardDevices = [ wireguardDevices = [
{ # judy {
# judy
publicKey = "I+gN7v1VXkAGoSir6L8aebtLbguvy5nAx1QVDTzdckk="; publicKey = "I+gN7v1VXkAGoSir6L8aebtLbguvy5nAx1QVDTzdckk=";
allowedIPs = [ "10.7.6.202/32" "fd00:fae:fae:fae:fae:202::/96" ]; allowedIPs = [
"10.7.6.202/32"
"fd00:fae:fae:fae:fae:202::/96"
];
} }
]; ];
}; };
@ -56,16 +67,25 @@
secretEncryptionKeys = { secretEncryptionKeys = {
teutat3s-1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHcU6KPy4b1MQXd6EJhcYwbJu7E+0IrBZF/IP6T7gbMf teutat3s@dumpyourvms"; teutat3s-1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHcU6KPy4b1MQXd6EJhcYwbJu7E+0IrBZF/IP6T7gbMf teutat3s@dumpyourvms";
teutat3s-2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAsRdVYK0077cdtavmrRr6akrI68T1EDY4Hfv4+W86J teutat3s@ryzensun";
}; };
wireguardDevices = [ wireguardDevices = [
{ # dumpyourvms {
# dumpyourvms
publicKey = "3UrVLQrwXnPAVXPiTAd7eM3fZYxnFSYgKAGpNMUwnUk="; publicKey = "3UrVLQrwXnPAVXPiTAd7eM3fZYxnFSYgKAGpNMUwnUk=";
allowedIPs = [ "10.7.6.201/32" "fd00:fae:fae:fae:fae:201::/96" ]; allowedIPs = [
"10.7.6.201/32"
"fd00:fae:fae:fae:fae:201::/96"
];
} }
{ # ryzensun {
# ryzensun
publicKey = "oVF2/s7eIxyVjtG0MhKPx5SZ1JllZg+ZFVF2eVYtPGo="; publicKey = "oVF2/s7eIxyVjtG0MhKPx5SZ1JllZg+ZFVF2eVYtPGo=";
allowedIPs = [ "10.7.6.204/32" "fd00:fae:fae:fae:fae:204::/96" ]; allowedIPs = [
"10.7.6.204/32"
"fd00:fae:fae:fae:fae:204::/96"
];
} }
]; ];
}; };

View file

@ -1,13 +1,24 @@
{ lib, ... }: let { lib, ... }:
let
admins = import ./admins.nix; admins = import ./admins.nix;
robots = import ./robots.nix; robots = import ./robots.nix;
in { in
{
flake = { flake = {
logins = { logins = {
admins = lib.lists.foldl (logins: adminConfig: { admins =
sshPubKeys = logins.sshPubKeys ++ (lib.attrsets.attrValues adminConfig.sshPubKeys); lib.lists.foldl
wireguardDevices = logins.wireguardDevices ++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else []); (logins: adminConfig: {
}) { sshPubKeys = []; wireguardDevices = []; } (lib.attrsets.attrValues admins); sshPubKeys = logins.sshPubKeys ++ (lib.attrsets.attrValues adminConfig.sshPubKeys);
wireguardDevices =
logins.wireguardDevices
++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [ ]);
})
{
sshPubKeys = [ ];
wireguardDevices = [ ];
}
(lib.attrsets.attrValues admins);
robots.sshPubKeys = lib.attrsets.attrValues robots; robots.sshPubKeys = lib.attrsets.attrValues robots;
}; };
}; };

266
modules/backups/default.nix Normal file
View file

@ -0,0 +1,266 @@
{
flake,
config,
lib,
pkgs,
...
}: let
utils = import "${flake.inputs.nixpkgs}/nixos/lib/utils.nix" { inherit lib; inherit config; inherit pkgs; };
# Type for a valid systemd unit option. Needed for correctly passing "timerConfig" to "systemd.timers"
inherit (utils.systemdUtils.unitOptions) unitOption;
in {
options.pub-solar-os.backups = {
stores =
with lib;
mkOption {
description = ''
Periodic backups to create with Restic.
'';
type = types.attrsOf (
types.submodule (
{ name, ... }:
{
options = {
passwordFile = mkOption {
type = types.str;
description = ''
Read the repository password from a file.
'';
example = "/etc/nixos/restic-password";
};
repository = mkOption {
type = with types; nullOr str;
default = null;
description = ''
repository to backup to.
'';
example = "sftp:backup@192.168.1.100:/backups/${name}";
};
};
}
)
);
default = { };
example = {
remotebackup = {
repository = "sftp:backup@host:/backups/home";
passwordFile = "/etc/nixos/secrets/restic-password";
};
};
};
backups =
with lib;
mkOption {
description = ''
Periodic backups to create with Restic.
'';
type = types.attrsOf (
types.submodule (
{ name, ... }:
{
options = {
paths = mkOption {
# This is nullable for legacy reasons only. We should consider making it a pure listOf
# after some time has passed since this comment was added.
type = types.nullOr (types.listOf types.str);
default = [ ];
description = ''
Which paths to backup, in addition to ones specified via
`dynamicFilesFrom`. If null or an empty array and
`dynamicFilesFrom` is also null, no backup command will be run.
This can be used to create a prune-only job.
'';
example = [
"/var/lib/postgresql"
"/home/user/backup"
];
};
exclude = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Patterns to exclude when backing up. See
https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files for
details on syntax.
'';
example = [
"/var/cache"
"/home/*/.cache"
".git"
];
};
timerConfig = mkOption {
type = types.nullOr (types.attrsOf unitOption);
default = {
OnCalendar = "daily";
Persistent = true;
};
description = ''
When to run the backup. See {manpage}`systemd.timer(5)` for
details. If null no timer is created and the backup will only
run when explicitly started.
'';
example = {
OnCalendar = "00:05";
RandomizedDelaySec = "5h";
Persistent = true;
};
};
user = mkOption {
type = types.str;
default = "root";
description = ''
As which user the backup should run.
'';
example = "postgresql";
};
extraBackupArgs = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Extra arguments passed to restic backup.
'';
example = [ "--exclude-file=/etc/nixos/restic-ignore" ];
};
extraOptions = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Extra extended options to be passed to the restic --option flag.
'';
example = [ "sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'" ];
};
initialize = mkOption {
type = types.bool;
default = false;
description = ''
Create the repository if it doesn't exist.
'';
};
pruneOpts = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
A list of options (--keep-\* et al.) for 'restic forget
--prune', to automatically prune old snapshots. The
'forget' command is run *after* the 'backup' command, so
keep that in mind when constructing the --keep-\* options.
'';
example = [
"--keep-daily 7"
"--keep-weekly 5"
"--keep-monthly 12"
"--keep-yearly 75"
];
};
runCheck = mkOption {
type = types.bool;
default = (builtins.length config.pub-solar-os.backups.backups.${name}.checkOpts > 0);
defaultText = literalExpression ''builtins.length config.services.backups.${name}.checkOpts > 0'';
description = "Whether to run the `check` command with the provided `checkOpts` options.";
example = true;
};
checkOpts = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
A list of options for 'restic check'.
'';
example = [ "--with-cache" ];
};
dynamicFilesFrom = mkOption {
type = with types; nullOr str;
default = null;
description = ''
A script that produces a list of files to back up. The
results of this command are given to the '--files-from'
option. The result is merged with paths specified via `paths`.
'';
example = "find /home/matt/git -type d -name .git";
};
backupPrepareCommand = mkOption {
type = with types; nullOr str;
default = null;
description = ''
A script that must run before starting the backup process.
'';
};
backupCleanupCommand = mkOption {
type = with types; nullOr str;
default = null;
description = ''
A script that must run after finishing the backup process.
'';
};
package = mkPackageOption pkgs "restic" { };
createWrapper = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Whether to generate and add a script to the system path, that has the same environment variables set
as the systemd service. This can be used to e.g. mount snapshots or perform other opterations, without
having to manually specify most options.
'';
};
};
}
)
);
default = { };
example = {
localbackup = {
paths = [ "/home" ];
exclude = [ "/home/*/.cache" ];
initialize = true;
};
remotebackup = {
paths = [ "/home" ];
extraOptions = [
"sftp.command='ssh backup@host -i /etc/nixos/secrets/backup-private-key -s sftp'"
];
timerConfig = {
OnCalendar = "00:05";
RandomizedDelaySec = "5h";
};
};
};
};
};
config = {
services.restic.backups =
let
stores = config.pub-solar-os.backups.stores;
backups = config.pub-solar-os.backups.backups;
storeNames = builtins.attrNames stores;
backupNames = builtins.attrNames backups;
createBackups =
backupName:
map (storeName: {
name = "${backupName}-${storeName}";
value = stores."${storeName}" // backups."${backupName}";
}) storeNames;
in
builtins.listToAttrs (lib.lists.flatten (map createBackups backupNames));
};
}

22
modules/caddy/default.nix Normal file
View file

@ -0,0 +1,22 @@
{
config,
lib,
pkgs,
flake,
...
}:
{
services.caddy = {
enable = lib.mkForce true;
group = config.pub-solar-os.authentication.robot.username;
email = config.pub-solar-os.adminEmail;
enableReload = true;
globalConfig = lib.mkForce ''
grace_period 60s
'';
};
networking.firewall.allowedTCPPorts = [
80
443
];
}

View file

@ -1,10 +1,12 @@
{ config {
, lib config,
, pkgs lib,
, self pkgs,
, ... self,
}: { ...
services.nginx.virtualHosts."collabora.pub.solar" = { }:
{
services.nginx.virtualHosts."collabora.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -24,16 +26,14 @@
containers."collabora" = { containers."collabora" = {
image = "collabora/code"; image = "collabora/code";
autoStart = true; autoStart = true;
ports = [ ports = [ "127.0.0.1:9980:9980" ];
"127.0.0.1:9980:9980"
];
extraOptions = [ extraOptions = [
"--cap-add=MKNOD" "--cap-add=MKNOD"
"--pull=always" "--pull=always"
]; ];
environment = { environment = {
server_name = "collabora.pub.solar"; server_name = "collabora.${config.pub-solar-os.networking.domain}";
aliasgroup1 = "https://cloud.pub.solar:443"; aliasgroup1 = "https://cloud.${config.pub-solar-os.networking.domain}:443";
DONT_GEN_SSL_CERT = "1"; DONT_GEN_SSL_CERT = "1";
extra_params = "--o:ssl.enable=false --o:ssl.termination=true"; extra_params = "--o:ssl.enable=false --o:ssl.termination=true";
SLEEPFORDEBUGGER = "0"; SLEEPFORDEBUGGER = "0";

62
modules/core/default.nix Normal file
View file

@ -0,0 +1,62 @@
{
pkgs,
config,
flake,
lib,
...
}:
{
imports = [
./nix.nix
./networking.nix
./terminal-tooling.nix
./users.nix
];
options.pub-solar-os =
let
inherit (lib) mkOption types;
in
{
adminEmail = mkOption {
description = "Email address to use for administrative stuff like ACME";
type = types.str;
default = "admins@pub.solar";
};
privacyPolicyUrl = mkOption {
description = "URL of the privacy policy. Used to link there from applications";
type = types.str;
default = "https://pub.solar/privacy";
};
imprintUrl = mkOption {
description = "URL of the imprint. Used to link there from applications";
type = types.str;
default = "https://pub.solar/about";
};
};
config = {
environment = {
# Just a couple of global packages to make our lives easier
systemPackages = with pkgs; [
git
vim
wget
];
};
# Select internationalization properties
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
time.timeZone = "Etc/UTC";
home-manager.users.${config.pub-solar-os.authentication.username} = {
home.stateVersion = "23.05";
};
};
}

View file

@ -0,0 +1,80 @@
{
pkgs,
lib,
config,
...
}:
{
options.pub-solar-os.networking =
let
inherit (lib) mkOption types;
in
{
domain = mkOption {
description = "domain on which all services should run. This defaults to pub.solar";
type = types.str;
default = "pub.solar";
};
defaultInterface = mkOption {
description = "Network interface which should be used as the default internet-connected one";
type = types.nullOr types.str;
};
};
config = {
# Don't expose SSH via public interfaces
networking.firewall.interfaces.wg-ssh.allowedTCPPorts = [ 22 ];
networking.domain = config.pub-solar-os.networking.domain;
networking.hosts = {
"10.7.6.1" = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.2" = [ "flora-6.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.3" = [ "metronom.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.4" = [ "tankstelle.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:1::" = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:2::" = [ "flora-6.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:3::" = [ "metronom.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:4::" = [ "tankstelle.wg.${config.pub-solar-os.networking.domain}" ];
};
services.openssh = {
enable = true;
openFirewall = lib.mkDefault false;
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
# Add back openssh MACs that got removed from defaults
# for backwards compatibility
#
# NixOS default openssh MACs have changed to use "encrypt-then-mac" only.
# This breaks compatibilty with clients that do not offer these MACs. For
# compatibility reasons, we add back the old defaults.
# See: https://github.com/NixOS/nixpkgs/pull/231165
#
# https://blog.stribik.technology/2015/01/04/secure-secure-shell.html
# https://infosec.mozilla.org/guidelines/openssh#modern-openssh-67
Macs = [
"hmac-sha2-512-etm@openssh.com"
"hmac-sha2-256-etm@openssh.com"
"umac-128-etm@openssh.com"
"hmac-sha2-512"
"hmac-sha2-256"
"umac-128@openssh.com"
];
};
};
services.resolved = {
enable = true;
extraConfig = ''
DNS=193.110.81.0#dns0.eu 185.253.5.0#dns0.eu 2a0f:fc80::#dns0.eu 2a0f:fc81::#dns0.eu 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
FallbackDNS=5.1.66.255#dot.ffmuc.net 185.150.99.255#dot.ffmuc.net 2001:678:e68:f000::#dot.ffmuc.net 2001:678:ed0:f000::#dot.ffmuc.net
Domains=~.
DNSOverTLS=yes
'';
};
};
}

View file

@ -1,11 +1,12 @@
{ config {
, pkgs config,
, lib pkgs,
, flake lib,
, ... flake,
}: { ...
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ }:
]; {
nixpkgs.config = lib.mkDefault { allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ ]; };
nix = { nix = {
# Use default version alias for nix package # Use default version alias for nix package
@ -25,7 +26,10 @@
# Prevents impurities in builds # Prevents impurities in builds
sandbox = true; sandbox = true;
# Give root and @wheel special privileges with nix # Give root and @wheel special privileges with nix
trusted-users = [ "root" "@wheel" ]; trusted-users = [
"root"
"@wheel"
];
# Allow only group wheel to connect to the nix daemon # Allow only group wheel to connect to the nix daemon
allowed-users = [ "@wheel" ]; allowed-users = [ "@wheel" ];
}; };
@ -41,7 +45,7 @@
nixPath = [ nixPath = [
"nixpkgs=${flake.inputs.nixpkgs}" "nixpkgs=${flake.inputs.nixpkgs}"
"nixos-config=${../lib/compat/nixos}" "nixos-config=${../../lib/compat/nixos}"
"home-manager=${flake.inputs.home-manager}" "home-manager=${flake.inputs.home-manager}"
]; ];
}; };

View file

@ -1,5 +1,6 @@
{ flake, ... }: { { flake, config, ... }:
home-manager.users.${flake.self.username} = { {
home-manager.users.${config.pub-solar-os.authentication.username} = {
programs.git.enable = true; programs.git.enable = true;
programs.starship.enable = true; programs.starship.enable = true;
programs.bash.enable = true; programs.bash.enable = true;

79
modules/core/users.nix Normal file
View file

@ -0,0 +1,79 @@
{
flake,
pkgs,
lib,
config,
...
}:
{
options.pub-solar-os.authentication =
let
inherit (lib) mkOption types;
in
{
username = mkOption {
description = "Username for the adminstrative user";
type = types.str;
default = flake.self.username;
};
sshPubKeys = mkOption {
description = "SSH Keys that should have administrative root access";
type = types.listOf types.str;
default = flake.self.logins.admins.sshPubKeys;
};
root.initialHashedPassword = mkOption {
description = "Hashed password of the root account";
type = types.str;
default = "$y$j9T$bIN6GjQkmPMllOcQsq52K0$q0Z5B5.KW/uxXK9fItB8H6HO79RYAcI/ZZdB0Djke32";
};
robot.username = mkOption {
description = "username for the robot user";
type = types.str;
default = "hakkonaut";
};
robot.sshPubKeys = mkOption {
description = "SSH Keys to use for the robot user";
type = types.listOf types.str;
default = flake.self.logins.robots.sshPubKeys;
};
};
config = {
users.users.${config.pub-solar-os.authentication.username} = {
name = config.pub-solar-os.authentication.username;
group = config.pub-solar-os.authentication.username;
extraGroups = [
"wheel"
"docker"
];
isNormalUser = true;
openssh.authorizedKeys.keys = config.pub-solar-os.authentication.sshPubKeys;
};
users.groups.${config.pub-solar-os.authentication.username} = { };
# TODO: Remove when we stop locking ourselves out.
users.users.root.openssh.authorizedKeys.keys = config.pub-solar-os.authentication.sshPubKeys;
users.users.${config.pub-solar-os.authentication.robot.username} = {
description = "CI and automation user";
home = "/home/${config.pub-solar-os.authentication.robot.username}";
createHome = true;
useDefaultShell = true;
uid = 998;
group = "${config.pub-solar-os.authentication.robot.username}";
isSystemUser = true;
openssh.authorizedKeys.keys = config.pub-solar-os.authentication.robot.sshPubKeys;
};
users.groups.${config.pub-solar-os.authentication.robot.username} = { };
users.users.root.initialHashedPassword =
config.pub-solar-os.authentication.root.initialHashedPassword;
security.sudo.wheelNeedsPassword = false;
};
}

View file

@ -1,4 +1,9 @@
{ flake, config, lib, ... }: {
flake,
config,
lib,
...
}:
{ {
age.secrets."coturn-static-auth-secret" = { age.secrets."coturn-static-auth-secret" = {
file = "${flake.self}/secrets/coturn-static-auth-secret.age"; file = "${flake.self}/secrets/coturn-static-auth-secret.age";
@ -14,13 +19,17 @@
max-port = 50000; max-port = 50000;
use-auth-secret = true; use-auth-secret = true;
static-auth-secret-file = "/run/agenix/coturn-static-auth-secret"; static-auth-secret-file = "/run/agenix/coturn-static-auth-secret";
realm = "turn.pub.solar"; realm = "turn.${config.pub-solar-os.networking.domain}";
cert = "${config.security.acme.certs.${realm}.directory}/full.pem"; cert = "${config.security.acme.certs.${realm}.directory}/full.pem";
pkey = "${config.security.acme.certs.${realm}.directory}/key.pem"; pkey = "${config.security.acme.certs.${realm}.directory}/key.pem";
extraConfig = extraConfig =
let let
externalIPv4s = lib.strings.concatMapStringsSep "\n" ({ address, ... }: "external-ip=${address}") config.networking.interfaces.enp35s0.ipv4.addresses; externalIPv4s = lib.strings.concatMapStringsSep "\n" (
externalIPv6s = lib.strings.concatMapStringsSep "\n" ({ address, ... }: "external-ip=${address}") config.networking.interfaces.enp35s0.ipv6.addresses; { address, ... }: "external-ip=${address}"
) config.networking.interfaces.enp35s0.ipv4.addresses;
externalIPv6s = lib.strings.concatMapStringsSep "\n" (
{ address, ... }: "external-ip=${address}"
) config.networking.interfaces.enp35s0.ipv6.addresses;
in in
'' ''
${externalIPv4s} ${externalIPv4s}
@ -61,35 +70,42 @@
denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff
''; '';
}; };
networking.firewall = { networking.firewall = {
interfaces.enp35s0 = interfaces.enp35s0 =
let let
range = with config.services.coturn; [{ range = with config.services.coturn; [
from = min-port; {
to = max-port; from = min-port;
}]; to = max-port;
}
];
in in
{ {
allowedUDPPortRanges = range; allowedUDPPortRanges = range;
allowedUDPPorts = [ 3478 5349 ]; allowedUDPPorts = [
3478
5349
];
allowedTCPPortRanges = [ ]; allowedTCPPortRanges = [ ];
allowedTCPPorts = [ 3478 5349 ]; allowedTCPPorts = [
3478
5349
];
}; };
}; };
# get a certificate # get a certificate
security.acme.certs.${config.services.coturn.realm} = { security.acme.certs.${config.services.coturn.realm} = {
/* insert here the right configuration to obtain a certificate */ # insert here the right configuration to obtain a certificate
postRun = "systemctl restart coturn.service"; postRun = "systemctl restart coturn.service";
group = "turnserver"; group = "turnserver";
}; };
services.nginx.virtualHosts.${config.services.coturn.realm} = { services.nginx.virtualHosts.${config.services.coturn.realm} = {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
globalRedirect = "pub.solar"; globalRedirect = "${config.pub-solar-os.networking.domain}";
}; };
users.users.nginx.extraGroups = [ "turnserver" ]; users.users.nginx.extraGroups = [ "turnserver" ];

View file

@ -1,39 +0,0 @@
{ self, ... }:
{
flake = {
nixosModules = rec {
nix = import ./nix.nix;
networking = import ./networking.nix;
unlock-zfs-on-boot = import ./unlock-zfs-on-boot.nix;
docker = import ./docker.nix;
terminal-tooling = import ./terminal-tooling.nix;
users = import ./users.nix;
core = { pkgs, ... }: {
imports = [
nix
networking
terminal-tooling
users
];
environment = {
# Just a couple of global packages to make our lives easier
systemPackages = with pkgs; [ git vim wget ];
};
# Select internationalization properties
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
time.timeZone = "Etc/UTC";
home-manager.users.${self.username} = {
home.stateVersion = "23.05";
};
};
};
};
}

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }:
{
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
extraOptions = '' extraOptions = ''

View file

@ -1,9 +1,11 @@
{ config {
, lib config,
, pkgs lib,
, flake pkgs,
, ... flake,
}: { ...
}:
{
age.secrets.drone-secrets = { age.secrets.drone-secrets = {
file = "${flake.self}/secrets/drone-secrets.age"; file = "${flake.self}/secrets/drone-secrets.age";
mode = "600"; mode = "600";
@ -26,9 +28,16 @@
users.groups.drone = { }; users.groups.drone = { };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [ "d '/var/lib/drone-db' 0750 drone drone - -" ];
"d '/var/lib/drone-db' 0750 drone drone - -"
]; services.caddy.virtualHosts."ci.${config.pub-solar-os.networking.domain}" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
reverse_proxy :4000
'';
};
systemd.services."docker-network-drone" = systemd.services."docker-network-drone" =
let let
@ -57,62 +66,48 @@
image = "postgres:14"; image = "postgres:14";
autoStart = true; autoStart = true;
user = "994"; user = "994";
volumes = [ volumes = [ "/var/lib/drone-db:/var/lib/postgresql/data" ];
"/var/lib/drone-db:/var/lib/postgresql/data" extraOptions = [ "--network=drone-net" ];
]; environmentFiles = [ config.age.secrets.drone-db-secrets.path ];
extraOptions = [
"--network=drone-net"
];
environmentFiles = [
config.age.secrets.drone-db-secrets.path
];
}; };
containers."drone-server" = { containers."drone-server" = {
image = "drone/drone:2"; image = "drone/drone:2";
autoStart = true; autoStart = true;
user = "994"; user = "994";
ports = [ ports = [ "127.0.0.1:4000:80" ];
"127.0.0.1:4000:80"
];
dependsOn = [ "drone-db" ]; dependsOn = [ "drone-db" ];
extraOptions = [ extraOptions = [
"--network=drone-net" "--network=drone-net"
"--pull=always" "--pull=always"
"--add-host=nachtigall.pub.solar:10.7.6.1" "--add-host=nachtigall.${config.pub-solar-os.networking.domain}:10.7.6.1"
]; ];
environment = { environment = {
DRONE_GITEA_SERVER = "https://git.pub.solar"; DRONE_GITEA_SERVER = "https://git.${config.pub-solar-os.networking.domain}";
DRONE_SERVER_HOST = "ci.pub.solar"; DRONE_SERVER_HOST = "ci.${config.pub-solar-os.networking.domain}";
DRONE_SERVER_PROTO = "https"; DRONE_SERVER_PROTO = "https";
DRONE_DATABASE_DRIVER = "postgres"; DRONE_DATABASE_DRIVER = "postgres";
}; };
environmentFiles = [ environmentFiles = [ config.age.secrets.drone-secrets.path ];
config.age.secrets.drone-secrets.path
];
}; };
containers."drone-docker-runner" = { containers."drone-docker-runner" = {
image = "drone/drone-runner-docker:1"; image = "drone/drone-runner-docker:1";
autoStart = true; autoStart = true;
# needs to run as root # needs to run as root
#user = "994"; #user = "994";
volumes = [ volumes = [ "/var/run/docker.sock:/var/run/docker.sock" ];
"/var/run/docker.sock:/var/run/docker.sock"
];
dependsOn = [ "drone-db" ]; dependsOn = [ "drone-db" ];
extraOptions = [ extraOptions = [
"--network=drone-net" "--network=drone-net"
"--pull=always" "--pull=always"
"--add-host=nachtigall.pub.solar:10.7.6.1" "--add-host=nachtigall.${config.pub-solar-os.networking.domain}:10.7.6.1"
]; ];
environment = { environment = {
DRONE_RPC_HOST = "ci.pub.solar"; DRONE_RPC_HOST = "ci.${config.pub-solar-os.networking.domain}";
DRONE_RPC_PROTO = "https"; DRONE_RPC_PROTO = "https";
DRONE_RUNNER_CAPACITY = "2"; DRONE_RUNNER_CAPACITY = "2";
DRONE_RUNNER_NAME = "flora-6-docker-runner"; DRONE_RUNNER_NAME = "flora-6-docker-runner";
}; };
environmentFiles = [ environmentFiles = [ config.age.secrets.drone-secrets.path ];
config.age.secrets.drone-secrets.path
];
}; };
}; };
}; };

View file

@ -1,12 +1,14 @@
{ config {
, lib config,
, pkgs lib,
, flake pkgs,
, ... flake,
}: { ...
}:
{
age.secrets.forgejo-actions-runner-token = { age.secrets.forgejo-actions-runner-token = {
file = "${flake.self}/secrets/forgejo-actions-runner-token.age"; file = "${flake.self}/secrets/forgejo-actions-runner-token.age";
mode = "644"; mode = "440";
}; };
# Trust docker bridge interface traffic # Trust docker bridge interface traffic
@ -20,7 +22,7 @@
isSystemUser = true; isSystemUser = true;
}; };
users.groups.gitea-runner = {}; users.groups.gitea-runner = { };
systemd.services."gitea-runner-flora\\x2d6".serviceConfig = { systemd.services."gitea-runner-flora\\x2d6".serviceConfig = {
DynamicUser = lib.mkForce false; DynamicUser = lib.mkForce false;

View file

@ -1,9 +1,11 @@
{ config {
, lib config,
, pkgs lib,
, flake pkgs,
, ... flake,
}: { ...
}:
{
age.secrets.forgejo-database-password = { age.secrets.forgejo-database-password = {
file = "${flake.self}/secrets/forgejo-database-password.age"; file = "${flake.self}/secrets/forgejo-database-password.age";
mode = "600"; mode = "600";
@ -29,7 +31,7 @@
user = "gitea"; user = "gitea";
}; };
services.nginx.virtualHosts."git.pub.solar" = { services.nginx.virtualHosts."git.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -52,7 +54,7 @@
isSystemUser = true; isSystemUser = true;
}; };
users.groups.gitea = {}; users.groups.gitea = { };
# Expose SSH port only for forgejo SSH # Expose SSH port only for forgejo SSH
networking.firewall.interfaces.enp35s0.allowedTCPPorts = [ 2223 ]; networking.firewall.interfaces.enp35s0.allowedTCPPorts = [ 2223 ];
@ -78,8 +80,8 @@
DEFAULT.APP_NAME = "pub.solar git server"; DEFAULT.APP_NAME = "pub.solar git server";
server = { server = {
ROOT_URL = "https://git.pub.solar"; ROOT_URL = "https://git.${config.pub-solar-os.networking.domain}";
DOMAIN = "git.pub.solar"; DOMAIN = "git.${config.pub-solar-os.networking.domain}";
HTTP_ADDR = "127.0.0.1"; HTTP_ADDR = "127.0.0.1";
HTTP_PORT = 3000; HTTP_PORT = 3000;
START_SSH_SERVER = true; START_SSH_SERVER = true;
@ -92,7 +94,7 @@
mailer = { mailer = {
ENABLED = true; ENABLED = true;
PROTOCOL = "smtps"; PROTOCOL = "smtps";
SMTP_ADDR = "mail.greenbaum.zone"; SMTP_ADDR = "mail.pub.solar";
SMTP_PORT = 465; SMTP_PORT = 465;
FROM = ''"pub.solar git server" <forgejo@pub.solar>''; FROM = ''"pub.solar git server" <forgejo@pub.solar>'';
USER = "admins@pub.solar"; USER = "admins@pub.solar";
@ -123,7 +125,7 @@
# https://forgejo.org/docs/latest/admin/config-cheat-sheet/#webhook-webhook # https://forgejo.org/docs/latest/admin/config-cheat-sheet/#webhook-webhook
webhook = { webhook = {
ALLOWED_HOST_LIST = "loopback,external,*.pub.solar"; ALLOWED_HOST_LIST = "loopback,external,*.${config.pub-solar-os.networking.domain}";
}; };
# See https://forgejo.org/docs/latest/admin/actions/ # See https://forgejo.org/docs/latest/admin/actions/
@ -161,7 +163,7 @@
# gitea gitconfig # gitea gitconfig
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
pinentryFlavor = "curses"; pinentryPackage = pkgs.pinentry-curses;
}; };
# Required to make gpg work without a graphical environment? # Required to make gpg work without a graphical environment?
# otherwise generating a new gpg key fails with this error: # otherwise generating a new gpg key fails with this error:
@ -171,39 +173,13 @@
GPG_TTY = "$(tty)"; GPG_TTY = "$(tty)";
}; };
services.restic.backups.forgejo-droppie = {
paths = [
"/var/lib/forgejo"
"/tmp/forgejo-backup.sql"
];
timerConfig = {
OnCalendar = "*-*-* 02:00:00 Etc/UTC";
# droppie will be offline if nachtigall misses the timer
Persistent = false;
};
initialize = true;
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "sftp:yule@droppie.b12f.io:/media/internal/pub.solar";
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d gitea > /tmp/forgejo-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/forgejo-backup.sql
'';
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
services.restic.backups.forgejo-storagebox = { services.restic.backups.forgejo-storagebox = {
paths = [ paths = [
"/var/lib/forgejo" "/var/lib/forgejo"
"/tmp/forgejo-backup.sql" "/tmp/forgejo-backup.sql"
]; ];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 04:20:00 Etc/UTC"; OnCalendar = "*-*-* 00:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox".path;

View file

@ -1,22 +1,24 @@
{ config {
, lib config,
, pkgs lib,
, flake pkgs,
, ... flake,
}: { ...
}:
{
age.secrets.grafana-admin-password = { age.secrets.grafana-admin-password = {
file = "${flake.self}/secrets/grafana-admin-password.age"; file = "${flake.self}/secrets/grafana-admin-password.age";
mode = "644"; mode = "440";
owner = "grafana"; owner = "grafana";
}; };
age.secrets.grafana-smtp-password = { age.secrets.grafana-smtp-password = {
file = "${flake.self}/secrets/grafana-smtp-password.age"; file = "${flake.self}/secrets/grafana-smtp-password.age";
mode = "644"; mode = "440";
owner = "grafana"; owner = "grafana";
}; };
age.secrets.grafana-keycloak-client-secret = { age.secrets.grafana-keycloak-client-secret = {
file = "${flake.self}/secrets/grafana-keycloak-client-secret.age"; file = "${flake.self}/secrets/grafana-keycloak-client-secret.age";
mode = "644"; mode = "440";
owner = "grafana"; owner = "grafana";
}; };
@ -33,6 +35,15 @@
}; };
}; };
services.caddy.virtualHosts."grafana.${config.pub-solar-os.networking.domain}" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
reverse_proxy :${toString config.services.grafana.settings.server.http_port}
'';
};
services.grafana = { services.grafana = {
enable = true; enable = true;
settings = { settings = {
@ -42,13 +53,13 @@
# and Port # and Port
http_port = 3000; http_port = 3000;
# Grafana needs to know on which domain and URL it's running # Grafana needs to know on which domain and URL it's running
domain = "grafana.pub.solar"; domain = "grafana.${config.pub-solar-os.networking.domain}";
root_url = "https://grafana.pub.solar"; root_url = "https://grafana.${config.pub-solar-os.networking.domain}";
enable_gzip = true; enable_gzip = true;
}; };
smtp = { smtp = {
enabled = true; enabled = true;
host = "mail.greenbaum.zone:465"; host = "mail.pub.solar:465";
user = "admins@pub.solar"; user = "admins@pub.solar";
password = "\$__file{${config.age.secrets.grafana-smtp-password.path}}"; password = "\$__file{${config.age.secrets.grafana-smtp-password.path}}";
from_address = "no-reply@pub.solar"; from_address = "no-reply@pub.solar";
@ -69,9 +80,9 @@
email_attribute_path = "email"; email_attribute_path = "email";
login_attribute_path = "preferred_username"; login_attribute_path = "preferred_username";
name_attribute_path = "full_name"; name_attribute_path = "full_name";
auth_url = "https://auth.pub.solar/realms/pub.solar/protocol/openid-connect/auth"; auth_url = "https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}/protocol/openid-connect/auth";
token_url = "https://auth.pub.solar/realms/pub.solar/protocol/openid-connect/token"; token_url = "https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}/protocol/openid-connect/token";
api_url = "https://auth.pub.solar/realms/pub.solar/protocol/openid-connect/userinfo"; api_url = "https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}/protocol/openid-connect/userinfo";
role_attribute_path = "contains(roles[*], 'admin') && 'GrafanaAdmin' || 'Viewer'"; role_attribute_path = "contains(roles[*], 'admin') && 'GrafanaAdmin' || 'Viewer'";
allow_assign_grafana_admin = true; allow_assign_grafana_admin = true;
}; };

View file

@ -70,9 +70,7 @@
"icon": "external link", "icon": "external link",
"includeVars": true, "includeVars": true,
"keepTime": true, "keepTime": true,
"tags": [ "tags": ["matrix"],
"matrix"
],
"title": "Dashboards", "title": "Dashboards",
"type": "dashboards" "type": "dashboards"
} }
@ -4313,9 +4311,7 @@
"id": "byNames", "id": "byNames",
"options": { "options": {
"mode": "exclude", "mode": "exclude",
"names": [ "names": ["libera.chat "],
"libera.chat "
],
"prefix": "All except:", "prefix": "All except:",
"readOnly": true "readOnly": true
} }
@ -4435,9 +4431,7 @@
"id": "byNames", "id": "byNames",
"options": { "options": {
"mode": "exclude", "mode": "exclude",
"names": [ "names": ["libera.chat"],
"libera.chat"
],
"prefix": "All except:", "prefix": "All except:",
"readOnly": true "readOnly": true
} }
@ -13266,9 +13260,7 @@
"refresh": false, "refresh": false,
"schemaVersion": 37, "schemaVersion": 37,
"style": "dark", "style": "dark",
"tags": [ "tags": ["matrix"],
"matrix"
],
"templating": { "templating": {
"list": [ "list": [
{ {
@ -13453,17 +13445,7 @@
"2h", "2h",
"1d" "1d"
], ],
"time_options": [ "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"]
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
}, },
"timezone": "", "timezone": "",
"title": "Synapse", "title": "Synapse",

View file

@ -0,0 +1,83 @@
{
flake,
config,
lib,
pkgs,
...
}:
{
options.pub-solar-os.auth = with lib; {
enable = mkEnableOption "Enable keycloak to run on the node";
realm = mkOption {
description = "Name of the realm";
type = types.str;
default = config.pub-solar-os.networking.domain;
};
database-password-file = mkOption {
description = "Database password file path";
type = types.str;
};
};
config = lib.mkIf config.pub-solar-os.auth.enable {
services.nginx.virtualHosts."auth.${config.pub-solar-os.networking.domain}" = {
enableACME = true;
forceSSL = true;
locations = {
"= /" = {
extraConfig = ''
return 302 /realms/${config.pub-solar-os.auth.realm}/account;
'';
};
"/" = {
extraConfig = ''
proxy_pass http://127.0.0.1:8080;
proxy_buffer_size 8k;
'';
};
};
};
# keycloak
services.keycloak = {
enable = true;
database.passwordFile = config.pub-solar-os.auth.database-password-file;
settings = {
hostname = "auth.${config.pub-solar-os.networking.domain}";
http-host = "127.0.0.1";
http-port = 8080;
proxy = "edge";
};
themes = {
"pub.solar" =
flake.inputs.keycloak-theme-pub-solar.legacyPackages.${pkgs.system}.keycloak-theme-pub-solar;
};
plugins = [
flake.inputs.keycloak-event-listener.packages.${pkgs.system}.keycloak-event-listener
];
};
pub-solar-os.backups.backups.keycloak = {
paths = [ "/tmp/keycloak-backup.sql" ];
timerConfig = {
OnCalendar = "*-*-* 03:00:00 Etc/UTC";
};
initialize = true;
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d keycloak > /tmp/keycloak-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/keycloak-backup.sql
'';
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
};
}

134
modules/loki/default.nix Normal file
View file

@ -0,0 +1,134 @@
{
config,
lib,
pkgs,
flake,
...
}:
{
# Only expose loki port via wireguard interface
networking.firewall.interfaces.wg-ssh.allowedTCPPorts = [ 3100 ];
# source: https://gist.github.com/rickhull/895b0cb38fdd537c1078a858cf15d63e
# https://grafana.com/docs/loki/latest/configure/examples/#1-local-configuration-exampleyaml
services.loki = {
enable = true;
configuration = {
server.http_listen_port = 3100;
auth_enabled = false;
common = {
ring = {
instance_interface_names = [ "wg-ssh" ];
instance_enable_ipv6 = true;
kvstore = {
store = "inmemory";
};
};
replication_factor = 1;
path_prefix = "/data/loki";
storage = {
filesystem = {
chunks_directory = "chunks/";
rules_directory = "rules/";
};
};
};
ingester = {
chunk_encoding = "snappy";
chunk_idle_period = "1h";
};
query_range = {
results_cache = {
cache = {
embedded_cache = {
enabled = true;
max_size_mb = 500;
};
};
};
};
chunk_store_config = {
chunk_cache_config = {
embedded_cache = {
enabled = true;
max_size_mb = 500;
ttl = "24h";
};
};
};
# Keep logs for 4 weeks
# https://grafana.com/docs/loki/latest/operations/storage/retention/
limits_config = {
retention_period = "4w";
split_queries_by_interval = "0";
};
compactor = {
compaction_interval = "10m";
delete_request_store = "filesystem";
retention_enabled = true;
retention_delete_delay = "2h";
retention_delete_worker_count = 150;
};
schema_config = {
configs = [
{
from = "2020-05-15";
store = "boltdb-shipper";
object_store = "filesystem";
schema = "v11";
index = {
prefix = "index_";
period = "24h";
};
}
{
from = "2024-05-31";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index = {
prefix = "index_";
period = "24h";
};
}
];
};
};
};
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_port = 9080;
grpc_listen_port = 0;
};
positions = {
filename = "/tmp/positions.yaml";
};
clients = [
{
url = "http://flora-6.wg.pub.solar:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
}
];
scrape_configs = [
{
job_name = "journal";
journal = {
max_age = "24h";
labels = {
job = "systemd-journal";
host = "flora-6";
};
};
relabel_configs = [
{
source_labels = [ "__journal__systemd_unit" ];
target_label = "unit";
}
];
}
];
};
};
}

70
modules/mail/default.nix Normal file
View file

@ -0,0 +1,70 @@
{ config, flake, ... }:
{
age.secrets.mail-hensoko.file = "${flake.self}/secrets/mail/hensoko.age";
age.secrets.mail-teutat3s.file = "${flake.self}/secrets/mail/teutat3s.age";
age.secrets.mail-admins.file = "${flake.self}/secrets/mail/admins.age";
age.secrets.mail-bot.file = "${flake.self}/secrets/mail/bot.age";
age.secrets.mail-crew.file = "${flake.self}/secrets/mail/crew.age";
age.secrets.mail-erpnext.file = "${flake.self}/secrets/mail/erpnext.age";
age.secrets.mail-hakkonaut.file = "${flake.self}/secrets/mail/hakkonaut.age";
mailserver = {
enable = true;
fqdn = "mail.pub.solar";
domains = [ "pub.solar" ];
# A list of all login accounts. To create the password hashes, use
# nix-shell -p mkpasswd --run 'mkpasswd -R11 -m bcrypt'
loginAccounts = {
"hensoko@pub.solar" = {
hashedPasswordFile = config.age.secrets.mail-hensoko.path;
quota = "2G";
};
"teutat3s@pub.solar" = {
hashedPasswordFile = config.age.secrets.mail-teutat3s.path;
quota = "2G";
};
"admins@pub.solar" = {
hashedPasswordFile = config.age.secrets.mail-admins.path;
quota = "2G";
aliases = [
"abuse@pub.solar"
"alerts@pub.solar"
"forgejo@pub.solar"
"keycloak@pub.solar"
"mastodon-notifications@pub.solar"
"matrix@pub.solar"
"postmaster@pub.solar"
"nextcloud@pub.solar"
"no-reply@pub.solar"
"security@pub.solar"
];
};
"bot@pub.solar" = {
hashedPasswordFile = config.age.secrets.mail-bot.path;
quota = "2G";
aliases = [ "hackernews-bot@pub.solar" ];
};
"crew@pub.solar" = {
hashedPasswordFile = config.age.secrets.mail-crew.path;
quota = "2G";
aliases = [ "moderation@pub.solar" ];
};
"erpnext@pub.solar" = {
hashedPasswordFile = config.age.secrets.mail-erpnext.path;
quota = "2G";
};
"hakkonaut@pub.solar" = {
hashedPasswordFile = config.age.secrets.mail-hakkonaut.path;
quota = "2G";
};
};
# Use Let's Encrypt certificates. Note that this needs to set up a stripped
# down nginx and opens port 80.
certificateScheme = "acme-nginx";
};
security.acme.acceptTerms = true;
security.acme.defaults.email = "security@pub.solar";
}

View file

@ -1,15 +1,16 @@
{ flake {
, config flake,
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
{ {
networking.firewall.allowedTCPPorts = [ 25 ]; networking.firewall.allowedTCPPorts = [ 25 ];
users.users.nginx.extraGroups = [ "mailman" ]; users.users.nginx.extraGroups = [ "mailman" ];
services.nginx.virtualHosts."list.pub.solar" = { services.nginx.virtualHosts."list.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
}; };
@ -24,15 +25,15 @@
enable = true; enable = true;
relayDomains = [ "hash:/var/lib/mailman/data/postfix_domains" ]; relayDomains = [ "hash:/var/lib/mailman/data/postfix_domains" ];
# get TLS certs for list.pub.solar from acme # get TLS certs for list.pub.solar from acme
sslCert = "/var/lib/acme/list.pub.solar/fullchain.pem"; sslCert = "/var/lib/acme/list.${config.pub-solar-os.networking.domain}/fullchain.pem";
sslKey = "/var/lib/acme/list.pub.solar/key.pem"; sslKey = "/var/lib/acme/list.${config.pub-solar-os.networking.domain}/key.pem";
config = { config = {
transport_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; transport_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ];
local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ];
}; };
rootAlias = "admins@pub.solar"; rootAlias = "admins@pub.solar";
postmasterAlias = "admins@pub.solar"; postmasterAlias = "admins@pub.solar";
hostname = "list.pub.solar"; hostname = "list.${config.pub-solar-os.networking.domain}";
}; };
systemd.paths.watcher-acme-ssl-file = { systemd.paths.watcher-acme-ssl-file = {
@ -40,7 +41,7 @@
documentation = [ "systemd.path(5)" ]; documentation = [ "systemd.path(5)" ];
partOf = [ "postfix-reload.service" ]; partOf = [ "postfix-reload.service" ];
pathConfig = { pathConfig = {
PathChanged = "/var/lib/acme/list.pub.solar/fullchain.pem"; PathChanged = "/var/lib/acme/list.${config.pub-solar-os.networking.domain}/fullchain.pem";
Unit = "postfix-reload.service"; Unit = "postfix-reload.service";
}; };
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
@ -64,7 +65,7 @@
enable = true; enable = true;
serve.enable = true; serve.enable = true;
hyperkitty.enable = true; hyperkitty.enable = true;
webHosts = [ "list.pub.solar" ]; webHosts = [ "list.${config.pub-solar-os.networking.domain}" ];
siteOwner = "admins@pub.solar"; siteOwner = "admins@pub.solar";
}; };
@ -79,28 +80,6 @@
# ]) # ])
#''; #'';
services.restic.backups.mailman-droppie = {
paths = [
"/var/lib/mailman"
"/var/lib/mailman-web/mailman-web.db"
"/var/lib/mailman-web/settings_local.json"
"/var/lib/postfix/conf/aliases.db"
];
timerConfig = {
OnCalendar = "*-*-* 02:00:00 Etc/UTC";
# droppie will be offline if nachtigall misses the timer
Persistent = false;
};
initialize = true;
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "sftp:yule@droppie.b12f.io:/media/internal/pub.solar";
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
services.restic.backups.mailman-storagebox = { services.restic.backups.mailman-storagebox = {
paths = [ paths = [
"/var/lib/mailman" "/var/lib/mailman"
@ -109,7 +88,7 @@
"/var/lib/postfix/conf/aliases.db" "/var/lib/postfix/conf/aliases.db"
]; ];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 04:15:00 Etc/UTC"; OnCalendar = "*-*-* 02:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox".path;

View file

@ -1,4 +1,10 @@
{ config, pkgs, flake, inputs, ... }: {
config,
pkgs,
flake,
inputs,
...
}:
{ {
age.secrets."mastodon-secret-key-base" = { age.secrets."mastodon-secret-key-base" = {
@ -38,7 +44,7 @@
services.mastodon = { services.mastodon = {
enable = true; enable = true;
# Different from WEB_DOMAIN in our case # Different from WEB_DOMAIN in our case
localDomain = "pub.solar"; localDomain = "${config.pub-solar-os.networking.domain}";
enableUnixSocket = true; enableUnixSocket = true;
# Number of processes used by the mastodon-streaming service # Number of processes used by the mastodon-streaming service
# Recommended is the amount of your CPU cores minus one # Recommended is the amount of your CPU cores minus one
@ -54,7 +60,7 @@
vapidPublicKeyFile = "/run/agenix/mastodon-vapid-public-key"; vapidPublicKeyFile = "/run/agenix/mastodon-vapid-public-key";
smtp = { smtp = {
createLocally = false; createLocally = false;
host = "mail.greenbaum.zone"; host = "mail.pub.solar";
port = 587; port = 587;
authenticate = true; authenticate = true;
user = "admins@pub.solar"; user = "admins@pub.solar";
@ -64,11 +70,9 @@
mediaAutoRemove = { mediaAutoRemove = {
olderThanDays = 7; olderThanDays = 7;
}; };
extraEnvFiles = [ extraEnvFiles = [ "/run/agenix/mastodon-extra-env-secrets" ];
"/run/agenix/mastodon-extra-env-secrets"
];
extraConfig = { extraConfig = {
WEB_DOMAIN = "mastodon.pub.solar"; WEB_DOMAIN = "mastodon.${config.pub-solar-os.networking.domain}";
# Defined in ./opensearch.nix # Defined in ./opensearch.nix
ES_HOST = "127.0.0.1"; ES_HOST = "127.0.0.1";
# S3 File storage (optional) # S3 File storage (optional)
@ -77,7 +81,7 @@
S3_BUCKET = "pub-solar-mastodon"; S3_BUCKET = "pub-solar-mastodon";
S3_REGION = "europe-west-1"; S3_REGION = "europe-west-1";
S3_ENDPOINT = "https://gateway.tardigradeshare.io"; S3_ENDPOINT = "https://gateway.tardigradeshare.io";
S3_ALIAS_HOST = "files.pub.solar"; S3_ALIAS_HOST = "files.${config.pub-solar-os.networking.domain}";
# Translation (optional) # Translation (optional)
# ----------------------- # -----------------------
DEEPL_PLAN = "free"; DEEPL_PLAN = "free";
@ -85,48 +89,21 @@
# -------------- # --------------
OIDC_ENABLED = "true"; OIDC_ENABLED = "true";
OIDC_DISPLAY_NAME = "pub.solar ID"; OIDC_DISPLAY_NAME = "pub.solar ID";
OIDC_ISSUER = "https://auth.pub.solar/realms/pub.solar"; OIDC_ISSUER = "https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}";
OIDC_DISCOVERY = "true"; OIDC_DISCOVERY = "true";
OIDC_SCOPE = "openid,profile,email"; OIDC_SCOPE = "openid,profile,email";
OIDC_UID_FIELD = "preferred_username"; OIDC_UID_FIELD = "preferred_username";
OIDC_REDIRECT_URI = "https://mastodon.pub.solar/auth/auth/openid_connect/callback"; OIDC_REDIRECT_URI = "https://mastodon.${config.pub-solar-os.networking.domain}/auth/auth/openid_connect/callback";
OIDC_SECURITY_ASSUME_EMAIL_IS_VERIFIED = "true"; OIDC_SECURITY_ASSUME_EMAIL_IS_VERIFIED = "true";
# only use OIDC for login / registration # only use OIDC for login / registration
OMNIAUTH_ONLY = "true"; OMNIAUTH_ONLY = "true";
}; };
}; };
services.restic.backups.mastodon-droppie = {
paths = [
"/tmp/mastodon-backup.sql"
];
timerConfig = {
OnCalendar = "*-*-* 02:00:00 Etc/UTC";
# droppie will be offline if nachtigall misses the timer
Persistent = false;
};
initialize = true;
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "sftp:yule@droppie.b12f.io:/media/internal/pub.solar";
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d mastodon > /tmp/mastodon-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/mastodon-backup.sql
'';
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
services.restic.backups.mastodon-storagebox = { services.restic.backups.mastodon-storagebox = {
paths = [ paths = [ "/tmp/mastodon-backup.sql" ];
"/tmp/mastodon-backup.sql"
];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 04:05:00 Etc/UTC"; OnCalendar = "*-*-* 04:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox".path;

View file

@ -1,18 +1,26 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
# Find element in list config.services.matrix-synapse.settings.listeners.*.resources # Find element in list config.services.matrix-synapse.settings.listeners.*.resources
# that sets names = "client" # that sets names = "client"
nameHasClient = name: name == "client"; nameHasClient = name: name == "client";
resourceHasClient = resource: builtins.any nameHasClient resource.names; resourceHasClient = resource: builtins.any nameHasClient resource.names;
listenerWithClient = lib.findFirst listenerWithClient =
(listener: lib.findFirst (listener: builtins.any resourceHasClient listener.resources)
builtins.any resourceHasClient listener.resources) (throw "Found no matrix-synapse.settings.listeners.*.resources.*.names containing string client")
(throw "Found no matrix-synapse.settings.listeners.*.resources.*.names containing string client") config.services.matrix-synapse.settings.listeners;
config.services.matrix-synapse.settings.listeners
;
synapseClientPort = "${toString listenerWithClient.port}"; synapseClientPort = "${toString listenerWithClient.port}";
in in
{ {
systemd.services.matrix-appservice-irc.serviceConfig.SystemCallFilter = lib.mkForce [
"@system-service @pkey"
"~@privileged @resources"
"@chown"
];
services.matrix-appservice-irc = { services.matrix-appservice-irc = {
enable = true; enable = true;
localpart = "irc_bot"; localpart = "irc_bot";
@ -20,9 +28,9 @@ in
registrationUrl = "http://localhost:8010"; registrationUrl = "http://localhost:8010";
settings = { settings = {
homeserver = { homeserver = {
domain = "pub.solar"; domain = "${config.pub-solar-os.networking.domain}";
url = "http://127.0.0.1:${synapseClientPort}"; url = "http://127.0.0.1:${synapseClientPort}";
media_url = "https://matrix.pub.solar"; media_url = "https://matrix.${config.pub-solar-os.networking.domain}";
enablePresence = false; enablePresence = false;
}; };
ircService = { ircService = {
@ -41,7 +49,11 @@ in
}; };
metrics = { metrics = {
enabled = true; enabled = true;
remoteUserAgeBuckets = [ "1h" "1d" "1w" ]; remoteUserAgeBuckets = [
"1h"
"1d"
"1w"
];
}; };
provisioning = { provisioning = {
enabled = false; enabled = false;
@ -117,4 +129,3 @@ in
}; };
}; };
} }

View file

@ -1,4 +1,10 @@
{ flake, lib, config, pkgs, ... }: {
flake,
lib,
config,
pkgs,
...
}:
{ {
age.secrets."matrix-mautrix-telegram-env-file" = { age.secrets."matrix-mautrix-telegram-env-file" = {
file = "${flake.self}/secrets/matrix-mautrix-telegram-env-file.age"; file = "${flake.self}/secrets/matrix-mautrix-telegram-env-file.age";
@ -13,7 +19,7 @@
homeserver = { homeserver = {
# TODO: Use the port from synapse config # TODO: Use the port from synapse config
address = "http://127.0.0.1:8008"; address = "http://127.0.0.1:8008";
domain = "pub.solar"; domain = "${config.pub-solar-os.networking.domain}";
verify_ssl = true; verify_ssl = true;
}; };
appservice = { appservice = {
@ -34,7 +40,7 @@
}; };
public = { public = {
enabled = true; enabled = true;
external = "https://matrix.pub.solar/c3c3f34b-29fb-5feb-86e5-98c75ec8214b"; external = "https://matrix.${config.pub-solar-os.networking.domain}/c3c3f34b-29fb-5feb-86e5-98c75ec8214b";
prefix = "/c3c3f34b-29fb-5feb-86e5-98c75ec8214b"; prefix = "/c3c3f34b-29fb-5feb-86e5-98c75ec8214b";
}; };
}; };
@ -140,7 +146,7 @@
username_template = "telegram_{userid}"; username_template = "telegram_{userid}";
permissions = { permissions = {
"pub.solar" = "full"; "${config.pub-solar-os.networking.domain}" = "full";
}; };
}; };

View file

@ -1,7 +1,12 @@
{ flake, config, pkgs, ... }: {
flake,
config,
pkgs,
...
}:
let let
publicDomain = "matrix.pub.solar"; publicDomain = "matrix.${config.pub-solar-os.networking.domain}";
serverDomain = "pub.solar"; serverDomain = "${config.pub-solar-os.networking.domain}";
in in
{ {
age.secrets."matrix-synapse-signing-key" = { age.secrets."matrix-synapse-signing-key" = {
@ -40,22 +45,16 @@ in
}; };
listeners = [ listeners = [
{ {
bind_addresses = [ bind_addresses = [ "127.0.0.1" ];
"127.0.0.1"
];
port = 8008; port = 8008;
resources = [ resources = [
{ {
compress = true; compress = true;
names = [ names = [ "client" ];
"client"
];
} }
{ {
compress = false; compress = false;
names = [ names = [ "federation" ];
"federation"
];
} }
]; ];
tls = false; tls = false;
@ -63,29 +62,23 @@ in
x_forwarded = true; x_forwarded = true;
} }
{ {
bind_addresses = [ bind_addresses = [ "127.0.0.1" ];
"127.0.0.1"
];
port = 8012; port = 8012;
resources = [ resources = [ { names = [ "metrics" ]; } ];
{
names = [
"metrics"
];
}
];
tls = false; tls = false;
type = "metrics"; type = "metrics";
} }
]; ];
account_threepid_delegates.msisdn = ""; account_threepid_delegates.msisdn = "";
alias_creation_rules = [{ alias_creation_rules = [
action = "allow"; {
alias = "*"; action = "allow";
room_id = "*"; alias = "*";
user_id = "*"; room_id = "*";
}]; user_id = "*";
}
];
allow_guest_access = false; allow_guest_access = false;
allow_public_rooms_over_federation = true; allow_public_rooms_over_federation = true;
allow_public_rooms_without_auth = false; allow_public_rooms_without_auth = false;
@ -115,8 +108,6 @@ in
instance_map = { }; instance_map = { };
limit_profile_requests_to_users_who_share_rooms = false; limit_profile_requests_to_users_who_share_rooms = false;
log_config = ./matrix-log-config.yaml;
max_spider_size = "10M"; max_spider_size = "10M";
max_upload_size = "50M"; max_upload_size = "50M";
media_storage_providers = [ ]; media_storage_providers = [ ];
@ -152,7 +143,7 @@ in
}; };
per_user = { per_user = {
burst_count = 5; burst_count = 5;
per_second = 0.003; per_second = 3.0e-3;
}; };
}; };
rc_joins = { rc_joins = {
@ -162,7 +153,7 @@ in
}; };
remote = { remote = {
burst_count = 10; burst_count = 10;
per_second = 0.01; per_second = 1.0e-2;
}; };
}; };
rc_login = { rc_login = {
@ -194,17 +185,19 @@ in
registrations_require_3pid = [ "email" ]; registrations_require_3pid = [ "email" ];
report_stats = false; report_stats = false;
require_auth_for_profile_requests = false; require_auth_for_profile_requests = false;
room_list_publication_rules = [{ room_list_publication_rules = [
action = "allow"; {
alias = "*"; action = "allow";
room_id = "*"; alias = "*";
user_id = "*"; room_id = "*";
}]; user_id = "*";
}
];
signing_key_path = "/run/agenix/matrix-synapse-signing-key"; signing_key_path = "/run/agenix/matrix-synapse-signing-key";
stream_writers = { }; stream_writers = { };
trusted_key_servers = [{ server_name = "matrix.org"; }]; trusted_key_servers = [ { server_name = "matrix.org"; } ];
suppress_key_server_warning = true; suppress_key_server_warning = true;
turn_allow_guests = false; turn_allow_guests = false;
@ -276,21 +269,19 @@ in
"redis" "redis"
]; ];
plugins = [ plugins = [ config.services.matrix-synapse.package.plugins.matrix-synapse-shared-secret-auth ];
config.services.matrix-synapse.package.plugins.matrix-synapse-shared-secret-auth };
];
sliding-sync = { services.matrix-sliding-sync = {
enable = true; enable = true;
settings = { settings = {
SYNCV3_SERVER = "https://${publicDomain}"; SYNCV3_SERVER = "https://${publicDomain}";
SYNCV3_BINDADDR = "127.0.0.1:8011"; SYNCV3_BINDADDR = "127.0.0.1:8011";
# The bind addr for Prometheus metrics, which will be accessible at # The bind addr for Prometheus metrics, which will be accessible at
# /metrics at this address # /metrics at this address
SYNCV3_PROM = "127.0.0.1:9100"; SYNCV3_PROM = "127.0.0.1:9100";
};
environmentFile = config.age.secrets."matrix-synapse-sliding-sync-secret".path;
}; };
environmentFile = config.age.secrets."matrix-synapse-sliding-sync-secret".path;
}; };
services.restic.backups.matrix-synapse-storagebox = { services.restic.backups.matrix-synapse-storagebox = {

View file

@ -1,8 +1,9 @@
{ flake {
, config flake,
, lib config,
, pkgs lib,
, ... pkgs,
...
}: }:
let let
localSettingsPHP = pkgs.writeScript "LocalSettings.php" '' localSettingsPHP = pkgs.writeScript "LocalSettings.php" ''
@ -26,14 +27,14 @@ let
## For more information on customizing the URLs ## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see: ## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL ## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "https://wiki.pub.solar"; $wgScriptPath = "https://wiki.${config.pub-solar-os.networking.domain}";
## https://www.mediawiki.org/wiki/Manual:Short_URL ## https://www.mediawiki.org/wiki/Manual:Short_URL
## https://www.mediawiki.org/wiki/Extension:OpenID_Connect#Known_issues ## https://www.mediawiki.org/wiki/Extension:OpenID_Connect#Known_issues
$wgArticlePath = "/index.php/$1"; $wgArticlePath = "/index.php/$1";
## The protocol and server name to use in fully-qualified URLs ## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://wiki.pub.solar"; $wgServer = "https://wiki.${config.pub-solar-os.networking.domain}";
## The URL path to static resources (images, scripts, etc.) ## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath; $wgResourceBasePath = $wgScriptPath;
@ -143,7 +144,7 @@ let
$wgPluggableAuth_Config[] = [ $wgPluggableAuth_Config[] = [
'plugin' => 'OpenIDConnect', 'plugin' => 'OpenIDConnect',
'data' => [ 'data' => [
'providerURL' => 'https://auth.pub.solar/realms/pub.solar', 'providerURL' => 'https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}',
'clientID' => 'mediawiki', 'clientID' => 'mediawiki',
'clientsecret' => trim(file_get_contents('/run/mediawiki/oidc-client-secret')) 'clientsecret' => trim(file_get_contents('/run/mediawiki/oidc-client-secret'))
] ]
@ -189,7 +190,7 @@ in
''; '';
}; };
services.nginx.virtualHosts."wiki.pub.solar" = { services.nginx.virtualHosts."wiki.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -201,20 +202,20 @@ in
group = "mediawiki"; group = "mediawiki";
inherit uid; inherit uid;
}; };
users.groups.mediawiki = { inherit gid; }; users.groups.mediawiki = {
inherit gid;
};
virtualisation = { virtualisation = {
oci-containers = { oci-containers = {
backend = "docker"; backend = "docker";
containers."mediawiki" = { containers."mediawiki" = {
image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:1.41.1"; image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:1.42.1";
user = "1000:${builtins.toString gid}"; user = "1000:${builtins.toString gid}";
autoStart = true; autoStart = true;
ports = [ ports = [ "127.0.0.1:8293:80" ];
"127.0.0.1:8293:80"
];
extraOptions = [ extraOptions = [
"--add-host=host.docker.internal:host-gateway" "--add-host=host.docker.internal:host-gateway"

View file

@ -1,46 +0,0 @@
{ pkgs, lib, ... }: {
# Don't expose SSH via public interfaces
networking.firewall.interfaces.wg-ssh.allowedTCPPorts = [ 22 ];
networking.hosts = {
"10.7.6.1" = ["nachtigall.pub.solar"];
"10.7.6.2" = ["flora-6.pub.solar"];
};
services.openssh = {
enable = true;
openFirewall = lib.mkDefault false;
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
# Add back openssh MACs that got removed from defaults
# for backwards compatibility
#
# NixOS default openssh MACs have changed to use "encrypt-then-mac" only.
# This breaks compatibilty with clients that do not offer these MACs. For
# compatibility reasons, we add back the old defaults.
# See: https://github.com/NixOS/nixpkgs/pull/231165
#
# https://blog.stribik.technology/2015/01/04/secure-secure-shell.html
# https://infosec.mozilla.org/guidelines/openssh#modern-openssh-67
Macs = [
"hmac-sha2-512-etm@openssh.com"
"hmac-sha2-256-etm@openssh.com"
"umac-128-etm@openssh.com"
"hmac-sha2-512"
"hmac-sha2-256"
"umac-128@openssh.com"
];
};
};
services.resolved = {
enable = true;
extraConfig = ''
DNS=193.110.81.0#dns0.eu 185.253.5.0#dns0.eu 2a0f:fc80::#dns0.eu 2a0f:fc81::#dns0.eu 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
FallbackDNS=5.1.66.255#dot.ffmuc.net 185.150.99.255#dot.ffmuc.net 2001:678:e68:f000::#dot.ffmuc.net 2001:678:ed0:f000::#dot.ffmuc.net
Domains=~.
DNSOverTLS=yes
'';
};
}

View file

@ -1,7 +1,8 @@
{ config {
, pkgs config,
, flake pkgs,
, ... flake,
...
}: }:
{ {
age.secrets."nextcloud-secrets" = { age.secrets."nextcloud-secrets" = {
@ -16,21 +17,20 @@
owner = "nextcloud"; owner = "nextcloud";
}; };
services.nginx.virtualHosts."cloud.pub.solar" = { services.nginx.virtualHosts."cloud.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
}; };
services.nextcloud = { services.nextcloud = {
hostName = "cloud.pub.solar"; hostName = "cloud.${config.pub-solar-os.networking.domain}";
home = "/var/lib/nextcloud"; home = "/var/lib/nextcloud";
enable = true; enable = true;
package = pkgs.nextcloud28; package = pkgs.nextcloud29;
https = true; https = true;
secretFile = config.age.secrets."nextcloud-secrets".path; # secret secretFile = config.age.secrets."nextcloud-secrets".path; # secret
maxUploadSize = "1G"; maxUploadSize = "1G";
skeletonDirectory = "./nextcloud-skeleton";
configureRedis = true; configureRedis = true;
@ -46,11 +46,11 @@
dbtype = "pgsql"; dbtype = "pgsql";
dbname = "nextcloud"; dbname = "nextcloud";
dbtableprefix = "oc_"; dbtableprefix = "oc_";
overwriteProtocol = "https";
}; };
extraOptions = { settings = {
overwrite.cli.url = "http://cloud.pub.solar"; overwrite.cli.url = "http://cloud.${config.pub-solar-os.networking.domain}";
overwriteprotocol = "https";
installed = true; installed = true;
default_phone_region = "+49"; default_phone_region = "+49";
@ -60,10 +60,10 @@
mail_smtpauthtype = "PLAIN"; mail_smtpauthtype = "PLAIN";
mail_domain = "pub.solar"; mail_domain = "pub.solar";
mail_smtpname = "admins@pub.solar"; mail_smtpname = "admins@pub.solar";
mail_smtpsecure = "tls"; mail_smtpsecure = "ssl";
mail_smtpauth = 1; mail_smtpauth = true;
mail_smtphost = "mail.greenbaum.zone"; mail_smtphost = "mail.pub.solar";
mail_smtpport = "587"; mail_smtpport = "465";
# This is to allow connections to collabora and keycloak, among other services # This is to allow connections to collabora and keycloak, among other services
# running on the same host # running on the same host
@ -91,12 +91,13 @@
auth.bruteforce.protection.enabled = true; auth.bruteforce.protection.enabled = true;
trashbin_retention_obligation = "auto,7"; trashbin_retention_obligation = "auto,7";
skeletondirectory = ""; skeletondirectory = "./nextcloud-skeleton";
defaultapp = "file"; defaultapp = "file";
activity_expire_days = "14"; activity_expire_days = "14";
integrity.check.disabled = false; integrity.check.disabled = false;
updater.release.channel = "stable"; updater.release.channel = "stable";
loglevel = 0; loglevel = 2;
debug = false;
maintenance_window_start = "1"; maintenance_window_start = "1";
# maintenance = false; # maintenance = false;
app_install_overwrite = [ app_install_overwrite = [
@ -110,6 +111,10 @@
phpOptions = { phpOptions = {
"opcache.interned_strings_buffer" = "32"; "opcache.interned_strings_buffer" = "32";
"opcache.max_accelerated_files" = "16229";
"opcache.memory_consumption" = "256";
# https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
"opcache.revalidate_freq" = "60";
# https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#:~:text=opcache.jit%20%3D%201255%20opcache.jit_buffer_size%20%3D%20128m # https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#:~:text=opcache.jit%20%3D%201255%20opcache.jit_buffer_size%20%3D%20128m
"opcache.jit" = "1255"; "opcache.jit" = "1255";
"opcache.jit_buffer_size" = "128M"; "opcache.jit_buffer_size" = "128M";
@ -131,39 +136,13 @@
database.createLocally = true; database.createLocally = true;
}; };
services.restic.backups.nextcloud-droppie = {
paths = [
"/var/lib/nextcloud/data"
"/tmp/nextcloud-backup.sql"
];
timerConfig = {
OnCalendar = "*-*-* 02:00:00 Etc/UTC";
# droppie will be offline if nachtigall misses the timer
Persistent = false;
};
initialize = true;
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "sftp:yule@droppie.b12f.io:/media/internal/pub.solar";
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d nextcloud > /tmp/nextcloud-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/nextcloud-backup.sql
'';
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
services.restic.backups.nextcloud-storagebox = { services.restic.backups.nextcloud-storagebox = {
paths = [ paths = [
"/var/lib/nextcloud/data" "/var/lib/nextcloud/data"
"/tmp/nextcloud-backup.sql" "/tmp/nextcloud-backup.sql"
]; ];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 04:00:00 Etc/UTC"; OnCalendar = "*-*-* 01:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox".path;

View file

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View file

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View file

@ -1,4 +1,4 @@
{ ... }: { config, ... }:
let let
objStorHost = "link.tardigradeshare.io"; objStorHost = "link.tardigradeshare.io";
@ -6,7 +6,7 @@ let
in in
{ {
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"files.pub.solar" = { "files.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;

View file

@ -5,7 +5,7 @@ in
{ {
services.nginx = { services.nginx = {
virtualHosts = { virtualHosts = {
"mastodon.pub.solar" = { "mastodon.${config.pub-solar-os.networking.domain}" = {
root = "${cfg.package}/public/"; root = "${cfg.package}/public/";
# mastodon only supports https, but you can override this if you offload tls elsewhere. # mastodon only supports https, but you can override this if you offload tls elsewhere.
forceSSL = lib.mkDefault true; forceSSL = lib.mkDefault true;
@ -16,11 +16,11 @@ in
''; '';
locations."/auth/confirmation/new".extraConfig = '' locations."/auth/confirmation/new".extraConfig = ''
return 302 https://auth.pub.solar/realms/pub.solar/login-actions/reset-credentials?client_id=mastodon; return 302 https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}/login-actions/reset-credentials?client_id=mastodon;
''; '';
locations."/auth/password/new".extraConfig = '' locations."/auth/password/new".extraConfig = ''
return 302 https://auth.pub.solar/realms/pub.solar/login-actions/reset-credentials?client_id=mastodon; return 302 https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}/login-actions/reset-credentials?client_id=mastodon;
''; '';
locations."/system/".alias = "/var/lib/mastodon/public-system/"; locations."/system/".alias = "/var/lib/mastodon/public-system/";
@ -30,7 +30,12 @@ in
}; };
locations."@proxy" = { locations."@proxy" = {
proxyPass = (if cfg.enableUnixSocket then "http://unix:/run/mastodon-web/web.socket" else "http://127.0.0.1:${toString(cfg.webPort)}"); proxyPass = (
if cfg.enableUnixSocket then
"http://unix:/run/mastodon-web/web.socket"
else
"http://127.0.0.1:${toString (cfg.webPort)}"
);
proxyWebsockets = true; proxyWebsockets = true;
}; };
@ -45,13 +50,12 @@ in
extraConfig = '' extraConfig = ''
least_conn; least_conn;
''; '';
servers = builtins.listToAttrs servers = builtins.listToAttrs (
(map map (i: {
(i: { name = "unix:/run/mastodon-streaming/streaming-${toString i}.socket";
name = "unix:/run/mastodon-streaming/streaming-${toString i}.socket"; value = { };
value = { }; }) (lib.range 1 cfg.streamingProcesses)
}) );
(lib.range 1 cfg.streamingProcesses));
}; };
}; };
} }

View file

@ -1,11 +1,16 @@
{ lib, pkgs, ... }: {
lib,
pkgs,
config,
...
}:
let let
commonHeaders = '' commonHeaders = ''
add_header Permissions-Policy interest-cohort=() always; add_header Permissions-Policy interest-cohort=() always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-XSS-Protection "1; mode=block"; add_header X-XSS-Protection "1; mode=block";
''; '';
clientConfig = import ./matrix/element-client-config.nix { inherit lib pkgs; }; clientConfig = import ./element-client-config.nix { inherit lib pkgs; };
wellKnownClient = domain: { wellKnownClient = domain: {
"m.homeserver".base_url = "https://matrix.${domain}"; "m.homeserver".base_url = "https://matrix.${domain}";
"m.identity_server".base_url = "https://matrix.${domain}"; "m.identity_server".base_url = "https://matrix.${domain}";
@ -44,7 +49,7 @@ let
role = "m.role.admin"; role = "m.role.admin";
} }
]; ];
support_page = "https://pub.solar/about"; support_page = "https://${config.pub-solar-os.networking.domain}/about";
}; };
mkWellKnown = data: '' mkWellKnown = data: ''
add_header Content-Type application/json; add_header Content-Type application/json;
@ -64,19 +69,23 @@ in
# This is already in production use # # This is already in production use #
##################################### #####################################
"pub.solar" = { "${config.pub-solar-os.networking.domain}" = {
locations = wellKnownLocations "pub.solar"; locations = wellKnownLocations "${config.pub-solar-os.networking.domain}";
}; };
"chat.pub.solar" = { "chat.${config.pub-solar-os.networking.domain}" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
root = pkgs.element-web.override { root = pkgs.element-web.override { conf = clientConfig; };
conf = clientConfig;
};
}; };
"matrix.pub.solar" = { "stickers.chat.${config.pub-solar-os.networking.domain}" = {
forceSSL = true;
enableACME = true;
root = pkgs.element-stickerpicker;
};
"matrix.${config.pub-solar-os.networking.domain}" = {
root = "/dev/null"; root = "/dev/null";
forceSSL = lib.mkDefault true; forceSSL = lib.mkDefault true;
@ -116,20 +125,22 @@ in
}; };
}; };
}; };
"matrix.pub.solar-federation" = { "matrix.${config.pub-solar-os.networking.domain}-federation" = {
serverName = "matrix.pub.solar"; serverName = "matrix.${config.pub-solar-os.networking.domain}";
forceSSL = lib.mkDefault true; forceSSL = lib.mkDefault true;
enableACME = lib.mkDefault true; enableACME = lib.mkDefault true;
listen = [{ listen = [
port = 8448; {
addr = "0.0.0.0"; port = 8448;
ssl = true; addr = "0.0.0.0";
} ssl = true;
}
{ {
port = 8448; port = 8448;
addr = "[::]"; addr = "[::]";
ssl = true; ssl = true;
}]; }
];
root = "/dev/null"; root = "/dev/null";
extraConfig = '' extraConfig = ''
server_tokens off; server_tokens off;
@ -153,4 +164,3 @@ in
}; };
networking.firewall.allowedTCPPorts = [ 8448 ]; networking.firewall.allowedTCPPorts = [ 8448 ];
} }

View file

@ -1,4 +1,5 @@
{ pkgs, lib, ... }: { { pkgs, lib, ... }:
{
default_server_config = { default_server_config = {
"m.homeserver" = { "m.homeserver" = {
base_url = "https://matrix.pub.solar"; base_url = "https://matrix.pub.solar";
@ -35,10 +36,12 @@
homeUrl = ""; homeUrl = "";
}; };
branding = { branding = {
auth_footer_links = [{ auth_footer_links = [
text = "Privacy"; {
url = "https://pub.solar/privacy"; text = "Privacy";
}]; url = "https://pub.solar/privacy";
}
];
# FUTUREWORK: Replace with pub.solar logo # FUTUREWORK: Replace with pub.solar logo
auth_header_logo_url = "themes/element/img/logos/element-logo.svg"; auth_header_logo_url = "themes/element/img/logos/element-logo.svg";
}; };

Some files were not shown because too many files have changed in this diff Show more