-
@ 5b730fac:9e746e2a
2025-05-09 09:25:59Currently on
v0.0.4
:root@OpenWrt:/tmp# opkg list-installed | grep "tollgate" tollgate-module-basic-go - v0.0.4
Stop the janitor:
root@OpenWrt:/tmp# service tollgate-basic stop root@OpenWrt:/tmp# service tollgate-basic status inactive
Test update with deleted config files
Trigger new version:
c03rad0r@CobradorRomblonMimaropa:~/Documents/test-stable-release-channel$ git push origin v0.0.5 Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 To https://github.com/c03rad0r/test-stable-release-channel.git * [new tag] v0.0.5 -> v0.0.5
Delete the config files:
root@OpenWrt:/tmp# rm /etc/tollgate/config.json /etc/tollgate/install.json root@OpenWrt:/tmp# ls /etc/tollgate/config.json /etc/tollgate/install.json ls: /etc/tollgate/config.json: No such file or directory ls: /etc/tollgate/install.json: No such file or directory
Start janitor again:
root@OpenWrt:/tmp# service tollgate-basic start root@OpenWrt:/tmp# service tollgate-basic status running
Trusted maintainer is wrong:
root@OpenWrt:/tmp# cat /etc/tollgate/config.json | jq { "tollgate_private_key": "8a45d0add1c7ddf668f9818df550edfa907ae8ea59d6581a4ca07473d468d663", "accepted_mints": [ "https://mint.minibits.cash/Bitcoin", "https://mint2.nutmix.cash" ], "price_per_minute": 1, "bragging": { "enabled": true, "fields": [ "amount", "mint", "duration" ] }, "relays": [ "wss://relay.damus.io", "wss://nos.lol", "wss://nostr.mom", "wss://relay.tollgate.me" ], "trusted_maintainers": [ "5075e61f0b048148b60105c1dd72bbeae1957336ae5824087e52efa374f8416a" ], "fields_to_be_reviewed": [ "price_per_minute", "relays", "tollgate_private_key", "trusted_maintainers" ], "nip94_event_id": "unknown" } root@OpenWrt:/tmp# cat /etc/tollgate/install.json | jq { "package_path": "false", "ip_address_randomized": "false", "install_time": 0, "download_time": 0, "release_channel": "stable", "ensure_default_timestamp": 1746781145 }
Fixed trusted maintainer and restarted service. Now it updates:
Fri May 9 09:01:45 2025 daemon.info tollgate-basic[8705]: Started the timer Fri May 9 09:01:45 2025 daemon.info tollgate-basic[8705]: Intersection: [basic-gl-mt3000-aarch64_cortex-a53.ipk-v0.0.5] Fri May 9 09:01:45 2025 daemon.info tollgate-basic[8705]: Right Time Keys: [basic-gl-mt3000-aarch64_cortex-a53.ipk-v0.0.5] Fri May 9 09:01:45 2025 daemon.info tollgate-basic[8705]: Right Arch Keys: [basic-gl-mt3000-aarch64_cortex-a53.ipk-v0.0.5] Fri May 9 09:01:45 2025 daemon.info tollgate-basic[8705]: Right Version Keys: [basic-gl-mt3000-aarch64_cortex-a53.ipk-v0.0.5] Fri May 9 09:01:55 2025 daemon.err tollgate-basic[8705]: 2025/05/09 09:01:55.064780 Timeout reached, checking for new versions Fri May 9 09:01:55 2025 daemon.info tollgate-basic[8705]: Sorted Qualifying Events Keys: [basic-gl-mt3000-aarch64_cortex-a53.ipk-v0.0.5] Fri May 9 09:01:55 2025 daemon.info tollgate-basic[8705]: Newer package version available: v0.0.5 Fri May 9 09:01:55 2025 daemon.info tollgate-basic[8705]: Downloading package from https://blossom.swissdash.site/af1c7b75440859d8a3ee93e0612b77e8ce1abc3496f580e72c969032395b2c66.ipk to /tmp/af1c7b75440859d8a3ee93e0612b77e8ce1abc3496f580e72c969032395b2c66.ipk Fri May 9 09:01:56 2025 daemon.info tollgate-basic[8705]: Package downloaded successfully to /tmp/ Fri May 9 09:01:56 2025 daemon.info tollgate-basic[8705]: New package version is ready to be installed by cronjob Fri May 9 09:01:56 2025 daemon.err tollgate-basic[8705]: 2025/05/09 09:01:56.845394 Verifying package checksum Fri May 9 09:01:56 2025 daemon.err tollgate-basic[8705]: 2025/05/09 09:01:56.854767 Package checksum verified successfully
Version was updated correctly:
root@OpenWrt:~# opkg list-installed | grep "tollgate" tollgate-module-basic-go - v0.0.5
Try again without manually setting maintainer
v0.0.5
has the test maintainer set by default:c03rad0r@CobradorRomblonMimaropa:~/Documents/test-stable-release-channel$ git diff v0.0.4 diff --git a/src/config_manager/config_manager.go b/src/config_manager/config_manager.go index 92d9f28..398d2da 100644 --- a/src/config_manager/config_manager.go +++ b/src/config_manager/config_manager.go @@ -400,7 +400,7 @@ func (cm *ConfigManager) EnsureDefaultConfig() (*Config, error) { "wss://relay.tollgate.me", }, TrustedMaintainers: []string{ - "5075e61f0b048148b60105c1dd72bbeae1957336ae5824087e52efa374f8416a", + "c0757f43081aa96a8733b58fb7f745d8c784ecdfc02477a1b7b99e35416fff0b", }, FieldsToBeReviewed: []string{ "price_per_minute",
v0.0.5
is currently installed:root@OpenWrt:~# opkg list-installed | grep "tollgate" tollgate-module-basic-go - v0.0.5
Stop the service:
root@OpenWrt:~# service tollgate-basic stop root@OpenWrt:~# service tollgate-basic status inactive
Trigger a new build:
{ "id": "98f5e850f3aff389dd0591fe16f13738970bed1cbcc240f20f09d50e482fe707", "pubkey": "c0757f43081aa96a8733b58fb7f745d8c784ecdfc02477a1b7b99e35416fff0b", "created_at": 1746781775, "kind": 1063, "content": "TollGate Module Package: basic for gl-mt3000", "tags": [ [ "url", "https://blossom.swissdash.site/700bfb2e1788d8f42c89492562e8503979761ef7d07b7a412f6d9334d7f24f6f.ipk" ], [ "m", "application/octet-stream" ], [ "x", "700bfb2e1788d8f42c89492562e8503979761ef7d07b7a412f6d9334d7f24f6f" ], [ "ox", "700bfb2e1788d8f42c89492562e8503979761ef7d07b7a412f6d9334d7f24f6f" ], [ "filename", "basic-gl-mt3000-aarch64_cortex-a53.ipk" ], [ "architecture", "aarch64_cortex-a53" ], [ "version", "v0.0.6" ], [ "release_channel", "stable" ] ] }
Delete config files and start janitor:
root@OpenWrt:~# rm /etc/tollgate/config.json /etc/tollgate/install.json root@OpenWrt:~# ls /etc/tollgate/config.json /etc/tollgate/install.json ls: /etc/tollgate/config.json: No such file or directory ls: /etc/tollgate/install.json: No such file or directory
Started service:
root@OpenWrt:~# service tollgate-basic status inactive root@OpenWrt:~# service tollgate-basic start root@OpenWrt:~# service tollgate-basic status running
Config files set successfully:
root@OpenWrt:~# cat /etc/tollgate/config.json | jq { "tollgate_private_key": "8a45d0add1c7ddf668f9818df550edfa907ae8ea59d6581a4ca07473d468d663", "accepted_mints": [ "https://mint.minibits.cash/Bitcoin", "https://mint2.nutmix.cash" ], "price_per_minute": 1, "bragging": { "enabled": true, "fields": [ "amount", "mint", "duration" ] }, "relays": [ "wss://relay.damus.io", "wss://nos.lol", "wss://nostr.mom", "wss://relay.tollgate.me" ], "trusted_maintainers": [ "c0757f43081aa96a8733b58fb7f745d8c784ecdfc02477a1b7b99e35416fff0b" ], "fields_to_be_reviewed": [ "price_per_minute", "relays", "tollgate_private_key", "trusted_maintainers" ], "nip94_event_id": "unknown" } root@OpenWrt:~# cat /etc/tollgate/install.json | jq { "package_path": "false", "ip_address_randomized": "false", "install_time": 0, "download_time": 0, "release_channel": "stable", "ensure_default_timestamp": 1746781946 }
Not picking up new version. Perhaps due to default timestamp:
root@OpenWrt:~# cat /etc/tollgate/install.json | jq { "package_path": "false", "ip_address_randomized": "false", "install_time": 0, "download_time": 0, "release_channel": "stable", "ensure_default_timestamp": 1746781946 }
We only consider the incoming event in
janitor.go
if the events timestamp is greater than that of the config file:timestampConfig, err := configManager.GetTimestamp() if err != nil { log.Printf("Error getting timestamp: %v", err) continue } if timestamp > timestampConfig { rightTimeKeys = append(rightTimeKeys, key) }
Re-ran the workflow to generate the event again with a newer timestamp:
{ "id": "d30f92cdacf453bede2bd36d62231fc40b226cc183239f5daf724829d81bd192", "pubkey": "c0757f43081aa96a8733b58fb7f745d8c784ecdfc02477a1b7b99e35416fff0b", "created_at": 1746782339, "kind": 1063, "content": "TollGate Module Package: basic for gl-mt3000", "tags": [ [ "url", "https://blossom.swissdash.site/700bfb2e1788d8f42c89492562e8503979761ef7d07b7a412f6d9334d7f24f6f.ipk" ], [ "m", "application/octet-stream" ], [ "x", "700bfb2e1788d8f42c89492562e8503979761ef7d07b7a412f6d9334d7f24f6f" ], [ "ox", "700bfb2e1788d8f42c89492562e8503979761ef7d07b7a412f6d9334d7f24f6f" ], [ "filename", "basic-gl-mt3000-aarch64_cortex-a53.ipk" ], [ "architecture", "aarch64_cortex-a53" ], [ "version", "v0.0.6" ], [ "release_channel", "stable" ] ] }
Indeed, that was the issue:
root@OpenWrt:~# opkg list-installed | grep "tollgate" tollgate-module-basic-go - v0.0.6
Unfortunately, we can't do much about it, because all the more relevant timestamps were deleted when the config file was deleted. At-least we have this default timestamp to fall back on. Considering this test successful..
New config files:
root@OpenWrt:~# cat /etc/tollgate/config.json | jq { "tollgate_private_key": "8a45d0add1c7ddf668f9818df550edfa907ae8ea59d6581a4ca07473d468d663", "accepted_mints": [ "https://mint.minibits.cash/Bitcoin", "https://mint2.nutmix.cash" ], "price_per_minute": 1, "bragging": { "enabled": true, "fields": [ "amount", "mint", "duration" ] }, "relays": [ "wss://relay.damus.io", "wss://nos.lol", "wss://nostr.mom", "wss://relay.tollgate.me" ], "trusted_maintainers": [ "c0757f43081aa96a8733b58fb7f745d8c784ecdfc02477a1b7b99e35416fff0b" ], "fields_to_be_reviewed": [ "price_per_minute", "relays", "tollgate_private_key", "trusted_maintainers" ], "nip94_event_id": "98f5e850f3aff389dd0591fe16f13738970bed1cbcc240f20f09d50e482fe707" } root@OpenWrt:~# cat /etc/tollgate/install.json | jq { "package_path": "/tmp/700bfb2e1788d8f42c89492562e8503979761ef7d07b7a412f6d9334d7f24f6f.ipk", "ip_address_randomized": "192.168.70.1", "install_time": 1746782401, "download_time": 1746782354, "release_channel": "stable", "ensure_default_timestamp": 1746781946, "update_path": null }