Merge pull request #5 from safing/develop

Fix #1
This commit is contained in:
Raskaro
2019-07-02 16:35:05 +02:00
committed by GitHub
109 changed files with 414 additions and 454 deletions

248
Gopkg.lock generated
View File

@@ -2,309 +2,194 @@
[[projects]] [[projects]]
branch = "master" digest = "1:e92f5581902c345eb4ceffdcd4a854fb8f73cf436d47d837d1ec98ef1fe0a214"
digest = "1:636265d7c62365795e14a5d323a48db1409795adf96241bea7335d054f9d1879"
name = "github.com/Safing/portbase"
packages = [
"api",
"config",
"container",
"crypto/hash",
"crypto/random",
"database",
"database/accessor",
"database/dbmodule",
"database/iterator",
"database/query",
"database/record",
"database/storage",
"database/storage/bbolt",
"formats/dsd",
"formats/varint",
"info",
"log",
"modules",
"notifications",
"taskmanager",
"utils",
"utils/osdetail",
"utils/testutils",
]
pruneopts = ""
revision = "60dbbe55e94597e23305ebb7ed1ddbb074fa25b7"
[[projects]]
digest = "1:f82b8ac36058904227087141017bb82f4b0fc58272990a4cdae3e2d6d222644e"
name = "github.com/StackExchange/wmi" name = "github.com/StackExchange/wmi"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "5d049714c4a64225c3c79a7cf7d02f7fb5b96338" revision = "5d049714c4a64225c3c79a7cf7d02f7fb5b96338"
version = "1.0.0" version = "1.0.0"
[[projects]] [[projects]]
digest = "1:3b186fcaa1c0b374249e76601cd4d5c8c7f0712f8ad419f2e8288c7b9e7ed520" digest = "1:90afd0cfdffcc3df7855160ee2954cbca286e23c4eb9cb3d075536c9e4e1b04f"
name = "github.com/aead/serpent"
packages = ["."]
pruneopts = ""
revision = "fba169763ea663f7496376e5cdf709e4c7504704"
version = "v0.1"
[[projects]]
digest = "1:3c753679736345f50125ae993e0a2614da126859921ea7faeecda6d217501ce2"
name = "github.com/agext/levenshtein" name = "github.com/agext/levenshtein"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "0ded9c86537917af2ff89bc9c78de6bd58477894" revision = "0ded9c86537917af2ff89bc9c78de6bd58477894"
version = "v1.2.2" version = "v1.2.2"
[[projects]] [[projects]]
branch = "master" digest = "1:e097b70eeb55d10325f576ec2f97221d8ae18a3569cb0bc404863bde944788b8"
digest = "1:baf770c4efa1883bb5e444614e85b8028bbad33913aca290a43298f65d9df485"
name = "github.com/bluele/gcache"
packages = ["."]
pruneopts = ""
revision = "bc40bd6538339bd4be8cb0b48fc33fdf012ddb6e"
[[projects]]
digest = "1:04be39ea2e9e54ccb36ad938cc7fd991845b07efa7cd5b497a534085df2155ec"
name = "github.com/cloudflare/cfssl" name = "github.com/cloudflare/cfssl"
packages = [ packages = [
"crypto/pkcs7", "crypto/pkcs7",
"errors", "errors",
] ]
pruneopts = "" pruneopts = "UT"
revision = "768cd563887febaad559b511aaa5964823ccb4ab" revision = "768cd563887febaad559b511aaa5964823ccb4ab"
version = "1.3.3" version = "1.3.3"
[[projects]] [[projects]]
branch = "v2.1" branch = "v2.1"
digest = "1:3fc5d0d9cb474736e8e6c2f2292e0763b5132c6e7d8cbedf7bde404a470c8c3b" digest = "1:1a2c0956b86c464f8ee91a46e0947dac7251f1d6fb7d3ad89cb9b376273ece82"
name = "github.com/cookieo9/resources-go" name = "github.com/cookieo9/resources-go"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "d27c04069d0d5dfe11c202dacbf745ae8d1ab181" revision = "d27c04069d0d5dfe11c202dacbf745ae8d1ab181"
[[projects]] [[projects]]
digest = "1:166e24c91c2732657d2f791d3ee3897e7d85ece7cbb62ad991250e6b51fc1d4c" digest = "1:3b4fcce8036672adc21c09d8e288f7b7590e76a468fae5a13346366e778e5ff8"
name = "github.com/coreos/go-iptables" name = "github.com/coreos/go-iptables"
packages = ["iptables"] packages = ["iptables"]
pruneopts = "" pruneopts = "UT"
revision = "78b5fff24e6df8886ef8eca9411f683a884349a5" revision = "78b5fff24e6df8886ef8eca9411f683a884349a5"
version = "v0.4.1" version = "v0.4.1"
[[projects]] [[projects]]
digest = "1:b6581f9180e0f2d5549280d71819ab951db9d511478c87daca95669589d505c0" digest = "1:440028f55cb322d8cb5b9d5ebec298a00b7d74690a658fe6b1c0c0b44341bfae"
name = "github.com/go-ole/go-ole" name = "github.com/go-ole/go-ole"
packages = [ packages = [
".", ".",
"oleutil", "oleutil",
] ]
pruneopts = "" pruneopts = "UT"
revision = "97b6244175ae18ea6eef668034fd6565847501c9" revision = "97b6244175ae18ea6eef668034fd6565847501c9"
version = "v1.2.4" version = "v1.2.4"
[[projects]] [[projects]]
digest = "1:cc1255e2fef3819bfab3540277001e602892dd431ef9ab5499bcdbc425923d64" digest = "1:b3d20bcdedab2050e6bc58e52f4fdc46f710b4c74e1a1ecee262ebec1aee7b6e"
name = "github.com/godbus/dbus" name = "github.com/godbus/dbus"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "2ff6f7ffd60f0f2410b3105864bdd12c7894f844" revision = "2ff6f7ffd60f0f2410b3105864bdd12c7894f844"
version = "v5.0.1" version = "v5.0.1"
[[projects]] [[projects]]
digest = "1:e85e59c4152d8576341daf54f40d96c404c264e04941a4a36b97a0f427eb9e5e" digest = "1:0d40612c9acf7173aa742ee335bf344524add9c8d7e818992b610f3982350101"
name = "github.com/google/gopacket" name = "github.com/google/gopacket"
packages = [ packages = [
".", ".",
"layers", "layers",
"tcpassembly", "tcpassembly",
] ]
pruneopts = "" pruneopts = "UT"
revision = "6d3e2615da4ed2ed2a349918fe74e7e6d03482fa" revision = "6d3e2615da4ed2ed2a349918fe74e7e6d03482fa"
version = "v1.1.17" version = "v1.1.17"
[[projects]] [[projects]]
digest = "1:20dc576ad8f98fe64777c62f090a9b37dd67c62b23fe42b429c2c41936aa8a9c" digest = "1:c3388642e07731a240e14f4bc7207df59cfcc009447c657b9de87fec072d07e3"
name = "github.com/google/renameio" name = "github.com/google/renameio"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "f0e32980c006571efd537032e5f9cd8c1a92819e" revision = "f0e32980c006571efd537032e5f9cd8c1a92819e"
version = "v0.1.0" version = "v0.1.0"
[[projects]] [[projects]]
digest = "1:ec5262e6c65f9fcedc01d7789ee4e18ad429dde822cfd50e57e3fd77c4d70c73" digest = "1:cbec35fe4d5a4fba369a656a8cd65e244ea2c743007d8f6c1ccb132acf9d1296"
name = "github.com/gorilla/mux" name = "github.com/gorilla/mux"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "ed099d42384823742bba0bf9a72b53b55c9e2e38" revision = "00bdffe0f3c77e27d2cf6f5c70232a2d3e4d9c15"
version = "v1.7.2" version = "v1.7.3"
[[projects]]
digest = "1:09aa5dd1332b93c96bde671bafb053249dc813febf7d5ca84e8f382ba255d67d"
name = "github.com/gorilla/websocket"
packages = ["."]
pruneopts = ""
revision = "66b9c49e59c6c48f0ffce28c2d8b8a5678502c6d"
version = "v1.4.0"
[[projects]] [[projects]]
digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be"
name = "github.com/inconshreveable/mousetrap" name = "github.com/inconshreveable/mousetrap"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
version = "v1.0" version = "v1.0"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:e71cc6b377264002aec0d9c235087e51ad7a3c1fb341bb4baa84709308b94fe8" digest = "1:f433da6fbabb0bd1bd730fd340782015c644123d02eb78c20c69ce03352daad1"
name = "github.com/kardianos/osext" name = "github.com/kardianos/osext"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "2bc1f35cddc0cc527b4bc3dce8578fc2a6c11384" revision = "2bc1f35cddc0cc527b4bc3dce8578fc2a6c11384"
[[projects]] [[projects]]
digest = "1:49b2165427f1eecc536ccc1b34129f1f9240b85d1c54228f3aeb6d4275e3daf3" digest = "1:66def2f80d5127123c81ffa876242c12d3b7b06188f6645d79b3cc4acba637b3"
name = "github.com/miekg/dns" name = "github.com/miekg/dns"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "d16ecb693e3f8d524769fefce2192a4c92207ff9" revision = "b13675009d59c97f3721247d9efa8914e1866a5b"
version = "v1.1.13" version = "v1.1.15"
[[projects]] [[projects]]
digest = "1:3819cd861b7abd7d12dc1ea52ecb998ad1171826a76ecf0aefa09545781091f9" digest = "1:8186cc518f5dcea736d7725e284632937971fdf29fa2953fdfa53f631e21a799"
name = "github.com/oschwald/maxminddb-golang" name = "github.com/oschwald/maxminddb-golang"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "2905694a1b00c5574f1418a7dbf8a22a7d247559" revision = "2905694a1b00c5574f1418a7dbf8a22a7d247559"
version = "v1.3.1" version = "v1.3.1"
[[projects]] [[projects]]
digest = "1:7f569d906bdd20d906b606415b7d794f798f91a62fcfb6a4daa6d50690fb7a3f" digest = "1:274f67cb6fed9588ea2521ecdac05a6d62a8c51c074c1fccc6a49a40ba80e925"
name = "github.com/satori/go.uuid" name = "github.com/satori/go.uuid"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3" revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"
version = "v1.2.0" version = "v1.2.0"
[[projects]] [[projects]]
branch = "master" digest = "1:36ff5e7a8aa3e7d01b9ca22d441484d9c43247b6e34e379c404d17a2e0098091"
digest = "1:8ea5e33ea56cafca3c9636a8251d651f33431450ecb11bcb21ecf9e5d5017c7e"
name = "github.com/seehuhn/fortuna"
packages = ["."]
pruneopts = ""
revision = "f376bbcd33f446d4431a641aead7851fcbeafa08"
[[projects]]
branch = "master"
digest = "1:3e67cb161714c815dfe346a3c1d386b44bab7bd907473acf437171f5577bee88"
name = "github.com/seehuhn/sha256d"
packages = ["."]
pruneopts = ""
revision = "e9f377c596061894b7f9ee69aab61e62c3ccc13e"
[[projects]]
digest = "1:ab6d9cca43e0a89aacd6657db0adb5a6597ed51f81ad0e4f2db516728eb63185"
name = "github.com/shirou/gopsutil" name = "github.com/shirou/gopsutil"
packages = [ packages = [
"cpu", "cpu",
"host",
"internal/common", "internal/common",
"mem", "mem",
"net", "net",
"process", "process",
] ]
pruneopts = "" pruneopts = "UT"
revision = "fa9845945e5b5c6ffb19b436586ff702a30417c5" revision = "4c8b404ee5c53b04b04f34b1744a26bf5d2910de"
version = "v2.19.04" version = "v2.19.6"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:99c6a6dab47067c9b898e8c8b13d130c6ab4ffbcc4b7cc6236c2cd0b1e344f5b" digest = "1:99c6a6dab47067c9b898e8c8b13d130c6ab4ffbcc4b7cc6236c2cd0b1e344f5b"
name = "github.com/shirou/w32" name = "github.com/shirou/w32"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "bb4de0191aa41b5507caa14b0650cdbddcd9280b" revision = "bb4de0191aa41b5507caa14b0650cdbddcd9280b"
[[projects]] [[projects]]
digest = "1:78715f4ed019d19795e67eed1dc63f525461d925616b1ed02b72582c01362440" digest = "1:e096613fb7cf34743d49af87d197663cfccd61876e2219853005a57baedfa562"
name = "github.com/spf13/cobra" name = "github.com/spf13/cobra"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "67fc4837d267bc9bfd6e47f77783fcc3dffc68de" revision = "f2b07da1e2c38d5f12845a4f607e2e1018cbb1f5"
version = "v0.0.4" version = "v0.0.5"
[[projects]] [[projects]]
digest = "1:cbaf13cdbfef0e4734ed8a7504f57fe893d471d62a35b982bf6fb3f036449a66" digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2"
name = "github.com/spf13/pflag" name = "github.com/spf13/pflag"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "298182f68c66c05229eb03ac171abe6e309ee79a" revision = "298182f68c66c05229eb03ac171abe6e309ee79a"
version = "v1.0.3" version = "v1.0.3"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:86e6712cfd4070a2120c03fcec41cfcbbc51813504a74e28d74479edfaf669ee" digest = "1:93d6687fc19da8a35c7352d72117a6acd2072dfb7e9bfd65646227bf2a913b2a"
name = "github.com/tevino/abool" name = "github.com/tevino/abool"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "9b9efcf221b50905aab9bbabd3daed56dc10f339" revision = "9b9efcf221b50905aab9bbabd3daed56dc10f339"
[[projects]]
digest = "1:eade4ea6782f5eed4a6b3138a648f9a332900650804fd206e5daaf99cc5613ea"
name = "github.com/tidwall/gjson"
packages = ["."]
pruneopts = ""
revision = "eee0b6226f0d1db2675a176fdfaa8419bcad4ca8"
version = "v1.2.1"
[[projects]]
digest = "1:72511ec1089fee111c995492d1d390a38ac7ab888aabdb1188985f2a1719c599"
name = "github.com/tidwall/match"
packages = ["."]
pruneopts = ""
revision = "33827db735fff6510490d69a8622612558a557ed"
version = "v1.0.1"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:1d7cab09854959fe179fe2f209400626f3dda9ec8e8b719c661d7b2add7b54b5" digest = "1:2a9f7ca80c3035b7e68a927db100922d4a266a31cea2568d9a5185a90b469279"
name = "github.com/tidwall/pretty"
packages = ["."]
pruneopts = ""
revision = "1166b9ac2b65e46a43d8618d30d1554f4652d49b"
[[projects]]
digest = "1:04a1f04f50d734222dc3da57368771a1d6a4e4c7418d19e17285d7c1d1936939"
name = "github.com/tidwall/sjson"
packages = ["."]
pruneopts = ""
revision = "25fb082a20e29e83fb7b7ef5f5919166aad1f084"
version = "v1.0.4"
[[projects]]
branch = "master"
digest = "1:21097653bd7914de1262f2429e277933507442f892815a791ce1c0dbf0a8dc20"
name = "github.com/umahmood/haversine" name = "github.com/umahmood/haversine"
packages = ["."] packages = ["."]
pruneopts = "" pruneopts = "UT"
revision = "808ab04add26660fd241ddb7973886c6dd6669e8" revision = "808ab04add26660fd241ddb7973886c6dd6669e8"
[[projects]]
digest = "1:8fe1bf6222077787bf88db4eae509f1c910743be1b82e1a6a57444fe092fc4a5"
name = "go.etcd.io/bbolt"
packages = ["."]
pruneopts = ""
revision = "63597a96ec0ad9e6d43c3fc81e809909e0237461"
version = "v1.3.2"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:23603929c559ebf5fa44cc2ed4a72ae729292e2b7e0295ab0e743641f0a47535" digest = "1:bf3f59dec5aa79945bd4b45c0c649c99d03609565acdd6a087f4cd6e9e5b5544"
name = "golang.org/x/crypto" name = "golang.org/x/crypto"
packages = [ packages = [
"blake2b",
"blake2s",
"chacha20poly1305", "chacha20poly1305",
"curve25519", "curve25519",
"ed25519", "ed25519",
@@ -313,14 +198,13 @@
"internal/subtle", "internal/subtle",
"ocsp", "ocsp",
"poly1305", "poly1305",
"sha3",
] ]
pruneopts = "" pruneopts = "UT"
revision = "20be4c3c3ed52bfccdb2d59a412ee1a936d175a7" revision = "4def268fd1a49955bfb3dda92fe3db4f924f2285"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:3fcc745bd071aa073bd666e01ff8df5fc72ab15f493ae7246710c66c738aab45" digest = "1:caffb9a4f8c756941de4b3eb577abd167e7fd4b570f2078c05ceb8835a1514cb"
name = "golang.org/x/net" name = "golang.org/x/net"
packages = [ packages = [
"bpf", "bpf",
@@ -330,43 +214,25 @@
"ipv4", "ipv4",
"ipv6", "ipv6",
] ]
pruneopts = "" pruneopts = "UT"
revision = "f3200d17e092c607f615320ecaad13d87ad9a2b3" revision = "da137c7871d730100384dbcf36e6f8fa493aef5b"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:42729e4b5f90f33713c3eb772316cac71baf3344965a9fd9a86ab54b46bff88b" digest = "1:7e3e63385ebe2dd5210be1534c516d8ae33c7ffac74126e5243d43ba7222e0d4"
name = "golang.org/x/sys" name = "golang.org/x/sys"
packages = [ packages = [
"cpu", "cpu",
"unix", "unix",
"windows", "windows",
] ]
pruneopts = "" pruneopts = "UT"
revision = "69e3a3a65b5bed52b8194d33c59d955757d87523" revision = "04f50cda93cbb67f2afa353c52f342100e80e625"
[solve-meta] [solve-meta]
analyzer-name = "dep" analyzer-name = "dep"
analyzer-version = 1 analyzer-version = 1
input-imports = [ input-imports = [
"github.com/Safing/portbase/api",
"github.com/Safing/portbase/config",
"github.com/Safing/portbase/crypto/hash",
"github.com/Safing/portbase/crypto/random",
"github.com/Safing/portbase/database",
"github.com/Safing/portbase/database/dbmodule",
"github.com/Safing/portbase/database/iterator",
"github.com/Safing/portbase/database/query",
"github.com/Safing/portbase/database/record",
"github.com/Safing/portbase/database/storage",
"github.com/Safing/portbase/database/storage/bbolt",
"github.com/Safing/portbase/info",
"github.com/Safing/portbase/log",
"github.com/Safing/portbase/modules",
"github.com/Safing/portbase/notifications",
"github.com/Safing/portbase/utils",
"github.com/Safing/portbase/utils/osdetail",
"github.com/Safing/portbase/utils/testutils",
"github.com/agext/levenshtein", "github.com/agext/levenshtein",
"github.com/cloudflare/cfssl/crypto/pkcs7", "github.com/cloudflare/cfssl/crypto/pkcs7",
"github.com/cookieo9/resources-go", "github.com/cookieo9/resources-go",

View File

@@ -1,4 +1,102 @@
ignored = ["github.com/Safing/portbase", "github.com/Safing/safing-core", "github.com/Safing/safing-core/formats/varint"] # Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
ignored = ["github.com/safing/portbase/*"]
[[constraint]]
name = "github.com/agext/levenshtein"
version = "1.2.2"
[[constraint]]
name = "github.com/cloudflare/cfssl"
version = "1.3.3"
[[constraint]]
branch = "v2.1"
name = "github.com/cookieo9/resources-go"
[[constraint]]
name = "github.com/coreos/go-iptables"
version = "0.4.1"
[[constraint]]
name = "github.com/godbus/dbus"
version = "5.0.1"
[[constraint]]
name = "github.com/google/gopacket"
version = "1.1.17"
[[constraint]]
name = "github.com/google/renameio"
version = "0.1.0"
[[constraint]]
name = "github.com/gorilla/mux"
version = "1.7.3"
[[constraint]]
name = "github.com/miekg/dns"
version = "1.1.15"
[[constraint]]
name = "github.com/oschwald/maxminddb-golang"
version = "1.3.1"
[[constraint]]
name = "github.com/satori/go.uuid"
version = "1.2.0"
[[constraint]]
name = "github.com/shirou/gopsutil"
version = "2.19.6"
[[constraint]]
name = "github.com/spf13/cobra"
version = "0.0.5"
[[constraint]]
branch = "master"
name = "github.com/tevino/abool"
[[constraint]]
branch = "master"
name = "github.com/umahmood/haversine"
[[constraint]]
branch = "master"
name = "golang.org/x/crypto"
[[constraint]]
branch = "master"
name = "golang.org/x/net"
[[constraint]]
branch = "master"
name = "golang.org/x/sys"
[prune] [prune]
go-tests = true go-tests = true

View File

@@ -32,7 +32,7 @@ If you want to know more, here are [the docs](http://docs.safing.io/).
The `pmctl` command will help you get up and running. It will bootstrap your the environment and download additional files it needs. All commands need the `--db` parameter with the database location, as this is where all the data and also the binaries live. The `pmctl` command will help you get up and running. It will bootstrap your the environment and download additional files it needs. All commands need the `--db` parameter with the database location, as this is where all the data and also the binaries live.
Just download `pmctl` from the [releases page](https://github.com/Safing/portmaster/releases) and put it somewhere comfortable. You may freely choose where you want to put the database - it needs to be the same for all commands. Here we go - run every command in a seperate terminal window: Just download `pmctl` from the [releases page](https://github.com/safing/portmaster/releases) and put it somewhere comfortable. You may freely choose where you want to put the database - it needs to be the same for all commands. Here we go - run every command in a seperate terminal window:
# start the portmaster: # start the portmaster:
sudo ./pmctl run core --db=/opt/pm_db sudo ./pmctl run core --db=/opt/pm_db
@@ -48,7 +48,7 @@ Just download `pmctl` from the [releases page](https://github.com/Safing/portmas
#### Feedback #### Feedback
We'd love to know what you think, drop by on [our forum](https://discourse.safing.community/) and let us know! We'd love to know what you think, drop by on [our forum](https://discourse.safing.community/) and let us know!
If you want to report a bug, please [open an issue on Github](https://github.com/Safing/portmaster/issues/new). If you want to report a bug, please [open an issue on Github](https://github.com/safing/portmaster/issues/new).
## Documentation ## Documentation

2
build
View File

@@ -54,5 +54,5 @@ if [[ $1 == "dev" ]]; then
fi fi
# build # build
BUILD_PATH="github.com/Safing/portbase/info" BUILD_PATH="github.com/safing/portbase/info"
go build $DEV -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $* go build $DEV -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $*

View File

@@ -1,13 +1,13 @@
package core package core
import ( import (
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
"github.com/Safing/portbase/notifications" "github.com/safing/portbase/notifications"
// module dependencies // module dependencies
_ "github.com/Safing/portbase/database/dbmodule" _ "github.com/safing/portbase/database/dbmodule"
_ "github.com/Safing/portbase/database/storage/bbolt" _ "github.com/safing/portbase/database/storage/bbolt"
) )
func init() { func init() {

View File

@@ -7,12 +7,12 @@ import (
"runtime" "runtime"
"syscall" "syscall"
"github.com/Safing/portbase/info" "github.com/safing/portbase/info"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
// include packages here // include packages here
_ "github.com/Safing/portmaster/nameserver/only" _ "github.com/safing/portmaster/nameserver/only"
) )
func main() { func main() {

View File

@@ -1,8 +1,8 @@
package firewall package firewall
import ( import (
"github.com/Safing/portbase/config" "github.com/safing/portbase/config"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
var ( var (

View File

@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"net" "net"
"github.com/Safing/portmaster/intel" "github.com/safing/portmaster/intel"
) )
func init() { func init() {

View File

@@ -8,16 +8,16 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
"github.com/Safing/portmaster/firewall/inspection" "github.com/safing/portmaster/firewall/inspection"
"github.com/Safing/portmaster/firewall/interception" "github.com/safing/portmaster/firewall/interception"
"github.com/Safing/portmaster/network" "github.com/safing/portmaster/network"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
// module dependencies // module dependencies
_ "github.com/Safing/portmaster/core" _ "github.com/safing/portmaster/core"
_ "github.com/Safing/portmaster/profile" _ "github.com/safing/portmaster/profile"
) )
var ( var (

View File

@@ -5,8 +5,8 @@ package inspection
import ( import (
"sync" "sync"
"github.com/Safing/portmaster/network" "github.com/safing/portmaster/network"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
const ( const (

View File

@@ -10,13 +10,13 @@ import (
"github.com/google/gopacket/layers" "github.com/google/gopacket/layers"
"github.com/google/gopacket/tcpassembly" "github.com/google/gopacket/tcpassembly"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/firewall/inspection" "github.com/safing/portmaster/firewall/inspection"
"github.com/Safing/portmaster/firewall/inspection/tls/tlslib" "github.com/safing/portmaster/firewall/inspection/tls/tlslib"
"github.com/Safing/portmaster/firewall/inspection/tls/verify" "github.com/safing/portmaster/firewall/inspection/tls/verify"
"github.com/Safing/portmaster/network" "github.com/safing/portmaster/network"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
// TODO: // TODO:

View File

@@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/Safing/portmaster/firewall/inspection/tls/tlslib" "github.com/safing/portmaster/firewall/inspection/tls/tlslib"
) )
var clientHelloSample = []byte{ var clientHelloSample = []byte{

View File

@@ -13,9 +13,9 @@ import (
"github.com/cloudflare/cfssl/crypto/pkcs7" "github.com/cloudflare/cfssl/crypto/pkcs7"
"github.com/Safing/portbase/crypto/hash" "github.com/safing/portbase/crypto/hash"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
) )
// Cert saves a certificate. // Cert saves a certificate.

View File

@@ -12,10 +12,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/Safing/portbase/crypto/hash" "github.com/safing/portbase/crypto/hash"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
// CARevocationInfo saves Information on revokation of Certificates of a Certificate Authority. // CARevocationInfo saves Information on revokation of Certificates of a Certificate Authority.

View File

@@ -14,8 +14,8 @@ import (
"golang.org/x/crypto/ocsp" "golang.org/x/crypto/ocsp"
"github.com/Safing/portbase/crypto/hash" "github.com/safing/portbase/crypto/hash"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
var ( var (

View File

@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/Safing/portbase/crypto/hash" "github.com/safing/portbase/crypto/hash"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
) )
// useful references: // useful references:

View File

@@ -2,7 +2,7 @@
package interception package interception
import "github.com/Safing/portmaster/network/packet" import "github.com/safing/portmaster/network/packet"
var ( var (
// Packets channel for feeding the firewall. // Packets channel for feeding the firewall.

View File

@@ -3,12 +3,12 @@ package interception
import ( import (
"fmt" "fmt"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/notifications" "github.com/safing/portbase/notifications"
"github.com/Safing/portbase/utils/osdetail" "github.com/safing/portbase/utils/osdetail"
"github.com/Safing/portmaster/firewall/interception/windowskext" "github.com/safing/portmaster/firewall/interception/windowskext"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
"github.com/Safing/portmaster/updates" "github.com/safing/portmaster/updates"
) )
var Packets chan packet.Packet var Packets chan packet.Packet

View File

@@ -7,7 +7,7 @@ package nfqueue
// import ( // import (
// "sync" // "sync"
// //
// "github.com/Safing/portmaster/network/packet" // "github.com/safing/portmaster/network/packet"
// ) // )
// //
// type multiQueue struct { // type multiQueue struct {

View File

@@ -20,7 +20,7 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
var queues map[uint16]*NFQueue var queues map[uint16]*NFQueue

View File

@@ -5,7 +5,7 @@ package nfqueue
import ( import (
"fmt" "fmt"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
var ( var (

View File

@@ -7,7 +7,7 @@ import (
"github.com/coreos/go-iptables/iptables" "github.com/coreos/go-iptables/iptables"
"github.com/Safing/portmaster/firewall/interception/nfqueue" "github.com/safing/portmaster/firewall/interception/nfqueue"
) )
// iptables -A OUTPUT -p icmp -j", "NFQUEUE", "--queue-num", "1", "--queue-bypass // iptables -A OUTPUT -p icmp -j", "NFQUEUE", "--queue-num", "1", "--queue-bypass

View File

@@ -6,8 +6,8 @@ import (
"github.com/tevino/abool" "github.com/tevino/abool"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
// VerdictRequest is the request structure from the Kext. // VerdictRequest is the request structure from the Kext.

View File

@@ -9,8 +9,8 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/network" "github.com/safing/portmaster/network"
"github.com/tevino/abool" "github.com/tevino/abool"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

View File

@@ -5,9 +5,9 @@ import (
"github.com/tevino/abool" "github.com/tevino/abool"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/network" "github.com/safing/portmaster/network"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
// Packet represents an IP packet. // Packet represents an IP packet.

View File

@@ -6,9 +6,9 @@ import (
"os/signal" "os/signal"
"syscall" "syscall"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/firewall/interception/windowskext" "github.com/safing/portmaster/firewall/interception/windowskext"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
var ( var (

View File

@@ -7,15 +7,15 @@ import (
"strings" "strings"
"time" "time"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/notifications" "github.com/safing/portbase/notifications"
"github.com/Safing/portmaster/intel" "github.com/safing/portmaster/intel"
"github.com/Safing/portmaster/network" "github.com/safing/portmaster/network"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/agext/levenshtein" "github.com/agext/levenshtein"

View File

@@ -4,8 +4,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/Safing/portbase/crypto/random" "github.com/safing/portbase/crypto/random"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
type portStatus struct { type portStatus struct {

View File

@@ -1,8 +1,8 @@
package intel package intel
import ( import (
"github.com/Safing/portbase/config" "github.com/safing/portbase/config"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
var ( var (

View File

@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
) )
var ( var (

View File

@@ -5,9 +5,9 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/utils" "github.com/safing/portbase/utils"
) )
var ( var (

View File

@@ -5,11 +5,11 @@ import (
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
// module dependencies // module dependencies
_ "github.com/Safing/portmaster/core" _ "github.com/safing/portmaster/core"
) )
func init() { func init() {

View File

@@ -4,9 +4,9 @@ import (
"os" "os"
"testing" "testing"
"github.com/Safing/portbase/database/dbmodule" "github.com/safing/portbase/database/dbmodule"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
) )
func TestMain(m *testing.M) { func TestMain(m *testing.M) {

View File

@@ -13,7 +13,7 @@ import (
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
// DNS Classes // DNS Classes

View File

@@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
) )
var ( var (

View File

@@ -13,9 +13,9 @@ import (
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
// TODO: make resolver interface for http package // TODO: make resolver interface for http package

View File

@@ -11,10 +11,10 @@ import (
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/network/environment" "github.com/safing/portmaster/network/environment"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
) )
// Resolver holds information about an active resolver. // Resolver holds information about an active resolver.

View File

@@ -4,7 +4,7 @@ import (
"errors" "errors"
"strings" "strings"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/miekg/dns" "github.com/miekg/dns"
) )

14
main.go
View File

@@ -9,15 +9,15 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/Safing/portbase/info" "github.com/safing/portbase/info"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
// include packages here // include packages here
_ "github.com/Safing/portmaster/core" _ "github.com/safing/portmaster/core"
_ "github.com/Safing/portmaster/firewall" _ "github.com/safing/portmaster/firewall"
_ "github.com/Safing/portmaster/nameserver" _ "github.com/safing/portmaster/nameserver"
_ "github.com/Safing/portmaster/ui" _ "github.com/safing/portmaster/ui"
) )
var ( var (

View File

@@ -9,14 +9,14 @@ import (
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
"github.com/Safing/portmaster/analytics/algs" "github.com/safing/portmaster/analytics/algs"
"github.com/Safing/portmaster/firewall" "github.com/safing/portmaster/firewall"
"github.com/Safing/portmaster/intel" "github.com/safing/portmaster/intel"
"github.com/Safing/portmaster/network" "github.com/safing/portmaster/network"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
) )
var ( var (

View File

@@ -7,13 +7,13 @@ import (
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
"github.com/Safing/portmaster/analytics/algs" "github.com/safing/portmaster/analytics/algs"
"github.com/Safing/portmaster/intel" "github.com/safing/portmaster/intel"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
var ( var (

View File

@@ -6,10 +6,10 @@ import (
"os" "os"
"time" "time"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/notifications" "github.com/safing/portbase/notifications"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
) )
func checkForConflictingService(err error) { func checkForConflictingService(err error) {

View File

@@ -5,8 +5,8 @@ package network
import ( import (
"time" "time"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
) )
var ( var (

View File

@@ -10,13 +10,13 @@ import (
"sync" "sync"
"time" "time"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/intel" "github.com/safing/portmaster/intel"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
) )
// Communication describes a logical connection between a process and a domain. // Communication describes a logical connection between a process and a domain.

View File

@@ -6,12 +6,12 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/iterator" "github.com/safing/portbase/database/iterator"
"github.com/Safing/portbase/database/query" "github.com/safing/portbase/database/query"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/database/storage" "github.com/safing/portbase/database/storage"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
) )
var ( var (

View File

@@ -4,7 +4,7 @@ import (
"net" "net"
"strings" "strings"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
) )
func GetAssignedAddresses() (ipv4 []net.IP, ipv6 []net.IP, err error) { func GetAssignedAddresses() (ipv4 []net.IP, ipv6 []net.IP, err error) {

View File

@@ -11,7 +11,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
// TODO: find a good way to identify a network // TODO: find a good way to identify a network

View File

@@ -12,8 +12,8 @@ import (
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
) )
// Gateways returns the currently active gateways // Gateways returns the currently active gateways

View File

@@ -10,7 +10,7 @@ import (
"os" "os"
"time" "time"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
"golang.org/x/net/icmp" "golang.org/x/net/icmp"
"golang.org/x/net/ipv4" "golang.org/x/net/ipv4"

View File

@@ -6,8 +6,8 @@ import (
maxminddb "github.com/oschwald/maxminddb-golang" maxminddb "github.com/oschwald/maxminddb-golang"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/updates" "github.com/safing/portmaster/updates"
) )
var ( var (

View File

@@ -8,9 +8,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
// FirewallHandler defines the function signature for a firewall handle function // FirewallHandler defines the function signature for a firewall handle function

View File

@@ -1,7 +1,7 @@
package network package network
import ( import (
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
) )
func init() { func init() {

View File

@@ -5,9 +5,9 @@ import (
"os" "os"
"time" "time"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
) )
// GetOwnComm returns the communication for the given packet, that originates from // GetOwnComm returns the communication for the given packet, that originates from

View File

@@ -3,9 +3,9 @@ package network
import ( import (
"time" "time"
"github.com/Safing/portmaster/network/netutils" "github.com/safing/portmaster/network/netutils"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
) )
// Static reasons // Static reasons

View File

@@ -48,5 +48,5 @@ echo "This information is useful for debugging and license compliance."
echo "Run the compiled binary with the -version flag to see the information included." echo "Run the compiled binary with the -version flag to see the information included."
# build # build
BUILD_PATH="github.com/Safing/portbase/info" BUILD_PATH="github.com/safing/portbase/info"
go build -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $* go build -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $*

View File

@@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/Safing/portmaster/updates" "github.com/safing/portmaster/updates"
) )
func getFile(identifier string) (*updates.File, error) { func getFile(identifier string) (*updates.File, error) {

View File

@@ -7,9 +7,9 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/Safing/portbase/info" "github.com/safing/portbase/info"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/updates" "github.com/safing/portmaster/updates"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@@ -7,8 +7,8 @@ import (
"path/filepath" "path/filepath"
"runtime" "runtime"
"github.com/Safing/portbase/info" "github.com/safing/portbase/info"
"github.com/Safing/portmaster/updates" "github.com/safing/portmaster/updates"
) )
func checkForUpgrade() (update *updates.File) { func checkForUpgrade() (update *updates.File) {

View File

@@ -7,9 +7,9 @@ import (
processInfo "github.com/shirou/gopsutil/process" processInfo "github.com/shirou/gopsutil/process"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
"github.com/tevino/abool" "github.com/tevino/abool"
) )

View File

@@ -5,8 +5,8 @@ import (
"errors" "errors"
"net" "net"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/network/packet" "github.com/safing/portmaster/network/packet"
) )
// Errors // Errors

View File

@@ -1,7 +1,7 @@
package process package process
import ( import (
"github.com/Safing/portmaster/process/proc" "github.com/safing/portmaster/process/proc"
) )
var ( var (

View File

@@ -1,7 +1,7 @@
package process package process
import ( import (
"github.com/Safing/portmaster/process/iphelper" "github.com/safing/portmaster/process/iphelper"
) )
var ( var (

View File

@@ -5,7 +5,7 @@ package main
import ( import (
"fmt" "fmt"
"github.com/Safing/portmaster/process/iphelper" "github.com/safing/portmaster/process/iphelper"
) )
func main() { func main() {

View File

@@ -4,10 +4,10 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/query" "github.com/safing/portbase/database/query"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
) )
var ( var (

View File

@@ -10,7 +10,7 @@ import (
"sync" "sync"
"syscall" "syscall"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
var ( var (

View File

@@ -13,7 +13,7 @@ import (
"sync" "sync"
"unicode" "unicode"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
/* /*

View File

@@ -12,9 +12,9 @@ import (
processInfo "github.com/shirou/gopsutil/process" processInfo "github.com/shirou/gopsutil/process"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
) )
var ( var (

View File

@@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/utils/osdetail" "github.com/safing/portbase/utils/osdetail"
) )
// IsUser returns whether the process is run by a normal user. // IsUser returns whether the process is run by a normal user.

View File

@@ -10,7 +10,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
var ( var (

View File

@@ -4,7 +4,7 @@ import (
"context" "context"
"sync" "sync"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
var ( var (

View File

@@ -1,7 +1,7 @@
package profile package profile
import ( import (
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
) )
// core:profiles/user/12345-1234-125-1234-1235 // core:profiles/user/12345-1234-125-1234-1235

View File

@@ -1,7 +1,7 @@
package profile package profile
import ( import (
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
func makeDefaultGlobalProfile() *Profile { func makeDefaultGlobalProfile() *Profile {

View File

@@ -6,7 +6,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/Safing/portmaster/intel" "github.com/safing/portmaster/intel"
) )
// Endpoints is a list of permitted or denied endpoints. // Endpoints is a list of permitted or denied endpoints.

View File

@@ -4,7 +4,7 @@ import (
"net" "net"
"testing" "testing"
"github.com/Safing/portbase/utils/testutils" "github.com/safing/portbase/utils/testutils"
) )
func testEndpointDomainMatch(t *testing.T, ep *EndpointPermission, domain string, expectedResult EPResult) { func testEndpointDomainMatch(t *testing.T, ep *EndpointPermission, domain string, expectedResult EPResult) {

View File

@@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
// Flags are used to quickly add common attributes to profiles // Flags are used to quickly add common attributes to profiles

View File

@@ -3,7 +3,7 @@ package profile
import ( import (
"testing" "testing"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
func TestProfileFlags(t *testing.T) { func TestProfileFlags(t *testing.T) {

View File

@@ -9,7 +9,7 @@ package profile
// "regexp" // "regexp"
// "strings" // "strings"
// //
// "github.com/Safing/portbase/log" // "github.com/safing/portbase/log"
// ) // )
// //
// type Framework struct { // type Framework struct {

View File

@@ -4,7 +4,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/Safing/portbase/utils" "github.com/safing/portbase/utils"
) )
// GetPathIdentifier returns the identifier from the given path // GetPathIdentifier returns the identifier from the given path

View File

@@ -15,7 +15,6 @@ func TestGetPathIdentifier(t *testing.T) {
testPathID(t, "/home/user/project/main", "project/main") testPathID(t, "/home/user/project/main", "project/main")
testPathID(t, "/root/project/main", "project/main") testPathID(t, "/root/project/main", "project/main")
testPathID(t, "/tmp/a/b/c/d/install.sh", "c/d/install.sh") testPathID(t, "/tmp/a/b/c/d/install.sh", "c/d/install.sh")
testPathID(t, "/sbin/init", "sbin/init")
testPathID(t, "/lib/systemd/systemd-udevd", "lib/systemd/systemd-udevd") testPathID(t, "/lib/systemd/systemd-udevd", "lib/systemd/systemd-udevd")
testPathID(t, "/bundle/ruby/2.4.0/bin/passenger", "bin/passenger") testPathID(t, "/bundle/ruby/2.4.0/bin/passenger", "bin/passenger")
testPathID(t, "/usr/sbin/cron", "sbin/cron") testPathID(t, "/usr/sbin/cron", "sbin/cron")

View File

@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/utils" "github.com/safing/portbase/utils"
) )
// ProfileIndex links an Identifier to Profiles // ProfileIndex links an Identifier to Profiles

View File

@@ -1,13 +1,13 @@
package index package index
import ( import (
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/query" "github.com/safing/portbase/database/query"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
) )
// FIXME: listen for profile changes and update the index // FIXME: listen for profile changes and update the index

View File

@@ -1,7 +1,7 @@
package matching package matching
import ( import (
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
) )
// core:profiles/user/12345-1234-125-1234-1235 // core:profiles/user/12345-1234-125-1234-1235

View File

@@ -3,8 +3,8 @@ package matcher
import ( import (
"strings" "strings"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
) )
// CheckFingerprints checks what fingerprints match and returns the total score. // CheckFingerprints checks what fingerprints match and returns the total score.

View File

@@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
) )
// GetIdentificationPath returns the identifier for the given process (linux edition). // GetIdentificationPath returns the identifier for the given process (linux edition).

View File

@@ -3,7 +3,7 @@ package matcher
import ( import (
"testing" "testing"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
) )
func TestGetIdentifierLinux(t *testing.T) { func TestGetIdentifierLinux(t *testing.T) {

View File

@@ -4,10 +4,10 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portmaster/process" "github.com/safing/portmaster/process"
"github.com/Safing/portmaster/profile" "github.com/safing/portmaster/profile"
"github.com/Safing/portmaster/profile/index" "github.com/safing/portmaster/profile/index"
) )
// GetProfileSet finds a local profile. // GetProfileSet finds a local profile.

View File

@@ -1,10 +1,10 @@
package profile package profile
import ( import (
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
// module dependencies // module dependencies
_ "github.com/Safing/portmaster/core" _ "github.com/safing/portmaster/core"
) )
var ( var (

View File

@@ -7,8 +7,8 @@ import (
uuid "github.com/satori/go.uuid" uuid "github.com/satori/go.uuid"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
var ( var (
@@ -65,11 +65,7 @@ func MakeProfileKey(namespace, ID string) string {
// Save saves the profile to the database // Save saves the profile to the database
func (profile *Profile) Save(namespace string) error { func (profile *Profile) Save(namespace string) error {
if profile.ID == "" { if profile.ID == "" {
u, err := uuid.NewV4() profile.ID = uuid.NewV4().String()
if err != nil {
return err
}
profile.ID = u.String()
} }
if !profile.KeyIsSet() { if !profile.KeyIsSet() {

View File

@@ -5,7 +5,7 @@ import (
"net" "net"
"sync" "sync"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
var ( var (

View File

@@ -1,12 +1,13 @@
package profile package profile
import ( import (
"context"
"net" "net"
"testing" "testing"
"time" "time"
"github.com/Safing/portbase/utils/testutils" "github.com/safing/portbase/utils/testutils"
"github.com/Safing/portmaster/status" "github.com/safing/portmaster/status"
) )
var ( var (
@@ -140,7 +141,7 @@ func testEndpointIP(t *testing.T, set *Set, domain string, ip net.IP, protocol u
func TestProfileSet(t *testing.T) { func TestProfileSet(t *testing.T) {
set := NewSet("[pid]-/path/to/bin", testUserProfile, testStampProfile) set := NewSet(context.Background(), "[pid]-/path/to/bin", testUserProfile, testStampProfile)
set.Update(status.SecurityLevelDynamic) set.Update(status.SecurityLevelDynamic)
testFlag(t, set, Whitelist, false) testFlag(t, set, Whitelist, false)

View File

@@ -3,7 +3,7 @@ package profile
import ( import (
"sync" "sync"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
) )
var ( var (

View File

@@ -4,9 +4,9 @@ import (
"strings" "strings"
"sync/atomic" "sync/atomic"
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/query" "github.com/safing/portbase/database/query"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
func initUpdateListener() error { func initUpdateListener() error {

View File

@@ -1,9 +1,9 @@
package status package status
import ( import (
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/database/query" "github.com/safing/portbase/database/query"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
) )
const ( const (

View File

@@ -1,7 +1,7 @@
package status package status
import ( import (
"github.com/Safing/portbase/config" "github.com/safing/portbase/config"
) )
type ( type (

View File

@@ -1,12 +1,12 @@
package status package status
import ( import (
"github.com/Safing/portbase/database" "github.com/safing/portbase/database"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
// module dependencies // module dependencies
_ "github.com/Safing/portmaster/core" _ "github.com/safing/portmaster/core"
) )
var ( var (

View File

@@ -3,7 +3,7 @@ package status
import ( import (
"sync/atomic" "sync/atomic"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
// autopilot automatically adjusts the security level as needed // autopilot automatically adjusts the security level as needed

View File

@@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/Safing/portbase/database/record" "github.com/safing/portbase/database/record"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
var ( var (

View File

@@ -1,6 +1,6 @@
package threats package threats
import ( import (
_ "github.com/Safing/portmaster/threats/arp" _ "github.com/safing/portmaster/threats/arp"
_ "github.com/Safing/portmaster/threats/portscan" _ "github.com/safing/portmaster/threats/portscan"
) )

View File

@@ -5,7 +5,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/Safing/portbase/log" "github.com/safing/portbase/log"
) )
const ( const (

View File

@@ -1,15 +1,15 @@
package ui package ui
import ( import (
"github.com/Safing/portbase/api" "github.com/safing/portbase/api"
"github.com/Safing/portbase/modules" "github.com/safing/portbase/modules"
) )
func init() { func init() {
modules.Register("ui", prep, nil, nil, "updates", "api") modules.Register("ui", prep, nil, nil, "updates", "api")
api.SetDefaultAPIListenAddress("127.0.0.1:817")
} }
func prep() error { func prep() error {
api.SetDefaultAPIListenAddress("127.0.0.1:817")
return registerRoutes() return registerRoutes()
} }

Some files were not shown because too many files have changed in this diff Show More