feat(交付): 客户侧两台服务器离线部署包
内网机/外网机各起一套栈,两台之间不开任何端口,文件只经光闸在 gate/out 与对端 gate/in 之间单向摆渡。一份 compose + 一份 config + 一份 nginx 模板,全部差异收在 .env 里。 - docker-compose.yml:5 服务只发布前端端口;app 容器 IP 锁死并由 compose 注入 -Dcode.snowflake.workid.<IP>=<WORK_ID>,绕开兜底 99 超雪花 5 位上限导致启动即崩的问题 - .env.iw / .env.ow:出厂配置与随机口令已填好,仅 MESHSAFE_SECRET 故意留占位(以 MeshSafe 侧白名单为准);按 maintainer 决定原样入库 - install.sh iw|ow:按角色建 .env -> 自检 -> sha256 校验 tar -> 架构 核对 -> docker load 后校验 tag -> 建目录/属主/SELinux 标签 -> 起栈 并逐个等健康。修掉 pipefail 下 `grep | head -1` 静默中断、架构字段 误读 manifest.json(实际在 Config blob)、die() 未定义先被调用 - export-images.sh:就地刷新 images/*.tar、sql、.env 的 tag 与 SHA256SUMS,再打 dist 交付盘;tar 与 SHA256SUMS 由 .gitignore 排除 - sql/01+02:从 backend/db 的 PG 全量与初始数据覆盖拷贝。三个 upgrade-*.sql 的 PG 段(x_upload_config、x_file_security)已在 init-table-postgres-full.sql 内,空库跑 01->02 即完整现状 - smoke_test.py:18 条断言的现场验收,凭证全部走环境变量 - 部署说明.md:拓扑、交付清单、出厂口令表、iw/ow 差异、验收清单、 13 条已知坑 镜像 tar 不进 git,装机包由 export-images.sh 出盘。
This commit is contained in:
2082
deploy/offline/sql/01-init-table.sql
Normal file
2082
deploy/offline/sql/01-init-table.sql
Normal file
File diff suppressed because it is too large
Load Diff
46
deploy/offline/sql/02-init-data.sql
Normal file
46
deploy/offline/sql/02-init-data.sql
Normal file
@@ -0,0 +1,46 @@
|
||||
-- 系统uc_platform
|
||||
INSERT INTO uc_platform
|
||||
(platform_code, name, full_name, short_name, business, deleted, create_time)
|
||||
VALUES(1, '文档系统', 's-file', 'file', true, FALSE, now());
|
||||
|
||||
-- 平台机构/平台机构管理员
|
||||
INSERT INTO xs_org
|
||||
(org_name, org_code, type, address_code, address_name, description, quality, enable, activated, parent_id, credit_code, trade, deleted, create_by, create_time, update_by, update_time, proxy_by, activation_code, phone, query_children, org_logo, registered_address, company_size, business_license, recruit_position_type)
|
||||
VALUES('senmesh', 'O001', '1', '440232', NULL, NULL, false, TRUE, TRUE, NULL, '', NULL, FALSE, 0, now(), 1, now(), null, NULL, null, NULL, null, '1234', '6', null, '1');
|
||||
|
||||
INSERT INTO uc_user
|
||||
(username, password, type, supeiror, security_code, nickname, avatar, phone, phone_binding, real_name, card_no, authenticated, status, email, address, education, init_user_id, enabled, account_non_expired, account_non_locked, credentials_non_expired, deleted, create_by, create_time, update_by, update_time, proxy_by, gender, birthday)
|
||||
VALUES('admin', '$2a$10$0N3iaxx2sYv0hXvYzS4.6.yriL.DfjRTjED7Y4vkqxzbxi2dNpBou', 1, TRUE, '$2a$10$mGA1jdBzq8micEr02KiJ9OiYQz1fc/PSVG0hN0EYUuxhZp8EI1M2q', '平台管理员', '', '13888888888', TRUE, '平台管理员', NULL, FALSE, 2, null, NULL, NULL, NULL, TRUE, TRUE, TRUE, TRUE, FALSE, 0, now(), 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO uc_org_user
|
||||
(user_id, org_id, administrator, deleted, create_by, create_time, update_by, update_time, proxy_by)
|
||||
VALUES(1, 1, TRUE, FALSE, 0, now(), NULL, NULL, NULL);
|
||||
-- 平台uc_org_relation
|
||||
INSERT INTO uc_org_relation
|
||||
(org_id, org_type, parent_id, path, platform_code, platform_name, deleted, create_by, create_time, update_by, update_time, proxy_by)
|
||||
VALUES(1, 1, 0, '1', 1, NULL, FALSE, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of x_file_category
|
||||
-- ----------------------------
|
||||
INSERT INTO x_file_category (file_category, file_suffix, deleted, create_by, create_time) VALUES
|
||||
('video', 'mp4', FALSE, 0, NOW()),
|
||||
('video', 'mkv', FALSE, 0, NOW()),
|
||||
('video', 'avi', FALSE, 0, NOW()),
|
||||
('video', 'mov', FALSE, 0, NOW()),
|
||||
('video', 'wmv', FALSE, 0, NOW()),
|
||||
('video', 'flv', FALSE, 0, NOW()),
|
||||
('audio', 'mp3', FALSE, 0, NOW()),
|
||||
('audio', 'wav', FALSE, 0, NOW()),
|
||||
('audio', 'flac', FALSE, 0, NOW()),
|
||||
('audio', 'aac', FALSE, 0, NOW()),
|
||||
('document', 'txt', FALSE, 0, NOW()),
|
||||
('document', 'docx', FALSE, 0, NOW()),
|
||||
('document', 'pdf', FALSE, 0, NOW()),
|
||||
('document', 'epub', FALSE, 0, NOW()),
|
||||
('other', 'zip', FALSE, 0, NOW()),
|
||||
('other', 'rar', FALSE, 0, NOW()),
|
||||
('other', '7z', FALSE, 0, NOW()),
|
||||
('other', 'jpg', FALSE, 0, NOW()),
|
||||
('other', 'png', FALSE, 0, NOW()),
|
||||
('other', 'gif', FALSE, 0, NOW()),
|
||||
('other', 'tiff', FALSE, 0, NOW());
|
||||
12
deploy/offline/sql/README.md
Normal file
12
deploy/offline/sql/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
建表与初始数据脚本已随包放好,文件名前缀决定执行顺序(先建表后灌数据):
|
||||
|
||||
| 文件 | 来源 | 说明 |
|
||||
|---|---|---|
|
||||
| `01-init-table.sql` | `backend/db/init-table-postgres-full.sql` | 全量 DDL,含 `x_file_security` 安全检测表 |
|
||||
| `02-init-data.sql` | `backend/db/init-data.sql` | admin 账号、机构、平台编码(`system.code=1` 要与此一致) |
|
||||
|
||||
出盘时用 `scripts/export-images.sh` 从仓库重新覆盖这两份,别手改副本;
|
||||
增量升级脚本(`backend/db/upgrade-*.sql`)不在这里,装好后按《部署说明.md》第 7 节人工执行。
|
||||
|
||||
只有 `POSTGRES_*` 指向的库为空时,PostgreSQL 官方镜像才会执行 `docker-entrypoint-initdb.d`;
|
||||
数据目录已有数据时会跳过 —— 想重建就把 `$SFILE_DATA_ROOT/pgdata` 一起清掉再 `up`。
|
||||
Reference in New Issue
Block a user