Commit graph

119 commits

Author SHA1 Message Date
19e2743c3b feat(mx): add ntfy push notifications for disk alerts and service failures
- Disk check scripts now send ntfy alerts in addition to email
- New ntfy-failure@ template service notifies on any systemd service failure
- Uses sops-managed token for ntfy authentication

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:31:39 +01:00
507fc67d60 feat(mx): add ntfy-sh push notification service
Self-hosted at ntfy.hoyer.xyz with deny-all default access.
After deploying, create a user with: ntfy user add --role=admin harald

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:21:04 +01:00
616c57874c feat(mx): enable daily PostgreSQL backup via pg_dumpall
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:13:10 +01:00
35b1f0218d feat(mx): upgrade PostgreSQL 14 → 16 and remove migration script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:23:13 +01:00
a854caaf19 feat(mx): add pg_upgrade script for PostgreSQL 14 → 16 migration
Temporary upgrade script following the official NixOS procedure.
Run `upgrade-pg-cluster --jobs 4 --link` on the server, then switch
the package to postgresql_16 and remove the script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:20:26 +01:00
dc4594333f fix(mx): fix check_root email subject and consolidate systemd attrsets
The check_root service incorrectly used '/boot Disk Space Alert' as
the email subject instead of '/ Disk Space Alert'. Also merged the
duplicate systemd.services and systemd.timers attribute sets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:09:32 +01:00
d11199da10 fix(mx): update stale comment in Roundcube config to reflect SSL/TLS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:08:55 +01:00
f6a76ad5e5 fix(mx): use SSL/TLS on port 465 for Roundcube SMTP
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 12:36:40 +01:00
9a926472f9 feat(mx): configure Roundcube SMTP to use STARTTLS on port 587
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 12:34:03 +01:00
2c70ee0a0a feat(mx): configure Roundcube IMAP to use SSL/TLS on port 993
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 12:24:52 +01:00
9feb16efe1 feat(mx): nextcloud33 2026-03-24 12:00:38 +01:00
108b3cb96f feat(mx): enable ManageSieve for server-side email filtering
Enable ManageSieve in Dovecot (port 4190) and add the managesieve
plugin to Roundcube for managing Sieve filter rules via webmail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:57:38 +01:00
04150f10d4 nix fmt 2026-02-24 13:25:42 +01:00
9b42e808d3 feat(bot): refactor system prompt and enhance CLI command
- Replaced `DEFAULT_SYSTEM_PROMPT` with `BOT_SYSTEM_PROMPT` for clarity and modularity.
- Introduced a `build_system_prompt` function to dynamically compose prompts.
- Enhanced `call_claude` CLI with new tool options and appendable prompts.
2026-02-04 09:11:08 +01:00
f25aab2441 feat(bot): improve prompt-building and help command handling
- Added a default system prompt and adjusted the structure to use XML for clarity.
- Improved help command handling by simplifying triggers and updating responses.
- Enhanced NixOS configuration with support for optional custom instructions.
2026-02-03 17:39:31 +01:00
9342933987 feat(bot): switch to in-memory conversation history
- Replaced Nextcloud chat history fetching with in-memory storage for conversation history.
- Added limits to history length based on an environment variable (`CONTEXT_MESSAGES`).
- Simplified prompt-building logic by removing async history fetching.
2026-02-03 17:26:46 +01:00
b35373b0ec feat(bot): replace maxTokens with contextMessages option
- Switched `maxTokens` to `contextMessages` to set chat history length instead of token limit.
- Updated environment variables, NixOS module, and prompt building logic for consistency.
- Removed in-memory conversation history, now fetching from Nextcloud for better scalability.
2026-02-03 17:00:50 +01:00
538d7623be refactor(bot): remove unused max-tokens argument handling
- Simplified the `call_claude` function by removing the unused `MAX_TOKENS` argument handling.
- Ensures cleaner and more maintainable command construction.
2026-02-03 16:30:47 +01:00
1f61a0d1ec feat(bot): refactor webhook parsing for better structure
- Updated webhook parsing to align with the latest Nextcloud Talk Bot format.
- Improved handling of actor, message, and conversation data for clarity and flexibility.
- Added robust JSON decoding with fallback for content extraction.
2026-02-03 16:29:10 +01:00
77cf4a0aed feat(bot): support random token in signature verification
- Enhanced signature verification by adding support for a `random` token included in webhook headers.
- Introduced logging to display signature variants for debugging purposes.
- Improved webhook handling to process new `X-Nextcloud-Talk-Random` header.
2026-02-03 16:26:37 +01:00
33937ab115 feat(bot): add signature verification logging
- Added info-level logging to provide details about signature verification, including secret length and partial hashes for expected and received signatures.
- Helps in debugging signature mismatches without exposing full sensitive data.
2026-02-03 16:23:14 +01:00
d5967cf392 feat(nix): improve Nextcloud Claude Bot security and user setup
- Set `User` and `Group` for the bot service to enhance security and isolation.
- Added system user and group for `claude-bot` with defined home directory.
- Modified secrets ownership to align with the new bot user.
2026-02-03 16:14:21 +01:00
b1370b5fc6 feat(bot): enhance group chat handling and mention detection
- Updated bot to only respond in group chats when explicitly mentioned.
- Added mention detection using regex for "Claude" patterns and cleaned up the message text for processing.
- Improved help message to clarify usage in direct messages and group chats.
2026-02-03 16:09:25 +01:00
8404f0998b refactor(nix): simplify Nextcloud Claude Bot packaging
- Replaced `buildPythonApplication` with `python3.withPackages` for a cleaner and more concise implementation.
- Adjusted service configuration to use the updated packaging structure, ensuring compatibility with the new setup.
- Simplifies the NixOS module by reducing redundancy and improving maintainability.
2026-02-03 15:54:01 +01:00
bc6091f63f feat(nix): add Nextcloud Claude Bot integration
- Added configuration for Nextcloud Claude Bot, including NixOS module, secrets management, and example setup files.
- Introduced a Python-based HTTP server for handling webhook events and interacting with Nextcloud Talk.
- Integrated necessary dependencies and systemd service for seamless operation.
2026-02-03 15:42:56 +01:00
4622c52d5b refactor(nix): extract common system configs into reusable modules
Create 6 new NixOS modules to reduce duplication across system configs:
- hardware/wooting: Wooting keyboard udev rules and Bluetooth compat
- services/nginx-base: Common nginx server settings
- services/acme-base: ACME certificate defaults
- services/xremap: Key remapping with sensible defaults
- system/no-sleep: Disable sleep/suspend/hibernate targets
- system/kernel-tweaks: PM freeze timeout and zram configuration

