mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-23 09:20:20 +08:00
plugin update
This commit is contained in:
parent
c8565b2c9c
commit
1a11fdf031
49
.github/workflows/logo.yml
vendored
49
.github/workflows/logo.yml
vendored
@ -1,49 +0,0 @@
|
|||||||
name: logo timely update
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@master
|
|
||||||
name: Check out code
|
|
||||||
|
|
||||||
- name: update logo
|
|
||||||
run: |
|
|
||||||
# 获取contentful中所有url
|
|
||||||
entry=$(curl --include \
|
|
||||||
--request GET \
|
|
||||||
--header 'Authorization: Bearer ${{secrets.CONTENTFUL_TOKEN}}' \
|
|
||||||
https://api.contentful.com/spaces/ffrhttfighww/environments/master/entries?content_type=media\&select=fields.slug |tail -n 1)
|
|
||||||
echo $entry
|
|
||||||
applist=$(echo $entry | sed 's/en-US/en/g' | jq -r '.items[] | .fields.slug.en')
|
|
||||||
echo $applist
|
|
||||||
|
|
||||||
for app in ${applist};do
|
|
||||||
if [ "$app" = null ];then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
item=$(curl --include \
|
|
||||||
--request GET \
|
|
||||||
--header 'Authorization: Bearer ${{secrets.CONTENTFUL_TOKEN}}' \
|
|
||||||
https://api.contentful.com/spaces/ffrhttfighww/environments/master/entries?content_type=media\&fields.slug=${app}\&select=fields.imageurl\&locale=en-US | tail -n 1)
|
|
||||||
echo $item
|
|
||||||
url=$(echo $item | sed 's/en-US/en/' | jq -r '.items[0].fields.imageurl.en')
|
|
||||||
echo $url
|
|
||||||
file=$(echo appmanage/static/images/${url##*/})
|
|
||||||
echo $file
|
|
||||||
if [[ -f ${file} ]];then
|
|
||||||
echo "存在此文件,跳过"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
echo "执行wget"
|
|
||||||
wget --timeout=3 -q -P appmanage/static/images "$url"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: push logo
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
|
||||||
commit_message: update logo
|
|
@ -10,7 +10,7 @@ COPY static ./static
|
|||||||
COPY requirements.txt main.py ./
|
COPY requirements.txt main.py ./
|
||||||
RUN apt update
|
RUN apt update
|
||||||
|
|
||||||
# Install supervisord
|
# Install supervisords
|
||||||
RUN apt install -y supervisor
|
RUN apt install -y supervisor
|
||||||
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
COPY config/cmd.sh /cmd.sh
|
COPY config/cmd.sh /cmd.sh
|
||||||
|
@ -35,7 +35,9 @@ q = Queue(connection=redis_conn, default_timeout=3600)
|
|||||||
|
|
||||||
def auto_update():
|
def auto_update():
|
||||||
myLogger.info_logger("auto update")
|
myLogger.info_logger("auto update")
|
||||||
shell_execute.execute_command_output_all("wget https://websoft9.github.io/StackHub/install/update_appstore.sh && bash update_appstore.sh 1>/dev/null 2>&1")
|
shell_execute.execute_command_output_all("rm -rf /tmp/update_appstore.sh")
|
||||||
|
shell_execute.execute_command_output_all("cd /tmp && wget https://websoft9.github.io/websoft9/install/update_appstore.sh")
|
||||||
|
shell_execute.execute_command_output_all("bash /tmp/update_appstore.sh 1>/dev/null 2>&1")
|
||||||
|
|
||||||
scheduler = BackgroundScheduler()
|
scheduler = BackgroundScheduler()
|
||||||
scheduler.add_job(auto_update, 'cron', hour=1)
|
scheduler.add_job(auto_update, 'cron', hour=1)
|
||||||
@ -89,7 +91,7 @@ def AppStoreUpdate():
|
|||||||
if change != '':
|
if change != '':
|
||||||
content.append(change)
|
content.append(change)
|
||||||
shell_execute.execute_command_output_all("rm -rf /tmp/update_appstore.sh")
|
shell_execute.execute_command_output_all("rm -rf /tmp/update_appstore.sh")
|
||||||
shell_execute.execute_command_output_all("cd /tmp && wget https://websoft9.github.io/StackHub/install/update_appstore.sh")
|
shell_execute.execute_command_output_all("cd /tmp && wget https://websoft9.github.io/websoft9/install/update_appstore.sh")
|
||||||
shell_execute.execute_command_output_all("bash /tmp/update_appstore.sh 1>/dev/null 2>&1")
|
shell_execute.execute_command_output_all("bash /tmp/update_appstore.sh 1>/dev/null 2>&1")
|
||||||
|
|
||||||
return content
|
return content
|
||||||
@ -98,8 +100,8 @@ def AppStoreUpdate():
|
|||||||
|
|
||||||
# 获取 update info
|
# 获取 update info
|
||||||
def get_update_list():
|
def get_update_list():
|
||||||
local_path = '/data/apps/stackhub/install/version.json'
|
local_path = '/data/apps/websoft9/install/version.json'
|
||||||
repo = 'StackHub'
|
repo = 'websoft9'
|
||||||
local_version = "0"
|
local_version = "0"
|
||||||
try:
|
try:
|
||||||
op = shell_execute.execute_command_output_all("cat " + local_path)['result']
|
op = shell_execute.execute_command_output_all("cat " + local_path)['result']
|
||||||
|
@ -10,7 +10,6 @@ trap 'error_exit "Please push issue to: https://github.com/Websoft9/StackHub/iss
|
|||||||
|
|
||||||
urls=(
|
urls=(
|
||||||
https://github.com
|
https://github.com
|
||||||
https://gitee.com
|
|
||||||
https://ghproxy.com/https://github.com
|
https://ghproxy.com/https://github.com
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -275,22 +274,35 @@ fi
|
|||||||
echo "Set cockpit port to 9000 ..."
|
echo "Set cockpit port to 9000 ..."
|
||||||
sudo sed -i 's/ListenStream=9090/ListenStream=9000/' /lib/systemd/system/cockpit.socket
|
sudo sed -i 's/ListenStream=9090/ListenStream=9000/' /lib/systemd/system/cockpit.socket
|
||||||
|
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-appstore /data/apps/plugin-appstore
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-myapps /data/apps/plugin-myapps
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-portainer /data/apps/plugin-portainer
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-settings /data/apps/plugin-settings
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-nginx /data/apps/plugin-nginx
|
||||||
|
|
||||||
# install plugins
|
# install plugins
|
||||||
# install appstore
|
# install appstore
|
||||||
mkdir /usr/share/cockpit/appstore
|
mkdir /usr/share/cockpit/appstore
|
||||||
cp -r /data/apps/stackhub-web/plugins/appstore/build/* /usr/share/cockpit/appstore
|
cp -r /data/apps/plugin-appstore/build/* /usr/share/cockpit/appstore
|
||||||
|
cp -r /data/apps/plugin-appstore/data /usr/share/cockpit/appstore/static/
|
||||||
|
|
||||||
# install portainer
|
# install portainer
|
||||||
mkdir /usr/share/cockpit/container
|
mkdir /usr/share/cockpit/container
|
||||||
cp -r /data/apps/stackhub-web/plugins/portainer/build/* /usr/share/cockpit/container
|
cp -r /data/apps/plugin-portainer/build/* /usr/share/cockpit/container
|
||||||
|
|
||||||
## install nginx
|
## install nginx
|
||||||
mkdir /usr/share/cockpit/nginx
|
mkdir /usr/share/cockpit/nginx
|
||||||
cp -r /data/apps/stackhub-web/plugins/nginxproxymanager/build/* /usr/share/cockpit/nginx
|
cp -r /data/apps/plugin-nginx/build/* /usr/share/cockpit/nginx
|
||||||
|
|
||||||
## install settings
|
## install settings
|
||||||
mkdir /usr/share/cockpit/settings
|
mkdir /usr/share/cockpit/settings
|
||||||
cp -r /data/apps/stackhub-web/plugins/settings/build/* /usr/share/cockpit/settings
|
cp -r /data/apps/plugin-settings/build/* /usr/share/cockpit/settings
|
||||||
|
|
||||||
## install myapps
|
## install myapps
|
||||||
mkdir /usr/share/cockpit/myapps
|
mkdir /usr/share/cockpit/myapps
|
||||||
cp -r /data/apps/stackhub-web/plugins/myapps/build/* /usr/share/cockpit/myapps
|
cp -r /data/apps/plugin-myapps/build/* /usr/share/cockpit/myapps
|
||||||
|
cp -r /data/apps/plugin-appstore/logos /usr/share/cockpit/appstore/static/
|
||||||
|
rm -rf /data/apps/plugin-*
|
||||||
|
|
||||||
# install navigator
|
# install navigator
|
||||||
if [ "$os_type" == 'Ubuntu' ] || [ "$os_type" == 'Debian' ] ;then
|
if [ "$os_type" == 'Ubuntu' ] || [ "$os_type" == 'Debian' ] ;then
|
||||||
@ -317,7 +329,7 @@ fi
|
|||||||
rm -rf /usr/share/cockpit/apps /usr/share/cockpit/selinux /usr/share/cockpit/kdump /usr/share/cockpit/sosreport /usr/share/cockpit/packagekit
|
rm -rf /usr/share/cockpit/apps /usr/share/cockpit/selinux /usr/share/cockpit/kdump /usr/share/cockpit/sosreport /usr/share/cockpit/packagekit
|
||||||
|
|
||||||
# configure cockpit
|
# configure cockpit
|
||||||
cp /data/apps/stackhub/cockpit/cockpit.conf /etc/cockpit/cockpit.conf
|
cp /data/apps/websoft9/cockpit/cockpit.conf /etc/cockpit/cockpit.conf
|
||||||
|
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable --now cockpit
|
sudo systemctl enable --now cockpit
|
||||||
@ -377,9 +389,13 @@ echo "fast url is: "$fasturl
|
|||||||
# download apps
|
# download apps
|
||||||
mkdir -p /data/apps
|
mkdir -p /data/apps
|
||||||
clone_repo $fasturl/Websoft9/docker-library /data/library
|
clone_repo $fasturl/Websoft9/docker-library /data/library
|
||||||
clone_repo $fasturl/Websoft9/StackHub /data/apps/stackhub
|
clone_repo $fasturl/Websoft9/websoft9 /data/apps/websoft9
|
||||||
clone_repo $fasturl/Websoft9/stackhub-web /data/apps/stackhub-web
|
clone_repo $fasturl/Websoft9/plugin-appstore /data/apps/plugin-appstore
|
||||||
cp -r /data/apps/stackhub/docker /data/apps/w9services
|
clone_repo $fasturl/Websoft9/plugin-myapps /data/apps/plugin-myapps
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-portainer /data/apps/plugin-portainer
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-settings /data/apps/plugin-settings
|
||||||
|
clone_repo $fasturl/Websoft9/plugin-nginx /data/apps/plugin-nginx
|
||||||
|
cp -r /data/apps/websoft9/docker /data/apps/w9services
|
||||||
}
|
}
|
||||||
|
|
||||||
StartAppMng(){
|
StartAppMng(){
|
||||||
@ -503,6 +519,5 @@ PrepareStaticFiles
|
|||||||
InstallCockpit
|
InstallCockpit
|
||||||
StartAppMng
|
StartAppMng
|
||||||
StartPortainer
|
StartPortainer
|
||||||
#StartKopia
|
|
||||||
InstallNginx
|
InstallNginx
|
||||||
EditMenu
|
EditMenu
|
Loading…
Reference in New Issue
Block a user