|
#!/bin/bash |
|
|
|
NGX_NAME="${NGX_NAME:-admin}" |
|
NGX_PASS="${NGX_PASS:-admin}" |
|
CRYPTPASS=`openssl passwd -apr1 ${NGX_PASS}` |
|
PORT="${PORT:-8080}" |
|
|
|
echo "USERNAME:" $NGX_NAME |
|
echo "PASSWORD:" $NGX_PASS |
|
|
|
echo "${NGX_NAME}:${CRYPTPASS}" > ngpasswd |
|
|
|
COMMIT=$(cat /app/openvscode-server/product.json | awk '/commit/{print $4;exit}' FS='[""]') |
|
sed -i "s/#COMMIT#/$COMMIT/" nginx.conf |
|
sed -i "s/#PORT#/$PORT/" nginx.conf |
|
nginx -c $PWD/nginx.conf |
|
|
|
set +e |
|
if [[ ! -z "$REPO" ]]; then |
|
echo start to clone initial repo $repo |
|
git clone --progress $REPO |
|
fi |
|
|
|
git config --global http.postBuffer 524288000 |
|
|
|
echo "Starting VSCode Server..." |
|
vscode=/app/openvscode-server/bin/openvscode-server |
|
ln -s $vscode $(dirname $vscode)/code |
|
$vscode --install-extension ms-toolsai.jupyter |
|
set -e |
|
exec $vscode --host 0.0.0.0 --port 5050 --without-connection-token \"${@}\" -- |
|
|