mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
Merge pull request #15 from wickedyoda/configure_telegraf
Update update-telegraf-w-keys.sh
This commit is contained in:
4 files changed
+7
-78
No files matched your search
@@ -1,50 +0,0 @@
|
|||||||
name: Code Quality Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- '**.py'
|
|
||||||
- '**.sh'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- '**.py'
|
|
||||||
- '**.sh'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint-python:
|
|
||||||
name: Python Code Linting
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: Install Python linters
|
|
||||||
run: |
|
|
||||||
pip install black flake8
|
|
||||||
|
|
||||||
- name: Run black
|
|
||||||
run: black --check .
|
|
||||||
|
|
||||||
- name: Run flake8
|
|
||||||
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
||||||
|
|
||||||
lint-shell:
|
|
||||||
name: Shell Script Linting
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install shellcheck
|
|
||||||
run: sudo apt-get install -y shellcheck
|
|
||||||
|
|
||||||
- name: Run shellcheck
|
|
||||||
run: |
|
|
||||||
find . -type f -name "*.sh" -exec shellcheck {} +
|
|
||||||
Vendored
-10
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Vendored
-16
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"type": "markdownlint",
|
|
||||||
"problemMatcher": [
|
|
||||||
"$markdownlint"
|
|
||||||
],
|
|
||||||
"label": "markdownlint: Lint all Markdown files in the workspace with markdownlint",
|
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
"isDefault": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -7,9 +7,14 @@ TOKEN_FILE="/run/secrets/${HOSTNAME}"
|
|||||||
if [[ -r "$TOKEN_FILE" ]]; then
|
if [[ -r "$TOKEN_FILE" ]]; then
|
||||||
TOKEN="$(sudo cat "$TOKEN_FILE")"
|
TOKEN="$(sudo cat "$TOKEN_FILE")"
|
||||||
else
|
else
|
||||||
echo "[✗] Docker secret $TOKEN_FILE not found or unreadable." >&2
|
echo "[!] Docker secret $TOKEN_FILE not found or unreadable." >&2
|
||||||
|
read -rsp "Enter InfluxDB token: " TOKEN
|
||||||
|
echo
|
||||||
|
if [[ -z "$TOKEN" ]]; then
|
||||||
|
echo "[✗] No token provided. Exiting." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
BUCKET="Home_Network"
|
BUCKET="Home_Network"
|
||||||
ORG="Home Network"
|
ORG="Home Network"
|
||||||
URL="http://docker2:8086"
|
URL="http://docker2:8086"
|
||||||
@@ -41,7 +46,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[+] Checking for Docker plugin..."
|
echo "[+] Checking for Docker plugin..."
|
||||||
if ! sudo grep -q '^\s*\[\[inputs.docker\]\]' "$TELEGRAF_CONF"; then
|
if ! grep -q '^\s*\[\[inputs.docker\]\]' "$TELEGRAF_CONF"; then
|
||||||
cat <<EOF | sudo tee -a "$TELEGRAF_CONF" > /dev/null
|
cat <<EOF | sudo tee -a "$TELEGRAF_CONF" > /dev/null
|
||||||
|
|
||||||
[[inputs.docker]]
|
[[inputs.docker]]
|
||||||
|
|||||||
Reference in new issue
Block a user