Blocky integration

This commit is contained in:
Brian Zalewski 2023-12-23 10:38:31 +00:00
parent 637a3e5919
commit 81e774dc83
3 changed files with 90 additions and 1 deletions

View file

@ -0,0 +1,12 @@
[Unit]
Description=Blocky service
After=network-online.target
[Service]
User=blocky
ExecStart=/usr/local/bin/blocky --config /usr/local/etc/blocky/config.yaml
Restart=on-failure
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=network-online.target

View file

@ -0,0 +1,53 @@
---
ports:
dns: 53
tls: 853
https: 443
http: 4000
log:
level: info
format: text
timestamp: true
privacy: false
upstreams:
groups:
default:
- 159.69.114.157
- 116.203.32.217
- tcp-tls:fdns1.dismail.de:853
- https://dns.digitale-gesellschaft.ch/dns-query
bootstrapDns:
- tcp+udp:1.1.1.1
- https://1.1.1.1/dns-query
blocking:
blackLists:
ads:
- https://easylist.to/easylist/easyprivacy.txt
- https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts
- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
- https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
- https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
- https://sysctl.org/cameleon/hosts
clientGroupsBlock:
default:
- ads
blockType: zeroIp
caching:
minTime: 5m
maxTime: 0
prefetching: true
prometheus:
enable: true
path: /metrics
queryLog:
type: none
specialUseDomains:
rfc6762-appendixG: true

View file

@ -823,6 +823,18 @@ softwarePackages:
- name: blocky
sudo: true
_serviceEnabled: true
_post:linux: |
#!/usr/bin/env bash
sudo mkdir -p /usr/local/etc/blocky
if [ -d /usr/lib/systemd/system ]; then
sudo cp -f "$HOME/.local/etc/blocky/config.yaml" /usr/local/etc/blocky/config.yaml
sudo cp -f "$HOME/.local/etc/blocky/blocky.service" /usr/lib/systemd/system/blocky.service
else
echo "/usr/lib/systemd/system is missing from the file system"
fi
_post:brew: |
#!/usr/bin/env bash
cp -f "$HOME/.local/etc/blocky/config.yaml" "$(brew --prefix)/etc/blocky/config.yaml"
brew: blocky
go: github.com/0xERR0R/blocky@mastergithub.com/0xERR0R/blocky@master
http-toolkit:
@ -7815,6 +7827,16 @@ softwarePackages:
logg error 'No etc location found for netdata' && exit 1
fi
logg info "Copying ${XDG_CONFIG_HOME:-$HOME/.config}/netdata/health.d/ to $NETDATA_ETC" && sudo cp -rf "${XDG_CONFIG_HOME:-$HOME/.config}/netdata/health.d/" "$NETDATA_ETC"
### Blocky
logg info "Adding Blocky metrics collection to $NETDATA_ETC/go.d/prometheus.conf"
if command -v gsed > /dev/null; then
SED_UTIL="gsed"
else
SED_UTIL="sed"
fi
sudo "$SED_UTIL" -i "/jobs:/a\ - name: blocky_local \n url: 'http://127.0.0.1:4000/metrics'" "$NETDATA_ETC/go.d/prometheus.conf"
# Backup current health alarm configuration and apply new one
if [ -d /usr/local/lib/netdata ]; then
NETDATA_LIB='/usr/local/lib/netdata'
@ -10333,7 +10355,9 @@ softwarePackages:
_name: sftpgo
_post: |
#!/usr/bin/env bash
sudo mkdir -p /usr/local/etc/sftpgo && sudo cp -f "$HOME/.local/etc/sftpgo/sftpgo.json" /usr/local/etc/sftpgo/sftpgo.json && sudo sftpgo initprovider
sudo mkdir -p /usr/local/etc/sftpgo
sudo cp -f "$HOME/.local/etc/sftpgo/sftpgo.json" /usr/local/etc/sftpgo/sftpgo.json
sudo sftpgo initprovider
_service: sftpgo
_service:brew:
- name: sftpgo