Skip to content

Commit

Permalink
changed the directories used for writing data in flaarum
Browse files Browse the repository at this point in the history
  • Loading branch information
bankole7782 committed Sep 18, 2021
1 parent 6f0e1e0 commit 515671d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions flaarum_shared/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lgcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flaarum # you probably want to 'snapcraft register <name>'
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
Expand Down

0 comments on commit 515671d

Please sign in to comment.