asons commited on
Commit
b1c9920
·
1 Parent(s): 04c5f6e

Remove auth requirements: no password for code-server or nginx basic auth

Browse files
Files changed (1) hide show
  1. entrypoint.sh +1 -10
entrypoint.sh CHANGED
@@ -5,11 +5,8 @@ set -euo pipefail
5
  # Required env vars (Space 设置):
6
  # Secrets:
7
  # HF_TOKEN
8
- # CODE_SERVER_PASSWORD
9
- # BASIC_AUTH_PASSWORD
10
  # Variables:
11
  # CONFIG_DATASET e.g. "yourname/ubuntu"
12
- # BASIC_AUTH_USER e.g. "gally"
13
  # SYNC_INTERVAL_SECONDS e.g. "300"
14
  #
15
  # Optional:
@@ -18,9 +15,6 @@ set -euo pipefail
18
 
19
  : "${CONFIG_DATASET:?CONFIG_DATASET is required, e.g. yourname/ubuntu}"
20
  : "${HF_TOKEN:?HF_TOKEN secret is required}"
21
- : "${CODE_SERVER_PASSWORD:?CODE_SERVER_PASSWORD secret is required}"
22
- : "${BASIC_AUTH_USER:?BASIC_AUTH_USER variable is required}"
23
- : "${BASIC_AUTH_PASSWORD:?BASIC_AUTH_PASSWORD secret is required}"
24
  : "${SYNC_INTERVAL_SECONDS:=300}"
25
 
26
  # Use venv python (has huggingface_hub installed)
@@ -208,8 +202,6 @@ exec /usr/bin/node "${CODEX_JS}" "\$@"
208
  EOF
209
  chmod 755 /usr/local/bin/codex
210
 
211
- # ---- Nginx basic auth ----
212
- htpasswd -bc /etc/nginx/.htpasswd "${BASIC_AUTH_USER}" "${BASIC_AUTH_PASSWORD}"
213
  cp /etc/nginx/templates/nginx.conf.template /etc/nginx/nginx.conf
214
 
215
  # ---- code-server dirs ----
@@ -246,7 +238,6 @@ else
246
  fi
247
 
248
  # ---- Start code-server (ignore last opened to avoid /root watcher EACCES) ----
249
- export PASSWORD="${CODE_SERVER_PASSWORD}"
250
  echo "[boot] Start code-server with explicit user-data-dir/extensions-dir"
251
  mkdir -p /home/coder/workspace
252
  chown coder:coder /home/coder/workspace
@@ -254,7 +245,7 @@ chown coder:coder /home/coder/workspace
254
  su -p coder -c "export HOME=/home/coder; export PATH=/home/coder/.npm-global/bin:\$PATH; \
255
  /usr/bin/code-server \
256
  --bind-addr 127.0.0.1:8080 \
257
- --auth password \
258
  --ignore-last-opened \
259
  --user-data-dir /home/coder/.local/share/code-server \
260
  --extensions-dir /home/coder/.local/share/code-server/extensions \
 
5
  # Required env vars (Space 设置):
6
  # Secrets:
7
  # HF_TOKEN
 
 
8
  # Variables:
9
  # CONFIG_DATASET e.g. "yourname/ubuntu"
 
10
  # SYNC_INTERVAL_SECONDS e.g. "300"
11
  #
12
  # Optional:
 
15
 
16
  : "${CONFIG_DATASET:?CONFIG_DATASET is required, e.g. yourname/ubuntu}"
17
  : "${HF_TOKEN:?HF_TOKEN secret is required}"
 
 
 
18
  : "${SYNC_INTERVAL_SECONDS:=300}"
19
 
20
  # Use venv python (has huggingface_hub installed)
 
202
  EOF
203
  chmod 755 /usr/local/bin/codex
204
 
 
 
205
  cp /etc/nginx/templates/nginx.conf.template /etc/nginx/nginx.conf
206
 
207
  # ---- code-server dirs ----
 
238
  fi
239
 
240
  # ---- Start code-server (ignore last opened to avoid /root watcher EACCES) ----
 
241
  echo "[boot] Start code-server with explicit user-data-dir/extensions-dir"
242
  mkdir -p /home/coder/workspace
243
  chown coder:coder /home/coder/workspace
 
245
  su -p coder -c "export HOME=/home/coder; export PATH=/home/coder/.npm-global/bin:\$PATH; \
246
  /usr/bin/code-server \
247
  --bind-addr 127.0.0.1:8080 \
248
+ --auth none \
249
  --ignore-last-opened \
250
  --user-data-dir /home/coder/.local/share/code-server \
251
  --extensions-dir /home/coder/.local/share/code-server/extensions \