-
Notifications
You must be signed in to change notification settings - Fork 167
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
Make VPN port configurable in api service via environment variable #271
base: master
Are you sure you want to change the base?
Conversation
Could you please add a change-type (see 52d0eb6) |
I've added the |
We don't support merged commits in the CI workflow, see here. Can you please squash your work down to a single commit, annotated with the |
1af60eb
to
45a29dd
Compare
I've squashed the commits into a single commit and added Thank you! |
45a29dd
to
2d6c858
Compare
Fails tests due to commit being out of tree, need to think about how to solve this for external contributors..
|
Head branch was pushed to by a user without write access
2d6c858
to
c4cdb29
Compare
With the help of chat gpt, I have updated the fork: Will that be enough? |
c4cdb29
to
4c7f46b
Compare
4c7f46b
to
9a9a9e0
Compare
9a9a9e0
to
5ac70b3
Compare
5ac70b3
to
90d20a9
Compare
@@ -108,7 +108,7 @@ services: | |||
TOKEN_AUTH_JWT_ALGO: ES256 | |||
TOKENS_CONFIG: API_SERVICE_API_KEY:hex,AUTH_RESINOS_REGISTRY_CODE:hex,COOKIE_SESSION_SECRET:hex,JSON_WEB_TOKEN_SECRET:hex,MIXPANEL_TOKEN:hex,SUPERUSER_PASSWORD:hex,TOKEN_AUTH_BUILDER_TOKEN:hex,VPN_GUEST_API_KEY:hex,VPN_SERVICE_API_KEY:hex,API_VPN_SERVICE_API_KEY:API_SERVICE_API_KEY,REGISTRY2_TOKEN:TOKEN_AUTH_BUILDER_TOKEN | |||
TRUST_PROXY: 172.16.0.0/12 | |||
VPN_PORT: 443 | |||
VPN_PORT: ${VPN_PORT:-443} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matiasAS thank you, there are a few blockers on our side in relation to your PR, one I've already mentioned in this comment and the other is the way balena-cli currently handles env-var interpolation (different to compose). We are working on resolving both of these blockers and once we have a resolution, we should be able to hopefully merge this work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, is the blocking of the previous comments ok now?
Is the problem with the environment variable related to the fact that the version of Docker Compose is 2.4 and that way of defining it is for a more current version like 3.8, for example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ab77
Sorry for asking again, do I have to do something else, or just wait for the other part of the environment variables to be resolved? Greetings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @ab77 , any progress with my suggestion of making the VPN port customizable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, now only the balena-ci blocker remains, this is on us @matiasAS: balena-io/balena-cli#2818
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's rather more likely that we'd migrate ll of this to Kubernetes before balena-compose understands env. var. interpolation. In the mean time, just use sed
or similar to patch the composition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ab77 ok, I have learned that if I use docker-compose.override.yml by running "docker compose up -d" docker replaces the original docker compose in memory without applying changes. That is my solution, I have not decided to modify the original docker-compose.yml because if I update I will have a git conflict error.
I don't have much experience with kubernetes to be honest, but I think it looks good, I guess it will be better that way.
I take the opportunity to ask, do you plan to implement more Balena Cloud functionalities in Openbalena? For example: the public url of the devices, SSH connection without doing the tunnel, update delta, etc.
Greetings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you plan to implement more Balena Cloud functionalities in Openbalena? For example: the public url of the devices, SSH connection without doing the tunnel, update delta, etc.
No plans at present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ab77 I am still on openbalena v3, and I have also tried v4, could there be breaking change updates that break the system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ab77 I am still on openbalena v3, and I have also tried v4, could there be breaking change updates that break the system?
90d20a9
to
cecfddb
Compare
Website deployed to CF Pages, 👀 preview link https://f4d61b54.open-balena.pages.dev |
Added .idea to gitignore Change-type: minor
cecfddb
to
a9de205
Compare
Description
This pull request modifies the docker-compose.yml file to allow the VPN port of the api service to be configurable via an environment variable (VPN_PORT). If the environment variable is not set, the default value 443 will be used.
Reason
Hetzner server
Proxmox
pfSense for networking
Nginx Proxy Manager as a reverse proxy for services
Cloudflare in front
I encountered the following error on devices connecting to the VPN:
Jun 30 04:05:08 a179fab openvpn[6532]: 2024-06-30 04:05:08 WARNING: Bad encapsulated packet length from peer (18516), which must be > 0 and <= 1627 -- please ensure that --tun-mtu or --link-mtu is equal on both peers -- this condition could also indicate a possible active attack on the TCP link -- [Attempting restart...]
An alternative solution to getting a new dedicated public IP for the virtual machine hosting OpenBalena was to change the VPN port to 4443, and then set up port forwarding from the public IP of pfSense to port 443 of the virtual machine.
From my research, the error was due to using pfSense and/or Nginx Proxy Manager along with Cloudflare, causing OpenVPN to "confuse" it with an HTTPS connection.
I want this change to avoid modifying the docker-compose.yml file directly and to prevent errors when updating with git pull due to file modifications.
The ideal and correct solution might be to use a dedicated IP, but I also did this to save money, even if it's a little less than 2 euros; it's still worth it, right?
Best regards,
Matias Alvarez Sabate