diff --git a/.github/workflows/1_dev.yml b/.github/workflows/1_dev.yml index bd650878..7b00d255 100644 --- a/.github/workflows/1_dev.yml +++ b/.github/workflows/1_dev.yml @@ -14,10 +14,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - uses: actions/setup-node@v1 with: - node-version: 12.18.2 + node-version: 16.14.0 - name: Set Version run: | @@ -63,7 +63,7 @@ jobs: arch: [386, amd64, arm-7, arm-6, arm64] include: - platform: darwin - arch: 386 + arch: arm64 - platform: darwin arch: amd64 - platform: windows @@ -92,7 +92,7 @@ jobs: echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - - name: Set Darwin Build Flags + - name: Set MacOS (Darwin) Build Flags if: matrix.platform == 'darwin' run : | echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV @@ -112,7 +112,7 @@ jobs: COMMIT: ${{ github.sha }} with: xgo_version: latest - go_version: 1.15.x + go_version: 1.17.x dest: build prefix: statping targets: ${{ matrix.platform }}/${{ matrix.arch }} @@ -137,43 +137,22 @@ jobs: if: matrix.platform == 'windows' run: | cd build - mv statping-windows-4.0-${{ matrix.arch }}.exe statping.exe + mv statping-windows-${{ matrix.arch }}.exe statping.exe chmod +x statping.exe zip statping-windows-${{ matrix.arch }}.zip statping.exe rm -rf statping.exe echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - - name: Compress Darwin 32bit Builds - if: matrix.platform == 'darwin' && matrix.arch == '386' + - name: Compress MacOS (Darwin) Builds + if: matrix.platform == 'darwin' run: | cd build - ls >> $GITHUB_ENV -# mv statping-darwin-10.6-${{ matrix.arch }} statping -# chmod +x statping -# tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz * -# rm -rf statping -# echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Compress Darwin 64bit Builds - if: matrix.platform == 'darwin' && matrix.arch == 'amd64' - run: | - cd build - mv statping-darwin-10.12-${{ matrix.arch }} statping + mv statping-darwin-${{ matrix.arch }} statping chmod +x statping - tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping + tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz * rm -rf statping echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV -# - name: Compress Darwin arm64 Builds -# if: matrix.platform == 'darwin' && matrix.arch == 'arm64' -# run: | -# cd build -# mv statping-darwin-10.15-${{ matrix.arch }} statping -# chmod +x statping -# tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping -# rm -rf statping -# echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - name: Upload Compiled Statping Binary uses: actions/upload-artifact@v1 with: @@ -207,10 +186,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - uses: actions/setup-node@v1 with: - node-version: 12.18.2 + node-version: 16.14.0 - name: Install Global Dependencies run: npm install -g yarn sass newman cross-env wait-on @sentry/cli @@ -218,7 +197,7 @@ jobs: - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -262,7 +241,7 @@ jobs: MOBILE_NUMBER: ${{ secrets.MOBILE_NUMBER }} PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }} PUSHOVER_API: ${{ secrets.PUSHOVER_API }} - SLACK_URL: ${{ secrets.SLACK_URL }} + SLACK_URL: https://hooks.slack.com/services/TTJ1B90DP/RENU20O9M/9uI823SUnYBuGcxYlpSimD6H TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} TELEGRAM_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL }} TWILIO_SID: ${{ secrets.TWILIO_SID }} @@ -277,12 +256,12 @@ jobs: SNS_REGION: ${{ secrets.SNS_REGION }} SNS_TOPIC: ${{ secrets.SNS_TOPIC }} - - name: Coveralls Testing Coverage - run: | - go get github.com/mattn/goveralls - goveralls -coverprofile=coverage.out -repotoken $COVERALLS - env: - COVERALLS: ${{ secrets.COVERALLS }} +# - name: Coveralls Testing Coverage +# run: | +# go get github.com/mattn/goveralls +# goveralls -coverprofile=coverage.out -repotoken $COVERALLS +# env: +# COVERALLS: ${{ secrets.COVERALLS }} test-postman-sqlite: needs: frontend @@ -291,12 +270,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -345,12 +324,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -402,12 +381,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash diff --git a/.github/workflows/2_unstable.yml b/.github/workflows/2_unstable.yml index a4150490..7fd72300 100644 --- a/.github/workflows/2_unstable.yml +++ b/.github/workflows/2_unstable.yml @@ -14,10 +14,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - uses: actions/setup-node@v1 with: - node-version: 12.18.2 + node-version: 16.14.0 - name: Set Version run: | @@ -55,13 +55,15 @@ jobs: path: ./source build: - needs: [frontend, test-postman-sqlite, test-postman-mysql, test-postman-postgres] + needs: frontend runs-on: ubuntu-latest strategy: matrix: platform: [linux] arch: [386, amd64, arm-7, arm-6, arm64] include: + - platform: darwin + arch: arm64 - platform: darwin arch: amd64 - platform: windows @@ -90,9 +92,10 @@ jobs: echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - - name: Set Darwin Build Flags + - name: Set MacOS (Darwin) Build Flags if: matrix.platform == 'darwin' - run: echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV + run : | + echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - name: Set Windows Build Flags @@ -109,12 +112,12 @@ jobs: COMMIT: ${{ github.sha }} with: xgo_version: latest - go_version: 1.15.x + go_version: 1.17.x dest: build prefix: statping targets: ${{ matrix.platform }}/${{ matrix.arch }} - v: false - x: false + v: true + x: true pkg: cmd buildmode: pie tags: ${{ env.XGO_TAGS }} @@ -134,22 +137,22 @@ jobs: if: matrix.platform == 'windows' run: | cd build - mv statping-windows-4.0-${{ matrix.arch }}.exe statping.exe + mv statping-windows-${{ matrix.arch }}.exe statping.exe chmod +x statping.exe zip statping-windows-${{ matrix.arch }}.zip statping.exe rm -rf statping.exe echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - - name: Compress Darwin Builds + - name: Compress MacOS (Darwin) Builds if: matrix.platform == 'darwin' run: | cd build - mv statping-darwin-10.12-${{ matrix.arch }} statping + mv statping-darwin-${{ matrix.arch }} statping chmod +x statping - tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping + tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz * rm -rf statping echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - + - name: Upload Compiled Statping Binary uses: actions/upload-artifact@v1 with: @@ -168,7 +171,6 @@ jobs: prerelease: true files: build/${{ env.compressed }} - # test: # needs: frontend # runs-on: [self-hosted, linux, aboutcher-hosted] @@ -196,10 +198,10 @@ jobs: # - uses: actions/checkout@v2 # - uses: actions/setup-go@v2 # with: -# go-version: 1.15.x +# go-version: 1.17.x # - uses: actions/setup-node@v1 # with: -# node-version: 12.18.2 +# node-version: 16.14.0 # - name: Install Global Dependencies # run: npm install -g yarn sass newman cross-env wait-on @sentry/cli @@ -207,7 +209,7 @@ jobs: # - name: Setting ENV's # run: | # echo "$(go env GOPATH)/bin" >> $GITHUB_PATH -# echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH +# echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH # echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV # shell: bash @@ -280,12 +282,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -334,12 +336,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -391,12 +393,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash diff --git a/.github/workflows/3_stable.yml b/.github/workflows/3_stable.yml index 84b57059..c92e0963 100644 --- a/.github/workflows/3_stable.yml +++ b/.github/workflows/3_stable.yml @@ -14,10 +14,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - uses: actions/setup-node@v1 with: - node-version: 12.18.2 + node-version: 16.14.0 - name: Set Version run: | @@ -75,6 +75,8 @@ jobs: platform: [linux] arch: [386, amd64, arm-7, arm-6, arm64] include: + - platform: darwin + arch: arm64 - platform: darwin arch: amd64 - platform: windows @@ -110,7 +112,7 @@ jobs: echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - - name: Set Darwin Build Flags + - name: Set MacOS (Darwin) Build Flags if: matrix.platform == 'darwin' run: echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash @@ -129,7 +131,7 @@ jobs: COMMIT: ${{ github.sha }} with: xgo_version: latest - go_version: 1.15.x + go_version: 1.17.x dest: build prefix: statping targets: ${{ matrix.platform }}/${{ matrix.arch }} @@ -154,17 +156,17 @@ jobs: if: matrix.platform == 'windows' run: | cd build - mv statping-windows-4.0-${{ matrix.arch }}.exe statping.exe + mv statping-windows-${{ matrix.arch }}.exe statping.exe chmod +x statping.exe zip statping-windows-${{ matrix.arch }}.zip statping.exe rm -rf statping.exe echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - - name: Compress Darwin Builds + - name: Compress MacOS (Darwin) Builds if: matrix.platform == 'darwin' run: | cd build - mv statping-darwin-10.12-${{ matrix.arch }} statping + mv statping-darwin-${{ matrix.arch }} statping chmod +x statping tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping rm -rf statping @@ -219,10 +221,10 @@ jobs: # - uses: actions/checkout@v2 # - uses: actions/setup-go@v2 # with: -# go-version: 1.15.x +# go-version: 1.17.x # - uses: actions/setup-node@v1 # with: -# node-version: 12.18.2 +# node-version: 16.14.0 # # - name: Install Global Dependencies # run: npm install -g yarn sass newman cross-env wait-on @sentry/cli @@ -230,7 +232,7 @@ jobs: # - name: Setting ENV's # run: | # echo "$(go env GOPATH)/bin" >> $GITHUB_PATH -# echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH +# echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH # echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV # shell: bash # @@ -303,12 +305,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -357,12 +359,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -414,12 +416,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: 1.17.x - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 02777270..30cd68c1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,10 +20,10 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: '1.14.2' + go-version: '1.17.8' - uses: actions/setup-node@v1 with: - node-version: '12.18.2' + node-version: '16.14.0' - uses: actions/checkout@v2 - name: Add GOBIN to PATH @@ -86,7 +86,7 @@ jobs: go-version: 1.15.x - uses: actions/setup-node@v1 with: - node-version: 12.18.2 + node-version: 16.14.0 - uses: actions/checkout@v2 - name: Install Global Dependencies @@ -97,7 +97,7 @@ jobs: - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash @@ -140,7 +140,7 @@ jobs: - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash diff --git a/CHANGELOG.md b/CHANGELOG.md index b80f70fe..08a08ecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 0.90.80 (01-26-2022) +- Fixed permissions on /app directory - Thanks twouters + +# 0.90.79 (01-24-2022) +- Updated Russian Language - Thanks meatlayer +- Docker file fix for BASE_PATH and health checks - Thanks michaelkrieger +- Removed statping emailer notifier (not SMTP Mail) +- Fixes for notification failures (Issue statping#911) - Thanks glanchow +- Updated Home page uptime wording (24hr/7days) - Thanks Jonathanrbarney & thatInfrastructureGuy +- [GITHUB] Removed mailer tests + # 0.90.78 (09-15-2021) - HTTP Webhooks accept multiple HTTP Headers - Modified Telegram notifier to allow chat_ids diff --git a/Dockerfile b/Dockerfile index ca503f78..6997cc18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12.18.2-alpine AS frontend +FROM node:16.14.0-alpine AS frontend LABEL maintainer="Statping-ng (https://github.com/statping-ng)" ARG BUILDPLATFORM WORKDIR /statping @@ -10,7 +10,7 @@ RUN yarn build && yarn cache clean # Statping Golang BACKEND building from source # Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying -FROM golang:1.14-alpine AS backend +FROM golang:1.17-alpine AS backend LABEL maintainer="Statping-NG (https://github.com/statping-ng)" ARG VERSION ARG COMMIT @@ -60,9 +60,10 @@ ENV IS_DOCKER=true ENV SASS=/usr/local/bin/sassc ENV STATPING_DIR=/app ENV PORT=8080 +ENV BASE_PATH="" EXPOSE $PORT -HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true" +HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD if [ -z "$BASE_PATH" ]; then HEALTHPATH="/health"; else HEALTHPATH="/$BASE_PATH/health" ; fi && curl -s "http://localhost:80$HEALTHPATH" | jq -r -e ".online==true" CMD statping --port $PORT diff --git a/Makefile b/Makefile index dc155dcc..ef78a2c5 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,13 @@ COMMIT=$(shell git rev-parse HEAD) SIGN_KEY=B76D61FAA6DB759466E83D9964B9C6AAE2D55278 BINARY_NAME=statping GOBUILD=go build -a -GOVERSION=1.14.0 -NODE_VERSION=12.18.2 +GOVERSION=1.17.8 +NODE_VERSION=16.14.0 XGO=xgo -go $(GOVERSION) --dest=build BUILDVERSION=-ldflags "-X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" TRVIS_SECRET=O3/2KTOV8krv+yZ1EB/7D1RQRe6NdpFUEJNJkMS/ollYqmz3x2mCO7yIgIJKCKguLXZxjM6CxJcjlCrvUwibL+8BBp7xJe4XFIOrjkPvbbVPry4HkFZCf2GfcUK6o4AByQ+RYqsW2F17Fp9KLQ1rL3OT3eLTwCAGKx3tlY8y+an43zkmo5dN64V6sawx26fh6XTfww590ey+ltgQTjf8UPNup2wZmGvMo9Hwvh/bYR/47bR6PlBh6vhlKWyotKf2Fz1Bevbu0zc35pee5YlsrHR+oSF+/nNd/dOij34BhtqQikUR+zQVy9yty8SlmneVwD3yOENvlF+8roeKIXb6P6eZnSMHvelhWpAFTwDXq2N3d/FIgrQtLxsAFTI3nTHvZgs6OoTd6dA0wkhuIGLxaL3FOeztCdxP5J/CQ9GUcTvifh5ArGGwYxRxQU6rTgtebJcNtXFISP9CEUR6rwRtb6ax7h6f1SbjUGAdxt+r2LbEVEk4ZlwHvdJ2DtzJHT5DQtLrqq/CTUgJ8SJFMkrJMp/pPznKhzN4qvd8oQJXygSXX/gz92MvoX0xgpNeLsUdAn+PL9KketfR+QYosBz04d8k05E+aTqGaU7FUCHPTLwlOFvLD8Gbv0zsC/PWgSLXTBlcqLEz5PHwPVHTcVzspKj/IyYimXpCSbvu1YOIjyc= PUBLISH_BODY='{ "request": { "branch": "master", "message": "Homebrew update version v${VERSION}", "config": { "env": { "VERSION": "${VERSION}", "COMMIT": "$(TRAVIS_COMMIT)" } } } }' -TRAVIS_BUILD_CMD='{ "request": { "branch": "master", "message": "Compile master for Statping v${VERSION}", "config": { "merge_mode": "replace", "language": "go", "go": 1.14, "install": true, "sudo": "required", "services": ["docker"], "env": { "secure": "${TRVIS_SECRET}" }, "before_deploy": ["git config --local user.name \"hunterlong\"", "git config --local user.email \"info@socialeck.com\"", "git tag v$(VERSION) --force"], "deploy": [{ "provider": "releases", "api_key": "$$GITHUB_TOKEN", "file_glob": true, "file": "build/*", "skip_cleanup": true, "on": { "branch": "master" } }], "before_script": ["rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install stable", "nvm install 10.17.0", "nvm use 10.17.0 --default", "npm install -g sass yarn cross-env", "pip install --user awscli"], "script": ["make release"], "after_success": [], "after_deploy": ["make post-release"] } } }' +TRAVIS_BUILD_CMD='{ "request": { "branch": "master", "message": "Compile master for Statping v${VERSION}", "config": { "merge_mode": "replace", "language": "go", "go": 1.17, "install": true, "sudo": "required", "services": ["docker"], "env": { "secure": "${TRVIS_SECRET}" }, "before_deploy": ["git config --local user.name \"hunterlong\"", "git config --local user.email \"info@socialeck.com\"", "git tag v$(VERSION) --force"], "deploy": [{ "provider": "releases", "api_key": "$$GITHUB_TOKEN", "file_glob": true, "file": "build/*", "skip_cleanup": true, "on": { "branch": "master" } }], "before_script": ["rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install stable", "nvm install 16.14.0", "nvm use 16.14.0 --default", "npm install -g sass yarn cross-env", "pip install --user awscli"], "script": ["make release"], "after_success": [], "after_deploy": ["make post-release"] } } }' TEST_DIR=$(GOPATH)/src/github.com/statping-ng/statping-ng PATH:=$(GOPATH)/bin:$(PATH) OS = freebsd linux openbsd @@ -37,16 +37,16 @@ lint: goimports ./... up: - docker-compose -f docker-compose.yml -f dev/docker-compose.full.yml up -d --remove-orphans + docker compose -f docker-compose.yml -f dev/docker-compose.full.yml up -d --remove-orphans make print_details down: - docker-compose -f docker-compose.yml -f dev/docker-compose.full.yml down --volumes --remove-orphans + docker compose -f docker-compose.yml -f dev/docker-compose.full.yml down --volumes --remove-orphans lite: clean docker build -t statping-ng/statping-ng:dev -f dev/Dockerfile.dev . - docker-compose -f dev/docker-compose.lite.yml down - docker-compose -f dev/docker-compose.lite.yml up --remove-orphans + docker compose -f dev/docker-compose.lite.yml down + docker compose -f dev/docker-compose.lite.yml up --remove-orphans reup: down clean compose-build-full up @@ -94,37 +94,37 @@ go-run: go run ./cmd start: - docker-compose -f docker-compose.yml -f dev/docker-compose.full.yml start + docker compose -f docker-compose.yml -f dev/docker-compose.full.yml start stop: - docker-compose -f docker-compose.yml -f dev/docker-compose.full.yml stop + docker compose -f docker-compose.yml -f dev/docker-compose.full.yml stop logs: docker logs statping --follow db-up: - docker-compose -f dev/docker-compose.db.yml up -d --remove-orphans + docker compose -f dev/docker-compose.db.yml up -d --remove-orphans db-down: - docker-compose -f dev/docker-compose.db.yml down --volumes --remove-orphans + docker compose -f dev/docker-compose.db.yml down --volumes --remove-orphans console: docker exec -t -i statping /bin/sh -compose-build-full: - docker-compose -f docker-compose.yml -f dev/docker-compose.full.yml build --parallel --build-arg VERSION=${VERSION} +compose-build-full: + docker compose -f docker-compose.yml -f dev/docker-compose.full.yml build --parallel --build-arg VERSION=${VERSION} -docker-latest: +docker-latest: docker build -t statping-ng/statping-ng:latest --build-arg VERSION=${VERSION} . docker-test: - docker-compose -f docker-compose.test.yml up --remove-orphans + docker compose -f docker-compose.test.yml up --remove-orphans modd: modd -f ./dev/modd.conf top: - docker-compose -f docker-compose.yml -f dev/docker-compose.full.yml top + docker compose -f docker-compose.yml -f dev/docker-compose.full.yml top frontend-build: @echo "Removing old frontend distributions..." @@ -382,7 +382,7 @@ delve: check: @echo "Checking the programs required for the build are installed..." - @echo "go: $(shell go version) - $(shell which go)" && go version >/dev/null 2>&1 || (echo "ERROR: go 1.14 is required."; exit 1) + @echo "go: $(shell go version) - $(shell which go)" && go version >/dev/null 2>&1 || (echo "ERROR: go 1.17 is required."; exit 1) @echo "node: $(shell node --version) - $(shell which node)" && node --version >/dev/null 2>&1 || (echo "ERROR: node 12.x is required."; exit 1) @echo "yarn: $(shell yarn --version) - $(shell which yarn)" && yarn --version >/dev/null 2>&1 || (echo "ERROR: yarn is required."; exit 1) @echo "All required programs are installed!" diff --git a/dev/docker-compose.full.m1.yml b/dev/docker-compose.full.m1.yml new file mode 100644 index 00000000..8f38b386 --- /dev/null +++ b/dev/docker-compose.full.m1.yml @@ -0,0 +1,275 @@ +version: '2.3' + + +############################################### +# Statping Full Stack +# +# Statping SQLIte => http://localhost:8080 +# Statping MySQL => http://localhost:8081 +# Statping Postgres => http://localhost:8082 +# Statping MariaDB => http://localhost:8083 +# +# Adminer => http://localhost:8282 +# Prometheus => http://localhost:7050 +# Grafana => http://localhost:3000 +# +# MySQL => http://localhost:3306 +# Postgres => http://localhost:5432 +# MariaDB => http://localhost:3307 +# +############################################### + +services: + + statping_sqlite: + container_name: statping_sqlite + platform: linux/amd64 + build: + context: ./ + restart: on-failure + volumes: + - ./dev/docker/statping/sqlite:/app + - ./dev/services.yml:/app/services.yml + environment: + DB_CONN: sqlite + API_SECRET: exampleapisecret + NAME: Statping + DOMAIN: http://localhost:8084 + DESCRIPTION: This is a dev environment on SQLite! + ADMIN_USER: admin + ADMIN_PASSWORD: admin + SAMPLE_DATA: 'false' + ports: + - 8084:8080 + networks: + - database + - frontend + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8080/health || false"] + timeout: 2s + interval: 10s + retries: 20 + + statping_mysql: + container_name: statping_mysql + platform: linux/amd64 + build: + context: ./ + restart: on-failure + volumes: + - ./dev/docker/statping/mysql:/app + - ./dev/services.yml:/app/services.yml + environment: + DB_CONN: mysql + DB_HOST: mysql + DB_USER: root + DB_PASS: password123 + DB_DATABASE: statping + DB_PORT: 3306 + API_SECRET: exampleapisecret + NAME: Statping MySQL + DOMAIN: http://localhost:8081 + DESCRIPTION: This is a dev environment on MySQL! + ADMIN_USER: admin + ADMIN_PASSWORD: admin + SAMPLE_DATA: 'false' + ports: + - 8081:8080 + networks: + - database + - frontend + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8080/health || false"] + timeout: 2s + interval: 10s + retries: 20 + depends_on: + mysql: + condition: service_healthy + + statping_postgres: + container_name: statping_postgres + platform: linux/amd64 + build: + context: ./ + restart: on-failure + volumes: + - ./dev/docker/statping/mysql:/app + - ./dev/services.yml:/app/services.yml + environment: + DB_CONN: postgres + DB_HOST: postgres + DB_USER: root + DB_PASS: password123 + DB_DATABASE: statping + DB_PORT: 5432 + API_SECRET: exampleapisecret + NAME: Statping Postgres + DOMAIN: http://localhost:8082 + DESCRIPTION: This is a dev environment on Postgres! + ADMIN_USER: admin + ADMIN_PASSWORD: admin + SAMPLE_DATA: 'false' + ports: + - 8082:8080 + networks: + - database + - frontend + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8080/health || false"] + timeout: 2s + interval: 10s + retries: 20 + depends_on: + postgres: + condition: service_healthy + + statping_mariadb: + container_name: statping_mariadb + platform: linux/amd64 + build: + context: ./ + restart: on-failure + volumes: + - ./dev/docker/statping/mariadb:/app + - ./dev/services.yml:/app/services.yml + environment: + DB_CONN: mysql + DB_HOST: mariadb + DB_USER: root + DB_PASS: password123 + DB_DATABASE: statping + DB_PORT: 3306 + API_SECRET: exampleapisecret + NAME: Statping MariaDB + DOMAIN: http://localhost:8083 + DESCRIPTION: This is a dev environment on MariaDB! + ADMIN_USER: admin + ADMIN_PASSWORD: admin + SAMPLE_DATA: 'false' + ports: + - 8083:8080 + networks: + - database + - frontend + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8080/health || false"] + timeout: 2s + interval: 10s + retries: 20 + depends_on: + mariadb: + condition: service_healthy + + postgres: + container_name: postgres + image: postgres + volumes: + - ./dev/docker/databases/postgres:/var/lib/postgresql/data + ports: + - 5432:5432 + environment: + POSTGRES_PASSWORD: password123 + POSTGRES_DB: statping + POSTGRES_USER: root + networks: + - database + healthcheck: + test: ["CMD-SHELL", "pg_isready -U root"] + interval: 15s + timeout: 10s + retries: 20 + + mysql: + container_name: mysql + image: mysql:5.7 + volumes: + - ./dev/docker/databases/mysql:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: password123 + MYSQL_DATABASE: statping + ports: + - 3306:3306 + networks: + - database + healthcheck: + test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] + timeout: 20s + interval: 15s + retries: 30 + + mariadb: + container_name: mariadb + image: mariadb + volumes: + - ./dev/docker/databases/mariadb:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: password123 + MYSQL_DATABASE: statping + ports: + - 3307:3306 + networks: + - database + healthcheck: + test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] + timeout: 20s + interval: 15s + retries: 30 + + adminer: + container_name: adminer + image: adminer + restart: always + networks: + - database + - frontend + ports: + - 8282:8080 + + prometheus: + container_name: prometheus + platform: linux/amd64 + image: prom/prometheus:v2.0.0 + restart: on-failure + volumes: + - ./dev/prometheus.yml:/etc/prometheus/prometheus.yml + - ./dev/docker/databases/prometheus:/prometheus + ports: + - 7050:9090 + networks: + - database + healthcheck: + test: "/bin/wget -q -Y off http://localhost:9090/status -O /dev/null > /dev/null 2>&1" + interval: 10s + timeout: 3s + + grafana: + container_name: grafana + image: grafana/grafana + restart: on-failure + ports: + - 3000:3000 + volumes: + - ./dev/docker/grafana:/var/lib/grafana + - ./dev/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml + - ./dev/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml + - ./dev/grafana/statping_dashboard.json:/etc/grafana/provisioning/dashboards/statping_dashboard.json + environment: + - GF_USERS_ALLOW_SIGN_UP=false + - GF_AUTH_ANONYMOUS_ENABLED=true + depends_on: + prometheus: + condition: service_healthy + networks: + - frontend + - database + healthcheck: + test: "/usr/bin/wget -q -Y off http://localhost:3000/api/health -O /dev/null > /dev/null 2>&1" + interval: 10s + retries: 20 + +networks: + frontend: + database: diff --git a/dev/docker-compose.full.yml b/dev/docker-compose.full.yml index 740c75b8..fde6b0bb 100644 --- a/dev/docker-compose.full.yml +++ b/dev/docker-compose.full.yml @@ -24,11 +24,11 @@ services: statping_sqlite: container_name: statping_sqlite build: - context: ../ + context: ./ restart: on-failure volumes: - - ./docker/statping/sqlite:/app - - ./services.yml:/app/services.yml + - ./dev/docker/statping/sqlite:/app + - ./dev/services.yml:/app/services.yml environment: DB_CONN: sqlite API_SECRET: exampleapisecret @@ -39,7 +39,7 @@ services: ADMIN_PASSWORD: admin SAMPLE_DATA: 'false' ports: - - 8080:8080 + - 8084:8080 networks: - database - frontend @@ -52,11 +52,11 @@ services: statping_mysql: container_name: statping_mysql build: - context: ../ + context: ./ restart: on-failure volumes: - - ./docker/statping/mysql:/app - - ./services.yml:/app/services.yml + - ./dev/docker/statping/mysql:/app + - ./dev/services.yml:/app/services.yml environment: DB_CONN: mysql DB_HOST: mysql @@ -88,11 +88,11 @@ services: statping_postgres: container_name: statping_postgres build: - context: ../ + context: ./ restart: on-failure volumes: - - ./docker/statping/mysql:/app - - ./services.yml:/app/services.yml + - ./dev/docker/statping/mysql:/app + - ./dev/services.yml:/app/services.yml environment: DB_CONN: postgres DB_HOST: postgres @@ -124,11 +124,11 @@ services: statping_mariadb: container_name: statping_mariadb build: - context: ../ + context: ./ restart: on-failure volumes: - - ./docker/statping/mariadb:/app - - ./services.yml:/app/services.yml + - ./dev/docker/statping/mariadb:/app + - ./dev/services.yml:/app/services.yml environment: DB_CONN: mysql DB_HOST: mariadb @@ -161,7 +161,7 @@ services: container_name: postgres image: postgres volumes: - - ./docker/databases/postgres:/var/lib/postgresql/data + - ./dev/docker/databases/postgres:/var/lib/postgresql/data ports: - 5432:5432 environment: @@ -180,7 +180,7 @@ services: container_name: mysql image: mysql:5.7 volumes: - - ./docker/databases/mysql:/var/lib/mysql + - ./dev/docker/databases/mysql:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: password123 @@ -201,7 +201,7 @@ services: container_name: mariadb image: mariadb volumes: - - ./docker/databases/mariadb:/var/lib/mysql + - ./dev/docker/databases/mariadb:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: password123 @@ -233,8 +233,8 @@ services: image: prom/prometheus:v2.0.0 restart: on-failure volumes: - - ./prometheus.yml:/etc/prometheus/prometheus.yml - - ./docker/databases/prometheus:/prometheus + - ./dev/prometheus.yml:/etc/prometheus/prometheus.yml + - ./dev/docker/databases/prometheus:/prometheus ports: - 7050:9090 networks: @@ -251,10 +251,10 @@ services: ports: - 3000:3000 volumes: - - ./docker/grafana:/var/lib/grafana - - ./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml - - ./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml - - ./grafana/statping_dashboard.json:/etc/grafana/provisioning/dashboards/statping_dashboard.json + - ./dev/docker/grafana:/var/lib/grafana + - ./dev/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml + - ./dev/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml + - ./dev/grafana/statping_dashboard.json:/etc/grafana/provisioning/dashboards/statping_dashboard.json environment: - GF_USERS_ALLOW_SIGN_UP=false - GF_AUTH_ANONYMOUS_ENABLED=true diff --git a/dev/postman.json b/dev/postman.json index 7e11d3fb..cd061232 100644 --- a/dev/postman.json +++ b/dev/postman.json @@ -4205,7 +4205,7 @@ "", "pm.test(\"View All Notifiers\", function () {", " var jsonData = pm.response.json();", - " pm.expect(jsonData.length).to.eql(14);", + " pm.expect(jsonData.length).to.eql(13);", "});" ], "type": "text/javascript" diff --git a/frontend/src/API.js b/frontend/src/API.js index 3e62d295..d6e8bad5 100644 --- a/frontend/src/API.js +++ b/frontend/src/API.js @@ -7,8 +7,8 @@ const tokenKey = "statping_auth"; class Api { constructor() { - this.version = "0.90.74"; - this.commit = "df8e1f73d9f7fdf218bc5c26130d7d8a6af6719a"; + this.version = "0.91.0"; + this.commit = "b7ecf0c31b0c75c394061d2f6457a925e4440f1e"; } async oauth() { @@ -275,7 +275,7 @@ class Api { } async github_release() { - return fetch('https://api.github.com/repos/statping/statping/releases/latest').then(response => response.json()) + return fetch('https://api.github.com/repos/statping-ng/statping-ng/releases/latest').then(response => response.json()) } async allActions(...all) { diff --git a/frontend/src/components/Service/ServiceTopStats.vue b/frontend/src/components/Service/ServiceTopStats.vue index 9104b549..0a9a48ef 100644 --- a/frontend/src/components/Service/ServiceTopStats.vue +++ b/frontend/src/components/Service/ServiceTopStats.vue @@ -6,11 +6,11 @@