#21 - Replace Lens with Freelens in the coder-xfce-vnc variant #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "21-replace-lens-with-freelens"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Replace Lens (k8slens, proprietary) with Freelens in the
coder-xfce-vncvariant. Freelens is the MIT-licensed community fork of OpenLens. It's installed from Freelens's official APT repo and set up the same way Lens was: a wrapper that adds the flags needed in the pod, plus a desktop-entry override.Changes
Dockerfile: the Lens block is replaced by a Freelens block.50B1 BA0A AF45 14AE 56F9 9AC4 8B2A 569C D2EE ECC1is checked before the key is trusted, the same check the Claude Desktop block does.test -x "$(readlink -f /usr/bin/freelens)"checks that theupdate-alternativesentry point exists.freelens.desktopis generated withsedfrom the packaged entry:Execpoints to/usr/local/bin/freelens(upstream's own flags are kept),Categories=Development;. Both changes are checked withgrep.COPYnow ships the Freelens wrapper, and the comments that mentioned Lens elsewhere are updated.scripts/lens-desktop-wrapper.sh→scripts/freelens-wrapper.sh: same wrapper (ELECTRON_DISABLE_SANDBOX=1+--disable-dev-shm-usage), now pointing at/usr/bin/freelens.scripts/coder-init-desktop.sh: I removed the code that cleaned up stale user-local Lens menu entries. It only ran when the Lens wrapper existed, so with Lens gone it could never run again. Its note on why entries are renamed to.baknow sits on the Claude Desktop cleanup code.README.md: Lens → Freelens in the app list, the Electron section (the heading anchor changed, and every link to it is updated), thecoder-init-desktopdocs, and Version Information. A~/.config/Freelens/row is added to the persisted-state table.One design point worth reviewing: where the repo is defined
The Freelens repo is not set up like the Azul/Mozilla/Claude repos (
/usr/share/keyrings/*+ a.listfile). The freelens deb installs its own/etc/apt/keyrings/freelens.ascand/etc/apt/sources.list.d/freelens.sourcesas conffiles. If the repo were defined anywhere else, apt would see the same source twice with two differentSigned-Bypaths. That fails every laterapt-get update, including the Claude Desktop step right after it and anysudo apt updatein a workspace. I checked this in a pod:So the block writes the key and a deb822 source file at exactly those paths. The source file is byte-identical to the one the package ships.
--force-confdef --force-confoldmeans that if the key bundled in the deb ever differs from the fingerprint-checked one, the build keeps ours instead of stopping at a conffile prompt.The repo is served from GitHub's
releases/latestdownload URL, so every build installs the current Freelens release (currently 1.10.3) with no manual version bump. That's the same always-latest approach as Toolbox and Nimbalyst. APT still checks the signedReleasefile.Verification
I pulled the
RUNstep out of the Dockerfile with a script and ran it in anubuntu:24.04pod on the cluster:apt-get install freelens1.10.3/usr/bin/freelensalternative/opt/Freelens/freelens.dpkg-dist/.dpkg-oldfiles)Exec/Categorieschecksapt-get updateafter installW:/E:linesSigned-Byshellcheckpasses onfreelens-wrapper.shandcoder-init-desktop.sh. The branch push also starts thedocker-devKaniko build.Not verified: actually running Freelens inside the VNC session, which needs a real desktop. It's an Electron app with the same two failure modes the wrapper already handles for Lens and Claude Desktop, so I expect it to work, but that's inference. Worth a smoke test once the image is built.
Notes
~/.config/Freelens/, not Lens's~/.config/Lens/, so clusters added in Lens won't show up automatically.~/.kube/configis read as usual. The old~/.config/Lens/directory stays on the PVC untouched.unshare: unshare failed: Operation not permittedand then setschrome-sandboxsetuid. That's harmless here:ELECTRON_DISABLE_SANDBOX=1still applies, as with Claude Desktop.Closes #21
🤖 Generated with Claude Code
https://claude.ai/code/session_01XPajGyTH2js52mY5WSJoNA
b3b3b95e2aaf5014544fNew commits pushed, approval review dismissed automatically according to repository settings
af5014544fd6cf824b06d6cf824b06e163c2a591e163c2a591a6f3310f7c