fix: 将auth设为none

This commit is contained in:
2026-01-08 21:34:53 +08:00
parent 18cb4f2fbc
commit d42784c454
4 changed files with 46 additions and 38 deletions

View File

@@ -51,5 +51,10 @@ RUN chmod -R 555 /home/coder/.local/share/code-server/extensions
# 通过设置环境变量,把插件市场 URL 指向空,这样搜索插件会直接报错或为空
ENV EXTENSIONS_GALLERY='{"serviceUrl": ""}'
# 删除历史遗留的 config.yaml避免 auth 被写死
RUN rm -f /home/coder/.config/code-server/config.yaml
# 最后切换回 coder 用户运行
USER coder
CMD ["code-server", "--bind-addr", "0.0.0.0:8080", "--auth", "none"]

View File

@@ -3,7 +3,7 @@
- docker 打包命令
```sh
docker build -t code-server:v1
docker build -t code-viewer-docker:v1.1 .
```
- docker 推送到自建 gitea
@@ -17,13 +17,13 @@
2. 打标签
```sh
docker tag code-server:v1 gitea.kmux.cn/zhilv/code-viewer-docker:v1
docker tag code-server:v1 gitea.kmux.cn/zhilv/code-viewer-docker:latest
docker tag code-viewer-docker:v1.1 gitea.kmux.cn/zhilv/code-viewer-docker:v1.1
docker tag code-viewer-docker:v1.1 gitea.kmux.cn/zhilv/code-viewer-docker:latest
```
3. 推送
```sh
docker push gitea.kmux.cn/zhilv/code-viewer-docker:v1
docker push gitea.kmux.cn/zhilv/code-viewer-docker:v1.1
docker push gitea.kmux.cn/zhilv/code-viewer-docker:latest
```

View File

@@ -1,13 +1,12 @@
services:
code-viewer:
# build: .
image: gitea.kmux.cn/zhilv/code-viewer-docker:latest
image: code-viewer-docker:v1.1
container_name: code-viewer
restart: always
environment:
- TZ=Asia/Shanghai
- AUTH=none
- PASSWORD=123456
# - AUTH=none
volumes:
# 只挂载代码,不挂载配置和插件目录!
- ./repos:/home/coder/project:ro

View File

@@ -1,34 +1,38 @@
{
/* ------ 1. ------ */
"editor.mouseWheelZoom": true,
"locale": "zh-cn",
"workbench.startupEditor": "none",
"terminal.integrated.enabled": false,
/* ------ 2. UI ------ */
// 隐藏侧边栏的“扩展”视图 (软隐藏)
// 虽然用户能通过菜单打开,但打开了也装不了东西(因为我们锁了权限)
"workbench.view.extensions.visible": false,
"workbench.view.debug.visible": false,
/* ------ 1. ------ */
"editor.mouseWheelZoom": true,
// 隐藏状态栏
"workbench.statusBar.visible": false,
/* ------ 2. UI ------ */
// 隐藏侧边栏的“扩展”视图 (软隐藏)
// 虽然用户能通过菜单打开,但打开了也装不了东西(因为我们锁了权限)
"workbench.view.extensions.visible": false,
"workbench.view.debug.visible": false,
// 顶部菜单紧凑
"window.menuBarVisibility": "compact",
// 隐藏状态栏
"workbench.statusBar.visible": false,
// 隐藏小地图
"editor.minimap.enabled": false,
// 顶部菜单紧凑
"window.menuBarVisibility": "compact",
/* ------ 3. ------ */
// 禁止自动更新插件
"extensions.autoUpdate": false,
// 忽略推荐
"extensions.ignoreRecommendations": true,
// 隐藏小地图
"editor.minimap.enabled": false,
/* ------ 4. ------ */
"terminal.integrated.visible": false,
"files.readonlyInclude": { "**": true },
"files.autoSave": "off",
/* ------ 3. ------ */
// 禁止自动更新插件
"extensions.autoUpdate": false,
// 忽略推荐
"extensions.ignoreRecommendations": true,
/* ------ 5. ------ */
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "material-icon-theme"
/* ------ 4. ------ */
"terminal.integrated.visible": false,
"files.readonlyInclude": { "**": true },
"files.autoSave": "off",
/* ------ 5. ------ */
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "material-icon-theme"
}