Owntracks location tracking with MQTT and HTTPS (recorder) support
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

more nox

+20 -20
+3 -3
bin/dune
··· 9 9 owntracks 10 10 eio_main 11 11 nox-xdge 12 - tomlt 13 - tomlt.eio 12 + nox-toml 13 + nox-toml.eio 14 14 logs.fmt 15 15 fmt.tty 16 - mirage-crypto-rng.unix 16 + nox-crypto-rng.unix 17 17 jsont 18 18 jsont.bytesrw 19 19 requests))
+13 -13
bin/main.ml
··· 14 14 module Config = struct 15 15 type device = { id : string; name : string } 16 16 17 - let device_codec : device Tomlt.t = 18 - Tomlt.( 17 + let device_codec : device Toml.Codec.t = 18 + Toml.Codec.( 19 19 Table.( 20 20 obj (fun id name -> { id; name }) 21 21 |> mem "id" string ~enc:(fun d -> d.id) ··· 30 30 31 31 let empty_recorder = { url = None; user = None; password = None } 32 32 33 - let recorder_codec : recorder Tomlt.t = 34 - Tomlt.( 33 + let recorder_codec : recorder Toml.Codec.t = 34 + Toml.Codec.( 35 35 Table.( 36 36 obj (fun url user password -> { url; user; password }) 37 37 |> opt_mem "url" string ~enc:(fun r -> r.url) ··· 54 54 devices = []; 55 55 } 56 56 57 - let owntracks_codec : owntracks Tomlt.t = 58 - Tomlt.( 57 + let owntracks_codec : owntracks Toml.Codec.t = 58 + Toml.Codec.( 59 59 Table.( 60 60 obj (fun topic default_device recorder devices -> 61 61 { ··· 85 85 pool = Mqtte_cmd.Config_file.empty_pool_config; 86 86 } 87 87 88 - let codec : t Tomlt.t = 89 - Tomlt.( 88 + let codec : t Toml.Codec.t = 89 + Toml.Codec.( 90 90 Table.( 91 91 obj (fun owntracks mqtt pool -> 92 92 { ··· 111 111 let load xdg = 112 112 match Xdge.config_file xdg "owntracks.toml" with 113 113 | Some path -> ( 114 - try Some (Tomlt_eio.decode_file_exn codec path) 114 + try Some (Toml_eio.decode_file_exn codec path) 115 115 with exn -> 116 116 Logs.warn (fun m -> 117 117 m "Failed to parse owntracks.toml: %s" (Printexc.to_string exn)); ··· 235 235 Logs.info (fun m -> m "Subscribing to: %s" topic); 236 236 237 237 Eio_main.run @@ fun env -> 238 - Mirage_crypto_rng_unix.use_default (); 238 + Crypto_rng_unix.use_default (); 239 239 Eio.Switch.run @@ fun sw -> 240 240 let on_message msg = handle_message config msg in 241 241 let on_disconnect () = Logs.warn (fun m -> m "Disconnected from broker") in ··· 503 503 | _ -> None 504 504 in 505 505 Eio_main.run @@ fun env -> 506 - Mirage_crypto_rng_unix.use_default (); 506 + Crypto_rng_unix.use_default (); 507 507 Eio.Switch.run @@ fun sw -> 508 508 let locations = 509 509 Recorder.fetch_locations ~sw env ~verbose_http ~recorder_url ~user ··· 536 536 let track_device_name = ref "unknown" in 537 537 538 538 Eio_main.run @@ fun env -> 539 - Mirage_crypto_rng_unix.use_default (); 539 + Crypto_rng_unix.use_default (); 540 540 Eio.Switch.run @@ fun sw -> 541 541 let net = Eio.Stdenv.net env in 542 542 let clock = Eio.Stdenv.clock env in ··· 780 780 | _ -> None 781 781 in 782 782 Eio_main.run @@ fun env -> 783 - Mirage_crypto_rng_unix.use_default (); 783 + Crypto_rng_unix.use_default (); 784 784 Eio.Switch.run @@ fun sw -> 785 785 match user with 786 786 | None -> (
+2 -2
dune-project
··· 38 38 (eio (>= 1.0)) 39 39 (eio_main (>= 1.0)) 40 40 nox-xdge 41 - tomlt 41 + nox-toml 42 42 geojson 43 43 (cmdliner (>= 1.2)) 44 44 (logs (>= 0.7)) 45 45 (fmt (>= 0.9)) 46 - mirage-crypto-rng 46 + nox-crypto-rng 47 47 requests 48 48 (odoc :with-doc)))
+2 -2
owntracks-cli.opam
··· 18 18 "eio" {>= "1.0"} 19 19 "eio_main" {>= "1.0"} 20 20 "nox-xdge" 21 - "tomlt" 21 + "nox-toml" 22 22 "geojson" 23 23 "cmdliner" {>= "1.2"} 24 24 "logs" {>= "0.7"} 25 25 "fmt" {>= "0.9"} 26 - "mirage-crypto-rng" 26 + "nox-crypto-rng" 27 27 "requests" 28 28 "odoc" {with-doc} 29 29 ]