Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for listening on and connecting to I2P and Onion services securely #3293

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4e3257b
add a demo of Dendrite-over-I2P
Jul 21, 2023
34cd9f7
update i2p demo
Nov 20, 2023
24b93e4
remove unused flags
Nov 20, 2023
b9c605a
clean up
Nov 20, 2023
05816a2
Allow self-signed certs when using a SAMv3 dialer, disallow non-I2P h…
Nov 21, 2023
d1241d8
Merge branch 'matrix-org:main' into i2p-demo
eyedeekay Nov 26, 2023
e247f04
Add branch updater script
Nov 26, 2023
d7e4b1b
Add branch updater script
Nov 26, 2023
892d088
add instructions
Nov 27, 2023
d43e3cc
fix curlpipe
Nov 28, 2023
8c86ef6
It's less easy, but still possible, to set up a Tor demo service
Dec 27, 2023
aa855c6
Merge branch 'matrix-org:main' into i2p-demo
eyedeekay Dec 27, 2023
8ed0365
remove index.html
Dec 27, 2023
2668607
Merge branch 'i2p-demo' of github.com:eyedeekay/dendrite into i2p-demo
Dec 27, 2023
613f075
remove README_I2P
Dec 27, 2023
5f778d5
Update onramp version to 0.33.7, which sets i2cp.leaseSetEncType=4,0 …
Jan 10, 2024
da7c367
Use shorter tunnels with more redundancy when serving the homeserver
Jan 25, 2024
04de572
Use longer tunnels with more redundancy when serving the homeserver
Jan 25, 2024
4f23dba
Merge branch 'main' of github.com:matrix-org/dendrite into i2p-demo
S7evinK Feb 29, 2024
2aa0abb
Move to contrib
S7evinK Feb 29, 2024
3370e50
go mod tidy
S7evinK Feb 29, 2024
b3c663f
Disable err checks
S7evinK Feb 29, 2024
5d36ec5
Merge branch 'main' of github.com:matrix-org/dendrite into i2p-demo
S7evinK Aug 3, 2024
e030f0b
Merge branch 'main' of github.com:matrix-org/dendrite into i2p-demo
S7evinK Aug 3, 2024
4341cd2
Tor demo: Delete unused --flag samAddr
eyedeekay Aug 3, 2024
5098937
Tor demo: delete unused 'flag' library
eyedeekay Aug 3, 2024
11b284a
Skip tests that require external services(Tor, I2P) when running in CI
eyedeekay Aug 6, 2024
ef53e8b
Look up environment variables and determine if they are set or not in…
eyedeekay Aug 20, 2024
5124858
disable tests completely, something wierd is going on
eyedeekay Aug 21, 2024
dd6095f
Delete the tests, WTF, there are no tests to run so they can't fail r…
eyedeekay Aug 21, 2024
51d8d86
just comment out the whole test file
eyedeekay Aug 21, 2024
32ddf2a
uncomment tests and re-run them but what the hell
eyedeekay Aug 21, 2024
2602355
fix the test by checking the CI variable in the real main, not in the…
eyedeekay Aug 21, 2024
b0d4d7c
bail out of the main sooner when testing
eyedeekay Aug 21, 2024
0832209
Fall back to Tor when it is not an I2P host
eyedeekay Sep 12, 2024
246a9a4
Format everything
eyedeekay Sep 13, 2024
2b580bc
Fix comment
eyedeekay Sep 13, 2024
9aa7222
Merge branch 'main' into i2p-demo
eyedeekay Sep 13, 2024
a9da770
Resolve merge conflicts and remove unused files
eyedeekay Sep 13, 2024
e4785eb
update onramp version
eyedeekay Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format everything
  • Loading branch information
eyedeekay committed Sep 13, 2024
commit 246a9a4d23bb47bff52bdd55ccb2548e41f2a42a
6 changes: 4 additions & 2 deletions contrib/dendrite-demo-i2p/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ import (
"github.com/matrix-org/dendrite/userapi"
)

var samAddr = flag.String("samaddr", "127.0.0.1:7656", "Address to connect to the I2P SAMv3 API")
var _, skip = os.LookupEnv("CI")
var (
samAddr = flag.String("samaddr", "127.0.0.1:7656", "Address to connect to the I2P SAMv3 API")
_, skip = os.LookupEnv("CI")
)

func main() {
cfg := setup.ParseFlags(true)
Expand Down
14 changes: 11 additions & 3 deletions contrib/dendrite-demo-i2p/main_i2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ func dialer() (*tor.Dialer, error) {
return t.Dialer(context.TODO(), nil)
}

var t, terr = start()
var tdialer, tderr = dialer()
var (
t, terr = start()
tdialer, tderr = dialer()
)

// Dial a network connection to an I2P server or a unix socket. Fail for clearnet addresses.
func Dial(network, addr string) (net.Conn, error) {
Expand All @@ -85,6 +87,12 @@ func Dial(network, addr string) (net.Conn, error) {
if strings.HasSuffix(url.Host, ".i2p") {
return sam.Dial(network, addr)
}
if terr != nil {
return nil, terr
}
if (tderr != nil) || (tdialer == nil) {
return nil, tderr
}
return tdialer.Dial(network, addr)
}

Expand Down Expand Up @@ -139,7 +147,7 @@ func SetupAndServeHTTPS(
},
}

//Redirect for Landing Page
// Redirect for Landing Page
externalRouter.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, httputil.PublicStaticPath, http.StatusFound)
})
Expand Down
4 changes: 1 addition & 3 deletions contrib/dendrite-demo-i2p/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import (
// Generate HTML with coverage: go tool cover -html=/somewhere/where/there/is/integrationcover.out -o cover.html
// Source: https://dzone.com/articles/measuring-integration-test-coverage-rate-in-pouchc
func TestMain(t *testing.T) {
var (
args []string
)
var args []string

for _, arg := range os.Args {
switch {
Expand Down
4 changes: 1 addition & 3 deletions contrib/dendrite-demo-tor/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import (
// Generate HTML with coverage: go tool cover -html=/somewhere/where/there/is/integrationcover.out -o cover.html
// Source: https://dzone.com/articles/measuring-integration-test-coverage-rate-in-pouchc
func TestMain(t *testing.T) {
var (
args []string
)
var args []string

for _, arg := range os.Args {
switch {
Expand Down
8 changes: 5 additions & 3 deletions contrib/dendrite-demo-tor/main_tor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ func dialer() (*tor.Dialer, error) {
return t.Dialer(context.TODO(), nil)
}

var t, terr = start()
var tdialer, tderr = dialer()
var (
t, terr = start()
tdialer, tderr = dialer()
)

// Dial either a unix socket address, or connect to a remote address over Tor. Always uses Tor.
func Dial(network, addr string) (net.Conn, error) {
Expand Down Expand Up @@ -127,7 +129,7 @@ func SetupAndServeHTTPS(
},
}

//Redirect for Landing Page
// Redirect for Landing Page
externalRouter.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, httputil.PublicStaticPath, http.StatusFound)
})
Expand Down