{"id":485,"date":"2026-07-24T07:00:11","date_gmt":"2026-07-23T23:00:11","guid":{"rendered":"http:\/\/www.tantan.ink\/index.php\/2026\/07\/24\/%e8%87%aa%e6%89%98%e7%ae%a1%e6%9c%8d%e5%8a%a1%e4%b8%80%e5%a4%9a%ef%bc%8c%e5%85%88%e7%bb%99%e5%ae%83%e4%bb%ac%e5%8a%a0%e4%b8%aa%e7%bb%9f%e4%b8%80%e7%99%bb%e5%bd%95%e9%97%a8%ef%bc%9atinyauth-%e9%83%a8\/"},"modified":"2026-07-24T07:00:11","modified_gmt":"2026-07-23T23:00:11","slug":"%e8%87%aa%e6%89%98%e7%ae%a1%e6%9c%8d%e5%8a%a1%e4%b8%80%e5%a4%9a%ef%bc%8c%e5%85%88%e7%bb%99%e5%ae%83%e4%bb%ac%e5%8a%a0%e4%b8%aa%e7%bb%9f%e4%b8%80%e7%99%bb%e5%bd%95%e9%97%a8%ef%bc%9atinyauth-%e9%83%a8","status":"publish","type":"post","link":"https:\/\/www.tantan.ink\/index.php\/2026\/07\/24\/%e8%87%aa%e6%89%98%e7%ae%a1%e6%9c%8d%e5%8a%a1%e4%b8%80%e5%a4%9a%ef%bc%8c%e5%85%88%e7%bb%99%e5%ae%83%e4%bb%ac%e5%8a%a0%e4%b8%aa%e7%bb%9f%e4%b8%80%e7%99%bb%e5%bd%95%e9%97%a8%ef%bc%9atinyauth-%e9%83%a8\/","title":{"rendered":"\u81ea\u6258\u7ba1\u670d\u52a1\u4e00\u591a\uff0c\u5148\u7ed9\u5b83\u4eec\u52a0\u4e2a\u7edf\u4e00\u767b\u5f55\u95e8\uff1atinyauth \u90e8\u7f72\u5c0f\u8bb0"},"content":{"rendered":"<p>\u5bb6\u91cc\u81ea\u6258\u7ba1\u7684\u670d\u52a1\u4e00\u591a\uff0c\u6d4f\u89c8\u5668\u6807\u7b7e\u9875\u5c31\u5f00\u59cb\u6392\u961f\uff1a\u5a92\u4f53\u5e93\u3001\u4e0b\u8f7d\u5668\u3001\u76d1\u63a7\u9762\u677f\u3001RSS\u3001\u7b14\u8bb0\u5de5\u5177\u2026\u2026\u6bcf\u4e2a\u90fd\u5404\u81ea\u4e3a\u653f\uff0c\u6709\u7684\u81ea\u5e26\u767b\u5f55\uff0c\u6709\u7684\u5e72\u8106\u6ca1\u6709\u3002\u6211\u4e4b\u524d\u4e00\u76f4\u9760\u4e00\u5c42\u53cd\u4ee3\u548c\u79c1\u4e0b\u8bb0\u5bc6\u7801\u51d1\u5408\uff0c\u4f46\u628a\u5165\u53e3\u76f4\u63a5\u66b4\u9732\u7ed9\u516c\u7f51\u603b\u6709\u4e9b\u5fc3\u865a\u3002Authelia\u3001Authentik \u90fd\u770b\u8fc7\uff0c\u914d\u7f6e\u539a\u5f97\u50cf\u4e00\u672c\u624b\u518c\uff0c\u5149\u662f LDAP \u90a3\u4e00\u5957\u5c31\u628a\u4eba\u529d\u9000\u3002\u6700\u8fd1\u7ffb\u5230 tinyauth\uff0c\u53f7\u79f0\u662f\u201c\u6700\u5c0f\u7684 OpenID Certified \u8ba4\u8bc1\u670d\u52a1\u5668\u201d\uff0cGo \u5355\u4e8c\u8fdb\u5236\u3001Docker \u4e00\u884c\u8d77\uff0c\u6b63\u597d\u7ed9 homelab \u52a0\u4e00\u9053\u8f7b\u91cf\u95e8\u3002<\/p>\n<h2>\u5b83\u662f\u4ec0\u4e48<\/h2>\n<p>tinyauth \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u8ba4\u8bc1\/\u6388\u6743\u4e2d\u95f4\u4ef6\uff0cGo \u5199\u6210\uff0c\u5355\u4e8c\u8fdb\u5236\u3001\u65e0\u4f9d\u8d56\uff0c\u9ed8\u8ba4\u76d1\u542c 3000 \u7aef\u53e3\u3002\u5b83\u4e0d\u66ff\u4ee3\u7406\u7aef\u70b9\u6d41\u91cf\uff0c\u800c\u662f\u4f5c\u4e3a <strong>forward-auth<\/strong> \u670d\u52a1\u6302\u5728 Traefik\u3001Caddy \u6216 Nginx \u540e\u9762\uff1a\u7528\u6237\u8bbf\u95ee\u4efb\u610f\u53d7\u4fdd\u62a4\u5b50\u57df\u540d\u65f6\uff0c\u5148\u88ab\u5f39\u5230 tinyauth \u767b\u5f55\uff0c\u767b\u5f55\u6210\u529f\u540e\u518d\u8df3\u8f6c\u56de\u539f\u670d\u52a1\u3002\u652f\u6301\u7684\u8ba4\u8bc1\u6e90\u5305\u62ec\u672c\u5730\u7528\u6237\u540d\u5bc6\u7801\u3001OAuth \u7b2c\u4e09\u65b9\u767b\u5f55\uff08GitHub\/Google \u7b49\uff09\u3001LDAP \u7ec4 ACL\uff0c\u4ee5\u53ca\u7ec4\u7f51\u5de5\u5177 API \u505a\u7528\u6237\u6821\u9a8c\u3002\u6700\u65b0 v5.1.0 \u5728 2026 \u5e74 6 \u6708\u901a\u8fc7\u4e86 OpenID Basic OP \u8ba4\u8bc1\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/07\/tinyauth-logo.png\" alt=\"logo\" loading=\"lazy\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/07\/tinyauth-login.png\" alt=\"login\" loading=\"lazy\" \/><\/p>\n<p>\u8fd9\u5f20\u56fe\u5c31\u662f\u5b83\u7684\u767b\u5f55\u9875\uff1a\u9ed8\u8ba4\u8d70 OAuth \u53ef\u9009\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7528\u6237\u540d\u5bc6\u7801\u3002\u754c\u9762\u6ca1\u4ec0\u4e48\u82b1\u54e8\uff0c\u4f46\u597d\u5904\u662f\u4e5f\u51e0\u4e4e\u6ca1\u4ec0\u4e48\u5b66\u4e60\u6210\u672c\u3002<\/p>\n<h2>\u4e3a\u4ec0\u4e48\u9009\u5b83<\/h2>\n<p>\u6211\u539f\u6765\u7684\u72b6\u6001\u662f\uff1a\u5185\u7f51\u670d\u52a1\u9760\u7ec4\u7f51\u5de5\u5177\u56de\u5bb6\uff0c\u5916\u7f51\u66b4\u9732\u7684\u53ea\u6562\u653e\u5c11\u6570\u51e0\u4e2a\u5e26\u81ea\u8eab\u767b\u5f55\u7684\u3002\u95ee\u9898\u662f\uff0c\u6bcf\u4e2a\u670d\u52a1\u7684\u7528\u6237\u4f53\u7cfb\u3001\u4e8c\u6b65\u9a8c\u8bc1\u3001\u5bc6\u7801\u5f3a\u5ea6\u90fd\u4e0d\u4e00\u6837\uff0c\u7ba1\u7406\u8d77\u6765\u5f88\u788e\u3002 tinyauth \u89e3\u51b3\u7684\u662f\u4e00\u4e2a\u5f88\u5177\u4f53\u7684\u5c0f\u75db\u70b9\uff1a<\/p>\n<ul>\n<li><strong>\u7edf\u4e00\u5165\u53e3<\/strong>\uff1a\u6240\u6709\u5b50\u57df\u540d\u5171\u7528\u4e00\u5957\u767b\u5f55\u6001\uff0ccookie \u5199\u5728\u7236\u57df\u540d\u4e0b\uff0c\u8de8\u5b50\u57df\u81ea\u52a8\u5171\u4eab\u3002<\/li>\n<li><strong>\u8f7b\u91cf<\/strong>\uff1a\u4e00\u4e2a\u955c\u50cf\u5c31\u8d77\u6765\uff0c\u4e0d\u9700\u8981 Postgres \u96c6\u7fa4\u3001\u4e0d\u9700\u8981 Redis\u3001\u4e0d\u9700\u8981\u590d\u6742\u7684 RBAC \u914d\u7f6e\u3002<\/li>\n<li><strong> forward-auth \u4e0d\u6311\u98df<\/strong>\uff1aTraefik \u539f\u751f\u652f\u6301\uff0cCaddy \u548c Nginx Proxy Manager \u4e5f\u6709\u5b98\u65b9\u6216\u793e\u533a\u6587\u6863\u3002<\/li>\n<li><strong>ACL \u591f\u7528<\/strong>\uff1a\u53ef\u4ee5\u6309\u7528\u6237\u3001\u6309 OAuth \u7ec4\u3001\u6309 IP \u9ed1\u767d\u540d\u5355\u63a7\u5236\u8c01\u80fd\u8bbf\u95ee\u54ea\u4e2a\u5e94\u7528\u3002<\/li>\n<\/ul>\n<p>\u5b83\u4e0d\u662f\u8eab\u4efd\u6cbb\u7406\u5e73\u53f0\uff0c\u4e0d\u641e SSO \u5927\u8054\u76df\uff0c\u53ea\u662f\u628a\u201c\u8c01\u53ef\u4ee5\u8fdb\u8fd9\u4e2a\u5b50\u57df\u540d\u201d\u8fd9\u4ef6\u4e8b\u505a\u5f97\u5c0f\u800c\u7a33\u3002<\/p>\n<h2>\u600e\u4e48\u8dd1\u8d77\u6765<\/h2>\n<p>\u5b98\u65b9\u63a8\u8350\u955c\u50cf <code>ghcr.io\/tinyauthapp\/tinyauth:v5<\/code>\u3002\u8d77\u4e00\u4e2a\u6700\u5c0f compose \u5927\u6982\u662f\u8fd9\u6837\uff1a<\/p>\n<pre><code>services:\n  tinyauth:\n    image: ghcr.io\/tinyauthapp\/tinyauth:v5\n    restart: unless-stopped\n    environment:\n      - TINYAUTH_APPURL=https:\/\/auth.example.com\n      - TINYAUTH_AUTH_USERS=user:$$2a$$10$$...hash...\n    volumes:\n      - .\/data:\/data\n<\/code><\/pre>\n<p>\u5148\u521b\u5efa\u7528\u6237\uff1a<\/p>\n<pre><code>docker run -i -t --rm ghcr.io\/tinyauthapp\/tinyauth:v5 user create --interactive\n<\/code><\/pre>\n<p>\u7ec8\u7aef\u4f1a\u63d0\u793a\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u8f93\u51fa\u4e00\u4e2a bcrypt \u54c8\u5e0c\u3002\u8fd9\u91cc\u6709\u4e2a\u5751\uff1acompose \u91cc\u7684 <code>$<\/code> \u8981\u8f6c\u4e49\u6210 <code>$$<\/code>\uff0c\u5426\u5219 Docker \u4f1a\u628a\u5b83\u5f53\u53d8\u91cf\u66ff\u6362\u5403\u6389\u3002<\/p>\n<p>\u63a5\u7740\u6302\u5230 Traefik \u4e0a\u3002\u5173\u952e\u914d\u7f6e\u53ea\u6709\u4e24\u6761 label\uff1a<\/p>\n<pre><code>traefik.http.middlewares.tinyauth.forwardauth.address: http:\/\/tinyauth:3000\/api\/auth\/traefik\ntraefik.http.routers.whoami.middlewares: tinyauth\n<\/code><\/pre>\n<p>\u7b2c\u4e8c\u6761\u6302\u5230\u4f60\u60f3\u4fdd\u62a4\u7684\u5e94\u7528 router \u4e0a\u3002\u8bbf\u95ee <code>whoami.example.com<\/code> \u65f6\uff0cTraefik \u4f1a\u5148\u53d1\u8bf7\u6c42\u5230 tinyauth \u7684 <code>\/api\/auth\/traefik<\/code> \u6821\u9a8c\u5f53\u524d session\uff1b\u6ca1\u767b\u5f55\u5c31\u8fd4\u56de 401 \u5e76\u8df3\u8f6c\u5230\u767b\u5f55\u9875\uff0c\u767b\u5f55\u5b8c\u518d\u81ea\u52a8\u5e26\u56de\u53bb\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/07\/tinyauth-authorize.png\" alt=\"authorize\" loading=\"lazy\" \/><\/p>\n<p>\u4e0a\u56fe\u662f\u5b83\u4f5c\u4e3a OIDC provider \u7684\u6388\u6743\u786e\u8ba4\u9875\u3002\u5982\u679c\u4f60\u60f3\u8ba9\u67d0\u4e2a\u670d\u52a1\u8d70\u771f\u6b63\u7684 OIDC \u767b\u5f55\u800c\u4e0d\u662f\u7b80\u5355\u7684 forward-auth\uff0ctinyauth \u4e5f\u80fd\u5f53\u8eab\u4efd\u6e90\u7528\u3002<\/p>\n<h2>\u51e0\u4e2a\u8981\u6ce8\u610f\u7684\u5751<\/h2>\n<ul>\n<li><strong>\u57df\u540d\u5fc5\u987b\u89c4\u5212\u597d<\/strong>\uff1atinyauth \u7684 cookie \u662f\u5199\u5728\u7236\u57df\u540d\u4e0a\u7684\u3002\u6bd4\u5982\u8ba4\u8bc1\u670d\u52a1\u653e\u5728 <code>auth.example.com<\/code>\uff0c\u53d7\u4fdd\u62a4\u670d\u52a1\u653e\u5728 <code>*.example.com<\/code> \u4e0b\uff0c\u8fd9\u6837\u767b\u5f55\u6001\u624d\u80fd\u5171\u4eab\u3002\u4e0d\u8981\u628a\u5b83\u76f4\u63a5\u7ed1\u5728\u4e8c\u7ea7 DDNS \u57df\u540d\u4e0a\uff0c\u6d4f\u89c8\u5668 cookie \u89c4\u5219\u4f1a\u5931\u6548\u3002<\/li>\n<li><strong>\u53d7\u4fe1\u4ee3\u7406 IP<\/strong>\uff1a\u5982\u679c\u8981\u542f\u7528 IP \u9ed1\u767d\u540d\u5355\uff0c\u5fc5\u987b\u8bbe\u7f6e <code>TINYAUTH_AUTH_TRUSTEDPROXIES<\/code> \u6307\u5411\u4f60\u7684\u53cd\u4ee3\u5bb9\u5668\u7f51\u6bb5\uff08\u4f8b\u5982 <code>172.17.0.0\/16<\/code>\uff09\uff0c\u5426\u5219 tinyauth \u62ff\u5230\u7684\u662f Docker \u5185\u7f51 IP\uff0cACL \u5224\u65ad\u6ca1\u610f\u4e49\u3002<\/li>\n<li><strong>Docker NAT \u95ee\u9898<\/strong>\uff1aTraefik \u7528\u9ed8\u8ba4 bridge \u7f51\u7edc\u65f6\uff0c\u5bb9\u5668\u770b\u5230\u7684\u6e90 IP \u53ef\u80fd\u88ab NAT \u6389\u3002\u5b98\u65b9\u6587\u6863\u5efa\u8bae\u8ba9 Traefik \u8dd1\u5728 <code>network_mode: host<\/code> \u4e0b\uff0c\u4ee5\u62ff\u5230\u771f\u5b9e\u5ba2\u6237\u7aef\u5730\u5740\u3002<\/li>\n<li><strong>\u914d\u7f6e\u8fd8\u5728\u6d3b\u8dc3\u53d8\u52a8<\/strong>\uff1av5 \u4e4b\u540e\u914d\u7f6e\u683c\u5f0f\u548c\u547d\u4ee4\u884c\u6709\u8fc7\u8c03\u6574\uff0c\u5347\u7ea7\u524d\u4e00\u5b9a\u8981\u770b release note\u3002\u6211\u503e\u5411\u4e8e\u76f4\u63a5\u9501 <code>v5<\/code> \u6807\u7b7e\uff0c\u51cf\u5c11\u6f02\u79fb\u3002<\/li>\n<li><strong>AGPL-3.0 \u6388\u6743<\/strong>\uff1a\u5982\u679c\u4f60\u4fee\u6539\u4ee3\u7801\u5e76\u5728\u7f51\u7edc\u63d0\u4f9b\u670d\u52a1\uff0c\u9700\u8981\u5f00\u6e90\u3002\u666e\u901a homelab \u81ea\u7528\u4e0d\u53d7\u5f71\u54cd\uff0c\u5546\u4e1a\u90e8\u7f72\u8981\u7559\u795e\u3002<\/li>\n<\/ul>\n<h2>\u5b83\u4e0d\u9002\u5408\u8c01<\/h2>\n<p>tinyauth \u4e0d\u662f Authentik \u6216 Keycloak \u7684\u5e73\u66ff\u3002\u5982\u679c\u4f60\u9700\u8981\u52a8\u6001\u7528\u6237\u6ce8\u518c\u3001\u590d\u6742\u7684\u7ec4\u7ec7\/\u89d2\u8272\u3001\u5ba1\u8ba1\u65e5\u5fd7\u3001\u591a\u56e0\u7d20\u5f3a\u8ba4\u8bc1\u77e9\u9635\uff0c\u5b83\u53ef\u80fd\u4f1a\u663e\u5f97\u592a\u8584\u3002\u5b83\u7684\u5b9a\u4f4d\u5f88\u660e\u786e\uff1a\u7ed9\u53cd\u4ee3\u540e\u9762\u90a3\u5341\u51e0\u4e2a\u81ea\u6258\u7ba1\u670d\u52a1\uff0c\u52a0\u4e00\u9053\u201c\u767b\u5f55\u95e8 + \u7b80\u5355 ACL\u201d\uff0c\u800c\u4e0d\u662f\u505a\u4f01\u4e1a IAM\u3002<\/p>\n<h2>\u5c0f\u7ed3<\/h2>\n<p>\u6211\u6253\u7b97\u628a\u5b83\u653e\u5728\u4e00\u4e2a\u72ec\u7acb\u7684\u5c0f\u5bb9\u5668\u91cc\uff0c\u540e\u9762\u8ddf\u7740\u5a92\u4f53\u5e93\u3001\u76d1\u63a7\u9762\u677f\u3001RSS \u51e0\u4e2a\u670d\u52a1\u3002\u4e0d\u6539\u52a8\u4efb\u4f55\u5e94\u7528\u672c\u8eab\u7684\u8ba4\u8bc1\u903b\u8f91\uff0c\u53ea\u662f\u901a\u8fc7\u53cd\u4ee3\u7edf\u4e00\u52a0\u9053\u95e8\u3002\u914d\u7f6e\u52a0\u8d77\u6765\u4e0d\u5230\u4e8c\u5341\u884c\uff0c\u6bd4\u6bcf\u4e2a\u670d\u52a1\u5404\u81ea\u7ef4\u62a4\u5bc6\u7801\u8981\u5e72\u51c0\u5f97\u591a\u3002homelab \u73a9\u5230\u540e\u9762\uff0c\u5176\u5b9e\u7f3a\u7684\u5f80\u5f80\u4e0d\u662f\u66f4\u591a\u529f\u80fd\uff0c\u800c\u662f\u8fd9\u79cd\u201c\u5c11\u5373\u662f\u591a\u201d\u7684\u8fb9\u754c\u611f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb6\u91cc\u81ea\u6258\u7ba1\u7684\u670d\u52a1\u4e00\u591a\uff0c\u6d4f\u89c8\u5668\u6807\u7b7e\u9875\u5c31\u5f00\u59cb\u6392\u961f\uff1a\u5a92\u4f53\u5e93\u3001\u4e0b\u8f7d\u5668\u3001\u76d1\u63a7\u9762\u677f\u3001RSS\u3001\u7b14\u8bb0\u5de5\u5177\u2026\u2026\u6bcf\u4e2a\u90fd\u5404\u81ea\u4e3a\u653f\uff0c\u6709 &#8230; <a title=\"\u81ea\u6258\u7ba1\u670d\u52a1\u4e00\u591a\uff0c\u5148\u7ed9\u5b83\u4eec\u52a0\u4e2a\u7edf\u4e00\u767b\u5f55\u95e8\uff1atinyauth \u90e8\u7f72\u5c0f\u8bb0\" class=\"read-more\" href=\"https:\/\/www.tantan.ink\/index.php\/2026\/07\/24\/%e8%87%aa%e6%89%98%e7%ae%a1%e6%9c%8d%e5%8a%a1%e4%b8%80%e5%a4%9a%ef%bc%8c%e5%85%88%e7%bb%99%e5%ae%83%e4%bb%ac%e5%8a%a0%e4%b8%aa%e7%bb%9f%e4%b8%80%e7%99%bb%e5%bd%95%e9%97%a8%ef%bc%9atinyauth-%e9%83%a8\/\" aria-label=\"\u9605\u8bfb \u81ea\u6258\u7ba1\u670d\u52a1\u4e00\u591a\uff0c\u5148\u7ed9\u5b83\u4eec\u52a0\u4e2a\u7edf\u4e00\u767b\u5f55\u95e8\uff1atinyauth \u90e8\u7f72\u5c0f\u8bb0\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":2,"featured_media":482,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[164,10],"tags":[],"class_list":["post-485","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-selfhost","category-software"],"_links":{"self":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=485"}],"version-history":[{"count":0,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/485\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media\/482"}],"wp:attachment":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}