snap: add initial snap packaging - #30
LucasAPayne wants to merge 2 commits into
Conversation
667364b to
d92244e
Compare
Add the initial snap packaging for the application. The snap currently builds and installs successfully, but additional work is required before it is fully functional. In particular, the systemd service needs to be replaced with a snap service when built as a snap, and default configuration needs to be made available through an appropriate path for strict confinement.
d92244e to
a5fe1c1
Compare
|
Thanks @LucasAPayne. I dont have permissions to start a review but this looks good to me as an initial template. Could you add a note to the PR description making it clear that automatic unlock on boot will not work with the snap as part of this change? |
|
Thank you for calling that out @Raven-182; I have updated the description. |
freyes
left a comment
There was a problem hiding this comment.
Please add a new workflow to exercise this functionality
The new workflow should have (at least) the following steps:
- build the snap - https://github.com/marketplace/actions/snapcraft-action
- install it
- connect the interfaces, if needed
- run the
--helpcommand, and any other commands that can help to validate the snap is functional
| _udevadm_rescan.assert_called_once_with('/dev/sdb') | ||
| _udevadm_settle.assert_called_once_with('passed-UUID') | ||
|
|
||
| # TODO(lucas): Temporarily disabled for initial snap packaging |
There was a problem hiding this comment.
question: do you have a jira ticket or a note to enable this test assert and the code in shell.py?
There was a problem hiding this comment.
The acceptance criteria in my next ticket for this snap includes re-enabling or entirely removing the udev calls. This was originally added as a workaround to ensure device UUIDs could be picked up in old Ubuntu/cryptsetup versions, and it's likely no longer needed.
c6ea3fe to
9847c21
Compare
9847c21 to
b0f240e
Compare
This PR provides an initial snap build for vaultlocker. The snap uses strict confinement and needs the
network,dm-crypt, andblock-devicesconnections. This is just an initial build to allow making a snap recipe and getting this on the snap store, and there will be a follow-up PR to address any issues or anything missing.Most notably, vaultlocker currently creates a
systemdservice for each registered encrypted device to allow automatic unlocking on boot. The snap cannot create asystemdservice, and it will instead need a snap service to manage these devices. The device is still able to be controlled over the CLI; it's only the automatic unlocking that is currently affected. Becausesystemdappears in so many tests and has no effect on the snap other than printing an error, I have left it enabled. So while manually testing the snap, it will complain about thesystemdservice, but this does not prevent anything else from working. A follow-up PR will ensure thesystemdservice is used for a non-snap installation and the snap service is used for a snap installation.Note that until the snap service is implemented, automatic unlock on boot will not work for the snap.
The
udev admcalls that previously occurred during encryption have also been disabled. The snap cannot issue these commands. These commands were added as a workaround for an issue in older Ubuntu versions, and at least on Noble, the issue no longer occurs. A determination should be made whether these commands can be removed entirely.Also, the snap will not use the default configuration path of
/etc/vaultlocker/vaultlocker.conf. For now, the snap requires explicitly passing a config file with the--configoption. This will also be addressed in a follow-up PR.How to Test
Setup:
Install the snap based on this branch
Add the required snap connections
approleandsecret_idfields with the values from the previous step.Encrypt the device:
Verify that the device is now LUKS-formatted.
Links
Jira card: OPEN-4713