diff --git a/Dockerfile b/Dockerfile index 24ed4c1..d29d0ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ## # Use image with golang last version as builder. -FROM golang:1.20-bullseye AS build +FROM golang:1.22-bullseye AS build # See https://stackoverflow.com/questions/64462922/docker-multi-stage-build-go-image-x509-certificate-signed-by-unknown-authorit RUN apt-get update && apt-get install -y ca-certificates openssl @@ -24,13 +24,17 @@ RUN openssl s_client -showcerts -connect proxy.golang.org:443 /dev/ RUN update-ca-certificates # Make project root folder as current dir. -WORKDIR $GOPATH/src/github.com/schwarzlichtbezirk/hms +WORKDIR /go/src/github.com/schwarzlichtbezirk/hms # Copy only go.mod and go.sum to prevent downloads all dependencies again on any code changes. -COPY go.* . +COPY go.mod go.sum ./ # Download all dependencies pointed at go.mod file. RUN go mod download # Copy all files and subfolders in current state as is. COPY . . +COPY ./cmd ./cmd +COPY ./config ./config +COPY ./server ./server +COPY ./confdata /go/bin/config # Set executable rights to all shell-scripts. RUN chmod +x task/*.sh @@ -43,7 +47,11 @@ RUN task/wpk-app.sh RUN task/wpk-edge.sh # Compile project for Linux amd64. -RUN task/build-linux.x64.sh +RUN \ +buildvers=$(git describe --tags) && \ +buildtime=$(go run ./task/timenow.go) && \ +go env -w GOOS=linux GOARCH=amd64 CGO_ENABLED=1 && \ +go build -o /go/bin/hms_linux_x64 -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=$buildvers' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=$buildtime'" ./ ## ## Deploy stage @@ -55,11 +63,11 @@ FROM scratch # Copy compiled executable and packages to new image destination. COPY --from=build /go/bin/hms* /go/bin/ # Copy configuration files. -COPY --from=build /go/bin/config/* /go/bin/config/ +COPY --from=build /go/bin/config /go/bin/config # Open REST listen port. -EXPOSE 80 8080 +EXPOSE 80 8804 # Run application with full path representation. # Without shell to get signal for graceful shutdown. -ENTRYPOINT ["/go/bin/hms.linux.x64.exe"] +ENTRYPOINT ["/go/bin/hms_linux_x64", "web"] diff --git a/frontend/build/main.html b/frontend/build/main.html index 2f4a102..88f2bfc 100644 --- a/frontend/build/main.html +++ b/frontend/build/main.html @@ -99,7 +99,7 @@ - + diff --git a/frontend/build/stat.html b/frontend/build/stat.html index e79de06..bef2724 100644 --- a/frontend/build/stat.html +++ b/frontend/build/stat.html @@ -67,7 +67,7 @@ - + diff --git a/frontend/devmode/devmode.js b/frontend/devmode/devmode.js index 467acd3..64b0bc9 100644 --- a/frontend/devmode/devmode.js +++ b/frontend/devmode/devmode.js @@ -3,7 +3,7 @@ // This file is included only for developer mode linkage const buildvers = "0.11.0"; -const builddate = "2023.11.15"; +const builddate = "2024.02.17"; console.info("version: %s, builton: %s", buildvers, builddate); console.info("starts in developer mode"); diff --git a/frontend/devmode/main.html b/frontend/devmode/main.html index 67d7ad5..c05eab3 100644 --- a/frontend/devmode/main.html +++ b/frontend/devmode/main.html @@ -99,12 +99,12 @@ - + - + diff --git a/frontend/devmode/relmode.js b/frontend/devmode/relmode.js index df6e922..2e2635a 100644 --- a/frontend/devmode/relmode.js +++ b/frontend/devmode/relmode.js @@ -2,8 +2,8 @@ // This file is included for release mode linkage -const buildvers = "0.10.2"; -const builddate = "2023.05.10"; +const buildvers = "0.11.0"; +const builddate = "2024.02.17"; const devmode = false; const traceajax = () => undefined; diff --git a/frontend/devmode/stat.html b/frontend/devmode/stat.html index bdf8777..aa546e4 100644 --- a/frontend/devmode/stat.html +++ b/frontend/devmode/stat.html @@ -67,7 +67,7 @@ - + diff --git a/go.mod b/go.mod index 9a9844c..05bd535 100644 --- a/go.mod +++ b/go.mod @@ -74,7 +74,7 @@ require ( github.com/ugorji/go/codec v1.2.12 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.7.0 // indirect - golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect + golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/go.sum b/go.sum index 5534a71..2ce11ba 100644 --- a/go.sum +++ b/go.sum @@ -214,13 +214,13 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= -golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -261,8 +261,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= diff --git a/task/build-linux-x64.cmd b/task/build-linux-x64.cmd index 34551e4..5dec064 100644 --- a/task/build-linux-x64.cmd +++ b/task/build-linux-x64.cmd @@ -10,4 +10,4 @@ for /F "tokens=*" %%g in ('git describe --tags') do (set buildvers=%%g) for /F "tokens=*" %%g in ('go run %~dp0/timenow.go') do (set buildtime=%%g) go env -w GOOS=linux GOARCH=amd64 CGO_ENABLED=1 -go build -o %GOPATH%/bin/hms_linux_x64 -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=%buildvers%' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=%buildtime%'" %wd% +go build -o "%GOPATH%/bin/hms_linux_x64" -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=%buildvers%' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=%buildtime%'" %wd% diff --git a/task/build-linux-x64.sh b/task/build-linux-x64.sh index f515ee7..58dc9a4 100644 --- a/task/build-linux-x64.sh +++ b/task/build-linux-x64.sh @@ -5,10 +5,10 @@ wd=$(realpath -s "$(dirname "$0")/..") mkdir -p "$GOPATH/bin/cache" -cp -ruv "$wd/confdata" "$GOPATH/bin/config" +cp -ruv "$wd/confdata/"* "$GOPATH/bin/config" buildvers=$(git describe --tags) -buildtime=$(go run "$(dirname "$0")/timenow.go") # $(date -u +'%FT%TZ') +buildtime=$(go run "$wd/task/timenow.go") # $(date -u +'%FT%TZ') go env -w GOOS=linux GOARCH=amd64 CGO_ENABLED=1 -go build -o $GOPATH/bin/hms_linux_x64 -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=$buildvers' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=$buildtime'" $wd +go build -o "$GOPATH/bin/hms_linux_x64" -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=$buildvers' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=$buildtime'" $wd diff --git a/task/build-win-x64.cmd b/task/build-win-x64.cmd index 95582e5..ff8ef2b 100644 --- a/task/build-win-x64.cmd +++ b/task/build-win-x64.cmd @@ -10,4 +10,4 @@ for /F "tokens=*" %%g in ('git describe --tags') do (set buildvers=%%g) for /F "tokens=*" %%g in ('go run %~dp0/timenow.go') do (set buildtime=%%g) go env -w GOOS=windows GOARCH=amd64 CGO_ENABLED=1 -go build -o %GOPATH%/bin/hms_win_x64.exe -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=%buildvers%' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=%buildtime%'" %wd% +go build -o "%GOPATH%/bin/hms_win_x64.exe" -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=%buildvers%' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=%buildtime%'" %wd% diff --git a/task/build-win-x64.sh b/task/build-win-x64.sh index abc071b..94c687b 100644 --- a/task/build-win-x64.sh +++ b/task/build-win-x64.sh @@ -5,10 +5,10 @@ wd=$(realpath -s "$(dirname "$0")/..") mkdir -p "$GOPATH/bin/cache" -cp -ruv "$wd/confdata" "$GOPATH/bin/config" +cp -ruv "$wd/confdata/"* "$GOPATH/bin/config" buildvers=$(git describe --tags) -buildtime=$(go run "$(dirname "$0")/timenow.go") # $(date -u +'%FT%TZ') +buildtime=$(go run "$wd/task/timenow.go") # $(date -u +'%FT%TZ') go env -w GOOS=windows GOARCH=amd64 CGO_ENABLED=1 -go build -o $GOPATH/bin/hms_win_x64.exe -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=$buildvers' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=$buildtime'" $wd +go build -o "$GOPATH/bin/hms_win_x64.exe" -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=$buildvers' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=$buildtime'" $wd diff --git a/task/build-win-x86.cmd b/task/build-win-x86.cmd index d18d9c7..52dc038 100644 --- a/task/build-win-x86.cmd +++ b/task/build-win-x86.cmd @@ -10,4 +10,4 @@ for /F "tokens=*" %%g in ('git describe --tags') do (set buildvers=%%g) for /F "tokens=*" %%g in ('go run %~dp0/timenow.go') do (set buildtime=%%g) go env -w GOOS=windows GOARCH=386 CGO_ENABLED=1 -go build -o %GOPATH%/bin/hms_win_x86.exe -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=%buildvers%' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=%buildtime%'" %wd% +go build -o "%GOPATH%/bin/hms_win_x86.exe" -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=%buildvers%' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=%buildtime%'" %wd% diff --git a/task/build-win-x86.sh b/task/build-win-x86.sh index 6be7ae8..3d2d63c 100644 --- a/task/build-win-x86.sh +++ b/task/build-win-x86.sh @@ -5,10 +5,10 @@ wd=$(realpath -s "$(dirname "$0")/..") mkdir -p "$GOPATH/bin/cache" -cp -ruv "$wd/confdata" "$GOPATH/bin/config" +cp -ruv "$wd/confdata/"* "$GOPATH/bin/config" buildvers=$(git describe --tags) -buildtime=$(go run "$(dirname "$0")/timenow.go") # $(date -u +'%FT%TZ') +buildtime=$(go run "$wd/task/timenow.go") # $(date -u +'%FT%TZ') go env -w GOOS=windows GOARCH=386 CGO_ENABLED=1 -go build -o $GOPATH/bin/hms_win_x86.exe -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=$buildvers' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=$buildtime'" $wd +go build -o "$GOPATH/bin/hms_win_x86.exe" -v -ldflags="-linkmode external -extldflags -static -X 'github.com/schwarzlichtbezirk/hms/config.BuildVers=$buildvers' -X 'github.com/schwarzlichtbezirk/hms/config.BuildTime=$buildtime'" $wd diff --git a/task/deploy-plugins.cmd b/task/deploy-plugins.cmd index 370f43f..47af2ec 100644 --- a/task/deploy-plugins.cmd +++ b/task/deploy-plugins.cmd @@ -17,10 +17,10 @@ set vers=2.11.8 curl https://cdnjs.cloudflare.com/ajax/libs/popper.js/%vers%/umd/popper.min.js --output %plugdir%/popper.min.js curl https://cdnjs.cloudflare.com/ajax/libs/popper.js/%vers%/umd/popper.min.js.map --output %plugdir%/popper.min.js.map -rem Vue 3.3.8 +rem Vue 3.4.19 rem https://cdnjs.com/libraries/vue rem https://unpkg.com/vue@next -set vers=3.3.8 +set vers=3.4.19 curl https://unpkg.com/vue@%vers%/dist/vue.global.js --output %plugdir%/vue.global.js curl https://unpkg.com/vue@%vers%/dist/vue.global.prod.js --output %plugdir%/vue.global.prod.js @@ -44,9 +44,9 @@ curl https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/%vers%/leaflet curl https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/%vers%/MarkerCluster.css --output %plugdir%/MarkerCluster.css curl https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/%vers%/MarkerCluster.Default.css --output %plugdir%/MarkerCluster.Default.css -rem sha256 0.9.0 +rem sha256 0.11.0 rem https://cdnjs.com/libraries/js-sha256 -set vers=0.9.0 +set vers=0.11.0 curl https://cdnjs.cloudflare.com/ajax/libs/js-sha256/%vers%/sha256.min.js --output %plugdir%/sha256.min.js rem normalize 8.0.1 diff --git a/task/deploy-plugins.sh b/task/deploy-plugins.sh index 313a431..d39c8c3 100755 --- a/task/deploy-plugins.sh +++ b/task/deploy-plugins.sh @@ -18,10 +18,10 @@ vers="2.11.8" curl https://cdnjs.cloudflare.com/ajax/libs/popper.js/$vers/umd/popper.min.js --output $plugdir/popper.min.js curl https://cdnjs.cloudflare.com/ajax/libs/popper.js/$vers/umd/popper.min.js.map --output $plugdir/popper.min.js.map -# Vue 3.3.8 +# Vue 3.4.19 # https://cdnjs.com/libraries/vue # https://unpkg.com/vue@next -vers="3.3.8" +vers="3.4.19" curl https://unpkg.com/vue@$vers/dist/vue.global.js --output $plugdir/vue.global.js curl https://unpkg.com/vue@$vers/dist/vue.global.prod.js --output $plugdir/vue.global.prod.js @@ -45,9 +45,9 @@ curl https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/$vers/leaflet. curl https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/$vers/MarkerCluster.css --output $plugdir/MarkerCluster.css curl https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/$vers/MarkerCluster.Default.css --output $plugdir/MarkerCluster.Default.css -# sha256 0.9.0 +# sha256 0.11.0 # https://cdnjs.com/libraries/js-sha256 -vers="0.9.0" +vers="0.11.0" curl https://cdnjs.cloudflare.com/ajax/libs/js-sha256/$vers/sha256.min.js --output $plugdir/sha256.min.js # normalize 8.0.1