From 515671dc9d560dde5bc4798d1561cc444e914575 Mon Sep 17 00:00:00 2001 From: Bankole Ojo Date: Sat, 18 Sep 2021 17:42:34 +0100 Subject: [PATCH] changed the directories used for writing data in flaarum --- flaarum_shared/lib.go | 8 ++++---- lgcp/main.go | 4 ++-- snap/snapcraft.yaml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flaarum_shared/lib.go b/flaarum_shared/lib.go index e315381..d0ce1b7 100644 --- a/flaarum_shared/lib.go +++ b/flaarum_shared/lib.go @@ -78,7 +78,7 @@ func G(objectName string) string { func GetConfigPath() (string, error) { - dd := os.Getenv("SNAP_DATA") + dd := os.Getenv("SNAP_COMMON") if strings.HasPrefix(dd, "/var/snap/go") || dd == "" { hd, err := os.UserHomeDir() if err != nil { @@ -106,7 +106,7 @@ func GetDataPath() (string, error) { if inProd == "true" { return "/var/snap/flaarum/current/data_btrfs", nil } else { - dd := os.Getenv("SNAP_DATA") + dd := os.Getenv("SNAP_COMMON") if strings.HasPrefix(dd, "/var/snap/go") || dd == "" { hd, err := os.UserHomeDir() if err != nil { @@ -140,7 +140,7 @@ func GetSetting(settingName string) string { func GetKeyStrPath() string { var keyPath string - dd := os.Getenv("SNAP_DATA") + dd := os.Getenv("SNAP_COMMON") if strings.HasPrefix(dd, "/var/snap/go") || dd == "" { hd, err := os.UserHomeDir() if err != nil { @@ -159,7 +159,7 @@ func GetFlaarumPath(fileName string) (string, error) { if err != nil { return "", errors.Wrap(err, "os error") } - dd := os.Getenv("SNAP_USER_DATA") + dd := os.Getenv("SNAP_USER_COMMON") if strings.HasPrefix(dd, filepath.Join(hd, "snap", "go")) || dd == "" { dd = filepath.Join(hd, fileName) diff --git a/lgcp/main.go b/lgcp/main.go index 5dc9dc2..42e220d 100644 --- a/lgcp/main.go +++ b/lgcp/main.go @@ -197,7 +197,7 @@ sudo snap start flaarum.store startupScript += "\nsudo flaarum.prod mpr " + conf.Get("backup_bucket") + " " + conf.Get("backup_frequency")+ " \n" startupScript += ` -DATA_BTRFS=/var/snap/flaarum/current/data_btrfs +DATA_BTRFS=/var/snap/flaarum/common/data_btrfs if [ ! -d "$DATA_BTRFS" ]; then sudo mkfs.btrfs /dev/sdb sudo mkdir -p $DATA_BTRFS @@ -451,7 +451,7 @@ sudo snap start flaarum.store ` startupScript += "\nsudo flaarum.prod mpr " + conf.Get("backup_bucket") + " " + conf.Get("backup_frequency")+ " \n" startupScript += ` -DATA_BTRFS=/var/snap/flaarum/current/data_btrfs +DATA_BTRFS=/var/snap/flaarum/common/data_btrfs if [ ! -d "$DATA_BTRFS" ]; then sudo mkfs.btrfs /dev/sdb sudo mkdir -p $DATA_BTRFS diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 914061e..026f384 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: flaarum # you probably want to 'snapcraft register ' base: core20 # the base snap is the execution environment for this snap -version: '1.7.1' # just for humans, typically '1.2+git' or '1.3.2' +version: '1.7.2' # just for humans, typically '1.2+git' or '1.3.2' summary: A database that enforces structures # 79 char long summary description: | Flaarum brings in autoscaling, autoindexing, table expansion