diff --git a/build-dev.sh b/build-dev.sh new file mode 100644 index 00000000..dea26bc7 --- /dev/null +++ b/build-dev.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +echo " ---- Build Cosmos ----" + +rm -rf build + +cp src/update.go src/launcher/update.go + +go build -o build/cosmos src/*.go +if [ $? -ne 0 ]; then + exit 1 +fi +go build -o build/cosmos-launcher ./src/launcher/launcher.go ./src/launcher/update.go +if [ $? -ne 0 ]; then + exit 1 +fi + +echo " ---- Build complete, copy assets ----" + +cp start.sh build/start.sh +chmod +x build/start.sh +chmod +x build/cosmos +chmod +x build/cosmos-launcher + +cp -r static build/ +cp -r GeoLite2-Country.mmdb build/ +cp nebula-arm-cert nebula-cert nebula-arm nebula build/ +cp -r Logo.png build/ +mkdir build/images +cp client/src/assets/images/icons/cosmos_gray.png build/cosmos_gray.png +cp client/src/assets/images/icons/cosmos_gray.png cosmos_gray.png +echo '{' > build/meta.json +cat package.json | grep -E '"version"' >> build/meta.json +echo ' "buildDate": "'`date`'",' >> build/meta.json +echo ' "built from": "'`hostname`'"' >> build/meta.json +echo '}' >> build/meta.json + +echo " ---- copy complete ----" \ No newline at end of file diff --git a/changelog.md b/changelog.md index ffbb035e..b4e92d48 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## Version 0.17.3 + - fix race condition with the monitoring + ## Version 0.17.2 - Fix RClone false error diff --git a/package.json b/package.json index 81f774e3..54d41dd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.17.2", + "version": "0.17.3", "description": "", "main": "test-server.js", "bugs": { @@ -90,7 +90,7 @@ "client": "vite", "client-build": "vite build --base=/cosmos-ui/", "start": "build/cosmos-launcher && env COSMOS_CONFIG_FOLDER=./zz_test_config/ CONFIG_FILE=./config_dev.json EZ=UTC ACME_STAGING=true build/cosmos", - "build": "sh build.sh", + "build": "sh build-dev.sh", "dev": "npm run build && npm run start", "dockerdevbuild": "docker build -f dockerfile.local --tag cosmos-dev .", "dockerdevrun": "docker stop cosmos-dev; docker rm cosmos-dev; docker run --cap-add NET_ADMIN -d -p 7200:443 -p 80:80 -p 53:53 -p 443:443 -p 4242:4242/udp -e DOCKER_HOST=tcp://host.docker.internal:2375 -e COSMOS_MONGODB=$MONGODB -e COSMOS_LOG_LEVEL=DEBUG -v /:/mnt/host --restart=unless-stopped -h cosmos-dev --name cosmos-dev cosmos-dev", diff --git a/src/proxy/SocketProxy.go b/src/proxy/SocketProxy.go index 8c2078cd..c9861fc3 100644 --- a/src/proxy/SocketProxy.go +++ b/src/proxy/SocketProxy.go @@ -134,6 +134,7 @@ func startProxy(listenAddr string, target string, proxyInfo *ProxyInfo, isHTTPPr utils.Log("[SocketProxy] Proxy listening on "+listenAddr+", forwarding to "+listenProtocol+"://"+target) if listenProtocol == "tcp" { + utils.Debug("[SocketProxy] Starting TCP proxy on " + listenAddr + " -> " + target) handleTCPProxy(listener, target, proxyInfo, isHTTPProxy, route, listenAddr) } else { handleUDPProxy(packetConn, target, proxyInfo, route, listenAddr) diff --git a/src/storage/rclone.go b/src/storage/rclone.go index f35d35dd..562b6ffa 100644 --- a/src/storage/rclone.go +++ b/src/storage/rclone.go @@ -740,7 +740,7 @@ type RcloneStatsObj struct { func RCloneStats() (RcloneStatsObj, error) { utils.Debug("[RemoteStorage] Getting rclone stats") - if !utils.FBL.LValid { + if utils.FBL == nil || !utils.FBL.LValid { return RcloneStatsObj{0, 0}, nil }