Skip to content
Permalink
Browse files

Merge branch 'master' into fix/216

  • Loading branch information
hunterlong committed Jan 13, 2020
2 parents c68e149 + 72f1889 commit 7f9e63989819dc8e68285e2a39864e5e33027471
Showing with 3,977 additions and 5,093 deletions.
  1. +2 −1 .dockerignore
  2. +5 −0 .gitattributes
  3. +2 −0 .github/FUNDING.yml
  4. +2 −1 .gitignore
  5. +34 −49 .travis.yml
  6. +4 −7 Dockerfile
  7. +0 −328 Gopkg.lock
  8. +0 −94 Gopkg.toml
  9. +74 −54 Makefile
  10. +80 −39 cmd/cli.go
  11. +3 −16 cmd/cli_test.go
  12. +62 −32 cmd/main.go
  13. +20 −15 core/checker.go
  14. +10 −10 core/checkin.go
  15. +34 −29 core/configs.go
  16. +32 −10 core/core.go
  17. +31 −31 core/core_test.go
  18. +143 −106 core/database.go
  19. +2 −3 core/export.go
  20. +9 −11 core/failures.go
  21. +2 −2 core/groups.go
  22. +1 −2 core/hits.go
  23. +3 −3 core/incidents.go
  24. +130 −0 core/integrations/csv_file.go
  25. +43 −0 core/integrations/csv_file_test.go
  26. +103 −0 core/integrations/docker.go
  27. +40 −0 core/integrations/docker_test.go
  28. +64 −0 core/integrations/integrations.go
  29. +15 −0 core/integrations/integrations_test.go
  30. +126 −0 core/integrations/traefik.go
  31. +27 −0 core/integrations/traefik_test.go
  32. +2 −3 core/messages.go
  33. +1 −1 core/notifier/audit.go
  34. +44 −3 core/notifier/events.go
  35. +14 −6 core/notifier/example_test.go
  36. +51 −37 core/notifier/notifiers.go
  37. +3 −24 core/notifier/notifiers_test.go
  38. +137 −32 core/sample.go
  39. +14 −14 core/services.go
  40. +12 −15 core/services_test.go
  41. +1 −1 core/sparklines.go
  42. +4 −4 core/users.go
  43. +120 −120 dev/COVERAGE.html
  44. +4 −7 dev/Dockerfile
  45. +1 −1 dev/README.md
  46. +21 −0 dev/docker-compose-nginx.yml
  47. +12 −0 dev/nginx.conf
  48. +0 −15 dev/test/cypress.json
  49. +0 −5 dev/test/cypress/fixtures/example.json
  50. +0 −65 dev/test/cypress/integration/0_setup.js
  51. +0 −56 dev/test/cypress/integration/assets.js
  52. +0 −41 dev/test/cypress/integration/dashboard.js
  53. +0 −115 dev/test/cypress/integration/services.js
  54. +0 −48 dev/test/cypress/integration/settings.js
  55. +0 −69 dev/test/cypress/integration/users.js
  56. +0 −34 dev/test/cypress/plugins/index.js
  57. +0 −42 dev/test/cypress/support/commands.js
  58. +0 −37 dev/test/cypress/support/index.js
  59. +0 −1,617 dev/test/package-lock.json
  60. +0 −23 dev/test/package.json
  61. +0 −5 dev/test/release.sh
  62. +0 −5 dev/test/test-docker.sh
  63. +0 −13 dev/test/test.sh
  64. +2 −2 doc.go
  65. +42 −0 go.mod
  66. +265 −0 go.sum
  67. +3 −2 handlers/api.go
  68. +17 −49 handlers/api_test.go
  69. +3 −2 handlers/cache.go
  70. +2 −3 handlers/checkin.go
  71. +5 −6 handlers/dashboard.go
  72. +4 −7 handlers/dashboard_test.go
  73. +11 −1 handlers/function.go
  74. +48 −33 handlers/handlers.go
  75. +2 −2 handlers/index.go
  76. +33 −0 handlers/integrations.go
  77. +1 −1 handlers/messages.go
  78. +2 −5 handlers/messages_test.go
  79. +45 −3 handlers/middleware.go
  80. +2 −2 handlers/notifications.go
  81. +47 −25 handlers/routes.go
  82. +11 −7 handlers/services.go
  83. +2 −5 handlers/services_test.go
  84. +72 −13 handlers/settings.go
  85. +17 −16 handlers/setup.go
  86. +3 −6 handlers/users_test.go
  87. +0 −5 heroku.yml
  88. +175 −0 install.sh
  89. +9 −19 notifiers/command.go
  90. +43 −64 notifiers/command_test.go
  91. +12 −17 notifiers/discord.go
  92. +20 −28 notifiers/discord_test.go
  93. +17 −40 notifiers/email.go
  94. +32 −40 notifiers/email_test.go
  95. +12 −16 notifiers/line_notify.go
  96. +12 −22 notifiers/mobile.go
  97. +37 −57 notifiers/mobile_test.go
  98. +5 −4 notifiers/notifiers_test.go
  99. +11 −18 notifiers/slack.go
  100. +29 −49 notifiers/slack_test.go
  101. +10 −15 notifiers/telegram.go
  102. +24 −27 notifiers/telegram_test.go
  103. +10 −15 notifiers/twilio.go
  104. +23 −28 notifiers/twilio_test.go
  105. +6 −30 notifiers/webhook.go
  106. +26 −38 notifiers/webhook_test.go
  107. +13 −12 plugin/plugin.go
  108. +2 −2 source/css/base.css
  109. +1 −1 source/generate_wiki.go
  110. +11 −3 source/js/apexcharts.min.js
  111. +1 −1 source/js/charts.js
  112. +16 −15 source/js/main.js
  113. +1 −1 source/scss/base.scss
  114. +1 −1 source/scss/mobile.scss
  115. +29 −27 source/source.go
  116. +1 −2 source/source_test.go
  117. +11 −5 source/tmpl/bulk_import.csv
  118. +2 −2 source/tmpl/dashboard.gohtml
  119. +1 −1 source/tmpl/footer.gohtml
  120. +1 −1 source/tmpl/form_checkin.gohtml
  121. +1 −5 source/tmpl/form_group.gohtml
  122. +1 −5 source/tmpl/form_incident.gohtml
  123. +32 −0 source/tmpl/form_integration.gohtml
  124. +1 −5 source/tmpl/form_message.gohtml
  125. +1 −1 source/tmpl/form_notifier.gohtml
  126. +31 −18 source/tmpl/form_service.gohtml
  127. +2 −6 source/tmpl/form_user.gohtml
  128. +5 −4 source/tmpl/head.gohtml
  129. +1 −1 source/tmpl/help.gohtml
  130. +4 −4 source/tmpl/index.gohtml
  131. +90 −0 source/tmpl/integrator.gohtml
  132. +2 −2 source/tmpl/login.gohtml
  133. +4 −4 source/tmpl/message.gohtml
  134. +9 −9 source/tmpl/messages.gohtml
  135. +17 −17 source/tmpl/nav.gohtml
  136. +501 −309 source/tmpl/postman.json
  137. +4 −4 source/tmpl/scripts.gohtml
  138. +31 −8 source/tmpl/service.gohtml
  139. +9 −0 source/tmpl/service_create.gohtml
  140. +23 −14 source/tmpl/services.gohtml
  141. +63 −28 source/tmpl/settings.gohtml
  142. +3 −3 source/tmpl/setup.gohtml
  143. +6 −6 source/tmpl/tray.gohtml
  144. +4 −4 source/tmpl/users.gohtml
  145. +3 −4 source/wiki.go
  146. +0 −384 statuper
  147. +7 −2 types/core.go
  148. +23 −0 types/integrations.go
  149. +5 −0 types/service.go
  150. +4 −4 types/time.go
  151. +18 −17 types/types.go
  152. +127 −93 utils/log.go
  153. +5 −0 utils/time.go
  154. +92 −22 utils/utils.go
  155. +34 −0 utils/utils_custom.go
  156. +3 −12 utils/utils_test.go
  157. +23 −0 utils/utils_windows.go
  158. +1 −1 version.txt
