Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix app perms, add sudo password var #6

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -60,6 +62,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
if [ -n "$(ls -A /config/.ssh)" ]; then
Expand Down