Commit graph

104 commits

Author SHA1 Message Date
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
e009207a30 feat(rustdesk): enable firewall configuration
Added `openFirewall` option to `rustdesk-server` service to simplify network setup.
2025-02-24 10:31:40 +01:00
18d7710302 feat(rustdesk): update relay host configuration
Updated the relay host for RustDesk server from "mx.surfsite.org" to "rustdesk.hoyer.world". This ensures the service uses the new designated host for signal relay.
2025-02-24 10:22:49 +01:00
f2a984c762 feat(rustdesk): enable SSL and update proxy configuration
Enabled `forceSSL` for the RustDesk nginx configuration to ensure secure connections. Replaced `proxyPass` with detailed `extraConfig` to include necessary headers and support for WebSocket connections.
2025-02-24 10:19:46 +01:00
64f48c5969 feat(mx): isolate rustdesk configuration into separate module
Moved rustdesk-server settings from `default.nix` to a dedicated module `rustdesk.nix`. This improves configuration structure and ensures better modularity for maintainability.
2025-02-24 10:08:19 +01:00
3778bf29d0 feat(rustdesk): configure relayHosts for rustdesk-server
Added `relayHosts` configuration to rustdesk-server to specify the relay host `mx.surfsite.org`. This ensures proper routing and connectivity for the RustDesk service.
2025-02-24 09:12:54 +01:00
a686d21d39 feat(mx): enable RustDesk server service
Added configuration to enable the RustDesk server service in the MX system. This facilitates remote desktop functionality out of the box.
2025-02-24 08:31:09 +01:00
47cf44ccfd refactor: improve formatting in Nextcloud and home config
Reformatted code blocks for better readability and consistency in Nextcloud and Darwin home configurations. No functional changes were made, ensuring existing behavior remains intact.
2024-12-13 09:19:09 +01:00
27d41ed91d feat(nextcloud): update service dependencies and apps
Include `config` in function parameters for better configurability. Removed unnecessary Nextcloud apps such as `files_texteditor`, `files_markdown`, `twofactor_backupcodes`, and `twofactor_totp` to streamline service setup.
2024-12-06 13:23:47 +01:00
aef4e331ae feat(nextcloud): add extra apps configuration
Enhance Nextcloud setup by enabling additional applications such as calendar, contacts, and notes. This change improves the service's functionality and usability by integrating essential productivity tools directly into the Nextcloud environment.
2024-12-06 13:20:39 +01:00
b0f42bce29 fix(systemd): correct path for nixos-upgrade service
Change the working directory from `/root` to `/root/nixcfg` in the `nixos-upgrade` systemd service to ensure the correct configuration repository is used. This update prevents potential errors due to fetching and resetting in the wrong directory.
2024-11-29 17:07:52 +01:00
1e5ceb6c73 feat(systemd): add git to nixos-upgrade service path
Include git in the `PATH` for the `nixos-upgrade` systemd service. This change ensures that the service can execute git commands during its operations. The path addition resolves issues related to unavailable git commands.
2024-11-29 17:06:07 +01:00
cd99b128d4 feat: add preStart hook for nixos-upgrade service
Introduce a preStart hook to the nixos-upgrade systemd service to ensure the local repository is updated before upgrades by fetching and resetting to the origin's HEAD. This enhances the reliability and consistency of the upgrade process. Also, maintain the commented out old flake path for backward traceability.
2024-11-29 17:04:24 +01:00
82c7352bc2 set /root for mx
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2024-11-29 16:57:32 +01:00
4390f2ae09 chore: remove redundant git filter rot8000 config
Remove duplicate configurations for the rot8000 git filter from both mx and base modules. This change helps to streamline the code by ensuring that the unnecessary and redundant configurations are eliminated.
2024-11-29 13:36:00 +01:00
0767577099 Fix rot8000 2024-11-29 12:58:21 +01:00