Environment File Resets After Application Restart
-
Hello Cloudron Support,
I have deployed FreeScout on Cloudron and I am experiencing an issue with the .env file configuration.
Whenever I modify the .env file and restart the application (or the app restarts automatically), all changes are discarded and the .env file is reset back to the default configuration.
This behavior prevents persistent configuration changes and makes it difficult to manage custom environment settings.
Steps to reproduce:
Open the app terminal / filesystem.
Modify values in the .env file.
Restart the application.
Observe that the .env file is reverted to the default state.Expected behavior:
Changes made to the .env file should persist after application restarts.
Actual behavior:
The .env file is overwritten/reset during restart.
Could you please advise:
Whether this is expected behavior in the Cloudron FreeScout package.
The correct method/location for persisting custom environment variables.
If there is a supported way to prevent the .env file from being regenerated.Thank you.
-
Hello Cloudron Support,
I have deployed FreeScout on Cloudron and I am experiencing an issue with the .env file configuration.
Whenever I modify the .env file and restart the application (or the app restarts automatically), all changes are discarded and the .env file is reset back to the default configuration.
This behavior prevents persistent configuration changes and makes it difficult to manage custom environment settings.
Steps to reproduce:
Open the app terminal / filesystem.
Modify values in the .env file.
Restart the application.
Observe that the .env file is reverted to the default state.Expected behavior:
Changes made to the .env file should persist after application restarts.
Actual behavior:
The .env file is overwritten/reset during restart.
Could you please advise:
Whether this is expected behavior in the Cloudron FreeScout package.
The correct method/location for persisting custom environment variables.
If there is a supported way to prevent the .env file from being regenerated.Thank you.
Hello @halkhamis
Changes made to the .env file should persist after application restarts.
Yes and No.
It depends on the environment variables you are looking to override.
Certain variables are configured on every app restart by Cloudron to ensure the app is working.For example these variables are always set - https://git.cloudron.io/packages/freescout-app/-/blob/master/start.sh?ref_type=heads#L51-L60
echo "=> Set configs" crudini --set /app/data/env "" APP_URL "${CLOUDRON_APP_ORIGIN}" crudini --set /app/data/env "" APP_FORCE_HTTPS "true" crudini --set /app/data/env "" DB_CONNECTION "mysql" crudini --set /app/data/env "" DB_HOST "${CLOUDRON_MYSQL_HOST}" crudini --set /app/data/env "" DB_PORT "${CLOUDRON_MYSQL_PORT}" crudini --set /app/data/env "" DB_DATABASE "${CLOUDRON_MYSQL_DATABASE}" crudini --set /app/data/env "" DB_USERNAME "${CLOUDRON_MYSQL_USERNAME}" crudini --set /app/data/env "" DB_PASSWORD "${CLOUDRON_MYSQL_PASSWORD}" crudini --set /app/data/env "" APP_DISABLE_UPDATING "true"Also when the Cloudron User Management was chosen when the app was installed the following configurations will always be set - https://git.cloudron.io/packages/freescout-app/-/blob/master/start.sh?ref_type=heads#L116-L139
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then echo "=> Configure OIDC" OAUTH_PROVIDERS=$(gosu cloudron php <<'EOF' <?php echo addslashes( serialize( [ [ 'active' => 1, 'default' => 1, 'provider' => "oauth", 'name' => getenv("CLOUDRON_OIDC_PROVIDER_NAME") ?? "Cloudron", 'id' => "cloudron", 'client_id' => getenv("CLOUDRON_OIDC_CLIENT_ID"), 'client_secret' => getenv("CLOUDRON_OIDC_CLIENT_SECRET"), 'auth_url' => getenv("CLOUDRON_OIDC_AUTH_ENDPOINT"), 'token_url' => getenv("CLOUDRON_OIDC_TOKEN_ENDPOINT"), 'user_url' => getenv("CLOUDRON_OIDC_PROFILE_ENDPOINT"), 'user_method' => "POST", 'proxy' => "", 'mapping' => "", 'scopes' => "openid profile email" ] ] ) ); EOF )So without the detail from you which exact variables you are trying to change, I can only assume they are one of the default sets of Cloudron.
-
The reason I changed the database variables is that I’m using a centralized managed database hosted on AWS. It provides additional security and encryption features, along with capabilities such as Point-in-Time Recovery (PITR) for backup and disaster recovery purposes. It also offers high availability and improved reliability compared to a locally hosted database.
-
Hello @halkhamis
If you want to use an external database with Freescout you will have to fork the Freescout package and change it so that you can use an external database.
It sounds like you want to use enterprise and high availability features for a software that is not highly available in the first place, so the HA of the DB will offer nothing when the software is down anyway.
Cloudron also provides the security and encryption for the DB and also offers the backup and restore for the app and database itself, but not PITR.
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