Developpement stuff
Virtualenv
virtualenv dev or prod
Dev / Debug
To code remotly, open vscode workspace ~/Dev/home_alarm/home_alarm.code-workspace
Push updates to git (via ssh) gitacp message
Deploy to production (via ssh) python ~/Dev/home_alarm/src/installer.py deploy-from-dev
To activate virtualenv workon dev
Go into dev directory cd ~/Dev/home_alarm/src
To run front-end server python main.py
To run back-end process python extAlarmProcess.py
Check the debug flags in
- extAlarmProcess.py
- noxAlarmProcess.py
- config.py
When running front-end this way, it uses the port defined in config.py (PORT = 5000)
When running front-end in production mode, it uses the default port 8000 (for internal gunicorn server) and 80 for external web server.
Documentation
Mkdoc used to generate the wiki. Markdown files are stored in folder doc/. Published to https://alarm-wiki.readthedocs.io. Pushing repository to github will trigger ReadTheDocs build.
Can be updated on the web and pushed to github from https://stackedit.io.
Don't forget to git pull the local repository after editing online.
To test documentation on local server, run mkdocs serve --dev-addr 0.0.0.0:8001.
Configuration file mkdoc.yml:
site_name: Alarm
theme: readthedocs
repo_url: https://github.com/cheperboy/home_alarm/
docs_dir: docs/
nav:
- Home: index.md
- Install Software: install_alarm.md
- Software: software.md
...
- flask_app/requirements.txt for dev build
- docs/requirements.txt for readthedocs.io build
Usefule extensions
Github config
Add *secret* and *.pem to .gitignore