fix: report config write failures instead of exiting 0
`config:set`, `config:unset` and `config:clear` discarded the result of writing the app's environment, so a write that never landed still printed `Setting config vars`, still fired the `post-config-update` trigger, still restarted the app and still exited 0. The `config-set` and `config-unset` plugin triggers behaved the same way, which meant an `app.json` `env` block that could not be persisted deployed anyway with the variables missing. The environment is now staged in a temporary file and renamed into place, so a write that fails partway leaves the previous environment intact, and that file is created at `0600` rather than being created at `0644` and chmodded afterwards. `apps:clone` and `apps:rename` never applied that chmod at all and left the new app's environment world-readable.
This commit is contained in:
11 files changed
+369
-43
No files matched your search
@@ -56,8 +56,7 @@ func TriggerConfigSet(appName string, noRestart bool, pairs ...string) error {
|
||||
|
||||
// TriggerConfigUnset unsets an app config value by key
|
||||
func TriggerConfigUnset(appName string, key string, restart bool) error {
|
||||
UnsetMany(appName, []string{key}, restart)
|
||||
return nil
|
||||
return UnsetMany(appName, []string{key}, restart)
|
||||
}
|
||||
|
||||
func setupAppConfigDir(appName string) error {
|
||||
|
||||
Reference in new issue
Block a user