fix(proxy): master domain routing for remote apps/services#8680
fix(proxy): master domain routing for remote apps/services#8680Iisyourdad wants to merge 16 commits intocoollabsio:nextfrom
Conversation
There was a problem hiding this comment.
Not necessarily a bad idea, but it comes with a few flaws / oversights.
From what I can tell, you are right now only covering service routes, but not applications. So as soon as you deploy a application, it won't work. The same probably applies for database proxies as well, would need to check the code again to confirm.
There are users who use Coolify actually the opposite way. Have the Coolify dashboard on a non-public, private network, while every other remote server is public.
Also one server as the entrypoint makes it a single point of failure.
It would probably be better if this is a setting people can opt-in from the UI, not make it the default behavior for every user.
I probably missed a few more points, I didn't actually test the implementation myself, just glanced over the code. Also make sure to actually do a integration test, aka test with a running Coolify installation, not just running the Unit test files.
|
I see your point about the applications, I'll make sure that that is resolved and I didn't think about people having coolify the opposite way. I'll look into this and also add a button in the server config that will let users opt into this. |
|
Howdy @Cinzya, I added support for applications and databases. I also added in a "master server" option in the server config that enables or disables this feature. I did implementation test on my machine and it works. I also added some more test cases via the command below. I had Codex write some of these test cases just because I couldn't get every edge case.
|
…AKA, fix the entire thing.
|
I found an error when I implemented this on my on VPS running coolify. TLS certificates would not route properly whenever the port on the secondary server wasn't resolved. I have implemented this PR on my own VPS and have seen that it has worked. I have tested it with the one click deploy of VERT which does work (with https). I just tried it on the one minecraft server and unfortunately it didn't work which I'm working on currently. |
|
Howdy @Cinzya, I have fixed the issue I found and tested both http/https and tcp applications running on a live VPS and a secondary home server. I tested the "Master router" feature where only one server has all the DNS records set to it and only one server can enable this feature. From there, I deployed the one click service VERT which ran as expected and I also ran the one click minecraft server aswell and it worked as expected. How I had my system set up is the main vps with *.twestbrook.com pointed to it and my home server connected via wireguard over ssh. From there, the end user types in the domain that they want and it gets routed to the appropriate server after passing through the master server, or in my case, to the vps then to the home server. Please let me know if you have any questions! |
|
Let me know if/when you want me to update documentation on this. |
…orwarding # Conflicts: # app/Actions/Database/StartDatabaseProxy.php
There was a problem hiding this comment.
Line 5
'version' => '4.0.0-beta.465', must be changed.
|
@Cinzya and @ShadowArcanist, would either of you mind reviewing this PR when you get a chance? I know it is a large PR so I completely understand that it may take some time. I currently have it running on my personal VPS with other servers connected to it and it has been working in my testing/use case. The overall idea is somewhat similar to a Kubernetes cluster. I did not want to ping Peak or Andras since I know they are busy with the recent updates, but I would really appreciate it if one of yall had time to look it over. |
Sorry, I’m unable to review this PR because the changes are beyond my current level of familiarity with the codebase. |
Add ability to gather and display server system information including OS, architecture, kernel version, CPU count, memory, and uptime. Includes: - New gatherServerMetadata() method to collect system details via remote commands - New refreshServerMetadata() Livewire action with authorization and error handling - Server Details UI section showing collected metadata with refresh capability - Database migration to add server_metadata JSON column - Comprehensive test suite for metadata collection and persistence
|
I readded one of the features in the new update which was a merge conflict. I readded the "Server Details" feature in servers. |
|
@andrasbacsai and/or @peaklabs-dev , would either of you mind reviewing this PR when you get a chance? I know it is a large PR so I completely understand that it may take some time. I currently have it running on my personal VPS with other servers connected to it and it has been working in my testing/use case. The overall idea is somewhat similar to a Kubernetes cluster. |
Changes
TLDR: Added the option to have a master domain router like a Kubernetes cluster.
Added
EdgeProxyRemoteRouteServiceto generate edge Traefik routes for remote services and applications.Added opt-in Master Domain Router setting (single server per team), instead of forcing this behavior globally.
Edge now writes stable dynamic files:
/data/coolify/proxy/dynamic/service-remote-<service-uuid>.yaml/data/coolify/proxy/dynamic/application-remote-<application-uuid>.yamlGenerated config includes:
certResolver=letsencrypthttp://<remote_host>:<published_host_port>Deploy/redeploy updates route files; delete removes them.
Missing/invalid host or port is skipped with warnings.
Added remote database proxy master-routing support and tests:
EdgeProxyRemoteRouteServiceTestDatabaseProxyMasterRoutingTestServerMasterDomainRouterSettingTestIssues
Closes #8668
Category
Preview
AI Assistance
If AI was used:
Testing
php artisan test tests/Unit/EdgeProxyRemotePortForwardServiceTest.php tests/Unit/EdgeProxyRemoteRouteServiceTest.php tests/Unit/DatabaseProxyMasterRoutingTest.php50 passed (230 assertions)Verified by tests:
certResolver=letsencrypthttp://<remote_host>:<published_host_port>Contributor Agreement
Important