Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap: Allow access to SSH keys and $HOME/.cache/hugo #11288

Closed
jmooring opened this issue Jul 27, 2023 · 5 comments · Fixed by #11289
Closed

snap: Allow access to SSH keys and $HOME/.cache/hugo #11288

jmooring opened this issue Jul 27, 2023 · 5 comments · Fixed by #11289

Comments

@jmooring
Copy link
Member

jmooring commented Jul 27, 2023

Access to SSH keys is required when users have configured Git to use SSH. For example:

[url "git@github.com:"]
  insteadOf = https://github.com/

See https://discourse.gohugo.io/t/error-failed-to-load-modules/45477/

Access to $HOME/.cache/hugo_cache is required in support of #11286.

Both require approval from the Snapcraft team:
https://forum.snapcraft.io/t/hugo-auto-connect-ssh-keys-and-dot-cache-hugo/36123

@jmooring jmooring self-assigned this Jul 27, 2023
jmooring added a commit to jmooring/hugo that referenced this issue Jul 27, 2023
@jmooring jmooring changed the title snap: Allow access to SSH keys and $HOME/.config/hugo snap: Allow access to SSH keys and $HOME/.cache/hugo Jul 27, 2023
@jmooring
Copy link
Member Author

jmooring commented Aug 3, 2023

The updated Snap package is now available on the "edge" channel. It will be available on the "stable" channel with the next Hugo release. To update your Snap installation to the latest "edge" release:

sudo snap refresh hugo --edge

Read/write access to $HOME/.cache/hugo_cache is enabled by default (auto-connect).

To enable or revoke access to SSH keys ($HOME/.ssh):

sudo snap connect hugo:ssh-keys
sudo snap disconnect hugo:ssh-keys

This is a persistent setting.

See https://gohugo.io/installation/linux/#snap

@DazWilkin
Copy link

Thank you!

sudo snap version
snap    2.59.5
snapd   2.59.5
series  16
ubuntu  22.04
kernel  5.15.0-1041-realtime

sudo snap list | grep hugo
hugo                            0.115.4                     16794  extended/stable   hugo-authors         -

sudo snap refresh hugo --edge
hugo (extended/edge) 0.115.4+git2.739d10e8 from Hugo Authors refreshed

sudo snap connect hugo:ssh-keys
error: snap "hugo" has no plug named "ssh-keys"

NOTE plug (sic)

@jmooring
Copy link
Member Author

jmooring commented Aug 3, 2023

When I refresh I get 0.116.1...

sudo snap refresh hugo --edge
hugo (edge) 0.116.1+git3.8fa8ce3e4 from Hugo Authors refreshed

Not sure why yours isn't refreshing. Try:

sudo snap remove hugo
sudo snap install hugo --edge

@DazWilkin
Copy link

That worked; I needed to sudo snap remove hugo first to get 0.116.1...

I've reverted git config to include:

[url "git@github.com:"]
        insteadOf = https://github.com/

And I'm able to deploy.

Thank you for the excellent support!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants