Update Canary to v1.5.0 with generated credentials#1001
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Canary dynamic app packaging to v1.5.0 and improves runtime configuration by generating/persisting Canary credentials on the device, surfacing them in a dedicated myNode Canary info page, and writing the Docker Compose runtime file from scripts instead of relying on packaged app_data at runtime.
Changes:
- Added a dedicated Canary app info page (Flask route + template) that displays the generated admin credentials and reads the installed version marker.
- Updated install/pre-start/uninstall scripts to generate persistent secrets under
/mnt/hdd/mynode/canary, writecanary.env, write a runtimedocker-compose.yml, and maintain a Canary version marker. - Bumped Canary metadata to v1.5.0 and adjusted tile behavior to link into the new info page.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rootfs/standard/usr/share/mynode_apps/canary/www/templates/canary.html | New Canary-specific app info template including credentials UI and copy-to-clipboard behavior. |
| rootfs/standard/usr/share/mynode_apps/canary/www/python/canary.py | New Flask handler for /app/canary/info that reads the stored password and version marker and renders the Canary template. |
| rootfs/standard/usr/share/mynode_apps/canary/scripts/uninstall_canary.sh | Updates uninstall flow to use app directory paths, remove Canary images, and clean up version marker and data dir. |
| rootfs/standard/usr/share/mynode_apps/canary/scripts/pre_canary.sh | Generates persistent secrets + env file and writes docker-compose.yml at service pre-start. |
| rootfs/standard/usr/share/mynode_apps/canary/scripts/install_canary.sh | Pins install to v1.5.0 images, writes docker-compose.yml, writes version marker, and triggers app refresh. |
| rootfs/standard/usr/share/mynode_apps/canary/canary.json | Updates latest version and adds tile button text/href to reach the new info page. |
| rootfs/standard/usr/share/mynode_apps/canary/app_data/docker-compose.yml | Adds env_file reference to support injected secrets. |
| cd "$APP_DIR" 2>/dev/null || true | ||
| /usr/local/bin/docker-compose down --remove-orphans 2>/dev/null || true |
| VERSION_FILE="/mnt/hdd/mynode/settings/canary_version" | ||
| VERSION="${VERSION:-$(cat "$VERSION_FILE" 2>/dev/null || echo v1.5.0)}" |
|
|
||
| echo "$VERSION" > "$VERSION_FILE" | ||
| chown bitcoin:bitcoin "$VERSION_FILE" | ||
| touch /tmp/need_application_refresh |
There was a problem hiding this comment.
Lines 67-69 should not be necessary along with 12-14. You should already be in the app dir during install time. Can you remove those?
| JWT_SECRET_FILE="$DATA_DIR/jwt_secret" | ||
| ENV_FILE="$DATA_DIR/canary.env" | ||
|
|
||
| write_compose_file() { |
There was a problem hiding this comment.
The compose file should not need to be written again. I'm fine with writing as part of a pre-startup script, but it should be done in one place or as part of an app_data file.
| remove_docker_images_by_name "canary-frontend" | ||
| remove_canary_images | ||
|
|
||
| rm -f "$VERSION_FILE" |
There was a problem hiding this comment.
Remove all this. Why are you managing version files? That's all handled by the platform.
|
|
||
| rm -f "$VERSION_FILE" | ||
| rm -rf /mnt/hdd/mynode/canary | ||
| touch /tmp/need_application_refresh |
|
Thanks for the feedback. I updated the Canary v1.5.0 changes to align with the existing myNode app lifecycle behavior. Summary of changes:
Validated locally:
|
|
Thanks! I'll merge this now. Was there a reason for the |
|
Thanks for merging the Canary v1.5.0 update to master. Good question. For the normal myNode app-manager path, I agree That fallback was added while debugging sideload/manual package testing. At one point Canary showed After your earlier feedback, we removed the Canary-specific version marker handling and now rely on myNode’s app version marker. One related thing I’m still seeing during sideload testing is |
|
No problem. Yeah, if you can reproduce just that and log an issue that may be helpful. Sideloading apps is really very rare though once an app makes it into the app store. Even for development, I normally add the app to the main source inthe repo and update by running |
|
Thanks. I was able to reproduce and gather more detail. Environment: myNode What happened:
My interpretation: there were two things interacting here. The original install failed because the Canary scripts used |
|
Follow-up: I addressed the myNode feedback in the new Canary v1.5.1 PR. The fix is now committed on #1004 as That commit removes Canary’s dependency on |
Summary
/mnt/hdd/mynode/canarycanary.enverrorapp_dataat runtimeTesting
mynode-sdk build canarybash -nfor install/pre/uninstall scriptspython3 -m py_compile canary/www/python/canary.pyadmin@localand a generated password