Skip to content

Commit

Permalink
chown stacks to this user
Browse files Browse the repository at this point in the history
  • Loading branch information
RichyHBM committed Nov 19, 2023
1 parent afe0bc5 commit 9f6a3ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ services:
environment:
# Tell Dockge where is your stacks directory
- DOCKGE_STACKS_DIR=/opt/stacks
# Both PUID and PGID must be set for it to do anything
- PUID=1000 # Set the stack file/dir ownership to this user
- PGID=1000 # Set the stack file/dir ownership to this group
```
## How to Update
Expand Down
7 changes: 7 additions & 0 deletions backend/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ export class Stack {

// Write or overwrite the compose.yaml
fs.writeFileSync(path.join(dir, this._composeFileName), this.composeYAML);
if(process.env.PUID && process.env.PGID)
{

Check failure on line 151 in backend/stack.ts

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 20.x)

Opening curly brace does not appear on the same line as controlling statement
var uid: number = Number(process.env.PUID);

Check failure on line 152 in backend/stack.ts

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 20.x)

Unexpected var, use let or const instead
var gid: number = Number(process.env.PGID);

Check failure on line 153 in backend/stack.ts

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 20.x)

Unexpected var, use let or const instead
fs.lchownSync(dir, uid, gid);
fs.chownSync(path.join(dir, this._composeFileName), uid, gid);
}
}

async deploy(socket? : DockgeSocket) : Promise<number> {
Expand Down

0 comments on commit 9f6a3ee

Please sign in to comment.