summaryrefslogtreecommitdiff
path: root/pkg/snowflake
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-25 13:45:54 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-29 18:14:05 +0100
commitb7b19b7195366dbacc4078b5b7a3fc6a3ad7889b (patch)
tree2b97e0167d507ddd9c1b5b0d5f0d3efbc4e6829c /pkg/snowflake
parenta81bf938fe2b9409d1fa0175cc5f20635bb16127 (diff)
[feat] expose snowflake in preferences
it will be disabled if Tor not present, for now
Diffstat (limited to 'pkg/snowflake')
-rw-r--r--pkg/snowflake/tor.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/snowflake/tor.go b/pkg/snowflake/tor.go
new file mode 100644
index 0000000..4f4c4e4
--- /dev/null
+++ b/pkg/snowflake/tor.go
@@ -0,0 +1,15 @@
+package snowflake
+
+import (
+ "errors"
+ "os"
+)
+
+func exists(path string) bool {
+ _, err := os.Stat(path)
+ return !errors.Is(err, os.ErrNotExist)
+}
+
+func HasTor() bool {
+ return exists("/usr/sbin/tor")
+}