Commit graph

70 commits

Author SHA1 Message Date
7ee990b052 chore: merkwerk auto-update 2025-09-05 22:30:13 +02:00
25a709ebbe feat(service): implement PID-file based service management (DAW/furt#100)
- Replace unreliable pexp patterns with PID-file approach
- Add graceful shutdown with timeout handling in rc.d script
- Implement process validation after startup
- Add SIGHUP config reload support for Unix services
- Ensure PID-file cleanup on service exit
- Update systemd service to use PIDFile parameter

Platform improvements:
- OpenBSD: rc_check/rc_stop functions now PID-file based
- Linux: systemd Type=forking with proper PIDFile support
- Cross-platform: /var/run/furt.pid standard location

Resolves service status detection issues where rcctl check showed
(failed) despite running service due to process name variations
across platforms.
2025-09-05 22:30:07 +02:00
ddbb232de2 Merge branch 'refactor/extract-health-routes-and-server-core' 2025-09-05 19:26:37 +02:00
dccf3e462a chore: merkwerk auto-update 2025-09-05 19:25:09 +02:00
d271b846ad refactor: extract health routes and HTTP server core from main.lua
- Extract health routes to src/routes/health.lua (80 lines)
- Extract HTTP server core to src/http_server.lua (256 lines)
- Reduce main.lua to pure orchestration (342 → 27 lines)
- Preserve all functionality and API compatibility
- Add proper module separation following existing patterns
- Enable future service self-registration architecture

Closes #96
2025-09-05 19:25:02 +02:00
1162dceef8 Merge branch 'fix/ssl-dependency-check' 2025-09-05 18:20:08 +02:00
ed7d069953 chore: merkwerk auto-update 2025-09-05 18:20:08 +02:00
d4fa6e34e2 fix(deps): add comprehensive SSL dependency check and unify error messages
- Add SSL/TLS library validation before startup
- Unify all dependency error messages with install instructions
- Provide platform-specific package names for all dependencies
- Prevents silent SMTP SSL failures at runtime

Fixes #109
2025-09-05 18:20:08 +02:00
bf41726613 Merge branch 'fix/json-library-compatibility' 2025-09-05 17:44:42 +02:00
0592381e5d chore: merkwerk auto-update 2025-09-05 17:44:42 +02:00
78e8dedf8e fix(json): add multi-platform JSON library compatibility
- Add flexible JSON detection (cjson preferred, dkjson fallback)
- Update main.lua and mail.lua with found_cjson detection
- Update start.sh to check both JSON libraries
- Enables furt to run on Arch Linux without manual patches
- Maintains API compatibility with existing cjson usage

Fixes #108
2025-09-05 17:44:42 +02:00
785283950f Merge branch 'fix/config-path-consistency' 2025-09-05 17:21:36 +02:00
56b5c43e98 chore: merkwerk auto-update 2025-09-05 17:21:25 +02:00
c15b01a0a6 fix(config): unify config path detection across all scripts
- Add platform detection to start.sh for consistent config paths
- BSD systems: /usr/local/etc/furt/furt.conf
- Linux systems: /etc/furt/furt.conf
- Now consistent with setup-directories.sh and validate-config.sh
- Follows DAW service separation standards

Fixes #103
2025-09-05 17:21:25 +02:00
b068a24ed5 Merge branch 'fix/systemd-type-forking' 2025-09-05 17:03:36 +02:00
7b15a2cfc4 chore: merkwerk auto-update 2025-09-05 17:02:31 +02:00
442b465f16 fix(systemd): use Type=forking for background start.sh compatibility
- Change Type=simple to Type=forking in systemd service
- Properly handle start.sh background process (&)
- Ensures systemd correctly tracks daemon lifecycle
- Fixes BSD-compatible start script integration

Fixes #104
2025-09-05 17:02:31 +02:00
4716630e5b chore: merkwerk auto-update 2025-09-03 22:13:09 +02:00
38a1108a46 feat(deployment): replace monster scripts with modular helper scripts (#87)
- Add install.sh orchestrator with upgrade support
- Add 6 helper scripts (<100 lines each) replacing 700-800 line monsters
- Add deployment/linux/furt.service systemd template
- Support both fresh install and upgrade modes
- Platform-aware detection (OpenBSD/FreeBSD vs Linux)
- Skip user/service creation in upgrade mode
- Preserve existing configuration during updates
- Remove merkwerk dependency from production install script

Helper scripts:
- scripts/setup-user.sh - Create system user (_furt/furt)
- scripts/setup-directories.sh - Create directory structure
- scripts/sync-files.sh - Copy source files to installation
- scripts/create-service.sh - Create system service from templates
- scripts/validate-config.sh - Validate furt.conf syntax
- scripts/health-check.sh - Basic health check functionality

Closes DAW/furt#87
2025-09-03 22:12:58 +02:00
8ad77860d1 chore: merkwerk auto-update 2025-09-03 20:25:19 +02:00
eb64c39312 feat(distribution): add clean package build system
- Add scripts/build-package.sh for production-ready packages
- VCS-agnostic archive creation (git/hg/bzr/fossil support)
- Automatic version detection from VERSION file or git tags
- Secure exclusions for development files and secrets
- Package validation and content verification
- Support for explicit version override

Creates dist/furt-api-gateway-vX.Y.Z.tar.gz with clean structure
for deployment without development dependencies.

Related to DAW/furt#88
2025-09-03 20:24:59 +02:00
f2ca7a5e1c chore: merkwerk auto-update 2025-09-03 12:23:48 +02:00
53ef8ad427 remove internal files from git tracking 2025-09-03 12:23:47 +02:00
c7e33a85bb chore: merkwerk auto-update 2025-09-03 12:16:05 +02:00
589dccc376 fix(packaging): exclude internal files from packages 2025-09-03 12:15:44 +02:00
32d1371a4f chore: merkwerk auto-update 2025-09-03 11:02:41 +02:00
0c59b273d8 chore(license): switch to ISC license
- Replace existing license with ISC license
- Adopt more permissive and simpler license terms
- Align with dragons@work low-tech philosophy
- Maintain full open source compatibility

ISC license provides maximum freedom with minimal legal complexity,
supporting the project's commitment to digital sovereignty and
uncomplicated technology solutions.
2025-09-03 11:02:32 +02:00
fb29a10035 chore: merkwerk auto-update 2025-09-02 21:45:08 +02:00
cec390ef50 chore: remove obsolete .env.example and add issue #98 reference
- Remove .env.example to prevent configuration confusion
- furt now uses only furt.conf for all configuration
- .env.example was misleading users during installation
- Add comment referencing issue #98 resolution

Eliminates config method ambiguity identified in installation testing.
Closes DAW/furt#98
2025-09-02 21:45:01 +02:00
4834ed7f8d chore: merkwerk auto-update 2025-09-02 21:24:58 +02:00
c575d5eed0 fix(deployment): update OpenBSD rc.d template for current service architecture
- Update daemon path to use scripts/start.sh instead of direct lua execution
- Correct process expression pattern (pexp) for lua process detection
- Align template with installation.md service integration patterns
- Ensure compatibility with current furt directory structure

Fixes service integration issues identified in testing.
Related to DAW/furt#98
2025-09-02 21:24:52 +02:00
3bef171671 Merge branch 'fix/service-detection' 2025-09-02 18:38:33 +02:00
467e525786 chore: merkwerk auto-update 2025-09-02 18:36:07 +02:00
11ceb187b6 fix(service): add service vs interactive detection to start.sh
- Fix hanging rcctl/systemd service starts
- Background mode (&) when no TTY (service context)
- Foreground mode (exec) for interactive usage
- POSIX-compatible detection via [ ! -t 0 ]

Fixes service timeout issues on OpenBSD rcctl and Linux systemd.
Tested on werner - service starts correctly and survives reboots.

Fixes DAW/furt#99
2025-09-02 18:35:00 +02:00
0d39d166b8 chore: merkwerk auto-update 2025-08-29 22:01:45 +02:00
9b19b6a95b fix(scripts): resolve lua51 detection failure and remove obsolete environment system
- Fix variable inconsistency: LUA_CMD -> LUA_COMMAND throughout script
- Remove obsolete .env/environment loading - furt reads furt.conf directly
- Add config check for furt.conf (system or project location)
- Implement robust lua51 detection with fallback to lua5.1
- Support all target distributions: Arch, OpenBSD, Debian, FreeBSD
- Add clear installation instructions for missing dependencies
- Allow custom lua path via LUA_COMMAND variable override

This resolves the lua51 detection regression and simplifies the boot process
by eliminating dual config systems (environment vs furt.conf).

Fixes DAW/furt#91
2025-08-29 22:01:38 +02:00
dfeaca55ae Merge branch 'feature/issue-89-multi-tenant' 2025-08-29 20:06:48 +02:00
ef6b995042 chore: merkwerk auto-update 2025-08-29 20:01:55 +02:00
5c17c86fd4 feat(config): integrate rate limiting and CORS configuration from furt.conf
- Add RateLimiter:configure() function to accept config-based limits
- Integrate security section parameters (rate_limit_api_key_max, ip_max, window)
- Add CORS configuration from config file with environment fallback
- Replace hardcoded rate limiting defaults with configurable values
- Add test endpoint control via config.security.enable_test_endpoint
- Update startup logging to show actual configured rate limits
- Add configuration validation and detailed startup information

Rate limiting now uses values from [security] section instead of hardcoded
defaults. CORS origins prioritize config file over environment variables.

Related to DAW/furt#89
2025-08-29 20:01:47 +02:00
ecd4f68595 chore: merkwerk auto-update 2025-08-28 19:53:42 +02:00
8ec401930c fix(config): lua 5.1 compatibility and multi-tenant validation
- Replace goto statements with if-not pattern for Lua 5.1 compatibility
- Validate mail config only for API keys with mail:send permissions
- Safe display of API key info for monitoring keys without mail config
- Fix health check SMTP detection for new config structure
- Multi-tenant system tested and working on port 7811

Fixes multi-tenant config parsing, validation, and health checks.
Related to DAW/furt#89
2025-08-28 19:53:30 +02:00
a5db9a633f merge: integrate merkwerk binary detection into multi-tenant
- Add universal merkwerk binary detection from main
- Required for furt installations (no install without merkwerk)
- Maintains compatibility with multi-tenant architecture

Merges main branch changes for issue #94 into feature/issue-89-multi-tenant
2025-08-28 18:20:54 +02:00
82da58b358 chore: merkwerk auto-update 2025-08-28 17:34:36 +02:00
95dcdbaebb feat(integration): add universal merkwerk binary detection
- Check development binary (./bin/merkwerk)
- Check installed binary (/usr/local/bin/merkwerk)
- Fallback to PATH lookup (command -v merkwerk)
- Proper error handling for missing binary

Related to DAW/furt#94
2025-08-28 17:34:36 +02:00
6b2da02429 chore: merkwerk auto-update 2025-08-20 06:08:04 +02:00
62ddc17393 feat(integration): production-ready .version_history priority
- Change get_info() priority: .version_history first, merkwerk fallback
- Add read_version_history() for production deployment compatibility
- Works without merkwerk binary (tar.gz deployments)
- Maintains development fallback to merkwerk command

Production-ready: tar.gz deployments work without merkwerk installation.
2025-08-20 06:07:56 +02:00
f2d925ee57 chore: merkwerk auto-update 2025-08-19 21:36:34 +02:00
00b8a18527 feat(health): migrate VERSION file to merkwerk integration (#83)
- Replace read_version() with merkwerk.get_health_info()
- Health endpoint now returns content_hash, vcs_info, source tracking
- Add merkwerk_integrated feature flag
- Enhanced startup logs with content-hash and VCS info
- Maintain backward compatibility with version field
- lua51 compatible integration for OpenBSD deployment

Migration from static VERSION file to dynamic merkwerk version tracking.
Health endpoint now provides rich metadata for debugging and monitoring.

Resolves DAW/furt#83
2025-08-19 21:28:22 +02:00
7053af3c0d feat(core): implement file-based API versioning system (DAW/furt#83)
- Add VERSION file in repository root
- Add read_version() function with error handling
- Update /health endpoint to show file-based version
- Add version display during server startup
- Fallback to ?.?.? when VERSION file unreadable

Enables deployment tracking across dev/test/prod environments
2025-08-15 16:57:33 +02:00
5b851b8bfb fix(devdocs) delete project-tree.txt 2025-08-15 16:22:12 +02:00