Hola snapcrafters,
TLDR
The snap package I have built does not create a habit and log file in the snap “home” directories on onboarding which I assume is because of security sandboxing. Do I need to change that option and to what in my snap build config? (it’s currently “strict”).
The Longer Tale
I’ve recently attempted to create a snap so linux users can use harsh easily (and I apologize if I am asking a stupid question, this is the first time I’ve created a snap package). It builds and releases fine, but the app is not working when it needs to create the habits and log file on onboarding.
I currently build binaries for the GoLang program via goreleaser and a github action and then push the snap. This works fine for the regular binaries I create in OSX, linux, and Windows and via homebrew, but people installing the new snap I created are not getting the onboarding files created on the first run. I imagine this has something to do with the sandboxing model, however, I just wanted to check here before altering my config file for creating the snap.
Using goreleaser, I have the following yaml for the snap which builds successfully and is currently in the snap store:
snapcrafts:
- name_template: '{{ .ProjectName }}_{{ .Arch }}'
summary: habit tracking for geeks. A minimalist CLI for examining your habits.
description: |
Harsh provides a simple, portable, minimalist command line interface for
tracking and examining your habits with text files and actionable
consistency graphs, sparklines, and scoring to let you know how you are
doing on progressing (or breaking) your habits.
https://github.com/wakatara/harsh
grade: stable
confinement: strict
license: MIT
publish: true
It builds fine, but as I say, once installed on a system via snap it appears not to allow the initial habits and log file to be created on the first onboarding run (if those are required).
You get the following when you run the command which triggers onbaording if the config/setup files are not present:
Welcome to harsh!
Created /home/ubuntu/snap/harsh/1/.config/harsh/habits This file lists your habits.
Created /home/ubuntu/snap/harsh/1/.config/harsh/log This file is your habit log.
No habits of your own yet?
Open your habits file @ /home/ubuntu/snap/harsh/1/.config/harsh/habits
with a text editor (nano, vim, VS Code, Atom, emacs) and modify and save the habits list.
Then:
Run harsh ask to start tracking
Running harsh todo will show you undone habits for today.
Running harsh log will show you a consistency graph of your efforts.
(the graph gets way cooler looking over time.
For more depth, you can read https://github.com/wakatara/harsh#usage
Happy tracking! I genuinely hope this helps you with your goals. Bueno suerte!
thanks!
Daryl.