coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
34.47k stars 1.88k forks source link

Trigger.dev template fix to disable SSL mode for db and include port in db host url #4214

Closed beejaz closed 4 days ago

beejaz commented 1 week ago

Changes

Issues

Yoda-Soda commented 6 days ago

I did run into some issues creating a Personal Access Tokens via the cli or manually, dunno if it's me issue or a trigger issue or an issue related to the docker compose config. Worth confirming before merging.

beejaz commented 6 days ago

I did run into some issues creating a Personal Access Tokens via the cli or manually, dunno if it's me a issue or a trigger issue or an issue related to the docker compose config. Worth confirming before mering.

Yes, Im stuck at that issue also. I dont think it is related to this PR but im still trying to find the reason it gives:

Authentication failed
Invalid key length

There was a problem authenticating you, please try logging in with your CLI again.

After opening URL from CLI <domain>/account/authorization-code/2U2Nnj33rq1t0A51jnXodbVdNvkzc8DwwfhJ1UxMltOISYH39QxuFGNKmMN2J_ur

CLI command: bunx trigger.dev@latest init -p proj_ymhcwzuyrpbosgykwagl -a https://<domain> -l debug

Yoda-Soda commented 6 days ago

yeah that's exactly the same issue I have. I've created a bug report on trigger to see if I can get more info.

matt-aitken commented 6 days ago

Hey, I'm one of the cofounders of Trigger.dev.

Those errors are invalid key lengths are because your not generating the correct length encryption keys. From our self-hosted docs:

echo MAGIC_LINK_SECRET=$(openssl rand -hex 16)
echo SESSION_SECRET=$(openssl rand -hex 16)
echo ENCRYPTION_KEY=$(openssl rand -hex 16)
echo PROVIDER_SECRET=$(openssl rand -hex 32)
echo COORDINATOR_SECRET=$(openssl rand -hex 32)

I don't use Coolify but my guess is that you need to use BASE64 instead of PASSWORD for the first 3, and BASE64_64 for the last two. I know for sure that the ENCRYPTION_KEY must be the correct length and that's why you're seeing that error when using the CLI.

peaklabs-dev commented 6 days ago

@matt-aitken Nice to see you here on the Coolify repo.

I am a core developer of Coolify and I am currently refactoring our magic env variabels. The new magic will be able to generate hexadecimal secrets of any length you want. And from your message and the openssl commands I see that Trigger needs random hexadecimal secrets all in lowercase is that correct? or is it also possible to use no hexadecimal characters?

peaklabs-dev commented 4 days ago

Thank you for the PR 💜. I will ajust the variables to be hex ones in the future as soon as the new magic is ready.