Rank 1: Thread
I am encountering a problem where environment variables are unexpectedly modified at runtime on my Appwrite server (version 1.6.0) hosted at https://custom-domain.tld. Here is the JavaScript configuration I'm using:
const client = new Client() .setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT) .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) .setKey(process.env.APPWRITE_FUNCTION_API_KEY);The environment variable for the API endpoint is set as follows:
APPWRITE_FUNCTION_API_ENDPOINT="https://custom-domain.tld/v1"Despite being correctly configured on the server, APPWRITE_FUNCTION_API_ENDPOINT changes to https:///v1 during runtime.
Using a hardcoded endpoint avoids this issue:
const client = new Client() .setEndpoint("https://custom-domain.tld/v1") .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) .setKey(process.env.APPWRITE_FUNCTION_API_KEY);Additionally, there was a protocol issue where, despite the endpoint protocol being set to https, it appeared to operate over http internally. I resolved this by enforcing HTTPS in the Appwrite environment settings:
_APP_OPTIONS_FORCE_HTTPS=enabledI'm sharing this issue to find out if this behavior is intentional or if I might have misconfigured or misunderstood something. Any insights or similar experiences would be greatly appreciated.
Thanks a lot! ❤️