Merge pull request #920 from statping/dev

0.90.73
pull/921/head^2
Hunter Long 2020-12-18 01:41:52 -08:00 committed by GitHub
commit 1bde0626e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 524 additions and 649 deletions

View File

@ -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

View File

@ -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

View File

@ -28,8 +28,8 @@ jobs:
- name: Add GOBIN to PATH
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
@ -96,9 +96,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)
@ -135,13 +135,13 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.2'
go-version: 1.15.x
- 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)

17
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"env": {},
"args": []
}
]
}

View File

@ -1,3 +1,13 @@
# 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
# 0.90.71 (10-13-2020)
- Reverted Docker user in Dockerfile

View File

@ -302,8 +302,8 @@ dockerhub:
docker push statping/statping
docker-build-dev:
docker build --build-arg VERSION=${VERSION} -t hunterlong/statping:latest --no-cache -f Dockerfile .
docker tag hunterlong/statping:dev hunterlong/statping:dev-v${VERSION}
docker build --build-arg VERSION=${VERSION} -t statping/statping:latest --no-cache -f Dockerfile .
docker tag statping/statping:latest statping/statping:dev-v${VERSION}
post-release: frontend-build upload_to_s3 publish-homebrew dockerhub

362
dev/postman.json vendored
View File

@ -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",

View File

@ -3,7 +3,7 @@ version: '2.3'
services:
statping:
container_name: statping
image: statping/statping:latest
image: statping/statping:dev
restart: always
volumes:
- statping_data:/app

View File

@ -1,6 +1,6 @@
[defaults]
org=Statping
project=statping_frontend
project=frontend
url=https://sentry.statping.com
[auth]

View File

@ -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",

View File

@ -7,8 +7,8 @@ const tokenKey = "statping_auth";
class Api {
constructor() {
this.version = "0.90.67";
this.commit = "7e121335791d2143a2eefd404dbcce83b8f46f61";
this.version = "0.90.72";
this.commit = "fe63947d632083ad7d8e9adcf2d0d7e85383861d";
}
async oauth() {
@ -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)) || []
}

View File

