feat(templates): add openpanel template & svg logo
Changes
- Added
openpanel.yamltemplate service - Added
openpanel.svglogo
~This is my first time setting a coolify template, not sure but I have an issue when adding a custom domain, to make it work I had to remove the following in my docker compose:~
# Set coolify FQDN domain
- NEXT_PUBLIC_API_URL=$SERVICE_FQDN_OPENPANELAPI
- NEXT_PUBLIC_DASHBOARD_URL=$SERVICE_FQDN_OPENPANEL
~And set it like this to make it work:~
# Set custom domain
- NEXT_PUBLIC_DASHBOARD_URL=${NEXT_PUBLIC_DASHBOARD_URL:-https://your-domain.com}
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-https://your-domain.com/api}
~Not sure why it doesn't work modifying the NEXT_PUBLIC_API_URL and NEXT_PUBLIC_DASHBOARD_URL directly via the coolify UI.~
Edit: I got it working now with Coolify FQDN thanks to @dickwolff reply: https://github.com/coollabsio/coolify/pull/5310#issuecomment-2762641740
@gurvancampion I dont know if it helps, but while trying your docker-compose I got the FQDN to work by matching it with the service name. So I renamed it from op-api to api and then by doing SERVICE_FQDN_API changing the domain via the UI and saving it also updates the environment variable. And the same for the dashboard.
Edit: and I also found out about the missing variables on the dashboard, which I see you also already added.
@dickwolff Oh you are right, I just tried again by matching my docker service name with SERVICE_FQDN_<SERVICENAME> and now it works!
@gurvancampion I tried your file again to verify and the FQDN works as expected. However when I open the dashboard, I see some weird behavior and a lot of failing API calls like https://openpanelapi-o4ococggw08gwc0gsckgsos8.mycoolifyinstance.tld/api/misc/favicon?url=https%3A%2F%2Fupload.w.... Do you also see this? My API URL is set to something else then specified above.
Apart from that, both the API and Dashboard seem to be running just fine, but they are being reported as unhealthy in Coolify. Not sure if this is down to that there isn't a health check specified.
@dickwolff Did you restart the services after you changed the domains?
If you change the domain on the API, the dashboard (Next.js) needs to be rebuilt (by doing a restart) to properly set the new API URL. Before I had similar failing API calls, it was because the FQDN didn't work, so it was using the wrong URL. But I do remember also having an issue with cache (my domain is using Cloudflare), it was using cached files from my previous build (tests) calling the wrong API URL.
Regarding the "unhealthy", yes it's because there are no health checks specified
@gurvancampion I put everything under a new FQDN and then it was working. When I change the API URL and redeploy, then it keeps the old API URL. I also use Cloudflare on my domain, could be that they are doing some caching stuff.
Edit: after fully purging the cache on Cloudflare, new stuff is being picked up.
Edit 2: unfortunately not I can't seem to log in. Purged all relevant caches, even tried to redeploy the whole stack again. Now the web app says "successfully signed in", but then does nothing, no session created etc..
@gurvancampion I put everything under a new FQDN and then it was working. When I change the API URL and redeploy, then it keeps the old API URL. I also use Cloudflare on my domain, could be that they are doing some caching stuff.
Edit: after fully purging the cache on Cloudflare, new stuff is being picked up.
Edit 2: unfortunately not I can't seem to log in. Purged all relevant caches, even tried to redeploy the whole stack again. Now the web app says "successfully signed in", but then does nothing, no session created etc..
When I was doing mass testing at the beginning, I had to put my Cloudflare domain in development mode temporarily to avoid issues with the dashboard domain picking up old files from previous deployments.
@dickwolff Regarding your issues after signing in, do you have any errors in your services logs?
Thanks for this! I'm however unfortunately not getting it to work fully. A couple of issues:
- When using the default URLs for the API and Dashboard, both load - however they default to http (not https) which breaks calling the API from my website. The Dashboard seems to work though.
- When changing both the API and Dashboard URLs to e.g.,
https://mycoolifysite.com/op-apiandhttps://mycoolifysite.com/op-dashboard, the API seems to work, but the dashboard doesn't. Instead, I get redirected back tohttps://mycoolifysite.comjust like I do with any /path that doesn't exist. This applies for any /path I use. - If I change only the API URL, I can create an account in the Dashboard however I cannot log in or proceed with the onboarding.
Any idea what could be the cause of these issues and how to fix them? Would love to see this merged.
Thanks for this! I'm however unfortunately not getting it to work fully. A couple of issues:
- When using the default URLs for the API and Dashboard, both load - however they default to http (not https) which breaks calling the API from my website. The Dashboard seems to work though.
- When changing both the API and Dashboard URLs to e.g.,
https://mycoolifysite.com/op-apiandhttps://mycoolifysite.com/op-dashboard, the API seems to work, but the dashboard doesn't. Instead, I get redirected back tohttps://mycoolifysite.comjust like I do with any /path that doesn't exist. This applies for any /path I use.- If I change only the API URL, I can create an account in the Dashboard however I cannot log in or proceed with the onboarding.
Any idea what could be the cause of these issues and how to fix them? Would love to see this merged.
- Hmm, I never had this issue. If you have a wildcard domain set on your server, it should generate https FQDN, no?
- Seems to be a proxy configuration issue, did you restart the services after you changed the domains?
- May be related to point 2, the best would be to check the logs on the dashboard and API service to have any glue about what could be wrong
I have similar issues as you @gustavfridell with #3. I run Coolify behind Cloudflare and I seem to have some cache issues. I tried to test some things today with Cloudflare but didn't have time to finish my testing.
Thanks! That solved it, specifically adding a wildcard subdomain on Cloudflare and running the API and Dashboard as https://op-api.mycoolifysite.com and https://op-dashboard.mycoolifysite.com respectively.
Another issue I encountered is that it seems like the environment variable OPENPANEL_ALLOW_REGISTRATION doesn't work correctly. I have it set to false (which is the default value) but I can still register new users on the dashboard. Could be an issue where false is interpreted as a truthy string, but haven't looked into it.
One thing that's different from my end is that i'm trying to run the API and dashboard on separate domains (so API on api.domaina.com, and the dashboard on dashboard.domainb.com). But I would think that doesn't make the difference as both are wildcard domains.
Is there a way to update to the latest version of OpenPanel using this template? The standard self-hosting guide has an ./update script as described here.
I haven't tried yet to update a service in Coolify but currently there are no more recent Docker images for OpenPanel https://hub.docker.com/u/lindesvard
I guess modifying each service version in the docker compose file and click on "Pull latest images & restart" would probably do it
It was a mistake, sorry. I recreated the next branch and it auto-closed this PR.
@lindesvard are you satisfied with this PR? OpenPanel is great so would love to see it merged.
@lindesvard are you satisfied with this PR? OpenPanel is great so would love to see it merged.
Mostly yes but 2 things:
- @reynaldichernando had suggestion to bake in geo db into the api https://github.com/Openpanel-dev/openpanel/issues/153, then this docker compose would be a bit simpler
- I'll hopefully release new versions of self-hosting this week
So could we hold this PR open for a couple of days?
If I'm blocking you guys, maybe we could just proceed with this PR, and I can make another PR to coolify for updating the compose.yml when my change is finished?
If I'm blocking you guys, maybe we could just proceed with this PR, and I can make another PR to coolify for updating the compose.yml when my change is finished?
@reynaldichernando I'm fine waiting like @lindesvard suggested - sounds like great improvements. Thanks both.
Let's wait a bit then 👌
Thank you for your contribution. Due to inactivity, we're closing this PR. If you'd like to revisit this change, feel free to reopen this PR or open a new pull request.
@lindesvard and @gurvancampion - are there any plans on reopening this with @peaklabs-dev's suggested changes?
Just tried this yesterday on coolify so I'm keen of opening it. But have notified some things that can be better.
Will also make sure the docker compose gets all necessary changes.
Will be my weekend mission.
Apart from that, all things we waited for before is done ✅
Okey, I have done my tests (not really used to Coolify so I'm not sure what edge cases exists) and it works good.
Here is the templated I used (I've done some changes to @gurvancampion original file)
~~https://github.com/Openpanel-dev/openpanel/blob/92d62c3e5c679d6382b6d50de71c8c38dac0dd8e/self-hosting/coolify.yml~~
I have fixed all comments @peaklabs-dev has made except run command for the API. I think I would like to have the check before running migrations to be sure the services are live.
edit new link: https://github.com/Openpanel-dev/openpanel/blob/main/self-hosting/coolify.yml
Great, I've pushed a new commit with @lindesvard changes and made few adjustments:
https://github.com/gurvancampion/coolify/commit/1632e5e9b1347d0d841b12c6a4a71bb8d5a388e8
- Modified the API run command to only run migrations. I didn't encounter any issue in my tests; it seems like it relies correctly on the "depends_on" healthy services configuration.
- Modified the environment
SERVICE_FQDN_OPAPI=/apitoSERVICE_FQDN_OPAPI, which was causing an issue when requesting from the Dashboard to the API with a generated domain name from Coolify FQDN or when setting a custom domain name.
I've tested with Coolify FQDN generated domain names and by setting custom ones (e.g: https://op-api.mydomain.com, https://op-dashboard.mydomain.com & https://op-bullboard.mydomain.com), it's all working correctly.
@peaklabs-dev I cannot reopen this PR with our changes, Could you reopen it?
@gurvancampion have you really pushed? 🤔
@gurvancampion have you really pushed? 🤔
Yes I did push here: https://github.com/gurvancampion/coolify/commit/1632e5e9b1347d0d841b12c6a4a71bb8d5a388e8
@gurvancampion that commit (or your changes) does not exists in this PR at least 🤷♂️
@gurvancampion that commit (or your changes) does not exists in this PR at least 🤷♂️
Yes seems like I don't have the right to reopen the PR, so my changes are not taken. @peaklabs-dev could you reopen it? or shoud we create a new PR?
@gurvancampion PR is now opened, in case you missed it. Thanks @peaklabs-dev!
Thanks for the PR. I will fix it a bit.