-
Notifications
You must be signed in to change notification settings - Fork 0
docs: document pi-manager-X sister repo with templates #44
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
Open
MateoLostanlen
wants to merge
3
commits into
main
Choose a base branch
from
docs/sister-repo-templates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
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,9 @@ | ||
| # TEMPLATE — placeholders only. Encrypt before committing to your pi-manager-X repo: | ||
| # ansible-vault encrypt inventory/group_vars/all/vars.vault.yml | ||
| --- | ||
| # Telegram bot used by the alert API to push notifications. | ||
| TELEGRAM_TOKEN: "CHANGE_ME" | ||
|
|
||
| # Docker Hub password used by roles/servers/tasks/main.yml to docker login. | ||
| # The username is currently hardcoded to `pyronear` in that task. | ||
| dockerhub_password: "CHANGE_ME" |
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,29 @@ | ||
| # TEMPLATE — placeholders only. Encrypt before committing to your pi-manager-X repo: | ||
| # ansible-vault encrypt inventory/group_vars/engine_servers/vars.vault.yml | ||
| --- | ||
| # Default camera credentials (override per host in host_vars/<host>/vars.vault.yml). | ||
| CAM_USER: "admin" | ||
| CAM_PWD: "CHANGE_ME" | ||
|
|
||
| # Default Wi-Fi (override per host in host_vars/<host>/vars.vault.yml). | ||
| # Consumed by the `wifi` role; entries with a static IP are also picked up by `static_ip`. | ||
| wifi_connections: | ||
| - ssid: "Pyronear" | ||
| password: "CHANGE_ME" | ||
| priority: 10 | ||
|
|
||
| # Grafana Alloy config rendered into /etc/alloy/config.alloy by the | ||
| # grafana.grafana.alloy role. Contains the remote_write basic-auth token, | ||
| # hence why it lives in the vault file. See the role README for the full | ||
| # block; only the basic_auth username/password should change between sites. | ||
| alloy_config: | | ||
| prometheus.remote_write "metrics_service" { | ||
| endpoint { | ||
| url = "https://<your-grafana-cloud-prom-endpoint>/api/prom/push" | ||
| basic_auth { | ||
| username = "CHANGE_ME" | ||
| password = "CHANGE_ME" | ||
| } | ||
| } | ||
| } | ||
| # ... rest of the Alloy pipeline (loki.write, prometheus.exporter.unix, etc.) |
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,28 @@ | ||
| --- | ||
| # Dev environment. | ||
| # Hosts opt in via the `envdev` group in inventory (see inventory.template). | ||
|
|
||
| prefix: "ansible" # short, lowercase, used to derive resource names | ||
| pyronear_version: new-datamodel | ||
| api_dns: "alertapidev.pyronear.org" | ||
| openvpn_server_dns: "bastion{{ prefix }}.pyronear.org" | ||
| openvpn_server_ansible_host: "ovh-dev-3" # inventory name of the OpenVPN host | ||
|
|
||
| # Encrypt with: ansible-vault encrypt_string '<password>' --name 'openvpn_ca_password' | ||
| openvpn_ca_password: "CHANGE_ME" # vault-encrypted in real repos | ||
|
|
||
| # Object storage (OVH S3) used by the dev alert API. | ||
| S3_ENDPOINT_URL: https://s3.sbg.io.cloud.ovh.net/ | ||
| S3_ACCESS_KEY: "CHANGE_ME" # vault | ||
| S3_SECRET_KEY: "CHANGE_ME" # vault | ||
| S3_REGION: sbg | ||
|
|
||
| # Public hostnames served by the dev platform-react server. | ||
| platform_react_url_frontend: platformv3.pyronear.org | ||
| platform_react_url_backend: https://alertapi.pyronear.org | ||
| platform_react_url_livestream: https://livestream.pyronear.org | ||
|
|
||
| # Sites visible per dev org. | ||
| platform_react_sites_per_organization: | ||
| - name: example-org | ||
| sites: ["dev-site"] |
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,48 @@ | ||
| --- | ||
| # Production environment. | ||
| # Hosts opt in via the `envprod` group in inventory (see inventory.template). | ||
|
|
||
| prefix: "fr" # short, lowercase, used to derive resource names (e.g. bastion{{ prefix }}.pyronear.org) | ||
| pyronear_version: latest | ||
| api_dns: "alertapi.pyronear.org" | ||
| mediamtx_server_ip: "CHANGE_ME" # public IP of the mediamtx host (e.g. 91.134.47.14) | ||
| openvpn_server_dns: "bastion{{ prefix }}.pyronear.org" | ||
| openvpn_server_ansible_host: "fr_openvpn" # inventory name of the OpenVPN host | ||
|
|
||
| # Encrypt with: ansible-vault encrypt_string '<password>' --name 'openvpn_ca_password' | ||
| openvpn_ca_password: "CHANGE_ME" # vault-encrypted in real repos | ||
|
|
||
| # Object storage (OVH S3) used by alert API + annotation API. | ||
| S3_ENDPOINT_URL: https://s3.gra.io.cloud.ovh.net/ | ||
| S3_ACCESS_KEY: "CHANGE_ME" # vault | ||
| S3_SECRET_KEY: "CHANGE_ME" # vault | ||
| S3_REGION: gra | ||
|
|
||
| # Public hostnames served by the platform-react server. | ||
| platform_react_url_backend: https://alertapi.pyronear.org | ||
| platform_react_url_livestream: https://livestream.pyronear.org | ||
| platform_react_url_frontend: platform.pyronear.org | ||
|
|
||
| # One entry per organization in the alert API. Each lists the engine hostnames | ||
| # (must match inventory) whose detections that org is allowed to see. | ||
| platform_react_sites_per_organization: | ||
| - name: example-org | ||
| sites: ["site-a", "site-b"] | ||
|
|
||
| # alert API configuration. | ||
| alert_api_docker_version: latest | ||
| alert_api_proxy_url: alertapi.pyronear.org | ||
| alert_api_s3_proxy_url: assets.pyronear.org | ||
| alert_api_postgres_db: pyroapi | ||
| alert_api_postgres_pwd: "CHANGE_ME" # vault | ||
| alert_api_superuser_pwd: "CHANGE_ME" # vault | ||
| alert_api_jwt_secret: "CHANGE_ME" # vault | ||
| alert_api_s3_access_key: "CHANGE_ME" # vault | ||
| alert_api_s3_secret_key: "CHANGE_ME" # vault | ||
| alert_api_s3_region: gra | ||
| alert_api_s3_url: https://s3.gra.io.cloud.ovh.net/ | ||
| alert_api_server_name: ovh-alert-api-prod # used to derive S3 bucket names | ||
| alert_api_risk_api_url: https://riskapi.pyronear.org | ||
| alert_api_risk_refresh_hour_utc: 4 | ||
| alert_api_risk_api_login: "CHANGE_ME" # vault | ||
| alert_api_risk_api_pwd: "CHANGE_ME" # vault | ||
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,19 @@ | ||
| --- | ||
| ansible_user: pi | ||
| ansible_become_pass: "{{ ansible_password }}" | ||
|
|
||
| # Access Pi Zeros via their assigned engine (relay host) using SSH ProxyJump. | ||
| # Each pi_zero host must define `relay_host` in host_vars pointing to the | ||
| # engine's inventory hostname (e.g. relay_host: chambery). | ||
| ansible_ssh_common_args: >- | ||
| -o StrictHostKeyChecking=no | ||
| -o ProxyCommand="sshpass -p {{ hostvars[relay_host]['ansible_password'] }} ssh -o StrictHostKeyChecking=no -W %h:%p {{ hostvars[relay_host]['ansible_user'] }}@{{ hostvars[relay_host]['ansible_host'] }}" | ||
|
|
||
| # WiFi — override per host or per site in host_vars / group_vars | ||
| # wifi_ssid: "" | ||
| # wifi_password: "" | ||
|
|
||
| # Static IP — must be set in host_vars for each Pi Zero. | ||
| # After first run, update ansible_host to match static_ip_address. | ||
| # static_ip_address: "192.168.X.Y" | ||
| # static_ip_gateway: "192.168.X.1" |
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,11 @@ | ||
| # TEMPLATE — placeholders only. Encrypt before committing to your pi-manager-X repo: | ||
| # ansible-vault encrypt host_vars/<alert-server-host>/vars.vault.yml | ||
| --- | ||
| # Postgres database used by the alert API container. | ||
| POSTGRES_USER: "dbadmin" | ||
| POSTGRES_PASSWORD: "CHANGE_ME" | ||
| POSTGRES_DB: "pyroapi" | ||
|
|
||
| # For dev hosts you typically override the env prefix and DNS here, e.g.: | ||
| # prefix: "frdev" | ||
| # api_dns: "apidev.pyronear.org" |
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,12 @@ | ||
| # TEMPLATE — placeholders only. Encrypt before committing to your pi-manager-X repo: | ||
| # ansible-vault encrypt host_vars/<annotation-server-host>/vars.vault.yml | ||
| --- | ||
| # Postgres database used by the annotation API container. | ||
| POSTGRES_USER: "dbadmin" | ||
| POSTGRES_PASSWORD: "CHANGE_ME" | ||
| POSTGRES_DB: "pyroannotation" | ||
|
|
||
| # Annotation API basic-auth credentials and JWT signing secret. | ||
| AUTH_USERNAME: "admin" | ||
| AUTH_PASSWORD: "CHANGE_ME" | ||
| JWT_SECRET: "CHANGE_ME" # any high-entropy hex string |
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,28 @@ | ||
| # TEMPLATE — placeholders only. Encrypt before committing to your pi-manager-X repo: | ||
| # ansible-vault encrypt host_vars/<host>/vars.vault.yml | ||
| --- | ||
| # SSH / sudo on the Pi (user defined in group_vars/engine_servers/vars.yml — `pi`). | ||
| ansible_password: "CHANGE_ME" | ||
| # ansible_become_password: "CHANGE_ME" # only if different from ansible_password | ||
|
|
||
| # Camera credentials used by pyro-engine to talk to the cameras. | ||
| CAM_USER: "admin" | ||
| CAM_PWD: "CHANGE_ME" | ||
|
|
||
| # OpenVPN client password for this engine's certificate (matches the cert generated | ||
| # by the pyronear.openvpn role on the OpenVPN server). | ||
| open_vpn_password: "CHANGE_ME" | ||
| openvpn_client_password: "CHANGE_ME" | ||
|
|
||
| # Optional — only if this engine pushes streams to mediamtx with a per-engine password. | ||
| # mediamtx_pass: "CHANGE_ME" | ||
|
|
||
| # Wi-Fi — the `wifi` role iterates over `wifi_connections` (nmcli-based). | ||
| # Higher `priority` wins when several APs are visible. | ||
| wifi_connections: | ||
| - ssid: "Pyronear" | ||
| password: "CHANGE_ME" | ||
| priority: 10 | ||
| - ssid: "Backup-AP" | ||
| password: "CHANGE_ME" | ||
| priority: 8 |
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,40 @@ | ||
| --- | ||
| # Template for an engine host (Raspberry Pi running pyro-engine). | ||
| # Copy this folder to your pi-manager-X repo under host_vars/<your-host>/. | ||
| # Hostname must match the entry under engine_servers: in inventory/hosts_prod. | ||
|
|
||
| # Cameras attached to this engine. | ||
| # Keys are camera IPs on the engine's LAN. Values follow group_vars/engine_servers | ||
| # engine_json_schema. `id` is the camera id returned by init_script/create_cameras.py. | ||
| config_json: | | ||
| { | ||
| "192.168.1.11": { | ||
| "pose_ids": [401, 402, 403, 404], | ||
| "adapter": "reolink-823S2", | ||
| "id": "122", | ||
| "name": "<site>-01", | ||
| "bbox_mask_url": "", | ||
| "poses": [0, 1, 2, 3], | ||
| "token": "", | ||
| "type": "ptz" | ||
| }, | ||
| "192.168.1.12": { | ||
| "pose_ids": [405, 406, 407, 408], | ||
| "adapter": "reolink-823S2", | ||
| "id": "123", | ||
| "name": "<site>-02", | ||
| "bbox_mask_url": "", | ||
| "poses": [0, 1, 2, 3], | ||
| "token": "", | ||
| "type": "ptz" | ||
| } | ||
| } | ||
|
|
||
| # Static IP assigned to the Pi on its camera LAN (set by the static_ip role). | ||
| static_ip_interface: eth0 | ||
| static_ip_address: 192.168.1.99 | ||
| static_ip_gateway: 192.168.1.1 | ||
|
|
||
| # Name of the associated Pi Zero in inventory (omit if no Pi Zero). | ||
| # The engine_cron role uses this to derive PIZERO_IP from hostvars. | ||
| pi_zero_hostname: <site>-pi-zero |
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,17 @@ | ||
| # TEMPLATE — placeholders only. Encrypt before committing to your pi-manager-X repo: | ||
| # ansible-vault encrypt host_vars/<host>-pi-zero/vars.vault.yml | ||
| --- | ||
| # SSH / sudo on the Pi Zero. | ||
| ansible_password: "CHANGE_ME" | ||
|
|
||
| # Wi-Fi — the `wifi` role iterates over `wifi_connections` (nmcli-based). | ||
| # The `static_ip` role then applies a static IP for entries that define one. | ||
| wifi_connections: | ||
| - ssid: "Pyronear" | ||
| password: "CHANGE_ME" | ||
| priority: 10 | ||
| - ssid: "RUT200_XXXX" # e.g. a Teltonika 4G router | ||
| password: "CHANGE_ME" | ||
| priority: 8 | ||
| static_ip_address: "{{ static_ip_address }}" | ||
| static_ip_gateway: 192.168.1.1 |
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,18 @@ | ||
| --- | ||
| # Template for a Pi Zero host (watchdog companion to an engine). | ||
| # Copy to your pi-manager-X repo under host_vars/<your-host>-pi-zero/. | ||
| # Hostname must match the entry under pi_zero: in inventory/hosts_prod. | ||
|
|
||
| # First boot uses DHCP — set ansible_host to the lease IP you find with `nmap`/router UI. | ||
| # After the first run of rpi-init-pi-zero.yml the Pi Zero reboots onto its static IP; | ||
| # update ansible_host below to match static_ip_address before the next run. | ||
| ansible_host: 192.168.1.24 # DHCP ip first, then static after init | ||
|
|
||
| # Engine that proxies SSH into this Pi Zero. Must be an inventory hostname under | ||
| # engine_servers. The pi_zero_watchdog role derives MAIN_PI_IP and CAM_IPS from | ||
| # hostvars[relay_host]. | ||
| relay_host: <site> | ||
|
|
||
| # Static IP assigned by the static_ip role on the camera LAN. | ||
| static_ip_address: 192.168.1.98 | ||
| static_ip_gateway: 192.168.1.1 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are those url wanted to be exposed ? ( same comment elsewhere whenever they're present)