-
Notifications
You must be signed in to change notification settings - Fork 166
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.
@ab77
Excellent, I liked contributing to the project, even if it was a little small.
I am developing on my own an api in fast api that communicates with the openbalena api in cases where at least 3 requests have to be made, everything is simplified with 1.
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 , will my suggested change be applied one day or never?
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 we can't merge this change until there is support for env-var interpolation at the balena-compose level.
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 do you like my proposal? Who does that depend on? I understand that it is not mandatory for my proposal to be accepted and perhaps I am the only openbalena user who needs it, I say this because if I manually modify docker compose and then do a git pull to update openbalena, an error will be generated in the merge, that is the only reason why I want you to apply that change
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