aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Timber <dxdt@dev.snart.me>2022-05-16 17:22:33 +0800
committerDavid Timber <dxdt@dev.snart.me>2022-05-16 17:58:25 +0800
commit38b7a8e28bc5c102c226333769ed8f2b44a8ce76 (patch)
tree21a2078849d91796804ff2bf5760eab61b5b0611 /src
parent990a7a560c98dcbaa9c9e8deb0968819b646a664 (diff)
Doc and licence ...
- Add Apache Licence Notice - Doc "boot-report" and "check-dnssec" - Change doc: upper (required)
Diffstat (limited to 'src')
-rw-r--r--src/conf/crontab2
-rw-r--r--src/conf/py-sample/sample.jsonc14
-rwxr-xr-xsrc/palhm-dnssec-check.sh20
-rwxr-xr-xsrc/palhm.py19
-rw-r--r--src/palhm/__init__.py19
-rw-r--r--src/palhm/exceptions.py19
-rw-r--r--src/palhm/mod/aws.py19
7 files changed, 104 insertions, 8 deletions
diff --git a/src/conf/crontab b/src/conf/crontab
index 35f52ce..d0eeda6 100644
--- a/src/conf/crontab
+++ b/src/conf/crontab
@@ -3,4 +3,4 @@ MAILTO="root"
# Run default task every Sunday at midnight
0 0 * * sun root /var/lib/PALHM/src/palhm.py -q run
# Check dnssec validity every hour
-# 0 * * * * root systemd-run -qP -p Nice=15 -p ProtectSystem=strict -p ReadOnlyPaths=/ -p PrivateDevices=true --wait /var/lib/PALHM/src/palhm.py -q run check-dnssec
+# 0 * * * * root systemd-run -qP -p User=palhm -p Nice=15 -p ProtectSystem=strict -p ReadOnlyPaths=/ -p PrivateDevices=true --wait /var/lib/PALHM/src/palhm.py -q run check-dnssec
diff --git a/src/conf/py-sample/sample.jsonc b/src/conf/py-sample/sample.jsonc
index 0da72a6..9aa4fa0 100644
--- a/src/conf/py-sample/sample.jsonc
+++ b/src/conf/py-sample/sample.jsonc
@@ -133,19 +133,19 @@
"path": "example.com", // Placeholder
"pipeline": [
/*
- * Check if dig can query the record with the DNSSEC
- * validation flag. Empty stdout with zero return code
- * means SERVFAIL.
- */
+ * Check if dig can query the record with the DNSSEC
+ * validation flag. Empty stdout with zero return code
+ * means SERVFAIL.
+ */
{
"type": "exec-append",
"exec-id": "dig-dnssec",
"argv": [ "ANY", "example.com" ]
},
/*
- * Trap for empty dig output grep will return non-zero if
- * dig have not produced any output
- */
+ * Trap for empty dig output grep will return non-zero if
+ * dig have not produced any output
+ */
{ "type": "exec", "exec-id": "grep-any" }
]
}
diff --git a/src/palhm-dnssec-check.sh b/src/palhm-dnssec-check.sh
index 122e51d..215b30f 100755
--- a/src/palhm-dnssec-check.sh
+++ b/src/palhm-dnssec-check.sh
@@ -3,6 +3,26 @@
# This script is a legacy. The same functionality can be implemented by setting
# up a back up task. See [conf/py-sample/sample.jsonc]
+# Copyright (c) 2022 David Timber <dxdt@dev.snart.me>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
do_query () {
# dig returns 0 upon successful reception and parse of the response message.
# All the other exit codes other than 0 will cause the script to terminate
diff --git a/src/palhm.py b/src/palhm.py
index f008736..b0ce2d4 100755
--- a/src/palhm.py
+++ b/src/palhm.py
@@ -1,4 +1,23 @@
#!/usr/bin/env python3
+# Copyright (c) 2022 David Timber <dxdt@dev.snart.me>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
import importlib
import logging
import os
diff --git a/src/palhm/__init__.py b/src/palhm/__init__.py
index 9f2ff4f..50f92ca 100644
--- a/src/palhm/__init__.py
+++ b/src/palhm/__init__.py
@@ -1,3 +1,22 @@
+# Copyright (c) 2022 David Timber <dxdt@dev.snart.me>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
import platform
import sys
import time
diff --git a/src/palhm/exceptions.py b/src/palhm/exceptions.py
index f63f2f9..e3d572a 100644
--- a/src/palhm/exceptions.py
+++ b/src/palhm/exceptions.py
@@ -1,2 +1,21 @@
+# Copyright (c) 2022 David Timber <dxdt@dev.snart.me>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
class InvalidConfigError (Exception): ...
class APIFailError (Exception): ...
diff --git a/src/palhm/mod/aws.py b/src/palhm/mod/aws.py
index 01fb8bc..dbffe3b 100644
--- a/src/palhm/mod/aws.py
+++ b/src/palhm/mod/aws.py
@@ -1,3 +1,22 @@
+# Copyright (c) 2022 David Timber <dxdt@dev.snart.me>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
from concurrent.futures import ThreadPoolExecutor, Future
from decimal import Decimal
from enum import Enum