Merge pull request #3030 from dokku/system-user
feat: allow changing the system user the properties plugin uses
This commit is contained in:
2 files changed
+13
-2
No files matched your search
@@ -115,4 +115,6 @@ The following list config variables have special meaning and can be set in a var
|
|||||||
| `DOKKU_SKIP_CLEANUP` | | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | When a deploy is triggered, if this is set to a non-empty value, then old docker containers and images will not be removed. |
|
| `DOKKU_SKIP_CLEANUP` | | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | When a deploy is triggered, if this is set to a non-empty value, then old docker containers and images will not be removed. |
|
||||||
| `DOKKU_SKIP_DEFAULT_CHECKS` | | `dokku config:set` | |
|
| `DOKKU_SKIP_DEFAULT_CHECKS` | | `dokku config:set` | |
|
||||||
| `DOKKU_SKIP_DEPLOY` | | `dokku config:set` | |
|
| `DOKKU_SKIP_DEPLOY` | | `dokku config:set` | |
|
||||||
|
| `DOKKU_SYSTEM_GROUP` | `dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | System group to chown files as. |
|
||||||
|
| `DOKKU_SYSTEM_USER` | `dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | System user to chown files as. |
|
||||||
| `DOKKU_WAIT_TO_RETIRE` | `60` | `dokku config:set` | After a successful deploy, the grace period given to old containers before they are stopped/terminated. This is useful for ensuring completion of long-running http connections. |
|
| `DOKKU_WAIT_TO_RETIRE` | `60` | `dokku config:set` | After a successful deploy, the grace period given to old containers before they are stopped/terminated. This is useful for ensuring completion of long-running http connections. |
|
||||||
@@ -142,11 +142,20 @@ func setPermissions(path string, fileMode os.FileMode) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
group, err := user.LookupGroup("dokku")
|
systemGroup := os.Getenv("DOKKU_SYSTEM_GROUP")
|
||||||
|
systemUser := os.Getenv("DOKKU_SYSTEM_USER")
|
||||||
|
if systemGroup == "" {
|
||||||
|
systemGroup = "dokku"
|
||||||
|
}
|
||||||
|
if systemUser == "" {
|
||||||
|
systemUser = "dokku"
|
||||||
|
}
|
||||||
|
|
||||||
|
group, err := user.LookupGroup(systemGroup)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
user, err := user.Lookup("dokku")
|
user, err := user.Lookup(systemUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user