Initial publish: fpsd-git — content-aware HTTPS interception proxy

This commit is contained in:
NJ Verenini 2026-02-16 22:29:16 -08:00
commit b87ab01b01
3 changed files with 111 additions and 0 deletions

19
.SRCINFO Normal file
View file

@ -0,0 +1,19 @@
pkgbase = fpsd-git
pkgdesc = Content-aware HTTPS interception proxy for ad blocking
pkgver = 1.1.2.r31.g8cb743b
pkgrel = 1
url = https://github.com/ushineko/face-puncher-supreme
install = fpsd.install
arch = x86_64
license = MIT
makedepends = git
makedepends = go
makedepends = npm
makedepends = nodejs
depends = glibc
provides = fpsd
conflicts = fpsd
source = face-puncher-supreme::git+https://github.com/ushineko/face-puncher-supreme.git
sha256sums = SKIP
pkgname = fpsd-git

69
PKGBUILD Normal file
View file

@ -0,0 +1,69 @@
# Maintainer: ushineko <https://github.com/ushineko>
pkgname=fpsd-git
pkgver=1.1.2.r31.g8cb743b
pkgrel=1
pkgdesc="Content-aware HTTPS interception proxy for ad blocking"
arch=('x86_64')
url="https://github.com/ushineko/face-puncher-supreme"
license=('MIT')
depends=('glibc')
makedepends=('git' 'go' 'npm' 'nodejs')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("face-puncher-supreme::git+https://github.com/ushineko/face-puncher-supreme.git")
sha256sums=('SKIP')
install=fpsd.install
pkgver() {
cd face-puncher-supreme
# Read VERSION from Makefile (single source of truth)
_ver=$(grep -oP '(?<=^VERSION := ).*' Makefile | tr -d '[:space:]')
printf "%s.r%s.g%s" "$_ver" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd face-puncher-supreme
make build
}
package() {
cd face-puncher-supreme
# Binary
install -Dm755 fpsd "${pkgdir}/usr/bin/fpsd"
# Tproxy management script
install -Dm755 scripts/fps-ctl "${pkgdir}/usr/bin/fps-ctl"
# Reference config (user copies to ~/.config/fpsd/)
install -Dm644 fpsd.yml "${pkgdir}/usr/share/doc/${pkgname}/fpsd.yml.example"
# License and documentation
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
# Systemd user service unit
install -dm755 "${pkgdir}/usr/lib/systemd/user"
cat > "${pkgdir}/usr/lib/systemd/user/fpsd.service" <<'UNIT'
[Unit]
Description=Face Puncher Supreme proxy
After=network-online.target
Wants=network-online.target
[Service]
Type=exec
ExecStart=/usr/bin/fpsd -c %h/.config/fpsd/fpsd.yml
WorkingDirectory=%h/.local/share/fpsd
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=fpsd
NoNewPrivileges=yes
ProtectSystem=strict
PrivateTmp=yes
[Install]
WantedBy=default.target
UNIT
}

23
fpsd.install Normal file
View file

@ -0,0 +1,23 @@
post_install() {
echo ":: First-time setup:"
echo ":: mkdir -p ~/.config/fpsd ~/.local/share/fpsd/logs"
echo ":: cp /usr/share/doc/fpsd-git/fpsd.yml.example ~/.config/fpsd/fpsd.yml"
echo ":: Edit ~/.config/fpsd/fpsd.yml — set data_dir to ~/.local/share/fpsd"
echo ":: Enable the service: systemctl --user enable --now fpsd"
echo ":: Generate CA for MITM: fpsd generate-ca (safe — refuses to overwrite existing CA)"
echo ":: Transparent proxy setup: sudo fps-ctl install --transparent --interface <IF>"
}
post_upgrade() {
echo ":: Restart the service: systemctl --user restart fpsd"
}
pre_remove() {
# pacman hooks run as root, so systemctl --user targets root's session.
# Use --machine to target the actual user who owns the service.
if [ -n "$SUDO_USER" ]; then
systemctl --user --machine="$SUDO_USER@" stop fpsd.service 2>/dev/null || true
systemctl --user --machine="$SUDO_USER@" disable fpsd.service 2>/dev/null || true
fi
echo ":: If fpsd is still running: systemctl --user stop fpsd"
}