Closed darkspirit510 closed 4 years ago
What do get as response back? Does it say "Updated App Definition Saved" ?
Is the problem limited to env vars? Or other parameters, such as notExposeAsWebApp
cannot be set?
Response of mentioned command:
------------
CapRover CLI has recently been refactored. Please report potential bugs here: https://github.com/caprover/caprover-cli/issues
------------
Call generic CapRover API [Experimental Feature]...
Ensuring authentication...
API call completed successfully!
{}
Good, that you asked. Single values like notExposeAsWebApp
are set. No array values get persisted (neither envVars nor volumes. did not test ports)
Another error I forgot to mention: Setting forceSsl
(even if false) in the given command throws Error Code: 1108 Message: Cannot force SSL without at least one SSL-enabled domain!
. Leaving it out works. GUI sends this as false.
Edit: notExposeAsWebApp
is not set 😔, but other values (container port, instance count, description) work.
@darkspirit510
Thanks for the detailed info. Turned out to be a bug in the JSON parse that the CLI uses to send API request. I fixed the bug in https://github.com/caprover/caprover-cli/commit/00693aae03538ac110db6519a232b0ce9aff0d80
I'll publish the new version with the bugfix in next few minutes...
@githubsaturn Is there a more concise way to just set env vars via the CLI (without having to specify/overwrite the other fields of the app definition)? 🙂
Not at the moment. The update endpoint takes a snapshot of the entire config object and updates it. Of course, you can simply write a script that:
Hi all, using the web GUI it is possible to set container env vars both on creation (at least for one-click-apps) and in 'app configs' tab. Both of those will send a JSON to
/user/apps/appDefinitions/update
with:When I try to do the same with CLI:
no environment variable is set. Any idea how to set env vars from CLI?