decentralized and customizable links page on top of atproto ligo.at
atproto link-in-bio python uv

make auth_servers configurable by code

+22 -5
+19 -1
src/main.py
··· 96 96 ) 97 97 98 98 99 + class AuthServer(NamedTuple): 100 + name: str 101 + url: str 102 + 103 + 104 + auth_servers: list[AuthServer] = [ 105 + AuthServer("Bluesky", "https://bsky.social"), 106 + AuthServer("Blacksky", "https://blacksky.app"), 107 + AuthServer("Northsky", "https://northsky.social"), 108 + AuthServer("tangled.org", "https://tngl.sh"), 109 + AuthServer("Witchraft Systems", "https://pds.witchcraft.systems"), 110 + AuthServer("selfhosted.social", "https://selfhosted.social"), 111 + ] 112 + 113 + if app.debug: 114 + auth_servers.append(AuthServer("pds.rip", "https://pds.rip")) 115 + 116 + 99 117 @app.get("/login") 100 118 def page_login(): 101 119 if get_user() is not None: 102 120 return redirect("/editor") 103 - return render_template("login.html") 121 + return render_template("login.html", auth_servers=auth_servers) 104 122 105 123 106 124 @app.post("/login")
+3 -4
src/templates/login.html
··· 31 31 <div class="authservers"> 32 32 <span class="faded caption">If you're unsure you can log in with...</span> 33 33 <form action="{{ url_for('auth_login') }}" method="post"> 34 - <button type="submit" name="authserver" value="https://bsky.social">Bluesky</button> 35 - <button type="submit" name="authserver" value="https://blacksky.app">Blacksky</button> 36 - <button type="submit" name="authserver" value="https://tngl.sh">tangled</button> 37 - <button type="submit" name="authserver" value="https://pds.witchcraft.systems">Witchraft Systems</button> 34 + {% for server in auth_servers %} 35 + <button type="submit" name="authserver" value="{{ server.url }}">{{ server.name }}</button> 36 + {% endfor %} 38 37 </form> 39 38 </div> 40 39