mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-12 03:07:51 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
+71
@@ -0,0 +1,71 @@
|
||||
#!/bin/sh
|
||||
# Author Xiaobao(xiaobao@linkease.com)
|
||||
|
||||
ACTION=${1}
|
||||
shift 1
|
||||
|
||||
do_install() {
|
||||
local port=`uci get drawio.@main[0].port 2>/dev/null`
|
||||
local config=`uci get drawio.@main[0].config_path 2>/dev/null`
|
||||
|
||||
if [ -z "$config" ]; then
|
||||
echo "config path is empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p $config
|
||||
RET=$?
|
||||
if [ ! "$RET" = "0" ]; then
|
||||
echo "mkdir config path failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -z $port ] && port=8090
|
||||
sed 's/PORT_VAR/'$port'/g' /usr/share/drawio/docker-compose.template.yaml > $config/docker-compose.yaml
|
||||
RET=$?
|
||||
if [ ! "$RET" = "0" ]; then
|
||||
echo "convert docker-compose.yaml failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $config
|
||||
export COMPOSE_PROJECT_NAME=linkease-drawio
|
||||
docker-compose down || true
|
||||
docker-compose up -d
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 sub-command"
|
||||
echo "where sub-command is one of:"
|
||||
echo " install Install the drawio"
|
||||
echo " upgrade Upgrade the drawio"
|
||||
echo " rm/start/stop/restart Remove/Start/Stop/Restart the drawio"
|
||||
echo " status DrawIO status"
|
||||
echo " port DrawIO port"
|
||||
}
|
||||
|
||||
case ${ACTION} in
|
||||
"install")
|
||||
do_install
|
||||
;;
|
||||
"upgrade")
|
||||
do_install
|
||||
;;
|
||||
"rm")
|
||||
docker rm -f drawio
|
||||
;;
|
||||
"start" | "stop" | "restart")
|
||||
config=`uci get drawio.@main[0].config_path 2>/dev/null`
|
||||
cd $config && docker-compose ${ACTION}
|
||||
;;
|
||||
"status")
|
||||
docker ps --all -f 'name=^/linkease-drawio_drawio_1$' --format '{{.State}}'
|
||||
;;
|
||||
"port")
|
||||
docker ps --all -f 'name=^/linkease-drawio_drawio_1$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://'
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,67 @@
|
||||
version: '3'
|
||||
services:
|
||||
plantuml-server:
|
||||
image: linkease/drawio-plantuml-server:2022121901
|
||||
expose:
|
||||
- "8080"
|
||||
networks:
|
||||
- drawionet
|
||||
volumes:
|
||||
- fonts_volume:/usr/share/fonts/drawio
|
||||
image-export:
|
||||
image: linkease/drawio-image-export:2022121901
|
||||
expose:
|
||||
- "8000"
|
||||
networks:
|
||||
- drawionet
|
||||
volumes:
|
||||
- fonts_volume:/usr/share/fonts/drawio
|
||||
environment:
|
||||
- DRAWIO_SERVER_URL=${DRAWIO_BASE_URL}
|
||||
drawio:
|
||||
image: jgraph/drawio
|
||||
ports:
|
||||
- "PORT_VAR:8080"
|
||||
links:
|
||||
- plantuml-server:plantuml-server
|
||||
- image-export:image-export
|
||||
depends_on:
|
||||
- plantuml-server
|
||||
- image-export
|
||||
networks:
|
||||
- drawionet
|
||||
environment:
|
||||
- DRAWIO_SELF_CONTAINED=1
|
||||
- PLANTUML_URL=http://plantuml-server:8080/
|
||||
- EXPORT_URL=http://image-export:8000/
|
||||
- DRAWIO_BASE_URL=${DRAWIO_BASE_URL}
|
||||
- DRAWIO_CSP_HEADER=${DRAWIO_CSP_HEADER}
|
||||
- DRAWIO_VIEWER_URL=${DRAWIO_VIEWER_URL}
|
||||
- DRAWIO_LIGHTBOX_URL=${DRAWIO_LIGHTBOX_URL}
|
||||
- DRAWIO_CONFIG=${DRAWIO_CONFIG}
|
||||
- DRAWIO_GOOGLE_CLIENT_ID=${DRAWIO_GOOGLE_CLIENT_ID}
|
||||
- DRAWIO_GOOGLE_APP_ID=${DRAWIO_GOOGLE_APP_ID}
|
||||
- DRAWIO_GOOGLE_CLIENT_SECRET=${DRAWIO_GOOGLE_CLIENT_SECRET}
|
||||
- DRAWIO_GOOGLE_VIEWER_CLIENT_ID=${DRAWIO_GOOGLE_VIEWER_CLIENT_ID}
|
||||
- DRAWIO_GOOGLE_VIEWER_APP_ID=${DRAWIO_GOOGLE_VIEWER_APP_ID}
|
||||
- DRAWIO_GOOGLE_VIEWER_CLIENT_SECRET=${DRAWIO_GOOGLE_VIEWER_CLIENT_SECRET}
|
||||
- DRAWIO_MSGRAPH_CLIENT_ID=${DRAWIO_MSGRAPH_CLIENT_ID}
|
||||
- DRAWIO_MSGRAPH_CLIENT_SECRET=${DRAWIO_MSGRAPH_CLIENT_SECRET}
|
||||
- DRAWIO_MSGRAPH_TENANT_ID=${DRAWIO_MSGRAPH_TENANT_ID}
|
||||
- DRAWIO_GITLAB_ID=${DRAWIO_GITLAB_ID}
|
||||
- DRAWIO_GITLAB_SECRET=${DRAWIO_GITLAB_SECRET}
|
||||
- DRAWIO_GITLAB_URL=${DRAWIO_GITLAB_URL}
|
||||
- DRAWIO_CLOUD_CONVERT_APIKEY=${DRAWIO_CLOUD_CONVERT_APIKEY}
|
||||
- DRAWIO_CACHE_DOMAIN=${DRAWIO_CACHE_DOMAIN}
|
||||
- DRAWIO_MEMCACHED_ENDPOINT=${DRAWIO_MEMCACHED_ENDPOINT}
|
||||
- DRAWIO_PUSHER_MODE=2
|
||||
- DRAWIO_IOT_ENDPOINT=${DRAWIO_IOT_ENDPOINT}
|
||||
- DRAWIO_IOT_CERT_PEM=${DRAWIO_IOT_CERT_PEM}
|
||||
- DRAWIO_IOT_PRIVATE_KEY=${DRAWIO_IOT_PRIVATE_KEY}
|
||||
- DRAWIO_IOT_ROOT_CA=${DRAWIO_IOT_ROOT_CA}
|
||||
- DRAWIO_MXPUSHER_ENDPOINT=${DRAWIO_MXPUSHER_ENDPOINT}
|
||||
networks:
|
||||
drawionet:
|
||||
|
||||
volumes:
|
||||
fonts_volume:
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-drawio": {
|
||||
"description": "Grant UCI access for luci-app-drawio",
|
||||
"read": {
|
||||
"uci": [ "drawio" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "drawio" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user