From aaf12377bb4ac7c723f524410c953aa485d072a9 Mon Sep 17 00:00:00 2001 From: Darren <27513732@qq.com> Date: Mon, 20 Nov 2023 11:06:44 +0800 Subject: [PATCH 1/6] Update user.md --- apphub/docs/user.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apphub/docs/user.md b/apphub/docs/user.md index dbd2491c..64e997e7 100755 --- a/apphub/docs/user.md +++ b/apphub/docs/user.md @@ -15,4 +15,14 @@ usermod -aG sudo username #### Can not login when I reinstall my Instance? -Need to clear all cookie at you browser \ No newline at end of file +Need to clear all cookie at you browser + +#### How to update Media and library? + +--channel dev | release + +``` +docker exec -it websoft9-apphub bash +bash /websoft9/script/update_zip.sh --channel dev --package_name "media-latest.zip" --sync_to "/websoft9/media" +bash /websoft9/script/update_zip.sh --channel dev --package_name "library-latest.zip" --sync_to "/websoft9/library" +``` From 0c5893b61c4fc5caef226bc9173096bfa60973bb Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Tue, 21 Nov 2023 15:00:57 +0800 Subject: [PATCH 2/6] websoft9 --- docs/notes/Process.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/notes/Process.md b/docs/notes/Process.md index db63012b..fe753008 100644 --- a/docs/notes/Process.md +++ b/docs/notes/Process.md @@ -27,7 +27,7 @@ API 接口功能设计: body: { - app_name # 产品名 -- app_id # 自定义应用名称 +- app_id # 自定义应用名称+随机字符串组成唯一标识 - domains[] #域名-可选 - default_domain #默认域名-可选:设置.env中APP_URL - edition{dist:community, version:5.0} #应用版本,来自variable.json,但目前variable.json中只有 version 的数据 @@ -38,9 +38,7 @@ body: 过程: 1. 参数验证: - app_id 验证: - 业务要求:gitea 中是否存在同名的 repository,Portainer中是否存在同名stack - 技术要求-【非空,容器要求:2位-20位,字母数字以及-组成 gitea:todo portainer:todo】 + app_id 验证:随机字符串保证唯一性,无需验证 app_name 验证: 在gitea容器的library目录下验证 domains[]验证:是否绑定过,数量不能超过2:泛域名+其他域名 default_domain验证:来自domains[]中,自定义域名优先 @@ -267,7 +265,10 @@ List all apps,继承 Portainer API /stacks: 2. portainer 中的应用目录的 variables.json 或 repository variables.json 3. Gitea API 列出当前 APP 的 repository 之 URL,提供访问链接? 4. 所用应用的数据目录:/var/lib/docker/volumes/... -5. Portainer 通过主容器的 Label 标签和 Ports,获取 app_*_port等 +5. Portainer 各种说明 + - 主容器:通过 W9_HTTP_PORT_SET获取http端口,通过W9_DB_PORT_SET获取DB端口,通过W9_MQ_PORT_SET获取消息队列端口 + > 当数据库是主应用时,url 显示为 IP和端口,以非链接形式展示 + - web应用数据库: 通过 W9_DB_EXPOSE 来确定数据库类型,然后根据数据库字典获得数据库用户名,POWER_PASSWORD是数据库密码,HOST 是APP_ID-db #### deploy/apps/{id} @@ -305,9 +306,9 @@ function proxy(host,domains[], Optional:port, Optional:exra_proxy.conf) 也可以使用 getPort(), getExra_proxy() -1. 获取 Port: 从 portainer.containers 接口中 Label 属性集中获取 http 或 https +1. 获取 Port: 从 .env 获取 W9_HTTP_PORT 或者 W9_HTTPS_PORT - > com.docker.compose.http.port": "9001" | com.docker.compose.https.port": "9002" + > W9_HTTP_PORT=9001 | W9_HTTPS_PORT=9002,根据是否含有HTTPS决定proxy的协议 2. 获取 exra_proxy.conf: 从 Gitea 接口中获取 repository 的 src/nginx_proxy.conf From 3a1dec2e47571ebd01703ab303a8d02d1ec7fca7 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Wed, 22 Nov 2023 10:10:19 +0800 Subject: [PATCH 3/6] disable storge network --- .../networkmanager.override.json | 62 ++------------- cockpit/menu_override/storaged.override.json | 78 +++---------------- 2 files changed, 16 insertions(+), 124 deletions(-) diff --git a/cockpit/menu_override/networkmanager.override.json b/cockpit/menu_override/networkmanager.override.json index 9ca218d3..90244aac 100644 --- a/cockpit/menu_override/networkmanager.override.json +++ b/cockpit/menu_override/networkmanager.override.json @@ -1,57 +1,7 @@ { - "menu": null, - "tools": { - "index": { - "label": "Networking", - "order": 40, - "docs": [ - { - "label": "Managing networking bonds", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-network-bonds-using-the-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing networking teams", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-network-teams-using-the-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing networking bridges", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-network-bridges-in-the-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing VLANs", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-vlans-in-the-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing firewall", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing_firewall_using_the_web_console" - } - ], - "keywords": [ - { - "matches": [ - "network", - "interface", - "bridge", - "vlan", - "bond", - "team", - "port", - "mac", - "ipv4", - "ipv6" - ] - }, - { - "matches": [ - "firewall", - "firewalld", - "zone", - "tcp", - "udp" - ], - "goto": "/network/firewall" - } - ] - } - } -} \ No newline at end of file + "name": "network", + "conditions": [ + {"path-exists": "/usr/share/dbus-1/system.d/org.freedesktop.NetworkManager.conf"} + ], + "menu": null +} diff --git a/cockpit/menu_override/storaged.override.json b/cockpit/menu_override/storaged.override.json index 726a9ccc..ccbf5ad3 100644 --- a/cockpit/menu_override/storaged.override.json +++ b/cockpit/menu_override/storaged.override.json @@ -1,69 +1,11 @@ { - "menu": null, - "tools": { - "index": { - "label": "Storage", - "order": 30, - "docs": [ - { - "label": "Managing partitions", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing-partitions-using-the-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing NFS mounts", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing-nfs-mounts-in-the-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing RAIDs", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/managing-redundant-arrays-of-independent-disks-in-the-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing LVMs", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/using-the-web-console-for-configuring-lvm-logical-volumes_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing physical drives", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/using-the-web-console-for-changing-physical-drives-in-volume-groups_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Managing VDOs", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/using-the-web-console-for-managing-virtual-data-optimizer-volumes_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Using LUKS encryption", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/locking-data-with-luks-password-in-the-rhel-web-console_system-management-using-the-rhel-8-web-console" - }, - { - "label": "Using Tang server", - "url": "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console/configuring-automated-unlocking-using-a-tang-key-in-the-web-console_system-management-using-the-rhel-8-web-console" - } - ], - "keywords": [ - { - "matches": [ - "filesystem", - "partition", - "nfs", - "raid", - "volume", - "disk", - "vdo", - "iscsi", - "drive", - "mount", - "unmount", - "udisks", - "mkfs", - "format", - "fstab", - "lvm2", - "luks", - "encryption", - "nbde", - "tang" - ] - } - ] - } - } -} \ No newline at end of file + "name": "storage", + "requires": { + "cockpit": "266" + }, + "conditions": [ + {"path-exists": "/usr/share/dbus-1/system.d/org.freedesktop.UDisks2.conf"} + ], + + "menu": null +} From 1bfba4ed7ebf358c55cced7eae9910314b19b9a2 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Thu, 23 Nov 2023 15:52:03 +0800 Subject: [PATCH 4/6] ports --- scripts/check_ports.sh | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scripts/check_ports.sh diff --git a/scripts/check_ports.sh b/scripts/check_ports.sh new file mode 100644 index 00000000..c08cc4be --- /dev/null +++ b/scripts/check_ports.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Command-line options +# ============================================================================== +# +# --version +# Use the --version option to install a special version for installation. default is latest, for example: +# +# $ sudo bash install.sh --version "0.8.25" +# +# --port check ports +# Use the --port option to check port, for example: +# +# $ sudo bash check_ports.sh --port 9001,9001 +# ============================================================================== + + +# 获取参数值 +while [[ $# -gt 0 ]]; do + case $1 in + --port) + IFS=',' read -ra ports <<< "$2" + shift 2 + ;; + *) + shift + ;; + esac +done + +check_ports() { + for port in "${ports[@]}"; do + if ss -tuln | grep ":$port " >/dev/null; then + echo "Port $port is in use!" + return 1 + fi + done + + echo "All ports are available" + return 0 +} + +check_ports From f04c3ad79ad7e881463add995da2b20abe41afbb Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Thu, 23 Nov 2023 16:03:30 +0800 Subject: [PATCH 5/6] checkports --- scripts/check_ports.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/check_ports.sh b/scripts/check_ports.sh index c08cc4be..c110697d 100644 --- a/scripts/check_ports.sh +++ b/scripts/check_ports.sh @@ -14,7 +14,6 @@ # $ sudo bash check_ports.sh --port 9001,9001 # ============================================================================== - # 获取参数值 while [[ $# -gt 0 ]]; do case $1 in @@ -29,15 +28,18 @@ while [[ $# -gt 0 ]]; do done check_ports() { + local used_ports=() for port in "${ports[@]}"; do if ss -tuln | grep ":$port " >/dev/null; then - echo "Port $port is in use!" - return 1 + used_ports+=("$port") fi done - echo "All ports are available" - return 0 + if [ ${#used_ports[@]} -eq 0 ]; then + echo "0" + else + IFS=','; echo "${used_ports[*]}" + fi } -check_ports +check_ports \ No newline at end of file From f770ae5f7e102aa3f3f3a87db5a7ad645682f8ff Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Thu, 23 Nov 2023 16:07:23 +0800 Subject: [PATCH 6/6] checkports --- scripts/check_ports.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/check_ports.sh b/scripts/check_ports.sh index c110697d..a31b5a1d 100644 --- a/scripts/check_ports.sh +++ b/scripts/check_ports.sh @@ -3,11 +3,6 @@ # Command-line options # ============================================================================== # -# --version -# Use the --version option to install a special version for installation. default is latest, for example: -# -# $ sudo bash install.sh --version "0.8.25" -# # --port check ports # Use the --port option to check port, for example: #