From 406b17c7d8b4aa26777ab93e892e342550594431 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Thu, 6 Jun 2024 20:39:38 -0400 Subject: [PATCH] break out blocklist project --- pihole_blocklist/Dockerfile | 5 ++ pihole_blocklist/README.md | 29 ++++++++ pihole_blocklist/blocklists.txt | 48 ++++++++++++ pihole_blocklist/docker-compose.yaml | 8 ++ pihole_blocklist/helm/blocklist/.helmignore | 23 ++++++ pihole_blocklist/helm/blocklist/Chart.yaml | 24 ++++++ .../helm/blocklist/templates/blocklist.yaml | 73 +++++++++++++++++++ pihole_blocklist/helm/blocklist/values.yaml | 2 + 8 files changed, 212 insertions(+) create mode 100644 pihole_blocklist/Dockerfile create mode 100644 pihole_blocklist/README.md create mode 100644 pihole_blocklist/blocklists.txt create mode 100644 pihole_blocklist/docker-compose.yaml create mode 100644 pihole_blocklist/helm/blocklist/.helmignore create mode 100644 pihole_blocklist/helm/blocklist/Chart.yaml create mode 100644 pihole_blocklist/helm/blocklist/templates/blocklist.yaml create mode 100644 pihole_blocklist/helm/blocklist/values.yaml diff --git a/pihole_blocklist/Dockerfile b/pihole_blocklist/Dockerfile new file mode 100644 index 0000000..50cd079 --- /dev/null +++ b/pihole_blocklist/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx +COPY blocklists.txt /usr/share/nginx/html +RUN for url in $(cat /usr/share/nginx/html/blocklists.txt);\ + do echo >> /usr/share/nginx/html/hosts && curl $url >> /usr/share/nginx/html/hosts;\ + done diff --git a/pihole_blocklist/README.md b/pihole_blocklist/README.md new file mode 100644 index 0000000..1fcd5a7 --- /dev/null +++ b/pihole_blocklist/README.md @@ -0,0 +1,29 @@ +# Pihole + +See `podman` for the pihole installation. This is just the blocklist. + +## Blocklists + +Add this to your pihole adlists: + + + +## Updating blocklist.reeseapps.com + +Add lists to blocklists.txt and build the project. + +Blocklists are built into an nginx image to be served with docker: + +```bash +podman-compose build +podman-compose push + +helm upgrade --install \ + --namespace pihole \ + --create-namespace \ + blocklist ./helm/blocklist +``` + +## Notes + + diff --git a/pihole_blocklist/blocklists.txt b/pihole_blocklist/blocklists.txt new file mode 100644 index 0000000..ab6cb68 --- /dev/null +++ b/pihole_blocklist/blocklists.txt @@ -0,0 +1,48 @@ +https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts +https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts.txt +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts +https://v.firebog.net/hosts/static/w3kbl.txt +https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt +https://someonewhocares.org/hosts/zero/hosts +https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts +https://winhelp2002.mvps.org/hosts.txt +https://v.firebog.net/hosts/neohostsbasic.txt +https://raw.githubusercontent.com/RooneyMcNibNug/pihole-stuff/master/SNAFU.txt +https://paulgb.github.io/BarbBlock/blacklists/hosts-file.txt +https://adaway.org/hosts.txt +https://v.firebog.net/hosts/AdguardDNS.txt +https://v.firebog.net/hosts/Admiral.txt +https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt +https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt +https://v.firebog.net/hosts/Easylist.txt +https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts +https://raw.githubusercontent.com/bigdargon/hostsVN/master/hosts +https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts +https://v.firebog.net/hosts/Easyprivacy.txt +https://v.firebog.net/hosts/Prigent-Ads.txt +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts +https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt +https://hostfiles.frogeye.fr/firstparty-trackers-hosts.txt +https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt +https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt +https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt +https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/AmazonFireTV.txt +https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt +https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt +https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt +https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt +https://v.firebog.net/hosts/Prigent-Crypto.txt +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts +https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Appendix_D.txt +https://phishing.army/download/phishing_army_blocklist_extended.txt +https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt +https://v.firebog.net/hosts/RPiList-Malware.txt +https://v.firebog.net/hosts/RPiList-Phishing.txt +https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt +https://raw.githubusercontent.com/AssoEchap/stalkerware-indicators/master/generated/hosts +https://urlhaus.abuse.ch/downloads/hostfile/ +https://malware-filter.gitlab.io/malware-filter/phishing-filter-hosts.txt +https://v.firebog.net/hosts/Prigent-Malware.txt +https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser +https://blocklistproject.github.io/Lists/everything.txt diff --git a/pihole_blocklist/docker-compose.yaml b/pihole_blocklist/docker-compose.yaml new file mode 100644 index 0000000..5398ef2 --- /dev/null +++ b/pihole_blocklist/docker-compose.yaml @@ -0,0 +1,8 @@ +version: '3' + +services: + repo: + image: ducoterra/blocklist:0.0.2 + build: . + ports: + - 8080:80 diff --git a/pihole_blocklist/helm/blocklist/.helmignore b/pihole_blocklist/helm/blocklist/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/pihole_blocklist/helm/blocklist/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/pihole_blocklist/helm/blocklist/Chart.yaml b/pihole_blocklist/helm/blocklist/Chart.yaml new file mode 100644 index 0000000..e44ea10 --- /dev/null +++ b/pihole_blocklist/helm/blocklist/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: blocklist +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/pihole_blocklist/helm/blocklist/templates/blocklist.yaml b/pihole_blocklist/helm/blocklist/templates/blocklist.yaml new file mode 100644 index 0000000..cb3d9d8 --- /dev/null +++ b/pihole_blocklist/helm/blocklist/templates/blocklist.yaml @@ -0,0 +1,73 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ .Release.Name }} + strategy: + type: Recreate + template: + metadata: + labels: + app.kubernetes.io/name: {{ .Release.Name }} + spec: + containers: + - name: nginx + image: {{ .Values.image }} + imagePullPolicy: Always + ports: + - containerPort: 80 + name: http + resources: + requests: + memory: "1Gi" + cpu: "1m" + limits: + memory: "1Gi" + cpu: "1" + +--- + +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app.kubernetes.io/name: {{ .Release.Name }} + ports: + - name: http + protocol: TCP + port: 80 + targetPort: http + +--- + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }} + annotations: + cert-manager.io/cluster-issuer: letsencrypt + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/proxy-body-size: "0" + nginx.org/client-max-body-size: "0" +spec: + rules: + - host: {{ .Values.domain }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }} + port: + name: http + tls: + - hosts: + - {{ .Values.domain }} + secretName: {{ .Release.Name }}-tls-cert diff --git a/pihole_blocklist/helm/blocklist/values.yaml b/pihole_blocklist/helm/blocklist/values.yaml new file mode 100644 index 0000000..447ddcd --- /dev/null +++ b/pihole_blocklist/helm/blocklist/values.yaml @@ -0,0 +1,2 @@ +image: ducoterra/blocklist:0.0.2 +domain: blocklist.reeseapps.com