diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 2f8f56d2..2553984c 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -21,8 +21,8 @@ jobs: - name: Set Version run: | - echo "::add-path::$(go env GOPATH)/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Install Global Dependencies @@ -98,26 +98,26 @@ jobs: - name: Add GOBIN to PATH run: | - echo ::set-env name=VERSION::$(cat version.txt) + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Set Linux Build Flags if: matrix.platform == 'linux' run: | - echo ::set-env name=BUILD_FLAGS::'-extldflags -static' - echo ::set-env name=XGO_TAGS::'netgo,osusergo,linux,sqlite_omit_load_extension' + echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV + echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - name: Set Darwin Build Flags if: matrix.platform == 'darwin' - run: echo ::set-env name=XGO_TAGS::'netgo,osusergo,darwin,sqlite_omit_load_extension' + run: echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - name: Set Windows Build Flags if: matrix.platform == 'windows' run: | - echo ::set-env name=BUILD_FLAGS::'-extldflags -static' - echo ::set-env name=XGO_TAGS::'netgo,osusergo,sqlite_omit_load_extension' + echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV + echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - name: Build ${{ matrix.platform }}/${{ matrix.arch }} @@ -146,7 +146,7 @@ jobs: chmod +x statping tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping rm -rf statping - echo ::set-env name=compressed::statping-linux-${{ matrix.arch }}.tar.gz + echo "compressed=statping-linux-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - name: Compress Windows Builds if: matrix.platform == 'windows' @@ -156,7 +156,7 @@ jobs: chmod +x statping.exe zip statping-windows-${{ matrix.arch }}.zip statping.exe rm -rf statping.exe - echo ::set-env name=compressed::statping-windows-${{ matrix.arch }}.zip + echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - name: Compress Darwin Builds if: matrix.platform == 'darwin' @@ -166,7 +166,7 @@ jobs: chmod +x statping tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping rm -rf statping - echo ::set-env name=compressed::statping-darwin-${{ matrix.arch }}.tar.gz + echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - name: Upload Compiled Statping Binary uses: actions/upload-artifact@v1 @@ -227,9 +227,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -305,9 +305,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -359,9 +359,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -416,9 +416,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -456,11 +456,17 @@ jobs: uses: actions/checkout@v2 - name: Setting ENV's - run: echo ::set-env name=VERSION::$(cat version.txt) + run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx - uses: crazy-max/ghaction-docker-buildx@v3 + uses: docker/setup-buildx-action@v1 + id: buildx + with: + install: true - name: Docker Login env: @@ -498,7 +504,7 @@ jobs: # organization: statping # # - name: Setting ENV's -# run: echo ::set-env name=VERSION::$(cat version.txt) +# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV # shell: bash # # - name: Sentry Release diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index b16c68a2..c7ca3ce4 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -21,8 +21,8 @@ jobs: - name: Set Version run: | - echo "::add-path::$(go env GOPATH)/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Install Global Dependencies @@ -98,26 +98,26 @@ jobs: - name: Add GOBIN to PATH run: | - echo ::set-env name=VERSION::$(cat version.txt) + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Set Linux Build Flags if: matrix.platform == 'linux' run: | - echo ::set-env name=BUILD_FLAGS::'-extldflags -static' - echo ::set-env name=XGO_TAGS::'netgo,osusergo,linux,sqlite_omit_load_extension' + echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV + echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - name: Set Darwin Build Flags if: matrix.platform == 'darwin' - run: echo ::set-env name=XGO_TAGS::'netgo,osusergo,darwin,sqlite_omit_load_extension' + run: echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - name: Set Windows Build Flags if: matrix.platform == 'windows' run: | - echo ::set-env name=BUILD_FLAGS::'-extldflags -static' - echo ::set-env name=XGO_TAGS::'netgo,osusergo,sqlite_omit_load_extension' + echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV + echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash - name: Build ${{ matrix.platform }}/${{ matrix.arch }} @@ -146,7 +146,7 @@ jobs: chmod +x statping tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping rm -rf statping - echo ::set-env name=compressed::statping-linux-${{ matrix.arch }}.tar.gz + echo "compressed=statping-linux-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - name: Compress Windows Builds if: matrix.platform == 'windows' @@ -156,7 +156,7 @@ jobs: chmod +x statping.exe zip statping-windows-${{ matrix.arch }}.zip statping.exe rm -rf statping.exe - echo ::set-env name=compressed::statping-windows-${{ matrix.arch }}.zip + echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - name: Compress Darwin Builds if: matrix.platform == 'darwin' @@ -166,7 +166,7 @@ jobs: chmod +x statping tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping rm -rf statping - echo ::set-env name=compressed::statping-darwin-${{ matrix.arch }}.tar.gz + echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - name: Upload Compiled Statping Binary uses: actions/upload-artifact@v1 @@ -227,9 +227,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -305,9 +305,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -359,9 +359,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -416,9 +416,9 @@ jobs: - name: Setting ENV's run: | - echo "::add-path::$(go env GOPATH)/bin" - echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin" - echo ::set-env name=VERSION::$(cat version.txt) + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -456,11 +456,17 @@ jobs: uses: actions/checkout@v2 - name: Setting ENV's - run: echo ::set-env name=VERSION::$(cat version.txt) + run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx - uses: crazy-max/ghaction-docker-buildx@v3 + uses: docker/setup-buildx-action@v1 + id: buildx + with: + install: true - name: Docker Login env: @@ -498,7 +504,7 @@ jobs: # organization: statping # # - name: Setting ENV's -# run: echo ::set-env name=VERSION::$(cat version.txt) +# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV # shell: bash # # - name: Sentry Release @@ -512,7 +518,7 @@ jobs: uses: actions/checkout@v2 - name: Setting ENV's - run: echo ::set-env name=VERSION::$(cat version.txt) + run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Update Homebrew Package @@ -529,7 +535,7 @@ jobs: uses: actions/checkout@v2 - name: Setting ENV's - run: echo ::set-env name=VERSION::$(cat version.txt) + run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Slack Notification diff --git a/CHANGELOG.md b/CHANGELOG.md index 7714e6d3..5f1a49d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.90.73 (12-15-2020) +- Removed complexity in code for http server +- Removed internal cache functionality (not useful, needs refactor) +- Merged PR https://github.com/statping/statping/pull/909 +- Merged PR https://github.com/statping/statping/pull/880 +- Merged PR https://github.com/statping/statping/pull/859 + # 0.90.72 (10-28-2020) - Fixed issue with graphs becoming stuck on reload diff --git a/dev/postman.json b/dev/postman.json index f21fd2b1..4aaf42be 100644 --- a/dev/postman.json +++ b/dev/postman.json @@ -343,6 +343,146 @@ } ] }, + { + "name": "View Configuration", + "event": [ + { + "listen": "test", + "script": { + "id": "557dd7ef-fa5a-4f3d-98b3-4bca5e3ce154", + "exec": [ + "pm.test(\"Response is ok\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{api_key}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/api/settings/configs", + "host": [ + "{{endpoint}}" + ], + "path": [ + "api", + "settings", + "configs" + ] + }, + "description": "This endpoint will return the config.yml configuration without database credentials." + }, + "response": [ + { + "name": "View Configuration", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{endpoint}}/api/settings/configs", + "host": [ + "{{endpoint}}" + ], + "path": [ + "api", + "settings", + "configs" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "plain", + "header": [ + { + "key": "Date", + "value": "Fri, 18 Sep 2020 03:41:34 GMT" + }, + { + "key": "Content-Length", + "value": "256" + }, + { + "key": "Content-Type", + "value": "text/plain; charset=utf-8" + }, + { + "key": "Connection", + "value": "close" + } + ], + "cookie": [], + "body": "api_secret: demoapisecret123\nlanguage: en\nallow_reports: true\nlocation: /root/go/src/github.com/statping/statping\ndisable_http: false\ndemo_mode: false\ndisable_logs: false\nuse_assets: false\nsample_data: true\nuse_cdn: false\ndisable_colors: false\n" + } + ] + }, + { + "name": "Update Configuration", + "event": [ + { + "listen": "test", + "script": { + "id": "5074172f-5689-4471-aced-50b0a0b6b2b4", + "exec": [ + "pm.test(\"Response is ok\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{api_key}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "api_secret: demoapisecret123\nlanguage: en\nallow_reports: true\nlocation: /root/go/src/github.com/statping/statping\ndisable_http: false\ndemo_mode: false\ndisable_logs: false\nuse_assets: false\nsample_data: true\nuse_cdn: false\ndisable_colors: false\n", + "options": { + "raw": {} + } + }, + "url": { + "raw": "{{endpoint}}/api/settings/configs", + "host": [ + "{{endpoint}}" + ], + "path": [ + "api", + "settings", + "configs" + ] + }, + "description": "This endpoint will update the config.yml configuration." + }, + "response": [] + }, { "name": "Logs Last Line", "event": [ @@ -567,166 +707,6 @@ } ] }, - { - "name": "Clear Cache", - "event": [ - { - "listen": "test", - "script": { - "id": "dbabc164-5030-441d-90f7-b29c7fe794df", - "exec": [ - "pm.test(\"Response is ok\", function () {", - " pm.response.to.have.status(200);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{api_key}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/api/clear_cache", - "host": [ - "{{endpoint}}" - ], - "path": [ - "api", - "clear_cache" - ] - }, - "description": "This endpoint will clear all the cache files in your Statping instance. This includes chart data and service views." - }, - "response": [ - { - "name": "Clear Cache", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/api/clear_cache", - "host": [ - "{{endpoint}}" - ], - "path": [ - "api", - "clear_cache" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Length", - "value": "21" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Date", - "value": "Sat, 02 May 2020 01:06:43 GMT" - } - ], - "cookie": [], - "body": "{\n \"status\": \"success\"\n}" - } - ] - }, - { - "name": "List Cache", - "event": [ - { - "listen": "test", - "script": { - "id": "992ce59d-3cce-43f1-9c3d-895c55a3e0a1", - "exec": [ - "pm.test(\"Response is ok\", function () {", - " pm.response.to.have.status(200);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{api_key}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/api/cache", - "host": [ - "{{endpoint}}" - ], - "path": [ - "api", - "cache" - ] - }, - "description": "This endpoint will return all cached API endpoints." - }, - "response": [ - { - "name": "List Cache", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/api/cache", - "host": [ - "{{endpoint}}" - ], - "path": [ - "api", - "cache" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Length", - "value": "1631" - }, - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "Date", - "value": "Sat, 02 May 2020 01:06:32 GMT" - } - ], - "cookie": [], - "body": "[\n {\n \"url\": \"/api/services/1/failure_data?start=1585789587&end=1588381587&group=24h&fill=true\",\n \"expiration\": \"2020-05-02T01:06:57.511702322Z\",\n \"size\": 1541\n },\n {\n \"url\": \"/api/services/1/hits_data?start=1588127787&end=1588381587&group=5m&fill=false\",\n \"expiration\": \"2020-05-02T01:06:57.808458203Z\",\n \"size\": 45223\n },\n {\n \"url\": \"/api/services/2/hits_data?start=1588127787&end=1588381587&group=5m&fill=false\",\n \"expiration\": \"2020-05-02T01:06:57.873815975Z\",\n \"size\": 45224\n },\n {\n \"url\": \"/api/services/3/hits_data?start=1588127787&end=1588381587&group=5m&fill=false\",\n \"expiration\": \"2020-05-02T01:06:57.909984136Z\",\n \"size\": 45088\n },\n {\n \"url\": \"/api/services/2/failure_data?start=1585789587&end=1588381587&group=24h&fill=true\",\n \"expiration\": \"2020-05-02T01:06:57.48592429Z\",\n \"size\": 1538\n },\n {\n \"url\": \"/api/services/4/failure_data?start=1585789587&end=1588381587&group=24h&fill=true\",\n \"expiration\": \"2020-05-02T01:06:57.493425593Z\",\n \"size\": 1538\n },\n {\n \"url\": \"/api/services/3/failure_data?start=1585789587&end=1588381587&group=24h&fill=true\",\n \"expiration\": \"2020-05-02T01:06:57.493554858Z\",\n \"size\": 1538\n },\n {\n \"url\": \"/api/services/5/failure_data?start=1585789587&end=1588381587&group=24h&fill=true\",\n \"expiration\": \"2020-05-02T01:06:57.511424891Z\",\n \"size\": 1538\n },\n {\n \"url\": \"/api/services/5/hits_data?start=1588127788&end=1588381588&group=5m&fill=false\",\n \"expiration\": \"2020-05-02T01:06:58.377413844Z\",\n \"size\": 45193\n },\n {\n \"url\": \"/api/services/4/hits_data?start=1588127788&end=1588381588&group=5m&fill=false\",\n \"expiration\": \"2020-05-02T01:06:58.380229692Z\",\n \"size\": 45198\n }\n]" - } - ] - }, { "name": "Shields.io Badge", "event": [ @@ -1801,7 +1781,10 @@ ], "body": { "mode": "raw", - "raw": "{\n \"name\": \"New Service\",\n \"domain\": \"https://statping.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 30,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 30,\n \"order_id\": 0\n}" + "raw": "{\n \"name\": \"New Service\",\n \"domain\": \"https://statping.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 30,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 30,\n \"order_id\": 0\n}", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/services", @@ -2069,7 +2052,10 @@ "header": [], "body": { "mode": "raw", - "raw": "" + "raw": "", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/services/{{service_id}}/failures", @@ -2492,7 +2478,10 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"message\": \"Website is loading very slowly, looking into this.\",\n\t\"type\": \"Investigating\"\n}" + "raw": "{\n\t\"message\": \"Website is loading very slowly, looking into this.\",\n\t\"type\": \"Investigating\"\n}", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/incidents/2/updates", @@ -2654,7 +2643,10 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"title\": \"Updated Downtime\",\n\t\"description\": \"This is an update for an incident\"\n}" + "raw": "{\n\t\"title\": \"Updated Downtime\",\n\t\"description\": \"This is an update for an incident\"\n}", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/incidents/1", @@ -3105,7 +3097,10 @@ ], "body": { "mode": "raw", - "raw": "{\n \"name\": \"New Group\",\n \"public\": true\n}" + "raw": "{\n \"name\": \"New Group\",\n \"public\": true\n}", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/groups", @@ -3261,7 +3256,10 @@ "header": [], "body": { "mode": "raw", - "raw": "" + "raw": "", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/groups/{{group_id}}", @@ -3541,7 +3539,10 @@ "value": "{{token}}", "type": "text" } - ] + ], + "options": { + "urlencoded": {} + } }, "url": { "raw": "{{endpoint}}/api/users/token", @@ -3787,7 +3788,10 @@ ], "body": { "mode": "raw", - "raw": "{\n \"username\": \"adminuser2\",\n \"email\": \"info@adminemail.com\",\n \"password\": \"passsword123\",\n \"admin\": true\n}" + "raw": "{\n \"username\": \"adminuser2\",\n \"email\": \"info@adminemail.com\",\n \"password\": \"passsword123\",\n \"admin\": true\n}", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/users", @@ -3990,7 +3994,10 @@ ], "body": { "mode": "raw", - "raw": "{\n \"username\": \"adminupdated\",\n \"email\": \"info@email.com\",\n \"password\": \"password12345\",\n \"admin\": true\n}" + "raw": "{\n \"username\": \"adminupdated\",\n \"email\": \"info@email.com\",\n \"password\": \"password12345\",\n \"admin\": true\n}", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/users/{{user_id}}", @@ -4514,7 +4521,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"method\": \"success\",\n \"notifier\": {\n \"enabled\": false,\n \"limits\": 60,\n \"method\": \"slack\",\n \"host\": \"https://webhooksurl.slack.com/***\",\n \"success_data\": \"{\\n \\\"blocks\\\": [{\\n \\\"type\\\": \\\"section\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"The service {{.Service.Name}} is back online.\\\"\\n }\\n }, {\\n \\\"type\\\": \\\"actions\\\",\\n \\\"elements\\\": [{\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"View Service\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"style\\\": \\\"primary\\\",\\n \\\"url\\\": \\\"{{.Core.Domain}}/service/{{.Service.Id}}\\\"\\n }, {\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"Go to Statping\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"url\\\": \\\"{{.Core.Domain}}\\\"\\n }]\\n }]\\n}\",\n \"failure_data\": \"{\\n \\\"blocks\\\": [{\\n \\\"type\\\": \\\"section\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\":warning: The service {{.Service.Name}} is currently offline! :warning:\\\"\\n }\\n }, {\\n \\\"type\\\": \\\"divider\\\"\\n }, {\\n \\\"type\\\": \\\"section\\\",\\n \\\"fields\\\": [{\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*Service:*\\\\n{{.Service.Name}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*URL:*\\\\n{{.Service.Domain}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*Status Code:*\\\\n{{.Service.LastStatusCode}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*When:*\\\\n{{.Failure.CreatedAt}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*Downtime:*\\\\n{{.Service.Downtime.Human}}\\\"\\n }, {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"*Error:*\\\\n{{.Failure.Issue}}\\\"\\n }]\\n }, {\\n \\\"type\\\": \\\"divider\\\"\\n }, {\\n \\\"type\\\": \\\"actions\\\",\\n \\\"elements\\\": [{\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"View Offline Service\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"style\\\": \\\"danger\\\",\\n \\\"url\\\": \\\"{{.Core.Domain}}/service/{{.Service.Id}}\\\"\\n }, {\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"Go to Statping\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"url\\\": \\\"{{.Core.Domain}}\\\"\\n }]\\n }]\\n}\"\n }\n}", + "raw": "{\n \"method\": \"success\",\n \"notifier\": {\n \"enabled\": false,\n \"limits\": 60,\n \"method\": \"slack\",\n \"host\": \"https://hooks.slack.com/services/TTJ1B49DP/XBNU09O9M/9uI2123SUnYBuGcxLopZomz9H\",\n \"success_data\": \"{\\n \\\"blocks\\\": [{\\n \\\"type\\\": \\\"section\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"The service {{.Service.Name}} is back online.\\\"\\n }\\n }, {\\n \\\"type\\\": \\\"actions\\\",\\n \\\"elements\\\": [{\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"View Service\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"style\\\": \\\"primary\\\",\\n \\\"url\\\": \\\"{{.Core.Domain}}/service/{{.Service.Id}}\\\"\\n }, {\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"Go to Statping\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"url\\\": \\\"{{.Core.Domain}}\\\"\\n }]\\n }]\\n}\",\n \"failure_data\": \"{\\n \\\"blocks\\\": [{\\n \\\"type\\\": \\\"section\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\":warning: The service {{.Service.Name}} is currently offline! :warning:\\\"\\n }\\n }, {\\n \\\"type\\\": \\\"divider\\\"\\n }, {\\n \\\"type\\\": \\\"section\\\",\\n \\\"fields\\\": [{\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*Service:*\\\\n{{.Service.Name}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*URL:*\\\\n{{.Service.Domain}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*Status Code:*\\\\n{{.Service.LastStatusCode}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*When:*\\\\n{{.Failure.CreatedAt}}\\\"\\n }, {\\n \\\"type\\\": \\\"mrkdwn\\\",\\n \\\"text\\\": \\\"*Downtime:*\\\\n{{.Service.Downtime.Human}}\\\"\\n }, {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"*Error:*\\\\n{{.Failure.Issue}}\\\"\\n }]\\n }, {\\n \\\"type\\\": \\\"divider\\\"\\n }, {\\n \\\"type\\\": \\\"actions\\\",\\n \\\"elements\\\": [{\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"View Offline Service\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"style\\\": \\\"danger\\\",\\n \\\"url\\\": \\\"{{.Core.Domain}}/service/{{.Service.Id}}\\\"\\n }, {\\n \\\"type\\\": \\\"button\\\",\\n \\\"text\\\": {\\n \\\"type\\\": \\\"plain_text\\\",\\n \\\"text\\\": \\\"Go to Statping\\\",\\n \\\"emoji\\\": true\\n },\\n \\\"url\\\": \\\"{{.Core.Domain}}\\\"\\n }]\\n }]\\n}\"\n }\n}", "options": { "raw": {} } @@ -4798,7 +4805,10 @@ ], "body": { "mode": "raw", - "raw": "{\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 6,\n \"notify_before_scale\": \"hour\"\n}" + "raw": "{\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 6,\n \"notify_before_scale\": \"hour\"\n}", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/messages", @@ -5077,7 +5087,10 @@ "header": [], "body": { "mode": "raw", - "raw": "" + "raw": "", + "options": { + "raw": {} + } }, "url": { "raw": "{{endpoint}}/api/messages/{{message_id}}", @@ -6114,7 +6127,10 @@ "value": "0", "type": "text" } - ] + ], + "options": { + "formdata": {} + } }, "url": { "raw": "{{endpoint}}/oauth/slack", diff --git a/frontend/config/sentry.properties b/frontend/config/sentry.properties index f3cd274e..20eefd4d 100644 --- a/frontend/config/sentry.properties +++ b/frontend/config/sentry.properties @@ -1,6 +1,6 @@ [defaults] org=Statping -project=statping_frontend +project=frontend url=https://sentry.statping.com [auth] diff --git a/frontend/package.json b/frontend/package.json index 46b06aac..dcb28786 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -21,6 +21,8 @@ "@fortawesome/vue-fontawesome": "^0.1.9", "@sentry/browser": "^5.20.1", "@sentry/integrations": "^5.20.1", + "@sentry/tracing": "^5.29.0", + "@sentry/vue": "^5.29.0", "apexcharts": "^3.6.6", "axios": "^0.19.1", "codemirror-colorpicker": "^1.9.66", diff --git a/frontend/src/API.js b/frontend/src/API.js index deb0152f..622559ee 100644 --- a/frontend/src/API.js +++ b/frontend/src/API.js @@ -200,14 +200,6 @@ class Api { return axios.get('api/renew').then(response => (response.data)) } - async cache() { - return axios.get('api/cache').then(response => (response.data)) - } - - async clearCache() { - return axios.get('api/clear_cache').then(response => (response.data)) - } - async logs() { return axios.get('api/logs').then(response => (response.data)) || [] } diff --git a/frontend/src/components/Dashboard/Cache.vue b/frontend/src/components/Dashboard/Cache.vue deleted file mode 100644 index 5a0e3f38..00000000 --- a/frontend/src/components/Dashboard/Cache.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - Cache - - There are no cached pages yet! - - - - URL - Size - Expiration - - - - - - {{cache.url}} - {{cache.size}} - {{ago(cache.expiration)}} - - - - - Clear Cache - - - - - - - - diff --git a/frontend/src/main.js b/frontend/src/main.js index ee918dcd..b5090979 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -6,14 +6,14 @@ import VueClipboard from 'vue-clipboard2' import VueCookies from 'vue-cookies' import VueI18n from 'vue-i18n' import * as Sentry from "@sentry/browser"; -import * as Integrations from "@sentry/integrations"; +import { Integrations as TracingIntegrations } from "@sentry/tracing"; import router from './routes' import "./mixin" import "./icons" import store from './store' import language from './languages' -const errorReporter = "https://bed4d75404924cb3a799e370733a1b64@sentry.statping.com/3" +const errorReporter = "https://f674a4b91578476a99809f1dea56b63b@sentry.statping.com/3" const App = () => import(/* webpackChunkName: "index" */ '@/App.vue') @@ -33,8 +33,11 @@ const i18n = new VueI18n({ Vue.$cookies.config('3d') Sentry.init({ + Vue: Vue, dsn: errorReporter, - integrations: [new Integrations.Vue({Vue, attachProps: true, logErrors: true})], + integrations: [new TracingIntegrations.BrowserTracing()], + tracesSampleRate: 0.2, + environment: process.env.NODE_ENV === 'production' ? 'production' : 'development', }); Vue.config.productionTip = process.env.NODE_ENV !== 'production' diff --git a/frontend/src/pages/Index.vue b/frontend/src/pages/Index.vue index 78197ea8..3419075d 100644 --- a/frontend/src/pages/Index.vue +++ b/frontend/src/pages/Index.vue @@ -39,6 +39,7 @@