Skip to content

Commit

Permalink
Merge branch 'develop' for release 1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesoff committed Jun 11, 2023
2 parents 57c54b5 + fd6a589 commit f5660ba
Show file tree
Hide file tree
Showing 106 changed files with 4,849 additions and 2,022 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [jamesoff]
42 changes: 42 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "CodeQL"

on:
push:
branches: [ "develop", "main" ]
pull_request:
branches: [ "develop" ]
schedule:
- cron: "47 18 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript, python ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
if: ${{ matrix.language == 'javascript' || matrix.language == 'python' }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Prepare ini files
run: cp tests/monitor-docker.ini monitor.ini; cp tests/monitors-docker.ini monitors.ini
- name: Build standalone container
Expand All @@ -16,7 +16,7 @@ jobs:
docker-compose:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Prepare ini files
run: cp tests/monitor-docker.ini monitor.ini; cp tests/monitors-docker.ini monitors.ini
- name: Build docker-compose environment
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
name: Python ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
name: Python ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Update pip
run: pip install --upgrade pip
- name: Install poetry
run: pip install poetry==1.1.4
run: pip install poetry
- name: poetry install
run: poetry install
- name: Integration tests
Expand All @@ -40,4 +40,4 @@ jobs:
run: make network-test
- name: Output coverage report
run: poetry run coverage xml -i
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
14 changes: 7 additions & 7 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
name: Python ${{ matrix.python-version }} (Windows)

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Check pip
run: pip --version
run: python -m pip --version
- name: Update pip
run: pip install --user --upgrade pip
run: python -m pip install --user --upgrade pip
- name: Install poetry
run: pip install poetry==1.1.4
run: pip install poetry
- name: poetry install
run: poetry install
- name: create HTML output folder
Expand All @@ -34,4 +34,4 @@ jobs:
run: make integration-tests-threaded
- name: Unit tests
run: make unit-test
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ docs/_build
*.log
.tox
pyrightconfig.json
simplemonitor/html/node_modules
19 changes: 14 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@ repos:
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: |
(?x)^(
simplemonitor/html/dist/.*bundle.js
)$
- id: trailing-whitespace
exclude: tests/test_alerter.py
exclude: |
(?x)^(
tests/test_alerter.py|
tests/html/.*
)$
- id: flake8
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21 # pick the isort version you'd like to use from https://github.com/pre-commit/mirrors-isort/releases
rev: v5.9.2 # pick the isort version you'd like to use from https://github.com/pre-commit/mirrors-isort/releases
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
rev: v0.910
hooks:
- id: mypy
args: ["--install-types", "--non-interactive"]
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.2
3.10.1
16 changes: 16 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
1.12:
* Require Python 3.7+
* Add allow_redirects option for HTTP monitor
* Add port option for DNS monitor
* Improve reliability of network logging thread
* Fix display of 60 seconds up/downtime as "1:00" instead of "0:60"
* Add heartbeat option to Loggers
* Add downtime to monitor recovery message
* Add nextcloud alerter
* Add support for Ring camera
* Improve logic for OOH alerting
* Improve compound monitor alert/failure calculation
* Remove PyOpenSSL and use native SSL support
* Improve efficiency for copying HTML files around
* Fix double-call to record_fail in unix service monitor

1.11:
* Run monitors multithreaded
* Add TLS certificate expiry monitor
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
BrainDoctor
Bruno
Charlie
Christian
Daniele
Ed
Erwin
Fabian
Fred
FvDxxx
G
Expand All @@ -12,6 +14,8 @@ James
Jamie
Joe
John
Kirk
LGTM
MattK
Michał
Paolo
Expand All @@ -20,6 +24,7 @@ Ryan
Sara
Scott
Sebastian
Simeon
Tim
User
Valentin
Expand All @@ -31,6 +36,7 @@ dan
danieldh206
error454
graham
kz159
nvnwater
pheuzoune
r4r3
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env-test:
env TEST_VALUE=myenv poetry run coverage run --append monitor.py -t -f tests/monitor-env.ini

unit-test:
poetry run pytest --cov-append --cov=simplemonitor tests
poetry run pytest --cov-append --cov=simplemonitor --cov-report= tests

network-test:
rm -f master.log
Expand Down Expand Up @@ -61,3 +61,9 @@ docker-build:

docker-compose-build:
docker-compose build

html-bundle:
cd simplemonitor/html && npx webpack

fix-html-tests:
for i in tests/html/*.html; do sed -i -E -e 's/1.12.0\+dev/__VERSION__/g' "$i"; done
11 changes: 11 additions & 0 deletions docs/alerters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ These options are common to all alerter types.

fire this alerter (for a failed monitor) every iteration

.. confval:: urgent

:type: boolean
:required: false

if the alerter should be urgent or not. The default varies from alerter to
alerter. Typically, those which send "page" style alerts such as SMS default
to urgent. You can use this option to override that in e.g. the case of the
SNS alerter, which could be urgent if sending SMSes, but non-urgent if
sending emails.

Time restrictions
-----------------

Expand Down
8 changes: 8 additions & 0 deletions docs/alerters/46elks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ You will need to register for an account at 46elks_.
:default: ``api.46elks.com``

API endpoint to use

.. confval:: timeout

:type: int
:required: false
:default: ``5``

Timeout for HTTP request
8 changes: 8 additions & 0 deletions docs/alerters/bulksms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ bulksms - SMS via BulkSMS
:required: true

the number to send the SMS to. Specify using country code and number, with no ``+`` or international prefix. For example, ``447777123456`` for a UK mobile.

.. confval:: timeout

:type: int
:required: false
:default: ``5``

Timeout for HTTP request
44 changes: 44 additions & 0 deletions docs/alerters/nextcloud.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
nextcloud_notification - notifications
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. include:: ../creds-warning.rst

Send a notification to a Nextcloud_ server.

.. _nextcloud: https://nextcloud.com/

.. confval:: token

:type: string
:required: true

your nextcloud token

.. confval:: user

:type: string
:required: true

the admin user name

.. confval:: server

:type: string
:required: true

the nextcloud server

.. confval:: server

:type: string
:required: true

the user id who should receive the notification

.. confval:: timeout

:type: int
:required: false
:default: ``5``

Timeout for HTTP request
8 changes: 8 additions & 0 deletions docs/alerters/pushbullet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ You will need to be registered at pushbullet_.
:required: true

your pushbullet token

.. confval:: timeout

:type: int
:required: false
:default: ``5``

Timeout for HTTP request
12 changes: 10 additions & 2 deletions docs/alerters/pushover.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ You will need to be registered at pushover_.
:type: string
:required: true

your pushover username
your pushover user key

.. confval:: token

:type: string
:required: true

your pushover token
your pushover app token

.. confval:: timeout

:type: int
:required: false
:default: ``5``

Timeout for HTTP request
Loading

0 comments on commit f5660ba

Please sign in to comment.