This project provides a Flask application for managing network device configurations, packaged as a Windows service using Waitress for production deployment.
WANRING: cisco_driver.py is using an hardcoded line == "voice translation-rule 2" - ToDo: manage all translation rules or a user selected subset
- Windows 10/11 or Windows Server
- Python 3.11.14 (or compatible 3.11+ version)
- Administrator privileges
-
Install Python dependencies:
pip install -r requirements.txt
-
Install the Windows service:
python service_wrapper.py install
Or use the batch file:
install_service.bat
-
Start the service:
net start FlaskNetConfigService
After installation, the service will run automatically on system startup. You can access the application at:
http://localhost:5000
- Start service:
net start FlaskNetConfigService - Stop service:
net stop FlaskNetConfigService - Restart service:
net stop FlaskNetConfigService && net start FlaskNetConfigService - Uninstall service:
python service_wrapper.py uninstalloruninstall_service.bat
The service runs with the following configuration:
- Host: 0.0.0.0 (accessible from all network interfaces)
- Port: 5000
- Threads: 4 (for handling concurrent requests)
- Production server: Waitress (recommended for production)
For development purposes, you can still run the Flask app directly:
python app.py- Service fails to start: Check the Windows Event Log for detailed error messages
- Port conflicts: Ensure port 5000 is not being used by another application
- Database issues: The service automatically initializes the database on startup
If you prefer an executable file instead of a Windows service, you can use PyInstaller:
-
Install PyInstaller:
pip install pyinstaller
-
Create the executable:
pyinstaller --onefile --windowed service_wrapper.py
-
The executable will be created in the
dist/directory
- The service runs with the same permissions as the user who installed it
- Database files are stored in the application directory
- Logs are written to the Windows Event Log
On older windows 2008 R2 Server, beter Use NSSM: The most reliable way to run Python venv scripts as services is using NSSM (Non-Sucking Service Manager). Command: nssm install FlaskNetConfigService "D:\path\to.venv\Scripts\python.exe" "D:\path\to\service_wrapper.py" "debug"