浏览代码

Initial commit

Christopher Nethercott 3 年之前
父节点
当前提交
1135eb891a
共有 5 个文件被更改,包括 187 次插入0 次删除
  1. 5 0
      .dockerignore
  2. 34 0
      .github/workflow/docker.yml
  3. 128 0
      .gitignore
  4. 18 0
      Dockerfile
  5. 2 0
      requirements.txt

+ 5 - 0
.dockerignore

@@ -0,0 +1,5 @@
+.env
+.git
+.github
+*~
+README.md

+ 34 - 0
.github/workflow/docker.yml

@@ -0,0 +1,34 @@
+name: ci
+
+on:
+  push:
+    branches:
+      - 'master'
+
+jobs:
+  docker:
+    runs-on: ubuntu-latest
+    steps:
+      -
+        name: Checkout
+        uses: actions/checkout@v2
+      -
+        name: Set up QEMU
+        uses: docker/setup-qemu-action@v1
+      -
+        name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v1
+      -
+        name: Login to DockerHub
+        uses: docker/login-action@v1
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+      -
+        name: Build and push
+        uses: docker/build-push-action@v2
+        with:
+          context: .
+          platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
+          push: true
+          tags: chriscn/pihole-to-influxdb:latest

+ 128 - 0
.gitignore

@@ -0,0 +1,128 @@
+# VSCode Settings
+.vscode
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+pip-wheel-metadata/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+.python-version
+
+# pipenv
+#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+#   However, in case of collaboration, if having platform-specific dependencies or dependencies
+#   having no cross-platform support, pipenv may install dependencies that don't work, or not
+#   install all needed dependencies.
+#Pipfile.lock
+
+# celery beat schedule file
+celerybeat-schedule
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/

+ 18 - 0
Dockerfile

@@ -0,0 +1,18 @@
+FROM python:3.9-slim-buster
+
+LABEL maintainer="Christopher Nethercott" \
+    description="PiHole to InfluxDB data bridge"
+
+# Install Python packages
+COPY requirements.txt /
+RUN pip install -r /requirements.txt
+
+# Clean up
+RUN apt-get -q -y autoremove
+RUN apt-get -q -y clean
+RUN rm -rf /var/lib/apt/lists/*
+
+# Final setup & execution
+COPY . /app
+WORKDIR /app
+CMD ["python3", "-u", "main.py"]

+ 2 - 0
requirements.txt

@@ -0,0 +1,2 @@
+influxdb
+PiHole-api