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 basic getPings support by opening geo Uri

+20 -5
+13 -1
app/src-tauri/capabilities/default.json
··· 3 3 "identifier": "default", 4 4 "description": "Capability for the main window", 5 5 "windows": ["main"], 6 - "permissions": ["core:default", "opener:default", "store:default"] 6 + "permissions": [ 7 + "core:default", 8 + "opener:default", 9 + "store:default", 10 + { 11 + "identifier": "opener:allow-open-url", 12 + "allow": [ 13 + { 14 + "url": "geo:*" 15 + } 16 + ] 17 + } 18 + ] 7 19 }
+1
app/src-tauri/src/lib.rs
··· 34 34 Ok(()) 35 35 }) 36 36 .plugin(tauri_plugin_store::Builder::default().build()) 37 + .plugin(tauri_plugin_opener::init()) 37 38 .invoke_handler(tauri::generate_handler![greet]) 38 39 .run(tauri::generate_context!()) 39 40 .expect("error while running tauri application");
+5 -3
app/src/home-page/home.ts
··· 2 2 import { goto } from "../utils/tools.ts"; 3 3 import { Store } from "../utils/store.ts"; 4 4 import * as api from "../utils/api.ts"; 5 + import { openUrl } from "@tauri-apps/plugin-opener"; 5 6 6 7 Alpine.data("homePageState", () => ({ 7 8 is_admin: false, ··· 18 19 return "2m ago"; 19 20 }, 20 21 21 - viewLocation(friend_id: string) { 22 - alert(`Opening the location for the friend with id ${friend_id}`); 22 + async viewLocation(friend_id: string) { 23 + const pings = await api.getPings(friend_id); 24 + await openUrl(`geo:0,0?q=${pings[0]}`); 23 25 }, 24 26 25 27 friendOptions(friend_id: string) { ··· 30 32 // temporarly, just use the friend id of the first in the list 31 33 const friends = await Store.get("friends"); 32 34 33 - await api.sendPings(friends[0].id, "3.14159N 3.14159W"); 35 + await api.sendPings(friends[0].id, "37.78918,-122.40335"); 34 36 }, 35 37 36 38 addFriend() {
+1 -1
app/src/utils/api.ts
··· 72 72 73 73 const privKeyBytes = Uint8Array.fromBase64(privKey_b64); 74 74 75 - const privKey = await crypto.subtle.importKey("pkcs8", privKeyBytes.buffer, "Ed25519", false, [ 75 + const privKey = await crypto.subtle.importKey("pkcs8", privKeyBytes, "Ed25519", false, [ 76 76 "sign", 77 77 ]); 78 78