Port 4ducky to Rust (Axum + SQLite)

Same design, layout, URLs and features as the PHP version: browse grid,
image view with AJAX comments, BBCode, likes, uploads (file, URL and
bookmarklet), quicktagger, profile, block list, inbox, invites, Hall of
Ducks, Truhe, abuse reports and the admin tools.

- Parameterized SQL, escaped templates (askama), argon2 passwords,
  server-side sessions, CSRF tokens on every write, strict script CSP
- SSRF-safe remote image fetching, magic-byte upload checks
- Self-hosted captcha replaces reCAPTCHA v1; analytics/social widgets removed
- Vanilla JS replaces jQuery and its plugins with the same DOM behaviour
- Reverse proxy support (frontend_path, trust_proxy, secure_cookies)
- Admin CLI: admin, settings, invites

See README.md for running it and the full list of changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 02:15:05 +02:00
co-authored by Claude Opus 5.5
parent 664d8c6117
commit d0f2d526df
56 changed files with 11133 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
{% include "header.html" %}
{%- if let Some(ub) = user_block %}
<div style="margin-left: 5px; width: 95%;">
<div style="font-size: 20px; margin-bottom: 5px; font-weight: bold;">
<a style="{{ ub.style }}" href="/user/{{ ub.name_enc }}">{{ ub.name }}</a> {{ ub.rank|safe }} {% if let Some(w) = ub.website %}- <a href="{{ w }}" target="_blank">www</a> -{% endif %}
</div>
<div style="max-width: 35em; float: left;"><img alt="{{ ub.name }}" src="/{{ ub.avatar }}"/></div>
<div id="userstats"><a href="/inbox/{{ ub.name_enc }}"><img alt="mailme" src="/media/{% if l.white %}mailme_fb.png{% else %}mailme.png{% endif %}" width="64px" height="64px"/></a></div>
<div id="userstats"><div>{{ ub.id }}</div>ID</div>
<div id="userstats"><div>{{ ub.days }}</div>Days past</div>
<div id="userstats"><div>{{ ub.images }}</div>Uploads</div>
<div id="userstats"><div>{{ ub.comments }}</div>Comments</div>
<div id="userstats"><div>{{ ub.favs }}</div>Favs</div>
</div>
{%- endif %}
<div style="clear:both;"></div>
<h1>
&raquo; Browsing
{%- if let Some(ub) = user_block %}
User: <a href="/user/{{ ub.name_enc }}">{{ ub.name }}</a>
{%- else if kind == "search" %}
Results for {{ term }},
{%- else if kind == "comments" %}
Comments ,
{%- else if kind == "favorites" %}
favorites ,
{%- else %}
All,
{%- endif %}
Page: {{ page_current }} of {{ page_total }}
{%- if kind == "comments" %}
| <strong><a href="/comments/reset?t={{ l.csrf }}">&#187; reset unread</a></strong>
{%- if unread_new > 0 %}
| <a href="/unread">&#187; newest comments ({{ unread_new }})</a> | <a href="/comments">&#187; Comments</a>
{%- endif %}
{%- endif %}
</h1>
<div id="images" style="height:{{ height }}px">
{%- if let Some(p) = prev_href %}
<a href="{{ p }}" class="prev" title="Previous" id="prevBar">Previous</a>
{%- else %}
<div class="noPrev" id="prevBar">Previous</div>
{%- endif %}
{%- if let Some(n) = next_href %}
<a href="{{ n }}" class="next" title="Next" id="nextBar">Next</a>
{%- else %}
<div class="noNext" id="nextBar">Next</div>
{%- endif %}
<noscript>
<div class="noscr">Please enable Javascript.</div>
</noscript>
<div id="imageGrid" style="height:{{ height }}px">
{%- for t in items %}
<div class="{{ t.class }}" style="left:{{ t.left }}px;top:{{ t.top }}px;">{% if t.alert %}<div class="inboxalert" style="padding:3px;" >!</div>{% endif %}<a {% if t.alert %}style="background-color:#96b2e4;" {% endif %}class="thumb" href="{{ t.href }}">{% if t.alert %}<div class="overlay"></div>{% endif %}<img src="{{ t.src }}" title="{{ t.title }}" alt="{{ t.alt }}"/></a></div>
{%- endfor %}
</div>
</div>
{% include "footer.html" %}