Add Unraid template, icon and privilege-dropping entrypoint
Build and deploy / build (push) Successful in 1m32s
Build and deploy / deploy (push) Successful in 22s
Release / image (push) Successful in 1m57s
Release / release (push) Successful in 7s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
TomandClaude Opus 5.5 committed 2026-11-14 17:35:46 +01:00
1 parent 0984af25bc
commit 4168e9990b
8 files changed
+102 -1

No files matched your search

+2
View File
@@ -7,3 +7,5 @@
.idea/ .idea/
test/ test/
.gitea/ .gitea/
unraid/
deploy/
+2
View File
@@ -29,6 +29,8 @@ First release.
- Daily retention cleanup (90 days by default), `/health` endpoint, Docker image running as - Daily retention cleanup (90 days by default), `/health` endpoint, Docker image running as
non-root with all data under `/data`. non-root with all data under `/data`.
- Public images for `linux/amd64` and `linux/arm64` in the Gitea registry. - Public images for `linux/amd64` and `linux/arm64` in the Gitea registry.
- Unraid Docker template; when started as root, the container hands `/data` to its app user
and drops privileges.
[Unreleased]: https://gitea.anticarnist.de/Tom/Flypaper/compare/v0.1.0...main [Unreleased]: https://gitea.anticarnist.de/Tom/Flypaper/compare/v0.1.0...main
[0.1.0]: https://gitea.anticarnist.de/Tom/Flypaper/releases/tag/v0.1.0 [0.1.0]: https://gitea.anticarnist.de/Tom/Flypaper/releases/tag/v0.1.0
+2 -1
View File
@@ -35,9 +35,10 @@ ENV ASPNETCORE_HTTP_PORTS= \
COPY --from=build --chown=1654:1654 /data /data COPY --from=build --chown=1654:1654 /data /data
COPY --from=build /app . COPY --from=build /app .
COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/flypaper-entrypoint
USER $APP_UID USER $APP_UID
EXPOSE 8080 8081 EXPOSE 8080 8081
VOLUME /data VOLUME /data
ENTRYPOINT ["dotnet", "Flypaper.Web.dll"] ENTRYPOINT ["flypaper-entrypoint"]
+34
View File
@@ -106,6 +106,40 @@ The files in [`deploy/unraid/`](deploy/unraid) and `.gitea/workflows/deploy.yml`
author's personal deployment (Gitea Actions to Unraid). They are an example only and not author's personal deployment (Gitea Actions to Unraid). They are an example only and not
needed to run Flypaper. needed to run Flypaper.
## Unraid
[`unraid/flypaper.xml`](unraid/flypaper.xml) is a Docker template for Unraid. It sets up both
ports, the appdata folder `/mnt/user/appdata/flypaper` and the optional variables (under
*Show more settings*).
1. Copy the template to the flash drive, in the Unraid terminal:
```bash
wget -O /boot/config/plugins/dockerMan/templates-user/my-Flypaper.xml \
https://gitea.anticarnist.de/Tom/Flypaper/raw/branch/main/unraid/flypaper.xml
```
2. **Docker → Add Container**, pick *Flypaper* under the user templates, choose free host ports
(8080 is often taken on Unraid) and **Apply**.
3. Open the WebUI (the dashboard port) and set the admin password.
Unraid can also read templates from a *template repository* (Docker tab, Advanced View), but
that feature is built around GitHub repositories and may not accept this Gitea URL; the manual
copy above always works.
The template starts the container as root (`--user 0:0`) only so it can hand the appdata folder
to its app user; Flypaper then drops to UID 1654 for good. Without it, a freshly created appdata
folder belongs to root and the database cannot be created.
**Connecting Nginx Proxy Manager:** follow the [NPM section](#nginx-proxy-manager) below. If NPM
runs in a user-defined Docker network (e.g. `proxynet`), put Flypaper into the same network
(*Network Type* in the template) and use `http://Flypaper:8080` as the target. If NPM can't
share a network with it, forward to `http://<unraid-ip>:<trap-port>` instead. Either way the
request comes from a private address, which Flypaper trusts by default.
The template is not part of the official Community Applications yet; that needs a separate
submission.
## Versions and updates ## Versions and updates
Flypaper follows [Semantic Versioning](https://semver.org); every release is listed in Flypaper follows [Semantic Versioning](https://semver.org); every release is listed in
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
set -e
# Started as root (e.g. by the Unraid template): hand /data to the app user, which a
# freshly created host folder is not, then drop privileges for good.
if [ "$(id -u)" = "0" ]; then
chown -R "$APP_UID:$APP_UID" /data
exec setpriv --reuid="$APP_UID" --regid="$APP_UID" --clear-groups dotnet /app/Flypaper.Web.dll "$@"
fi
exec dotnet /app/Flypaper.Web.dll "$@"
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+19
View File
@@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256">
<title>Flypaper</title>
<rect width="256" height="256" rx="48" fill="#14171c"/>
<path d="M-38.4,153.1 L290.2,83.3 L303.6,145.9 L-25.1,215.7 Z" fill="#e09a4f"/>
<path d="M-38.4,153.1 L290.2,83.3 L291.5,89.2 L-37.2,159.0 Z" fill="#b5651d"/>
<path d="M-26.3,209.9 L302.3,140.0 L303.6,145.9 L-25.1,215.7 Z" fill="#b5651d"/>
<line x1="116" y1="150" x2="90" y2="168" stroke="#0e1014" stroke-width="6" stroke-linecap="round"/>
<line x1="114" y1="162" x2="88" y2="186" stroke="#0e1014" stroke-width="6" stroke-linecap="round"/>
<line x1="118" y1="172" x2="98" y2="200" stroke="#0e1014" stroke-width="6" stroke-linecap="round"/>
<line x1="140" y1="150" x2="166" y2="168" stroke="#0e1014" stroke-width="6" stroke-linecap="round"/>
<line x1="142" y1="162" x2="168" y2="186" stroke="#0e1014" stroke-width="6" stroke-linecap="round"/>
<line x1="138" y1="172" x2="158" y2="200" stroke="#0e1014" stroke-width="6" stroke-linecap="round"/>
<path d="M135.1,94.2 L135.9,95.5 L136.3,97.0 L136.6,98.6 L136.6,100.3 L136.3,102.1 L135.8,104.1 L135.1,106.1 L134.1,108.3 L132.9,110.4 L131.5,112.7 L129.8,114.9 L128.0,117.2 L126.0,119.4 L123.8,121.6 L121.5,123.8 L119.0,125.9 L116.4,128.0 L113.8,129.9 L111.0,131.8 L108.2,133.5 L105.4,135.1 L102.5,136.5 L99.7,137.8 L96.9,139.0 L94.1,139.9 L91.5,140.7 L88.9,141.3 L86.4,141.6 L84.1,141.8 L81.9,141.8 L79.9,141.6 L78.1,141.2 L76.5,140.7 L75.0,139.9 L73.8,138.9 L72.9,137.8 L72.1,136.5 L71.7,135.0 L71.4,133.4 L71.4,131.7 L71.7,129.9 L72.2,127.9 L72.9,125.9 L73.9,123.7 L75.1,121.6 L76.5,119.3 L78.2,117.1 L80.0,114.8 L82.0,112.6 L84.2,110.4 L86.5,108.2 L89.0,106.1 L91.6,104.0 L94.2,102.1 L97.0,100.2 L99.8,98.5 L102.6,96.9 L105.5,95.5 L108.3,94.2 L111.1,93.0 L113.9,92.1 L116.5,91.3 L119.1,90.7 L121.6,90.4 L123.9,90.2 L126.1,90.2 L128.1,90.4 L129.9,90.8 L131.5,91.3 L133.0,92.1 L134.2,93.1 Z" fill="#e4e7ec" fill-opacity="0.6" stroke="#e4e7ec" stroke-width="2"/>
<path d="M183.1,137.8 L182.2,138.9 L181.0,139.9 L179.5,140.7 L177.9,141.2 L176.1,141.6 L174.1,141.8 L171.9,141.8 L169.6,141.6 L167.1,141.3 L164.5,140.7 L161.9,139.9 L159.1,139.0 L156.3,137.8 L153.5,136.5 L150.6,135.1 L147.8,133.5 L145.0,131.8 L142.2,129.9 L139.6,128.0 L137.0,125.9 L134.5,123.8 L132.2,121.6 L130.0,119.4 L128.0,117.2 L126.2,114.9 L124.5,112.7 L123.1,110.4 L121.9,108.3 L120.9,106.1 L120.2,104.1 L119.7,102.1 L119.4,100.3 L119.4,98.6 L119.7,97.0 L120.1,95.5 L120.9,94.2 L121.8,93.1 L123.0,92.1 L124.5,91.3 L126.1,90.8 L127.9,90.4 L129.9,90.2 L132.1,90.2 L134.4,90.4 L136.9,90.7 L139.5,91.3 L142.1,92.1 L144.9,93.0 L147.7,94.2 L150.5,95.5 L153.4,96.9 L156.2,98.5 L159.0,100.2 L161.8,102.1 L164.4,104.0 L167.0,106.1 L169.5,108.2 L171.8,110.4 L174.0,112.6 L176.0,114.8 L177.8,117.1 L179.5,119.3 L180.9,121.6 L182.1,123.7 L183.1,125.9 L183.8,127.9 L184.3,129.9 L184.6,131.7 L184.6,133.4 L184.3,135.0 L183.9,136.5 Z" fill="#e4e7ec" fill-opacity="0.6" stroke="#e4e7ec" stroke-width="2"/>
<path d="M148.0,152.0 L147.9,155.1 L147.7,158.3 L147.3,161.3 L146.8,164.3 L146.1,167.2 L145.3,170.0 L144.4,172.6 L143.3,175.1 L142.1,177.5 L140.9,179.6 L139.5,181.5 L138.0,183.2 L136.5,184.6 L134.8,185.8 L133.2,186.8 L131.5,187.5 L129.7,187.9 L128.0,188.0 L126.3,187.9 L124.5,187.5 L122.8,186.8 L121.2,185.8 L119.5,184.6 L118.0,183.2 L116.5,181.5 L115.1,179.6 L113.9,177.5 L112.7,175.1 L111.6,172.6 L110.7,170.0 L109.9,167.2 L109.2,164.3 L108.7,161.3 L108.3,158.3 L108.1,155.1 L108.0,152.0 L108.1,148.9 L108.3,145.7 L108.7,142.7 L109.2,139.7 L109.9,136.8 L110.7,134.0 L111.6,131.4 L112.7,128.9 L113.9,126.5 L115.1,124.4 L116.5,122.5 L118.0,120.8 L119.5,119.4 L121.2,118.2 L122.8,117.2 L124.5,116.5 L126.3,116.1 L128.0,116.0 L129.7,116.1 L131.5,116.5 L133.2,117.2 L134.8,118.2 L136.5,119.4 L138.0,120.8 L139.5,122.5 L140.9,124.4 L142.1,126.5 L143.3,128.9 L144.4,131.4 L145.3,134.0 L146.1,136.8 L146.8,139.7 L147.3,142.7 L147.7,145.7 L147.9,148.9 Z" fill="#2a2f38"/>
<path d="M145.0,108.0 L144.9,109.3 L144.7,110.6 L144.4,111.9 L144.0,113.1 L143.4,114.3 L142.7,115.5 L141.9,116.6 L141.0,117.6 L140.0,118.6 L138.9,119.5 L137.8,120.3 L136.5,121.0 L135.2,121.6 L133.8,122.1 L132.4,122.5 L131.0,122.8 L129.5,122.9 L128.0,123.0 L126.5,122.9 L125.0,122.8 L123.6,122.5 L122.2,122.1 L120.8,121.6 L119.5,121.0 L118.2,120.3 L117.1,119.5 L116.0,118.6 L115.0,117.6 L114.1,116.6 L113.3,115.5 L112.6,114.3 L112.0,113.1 L111.6,111.9 L111.3,110.6 L111.1,109.3 L111.0,108.0 L111.1,106.7 L111.3,105.4 L111.6,104.1 L112.0,102.9 L112.6,101.7 L113.3,100.5 L114.1,99.4 L115.0,98.4 L116.0,97.4 L117.1,96.5 L118.2,95.7 L119.5,95.0 L120.8,94.4 L122.2,93.9 L123.6,93.5 L125.0,93.2 L126.5,93.1 L128.0,93.0 L129.5,93.1 L131.0,93.2 L132.4,93.5 L133.8,93.9 L135.2,94.4 L136.5,95.0 L137.8,95.7 L138.9,96.5 L140.0,97.4 L141.0,98.4 L141.9,99.4 L142.7,100.5 L143.4,101.7 L144.0,102.9 L144.4,104.1 L144.7,105.4 L144.9,106.7 Z" fill="#2a2f38"/>
<path d="M125.0,103.0 L125.0,103.7 L124.9,104.4 L124.8,105.1 L124.6,105.7 L124.3,106.4 L124.1,107.0 L123.7,107.6 L123.4,108.1 L122.9,108.7 L122.5,109.1 L122.0,109.6 L121.5,109.9 L121.0,110.3 L120.4,110.5 L119.8,110.7 L119.2,110.9 L118.6,111.0 L118.0,111.0 L117.4,111.0 L116.8,110.9 L116.2,110.7 L115.6,110.5 L115.0,110.3 L114.5,109.9 L114.0,109.6 L113.5,109.1 L113.1,108.7 L112.6,108.1 L112.3,107.6 L111.9,107.0 L111.7,106.4 L111.4,105.7 L111.2,105.1 L111.1,104.4 L111.0,103.7 L111.0,103.0 L111.0,102.3 L111.1,101.6 L111.2,100.9 L111.4,100.3 L111.7,99.6 L111.9,99.0 L112.3,98.4 L112.6,97.9 L113.1,97.3 L113.5,96.9 L114.0,96.4 L114.5,96.1 L115.0,95.7 L115.6,95.5 L116.2,95.3 L116.8,95.1 L117.4,95.0 L118.0,95.0 L118.6,95.0 L119.2,95.1 L119.8,95.3 L120.4,95.5 L121.0,95.7 L121.5,96.1 L122.0,96.4 L122.5,96.9 L122.9,97.3 L123.4,97.9 L123.7,98.4 L124.1,99.0 L124.3,99.6 L124.6,100.3 L124.8,100.9 L124.9,101.6 L125.0,102.3 Z" fill="#b3261e"/>
<path d="M145.0,103.0 L145.0,103.7 L144.9,104.4 L144.8,105.1 L144.6,105.7 L144.3,106.4 L144.1,107.0 L143.7,107.6 L143.4,108.1 L142.9,108.7 L142.5,109.1 L142.0,109.6 L141.5,109.9 L141.0,110.3 L140.4,110.5 L139.8,110.7 L139.2,110.9 L138.6,111.0 L138.0,111.0 L137.4,111.0 L136.8,110.9 L136.2,110.7 L135.6,110.5 L135.0,110.3 L134.5,109.9 L134.0,109.6 L133.5,109.1 L133.1,108.7 L132.6,108.1 L132.3,107.6 L131.9,107.0 L131.7,106.4 L131.4,105.7 L131.2,105.1 L131.1,104.4 L131.0,103.7 L131.0,103.0 L131.0,102.3 L131.1,101.6 L131.2,100.9 L131.4,100.3 L131.7,99.6 L131.9,99.0 L132.3,98.4 L132.6,97.9 L133.1,97.3 L133.5,96.9 L134.0,96.4 L134.5,96.1 L135.0,95.7 L135.6,95.5 L136.2,95.3 L136.8,95.1 L137.4,95.0 L138.0,95.0 L138.6,95.0 L139.2,95.1 L139.8,95.3 L140.4,95.5 L141.0,95.7 L141.5,96.1 L142.0,96.4 L142.5,96.9 L142.9,97.3 L143.4,97.9 L143.7,98.4 L144.1,99.0 L144.3,99.6 L144.6,100.3 L144.8,100.9 L144.9,101.6 L145.0,102.3 Z" fill="#b3261e"/>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<Container version="2">
<Name>Flypaper</Name>
<Repository>gitea.anticarnist.de/tom/flypaper:latest</Repository>
<Registry>https://gitea.anticarnist.de/Tom/-/packages/container/flypaper</Registry>
<Network>bridge</Network>
<MyIP/>
<Shell>bash</Shell>
<Privileged>false</Privileged>
<Support>https://gitea.anticarnist.de/Tom/Flypaper/issues</Support>
<Project>https://gitea.anticarnist.de/Tom/Flypaper</Project>
<Overview>Self-hosted tarpit that traps and slows down scanning bots, with event logging and analysis. Instead of blocking bots, Flypaper answers them with an endless HTML page that trickles in a few bytes at a time, and logs every catch with its country and network provider.[br][br]
The trap port receives everything your reverse proxy has no site for (its catch-all / default server) and, optionally, bait paths such as /.env from your real domains. The dashboard has its own port: keep it inside your LAN. On first visit you set the admin password.[br][br]
The container starts as root only to hand the appdata folder to its app user (UID 1654), then drops privileges for good.</Overview>
<Category>Security: Network:Proxy</Category>
<WebUI>http://[IP]:[PORT:8081]/</WebUI>
<TemplateURL>https://gitea.anticarnist.de/Tom/Flypaper/raw/branch/main/unraid/flypaper.xml</TemplateURL>
<Icon>https://gitea.anticarnist.de/Tom/Flypaper/raw/branch/main/unraid/flypaper.png</Icon>
<ExtraParams>--user 0:0</ExtraParams>
<PostArgs/>
<CPUset/>
<DateInstalled/>
<DonateText/>
<DonateLink/>
<Requires/>
<Config Name="Trap port" Target="8080" Default="8080" Mode="tcp" Description="Point your reverse proxy's catch-all / default server here. Every request on this port is trapped." Type="Port" Display="always" Required="true" Mask="false">8080</Config>
<Config Name="Dashboard port" Target="8081" Default="8081" Mode="tcp" Description="Dashboard and settings. Keep this port inside your LAN and never forward it from your public proxy." Type="Port" Display="always" Required="true" Mask="false">8081</Config>
<Config Name="Data" Target="/data" Default="/mnt/user/appdata/flypaper" Mode="rw" Description="Database, login keys and GeoIP databases." Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/flypaper</Config>
<Config Name="Admin password" Target="Flypaper__Admin__Password" Default="" Mode="" Description="Optional. Fixes the dashboard password and disables the first-visit setup. Leave empty to set it in the dashboard." Type="Variable" Display="advanced" Required="false" Mask="true"/>
<Config Name="Trusted proxy" Target="Flypaper__Http__TrustedProxies__0" Default="" Mode="" Description="Optional. IP or CIDR of the reverse proxy allowed to set X-Real-IP / X-Forwarded-For. Default: all private networks." Type="Variable" Display="advanced" Required="false" Mask="false"/>
<Config Name="Known host" Target="Flypaper__Http__KnownHosts__0" Default="" Mode="" Description="Optional. A host that is caught only on trap paths; its other paths get a plain 404." Type="Variable" Display="advanced" Required="false" Mask="false"/>
</Container>