commit b87ab01b016f9ee1f7a785a71c24f21326faee1b Author: NJ Verenini Date: Mon Feb 16 22:29:16 2026 -0800 Initial publish: fpsd-git — content-aware HTTPS interception proxy diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000000000..b9666d89a933d --- /dev/null +++ b/.SRCINFO @@ -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 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000000000..3bc74e973d13f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,69 @@ +# Maintainer: 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 +} diff --git a/fpsd.install b/fpsd.install new file mode 100644 index 0000000000000..49f436f0cf40e --- /dev/null +++ b/fpsd.install @@ -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 " +} + +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" +}