@ -1,53 +0,0 @@
<template>
<div class="card mb-5">
<div class="card-header">Cache</div>
<div class="card-body">
<span v-if="!cache" class="text-muted">There are no cached pages yet!</span>
<table v-if="cache" class="table">
<thead>
<tr>
<th scope="col">URL</th>
<th scope="col">Size</th>
<th scope="col">Expiration</th>
</tr>
</thead>
<tbody>
<tr v-for="(cache, index) in cache">
<td>{{cache.url}}</td>
<td>{{cache.size}}</td>
<td>{{ago(cache.expiration)}}</td>
</tr>
</tbody>
</table>
<button v-if="cache" @click.prevent="clearCache" class="btn btn-danger btn-block">Clear Cache</button>
</div>
</div>
</template>
<script>
import Api from "../../API";
export default {
name: 'Cache',
data() {
return {
cache: [],
}
},
async mounted() {
this.cache = await Api.cache()
},
methods: {
async clearCache() {
await Api.clearCache()
this.cache = []
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>

View File

@ -110,7 +110,7 @@
return ""
},
GHlogin() {
window.location = `https://github.com/login/oauth/authorize?client_id=${this.oauth.gh_client_id}&redirect_uri=${this.encode(this.core.domain+"/oauth/github")}&scope=user,repo`
window.location = `https://github.com/login/oauth/authorize?client_id=${this.oauth.gh_client_id}&redirect_uri=${this.encode(this.core.domain+"/oauth/github")}&scope=read:user,read:org`
},
Slacklogin() {
window.location = `https://slack.com/oauth/authorize?client_id=${this.oauth.slack_client_id}&redirect_uri=${this.encode(this.core.domain+"/oauth/slack")}&scope=identity.basic`

View File

@ -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')
@ -32,11 +32,6 @@ const i18n = new VueI18n({
Vue.$cookies.config('3d')
Sentry.init({
dsn: errorReporter,
integrations: [new Integrations.Vue({Vue, attachProps: true, logErrors: true})],
});
Vue.config.productionTip = process.env.NODE_ENV !== 'production'
Vue.config.devtools = process.env.NODE_ENV !== 'production'
Vue.config.performance = process.env.NODE_ENV !== 'production'

View File

@ -13,6 +13,8 @@
<a @click.prevent='tab="Notifiers"' class="d-block mb-1 text-link" href="#">Notifiers</a>
<a @click.prevent='tab="Issues and Solutions"' class="d-block mb-1 text-link" href="#">Issues and Solutions</a>
<a @click.prevent='tab="Bulk Import Services"' class="d-block mb-1 text-link" href="#">Bulk Import Services</a>
<a @click.prevent='tab="Environment Variables"' class="d-block mb-1 text-link" href="#">Environment Variables</a>
@ -326,6 +328,44 @@ func AttachNotifiers() error {
</div>
</div>
<div class="col-12" v-if='tab === "Issues and Solutions"'>
<h1 class="h1 mt-5 mb-5 text-muted">Issues and Solutions</h1>
<span class="spacer"></span>
<div v-pre>
<p>If you have issues with your Statping instance, this page will help you solve them. Before doing anything, I recommend updating to the latest version of Statping.</p>
<h2>Update to Latest Version</h2>
<p>Updating Statping is very simple, you can choose one of the options below:
- Run command: <code>statping update</code> (you may need to run sudo depending on your server)
- or Run command: <code>curl -o- -L https://statping.com/install.sh | bash</code>
- or download tar.gz file from <a href="https://github.com/statping/statping/releases/latest" target="_blank">Latest Releases</a> and extract for <code>statping</code>.</p>
<h2>Blank/White Page</h2>
<p>If your Statping instance is only showing a blank white page, this means there&rsquo;s an issue with CSS or JS assets.
- Update to the latest version of Statping
- Delete the <code>assets</code> folder if you have one
- Restart Statping instance</p>
<h2>Database Migration Errors</h2>
<p>If you notice a database error during migration, you can reset your Statping instance while keeping previous data so you won&rsquo;t have to re-input.
- In your Statping directory (contains config.yml) run command: <code>statping export</code>. This will export all elements into a timestamped JSON file. This file will not include previous hits or failures.
- Delete <code>assets</code> folder if you have one.
- Delete and Recreate MySQL, Postgres database, or delete <code>statping.db</code>.
- Import previous data by running: <code>statping import backup.json</code> (replace backup.json with your exported filename)</p>
<h2>Deleting Old Records</h2>
<ul>
<li><code>DELETE FROM hits WHERE created_at &lt; '2020-02-21 00:00:00';</code> // Delete hits older than</li>
<li><code>DELETE FROM failures WHERE created_at &lt; '2020-02-21 00:00:00';</code> // Delete failures older than</li>
</ul>
</div>
</div>
<div class="col-12" v-if='tab === "Bulk Import Services"'>
<h1 class="h1 mt-5 mb-5 text-muted">Bulk Import Services</h1>
<span class="spacer"></span>
@ -422,10 +462,12 @@ services:
<li><code>DB_PASS</code> - Database password</li>
<li><code>DB_PORT</code> - Database port (5432, 3306, &hellip;)</li>
<li><code>DB_DATABASE</code> - Database connection&rsquo;s database name</li>
<li><code>DB_DSN</code> - Database DSN string (<a href="https://www.php.net/manual/en/ref.pdo-pgsql.connection.php" target="_blank">postgres</a>, <a href="https://github.com/go-sql-driver/mysql#dsn-data-source-name" target="_blank">mysql</a>, <a href="https://www.sqlite.org/inmemorydb.html" target="_blank">sqlite</a>)</li>
<li><code>READ_ONLY</code> - Run in a read only mode, this will not create, update, or delete records (false)</li>
<li><code>POSTGRES_SSLMODE</code> - Enable <a href="https://www.postgresql.org/docs/9.1/libpq-ssl.html" target="_blank">Postgres SSL Mode</a> &lsquo;ssl_mode=VALUE&rsquo; (enable/disable/verify-full/verify-ca)</li>
<li><code>MAX_OPEN_CONN</code> - Set <a href="https://golang.org/pkg/database/sql/#DB.SetMaxOpenConns" target="_blank">Maximum Open Connections</a> for database server (default: 25)</li>
<li><code>MAX_IDLE_CONN</code> - Set <a href="https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns" target="_blank">Maximum Idle Connections</a> for database server (default: 25)</li>
<li><code>MAX_LIFE_CONN</code> - Set <a href="https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime" target="_blank">Maximum Life Connections</a> for database server (default: 25)</li>
<li><code>MAX_LIFE_CONN</code> - Set <a href="https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime" target="_blank">Maximum Life Connections</a> for database server (default: 5 minutes)</li>
<li><code>PREFIX</code> - Add a prefix string to each Prometheus metric (default is empty)</li>
</ul>
@ -454,7 +496,7 @@ services:
<li><p><code>LOGS_MAX_SIZE</code> - Maximum size for log files (defaults to 16 MB)</p></li>
<li><p><code>LANGUAGE</code> - Language to use (en, fr, ru, more to come&hellip;)</p>
<li><p><code>LANGUAGE</code> - Language to use (en, fr, it, ru, zh, de, ko, ja)</p>
<h3>Assets</h3></li>
@ -463,6 +505,10 @@ services:
<li><p><code>USE_ASSETS</code> - Automatically use assets from &lsquo;assets folder&rsquo; (true/false)</p></li>
</ul>
<blockquote>
<p>If you have issues with Statping not loading frontend files, delete the assets folder and reboot.</p>
</blockquote>
<h3>Automatic Fills</h3>
<ul>
@ -2275,7 +2321,7 @@ OluFxewsEO0QNDrfFb+0gnjYlnGqOFcZjUMXbDdY5oLSPtXohynuTK1qyQ==
</div>
<div class="text-center small text-dim" v-pre>
Automatically generated from Statping's Wiki on 2020-09-15 19:09:14.703237 &#43;0000 UTC
Automatically generated from Statping's Wiki on 2020-11-01 17:17:43.627285 &#43;0000 UTC
</div>
</div>

View File

@ -39,6 +39,7 @@
<script>
import Api from "@/API";
const Group = () => import(/* webpackChunkName: "index" */ '@/components/Index/Group')
const Header = () => import(/* webpackChunkName: "index" */ '@/components/Index/Header')
const MessageBlock = () => import(/* webpackChunkName: "index" */ '@/components/Index/MessageBlock')
@ -63,9 +64,7 @@ export default {
},
computed: {
loading_text() {
if (!this.$store.getters.core.version) {
return "Loading Core"
} else if (this.$store.getters.groups.length === 0) {
if (this.$store.getters.groups.length === 0) {
return "Loading Groups"
} else if (this.$store.getters.services.length === 0) {
return "Loading Services"
@ -74,7 +73,7 @@ export default {
}
},
loaded() {
return this.$store.getters.core.version && this.$store.getters.services.length !== 0
return this.$store.getters.services.length !== 0
},
core() {
return this.$store.getters.core

View File

@ -24,9 +24,6 @@
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-style-tab')}" id="v-pills-style-tab" data-toggle="pill" href="#v-pills-style" role="tab" aria-controls="v-pills-style" aria-selected="false">
<font-awesome-icon icon="image" class="mr-2"/> {{ $t('theme') }}
</a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-cache-tab')}" id="v-pills-cache-tab" data-toggle="pill" href="#v-pills-cache" role="tab" aria-controls="v-pills-cache" aria-selected="false">
<font-awesome-icon icon="paperclip" class="mr-2"/> {{ $t('cache') }}
</a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-oauth-tab')}" id="v-pills-oauth-tab" data-toggle="pill" href="#v-pills-oauth" role="tab" aria-controls="v-pills-oauth" aria-selected="false">
<font-awesome-icon icon="key" class="mr-2"/> {{ $t('authentication') }}
</a>
@ -110,10 +107,6 @@
<ThemeEditor/>
</div>
<div class="tab-pane fade" v-bind:class="{active: liClass('v-pills-cache-tab'), show: liClass('v-pills-cache-tab')}" id="v-pills-cache" role="tabpanel" aria-labelledby="v-pills-cache-tab">
<Cache/>
</div>
<div class="tab-pane fade" v-bind:class="{active: liClass('v-pills-oauth-tab'), show: liClass('v-pills-oauth-tab')}" id="v-pills-oauth" role="tabpanel" aria-labelledby="v-pills-oauth-tab">
<OAuth/>
</div>
@ -150,7 +143,6 @@
const Notifier = () => import(/* webpackChunkName: "dashboard" */ '@/forms/Notifier')
const OAuth = () => import(/* webpackChunkName: "dashboard" */ '@/forms/OAuth')
const ThemeEditor = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/ThemeEditor')
const Cache = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Cache')
const Importer = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Importer')
const Variables = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Variables')
const Configs = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Configs')
@ -162,7 +154,6 @@
Importer,
Variables,
OAuth,
Cache,
ThemeEditor,
FormIntegration,
Notifier,
@ -196,7 +187,6 @@
},
methods: {
async update() {
this.cache = await Api.cache()
await this.getGithub()
},
async getGithub() {

View File

@ -1094,6 +1094,16 @@
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"
"@sentry/browser@5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.29.0.tgz#a8cab91729c759c456bd2254cef65bafa5cdc4ea"
integrity sha512-kRlt1mE2wrYjspnIupNnPxqsUrRuy02SuXhbpP7J6uu8QasoEmJ78hk0hHz4jOZRmuWwfs2zIXD4tLGgWOKq8A==
dependencies:
"@sentry/core" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"
"@sentry/browser@^5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.20.1.tgz#be59522d0914d58309e1367d997d4b3cd5385d7e"
@ -1115,6 +1125,17 @@
"@sentry/utils" "5.20.1"
tslib "^1.9.3"
"@sentry/core@5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.29.0.tgz#4410ca0dc5785abf3df02fa23c18e83ad90d7cda"
integrity sha512-a1sZBJ2u3NG0YDlGvOTwUCWiNjhfmDtAQiKK1o6RIIbcrWy9TlSps7CYDkBP239Y3A4pnvohjEEKEP3v3L3LZQ==
dependencies:
"@sentry/hub" "5.29.0"
"@sentry/minimal" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"
"@sentry/hub@5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.20.1.tgz#05e83ba972a96e9d7225a64c7d3728aa9fcefc4e"
@ -1124,6 +1145,15 @@
"@sentry/utils" "5.20.1"
tslib "^1.9.3"
"@sentry/hub@5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.29.0.tgz#d018b978fdffc6c8261744b0d08e8d25a3f4dc58"
integrity sha512-kcDPQsRG4cFdmqDh+TzjeO7lWYxU8s1dZYAbbl1J4uGKmhNB0J7I4ak4SGwTsXLY6fhbierxr6PRaoNojCxjPw==
dependencies:
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"
"@sentry/integrations@^5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.20.1.tgz#c42dd53c2162b96bf4da641cd1c2bd53c0bbdce3"
@ -1142,11 +1172,36 @@
"@sentry/types" "5.20.1"
tslib "^1.9.3"
"@sentry/minimal@5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.29.0.tgz#bd8b52f388abcec2234dbbc6d6721ff65aa30e35"
integrity sha512-nhXofdjtO41/caiF1wk1oT3p/QuhOZDYdF/b29DoD2MiAMK9IjhhOXI/gqaRpDKkXlDvd95fDTcx4t/MqqcKXA==
dependencies:
"@sentry/hub" "5.29.0"
"@sentry/types" "5.29.0"
tslib "^1.9.3"
"@sentry/tracing@^5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.29.0.tgz#8ed515b3f9d409137357c38c8622858f9e684e4a"
integrity sha512-2ZITUH7Eur7IkmRAd5gw8Xt2Sfc28btCnT7o2P2J8ZPD65e99ATqjxXPokx0+6zEkTsstIDD3mbyuwkpbuvuTA==
dependencies:
"@sentry/hub" "5.29.0"
"@sentry/minimal" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"
"@sentry/types@5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.20.1.tgz#ccc4fa4c9d0f94d93014b04e674762d5d5cd30a2"
integrity sha512-OU+i/lcjGpDJv0XkNpsKrI2r1VPp8qX0H6Knq8NuZrlZe3AbvO3jRJJK0pH14xFv8Xok5jbZZpKKoQLxYfxqsw==
"@sentry/types@5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.29.0.tgz#af5cec98cde54316c14df3121f0e8106e56b578e"
integrity sha512-iDkxT/9sT3UF+Xb+JyLjZ5caMXsgLfRyV9VXQEiR2J6mgpMielj184d9jeF3bm/VMuAf/VFFqrHlcVsVgmrrMw==
"@sentry/utils@5.20.1":
version "5.20.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.20.1.tgz#68cfae0d0e3b321b4649b59f30265024b29eae63"
@ -1155,6 +1210,26 @@
"@sentry/types" "5.20.1"
tslib "^1.9.3"
"@sentry/utils@5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.29.0.tgz#b4c1223ba362a94cf4850e9ca2cb24655b006b53"
integrity sha512-b2B1gshw2u3EHlAi84PuI5sfmLKXW1z9enMMhNuuNT/CoRp+g5kMAcUv/qYTws7UNnYSvTuVGuZG30v1e0hP9A==
dependencies:
"@sentry/types" "5.29.0"
tslib "^1.9.3"
"@sentry/vue@^5.29.0":
version "5.29.0"
resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-5.29.0.tgz#606e0c7fe3e6860934eb19461d8fc6cf97b1a198"
integrity sha512-AIlPWdC6uNhLcFUBFfvY2CblHSQK0IK7y+qdOKVhpQFNBz6zOEHleg98UEv4uVmXeKqmpESkIDeCcAP7MqCCyQ==
dependencies:
"@sentry/browser" "5.29.0"
"@sentry/core" "5.29.0"
"@sentry/minimal" "5.29.0"
"@sentry/types" "5.29.0"
"@sentry/utils" "5.29.0"
tslib "^1.9.3"
"@soda/friendly-errors-webpack-plugin@^1.7.1":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz#706f64bcb4a8b9642b48ae3ace444c70334d615d"

11
go.mod
View File

@ -12,15 +12,15 @@ require (
github.com/foomo/tlsconfig v0.0.0-20180418120404-b67861b076c9
github.com/getsentry/sentry-go v0.5.1
github.com/go-mail/mail v2.3.1+incompatible
github.com/go-redis/cache/v8 v8.0.0
github.com/go-redis/redis/v8 v8.1.3
github.com/golang/protobuf v1.4.2 // indirect
github.com/google/go-cmp v0.5.1 // indirect
github.com/gorilla/mux v1.7.4
github.com/hako/durafmt v0.0.0-20200605151348-3a43fc422dd9
github.com/jinzhu/gorm v1.9.12
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.1.0
github.com/sirupsen/logrus v1.5.0
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.6.3
github.com/statping/emails v1.0.0
@ -29,9 +29,14 @@ require (
github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1
go.uber.org/atomic v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 // indirect
golang.org/x/net v0.0.0-20200904194848-62affa334b73 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20201012192620-5bd05386311b // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/grpc v1.28.1
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v2 v2.3.0
)

51
go.sum
View File

@ -115,8 +115,6 @@ github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
@ -136,8 +134,10 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpu/goacmedns v0.0.2 h1:hYAgjnPu7HogTgb8trqQouR/RrBgXq1TPBgmxbK9eRA=
github.com/cpu/goacmedns v0.0.2/go.mod h1:4MipLkI+qScwqtVxcNO6okBhbgRrr7/tKXUSgSL0teQ=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/daaku/go.zipexe v1.0.0 h1:VSOgZtH418pH9L16hC/JrgSNJbbAL26pj7lmD1+CGdY=
@ -153,8 +153,6 @@ github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6ps
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
@ -212,11 +210,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
github.com/go-mail/mail v2.3.1+incompatible h1:UzNOn0k5lpfVtO31cK3hn6I4VEVGhe3lX8AJBAxXExM=
github.com/go-mail/mail v2.3.1+incompatible/go.mod h1:VPWjmmNyRsWXQZHVHT3g0YbIINUkSmuKOiLIDkWbL6M=
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
github.com/go-redis/cache/v8 v8.0.0 h1:J/v+5zau/tfyBWK8BGIR6ubnXKDh7/o3rMy/TAr9d2Q=
github.com/go-redis/cache/v8 v8.0.0/go.mod h1:qSXlomlN5lJZf7TIgddPHwVAYMKWxEcwnZobz6kltX8=
github.com/go-redis/redis/v8 v8.0.0/go.mod h1:isLoQT/NFSP7V67lyvM9GmdvLdyZ7pEhsXvvyQtnQTo=
github.com/go-redis/redis/v8 v8.1.3 h1:Wcla0pl4iobatJy3CmQonbmZOPF6w94xOaGkVFWH/rQ=
github.com/go-redis/redis/v8 v8.1.3/go.mod h1:ysgGY09J/QeDYbu3HikWEIPCwaeOkuNoTgKayTEaEOw=
github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8=
github.com/go-resty/resty/v2 v2.2.0 h1:vgZ1cdblp8Aw4jZj3ZsKh6yKAlMg3CHMrqFSFFd+jgY=
github.com/go-resty/resty/v2 v2.2.0/go.mod h1:nYW/8rxqQCmI3bPz9Fsmjbr2FBjGuR2Mzt6kDh3zZ7w=
@ -381,8 +374,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.9.0 h1:GhthINjveNZAdFUD8QoQYfjxnOONZgztK/Yr6M23UTY=
github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.11.0 h1:wJbzvpYMVGG9iTI9VxpnNZfd4DzMPoCWze3GgSqz8yg=
github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ=
github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b h1:DzHy0GlWeF0KAglaTMY7Q+khIFoG8toHP+wLFBVBQJc=
@ -391,6 +382,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGi
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@ -419,10 +412,12 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
@ -476,22 +471,14 @@ github.com/nrdcg/goinwx v0.6.1 h1:AJnjoWPELyCtofhGcmzzcEMFd9YdF2JB/LgutWsWt/s=
github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ=
github.com/nrdcg/namesilo v0.2.1 h1:kLjCjsufdW/IlC+iSfAqj0iQGgKjlbUUeDJio5Y6eMg=
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=
github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs=
github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
github.com/oracle/oci-go-sdk v17.4.0+incompatible h1:W9yFhlwQ9+p0mE2oPrS++v821eIT17gTUpJXkmGZb9o=
@ -562,6 +549,8 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q=
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
@ -638,15 +627,6 @@ github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBn
github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94=
github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ=
github.com/vmihailenco/go-tinylfu v0.0.0-20200714092347-120b932f0a08 h1:IYlYw/r3UIaL/ICXVepbMoVEC0femQdEObM8Kmc/3e0=
github.com/vmihailenco/go-tinylfu v0.0.0-20200714092347-120b932f0a08/go.mod h1:qZbD6U3F10Sfuxyy4c5wMq5CM4/t5I3eJJS9yMQoXU0=
github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1 h1:d71/KA0LhvkrJ/Ok+Wx9qK7bU8meKA1Hk0jpVI5kJjk=
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1/go.mod h1:xlngVLeyQ/Qi05oQxhQ+oTuqa03RjMwMfk/7/TCs+QI=
github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY=
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
github.com/vultr/govultr v0.3.3 h1:fVaF4h9u3VzTXxFsxvgBUCiM52EiahLqAPkizamLzYM=
github.com/vultr/govultr v0.3.3/go.mod h1:TUuUizMOFc7z+PNMssb6iGjKjQfpw5arIaOLfocVudQ=
@ -664,6 +644,7 @@ github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FB
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
@ -672,8 +653,6 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/otel v0.11.0 h1:IN2tzQa9Gc4ZVKnTaMbPVcHjvzOdg5n9QfnmlqiET7E=
go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
@ -716,7 +695,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20200908183739-ae8ad444f925/go.mod h1:1phAWC201xIgDyaFpmDeZkgf70Q4Pd/CNqfRtVPtxNw=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@ -737,6 +715,7 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -773,9 +752,9 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA=
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
@ -819,11 +798,9 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -837,8 +814,6 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f h1:gWF768j/LaZugp8dyS4UwsslYCYz9XgFxvlgsn0n9H8=
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c=
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -895,10 +870,14 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4 h1:kDtqNkeBrZb8B+atrj50B5XLHpzXXqcCdZPP/ApQ5NY=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20201012192620-5bd05386311b h1:Imq6ZJ3mzzAkU1yzH1aHpiF3lTs3ySLzjH8SEfFdW0A=
golang.org/x/tools v0.0.0-20201012192620-5bd05386311b/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=

View File

@ -116,27 +116,6 @@ type cacheJson struct {
Size int `json:"size"`
}
func apiCacheHandler(w http.ResponseWriter, r *http.Request) {
var cacheList []cacheJson
for k, v := range CacheStorage.List() {
cacheList = append(cacheList, cacheJson{
URL: k,
Expiration: time.Unix(0, v.Expiration).UTC(),
Size: len(v.Content),
})
}
returnJson(cacheList, w, r)
}
func apiClearCacheHandler(w http.ResponseWriter, r *http.Request) {
CacheStorage.StopRoutine()
CacheStorage = NewStorage()
output := apiResponse{
Status: "success",
}
returnJson(output, w, r)
}
func sendErrorJson(err error, w http.ResponseWriter, r *http.Request) {
errCode := 0
e, ok := err.(errors.Error)

View File

@ -8,7 +8,6 @@ import (
"github.com/pkg/errors"
_ "github.com/statping/statping/notifiers"
"github.com/statping/statping/source"
"github.com/statping/statping/types"
"github.com/statping/statping/types/checkins"
"github.com/statping/statping/types/core"
"github.com/statping/statping/types/groups"
@ -168,33 +167,6 @@ func TestMainApiRoutes(t *testing.T) {
BeforeTest: SetTestENV,
SecureRoute: true,
},
{
Name: "Statping View Cache",
URL: "/api/cache",
Method: "GET",
ExpectedStatus: 200,
BeforeTest: SetTestENV,
SecureRoute: true,
ResponseLen: 0,
},
{
Name: "Statping Clear Cache",
URL: "/api/clear_cache",
Method: "POST",
ExpectedStatus: 200,
SecureRoute: true,
BeforeTest: func(t *testing.T) error {
CacheStorage.Set("test", []byte("data here"), types.Day)
list := CacheStorage.List()
assert.Len(t, list, 1)
return nil
},
AfterTest: func(t *testing.T) error {
list := CacheStorage.List()
assert.Len(t, list, 0)
return nil
},
},
{
Name: "Update Core",
URL: "/api/core",

View File

@ -1,123 +0,0 @@
package handlers
import (
"github.com/statping/statping/utils"
"net/url"
"sync"
"time"
)
var CacheStorage Cacher
type Cacher interface {
Get(key string) []byte
Delete(key string)
Set(key string, content []byte, duration time.Duration)
List() map[string]Item
Lock()
Unlock()
StopRoutine()
}
// Item is a cached reference
type Item struct {
Content []byte
Expiration int64
}
// cleanRoutine is a go routine to automatically remove expired caches that haven't been hit recently
func cleanRoutine(s *Storage) {
duration := 60 * time.Second
CacheRoutine:
for {
select {
case <-s.running:
break CacheRoutine
case <-time.After(duration):
for k, v := range s.List() {
if v.Expired() {
s.Delete(k)
}
}
duration = 60 * time.Second
}
}
}
// Expired returns true if the item has expired.
func (item Item) Expired() bool {
if item.Expiration == 0 {
return false
}
return utils.Now().UnixNano() > item.Expiration
}
//Storage mecanism for caching strings in memory
type Storage struct {
items map[string]Item
mu *sync.RWMutex
running chan bool
}
//NewStorage creates a new in memory CacheStorage
func NewStorage() *Storage {
storage := &Storage{
items: make(map[string]Item),
mu: &sync.RWMutex{},
running: make(chan bool),
}
go cleanRoutine(storage)
return storage
}
func (s Storage) StopRoutine() {
close(s.running)
}
func (s Storage) Lock() {
s.mu.Lock()
}
func (s Storage) Unlock() {
s.mu.Unlock()
}
func (s Storage) List() map[string]Item {
return s.items
}
//Get a cached content by key
func (s Storage) Get(key string) []byte {
s.mu.Lock()
defer s.mu.Unlock()
item := s.items[key]
if item.Expired() {
CacheStorage.Delete(key)
return nil
}
return item.Content
}
func (s Storage) Delete(key string) {
s.mu.Lock()
defer s.mu.Unlock()
delete(s.items, key)
}
//Set a cached content by key
func (s Storage) Set(key string, content []byte, duration time.Duration) {
s.mu.Lock()
defer s.mu.Unlock()
u, err := url.Parse(key)
if err != nil {
return
}
if u.Query().Get("v") != "" {
return
}
s.items[key] = Item{
Content: content,
Expiration: utils.Now().Add(duration).UnixNano(),
}
}

View File

@ -15,7 +15,8 @@ import (
const (
cookieName = "statping_auth"
timeout = time.Second * 30
timeout = time.Second * 30
)
var (
@ -24,13 +25,10 @@ var (
usingSSL bool
mainTmpl = `{{define "main" }} {{ template "base" . }} {{ end }}`
templates = []string{"base.gohtml"}
httpError chan error
)
func StopHTTPServer(err error) {
log.Infoln("Stopping HTTP Server")
httpError <- err
close(httpError)
}
// RunHTTPServer will start a HTTP server on a specific IP and port
@ -54,21 +52,13 @@ func RunHTTPServer() error {
router = Router()
resetCookies()
httpError = make(chan error)
if utils.Params.GetBool("LETSENCRYPT_ENABLE") {
go startLetsEncryptServer(ip)
return startLetsEncryptServer(ip)
} else if usingSSL {
go startSSLServer(ip)
return startSSLServer(ip)
} else {
go startServer(host)
}
for {
select {
case err := <-httpError:
return err
}
return startServer(host)
}
}

View File

@ -25,18 +25,12 @@ func findIncident(r *http.Request) (*incidents.Incident, int64, error) {
}
func apiServiceIncidentsHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
id := vars["id"]
if utils.NotNumber(id) {
sendErrorJson(errors.NotNumber, w, r)
service, err := findService(r)
if err != nil {
sendErrorJson(err, w, r)
return
}
incids := incidents.FindByService(utils.ToInt(id))
if incids == nil {
sendErrorJson(errors.Missing(&incidents.Incident{}, id), w, r)
return
}
returnJson(incids, w, r)
returnJson(service.Incidents, w, r)
}
func apiIncidentUpdatesHandler(w http.ResponseWriter, r *http.Request) {

View File

@ -13,9 +13,7 @@ import (
"github.com/statping/statping/utils"
"io"
"net/http"
"net/http/httptest"
"strings"
"time"
)
var (
@ -139,36 +137,6 @@ func readOnly(handler http.Handler, redirect bool) http.Handler {
})
}
// cached is a middleware function that accepts a duration and content type and will cache the response of the original request
func cached(duration, contentType string, handler func(w http.ResponseWriter, r *http.Request)) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
content := CacheStorage.Get(r.RequestURI)
w.Header().Set("Content-Type", contentType)
w.Header().Set("Access-Control-Allow-Origin", "*")
if !core.App.Setup {
handler(w, r)
return
}
if content != nil {
w.Write(content)
} else {
c := httptest.NewRecorder()
handler(c, r)
content := c.Body.Bytes()
result := c.Result()
if result.StatusCode != 200 {
w.WriteHeader(result.StatusCode)
w.Write(content)
return
}
w.Write(content)
if d, err := time.ParseDuration(duration); err == nil {
go CacheStorage.Set(r.RequestURI, content, d)
}
}
})
}
// prometheusMiddleware implements mux.MiddlewareFunc.
func prometheusMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

View File

@ -1,12 +1,13 @@
package handlers
import (
"testing"
"github.com/statping/statping/notifiers"
"github.com/statping/statping/types/services"
"github.com/statping/statping/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)
func TestAttachment(t *testing.T) {

View File

@ -27,7 +27,6 @@ func staticAssets(src string) http.Handler {
// Server will use static assets if the 'assets' directory is found in the root directory.
func Router() *mux.Router {
dir := utils.Directory
CacheStorage = NewStorage()
r := mux.NewRouter().StrictSlash(true)
r.Use(prometheusMiddleware)
@ -96,8 +95,6 @@ func Router() *mux.Router {
api.Handle("/api/login", http.HandlerFunc(apiLoginHandler)).Methods("POST")
api.Handle("/api/logout", http.HandlerFunc(logoutHandler))
api.Handle("/api/renew", authenticated(apiRenewHandler, false))
api.Handle("/api/cache", authenticated(apiCacheHandler, false)).Methods("GET")
api.Handle("/api/clear_cache", authenticated(apiClearCacheHandler, false))
api.Handle("/api/core", authenticated(apiCoreHandler, false)).Methods("POST")
api.Handle("/api/logs", authenticated(logsHandler, false)).Methods("GET")
api.Handle("/api/logs/last", authenticated(logsLineHandler, false)).Methods("GET")
@ -139,9 +136,9 @@ func Router() *mux.Router {
api.Handle("/api/services/{id}/hits", authenticated(apiServiceHitsDeleteHandler, false)).Methods("DELETE")
// API SERVICE CHART DATA Routes
api.Handle("/api/services/{id}/hits_data", cached("30s", "application/json", apiServiceDataHandler)).Methods("GET")
api.Handle("/api/services/{id}/failure_data", cached("30s", "application/json", apiServiceFailureDataHandler)).Methods("GET")
api.Handle("/api/services/{id}/ping_data", cached("30s", "application/json", apiServicePingDataHandler)).Methods("GET")
api.Handle("/api/services/{id}/hits_data", http.HandlerFunc(apiServiceDataHandler)).Methods("GET")
api.Handle("/api/services/{id}/failure_data", http.HandlerFunc(apiServiceFailureDataHandler)).Methods("GET")
api.Handle("/api/services/{id}/ping_data", http.HandlerFunc(apiServicePingDataHandler)).Methods("GET")
api.Handle("/api/services/{id}/uptime_data", http.HandlerFunc(apiServiceTimeDataHandler)).Methods("GET")
// API INCIDENTS Routes

View File

@ -10,7 +10,7 @@ import (
"strings"
)
func startServer(host string) {
func startServer(host string) error {
httpServer = &http.Server{
Addr: host,
WriteTimeout: timeout,
@ -19,9 +19,7 @@ func startServer(host string) {
Handler: router,
}
httpServer.SetKeepAlivesEnabled(false)
if err := httpServer.ListenAndServe(); err != nil {
httpError <- err
}
return httpServer.ListenAndServe()
}
func letsEncryptCert() (*tls.Config, error) {
@ -63,14 +61,13 @@ func letsEncryptCert() (*tls.Config, error) {
return tlsconf, nil
}
func startLetsEncryptServer(ip string) {
func startLetsEncryptServer(ip string) error {
log.Infoln("Starting LetEncrypt redirect server on port 80")
go http.ListenAndServe(":80", http.HandlerFunc(simplecert.Redirect))
cfg, err := letsEncryptCert()
if err != nil {
httpError <- err
return
return err
}
srv := &http.Server{
@ -82,12 +79,10 @@ func startLetsEncryptServer(ip string) {
IdleTimeout: timeout,
}
if err := srv.ListenAndServeTLS("", ""); err != nil {
httpError <- err
}
return srv.ListenAndServeTLS("", "")
}
func startSSLServer(ip string) {
func startSSLServer(ip string) error {
cfg := &tls.Config{
MinVersion: tls.VersionTLS12,
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
@ -112,7 +107,5 @@ func startSSLServer(ip string) {
certFile := utils.Directory + "/server.crt"
keyFile := utils.Directory + "/server.key"
if err := srv.ListenAndServeTLS(certFile, keyFile); err != nil {
httpError <- err
}
return srv.ListenAndServeTLS(certFile, keyFile)
}

View File

@ -234,6 +234,7 @@ func apiServiceTimeDataHandler(w http.ResponseWriter, r *http.Request) {
sendErrorJson(err, w, r)
return
}
returnJson(uptimeData, w, r)
}

View File

@ -120,7 +120,6 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) {
core.App.Setup = true
CacheStorage.Delete("/")
resetCookies()
out := struct {

View File

@ -2,12 +2,13 @@ package notifiers
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sns"
"github.com/statping/statping/types/null"
"time"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/notifications"

View File

@ -1,6 +1,9 @@
package notifiers
import (
"testing"
"time"
"github.com/statping/statping/database"
"github.com/statping/statping/types/core"
"github.com/statping/statping/types/failures"
@ -10,8 +13,6 @@ import (
"github.com/statping/statping/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
"time"
)
func TestCommandNotifier(t *testing.T) {

View File

@ -4,14 +4,15 @@ import (
"bytes"
"encoding/json"
"errors"
"strings"
"time"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/notifications"
"github.com/statping/statping/types/notifier"
"github.com/statping/statping/types/null"
"github.com/statping/statping/types/services"
"github.com/statping/statping/utils"
"strings"
"time"
)
var _ notifier.Notifier = (*discord)(nil)

View File

@ -3,6 +3,7 @@ package notifiers
import (
"crypto/tls"
"fmt"
"github.com/go-mail/mail"
"github.com/statping/emails"
"github.com/statping/statping/types/core"
@ -90,8 +91,9 @@ type emailOutgoing struct {
// OnFailure will trigger failing service
func (e *emailer) OnFailure(s services.Service, f failures.Failure) (string, error) {
subscriber := e.Var2.String
subject := fmt.Sprintf("Service %s is Offline", s.Name)
tmpl := renderEmail(s, f, emails.Failure)
tmpl := renderEmail(s, subscriber, f, emails.Failure)
email := &emailOutgoing{
To: e.Var2.String,
Subject: subject,
@ -103,8 +105,9 @@ func (e *emailer) OnFailure(s services.Service, f failures.Failure) (string, err
// OnSuccess will trigger successful service
func (e *emailer) OnSuccess(s services.Service) (string, error) {
subscriber := e.Var2.String
subject := fmt.Sprintf("Service %s is Back Online", s.Name)
tmpl := renderEmail(s, failures.Failure{}, emails.Success)
tmpl := renderEmail(s, subscriber, failures.Failure{}, emails.Success)
email := &emailOutgoing{
To: e.Var2.String,
Subject: subject,
@ -114,11 +117,12 @@ func (e *emailer) OnSuccess(s services.Service) (string, error) {
return tmpl, e.dialSend(email)
}
func renderEmail(s services.Service, f failures.Failure, emailData string) string {
func renderEmail(s services.Service, subscriber string, f failures.Failure, emailData string) string {
data := replacer{
Core: *core.App,
Service: s,
Failure: f,
Email: subscriber,
Custom: nil,
}
output, err := emails.Parse(emailData, data)
@ -131,12 +135,13 @@ func renderEmail(s services.Service, f failures.Failure, emailData string) strin
// OnTest triggers when this notifier has been saved
func (e *emailer) OnTest() (string, error) {
subscriber := e.Var2.String
service := services.Example(true)
subject := fmt.Sprintf("Service %v is Back Online", service.Name)
email := &emailOutgoing{
To: e.Var2.String,
Subject: subject,
Template: renderEmail(service, failures.Example(), emailFailure),
Template: renderEmail(service, subscriber, failures.Example(), emailFailure),
From: e.Var1.String,
}
return subject, e.dialSend(email)

View File

@ -1,4 +1,4 @@
// DO NOT EDIT ** This file was generated with go generate on 2020-08-21 21:37:06.638898 +0000 UTC ** DO NOT EDIT //
// DO NOT EDIT ** This file was generated with go generate on 2020-10-13 00:26:28.325328 +0000 UTC ** DO NOT EDIT //
package notifiers
const emailSuccess = `<!doctype html><html xmlns=http://www.w3.org/1999/xhtml xmlns:v=urn:schemas-microsoft-com:vml xmlns:o=urn:schemas-microsoft-com:office:office><title>Statping Service Notification</title><meta http-equiv=x-ua-compatible content="IE=edge"><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><style type=text/css>

View File

@ -6,11 +6,12 @@ import (
"bytes"
"encoding/json"
"fmt"
"os"
"time"
"github.com/statping/statping/utils"
"github.com/tdewolff/minify/v2"
"github.com/tdewolff/minify/v2/html"
"os"
"time"
)
var (

View File

@ -1,10 +1,11 @@
package notifiers
import (
"github.com/statping/statping/types/null"
"strings"
"time"
"github.com/statping/statping/types/null"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/notifications"
"github.com/statping/statping/types/notifier"

View File

@ -2,12 +2,13 @@ package notifiers
import (
"bytes"
"html/template"
"time"
"github.com/statping/statping/types/core"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/services"
"github.com/statping/statping/utils"
"html/template"
"time"
)
//go:generate go run generate.go
@ -18,6 +19,7 @@ type replacer struct {
Core core.Core
Service services.Service
Failure failures.Failure
Email string
Custom map[string]string
}

View File

@ -1,10 +1,11 @@
package notifiers
import (
"testing"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/services"
"github.com/stretchr/testify/assert"
"testing"
)
func TestReplaceTemplate(t *testing.T) {

View File

@ -2,15 +2,16 @@ package notifiers
import (
"fmt"
"net/url"
"strings"
"time"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/notifications"
"github.com/statping/statping/types/notifier"
"github.com/statping/statping/types/null"
"github.com/statping/statping/types/services"
"github.com/statping/statping/utils"
"net/url"
"strings"
"time"
)
const (

View File

@ -3,14 +3,15 @@ package notifiers
import (
"bytes"
"errors"
"strings"
"time"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/notifications"
"github.com/statping/statping/types/notifier"
"github.com/statping/statping/types/null"
"github.com/statping/statping/types/services"
"github.com/statping/statping/utils"
"strings"
"time"
)
var _ notifier.Notifier = (*slack)(nil)

View File

@ -4,15 +4,16 @@ import (
"encoding/json"
"errors"
"fmt"
"net/url"
"strings"
"time"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/notifications"
"github.com/statping/statping/types/notifier"
"github.com/statping/statping/types/null"
"github.com/statping/statping/types/services"
"github.com/statping/statping/utils"
"net/url"
"strings"
"time"
)
var _ notifier.Notifier = (*telegram)(nil)

View File

@ -5,15 +5,16 @@ import (
"encoding/json"
"errors"
"fmt"
"net/url"
"strings"
"time"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/notifications"
"github.com/statping/statping/types/notifier"
"github.com/statping/statping/types/null"
"github.com/statping/statping/types/services"
"github.com/statping/statping/utils"
"net/url"
"strings"
"time"
)
var _ notifier.Notifier = (*twilio)(nil)

View File

@ -1,6 +1,8 @@
package notifiers
import (
"testing"
"github.com/statping/statping/database"
"github.com/statping/statping/types/core"
"github.com/statping/statping/types/failures"
@ -10,7 +12,6 @@ import (
"github.com/statping/statping/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)
var (

View File

@ -42,7 +42,7 @@ func InitEnvs() {
Params.SetDefault("MAX_LIFE_CONN", 5*time.Minute)
Params.SetDefault("SAMPLE_DATA", true)
Params.SetDefault("USE_CDN", false)
Params.SetDefault("ALLOW_REPORTS", false)
Params.SetDefault("ALLOW_REPORTS", true)
Params.SetDefault("POSTGRES_SSLMODE", "disable")
Params.SetDefault("NAME", "Statping Sample Data")
Params.SetDefault("DOMAIN", "http://localhost:8080")

View File

@ -26,7 +26,7 @@ var (
const (
logFilePath = "/logs/statping.log"
errorReporter = "https://ddf2784201134d51a20c3440e222cebe@sentry.statping.com/4"
errorReporter = "https://518d5b04a52b4130bbbbd5b9e70cb7ba@sentry.statping.com/2"
)
func SentryInit(allow bool) {
@ -43,6 +43,7 @@ func SentryInit(allow bool) {
Log.Errorln(err)
}
Log.Infoln("Error Reporting initiated, thank you!")
sentry.CaptureMessage("sentry connected")
}
}

View File

@ -1 +1 @@
0.90.71
0.90.73