.env.sh never works no matter what you add to it
-
Im not sure why this happened im trying to hook up a google sheet however im not able to get the api key to work and I decided to add something simple like disable signup to the env.sh and it still is not working nor do I see the setting get pulled in via the logs even though it says its running env.sh.
Has anyone gotten the google sheets to work?
-
Im not sure why this happened im trying to hook up a google sheet however im not able to get the api key to work and I decided to add something simple like disable signup to the env.sh and it still is not working nor do I see the setting get pulled in via the logs even though it says its running env.sh.
Has anyone gotten the google sheets to work?
@CptPlastic Note that you need to add
export x=yin files ending with .sh (that's the pattern we use in cloudron) -
@CptPlastic Note that you need to add
export x=yin files ending with .sh (that's the pattern we use in cloudron)@girish That works! I didn't even think about that. I'm going to update the documents with this note.
Thank you
-
@CptPlastic Note that you need to add
export x=yin files ending with .sh (that's the pattern we use in cloudron)@girish depends
yes that is the default Cloudron way, but for example I did this in the Valheim Server app and the Greenlight app.Greenlight:
https://git.cloudron.io/cloudron/greenlight-app/-/blob/master/start.sh#L49echo "==> Reading /app/data/.env" export $(grep -v '^#' /app/data/.env | xargs)Valheim:
https://git.cloudron.io/cloudron/valheim-gameserver-app/-/blob/master/docker/app/code/start.sh#L23echo "=> Load .env" set -o allexport; source /app/data/.env; set +o allexportThis way the
.envfile does not needexport key=valuebut onlykey=value.

Many ways lead to Rome, so maybe I should stick the default way.
-
@girish depends
yes that is the default Cloudron way, but for example I did this in the Valheim Server app and the Greenlight app.Greenlight:
https://git.cloudron.io/cloudron/greenlight-app/-/blob/master/start.sh#L49echo "==> Reading /app/data/.env" export $(grep -v '^#' /app/data/.env | xargs)Valheim:
https://git.cloudron.io/cloudron/valheim-gameserver-app/-/blob/master/docker/app/code/start.sh#L23echo "=> Load .env" set -o allexport; source /app/data/.env; set +o allexportThis way the
.envfile does not needexport key=valuebut onlykey=value.

Many ways lead to Rome, so maybe I should stick the default way.
@BrutalBirdie yes, I think that needs to be fixed. Obviously, nothing is right/wrong, but this is just a convention to guide people and makes support simpler. The convention is:
- If the app uses environment variables, just use
env.shpattern and expect people to add export keyword. A motivation for this is that in many app doc pages, they have export and people copy/paste it. - If the app uses .env , dotenv and other styles, just use env. Same rationale as above.
- Use dot files in /app/data only for package internal files. Do not use for app files. For example, it would be htaccess and not .htaccess if needed in /app/data/ . But, we use .initialized since it's a package thing and not related to the app.
Any deviation from above is mostly just oversight...
- If the app uses environment variables, just use
-
N nebulon marked this topic as a question on
-
N nebulon has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login