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