Skip to content

Commit

Permalink
Merge pull request #7 from linuxserver/main-perms
Browse files Browse the repository at this point in the history
fix app perms, add sudo password vars
  • Loading branch information
aptalca authored Nov 30, 2021
2 parents b451560 + 173ca86 commit 61efb20
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ services:
- TZ=Europe/London
- CONNECTION_TOKEN=supersecrettoken #optional
- CONNECTION_SECRET= #optional
- SUDO_PASSWORD=password #optional
- SUDO_PASSWORD_HASH= #optional
volumes:
- /path/to/appdata/config:/config
ports:
Expand All @@ -116,6 +118,8 @@ docker run -d \
-e TZ=Europe/London \
-e CONNECTION_TOKEN=supersecrettoken `#optional` \
-e CONNECTION_SECRET= `#optional` \
-e SUDO_PASSWORD=password `#optional` \
-e SUDO_PASSWORD_HASH= `#optional` \
-p 3000:3000 \
-v /path/to/appdata/config:/config \
--restart unless-stopped \
Expand All @@ -134,6 +138,8 @@ Container images are configured using parameters passed at runtime (such as thos
| `-e TZ=Europe/London` | Specify a timezone to use. |
| `-e CONNECTION_TOKEN=supersecrettoken` | Optional security token for accessing the Web UI. |
| `-e CONNECTION_SECRET=` | Optional path to a file inside the container that contains the security token for accessing the Web UI (ie. `/path/to/file`). Overrides `CONNECTION_TOKEN`. |
| `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the openvscode-server terminal with the specified password. |
| `-e SUDO_PASSWORD_HASH=` | Optionally set sudo password via hash (takes priority over `SUDO_PASSWORD` var). Format is `$type$salt$hashed`. |
| `-v /config` | Contains all relevant configuration files. |

## Environment variables from files (Docker secrets)
Expand Down Expand Up @@ -245,6 +251,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **30.11.21:** - Fix app folder permissions, add the optional sudo password vars.
* **29.11.21:** - Create `.profile` and `.bashrc` for the user.
* **29.11.21:** - Release `insiders` tag.
* **28.11.21:** - Initial Release.
3 changes: 3 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ opt_param_usage_include_env: true
opt_param_env_vars:
- { env_var: "CONNECTION_TOKEN", env_value: "supersecrettoken", desc: "Optional security token for accessing the Web UI." }
- { env_var: "CONNECTION_SECRET", env_value: "", desc: "Optional path to a file inside the container that contains the security token for accessing the Web UI (ie. `/path/to/file`). Overrides `CONNECTION_TOKEN`." }
- { env_var: "SUDO_PASSWORD", env_value: "password", desc: "If this optional variable is set, user will have sudo access in the openvscode-server terminal with the specified password." }
- { env_var: "SUDO_PASSWORD_HASH", env_value: "", desc: "Optionally set sudo password via hash (takes priority over `SUDO_PASSWORD` var). Format is `$type$salt$hashed`." }

optional_block_1: false
optional_block_1_items: ""
Expand All @@ -59,6 +61,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "30.11.21:", desc: "Fix app folder permissions, add the optional sudo password vars." }
- { date: "29.11.21:", desc: "Create `.profile` and `.bashrc` for the user." }
- { date: "29.11.21:", desc: "Release `insiders` tag." }
- { date: "28.11.21:", desc: "Initial Release." }
3 changes: 3 additions & 0 deletions root/etc/cont-init.d/30-config
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ if [ -f "/usr/bin/find" ] && [ -f "/usr/bin/xargs" ]; then

echo "setting permissions::workspace"
chown abc:abc /config/workspace
echo "setting permissions::app"
chown -R abc:abc /app/openvscode-server
else
# Set permissions on data mount
# do not decend into the workspace
chown -R abc:abc "$(ls /config -I workspace)"
chown abc:abc /config/workspace
chown -R abc:abc /app/openvscode-server
fi
chmod 700 /config/.ssh
chmod 600 /config/.ssh/*

0 comments on commit 61efb20

Please sign in to comment.