Commit graph

64 commits

Author SHA1 Message Date
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
3ed921312f feat(config): implement multi-tenant config system (DAW/furt#89)
- nginx-style furt.conf configuration
- Multi-tenant mail routing per API key
- Custom SMTP support per customer
- Backward compatibility via server.lua adapter

WIP: Ready for testing on werner
2025-08-15 16:18:55 +02:00
be3b9614d0 refactor: clean repository structure for v0.1.0 open source release
- Remove Go artifacts (cmd/, internal/, pkg/, go.mod)
- Move furt-lua/* content to repository root
- Restructure as clean src/, config/, scripts/, tests/ layout
- Rewrite README.md as practical tool documentation
- Remove timeline references and marketing language
- Clean .gitignore from Go-era artifacts
- Update config/server.lua with example.org defaults
- Add .env.production to .gitignore for security

Repository now ready for open source distribution with minimal,
focused structure and generic configuration templates.
close issue DAW/furt#86
2025-08-14 09:36:55 +02:00
87c935379b upd(gitignor) update tools/gitea 2025-07-20 19:34:54 +02:00
901f5eb2d8 feat(auth): implement complete API-key authentication with modular architecture (#47)
- Add comprehensive API-key authentication system with X-API-Key header validation
- Implement permission-based access control (mail:send, * for admin)
- Add rate-limiting system (60 req/hour per API key, 100 req/hour per IP)
- Refactor monolithic 590-line main.lua into 6 modular components (<200 lines each)
- Add IP-restriction support with CIDR notation (127.0.0.1, 10.0.0.0/8)
- Implement Hugo integration with CORS support for localhost:1313
- Add production-ready configuration with environment variable support
- Create comprehensive testing suite (auth, rate-limiting, stress tests)
- Add production deployment checklist and cleanup scripts

This refactoring transforms the API gateway from a single-file monolith into a
biocodie-compliant modular architecture while adding enterprise-grade security
features. Performance testing shows 79 RPS concurrent throughput with <100ms
latency. Hugo contact form integration tested and working. System is now
production-ready for deployment to walter/aitvaras.

Resolves #47
2025-06-24 22:01:38 +02:00
445e751c16 feat(api): implement CORS support with environment-based configuration
- Add CORS headers to all API responses in main.lua
- Implement OPTIONS preflight request handling
- Add environment-variable based CORS origin configuration
- Create production.env.example for deployment documentation
- Update .env.example with CORS_ALLOWED_ORIGINS setting

Resolves cross-origin request blocking for Hugo dev server integration.
CORS origins now configurable via CORS_ALLOWED_ORIGINS environment variable
for production deployments while maintaining dev-friendly defaults.

Related to #49
2025-06-24 19:42:44 +02:00
9ea0cb43e4 fix(deploy): prevent environment config overwrite and fix SMTP_HOST variable
- Fix create_environment_file() to preserve existing production config
- Change SMTP_SERVER to SMTP_HOST for consistency with other configs
- Add config existence check before creating new environment file
- Preserve permissions on existing config files
- Prevent accidental production config loss on redeployment

Fixes #50
2025-06-24 11:04:19 +02:00