Update system configuration files to use these new modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:42:09 +01:00
Harald Hoyer
71304185bd fix(nix): add DNS nameservers for headscale
- Added global DNS nameservers configuration for headscale
- Included Cloudflare DNS servers (1.1.1.1, 1.0.0.1) and IPv6 addresses
- Added local DNS server (192.168.178.254) for internal resolution
2025-12-03 10:49:18 +01:00
Harald Hoyer
05eceda8ca feat(nix): configure gitea-runner to depend on nginx service
- Added systemd service dependencies for gitea-runner-default
  - Ensured nginx.service is required and started before gitea-runner-default
  - Maintains proper service startup order for forgejo deployment
2025-12-03 10:48:56 +01:00
9f792774a5 feat(nix): enable GNOME remote desktop and update flake lock
- Enabled `services.gnome.gnome-remote-desktop` in the `x1` configuration.
- Removed an unused `lib` parameter in the `forgejo.nix` module.
- Updated the `home-manager` source in the `flake.lock` file with the latest revision and hash.
2025-12-03 09:44:16 +01:00
62f1eb0a2d Update forgejo-runner package reference
Switched from `forgejo-actions-runner` to `forgejo-runner` package for the gitea actions runner instance. This aligns with the updated package naming convention in the system configuration. The change ensures proper integration with the forgejo ecosystem and maintains consistency with the project's package structure.
2025-12-03 09:43:59 +01:00
884ceee9fd fix(mx): set mailserver stateVersion 2025-12-03 07:08:57 +01:00
5444962eda fix(mx): set mailserver stateVersion 2025-12-03 07:02:18 +01:00
Harald Hoyer
bf82f7afa0 chore(nix): enable RustDesk and update configurations
- Uncommented `rustdesk.nix` in MX system and added `rustdesk-flutter` to GUI services.
- Disabled `services.rustdesk-server.signal` on X1 system to align with updated settings.
2025-11-24 14:59:39 +01:00
4e67949e03 fix: headscale web proxy 2025-11-24 14:07:09 +01:00
caad1ddba9 Revert "chore(nix): enhance Nginx proxy settings for Headscale"
This reverts commit 2d0d03f845.
2025-11-24 13:57:00 +01:00
Harald Hoyer
2d0d03f845 chore(nix): enhance Nginx proxy settings for Headscale
- Added extra HTTP headers and security configurations in the Nginx proxy for Headscale.
- Improves websocket handling, security headers, and HTTPS redirection.
2025-11-24 13:54:52 +01:00
Harald Hoyer
8d6db08029 chore(nix): add OIDC configuration to Headscale
- Introduced OIDC settings in Headscale, including allowed domains, client ID, client secret path, and issuer.
- Enables support for OpenID Connect authentication.
2025-11-24 11:22:21 +01:00
Harald Hoyer
ef4ac5e228 chore(nix): fix property name in Headscale settings
- Corrected `baseDomain` to `base_domain` in the Headscale DNS settings.
- Aligns property naming with expected schema for proper configuration.
2025-11-21 16:24:28 +01:00
Harald Hoyer
2a810ce759 chore(nix): remove enableACME from Headscale Nginx config
- Dropped `enableACME` as it is redundant when `useACMEHost` is defined.
- Simplifies Nginx virtual host configuration for Headscale.
2025-11-21 16:23:53 +01:00
Harald Hoyer
129630c163 chore(nix): refactor Headscale service configuration
- Reorganized `settings` block to simplify and correct nesting.
- Updated function arguments to include variadic parameters for extensibility.
2025-11-21 16:22:56 +01:00
Harald Hoyer
62201776f3 chore(nix): add Headscale service to MX configuration
- Included `headscale.nix` in the MX system configuration for VPN management.
- Added Nginx and ACME configuration to route traffic securely to Headscale.
- Ensures Headscale is enabled with required settings and packaged in the system.
2025-11-21 16:15:51 +01:00
Harald Hoyer
36f3ebfcb3 chore(nix): enable Tailscale on SGX, MX, and X1 systems
- Added `services.tailscale.enable = true` to the configurations of SGX, MX, and X1 systems for VPN support.
- Improves secure connectivity and simplifies network management across these systems.
2025-11-21 14:54:07 +01:00
Harald Hoyer
1f5d2c1ce5 chore(nix): add OIDC app and webfinger redirect for Nextcloud
- Added OIDC app to Nextcloud with specific URL, SHA256, and license configuration for authentication support.
- Configured Nginx to redirect `.well-known/webfinger` to Nextcloud for improved compatibility.
- Updated Nextcloud settings to include `overwrite.cli.url` for proper URL handling.
2025-11-21 14:52:00 +01:00
Harald Hoyer
325f3bafbe chore(nix): update Nextcloud to version 32
- Bumped `services.nextcloud.package` from `nextcloud31` to `nextcloud32`.
- Ensures compatibility with updated Nextcloud features and improvements.
2025-11-21 13:08:25 +01:00
5b0cab98d5 feat(systems): enable email notifications on failure
- Added `emailOnFailure.enable` option to metacfg with a default of `false`.
- Enabled email notifications on failure for SGX and MX systems.
- Enhanced `systemd-email-notify` module to support the new configuration.
2025-11-14 07:42:28 +01:00
f41c21344e chore(mailserver): update password hashing method
- Changed default hashing method in `mkpasswd` command to `sha-512`.
- Ensures stronger security compared to the previous bcrypt method.
2025-07-29 15:54:38 +02:00
35988e7888 feat(coturn): update configuration for secret management
Removed comment clutter and streamlined the configuration for better readability and maintenance. Ensured the sops secrets and ACME certificate handling remain functional.
2025-04-15 10:26:46 +02:00
4cb03eb58f feat(nextcloud): upgrade to Nextcloud 31
Updated the Nextcloud package from version 30 to 31. This ensures access to the latest features and improvements while maintaining compatibility with the system configuration.
2025-04-14 15:16:24 +02:00
7494fd7efd refactor: improve formatting and update dependencies
Reformatted configuration files for better readability and consistency. Updated lock file dependencies to the latest revisions, ensuring compatibility and performance improvements.
2025-02-25 08:56:02 +01:00
ce865160b8 chore(nix): comment out rustdesk configuration
Rustdesk configuration has been temporarily disabled in the system modules. This might be to address an issue or for future refactoring.
2025-02-24 10:56:30 +01:00