Skip to content

Commit be76b99

Browse files
rubysclaude
andcommitted
Replace complex modular architecture with simplified single-file implementation
## Major Architecture Changes - **Single-file implementation**: Consolidated entire codebase into cmd/navigator/main.go (~1700 lines) - **Minimal dependencies**: Only go-htpasswd and yaml.v3, removed complex internal packages - **Simplified build**: Single Go file compilation with Makefile support ## New Features - **Managed processes**: External process management (Redis, Sidekiq, etc.) with auto-restart - **Dynamic port allocation**: Finds available ports instead of sequential assignment - **PID file management**: Automatic cleanup of stale PID files before starting processes - **Graceful shutdown**: Proper SIGINT/SIGTERM handling with complete process cleanup - **Enhanced static serving**: nginx-style try_files behavior with multiple file extensions ## Configuration Changes - **YAML-first approach**: Modern YAML configuration with template variable support - **nginx compatibility**: Deprecated but still supported for backward compatibility - **Removed Rails generator references**: Users create and maintain their own YAML configs ## Process Management Improvements - **On-demand Rails apps**: Start when requested, stop after configurable idle timeout - **External process lifecycle**: Start/stop Redis, Sidekiq, and other services with Navigator - **Process monitoring**: Auto-restart crashed processes when configured - **Environment inheritance**: Rails apps inherit parent process environment variables ## Performance Optimizations - **Direct static file serving**: Bypasses Rails for assets with configurable caching - **try_files implementation**: Serves public content (studios, regions, docs) without Rails overhead - **Content-Type detection**: Automatic MIME type setting for various file extensions - **Public route optimization**: Zero Rails overhead for non-authenticated static content ## GitHub Actions Updates - **Updated CI workflow**: Tests new single-file build with proper YAML configuration - **Enhanced release workflow**: Multi-platform binaries with version injection and proper release notes - **Maintained compatibility**: Same release process with improved binary generation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9b8aa00 commit be76b99

30 files changed

Lines changed: 2573 additions & 5292 deletions

.github/workflows/ci.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,39 @@ jobs:
4242

4343
- name: Test binary
4444
run: |
45-
# Create minimal test environment
46-
mkdir -p /tmp/test-rails/config/tenant
47-
echo '"2025": {}' > /tmp/test-rails/config/tenant/showcases.yml
45+
# Create minimal test environment with YAML configuration
46+
mkdir -p /tmp/test-rails/config
47+
cat << 'EOF' > /tmp/test-rails/config/navigator.yml
48+
server:
49+
listen: 0 # Use port 0 for testing
50+
hostname: localhost
51+
public_dir: /tmp/test-rails/public
52+
53+
pools:
54+
max_size: 1
55+
idle_timeout: 300
56+
start_port: 4000
57+
58+
auth:
59+
enabled: false
60+
61+
static:
62+
directories: []
63+
extensions: [html, css, js]
64+
try_files:
65+
enabled: false
66+
67+
applications:
68+
global_env: {}
69+
standard_vars: {}
70+
tenants: []
71+
72+
managed_processes: []
73+
EOF
74+
mkdir -p /tmp/test-rails/public
4875

49-
# Test that binary starts and exits cleanly with new CLI syntax
50-
timeout 5s ./navigator serve --root /tmp/test-rails --listen :0 || [ $? -eq 124 ]
76+
# Test that binary starts and exits cleanly with YAML config
77+
timeout 5s ./navigator /tmp/test-rails/config/navigator.yml || [ $? -eq 124 ]
5178

5279
build:
5380
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
echo "" >> release_notes.md
139139
echo "Extract the binary and run:" >> release_notes.md
140140
echo "\`\`\`bash" >> release_notes.md
141-
echo "./navigator serve --root /path/to/your/rails/app" >> release_notes.md
141+
echo "./navigator config/navigator.yml" >> release_notes.md
142142
echo "\`\`\`" >> release_notes.md
143143
fi
144144

0 commit comments

Comments
 (0)