Skip to content

Add BASEPATH env var to enable use of --base-path option #19

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ opt_param_usage_include_env: true
opt_param_env_vars:
- { env_var: "PASSWORD", env_value: "password", desc: "Optional web gui password, if not provided, there will be no auth."}
- { 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."}
- { env_var: "BASEPATH", env_value: "", desc: "Optional base url setting (ie. if set to `code`, code-server will be served from `http://<your-ip>:8443/code`)."}

optional_block_1: false
optional_block_1_items: ""
Expand All @@ -65,6 +66,7 @@ app_setup_block: |

# changelog
changelogs:
- { date: "14.02.20:", desc: "Add support for --base-path option."}
- { date: "17.01.20:", desc: "Fix artifact url retrieval from github." }
- { date: "24.10.19:", desc: "Upgrade to v2 builds." }
- { date: "28.09.19:", desc: "Update project logo." }
Expand Down
7 changes: 7 additions & 0 deletions root/etc/services.d/code-server/run
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ else
echo "starting with no password"
fi

if [ -n "${BASEPATH}" ]; then
BASEPATH="--base-path ${BASEPATH}"
else
BASEPATH=""
fi

exec \
s6-setuidgid abc \
/usr/bin/code-server \
Expand All @@ -16,4 +22,5 @@ exec \
--disable-telemetry \
--disable-updates \
--auth "${AUTH}" \
"${BASEPATH}" \
/config/workspace