Self-hosted, federated location sharing app and server that prioritizes user privacy and security
end-to-end-encryption location-sharing privacy self-hosted federated

added function to admin controls and ability to gen signup key as admin

Kishka ababc43f afd823ff

Changed files
+9 -10
app
src
home-page
server
src
+6 -7
app/src/home-page/home.html
··· 75 </div> 76 77 <!-- Admin --> 78 - <template x-if="isAdmin()"> 79 <div class="content" style="text-align: center"> 80 <h4>Admin Controls:</h4> 81 <div style="display: flex; justify-content: center"> ··· 83 Generate signup key 84 </button> 85 </div> 86 - <template 87 style="display: flex; justify-content: center" 88 - x-if="isAdmin()" 89 > 90 - <p>New signup key:</p> 91 - <p x-text="newSignupKey"></p> 92 - </template> 93 </div> 94 - </template> 95 </div> 96 </body> 97 </html>
··· 75 </div> 76 77 <!-- Admin --> 78 + <div x-if="isAdmin()"> 79 <div class="content" style="text-align: center"> 80 <h4>Admin Controls:</h4> 81 <div style="display: flex; justify-content: center"> ··· 83 Generate signup key 84 </button> 85 </div> 86 + <div 87 style="display: flex; justify-content: center" 88 + x-show="newSignupKey != ''" 89 > 90 + <p>New signup key: <a x-text="newSignupKey"></a></p> 91 + </div> 92 </div> 93 + </div> 94 </div> 95 </body> 96 </html>
+1 -1
app/src/home-page/home.ts
··· 8 { id: "456", name: "Bob Smith" }, 9 { id: "789", name: "Carol Davis" }, 10 ], 11 - newSignupKey: "AOEUI", 12 13 timeAgo() { 14 return "2m ago";
··· 8 { id: "456", name: "Bob Smith" }, 9 { id: "789", name: "Carol Davis" }, 10 ], 11 + newSignupKey: "", 12 13 timeAgo() { 14 return "2m ago";
+2 -2
server/src/main.rs
··· 55 .route("/send-pings", post(send_pings)) 56 .route("/get-pings", post(get_pings)) 57 .with_state(state.clone()) 58 - .layer(CorsLayer::permissive()) 59 - .layer(axum::middleware::from_fn_with_state(state, auth_test)); 60 61 let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); 62 axum::serve(listener, app).await.unwrap();
··· 55 .route("/send-pings", post(send_pings)) 56 .route("/get-pings", post(get_pings)) 57 .with_state(state.clone()) 58 + .layer(axum::middleware::from_fn_with_state(state, auth_test)) 59 + .layer(CorsLayer::permissive()); 60 61 let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); 62 axum::serve(listener, app).await.unwrap();