Open Martinsos opened 1 month ago
@vincanger opened the same issue (#2055) but a bit different angle, so adding that here:
it's unclear which (server) ENV VARS are set automatically and which VARS users need to set themselves when deploying via wasp deploy fly launch
.
Since Wasp automatically sets the following vars (below) via the deploy command, it would be best if we informed the user about this:
wasp deploy fly launch
const secretsArgs = [
`JWT_SECRET=${randomString}`,
// NOTE: Normally these would just be envars, but flyctl
// doesn't provide a way to set envars that persist to fly.toml.
'PORT=8080',
`WASP_WEB_CLIENT_URL=${deploymentInfo.clientUrl}`,
`WASP_SERVER_URL=${deploymentInfo.serverUrl}`,
];
I am putting this one back for triage, people keep failing on this and I think we need to look into it sooner than later.
Here is another instance of it: https://discord.com/channels/686873244791210014/1241745021955473548/1248364761092198521 .
I pushed all the envs via terminal. But when you are sending a password with spaces (Google email password) it screws it up if quotes aren't included. So I set it directly on the fly dashboard.
It was a very simple issue, that I think a more experience coder would know. Maybe as a suggestion make it easier to set secrets/ pass along envs?
We should improve the docs to have clear examples on how vars should be set, also make sure we mention the double quotes.
We should do this also for the rest of the docs, not just Fly. It is also not super clear for Railway that env vars need to be set. We need to make this clear in general, for deployment. Here is an example of a user missing this for Railway also.
We had a user struggling quite a bit with setting up env vars for their app while deploying it via
wasp deploy fly deploy
: https://discord.com/channels/686873244791210014/1241745021955473548/1241745021955473548 .The thing is, our docs at https://wasp-lang.dev/docs/advanced/deployment/cli are really not mentioning env vars much! They do mention setting up that one for client URL, but don't at all go into setting other env vars. Since the idea behind
wasp deploy fly deploy
is that it should be quite streamlined, then we can't expect users to suddenly figure out they need to manually set those server env vars.We should:
wasp deploy fly deploy
and point them to confirm that by runningwasp deploy fly cmd --context server secrets list
, therefore also teaching them how to list existing secrets.wasp deploy fly cmd --context server secrets set WASP_WEB_CLIENT_URL=https://mycoolapp.com
. Explain to them they should be going through their .env.server and making sure all the stuff they have set there should also be present on the Fly cloud.EDIT: Actually, this also goes for other methods: Railway, even manually. Users often don't realize that they need to set the vars from .env.server on the production server. We need to make this very clear and show how to do it in different situations.
We should also catch when env vars are missing in production and write nice errors, for that we have separate issue though: https://github.com/wasp-lang/wasp/issues/2086 .