Installing hugo as snap on a Ubuntu Core system

I am using Ubuntu core 16.04.1 and the hugo snap hugo 0.18.1.

To get started with hugo I type: “hugo new site webpage” and the output is (see Output below).

The possibilities to tweak the system are limited in Ubuntu Core. I did the following:

  1. create the directory myself (worked)
  2. use option --force (worked, at least gave no negative result)

But after (2.) the directory “webpage” is empty.

Has anyone any idea?
Regards, Matthias

Output:

2017/01/12 14:45:36 mkdir /writable/user-data/matthias/webpage/: permission denied
panic: mkdir /writable/user-data/matthias/webpage/: permission denied

goroutine 1 [running]:
panic(0x668ef0, 0x10d247a8)
/usr/lib/go-1.6/src/runtime/panic.go:481 +0x330
log.Panicln(0x10d47a94, 0x1, 0x1)
/usr/lib/go-1.6/src/log/log.go:334 +0xa4
github.com/spf13/afero.WriteReader(0x7549c458, 0xb37f08, 0x10e63380, 0x37, 0x7549c2e0, 0x10e0dd20, 0x7549e0d8, 0x10e0dd60)
/build/hugo/parts/hugo/go/src/github.com/spf13/afero/util.go:49 +0x290
github.com/spf13/hugo/helpers.WriteToDisk(0x10e63380, 0x37, 0x7549c2e0, 0x10e0dd20, 0x7549c458, 0xb37f08, 0x0, 0x0)
/build/hugo/parts/hugo/go/src/github.com/spf13/hugo/helpers/path.go:585 +0x54
github.com/spf13/hugo/commands.createConfig(0x10e690e0, 0x2b, 0x787a80, 0x4, 0x0, 0x0)
/build/hugo/parts/hugo/go/src/github.com/spf13/hugo/commands/new.go:346 +0x428
github.com/spf13/hugo/commands.doNewSite(0x10e690e0, 0x2b, 0x0, 0x0, 0x0)
/build/hugo/parts/hugo/go/src/github.com/spf13/hugo/commands/new.go:151 +0xc7c
github.com/spf13/hugo/commands.NewSite(0xb24078, 0x10d24718, 0x1, 0x1, 0x0, 0x0)
/build/hugo/parts/hugo/go/src/github.com/spf13/hugo/commands/new.go:193 +0x2e8
github.com/spf13/cobra.(*Command).execute(0xb24078, 0x10d246b8, 0x1, 0x1, 0x0, 0x0)
/build/hugo/parts/hugo/go/src/github.com/spf13/cobra/command.go:632 +0x514
github.com/spf13/cobra.(*Command).ExecuteC(0xb236e8, 0xb24078, 0x0, 0x0)
/build/hugo/parts/hugo/go/src/github.com/spf13/cobra/command.go:722 +0x440
github.com/spf13/hugo/commands.Execute()
/build/hugo/parts/hugo/go/src/github.com/spf13/hugo/commands/hugo.go:160 +0x58
main.main()
/build/hugo/parts/hugo/go/src/github.com/spf13/hugo/main.go:26 +0x28

Well, kind of works in case you install the hugo snap with the option devmode

snap install hugo --devmode

Ok I got even further: --devmode is not required if one connects the right socket with the right plug in the core snap.

I had to do:
snap connect hugo:home :home

Now I have allowed hugo to access my home directory. Nice security feature but I was not aware of it.

More on interfaces on: http://snapcraft.io/docs/core/interfaces