Skip to content

Commit fcf9fcb

Browse files
committed
only chown when ownership change or new install detected
1 parent 42aae8b commit fcf9fcb

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Containers are configured using parameters passed at runtime (such as those abov
141141
| `-e HASHED_PASSWORD=` | Optional web gui password, overrides `PASSWORD`, instructions on how to create it is below. |
142142
| `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the code-server terminal with the specified password. |
143143
| `-e SUDO_PASSWORD_HASH=` | Optionally set sudo password via hash (takes priority over `SUDO_PASSWORD` var). Format is `$type$salt$hashed`. |
144-
| `-e PROXY_DOMAIN=code-server.my.domain` | If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#sub-domains) |
144+
| `-e PROXY_DOMAIN=code-server.my.domain` | If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/coder/code-server/blob/main/docs/guide.md#using-a-subdomain) |
145145
| `-e DEFAULT_WORKSPACE=/config/workspace` | If this optional variable is set, code-server will open this directory by default |
146146
| `-v /config` | Contains all relevant configuration files. |
147147

@@ -307,7 +307,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
307307

308308
## Versions
309309

310-
* **13.10.24:** - Ignore dev/cache folders during chown.
310+
* **13.10.24:** - Only chown config folder when change to ownership or new install is detected.
311311
* **09.10.24:** - Manage permissions in /config/.ssh according to file type
312312
* **19.08.24:** - Rebase to Ubuntu Noble.
313313
* **01.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)

readme-vars.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ opt_param_env_vars:
2727
- {env_var: "HASHED_PASSWORD", env_value: "", desc: "Optional web gui password, overrides `PASSWORD`, instructions on how to create it is below."}
2828
- {env_var: "SUDO_PASSWORD", env_value: "password", desc: "If this optional variable is set, user will have sudo access in the code-server terminal with the specified password."}
2929
- {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`."}
30-
- {env_var: "PROXY_DOMAIN", env_value: "code-server.my.domain", desc: "If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#sub-domains)"}
30+
- {env_var: "PROXY_DOMAIN", env_value: "code-server.my.domain", desc: "If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/coder/code-server/blob/main/docs/guide.md#using-a-subdomain)"}
3131
- {env_var: "DEFAULT_WORKSPACE", env_value: "/config/workspace", desc: "If this optional variable is set, code-server will open this directory by default"}
3232

3333
# application setup block
@@ -47,7 +47,7 @@ app_setup_block: |
4747
How to create the [hashed password](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#can-i-store-my-password-hashed).
4848
# changelog
4949
changelogs:
50-
- {date: "13.10.24:", desc: "Ignore dev/cache folders during chown."}
50+
- {date: "13.10.24:", desc: "Only chown config folder when change to ownership or new install is detected."}
5151
- {date: "09.10.24:", desc: "Manage permissions in /config/.ssh according to file type"}
5252
- {date: "19.08.24:", desc: "Rebase to Ubuntu Noble."}
5353
- {date: "01.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"}

root/etc/s6-overlay/s6-rc.d/init-code-server/run

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ if [[ ! -f /config/.profile ]]; then
2626
cp /root/.profile /config/.profile
2727
fi
2828

29-
# fix permissions (ignore contents of workspace and cache folders)
30-
find /config \
31-
-path "/config/workspace" -prune -o \
32-
-path "/config/.npm" -prune -o \
33-
-path "/config/.rustup" -prune -o \
34-
-path "/config/.cargo" -prune -o \
35-
-exec lsiown abc:abc {} +
36-
lsiown abc:abc /config/workspace
29+
# fix permissions (ignore contents of workspace)
30+
PUID=${PUID:-911}
31+
if [[ ! "$(stat -c %u /config/.profile)" == "${PUID}" ]]; then
32+
echo "Change in ownership or new install detected, please be patient while we chown existing files"
33+
echo "This could take some time"
34+
find /config -path "/config/workspace" -prune -o -exec lsiown abc:abc {} +
35+
lsiown abc:abc /config/workspace
36+
fi
3737
chmod 700 /config/.ssh
3838
if [[ -n "$(ls -A /config/.ssh)" ]]; then
3939
find /config/.ssh/ -type d -exec chmod 700 '{}' \;

0 commit comments

Comments
 (0)