diff --git a/apps/mixspace/5/.env.sample b/apps/mixspace/5/.env.sample new file mode 100644 index 00000000..aa813917 --- /dev/null +++ b/apps/mixspace/5/.env.sample @@ -0,0 +1,8 @@ +CONTAINER_NAME="mixspace" +PANEL_APP_PORT_HTTP="40203" +ALLOWED_ORIGINS="example.com" +ENCRYPT_ENABLE="false" +ENCRYPT_KEY="" +JWT_SECRET="Np2qgqtiUayA857a_2KpAwe" +TIME_ZONE="Asia/Shanghai" +SUBNET_PREFIX="172.19.0" \ No newline at end of file diff --git a/apps/mixspace/5/data.yml b/apps/mixspace/5/data.yml index b8e919fa..f62253e2 100644 --- a/apps/mixspace/5/data.yml +++ b/apps/mixspace/5/data.yml @@ -1,37 +1,54 @@ additionalProperties: formFields: - - default: 2333 + - default: 40203 edit: true envKey: PANEL_APP_PORT_HTTP labelEn: Port - labelZh: 应用端口 + labelZh: 端口 required: true rule: paramPort type: number - default: example.com + edit: true envKey: ALLOWED_ORIGINS - labelEn: Allowed_Origins - labelZh: 允许域名(前端绑定域名,不需要https://,多个使用英文逗号分割) + labelEn: Allowed domain (multiple delimited with ",") + labelZh: 被允许的域名 (多个使用英文逗号分割) required: true type: text - - default: Np2qgqtiUayA857 + - default: Np2qgqtiUayA857a + edit: true envKey: JWT_SECRET - labelEn: Password - labelZh: JWT密钥(16到32位字符,请一定修改至要求!) + labelEn: JWT key (16 to 32 characters) + labelZh: JWT 密钥 (16 到 32 位字符) random: true required: true rule: paramComplexity type: password - - default: + - default: '' + edit: true envKey: ENCRYPT_KEY - labelEn: ENCRYPT_KEY - labelZh: 加密密钥(非特殊需求不建议填写) + labelEn: Encryption key (not recommended for non-special needs, run "openssl rand -hex 32" on the terminal to obtain it) + labelZh: 加密密钥 (非特殊需求不建议填写,终端执行 "openssl rand -hex 32" 获取) required: false - rule: paramCommon - type: password - - default: + type: text + - default: "false" + edit: true envKey: ENCRYPT_ENABLE - labelEn: ENCRYPT_ENABLE - labelZh: 是否开启加密(true或false,需要填写加密密钥) - required: false - type: text \ No newline at end of file + labelEn: Whether to enable encryption (true or false, if you want to enable it, you need to enter the encryption key) + labelZh: 是否开启加密 (true或false,开启则需要填写加密密钥) + required: true + type: text + - default: Asia/Shanghai + edit: true + envKey: TIME_ZONE + labelEn: Time zone + labelZh: 时区 + required: true + type: text + - default: 172.19.0 + edit: true + envKey: SUBNET_PREFIX + labelEn: New docker network subnet prefix + labelZh: 新 docker 网络子网前缀 + required: true + type: text diff --git a/apps/mixspace/5/docker-compose.yml b/apps/mixspace/5/docker-compose.yml index f7991b97..75131388 100644 --- a/apps/mixspace/5/docker-compose.yml +++ b/apps/mixspace/5/docker-compose.yml @@ -1,12 +1,11 @@ version: '3.8' - services: - app: + mixspace: container_name: ${CONTAINER_NAME} image: innei/mx-server:5 command: bash ./docker-run.sh environment: - - TZ=Asia/Shanghai + - TZ=${TIME_ZONE} - NODE_ENV=production - ALLOWED_ORIGINS=${ALLOWED_ORIGINS} - JWT_SECRET=${JWT_SECRET} @@ -16,14 +15,8 @@ services: - ./data/mx-space:/root/.mx-space ports: - '${PANEL_APP_PORT_HTTP}:2333' - depends_on: - - mongo - - redis - links: - - mongo - - redis networks: - - 1panel-network + - mixspace-network restart: always healthcheck: test: ['CMD', 'curl', '-f', 'http://127.0.0.1:2333/api/v2/ping'] @@ -31,25 +24,39 @@ services: timeout: 30s retries: 5 start_period: 30s + depends_on: + - mongo + - redis + links: + - mongo + - redis labels: createdBy: "Apps" mongo: - container_name: mongo + container_name: ${CONTAINER_NAME}-mongo image: mongo volumes: - ./data/db:/data/db networks: - - 1panel-network + - mixspace-network restart: always + labels: + createdBy: "Apps" redis: image: redis - container_name: redis + container_name: ${CONTAINER_NAME}-redis networks: - - 1panel-network + - mixspace-network restart: always - -networks: - 1panel-network: - external: true \ No newline at end of file + labels: + createdBy: "Apps" + +networks: + mixspace-network: + driver: bridge + ipam: + driver: default + config: + - subnet: ${SUBNET_PREFIX}.0/16 \ No newline at end of file diff --git a/apps/mixspace/README.md b/apps/mixspace/README.md index d3bcf2a8..2b3dd818 100644 --- a/apps/mixspace/README.md +++ b/apps/mixspace/README.md @@ -4,8 +4,7 @@ Mix Space 是一个一款简洁而不简单的个人博客系统,它够快, ## 注意事项 -在此处你安装的是Mix-Space的后端,你还需要参照官方文档中的[前端主题](https://mx-space.js.org/themes -)部分完成前端部署 +在此处你安装的是Mix-Space的后端,你还需要参照官方文档中的 [前端主题](https://mx-space.js.org/themes) 部分完成前端部署 ## 主要功能: diff --git a/apps/mixspace/latest/.env.sample b/apps/mixspace/latest/.env.sample new file mode 100644 index 00000000..aa813917 --- /dev/null +++ b/apps/mixspace/latest/.env.sample @@ -0,0 +1,8 @@ +CONTAINER_NAME="mixspace" +PANEL_APP_PORT_HTTP="40203" +ALLOWED_ORIGINS="example.com" +ENCRYPT_ENABLE="false" +ENCRYPT_KEY="" +JWT_SECRET="Np2qgqtiUayA857a_2KpAwe" +TIME_ZONE="Asia/Shanghai" +SUBNET_PREFIX="172.19.0" \ No newline at end of file diff --git a/apps/mixspace/latest/data.yml b/apps/mixspace/latest/data.yml new file mode 100644 index 00000000..f62253e2 --- /dev/null +++ b/apps/mixspace/latest/data.yml @@ -0,0 +1,54 @@ +additionalProperties: + formFields: + - default: 40203 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number + - default: example.com + edit: true + envKey: ALLOWED_ORIGINS + labelEn: Allowed domain (multiple delimited with ",") + labelZh: 被允许的域名 (多个使用英文逗号分割) + required: true + type: text + - default: Np2qgqtiUayA857a + edit: true + envKey: JWT_SECRET + labelEn: JWT key (16 to 32 characters) + labelZh: JWT 密钥 (16 到 32 位字符) + random: true + required: true + rule: paramComplexity + type: password + - default: '' + edit: true + envKey: ENCRYPT_KEY + labelEn: Encryption key (not recommended for non-special needs, run "openssl rand -hex 32" on the terminal to obtain it) + labelZh: 加密密钥 (非特殊需求不建议填写,终端执行 "openssl rand -hex 32" 获取) + required: false + type: text + - default: "false" + edit: true + envKey: ENCRYPT_ENABLE + labelEn: Whether to enable encryption (true or false, if you want to enable it, you need to enter the encryption key) + labelZh: 是否开启加密 (true或false,开启则需要填写加密密钥) + required: true + type: text + - default: Asia/Shanghai + edit: true + envKey: TIME_ZONE + labelEn: Time zone + labelZh: 时区 + required: true + type: text + - default: 172.19.0 + edit: true + envKey: SUBNET_PREFIX + labelEn: New docker network subnet prefix + labelZh: 新 docker 网络子网前缀 + required: true + type: text diff --git a/apps/mixspace/latest/docker-compose.yml b/apps/mixspace/latest/docker-compose.yml new file mode 100644 index 00000000..080fa98f --- /dev/null +++ b/apps/mixspace/latest/docker-compose.yml @@ -0,0 +1,62 @@ +version: '3.8' +services: + mixspace: + container_name: ${CONTAINER_NAME} + image: innei/mx-server:latest + command: bash ./docker-run.sh + environment: + - TZ=${TIME_ZONE} + - NODE_ENV=production + - ALLOWED_ORIGINS=${ALLOWED_ORIGINS} + - JWT_SECRET=${JWT_SECRET} + - ENCRYPT_KEY=${ENCRYPT_KEY} + - ENCRYPT_ENABLE=${ENCRYPT_ENABLE} + volumes: + - ./data/mx-space:/root/.mx-space + ports: + - '${PANEL_APP_PORT_HTTP}:2333' + networks: + - mixspace-network + restart: always + healthcheck: + test: ['CMD', 'curl', '-f', 'http://127.0.0.1:2333/api/v2/ping'] + interval: 1m30s + timeout: 30s + retries: 5 + start_period: 30s + depends_on: + - mongo + - redis + links: + - mongo + - redis + labels: + createdBy: "Apps" + + mongo: + container_name: ${CONTAINER_NAME}-mongo + image: mongo + volumes: + - ./data/db:/data/db + networks: + - mixspace-network + restart: always + labels: + createdBy: "Apps" + + redis: + image: redis + container_name: ${CONTAINER_NAME}-redis + networks: + - mixspace-network + restart: always + labels: + createdBy: "Apps" + +networks: + mixspace-network: + driver: bridge + ipam: + driver: default + config: + - subnet: ${SUBNET_PREFIX}.0/16 \ No newline at end of file diff --git a/apps/mixspace/logo.png b/apps/mixspace/logo.png index 78f0fe3f..b89ed9fa 100644 Binary files a/apps/mixspace/logo.png and b/apps/mixspace/logo.png differ