diff --git a/.github/workflows/appmanage_docker.yml b/.github/workflows/appmanage_docker.yml index 1d18e25d..0442ea06 100644 --- a/.github/workflows/appmanage_docker.yml +++ b/.github/workflows/appmanage_docker.yml @@ -22,7 +22,7 @@ jobs: name: Build & push Docker image with: image: websoft9dev/appmanage - tags: 0.4.0 + tags: 0.5.0 registry: docker.io dockerfile: appmanage/Dockerfile directory: appmanage diff --git a/CHANGELOG.md b/CHANGELOG.md index 712e7e62..d8882d39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.0 release on 2023-06-17 + +1. appstore 升级脚本输出内容过多引起的异常修复 +2. 安装脚本对于 yq 失败的异常处理 + ## 0.4.0 release on 2023-06-15 1. owncloud 下线测试 diff --git a/appmanage/Dockerfile b/appmanage/Dockerfile index ef28a3a5..d6cf741e 100644 --- a/appmanage/Dockerfile +++ b/appmanage/Dockerfile @@ -10,7 +10,7 @@ COPY static ./static COPY requirements.txt main.py ./ RUN apt update -# Install supervisord +# Install supervisords RUN apt install -y supervisor COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY config/cmd.sh /cmd.sh diff --git a/appmanage/api/service/manage.py b/appmanage/api/service/manage.py index 98261ab9..deca4366 100644 --- a/appmanage/api/service/manage.py +++ b/appmanage/api/service/manage.py @@ -59,7 +59,7 @@ def AppStoreUpdate(): for change in change_log[1:]: if change != '': content.append(change) - shell_execute.execute_command_output_all("curl https://websoft9.github.io/StackHub/install/update_appstore.sh | bash") + shell_execute.execute_command_output_all("wget curl https://websoft9.github.io/StackHub/install/update_appstore.sh && bash update_appstore.sh 1>/dev/null 2>&1") return content else: diff --git a/docker/w9appmanage/.env b/docker/w9appmanage/.env index 94412b1d..b5323893 100644 --- a/docker/w9appmanage/.env +++ b/docker/w9appmanage/.env @@ -1,4 +1,4 @@ APP_NAME=websoft9-appmanage -APP_VERSION=0.4.0 +APP_VERSION=0.5.0 APP_HTTP_PORT=5000 APP_NETWORK=websoft9 diff --git a/install/install.sh b/install/install.sh index 0deca359..feaf969a 100644 --- a/install/install.sh +++ b/install/install.sh @@ -414,7 +414,8 @@ sleep 25 echo "edit nginxproxymanager password..." login_data=$(curl -X POST -H "Content-Type: application/json" -d '{"identity":"admin@example.com","scope":"user", "secret":"changeme"}' http://127.0.0.1:9092/api/tokens) sleep 3 -token=$(echo $login_data | jq -r '.token') +token=echo $login_data | grep -Po '(?<="token":")[^"]*' +#token=$(echo $login_data | jq -r '.token') new_password=$(docker run --name pwgen backplane/pwgen 15)! docker rm -f pwgen curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{"email": "help@websoft9.com", "nickname": "admin", "is_disabled": false, "roles": ["admin"]}' http://127.0.0.1:9092/api/users/1 @@ -432,6 +433,8 @@ public_ip=`bash /data/apps/stackhub/scripts/get_ip.sh` sudo sed -i "s/domain.com/$public_ip/g" /var/lib/docker/volumes/w9nginxproxymanager_nginx_data/_data/nginx/proxy_host/initproxy.conf echo "Add htpasswd for appmanage ..." +new_password=$(docker run --name pwgen backplane/pwgen 15)! +docker rm -f pwgen sudo sed -i 's/"APPMANAGE_USERNAME": ".*"/"APPMANAGE_USERNAME": "websoft9"/g' /usr/share/cockpit/myapps/config.json sudo sed -i 's/"APPMANAGE_PASSWORD": ".*"/"APPMANAGE_PASSWORD": "'$new_password'"/g' /usr/share/cockpit/myapps/config.json rm -rf /var/lib/docker/volumes/w9nginxproxymanager_nginx_data/_data/nginx/proxy_host/.htpasswd /tmp/.htpasswd @@ -444,28 +447,30 @@ sudo docker restart websoft9-nginxproxymanager EditMenu(){ echo "Start to Edit Cockpit Menu ..." -if [ -e /usr/share/cockpit/systemd ]; then - jq '. | .tools as $menu | .menu as $tools | .tools=$tools | .menu=$menu | del(.tools.services) | del(.menu.preload.services) | .menu.index = .tools.index | del(.tools.index) | .menu.index.order = -2' /usr/share/cockpit/systemd/manifest.json > /usr/share/cockpit/systemd/manifest.json.tmp - rm -rf /usr/share/cockpit/systemd/manifest.json - mv /usr/share/cockpit/systemd/manifest.json.tmp /usr/share/cockpit/systemd/manifest.json - cd /usr/share/cockpit/systemd && rm -rf services.js.gz services.html.gz services.css.gz -fi -if [ -e /usr/share/cockpit/networkmanager ]; then - sudo sed -i 's/menu/tools/g' /usr/share/cockpit/networkmanager/manifest.json -fi -if [ -e /usr/share/cockpit/storaged ]; then - sudo sed -i 's/menu/tools/g' /usr/share/cockpit/storaged/manifest.json -fi -if [ -e /usr/share/cockpit/users ]; then - sudo sed -i 's/menu/tools/g' /usr/share/cockpit/users/manifest.json -fi - -jq '. | del(.locales."ca-es") | del(.locales."nb-no") | del(.locales."sk-sk") | del(.locales."tr-tr")| del(.locales."cs-cz") | del(.locales."de-de") | del(.locales."es-es") | del(.locales."fi-fi") | del(.locales."fr-fr") | del(.locales."it-it") | del(.locales."ja-jp") | del(.locales."pl-pl") | del(.locales."pt-br") | del(.locales."ru-ru") | del(.locales."sv-se") | del(.locales."uk-ua") | del(.locales."zh-tw") | del(.locales."he-il") | del(.locales."nl-nl") | del(.locales."ko-kr") | del(.locales."ka-ge")' /usr/share/cockpit/shell/manifest.json > /usr/share/cockpit/shell/manifest.json.tmp -rm -rf /usr/share/cockpit/shell/manifest.json -mv /usr/share/cockpit/shell/manifest.json.tmp /usr/share/cockpit/shell/manifest.json +if command -v yq > /dev/null; then + if [ -e /usr/share/cockpit/systemd ]; then + jq '. | .tools as $menu | .menu as $tools | .tools=$tools | .menu=$menu | del(.tools.services) | del(.menu.preload.services) | .menu.index = .tools.index | del(.tools.index) | .menu.index.order = -2' /usr/share/cockpit/systemd/manifest.json > /usr/share/cockpit/systemd/manifest.json.tmp + rm -rf /usr/share/cockpit/systemd/manifest.json + mv /usr/share/cockpit/systemd/manifest.json.tmp /usr/share/cockpit/systemd/manifest.json + cd /usr/share/cockpit/systemd && rm -rf services.js.gz services.html.gz services.css.gz + fi + if [ -e /usr/share/cockpit/networkmanager ]; then + sudo sed -i 's/menu/tools/g' /usr/share/cockpit/networkmanager/manifest.json + fi + if [ -e /usr/share/cockpit/storaged ]; then + sudo sed -i 's/menu/tools/g' /usr/share/cockpit/storaged/manifest.json + fi + if [ -e /usr/share/cockpit/users ]; then + sudo sed -i 's/menu/tools/g' /usr/share/cockpit/users/manifest.json + fi + jq '. | del(.locales."ca-es") | del(.locales."nb-no") | del(.locales."sk-sk") | del(.locales."tr-tr")| del(.locales."cs-cz") | del(.locales."de-de") | del(.locales."es-es") | del(.locales."fi-fi") | del(.locales."fr-fr") | del(.locales."it-it") | del(.locales."ja-jp") | del(.locales."pl-pl") | del(.locales."pt-br") | del(.locales."ru-ru") | del(.locales."sv-se") | del(.locales."uk-ua") | del(.locales."zh-tw") | del(.locales."he-il") | del(.locales."nl-nl") | del(.locales."ko-kr") | del(.locales."ka-ge")' /usr/share/cockpit/shell/manifest.json > /usr/share/cockpit/shell/manifest.json.tmp + rm -rf /usr/share/cockpit/shell/manifest.json + mv /usr/share/cockpit/shell/manifest.json.tmp /usr/share/cockpit/shell/manifest.json +else + echo "system have no jq, use cockpit menu ..." +fi echo "---------------------------------- Install success! you can install a app by websoft9's appstore -------------------------------------------------------" - } CheckEnvironment diff --git a/install/version.json b/install/version.json index ac60b125..2ae68a88 100644 --- a/install/version.json +++ b/install/version.json @@ -2,7 +2,7 @@ "SERVICES": { "PORTAINER": "2.18.3", "NGINX": "2.10.3", - "APPMANAGE": "0.4.0", + "APPMANAGE": "0.5.0", "REDIS": "7.0.11" }, "PLUGINS": { @@ -14,5 +14,5 @@ "LIBRARY": { "VERSION": "0.2.1" }, - "VERSION": "0.4.1" + "VERSION": "0.5.0" } \ No newline at end of file