Repository navigation
Description
There's some outstanding problems with our use of the strict enclosure for the Snap installer:
- Terminal and Atom cannot be opened when strict confinement is enabled #95
- Icon and button style issues with file explorer #98
- AppArmor policy error accessing password manager #59
Essentially, a Snap in a strict enclosure is not able to launch any processes outside it sandbox. This affects some of the important integration for Desktop, such as being able to launch your configured editor or shell.
After talking it over with various Snap team members there appears to be no easy solution for this, other than switching enclosures. But that in itself is a really hard problem, because there's no way to upgrade a package which changes it's enclosure setting from strict to classic (which is basically unrestricted). This is why we've temporarily disabled the listing on the Snap store to prevent more people installing this app and then facing this problem: #108
The solution we have figured out is a bit rough, but looks like this (paraphrasing an earlier discussion with @flexiondotorg about this):
Preparations
- ✅Make a request for GitHub Desktop to be approved to use classic confinement
- ✅Create a branch named
snap-strict-enclosure. This will contain the old version with thestrictconfinement that we need to use later. - ✅ Create a pull request to restore the
classicconfinement: revert to using classic confinement for snap #117 - ✅ Create a pull request to add a prompt for users running
edgewith thestrictenclosure to manually migrate to thebetachannel with theclassicenclosure: in-app migration guide for Snap installs #118
This Week
- ✅ Friday 29th March
- Merge revert to using classic confinement for snap #117 into
linux - bump the version to
release-1.6.5-linux6 - tag and publish from
linuxto thebetachannel - confirm the version in the
betachannel is working as expected with the classic enclosure
- Merge revert to using classic confinement for snap #117 into
Next Week
- ✅ Monday 1st April -> Sunday 7th April
- add documentation to README about Snap migration - update section about snap store #135
- Merge in-app migration guide for Snap installs #118 into
snap-strict-enclosure - bump the version to
release-1.6.5-linux7so it is ahead ofbeta - tag and publish the snap from
snap-strict-enclosureto theedgechannel - as strict enclosure is unable to invoke
spawnSyncwe need a more robust way to detect the versions installed onedge - confirm the version in the
edgechannel is working as expected - make the snap public again so new users can install (either from
edgeorbeta) - closes Snap missing from Snapcraft.io? #108 Terminal and Atom cannot be opened when strict confinement is enabled #95 Icon and button style issues with file explorer #98 AppArmor policy error accessing password manager #59
At this point existing users of the edge channel will receive the update and see the notification to transition manually to the beta channel.
Post-Migration
- allow time for
edgeinstalls to migrate themselves over tobeta - at some point, publish a version on
edgethat uses the classic enclosure - cleanup the Snap migration warning once a sufficient % of users have migrated
Activity
shiftkey commentedon Feb 7, 2019
@flexiondotorg is there anything I can do to move this along? All the subsequent work is not possible currently...
shiftkey commentedon Mar 27, 2019
I've refreshed the issue body to reflect the current state of affairs, and hopefully on Friday I can start the migration process.
flexiondotorg commentedon Mar 27, 2019
@shiftkey Looks like you've got everything covered in the sequence of events.
shiftkey commentedon Mar 29, 2019
This is on hold at the moment because the package gets rejected on publish with this message:
This is the new config we are using to build the snap, and I'm not sure at a glance what I should be changing in here:
desktop/script/electron-builder-linux.yml
Lines 40 to 48 in 51694bf
I'll see if I can troubleshoot more over the weekend...
EDIT: should be addressed with 2af83f5
EDIT 2: ugh, now it's a different error
EDIT 3: I've isolated the issue to electron-userland/electron-builder#2730 which linked off to a workaround about manually editing
snap.yamland repackaging the app, which was done in 0ca1184. Then I needed to refresh my access token to supportbetapublishing, so hopefully-linux6is the lucky one.EDIT 4: we have a working beta version, aiming to do some testing this week and confirm it's working as expected..
shiftkey commentedon Apr 1, 2019
Did a quick test pass of the first run and integrations with the latest
betaand everything looks fine. I opened #134 to track the protocol handler integration, as the earlier work in #110 to support this with the.debpackage is not relevant here.shiftkey commentedon Apr 1, 2019
Pausing this because my earlier idea to "just spawn
snap" here worked in development but not in the strict enclosure after publishing toedge:desktop/app/src/ui/snap-migration-guide/detect-snap-install.ts
Lines 10 to 15 in 320181c
I have an idea to read
process.execPathwhich will give me:I can whitelist versions that we've published to
betato ignore part of this check, which can be obtained by runningsnapcraft revisions --arch amd64 github-desktop. I don't plan to publish the same build to multiple channels during this transition period, so I think this is fine.shiftkey commentedon Apr 5, 2019
After poking at available information for
betaandedgechannels I noticed a predictable differentiator between the two environments: in thestrictenclosure the--disable-gpu-compositingflag is passed into the renderer process:I haven't been able to find the relevant part of the toolchain that's responsible for this, but it seems a pretty reliable indicator of the environment, rather than hard-coding versions which aren't known until they're published to the store.
EDIT: this was a red herring, and not something controlled by the channel - likely Electron itself detecting GPU compositing was disabled at the time (power saving)? Oh well, the
snap-strict-enclosurebranch is not intending to be merged back into the main branch here, so the original naive patch can remain.[-]migration process from strict to classic enclosure[/-][+][snap] migration process from strict to classic enclosure[/+][-][snap] migration process from strict to classic enclosure[/-][+][snap] migration from strict to classic enclosure[/+]shiftkey commentedon Apr 7, 2019
I've tested out the
edgeupgrade warning the user and asking the user to change to thebetachannel, so I've now made the snap public again and updated the related issues with notes about the migration process.I'm going to let this issue sit a bit and monitor for feedback.
flexiondotorg commentedon Apr 7, 2019
Thanks for working on this. I'll be installing it when I get home 👍😀
shiftkey commentedon May 30, 2019
It's been almost 2 months since I did the cutover to beta and published the dialog about getting people to migrate from
edgetobeta. We had almost 400 installs at the time:Fast-forward to today and we still have 300+ active installs of
edge:I was really hoping that this number would be much lower, as I'd love to start exploring using
edgeas a preview channel for things like Electron upgrades and experimentation. But I can't do that if users are ignoring the warning and still running the wrong enclosure.A few ideas to make this more aggressive and see if it helps move people off
edge:flexiondotorg commentedon May 31, 2019
It seems a more heavy handed approach is indeed required. Anything we can do to help?
shiftkey commentedon May 31, 2019
@flexiondotorg not really, just gearing up for another release next week but I guess that's gonna skip Edge 🤷♂
zypA13510 commentedon Jun 26, 2019
How do you count active installs?
Because coming to this repository today to install it on a new system, I come to realize that I had an old install that hasn't been used for at least 3 months, but the system is regularly maintained. If these were counted then I think it's probably normal?
shiftkey commentedon Jun 26, 2019
@zypA13510
This is a question for the Snapcraft team. I can't answer this.
NatoBoram commentedon Jul 9, 2019
Hello! I just upgraded to the
betachannel on a fresh Ubuntu 19.04 install following the prompt and I can't launch it anymore.I think it may explain why some users aren't switching.
immackay commentedon Jul 9, 2019
@NatoBoram, I am under the impression that there is an issue with the 2.1.0 release (snap version 63).
Can you downgrade to version 62? I believe there is no issues with it.
If you don't have version 62 cached, you can download it from the release assets here, and install it with
See #163 for more information
hackel commentedon Nov 30, 2019
You need to remove (or make optional) the requirement to run this with classic confinement. As far as I'm concerned, this defeats the whole point of using Snap. If I didn't want confinement, I would just install the .deb package. I am not installing some random code from Microsoft of all people with unconfined access to my system! I understand that this currently brings with it several limitations, but that's better than opening up my entire system to random code from the internet.
Eventually I'm sure snapd will have a proper interface for running external editors or whatever the issue is that motivated this change.
zypA13510 commentedon Dec 1, 2019
I can think of one way to make this optional - build another snap that's under strict confinement and publish it via a different name, e.g.
github-desktop-confined. However, I'm not sure this is worth the effort, see my points below.Yes, I agree that using snap without confinement is somewhat pointless, save for the auto-update. But, if you didn't want a GitHub Desktop with shell, editor and file explorer integration, what are you using GitHub Desktop for? View git tree?
gitk --allcan do just that (and more, like cherry-picking or tagging). Stage files for commit? Atom or whatever IDE you use will probably have that built-in or provided via a plugin. As far as I'm concerned, GitHub Desktop is more about integrating the workflow, and if those integration features are all missing, this defeats the whole point of using GitHub Desktop.It's not some random code, it's code in this repository that you can review or even build yourself. This is open-source, if you so desire, you can fork it and switch it back to strict confinement, build, install, and use it. No-one will keep you from doing that. The question is, should we build broken snap by default, what do most users expect?
And it's not just GitHub Desktop, vscode, atom, webstorm, sublime, android-studio they all do this, all of them requires classic confinement to function properly.
And if you don't trust the source, the best and only solution is to not run it. Would you run an email attachment from an unknown sender, even if in strict snap confinement? Would you run malware in a VM? Who knows it won't utilize some privilege-escalation vulnerability and break out of jail? At some point, you have to trust something.
That would be great and eventually we can switch back to strict confinement without this discussion.
shiftkey commentedon Apr 4, 2020
Just bumping this issue to indicate the package is unlisted on the Snapcraft store due to various issues and I have no timeline for restoring Snap support. #202 is tracking that work, and I'm blocked on doing any sort of local building or testing of snaps.
shiftkey commentedon Apr 21, 2022
Closing this out as I don't have the bandwidth to revisit this in the short or medium term. If someone else wants to have a shot at this I've added notes in #202 which are from the last time I thought about Snap packaging...