-
-
Notifications
You must be signed in to change notification settings - Fork 425
Baremetal installer #1212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Baremetal installer #1212
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f900f3f
Resolve merge: keep proxmox installer and add README for Proxmox inst…
JVKeller c086ac3
Merge Deb/Ubuntu
JVKeller 21e770a
Create netalertx.conf
JVKeller 223aa29
tweaks
JVKeller e7d067d
tweaks
JVKeller 09c3457
fix typo
JVKeller 5f0a482
bug fix
JVKeller d9ecffd
Cleanup
JVKeller af6394a
Tweak permissions
JVKeller 55cfced
Comment out line
JVKeller cdee9b3
Permissions
JVKeller aad5bec
Single Debian/Ubuntu Installer
JVKeller dd91d1e
Merge branch 'jokob-sk:main' into baremetal-installer
JVKeller 79cec58
NGINX configuration
JVKeller 7790530
Revert source repo
JVKeller 0aceb09
Testing
JVKeller dd113f7
testing
JVKeller 70d63fe
Tweak log file paths
JVKeller 98d69e1
Restart nginx
JVKeller 35cd800
Fix logs
JVKeller 683f4e6
Move clone before setting up python env
JVKeller b34269d
Misc tweaks
JVKeller d7e6ff2
Fix log permissions
JVKeller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| # NetAlertX Proxmox Installer | ||
|
|
||
| An installer script for deploying NetAlertX on Proxmox VE (Debian-based) systems. This installer automates the complete setup including dependencies, NGINX configuration, systemd service, and security hardening. | ||
|
|
||
| ## 🚀 Quick Start | ||
|
|
||
| ### Prerequisites | ||
| - Fresh LXC or VM of Debian 13 or Ubuntu 24 | ||
| - Root access | ||
| - Internet connection | ||
|
|
||
| ### Installation | ||
|
|
||
| ```bash | ||
| # Download and run the installer | ||
| wget https://raw.githubusercontent.com/jokob-sk/NetAlertX/refs/heads/main/install/proxmox/proxmox-install-netalertx.sh -O proxmox-install-netalertx.sh && chmod +x proxmox-install-netalertx.sh && ./proxmox-install-netalertx.sh | ||
| ``` | ||
|
|
||
| ## 📋 What This Installer Does | ||
|
|
||
| ### System Dependencies | ||
| - **PHP 8.4** with FPM, SQLite3, cURL extensions | ||
| - **NGINX** with custom configuration | ||
| - **Python 3** with virtual environment | ||
| - **Network tools**: nmap, arp-scan, traceroute, mtr, speedtest-cli | ||
| - **Additional tools**: git, build-essential, avahi-daemon | ||
|
|
||
| ### Security Features | ||
| - **Hardened permissions**: Proper user/group ownership | ||
| - **TMPFS mounts**: Log and API directories mounted as tmpfs for security | ||
|
|
||
| ### Service Management | ||
| - **Systemd service**: Auto-start on boot with restart policies | ||
| - **Service monitoring**: Built-in health checks and logging | ||
| - **Dependency management**: Waits for network and NGINX | ||
|
|
||
| ## 🔧 Configuration | ||
|
|
||
| ### Port Configuration | ||
| The installer will prompt for a custom port, or defaultto 20211 after 10-seconds: | ||
|
|
||
| ``` | ||
| Enter HTTP port for NetAlertX [20211] (auto-continue in 10s): | ||
| ``` | ||
|
|
||
| ### Service Management | ||
| ```bash | ||
| # Check service status | ||
| systemctl status netalertx | ||
|
|
||
| # View logs | ||
| journalctl -u netalertx -f | ||
|
|
||
| # Restart service | ||
| systemctl restart netalertx | ||
|
|
||
| # Stop service | ||
| systemctl stop netalertx | ||
| ``` | ||
|
|
||
| ## 🌐 Access | ||
|
|
||
| After installation, access NetAlertX at: | ||
| ``` | ||
| http://[SERVER_IP]:[PORT] | ||
| ``` | ||
|
|
||
| ## 🔒 Security Considerations | ||
|
|
||
| ### TMPFS Mounts | ||
| - `/app/log` - Mounted as tmpfs (no persistent logs) | ||
| - `/app/api` - Mounted as tmpfs (temporary API data) | ||
|
|
||
| ### File Permissions | ||
| - Application files: `www-data:www-data` with appropriate permissions | ||
| - NGINX runs as `www-data` user | ||
| - Log directories: Secure permissions with tmpfs | ||
|
|
||
| ### Network Security | ||
| - NGINX configured for internal network access | ||
| - No external firewall rules added (configure manually if needed) | ||
|
|
||
| ## 🛠️ Troubleshooting | ||
|
|
||
| ### Common Issues | ||
|
|
||
| #### 403 Forbidden Error | ||
| ```bash | ||
| # Check file permissions | ||
| ls -la /var/www/html/netalertx | ||
| ls -la /app/front | ||
|
|
||
| # Fix permissions | ||
| chown -R www-data:www-data /app/front | ||
| chmod -R 755 /app/front | ||
| ``` | ||
|
|
||
| #### Service Won't Start | ||
| ```bash | ||
| # Check service status | ||
| systemctl status netalertx | ||
|
|
||
| # View detailed logs | ||
| journalctl -u netalertx --no-pager -l | ||
|
|
||
| # Check if port is in use | ||
| ss -tlnp | grep :20211 | ||
| ``` | ||
|
|
||
| #### GraphQL Connection Issues | ||
| ```bash | ||
| # Check API token in config | ||
| grep API_TOKEN /app/config/app.conf | ||
|
|
||
| # Verify GraphQL port | ||
| grep GRAPHQL_PORT /app/config/app.conf | ||
|
|
||
| # Check backend logs | ||
| tail -f /app/log/app.log | ||
| ``` | ||
|
|
||
| ### Log Locations | ||
| - **Service logs**: `journalctl -u netalertx` | ||
| - **Application logs**: `/app/log/` (tmpfs) | ||
| - **NGINX logs**: `/var/log/nginx/` | ||
| - **PHP logs**: `/app/log/app.php_errors.log` | ||
|
|
||
| ### Manual Service Start | ||
| If systemd service fails: | ||
| ```bash | ||
| # Activate Python environment | ||
| source /opt/myenv/bin/activate | ||
|
|
||
| # Start manually | ||
| cd /app | ||
| python server/ | ||
| ``` | ||
| or | ||
| ``` | ||
| ./start.netalertx.sh | ||
| ``` | ||
| ## 🔄 Updates | ||
|
|
||
| ### Updating NetAlertX | ||
| ```bash | ||
| # Stop service | ||
| systemctl stop netalertx | ||
|
|
||
| # Update from repository | ||
| cd /app | ||
| git pull origin main | ||
|
|
||
| # Restart service | ||
| systemctl start netalertx | ||
| ``` | ||
|
|
||
|
|
||
| ## 📁 File Structure | ||
|
|
||
| ``` | ||
| /app/ # Main application directory | ||
| ├── front/ # Web interface (symlinked to /var/www/html/netalertx) | ||
| ├── server/ # Python backend | ||
| ├── config/ # Configuration files | ||
| ├── db/ # Database files | ||
| ├── log/ # Log files (tmpfs) | ||
| ├── api/ # API files (tmpfs) | ||
| └── start.netalertx.sh # Service startup script | ||
|
|
||
| /etc/systemd/system/ | ||
| └── netalertx.service # Systemd service definition | ||
|
|
||
| /etc/nginx/conf.d/ | ||
| └── netalertx.conf # NGINX configuration | ||
| ``` | ||
|
|
||
| ## 🤝 Contributing | ||
| This installer will need a maintainer | ||
|
|
||
| 1. Fork the repository | ||
| 2. Create a feature branch | ||
| 3. Make your changes | ||
| 4. Test thoroughly | ||
| 5. Submit a pull request | ||
|
|
||
| ## 🙏 Acknowledgments | ||
|
|
||
| - NetAlertX development team | ||
| - Proxmox VE community | ||
| - Debian/Ubuntu maintainers | ||
| - Open source contributors | ||
|
|
||
| --- | ||
|
|
||
| **Note**: This installer was designed for a Proxmox LXC Debian 13 or Ubuntu 24 containers. For other systems, please use the appropriate installer or manual installation instructions. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| server { | ||
| listen 20211; | ||
| server_name _; #change this to your custom domain if you have one | ||
|
|
||
| # Web-interface files location | ||
| root /var/www/html/netalertx; | ||
|
|
||
| # Main page | ||
| index index.php; | ||
|
|
||
| #rewrite /app/(.*) / permanent; | ||
| add_header X-Forwarded-Prefix "/netalertx" always; | ||
| proxy_set_header X-Forwarded-Prefix "/netalertx"; | ||
|
|
||
| # Specify a character set | ||
| charset utf-8; | ||
|
|
||
| location / { | ||
| # Try to serve files directly, fallback to index.php | ||
| try_files $uri $uri/ /index.php?$query_string; | ||
| } | ||
|
|
||
| # FastCGI configuration for PHP | ||
| location ~ \.php$ { | ||
| # Use a Unix socket for better performance | ||
| fastcgi_pass unix:/var/run/php/php-fpm.sock; | ||
| fastcgi_index index.php; | ||
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
| fastcgi_param PATH_INFO $fastcgi_path_info; | ||
| fastcgi_param QUERY_STRING $query_string; | ||
| include fastcgi_params; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.