Commit Graph

18 Commits

Author SHA1 Message Date
Thomas Eizinger
94527f9fa1 fix(gateway): always masquerade for docker-deployed gateways (#6169)
Without masquerading, packets sent by the gateway through the TUN
interface use the wrong source address (the TUN device's address)
instead of the gateway's actual network interface.

We set this env variable in all our uses of the gateway, thus we might
as well remove it and always perform unconditionally.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-08-07 03:00:50 +00:00
Jamil
5dbf834313 feat(gateway): added support for docker secrets (#5031) (#5043)
Added a simple check in docker-init.sh so it's possible to provide a
file path instead of plain token.

---------

Co-authored-by: Lis <olgagorbushina1980@gmail.com>
2024-05-21 20:48:10 -07:00
Jamil
19a7bac4ae chore(ci): enforce shellscript formatting and style (#3679)
Noticed that we all have different styles of writing scripts :-).

This PR adds linting to our shell scripts to standardize on formatting,
catch common issues and/or possible security bugs.

For editor setup:
- Ensure [`shellcheck`](https://github.com/koalaman/shellcheck) and
[`shfmt`](https://github.com/mvdan/sh) are in your `PATH`
- Configure `shfmt` with indentation of `4`, otherwise it uses tabs by
default.
[Here](https://github.com/jamilbk/nvim/blob/master/init.vim#L159) is how
you can do that with Vim and
[here](https://marketplace.visualstudio.com/items?itemName=mkhl.shfmt)
is how for VScode.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Brian Manifold <bmanifold@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2024-02-21 01:01:32 +00:00
Jamil
df3953983c fix(ci): Fix publish step to publish multi-arch images for public use (#3287)
* Remove `--pull-tags`
* Correctly build and push multi-arch images for public use
* re-revert Fix POSIX shell issue
* re-revert Fix Gateways masquerading for wireless interfaces
2024-01-17 18:03:27 -08:00
Jamil Bou Kheir
1d80af79bc Revert docker-init.sh 2024-01-17 03:45:39 -08:00
Jamil Bou Kheir
fda49a17d6 Don't escape args 2024-01-17 00:12:05 -08:00
Jamil
9d476d83e4 fix(devops): Fix shellcheck errors for docker-init.sh script (#3265) 2024-01-16 12:05:40 -08:00
Jamil
856f72cd4b fix(ci): shell is dash on debian slim (#3261) 2024-01-16 11:27:46 -08:00
Jamil
b8e2a59570 fix(connlib): Use debian:12-slim for Rust base image (#3243)
Fixes #3215
2024-01-16 01:53:32 +00:00
Andrew Dryga
98383e8622 Introduce Sites (#2516)
Closes #2513
2023-10-27 13:10:36 -06:00
Jamil
fa57d66965 Publish Releases (#2344)
- rebuild and publish gateway and relay binaries to currently drafted
release
- re-tag current relay/gateway images and push to ghcr.io

Stacked on #2341 to prevent conflicts

Fixes #2223 
Fixes #2205 
Fixes #2202
Fixes #2239 

~~Still TODO: `arm64` images and binaries...~~ Edit: added via
`cross-rs`
2023-10-20 14:20:43 -07:00
Gabi
5a998f7373 connlib: add logging string configuration (#2115)
Split from #2104

This adds logging string configuration, unifies behavior between gateway
and headless clients and some cli improvements for those.

---------

Signed-off-by: Gabi <gabrielalejandro7@gmail.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-09-25 20:17:22 +00:00
Andrew Dryga
0006fa1a8d Auto-detect relay IPv6 2023-09-08 01:00:36 -06:00
Thomas Eizinger
79a24ca9cf feat(relay): remove LISTEN_IPX_ADDR parameters (#1922)
Previously, we required the user to specify a `LISTEN_IP4_ADDR` and/or a
`LISTEN_IP6_ADDR` parameter. This is cumbersome because dynamically
fetching the address of the local interface is not trivial in all
environments.

We remove this parameter in exchange for listening on all interfaces.
This is a trade-off. The relay will now listen on all interfaces, even
the ones not exposed to the public internet. This is true for the main
socket on port 3478 and for all created allocations. Actually relaying
data relies on the 4-tuple of a "connection", i.e. the source and
destination address and port. Technically, I think it is possible with
this change to send traffic to a relay via an interface that was not
intended to be used for that. I think this will still require spoofing
the source address which is a known and accepted problem.

It is still recommended that operators put appropriate firewall rules in
place to not allow ingress traffic on any interface other than the one
intended for relaying.

I've tested locally that we are correctly using the `IPV6_ONLY` flag. In
other words, a relay listening on the `0.0.0.0` wildcard interface will
not accept IPv6 traffic and vice versa.

Resolves #1886.
2023-08-18 09:44:41 +00:00
Andrew Dryga
c0844dfdb0 Fix discovery for listen address and make it optional 2023-08-11 12:20:58 -05:00
Andrew Dryga
9e17352fd6 Deploy relays (#1706)
Will finish once #1705 is merged and stable.

cc @thomaseizinger
2023-08-08 17:15:33 -05:00
Gabi
b563c7ad5a connlib: fix ipv6 (#1855)
Fixes some of the ipv6 handling.

Making this PR I also realized we need to update checksums on UDP and
TCP too, since we're mangling packets.
2023-08-04 03:17:35 +00:00
Gabi
eb5fc34f35 CI: add a flow that test client to resource ping (#1729)
This PR fixes a bunch of small things to allow a new flow to test
clients pinging a resource within docker compose.

Masquerade/Forwarding is enabled directly in the container for now, this
might change in the future.

Also added a README to be able to run this locally.

---------

Signed-off-by: Gabi <gabrielalejandro7@gmail.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-07-05 03:17:26 +00:00