k03rader's avatar
k03rader
npub1k03r...8rty
Your local ISP
k03rader's avatar
k03rader 11 months ago
### Using the image-builder in practice Earlier we explained the ins and outs of building packages and images for OpenWRT. Now lets actually build a package rather than just talking about it. ##### Lets clone the image-builder ``` git clone ``` ##### Lets install a tool to interact with blossom servers ``` curl -sSL https://raw.githubusercontent.com/OpenTollGate/tollgate-sdk/refs/heads/main/blossom-installer.sh | sudo bash ``` ##### Lets install a python library for interacting with nostr relays ``` pip3 install nostr ``` ##### Lets prepare a file containing the keys for these tools ``` cat blossom_secrets.json { "servers": [ "https://files.v0l.io/", "https://nostr.download/", "https://blossom.poster.place/" ], "relays": [ "wss://orangesync.tech", "wss://nostr.mom", "wss://nostr.chaima.info" ], "secret_key": "nsec[your_secret_key]", "secret_key_hex": "[hex_version_of_your_secret_key]", "public_key": "npub[your_public_key]", "public_key_hex": "[hex_version_of_your_public_key]" } ``` ##### Lets go! ``` ./build-firmware gl-mt3000 ``` The above script * downloads the OpenWRT image-builder * downloads your [custom packages]( from blossom * [installs all the packages]( in an OpenWRT image > [!Known bug] > You might get an error saying that the websocket connection to your nostr relays can't be opened. In that case, just abort and run the above command again. It often works on the second try. > ``` > DEBUG: Error getting event: socket is already closed. No valid events found for architecture: aarch64_cortex-a53 > ``` > Pull requests welcome.. ##### Are you winning? Eventually you should see the following output. This is the nostr event that your npub just broadcasted to announce that you compiled your custom feed successfully and that your packages are available on this listed blossom servers. Maybe @franzap has advice on how we can improve this workflow. ``` Number of ids (unique uids + gids) 1 Number of uids 1 unknown (0) Number of gids 1 unknown (0) Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144 compressed data, compressed metadata, compressed fragments, no xattrs, compressed ids duplicates are removed Filesystem size 64302.32 Kbytes (62.80 Mbytes) 24.24% of uncompressed filesystem size (265222.92 Kbytes) Inode table size 109854 bytes (107.28 Kbytes) 20.87% of uncompressed inode table size (526354 bytes) Directory table size 140778 bytes (137.48 Kbytes) 38.40% of uncompressed directory table size (366654 bytes) Number of duplicate files found 494 Number of inodes 16283 Number of files 14440 Number of fragments 371 Number of symbolic links 242 Number of device nodes 1 Number of fifo nodes 0 Number of socket nodes 0 Number of directories 1600 Number of hard-links 0 Number of ids (unique uids + gids) 1 Number of uids 1 unknown (0) Number of gids 1 unknown (0) 64302+1 records in 64303+0 records out 65846272 bytes (66 MB, 63 MiB) copied, 0.091405 s, 720 MB/s 64302+1 records in 64303+0 records out 65846272 bytes (66 MB, 63 MiB) copied, 0.091405 s, 720 MB/s /tmp/openwrt-build/openwrt-imagebuilder-23.05.3-mediatek-filogic.Linux-x86_64/staging_dir/host/bin/tar: Option --mtime: Treating date '@1711145382' as 2024-03-22 23:09:42 sysupgrade-glinet_gl-mt3000/ sysupgrade-glinet_gl-mt3000/CONTROL sysupgrade-glinet_gl-mt3000/kernel /tmp/openwrt-build/openwrt-imagebuilder-23.05.3-mediatek-filogic.Linux-x86_64/staging_dir/host/bin/tar: Option --mtime: Treating date '@1711145382' as 2024-03-22 23:09:42 sysupgrade-glinet_gl-mt3000/ sysupgrade-glinet_gl-mt3000/CONTROL sysupgrade-glinet_gl-mt3000/kernel sysupgrade-glinet_gl-mt3000/root sysupgrade-glinet_gl-mt3000/root Calculating checksums... Calculating checksums... Build successful! Firmware image created at: Image size (62.7952 62.7952MB) /tmp/openwrt-build/openwrt-imagebuilder-23.05.3-mediatek-filogic.Linux-x86_64/bin/targets/mediatek/filogic/openwrt-23.05.3-mediatek-filogic-glinet_gl-mt3000-squashfs-sysupgrade.bin ``` image ##### How do I install this thing? Copy the `sysupgrade.bin` file to the `/tmp` directory of your router. ``` scp /tmp/openwrt-build/openwrt-imagebuilder-23.05.3-mediatek-filogic.Linux-x86_64/bin/targets/mediatek/filogic/openwrt-23.05.3-mediatek-filogic-glinet_gl-mt3000-squashfs-sysupgrade.bin root@[routers-ip-address]:/tmp ``` > [!NOTE] > The `/tmp` directory is part of your device's RAM rather than its (small) flash storage, so it should have a lot of space for such binaries. Now lets install it ``` sysupgrade -n [your-sysupgrade-file].bin ``` Please leave your router plugged in and give it a minute or two of time to install the new image. It might show up with a new IP address and you will be prompted to delete the old router from your cached `ssh` keys when you try to log in to it. ##### How can you help? #help * do you know how to make git actions for this? * we are [struggling](View quoted note →) to build images for the `gl-ar300m` target. This might be connected with the fact that there are two similar devices (`gl-ar300m` and `gl-ar300m16`) that don't have the exact same architecture * have you fixed that bug already? * please DM us if you have questions or your looking for other ways to contribute
k03rader's avatar
k03rader 11 months ago
Any recommendations for VoIP solutions? #asknostr ---- Context: I love @https://silent.link, but it gets expensive if you want to have a phone number or perhaps even rotate it once in a while.. Also, my understanding is that it's better for privacy to buy data from silent.link and to use VoIP for phone calls...
k03rader's avatar
k03rader 11 months ago
When I publish markdown containing strings of the form `@npub...` in Amethyst, the npubs aren't always rendered. Sometimes only a portion of them is rendered and sometimes none of them is rendered. Editing the event only seems to make it worse.. What's the right way to do this? #asknostr
k03rader's avatar
k03rader 11 months ago
## CW4 Review Last week I worked mostly on getting how we build go binaries for OpenWRT targets in TollGate. In the past we used to modify the feeds and filesystem of OpenWRT and build the entire operating system from scratch to get an image - which took ages - each time we wanted to try something. ### Building golang with the SDK #### Why the SDK? It turns out that there is an SDK that allows us to just build code from our custom feed for an OpenWRT target without needing to build everything else every time as well. #### Why golang? We started using go recently, because @Arjen had already shown that we can run the [khatru](https://github.com/fiatjaf/khatru) relay on the `GL-AR300m` in November last year. Having the ability to simply run nostr tooling on routers is huge, because it unlocks this whole [new architecture](View quoted note →). #### Whats new in CW4? ##### Building our modules for multiple targets Fortunately, I was able to build all of the `crowsnest`, `relay`, `whoami`, `merchant` and `valve` using a custom feed in the SDK. In future this should enable us to use steps from the module's makefiles to configure the routers as a module is installed. A nice pirk is that we can easily specify which router to build the binaries for, so we no longer need to force our users to use the `GL-AR300m` or the `GL-MT3000`. Please do bring some know-how and patience if you choose to deviate from the well trodden path though.. ### Building OpenWRT images with the image-builder Last year @Simon Tennant contributed some code that made it really easy to generate OpenWRT images for multiple different routers within minutes using the OpenWRT image-builder. This makes it easy for us to pre-install packages in the OpenWRT image and to generate images for multiple different routers without needing to compile all the dependencies ourselves. #### Whats new in CW4? Runners that build TollGate modules using the SDK now upload the binaries to blossom and they publish an event listing the blossom servers that host each of these binaries. The image-builder downloads the right `ipk` files from blossom and installs them in the OpenWRT image. ### Outlook TollGates that want to update their modules just need a module that scrapes for these announcement events, downloads the `ipk` files and performs the updates. This client still needs to be made, but first I hope to create GitHub actions for what we have here, so that it can run in the [runner](View article →) that @Arjen and @AU9913 built.
k03rader's avatar
k03rader 11 months ago
What's the best tool for video calls these days? Jitsi seems to be buggy when a third person joins the call.. #asknostr