path -> filepath
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
799fc6e621
commit
85af1ad3ba
2
go.mod
2
go.mod
|
@ -5,7 +5,7 @@ go 1.15
|
||||||
require (
|
require (
|
||||||
cwtch.im/cwtch v0.14.12
|
cwtch.im/cwtch v0.14.12
|
||||||
git.openprivacy.ca/cwtch.im/server v1.4.2
|
git.openprivacy.ca/cwtch.im/server v1.4.2
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.8.0
|
git.openprivacy.ca/openprivacy/connectivity v1.8.1
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.3
|
git.openprivacy.ca/openprivacy/log v1.0.3
|
||||||
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
|
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
|
||||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
|
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -26,8 +26,8 @@ git.openprivacy.ca/openprivacy/bine v0.0.4/go.mod h1:13ZqhKyqakDsN/ZkQkIGNULsmLy
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.5.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
git.openprivacy.ca/openprivacy/connectivity v1.5.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.6.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
git.openprivacy.ca/openprivacy/connectivity v1.6.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.7.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
git.openprivacy.ca/openprivacy/connectivity v1.7.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.8.0 h1:/jnc/2LuUpli2NgeLw6zOAVESHrz5mr10kDCQHyZ7R4=
|
git.openprivacy.ca/openprivacy/connectivity v1.8.1 h1:OjWy+JTAvlrstY8PnGPBp7Ho04JaKHaQ+YdoLwSdaCo=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.8.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
git.openprivacy.ca/openprivacy/connectivity v1.8.1/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.2/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
git.openprivacy.ca/openprivacy/log v1.0.2/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.3 h1:E/PMm4LY+Q9s3aDpfySfEDq/vYQontlvNj/scrPaga0=
|
git.openprivacy.ca/openprivacy/log v1.0.3 h1:E/PMm4LY+Q9s3aDpfySfEDq/vYQontlvNj/scrPaga0=
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.3/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
git.openprivacy.ca/openprivacy/log v1.0.3/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
||||||
|
|
13
lib.go
13
lib.go
|
@ -11,7 +11,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"path"
|
path "path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
constants2 "cwtch.im/cwtch/model/constants"
|
constants2 "cwtch.im/cwtch/model/constants"
|
||||||
|
@ -43,7 +43,6 @@ import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
mrand "math/rand"
|
mrand "math/rand"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.openprivacy.ca/openprivacy/connectivity/tor"
|
"git.openprivacy.ca/openprivacy/connectivity/tor"
|
||||||
|
@ -142,7 +141,7 @@ func _startCwtch(appDir string, torPath string) {
|
||||||
if appDir == "~" {
|
if appDir == "~" {
|
||||||
appDir = homeDir
|
appDir = homeDir
|
||||||
} else if strings.HasPrefix(appDir, "~/") {
|
} else if strings.HasPrefix(appDir, "~/") {
|
||||||
appDir = filepath.Join(homeDir, appDir[2:])
|
appDir = path.Join(homeDir, appDir[2:])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that the application directory exists...and then initialize settings..
|
// Ensure that the application directory exists...and then initialize settings..
|
||||||
|
@ -161,7 +160,7 @@ func _startCwtch(appDir string, torPath string) {
|
||||||
log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath)
|
log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath)
|
||||||
|
|
||||||
log.Infof("making directory %v", appDir)
|
log.Infof("making directory %v", appDir)
|
||||||
err = os.MkdirAll(filepath.Join(appDir, "tor"), 0700)
|
err = os.MkdirAll(path.Join(appDir, "tor"), 0700)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("error creating tor data directory: %v. Aborting app start up", err)
|
log.Errorf("error creating tor data directory: %v. Aborting app start up", err)
|
||||||
|
@ -231,7 +230,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("making directory %v", appDir)
|
log.Infof("making directory %v", appDir)
|
||||||
err = os.MkdirAll(filepath.Join(appDir, "tor"), 0700)
|
err = os.MkdirAll(path.Join(appDir, "tor"), 0700)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("error creating tor data directory: %v. Aborting app start up", err)
|
log.Errorf("error creating tor data directory: %v. Aborting app start up", err)
|
||||||
|
@ -256,7 +255,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn
|
||||||
utils.WriteGlobalSettings(settings)
|
utils.WriteGlobalSettings(settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = torrc.Build(filepath.Join(appDir, "tor", "torrc"))
|
err = torrc.Build(path.Join(appDir, "tor", "torrc"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("error constructing torrc: %v", err)
|
log.Errorf("error constructing torrc: %v", err)
|
||||||
|
@ -269,7 +268,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn
|
||||||
|
|
||||||
// purge data dir directories if we are not using them for a cache
|
// purge data dir directories if we are not using them for a cache
|
||||||
torDir := path.Join(appDir, "tor")
|
torDir := path.Join(appDir, "tor")
|
||||||
files, err := filepath.Glob(path.Join(torDir, "data-dir-*"))
|
files, err := path.Glob(path.Join(torDir, "data-dir-*"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("could not construct filesystem glob: %v", err)
|
log.Errorf("could not construct filesystem glob: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
path "path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"cwtch.im/cwtch/event"
|
"cwtch.im/cwtch/event"
|
||||||
|
@ -9,7 +10,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
|
||||||
|
|
||||||
"git.openprivacy.ca/openprivacy/log"
|
"git.openprivacy.ca/openprivacy/log"
|
||||||
)
|
)
|
||||||
|
|
Reference in New Issue