Skip to content

Commit c735fa4

Browse files
committedJul 31, 2019
Initial Commit.
0 parents  commit c735fa4

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed
 

‎LICENSE

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2017 Shane Mc Cormack
2+
3+
Where no other license is explicitly given or mentioned in the file, all files
4+
in this project are licensed using the following license.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+

‎README.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# mydnshost-maintenance
2+
Maintenance Container
3+
4+
This container runs various scripts under cron to perform maintenance tasks:
5+
6+
- Every 6 Hours:
7+
- Database Backups
8+
- Bind Zone Backups
9+
- Every Hour
10+
- Update StatusCake checks
11+
- Every Minute
12+
- Gather Statistics from bind servers
13+
14+
## Backup DB
15+
16+
This will look for any container with a label of `uk.co.mydnshost.maintenance.db.backup` set to `"true"` and then will attempt to backup named databases from it.
17+
18+
Credentials for mysqldump can be passed with labels `uk.co.mydnshost.maintenance.db.user` and `uk.co.mydnshost.maintenance.db.pass` and the list of databases to dump can be passed as a comma separated string `uk.co.mydnshost.maintenance.db.dbs`
19+
20+
Backups are stored in `/output/mysqlbackup/<containername>/<date>/<database>/backup-<time>.sql`
21+
22+
The last 30 days of backups are kept.
23+
24+
## Backup Zone Files
25+
26+
This will create a backup of all files under `/bind/` into `/output/bindbackup/<date>/backup-<time>.tgz`
27+
28+
The last 30 days of backups are kept.
29+
30+
## Update StatusCake
31+
32+
This will make changes to a test domain and update StatusCake tests to look for the updated data.
33+
34+
Example ENV VARS Required:
35+
36+
- API_URL=https://api.mydnshost.co.uk/
37+
- The API Endpoint to use to make changes
38+
- API_DOMAIN=test.example.org
39+
- The domain we are using for putting tests under
40+
- API_RRNAMES=foobar,bazqux
41+
- List of RRNAMES to update. These will be updated in turn and cycled though to reduce the change of a test firing and failing between us updating the record and then updating the check.
42+
- A Records are created for each `<RRNAME>.<API_DOMAIN>` with an IP Address related to the date/time the change was made, statuscake will then be updated to point at the new `RRNAME` and the expected value.
43+
- A TXT record named `active` will also be created to remember between runs which `RRNAME` was last named.
44+
- API_DOMAINKEY=SomeKey
45+
- DomainKey to access the domain via the API.
46+
- STATUSCAKE_USER=SomeUser
47+
- StatusCake Username (If blank, this cron script will not run)
48+
- STATUSCAKE_APIKEY=SomeKey
49+
- StatusCake API
50+
- STATUSCAKE_TESTIDS=12345,67890
51+
- The TestIDs for status cake to update. There should be 1 test for each nameserver we monitor.
52+
53+
54+
## Gather Statistics
55+
56+
This will gather statistics from bind servers and put them into influx.
57+
58+
Example ENV VARS Required:
59+
60+
- INFLUX_HOST=influxdb
61+
- Server that hosts influx
62+
- INFLUX_PORT=8086
63+
- Influx Port
64+
- INFLUX_USER=
65+
- Influx Username
66+
- INFLUX_PASS=
67+
- Influx Password
68+
- INFLUX_DB=MyDNSHost
69+
- Influx Database
70+
- INFLUX_BIND_SLAVES=ns1=1.1.1.1, ns2=2.2.2.2, ns3=3.3.3.3
71+
- List of bind servers to get statistics from. This should be a comma-separated list of `<name>=<ip>` to reach the server.
72+
- We need the XML statistics API enabled on the server, and this container host needs to be allowed access it.
73+
- If this is empty, this cron script will not run.
74+
75+

0 commit comments

Comments
 (0)
Please sign in to comment.