@@ -16,4 +16,5 @@ dev
!dev/demo-script.sh
!build/alpine-linux-amd64
config.yml
statup.db
*.db
tmp
@@ -0,0 +1,5 @@
*.gohtml linguist-language=golang
*.js linguist-detectable=false
*.yml linguist-detectable=false
*.json linguist-detectable=false
dev/* linguist-vendored
@@ -0,0 +1,2 @@
github: hunterlong
custom: ['https://www.buymeacoffee.com/hunterlong']
@@ -5,7 +5,7 @@ stage
parts
core/rice-box.go
config.yml
statup.db
*.db
plugins/*.so
data
build
@@ -19,6 +19,7 @@ assets
*.log
.env
logs
tmp
/dev/test/node_modules
dev/test/cypress/videos
dev/test/cypress/screenshots
@@ -1,74 +1,59 @@
os:
- linux

- linux
language: go
go: 1.12.1
go: 1.13.5
go_import_path: github.com/hunterlong/statping

cache:
directories:
- $GOPATH/pkg/dep
- ~/.npm
- ~/.cache
- $GOPATH/src/github.com/hunterlong/statping/vendor

- "~/.npm"
- "~/.cache"
- "$GOPATH/src/github.com/hunterlong/statping/tmp"
- "$GOPATH/src/github.com/hunterlong/statping/vendor"
sudo: required

services:
- docker
- postgresql
- mysql
- mongodb

- docker
- postgresql
- mysql
- mongodb
env:
global:
- PATH=/snap/bin:$PATH
- DB_HOST=localhost
- DB_USER=travis
- DB_PASS=
- DB_DATABASE=test
- GO_ENV=test
- STATPING_DIR=$GOPATH/src/github.com/hunterlong/statping

- PATH=$HOME/.local/bin:$PATH
- DB_HOST=localhost
- DB_USER=travis
- DB_PASS=
- DB_DATABASE=test
- GO_ENV=test
- STATPING_DIR=$GOPATH/src/github.com/hunterlong/statping
matrix:
allow_failures:
- go: master
- go: master
fast_finish: true

notifications:
email: true

branches:
only:
- master
- dev

before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep

- master
install:
- npm install -g sass
- npm install -g newman
- make dev-deps
- make dep
- make install

- npm install -g sass
- npm install -g newman
- pip install --user awscli
- go mod vendor
- make dev-deps
- make install
before_script:
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
- psql -c 'create database test;' -U postgres

- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
- psql -c 'create database test;' -U postgres
script:
- travis_retry make test-all
- make test-api
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then make coverage; fi

- travis_retry make test-all
- make test-api
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
make coverage; fi
after_success:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then make travis-build; fi

- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
make travis-build; fi
webhooks:
urls:
- $GITTER
- "$GITTER"
on_success: change
on_failure: always
on_start: never
@@ -1,15 +1,12 @@
FROM golang:1.12-alpine as base
FROM golang:1.13.5-alpine as base
LABEL maintainer="Hunter Long (https://github.com/hunterlong)"
ARG VERSION
ENV DEP_VERSION v0.5.0
RUN apk add --no-cache libstdc++ gcc g++ make git ca-certificates linux-headers wget curl jq libsass
RUN curl -L -s https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 -o /go/bin/dep && \
chmod +x /go/bin/dep
RUN curl -L -s https://assets.statping.com/sass -o /usr/local/bin/sass && \
chmod +x /usr/local/bin/sass
WORKDIR /go/src/github.com/hunterlong/statping
ADD Makefile Gopkg.* /go/src/github.com/hunterlong/statping/
RUN make dep && \
ADD Makefile go.mod /go/src/github.com/hunterlong/statping/
RUN go mod vendor && \
make dev-deps
ADD . /go/src/github.com/hunterlong/statping
RUN make install
@@ -31,6 +28,6 @@ WORKDIR /app
VOLUME /app
EXPOSE $PORT

HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true"
HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true"

CMD statping -port $PORT

0 comments on commit 7f9e639

Please sign in to comment.
You can’t perform that action at this time.