mirror of https://github.com/statping/statping
Merge branch 'dev' into Improve-Web-Browser-Emulation
commit
d85a022cdb
|
@ -21,8 +21,8 @@ jobs:
|
||||||
|
|
||||||
- name: Set Version
|
- name: Set Version
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install Global Dependencies
|
- name: Install Global Dependencies
|
||||||
|
@ -98,26 +98,26 @@ jobs:
|
||||||
|
|
||||||
- name: Add GOBIN to PATH
|
- name: Add GOBIN to PATH
|
||||||
run: |
|
run: |
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set Linux Build Flags
|
- name: Set Linux Build Flags
|
||||||
if: matrix.platform == 'linux'
|
if: matrix.platform == 'linux'
|
||||||
run: |
|
run: |
|
||||||
echo ::set-env name=BUILD_FLAGS::'-extldflags -static'
|
echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV
|
||||||
echo ::set-env name=XGO_TAGS::'netgo,osusergo,linux,sqlite_omit_load_extension'
|
echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set Darwin Build Flags
|
- name: Set Darwin Build Flags
|
||||||
if: matrix.platform == 'darwin'
|
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
|
shell: bash
|
||||||
|
|
||||||
- name: Set Windows Build Flags
|
- name: Set Windows Build Flags
|
||||||
if: matrix.platform == 'windows'
|
if: matrix.platform == 'windows'
|
||||||
run: |
|
run: |
|
||||||
echo ::set-env name=BUILD_FLAGS::'-extldflags -static'
|
echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV
|
||||||
echo ::set-env name=XGO_TAGS::'netgo,osusergo,sqlite_omit_load_extension'
|
echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Build ${{ matrix.platform }}/${{ matrix.arch }}
|
- name: Build ${{ matrix.platform }}/${{ matrix.arch }}
|
||||||
|
@ -146,7 +146,7 @@ jobs:
|
||||||
chmod +x statping
|
chmod +x statping
|
||||||
tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping
|
tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping
|
||||||
rm -rf 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
|
- name: Compress Windows Builds
|
||||||
if: matrix.platform == 'windows'
|
if: matrix.platform == 'windows'
|
||||||
|
@ -156,7 +156,7 @@ jobs:
|
||||||
chmod +x statping.exe
|
chmod +x statping.exe
|
||||||
zip statping-windows-${{ matrix.arch }}.zip statping.exe
|
zip statping-windows-${{ matrix.arch }}.zip statping.exe
|
||||||
rm -rf 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
|
- name: Compress Darwin Builds
|
||||||
if: matrix.platform == 'darwin'
|
if: matrix.platform == 'darwin'
|
||||||
|
@ -166,7 +166,7 @@ jobs:
|
||||||
chmod +x statping
|
chmod +x statping
|
||||||
tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping
|
tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping
|
||||||
rm -rf 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
|
- name: Upload Compiled Statping Binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
|
@ -227,9 +227,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -305,9 +305,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -359,9 +359,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -416,9 +416,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -456,11 +456,17 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: echo ::set-env name=VERSION::$(cat version.txt)
|
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- 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
|
- name: Docker Login
|
||||||
env:
|
env:
|
||||||
|
@ -498,7 +504,7 @@ jobs:
|
||||||
# organization: statping
|
# organization: statping
|
||||||
#
|
#
|
||||||
# - name: Setting ENV's
|
# - name: Setting ENV's
|
||||||
# run: echo ::set-env name=VERSION::$(cat version.txt)
|
# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
# shell: bash
|
# shell: bash
|
||||||
#
|
#
|
||||||
# - name: Sentry Release
|
# - name: Sentry Release
|
||||||
|
|
|
@ -21,8 +21,8 @@ jobs:
|
||||||
|
|
||||||
- name: Set Version
|
- name: Set Version
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install Global Dependencies
|
- name: Install Global Dependencies
|
||||||
|
@ -98,26 +98,26 @@ jobs:
|
||||||
|
|
||||||
- name: Add GOBIN to PATH
|
- name: Add GOBIN to PATH
|
||||||
run: |
|
run: |
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set Linux Build Flags
|
- name: Set Linux Build Flags
|
||||||
if: matrix.platform == 'linux'
|
if: matrix.platform == 'linux'
|
||||||
run: |
|
run: |
|
||||||
echo ::set-env name=BUILD_FLAGS::'-extldflags -static'
|
echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV
|
||||||
echo ::set-env name=XGO_TAGS::'netgo,osusergo,linux,sqlite_omit_load_extension'
|
echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set Darwin Build Flags
|
- name: Set Darwin Build Flags
|
||||||
if: matrix.platform == 'darwin'
|
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
|
shell: bash
|
||||||
|
|
||||||
- name: Set Windows Build Flags
|
- name: Set Windows Build Flags
|
||||||
if: matrix.platform == 'windows'
|
if: matrix.platform == 'windows'
|
||||||
run: |
|
run: |
|
||||||
echo ::set-env name=BUILD_FLAGS::'-extldflags -static'
|
echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV
|
||||||
echo ::set-env name=XGO_TAGS::'netgo,osusergo,sqlite_omit_load_extension'
|
echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Build ${{ matrix.platform }}/${{ matrix.arch }}
|
- name: Build ${{ matrix.platform }}/${{ matrix.arch }}
|
||||||
|
@ -146,7 +146,7 @@ jobs:
|
||||||
chmod +x statping
|
chmod +x statping
|
||||||
tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping
|
tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping
|
||||||
rm -rf 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
|
- name: Compress Windows Builds
|
||||||
if: matrix.platform == 'windows'
|
if: matrix.platform == 'windows'
|
||||||
|
@ -156,7 +156,7 @@ jobs:
|
||||||
chmod +x statping.exe
|
chmod +x statping.exe
|
||||||
zip statping-windows-${{ matrix.arch }}.zip statping.exe
|
zip statping-windows-${{ matrix.arch }}.zip statping.exe
|
||||||
rm -rf 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
|
- name: Compress Darwin Builds
|
||||||
if: matrix.platform == 'darwin'
|
if: matrix.platform == 'darwin'
|
||||||
|
@ -166,7 +166,7 @@ jobs:
|
||||||
chmod +x statping
|
chmod +x statping
|
||||||
tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping
|
tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping
|
||||||
rm -rf 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
|
- name: Upload Compiled Statping Binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
|
@ -227,9 +227,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -305,9 +305,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -359,9 +359,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -416,9 +416,9 @@ jobs:
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/12.18.2/x64/bin"
|
echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
@ -456,11 +456,17 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: echo ::set-env name=VERSION::$(cat version.txt)
|
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- 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
|
- name: Docker Login
|
||||||
env:
|
env:
|
||||||
|
@ -498,7 +504,7 @@ jobs:
|
||||||
# organization: statping
|
# organization: statping
|
||||||
#
|
#
|
||||||
# - name: Setting ENV's
|
# - name: Setting ENV's
|
||||||
# run: echo ::set-env name=VERSION::$(cat version.txt)
|
# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
# shell: bash
|
# shell: bash
|
||||||
#
|
#
|
||||||
# - name: Sentry Release
|
# - name: Sentry Release
|
||||||
|
@ -512,7 +518,7 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: echo ::set-env name=VERSION::$(cat version.txt)
|
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Update Homebrew Package
|
- name: Update Homebrew Package
|
||||||
|
@ -529,7 +535,7 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: echo ::set-env name=VERSION::$(cat version.txt)
|
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
|
|
|
@ -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)
|
# 0.90.72 (10-28-2020)
|
||||||
- Fixed issue with graphs becoming stuck on reload
|
- Fixed issue with graphs becoming stuck on reload
|
||||||
|
|
||||||
|
|
|
@ -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",
|
"name": "Logs Last Line",
|
||||||
"event": [
|
"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",
|
"name": "Shields.io Badge",
|
||||||
"event": [
|
"event": [
|
||||||
|
@ -1801,7 +1781,10 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"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": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/services",
|
"raw": "{{endpoint}}/api/services",
|
||||||
|
@ -2069,7 +2052,10 @@
|
||||||
"header": [],
|
"header": [],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"mode": "raw",
|
||||||
"raw": ""
|
"raw": "",
|
||||||
|
"options": {
|
||||||
|
"raw": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/services/{{service_id}}/failures",
|
"raw": "{{endpoint}}/api/services/{{service_id}}/failures",
|
||||||
|
@ -2492,7 +2478,10 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"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": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/incidents/2/updates",
|
"raw": "{{endpoint}}/api/incidents/2/updates",
|
||||||
|
@ -2654,7 +2643,10 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"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": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/incidents/1",
|
"raw": "{{endpoint}}/api/incidents/1",
|
||||||
|
@ -3105,7 +3097,10 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"mode": "raw",
|
||||||
"raw": "{\n \"name\": \"New Group\",\n \"public\": true\n}"
|
"raw": "{\n \"name\": \"New Group\",\n \"public\": true\n}",
|
||||||
|
"options": {
|
||||||
|
"raw": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/groups",
|
"raw": "{{endpoint}}/api/groups",
|
||||||
|
@ -3261,7 +3256,10 @@
|
||||||
"header": [],
|
"header": [],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"mode": "raw",
|
||||||
"raw": ""
|
"raw": "",
|
||||||
|
"options": {
|
||||||
|
"raw": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/groups/{{group_id}}",
|
"raw": "{{endpoint}}/api/groups/{{group_id}}",
|
||||||
|
@ -3541,7 +3539,10 @@
|
||||||
"value": "{{token}}",
|
"value": "{{token}}",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"options": {
|
||||||
|
"urlencoded": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/users/token",
|
"raw": "{{endpoint}}/api/users/token",
|
||||||
|
@ -3787,7 +3788,10 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"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": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/users",
|
"raw": "{{endpoint}}/api/users",
|
||||||
|
@ -3990,7 +3994,10 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"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": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
||||||
|
@ -4514,7 +4521,7 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"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": {
|
"options": {
|
||||||
"raw": {}
|
"raw": {}
|
||||||
}
|
}
|
||||||
|
@ -4798,7 +4805,10 @@
|
||||||
],
|
],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"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": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/messages",
|
"raw": "{{endpoint}}/api/messages",
|
||||||
|
@ -5077,7 +5087,10 @@
|
||||||
"header": [],
|
"header": [],
|
||||||
"body": {
|
"body": {
|
||||||
"mode": "raw",
|
"mode": "raw",
|
||||||
"raw": ""
|
"raw": "",
|
||||||
|
"options": {
|
||||||
|
"raw": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
||||||
|
@ -6114,7 +6127,10 @@
|
||||||
"value": "0",
|
"value": "0",
|
||||||
"type": "text"
|
"type": "text"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"options": {
|
||||||
|
"formdata": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"raw": "{{endpoint}}/oauth/slack",
|
"raw": "{{endpoint}}/oauth/slack",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[defaults]
|
[defaults]
|
||||||
org=Statping
|
org=Statping
|
||||||
project=statping_frontend
|
project=frontend
|
||||||
url=https://sentry.statping.com
|
url=https://sentry.statping.com
|
||||||
|
|
||||||
[auth]
|
[auth]
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
"@fortawesome/vue-fontawesome": "^0.1.9",
|
"@fortawesome/vue-fontawesome": "^0.1.9",
|
||||||
"@sentry/browser": "^5.20.1",
|
"@sentry/browser": "^5.20.1",
|
||||||
"@sentry/integrations": "^5.20.1",
|
"@sentry/integrations": "^5.20.1",
|
||||||
|
"@sentry/tracing": "^5.29.0",
|
||||||
|
"@sentry/vue": "^5.29.0",
|
||||||
"apexcharts": "^3.6.6",
|
"apexcharts": "^3.6.6",
|
||||||
"axios": "^0.19.1",
|
"axios": "^0.19.1",
|
||||||
"codemirror-colorpicker": "^1.9.66",
|
"codemirror-colorpicker": "^1.9.66",
|
||||||
|
|
|
@ -200,14 +200,6 @@ class Api {
|
||||||
return axios.get('api/renew').then(response => (response.data))
|
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() {
|
async logs() {
|
||||||
return axios.get('api/logs').then(response => (response.data)) || []
|
return axios.get('api/logs').then(response => (response.data)) || []
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
|
|
@ -6,14 +6,14 @@ import VueClipboard from 'vue-clipboard2'
|
||||||
import VueCookies from 'vue-cookies'
|
import VueCookies from 'vue-cookies'
|
||||||
import VueI18n from 'vue-i18n'
|
import VueI18n from 'vue-i18n'
|
||||||
import * as Sentry from "@sentry/browser";
|
import * as Sentry from "@sentry/browser";
|
||||||
import * as Integrations from "@sentry/integrations";
|
import { Integrations as TracingIntegrations } from "@sentry/tracing";
|
||||||
import router from './routes'
|
import router from './routes'
|
||||||
import "./mixin"
|
import "./mixin"
|
||||||
import "./icons"
|
import "./icons"
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import language from './languages'
|
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')
|
const App = () => import(/* webpackChunkName: "index" */ '@/App.vue')
|
||||||
|
|
||||||
|
@ -33,8 +33,11 @@ const i18n = new VueI18n({
|
||||||
Vue.$cookies.config('3d')
|
Vue.$cookies.config('3d')
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
|
Vue: Vue,
|
||||||
dsn: errorReporter,
|
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'
|
Vue.config.productionTip = process.env.NODE_ENV !== 'production'
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Api from "@/API";
|
import Api from "@/API";
|
||||||
|
|
||||||
const Group = () => import(/* webpackChunkName: "index" */ '@/components/Index/Group')
|
const Group = () => import(/* webpackChunkName: "index" */ '@/components/Index/Group')
|
||||||
const Header = () => import(/* webpackChunkName: "index" */ '@/components/Index/Header')
|
const Header = () => import(/* webpackChunkName: "index" */ '@/components/Index/Header')
|
||||||
const MessageBlock = () => import(/* webpackChunkName: "index" */ '@/components/Index/MessageBlock')
|
const MessageBlock = () => import(/* webpackChunkName: "index" */ '@/components/Index/MessageBlock')
|
||||||
|
@ -63,9 +64,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
loading_text() {
|
loading_text() {
|
||||||
if (!this.$store.getters.core.version) {
|
if (this.$store.getters.groups.length === 0) {
|
||||||
return "Loading Core"
|
|
||||||
} else if (this.$store.getters.groups.length === 0) {
|
|
||||||
return "Loading Groups"
|
return "Loading Groups"
|
||||||
} else if (this.$store.getters.services.length === 0) {
|
} else if (this.$store.getters.services.length === 0) {
|
||||||
return "Loading Services"
|
return "Loading Services"
|
||||||
|
@ -74,7 +73,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loaded() {
|
loaded() {
|
||||||
return this.$store.getters.core.version && this.$store.getters.services.length !== 0
|
return this.$store.getters.services.length !== 0
|
||||||
},
|
},
|
||||||
core() {
|
core() {
|
||||||
return this.$store.getters.core
|
return this.$store.getters.core
|
||||||
|
|
|
@ -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">
|
<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') }}
|
<font-awesome-icon icon="image" class="mr-2"/> {{ $t('theme') }}
|
||||||
</a>
|
</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">
|
<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') }}
|
<font-awesome-icon icon="key" class="mr-2"/> {{ $t('authentication') }}
|
||||||
</a>
|
</a>
|
||||||
|
@ -110,10 +107,6 @@
|
||||||
<ThemeEditor/>
|
<ThemeEditor/>
|
||||||
</div>
|
</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">
|
<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/>
|
<OAuth/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -150,7 +143,6 @@
|
||||||
const Notifier = () => import(/* webpackChunkName: "dashboard" */ '@/forms/Notifier')
|
const Notifier = () => import(/* webpackChunkName: "dashboard" */ '@/forms/Notifier')
|
||||||
const OAuth = () => import(/* webpackChunkName: "dashboard" */ '@/forms/OAuth')
|
const OAuth = () => import(/* webpackChunkName: "dashboard" */ '@/forms/OAuth')
|
||||||
const ThemeEditor = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/ThemeEditor')
|
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 Importer = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Importer')
|
||||||
const Variables = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Variables')
|
const Variables = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Variables')
|
||||||
const Configs = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Configs')
|
const Configs = () => import(/* webpackChunkName: "dashboard" */ '@/components/Dashboard/Configs')
|
||||||
|
@ -162,7 +154,6 @@
|
||||||
Importer,
|
Importer,
|
||||||
Variables,
|
Variables,
|
||||||
OAuth,
|
OAuth,
|
||||||
Cache,
|
|
||||||
ThemeEditor,
|
ThemeEditor,
|
||||||
FormIntegration,
|
FormIntegration,
|
||||||
Notifier,
|
Notifier,
|
||||||
|
@ -196,7 +187,6 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async update() {
|
async update() {
|
||||||
this.cache = await Api.cache()
|
|
||||||
await this.getGithub()
|
await this.getGithub()
|
||||||
},
|
},
|
||||||
async getGithub() {
|
async getGithub() {
|
||||||
|
|
|
@ -1094,6 +1094,16 @@
|
||||||
"@nodelib/fs.scandir" "2.1.3"
|
"@nodelib/fs.scandir" "2.1.3"
|
||||||
fastq "^1.6.0"
|
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":
|
"@sentry/browser@^5.20.1":
|
||||||
version "5.20.1"
|
version "5.20.1"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.20.1.tgz#be59522d0914d58309e1367d997d4b3cd5385d7e"
|
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.20.1.tgz#be59522d0914d58309e1367d997d4b3cd5385d7e"
|
||||||
|
@ -1115,6 +1125,17 @@
|
||||||
"@sentry/utils" "5.20.1"
|
"@sentry/utils" "5.20.1"
|
||||||
tslib "^1.9.3"
|
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":
|
"@sentry/hub@5.20.1":
|
||||||
version "5.20.1"
|
version "5.20.1"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.20.1.tgz#05e83ba972a96e9d7225a64c7d3728aa9fcefc4e"
|
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.20.1.tgz#05e83ba972a96e9d7225a64c7d3728aa9fcefc4e"
|
||||||
|
@ -1124,6 +1145,15 @@
|
||||||
"@sentry/utils" "5.20.1"
|
"@sentry/utils" "5.20.1"
|
||||||
tslib "^1.9.3"
|
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":
|
"@sentry/integrations@^5.20.1":
|
||||||
version "5.20.1"
|
version "5.20.1"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.20.1.tgz#c42dd53c2162b96bf4da641cd1c2bd53c0bbdce3"
|
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.20.1.tgz#c42dd53c2162b96bf4da641cd1c2bd53c0bbdce3"
|
||||||
|
@ -1142,11 +1172,36 @@
|
||||||
"@sentry/types" "5.20.1"
|
"@sentry/types" "5.20.1"
|
||||||
tslib "^1.9.3"
|
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":
|
"@sentry/types@5.20.1":
|
||||||
version "5.20.1"
|
version "5.20.1"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.20.1.tgz#ccc4fa4c9d0f94d93014b04e674762d5d5cd30a2"
|
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.20.1.tgz#ccc4fa4c9d0f94d93014b04e674762d5d5cd30a2"
|
||||||
integrity sha512-OU+i/lcjGpDJv0XkNpsKrI2r1VPp8qX0H6Knq8NuZrlZe3AbvO3jRJJK0pH14xFv8Xok5jbZZpKKoQLxYfxqsw==
|
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":
|
"@sentry/utils@5.20.1":
|
||||||
version "5.20.1"
|
version "5.20.1"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.20.1.tgz#68cfae0d0e3b321b4649b59f30265024b29eae63"
|
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.20.1.tgz#68cfae0d0e3b321b4649b59f30265024b29eae63"
|
||||||
|
@ -1155,6 +1210,26 @@
|
||||||
"@sentry/types" "5.20.1"
|
"@sentry/types" "5.20.1"
|
||||||
tslib "^1.9.3"
|
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":
|
"@soda/friendly-errors-webpack-plugin@^1.7.1":
|
||||||
version "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"
|
resolved "https://registry.yarnpkg.com/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz#706f64bcb4a8b9642b48ae3ace444c70334d615d"
|
||||||
|
|
|
@ -116,27 +116,6 @@ type cacheJson struct {
|
||||||
Size int `json:"size"`
|
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) {
|
func sendErrorJson(err error, w http.ResponseWriter, r *http.Request) {
|
||||||
errCode := 0
|
errCode := 0
|
||||||
e, ok := err.(errors.Error)
|
e, ok := err.(errors.Error)
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
_ "github.com/statping/statping/notifiers"
|
_ "github.com/statping/statping/notifiers"
|
||||||
"github.com/statping/statping/source"
|
"github.com/statping/statping/source"
|
||||||
"github.com/statping/statping/types"
|
|
||||||
"github.com/statping/statping/types/checkins"
|
"github.com/statping/statping/types/checkins"
|
||||||
"github.com/statping/statping/types/core"
|
"github.com/statping/statping/types/core"
|
||||||
"github.com/statping/statping/types/groups"
|
"github.com/statping/statping/types/groups"
|
||||||
|
@ -168,33 +167,6 @@ func TestMainApiRoutes(t *testing.T) {
|
||||||
BeforeTest: SetTestENV,
|
BeforeTest: SetTestENV,
|
||||||
SecureRoute: true,
|
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",
|
Name: "Update Core",
|
||||||
URL: "/api/core",
|
URL: "/api/core",
|
||||||
|
|
|
@ -1,122 +0,0 @@
|
||||||
package handlers
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/url"
|
|
||||||
"sync"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/statping/statping/utils"
|
|
||||||
)
|
|
||||||
|
|
||||||
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 {
|
|
||||||
item := s.items[key]
|
|
||||||
if item.Expired() {
|
|
||||||
s.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(),
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,7 +15,8 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
cookieName = "statping_auth"
|
cookieName = "statping_auth"
|
||||||
timeout = time.Second * 30
|
|
||||||
|
timeout = time.Second * 30
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -24,13 +25,10 @@ var (
|
||||||
usingSSL bool
|
usingSSL bool
|
||||||
mainTmpl = `{{define "main" }} {{ template "base" . }} {{ end }}`
|
mainTmpl = `{{define "main" }} {{ template "base" . }} {{ end }}`
|
||||||
templates = []string{"base.gohtml"}
|
templates = []string{"base.gohtml"}
|
||||||
httpError chan error
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func StopHTTPServer(err error) {
|
func StopHTTPServer(err error) {
|
||||||
log.Infoln("Stopping HTTP Server")
|
log.Infoln("Stopping HTTP Server")
|
||||||
httpError <- err
|
|
||||||
close(httpError)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunHTTPServer will start a HTTP server on a specific IP and port
|
// RunHTTPServer will start a HTTP server on a specific IP and port
|
||||||
|
@ -54,21 +52,13 @@ func RunHTTPServer() error {
|
||||||
|
|
||||||
router = Router()
|
router = Router()
|
||||||
resetCookies()
|
resetCookies()
|
||||||
httpError = make(chan error)
|
|
||||||
|
|
||||||
if utils.Params.GetBool("LETSENCRYPT_ENABLE") {
|
if utils.Params.GetBool("LETSENCRYPT_ENABLE") {
|
||||||
go startLetsEncryptServer(ip)
|
return startLetsEncryptServer(ip)
|
||||||
} else if usingSSL {
|
} else if usingSSL {
|
||||||
go startSSLServer(ip)
|
return startSSLServer(ip)
|
||||||
} else {
|
} else {
|
||||||
go startServer(host)
|
return startServer(host)
|
||||||
}
|
|
||||||
|
|
||||||
for {
|
|
||||||
select {
|
|
||||||
case err := <-httpError:
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,12 @@ func findIncident(r *http.Request) (*incidents.Incident, int64, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func apiServiceIncidentsHandler(w http.ResponseWriter, r *http.Request) {
|
func apiServiceIncidentsHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
service, err := findService(r)
|
||||||
id := vars["id"]
|
if err != nil {
|
||||||
if utils.NotNumber(id) {
|
sendErrorJson(err, w, r)
|
||||||
sendErrorJson(errors.NotNumber, w, r)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
incids := incidents.FindByService(utils.ToInt(id))
|
returnJson(service.Incidents, w, r)
|
||||||
if incids == nil {
|
|
||||||
sendErrorJson(errors.Missing(&incidents.Incident{}, id), w, r)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
returnJson(incids, w, r)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func apiIncidentUpdatesHandler(w http.ResponseWriter, r *http.Request) {
|
func apiIncidentUpdatesHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
@ -13,9 +13,7 @@ import (
|
||||||
"github.com/statping/statping/utils"
|
"github.com/statping/statping/utils"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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.
|
// prometheusMiddleware implements mux.MiddlewareFunc.
|
||||||
func prometheusMiddleware(next http.Handler) http.Handler {
|
func prometheusMiddleware(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
@ -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.
|
// Server will use static assets if the 'assets' directory is found in the root directory.
|
||||||
func Router() *mux.Router {
|
func Router() *mux.Router {
|
||||||
dir := utils.Directory
|
dir := utils.Directory
|
||||||
CacheStorage = NewStorage()
|
|
||||||
|
|
||||||
r := mux.NewRouter().StrictSlash(true)
|
r := mux.NewRouter().StrictSlash(true)
|
||||||
r.Use(prometheusMiddleware)
|
r.Use(prometheusMiddleware)
|
||||||
|
@ -96,8 +95,6 @@ func Router() *mux.Router {
|
||||||
api.Handle("/api/login", http.HandlerFunc(apiLoginHandler)).Methods("POST")
|
api.Handle("/api/login", http.HandlerFunc(apiLoginHandler)).Methods("POST")
|
||||||
api.Handle("/api/logout", http.HandlerFunc(logoutHandler))
|
api.Handle("/api/logout", http.HandlerFunc(logoutHandler))
|
||||||
api.Handle("/api/renew", authenticated(apiRenewHandler, false))
|
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/core", authenticated(apiCoreHandler, false)).Methods("POST")
|
||||||
api.Handle("/api/logs", authenticated(logsHandler, false)).Methods("GET")
|
api.Handle("/api/logs", authenticated(logsHandler, false)).Methods("GET")
|
||||||
api.Handle("/api/logs/last", authenticated(logsLineHandler, 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.Handle("/api/services/{id}/hits", authenticated(apiServiceHitsDeleteHandler, false)).Methods("DELETE")
|
||||||
|
|
||||||
// API SERVICE CHART DATA Routes
|
// API SERVICE CHART DATA Routes
|
||||||
api.Handle("/api/services/{id}/hits_data", cached("30s", "application/json", apiServiceDataHandler)).Methods("GET")
|
api.Handle("/api/services/{id}/hits_data", http.HandlerFunc(apiServiceDataHandler)).Methods("GET")
|
||||||
api.Handle("/api/services/{id}/failure_data", cached("30s", "application/json", apiServiceFailureDataHandler)).Methods("GET")
|
api.Handle("/api/services/{id}/failure_data", http.HandlerFunc(apiServiceFailureDataHandler)).Methods("GET")
|
||||||
api.Handle("/api/services/{id}/ping_data", cached("30s", "application/json", apiServicePingDataHandler)).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.Handle("/api/services/{id}/uptime_data", http.HandlerFunc(apiServiceTimeDataHandler)).Methods("GET")
|
||||||
|
|
||||||
// API INCIDENTS Routes
|
// API INCIDENTS Routes
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func startServer(host string) {
|
func startServer(host string) error {
|
||||||
httpServer = &http.Server{
|
httpServer = &http.Server{
|
||||||
Addr: host,
|
Addr: host,
|
||||||
WriteTimeout: timeout,
|
WriteTimeout: timeout,
|
||||||
|
@ -19,9 +19,7 @@ func startServer(host string) {
|
||||||
Handler: router,
|
Handler: router,
|
||||||
}
|
}
|
||||||
httpServer.SetKeepAlivesEnabled(false)
|
httpServer.SetKeepAlivesEnabled(false)
|
||||||
if err := httpServer.ListenAndServe(); err != nil {
|
return httpServer.ListenAndServe()
|
||||||
httpError <- err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func letsEncryptCert() (*tls.Config, error) {
|
func letsEncryptCert() (*tls.Config, error) {
|
||||||
|
@ -63,14 +61,13 @@ func letsEncryptCert() (*tls.Config, error) {
|
||||||
return tlsconf, nil
|
return tlsconf, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func startLetsEncryptServer(ip string) {
|
func startLetsEncryptServer(ip string) error {
|
||||||
log.Infoln("Starting LetEncrypt redirect server on port 80")
|
log.Infoln("Starting LetEncrypt redirect server on port 80")
|
||||||
go http.ListenAndServe(":80", http.HandlerFunc(simplecert.Redirect))
|
go http.ListenAndServe(":80", http.HandlerFunc(simplecert.Redirect))
|
||||||
|
|
||||||
cfg, err := letsEncryptCert()
|
cfg, err := letsEncryptCert()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError <- err
|
return err
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
|
@ -82,12 +79,10 @@ func startLetsEncryptServer(ip string) {
|
||||||
IdleTimeout: timeout,
|
IdleTimeout: timeout,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := srv.ListenAndServeTLS("", ""); err != nil {
|
return srv.ListenAndServeTLS("", "")
|
||||||
httpError <- err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func startSSLServer(ip string) {
|
func startSSLServer(ip string) error {
|
||||||
cfg := &tls.Config{
|
cfg := &tls.Config{
|
||||||
MinVersion: tls.VersionTLS12,
|
MinVersion: tls.VersionTLS12,
|
||||||
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
|
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
|
||||||
|
@ -112,7 +107,5 @@ func startSSLServer(ip string) {
|
||||||
certFile := utils.Directory + "/server.crt"
|
certFile := utils.Directory + "/server.crt"
|
||||||
keyFile := utils.Directory + "/server.key"
|
keyFile := utils.Directory + "/server.key"
|
||||||
|
|
||||||
if err := srv.ListenAndServeTLS(certFile, keyFile); err != nil {
|
return srv.ListenAndServeTLS(certFile, keyFile)
|
||||||
httpError <- err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,6 +234,7 @@ func apiServiceTimeDataHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
sendErrorJson(err, w, r)
|
sendErrorJson(err, w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
returnJson(uptimeData, w, r)
|
returnJson(uptimeData, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,6 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
core.App.Setup = true
|
core.App.Setup = true
|
||||||
|
|
||||||
CacheStorage.Delete("/")
|
|
||||||
resetCookies()
|
resetCookies()
|
||||||
|
|
||||||
out := struct {
|
out := struct {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -42,7 +42,7 @@ func InitEnvs() {
|
||||||
Params.SetDefault("MAX_LIFE_CONN", 5*time.Minute)
|
Params.SetDefault("MAX_LIFE_CONN", 5*time.Minute)
|
||||||
Params.SetDefault("SAMPLE_DATA", true)
|
Params.SetDefault("SAMPLE_DATA", true)
|
||||||
Params.SetDefault("USE_CDN", false)
|
Params.SetDefault("USE_CDN", false)
|
||||||
Params.SetDefault("ALLOW_REPORTS", false)
|
Params.SetDefault("ALLOW_REPORTS", true)
|
||||||
Params.SetDefault("POSTGRES_SSLMODE", "disable")
|
Params.SetDefault("POSTGRES_SSLMODE", "disable")
|
||||||
Params.SetDefault("NAME", "Statping Sample Data")
|
Params.SetDefault("NAME", "Statping Sample Data")
|
||||||
Params.SetDefault("DOMAIN", "http://localhost:8080")
|
Params.SetDefault("DOMAIN", "http://localhost:8080")
|
||||||
|
|
|
@ -26,7 +26,7 @@ var (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
logFilePath = "/logs/statping.log"
|
logFilePath = "/logs/statping.log"
|
||||||
errorReporter = "https://ddf2784201134d51a20c3440e222cebe@sentry.statping.com/4"
|
errorReporter = "https://518d5b04a52b4130bbbbd5b9e70cb7ba@sentry.statping.com/2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SentryInit(allow bool) {
|
func SentryInit(allow bool) {
|
||||||
|
@ -43,6 +43,7 @@ func SentryInit(allow bool) {
|
||||||
Log.Errorln(err)
|
Log.Errorln(err)
|
||||||
}
|
}
|
||||||
Log.Infoln("Error Reporting initiated, thank you!")
|
Log.Infoln("Error Reporting initiated, thank you!")
|
||||||
|
sentry.CaptureMessage("sentry connected")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue