Skip to content

Commit d7599ae

Browse files
authored
fix: remove config file path from login page (#7709)
The login page displayed the full config file path (e.g. /home/username/.config/code-server/config.yaml), which exposes the username and system layout to anyone who can see the page. The path is already printed in the CLI output when starting code-server, so showing it on the login page is unnecessary. Fixes #7643
1 parent 13ca0e4 commit d7599ae

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/node/i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"LOGIN_TITLE": "{{app}} login",
33
"LOGIN_BELOW": "Please log in below.",
44
"WELCOME": "Welcome to {{app}}",
5-
"LOGIN_PASSWORD": "Check the config file at {{configFile}} for the password.",
5+
"LOGIN_PASSWORD": "Check the config file for the password.",
66
"LOGIN_USING_ENV_PASSWORD": "Password was set from $PASSWORD.",
77
"LOGIN_USING_HASHED_PASSWORD": "Password was set from $HASHED_PASSWORD.",
88
"SUBMIT": "SUBMIT",

src/node/i18n/locales/ja.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"LOGIN_TITLE": "{{app}} ログイン",
33
"LOGIN_BELOW": "以下によりログインしてください。",
44
"WELCOME": "ようこそ {{app}} へ!",
5-
"LOGIN_PASSWORD": "パスワードは設定ファイル( {{configFile}} )を確認してください",
5+
"LOGIN_PASSWORD": "パスワードは設定ファイルを確認してください",
66
"LOGIN_USING_ENV_PASSWORD": "パスワードは環境変数 $PASSWORD で設定されています。",
77
"LOGIN_USING_HASHED_PASSWORD": "パスワードは環境変数 $HASHED_PASSWORD で設定されています。",
88
"SUBMIT": "実行",

src/node/i18n/locales/th.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"LOGIN_TITLE": "เข้าสู่ระบบ {{app}}",
33
"LOGIN_BELOW": "กรุณาเข้าสู่ระบบด้านล่าง",
44
"WELCOME": "ยินดีต้อนรับสู่ {{app}}",
5-
"LOGIN_PASSWORD": "ตรวจสอบไฟล์กำหนดค่าที่ {{configFile}} เพื่อดูรหัสผ่าน",
5+
"LOGIN_PASSWORD": "ตรวจสอบไฟล์กำหนดค่าเพื่อดูรหัสผ่าน",
66
"LOGIN_USING_ENV_PASSWORD": "รหัสผ่านถูกกำหนดเป็น $PASSWORD",
77
"LOGIN_USING_HASHED_PASSWORD": "รรหัสผ่านถูกกำหนดเป็น $HASHED_PASSWORD",
88
"SUBMIT": "ส่ง",

src/node/i18n/locales/ur.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"LOGIN_TITLE": "{{app}} لاگ ان کریں",
33
"LOGIN_BELOW": "براہ کرم نیچے لاگ ان کریں۔",
44
"WELCOME": "میں خوش آمدید {{app}}",
5-
"LOGIN_PASSWORD": "پاس ورڈ کے لیے {{configFile}} پر کنفگ فائل چیک کریں۔",
5+
"LOGIN_PASSWORD": "پاس ورڈ کے لیے کنفگ فائل چیک کریں۔",
66
"LOGIN_USING_ENV_PASSWORD": "پاس ورڈ $PASSWORD سے سیٹ کیا گیا تھا۔",
77
"LOGIN_USING_HASHED_PASSWORD": "پاس ورڈ $HASHED_PASSWORD سے سیٹ کیا گیا تھا۔",
88
"SUBMIT": "جمع کرائیں",

src/node/i18n/locales/zh-cn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"LOGIN_TITLE": "{{app}} 登录",
33
"LOGIN_BELOW": "请在下面登录。",
44
"WELCOME": "欢迎来到 {{app}}",
5-
"LOGIN_PASSWORD": "查看配置文件 {{configFile}} 中的密码",
5+
"LOGIN_PASSWORD": "查看配置文件中的密码",
66
"LOGIN_USING_ENV_PASSWORD": "密码在 $PASSWORD 中设置。",
77
"LOGIN_USING_HASHED_PASSWORD": "密码在 $HASHED_PASSWORD 中设置。",
88
"SUBMIT": "提交",

src/node/routes/login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
3232
const welcomeText = req.args["welcome-text"] || (i18n.t("WELCOME", { app: req.args["app-name"] }) as string)
3333

3434
// Determine password message using i18n
35-
let passwordMsg = i18n.t("LOGIN_PASSWORD", { configFile: req.args.config })
35+
let passwordMsg = i18n.t("LOGIN_PASSWORD")
3636
if (req.args.usingEnvPassword) {
3737
passwordMsg = i18n.t("LOGIN_USING_ENV_PASSWORD")
3838
} else if (req.args.usingEnvHashedPassword) {

0 commit comments

Comments
 (0)