Closed CurlyBytes closed 4 months ago
Great, have tested this on a vm, facing some issues but seems to work so far:
The tool within the API named "Prisma" will fail and kill the whole api container if it isn't able to connect to the database: I suggest adding an artifical delay (such as simply sleep) for 30-40 seconds to wait for the mysql database to load up fully. Alternatively something that checks for the state of the database? Bit overkill but just adding a delay should be enough.
Docker-compose complains about the caddy network not existing, removing it from the docker-compose test-wise causes it to break with the following error:
{"level":"warn","ts":1721809389.340229,"logger":"docker-proxy","msg":"Container is not in same network as caddy","container":"83440556ccf194a0842256f5fdecd2f032723534766d3874b393755fa51fe7c7","container id":"83440556ccf194a0842256f5fdecd2f032723534766d3874b393755fa51fe7c7"}
So the use of the internal network didn't work quite yet, but should be easy to fix.
This can be easily fixed by adding a nginx configuration for the location that always forwards the request to the index.html:
location / {
try_files $uri $uri/ /index.html =404;
}
So when you're serving the files using nginx, make sure to also include this in an configuration file.
Unsure what the issue is in this case, as it doesn't seem to use the correct settings there. This should be the correct settings reported by the backend:
Possibly an issue with caddy?
The environment variables used:
SMTP_HOST=mail.hopefuls.de
SMTP_USERNAME=licensegate@hopefuls.de
SMTP_PASSWORD=redacted
SMTP_SENDER=LicenseGate <licensegate@hopefuls.de>
JWT_SECRET=secret
RECAPTCHA_SECRET_KEY=redacted
PUBLIC_BACKEND_URL=https://licensegate-api.direct.hopefuls.de
PUBLIC_FRONTEND_URL=https://licensegate.direct.hopefuls.de
MYSQL_ROOT_PASSWORD=rootpassword
MYSQL_DATABASE=mydb
MYSQL_USER=user
MYSQL_PASSWORD=password
BACKEND_FQDN=licensegate-api.direct.hopefuls.de
FROTNEND_FQDN=licensegate.direct.hopefuls.de
Great, have tested this on a vm, facing some issues but seems to work so far:
- The tool within the API named "Prisma" will fail and kill the whole api container if it isn't able to connect to the database: I suggest adding an artifical delay (such as simply sleep) for 30-40 seconds to wait for the mysql database to load up fully. Alternatively something that checks for the state of the database? Bit overkill but just adding a delay should be enough.
- Docker-compose complains about the caddy network not existing, removing it from the docker-compose test-wise causes it to break with the following error:
{"level":"warn","ts":1721809389.340229,"logger":"docker-proxy","msg":"Container is not in same network as caddy","container":"83440556ccf194a0842256f5fdecd2f032723534766d3874b393755fa51fe7c7","container id":"83440556ccf194a0842256f5fdecd2f032723534766d3874b393755fa51fe7c7"}
So the use of the internal network didn't work quite yet, but should be easy to fix.
- Since LicenseGate is using sveltekit, this may cause issues when directly visiting links as Sveltekit requires visiting the index.html always, doesn't matter which path is being visited.
This can be easily fixed by adding a nginx configuration for the location that always forwards the request to the index.html:
location / { try_files $uri $uri/ /index.html =404; }
So when you're serving the files using nginx, make sure to also include this in an configuration file.
- There's some issue with caddy seemingly changing the cors header settings? Causing the connection to fail? Causing sign up to fail:
Unsure what the issue is in this case, as it doesn't seem to use the correct settings there. This should be the correct settings reported by the backend:
Possibly an issue with caddy?
The environment variables used:
SMTP_HOST=mail.hopefuls.de SMTP_USERNAME=licensegate@hopefuls.de SMTP_PASSWORD=redacted SMTP_SENDER=LicenseGate <licensegate@hopefuls.de> JWT_SECRET=secret RECAPTCHA_SECRET_KEY=redacted PUBLIC_BACKEND_URL=https://licensegate-api.direct.hopefuls.de PUBLIC_FRONTEND_URL=https://licensegate.direct.hopefuls.de MYSQL_ROOT_PASSWORD=rootpassword MYSQL_DATABASE=mydb MYSQL_USER=user MYSQL_PASSWORD=password BACKEND_FQDN=licensegate-api.direct.hopefuls.de FROTNEND_FQDN=licensegate.direct.hopefuls.de
This is now been resolve, this is due to caddy is already using the port 80 and 443, while the nginx in the dockerfile is also using port 80, i added custom port in the docker file and nginx config to resolve the flaky registration
Cool, looks great to me, tried running it once more:
LGTM
@DevLeoko if you want to make a final look at it, then merge if you're ready.
Accessible on https://licensegate-secondary.direct.hopefuls.de/ if want to test it
(Also maybe create a development branch for others to test first)
Nevermind didn't work
Nevermind didn't work
Yup thats why i expose them
Making a final deployment test to ensure full functionality
Yup tested, works entirely fine now on a fresh install too.
Documentation will be created afterwards
Thanks a lot @CurlyBytes and @Hopefuls for contributing!
Thank you everyone @DevLeoko and @Hopefuls , i will be submitting again in the future, i love the tool thank you!
add caddy for reverse proxy add phpymadmin to check the database add nginx for the frontend