Skip to content

Commit

Permalink
sshDir as an option
Browse files Browse the repository at this point in the history
  • Loading branch information
link89 committed Sep 9, 2024
1 parent 9300087 commit c589f8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 7 additions & 4 deletions apps/cli/src/compose/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export const createComposeSpec = (config: InstallConfigSchema) => {
const AI_PATH = config.ai?.basePath || "/ai";
checkPathFormat("ai.basePath", AI_PATH);

const SSH_DIR = config.sshDir || "~/.ssh";
checkPathFormat("sshDir", SSH_DIR);

const serviceLogEnv = {
LOG_LEVEL: config.log.level,
LOG_PRETTY: String(config.log.pretty),
Expand Down Expand Up @@ -160,7 +163,7 @@ export const createComposeSpec = (config: InstallConfigSchema) => {
const authVolumes = {
"/etc/hosts": "/etc/hosts",
"./config": "/etc/scow",
"~/.ssh": "/root/.ssh",
SSH_DIR: "/root/.ssh",
};

const authUrl = config.auth.custom?.type === AuthCustomType.external
Expand Down Expand Up @@ -272,7 +275,7 @@ export const createComposeSpec = (config: InstallConfigSchema) => {
volumes: {
"/etc/hosts": "/etc/hosts",
"./config": configPath,
"~/.ssh": "/root/.ssh",
SSH_DIR: "/root/.ssh",
"portal_data":"/var/lib/scow/portal",
},
});
Expand Down Expand Up @@ -326,7 +329,7 @@ export const createComposeSpec = (config: InstallConfigSchema) => {
volumes: {
"/etc/hosts": "/etc/hosts",
"./config": "/etc/scow",
"~/.ssh": "/root/.ssh",
SSH_DIR: "/root/.ssh",
},
});

Expand Down Expand Up @@ -425,7 +428,7 @@ export const createComposeSpec = (config: InstallConfigSchema) => {
volumes: {
"/etc/hosts": "/etc/hosts",
"./config": "/etc/scow",
"~/.ssh": "/root/.ssh",
SSH_DIR: "/root/.ssh",
},
});

Expand Down
9 changes: 5 additions & 4 deletions apps/cli/src/config/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ export const InstallConfigSchema = Type.Object({
basePath: Type.String({ description: "整个系统的部署路径", default: "/" }),
image: Type.Optional(Type.String({ description: "镜像", default: "mirrors.pku.edu.cn/pkuhpc-icode/scow" })),
imageTag: Type.String({ description: "镜像tag", default: "master" }),
sshDir: Type.String({ description: "ssh目录", default: "~/.ssh" }),

scowd: Type.Optional(Type.Object({
ssl: Type.Optional(Type.Object({
enabled: Type.Boolean({ description: "到 SCOWD 的连接是否启动SSL", default: false }),
caCertPath: Type.String({ description: "SCOWD CA根证书路径, 相对 config 的默认目录", default: "./scowd/certs/ca.crt" }),
scowCertPath: Type.String({
description: "SCOWD CA签名的 SCOW 证书路径, 相对 config 的默认目录",
scowCertPath: Type.String({
description: "SCOWD CA签名的 SCOW 证书路径, 相对 config 的默认目录",
default: "./scowd/certs/scow.crt",
}),
scowPrivateKeyPath: Type.String({
description: "SCOWD CA签名的 SCOW 私钥路径, 相对 config 的默认目录",
scowPrivateKeyPath: Type.String({
description: "SCOWD CA签名的 SCOW 私钥路径, 相对 config 的默认目录",
default: "./scowd/certs/scow.key",
}),
}, { description: "scowd 全局 ssl 相关配置" })),
Expand Down

0 comments on commit c589f8b

Please sign in to comment.