Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f697963705 | ||
|
|
a74b95dca7 | ||
|
|
9da7cdb1a5 | ||
|
|
dcbe307c4a | ||
|
|
4e4bf28508 |
No files matched your search
@@ -1 +1,4 @@
|
|||||||
/target
|
/target
|
||||||
|
|
||||||
|
# local Gitea API token (never commit)
|
||||||
|
.gitea-push-token
|
||||||
@@ -70,7 +70,9 @@ rearms monitoring. See README.md for the full design.
|
|||||||
daemon only hears it a fraction of the time (2-20% duty), and frozen
|
daemon only hears it a fraction of the time (2-20% duty), and frozen
|
||||||
RSSI dedupes catches within one rotation window — event gaps of
|
RSSI dedupes catches within one rotation window — event gaps of
|
||||||
25-60 s are routine. `missing_after_secs` must be well above that
|
25-60 s are routine. `missing_after_secs` must be well above that
|
||||||
(30 s false-locked twice; 60 s is the sane floor).
|
(30 s false-locked twice; 60 s is the sane floor). The code default
|
||||||
|
stays 30 as a conservative fallback for configs that omit the key —
|
||||||
|
shipped configs (config.toml.example) must set 60 explicitly.
|
||||||
- `Device1.Connect` is the only reliable "is it actually there" oracle,
|
- `Device1.Connect` is the only reliable "is it actually there" oracle,
|
||||||
and it works whenever the phone advertises — but connection attempts
|
and it works whenever the phone advertises — but connection attempts
|
||||||
stall or abort (`le-connection-abort-by-local`) while our own
|
stall or abort (`le-connection-abort-by-local`) while our own
|
||||||
|
|||||||
Generated
+27
-47
@@ -115,7 +115,7 @@ checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "btle-proximity"
|
name = "btle-proximity"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -469,7 +469,7 @@ version = "3.5.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
|
checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"toml_edit 0.25.18+spec-1.1.0",
|
"toml_edit",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -534,9 +534,9 @@ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sd-notify"
|
name = "sd-notify"
|
||||||
version = "0.4.5"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b943eadf71d8b69e661330cb0e2656e31040acf21ee7708e2c238a0ec6af2bf4"
|
checksum = "3e4ef7359e694bfaf1dd27a30f9d760b54c00dfae9f19bd0c05a39bc9128fe76"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@@ -584,11 +584,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_spanned"
|
name = "serde_spanned"
|
||||||
version = "0.6.9"
|
version = "1.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
|
checksum = "9c187e0a369471c550af028cba56d4f4fa2a489ad28151ae95a4d340a2a8b782"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -723,46 +723,26 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml"
|
name = "toml"
|
||||||
version = "0.8.23"
|
version = "1.2.1+spec-1.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
|
checksum = "d5755c51863cdac711f1956baf8eb9588e060755f7d3c4c979e70ea1e1f32cd7"
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
"serde_spanned",
|
|
||||||
"toml_datetime 0.6.11",
|
|
||||||
"toml_edit 0.22.27",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "toml_datetime"
|
|
||||||
version = "0.6.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
|
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "toml_datetime"
|
|
||||||
version = "1.1.2+spec-1.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
|
|
||||||
dependencies = [
|
|
||||||
"serde_core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "toml_edit"
|
|
||||||
version = "0.22.27"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"serde",
|
"serde_core",
|
||||||
"serde_spanned",
|
"serde_spanned",
|
||||||
"toml_datetime 0.6.11",
|
"toml_datetime",
|
||||||
"toml_write",
|
"toml_parser",
|
||||||
"winnow 0.7.15",
|
"toml_writer",
|
||||||
|
"winnow 1.0.5",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml_datetime"
|
||||||
|
version = "1.1.3+spec-1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "173f25c883cd2176a2d8212155638c0a60d484a9d84546d270866f40f56b6e49"
|
||||||
|
dependencies = [
|
||||||
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -772,7 +752,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "1ec6e78bd70db9420d8d212fa9dc97f116448a1ceff5d00eabb991d407e21396"
|
checksum = "1ec6e78bd70db9420d8d212fa9dc97f116448a1ceff5d00eabb991d407e21396"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"toml_datetime 1.1.2+spec-1.1.0",
|
"toml_datetime",
|
||||||
"toml_parser",
|
"toml_parser",
|
||||||
"winnow 1.0.5",
|
"winnow 1.0.5",
|
||||||
]
|
]
|
||||||
@@ -787,10 +767,10 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml_write"
|
name = "toml_writer"
|
||||||
version = "0.1.2"
|
version = "1.2.0+spec-1.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
|
checksum = "009dbb7700f11c55ef83aebbe4c0e9cf1f1ac0844bd8d6f00dc38f302026e13a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing"
|
name = "tracing"
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "btle-proximity"
|
name = "btle-proximity"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.85"
|
rust-version = "1.85"
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
@@ -31,11 +31,11 @@ assets = [
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
clap = { version = "4", features = ["derive"] }
|
clap = { version = "4", features = ["derive"] }
|
||||||
sd-notify = "0.4"
|
sd-notify = "0.5"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
tokio = { version = "1", features = ["macros", "process", "rt-multi-thread", "signal", "time"] }
|
tokio = { version = "1", features = ["macros", "process", "rt-multi-thread", "signal", "time"] }
|
||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
toml = "0.8"
|
toml = "1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
zbus = { version = "5", default-features = false, features = ["tokio"] }
|
zbus = { version = "5", default-features = false, features = ["tokio"] }
|
||||||
|
|||||||
@@ -161,6 +161,24 @@ export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=/tmp/lld-bin/ld.lld
|
|||||||
The `--no-strip` matters: the release profile already strips via the
|
The `--no-strip` matters: the release profile already strips via the
|
||||||
linker, and the host `strip` cannot read aarch64 objects.
|
linker, and the host `strip` cannot read aarch64 objects.
|
||||||
|
|
||||||
|
#### Publishing a release (checklist)
|
||||||
|
|
||||||
|
A release is visible in two **separate** places, and both must be fed or
|
||||||
|
`apt upgrade` silently stays on the old version:
|
||||||
|
|
||||||
|
1. **Release attachments** (manual downloads):
|
||||||
|
`POST /api/v1/repos/bmaeuser/btle-proximity/releases` with the tag, then
|
||||||
|
upload the debs (and the beacon APK) as release assets.
|
||||||
|
2. **Debian package registry** (what `apt update` actually reads):
|
||||||
|
```sh
|
||||||
|
curl --upload-file btle-proximity_0.2.1-1_amd64.deb \
|
||||||
|
-u bmaeuser:<token> \
|
||||||
|
https://git.netz.org/api/packages/bmaeuser/debian/pool/stable/main/upload
|
||||||
|
# repeat for arm64; then verify the new version appears in:
|
||||||
|
curl https://git.netz.org/api/packages/bmaeuser/debian/dists/stable/main/binary-amd64/Packages
|
||||||
|
curl https://git.netz.org/api/packages/bmaeuser/debian/dists/stable/main/binary-arm64/Packages
|
||||||
|
```
|
||||||
|
|
||||||
### Manual install (dev flow)
|
### Manual install (dev flow)
|
||||||
|
|
||||||
The unit in `systemd/` runs the cargo-installed binary
|
The unit in `systemd/` runs the cargo-installed binary
|
||||||
@@ -180,7 +198,7 @@ See `config.toml.example`; every knob is documented there. Highlights:
|
|||||||
| key | default | meaning |
|
| key | default | meaning |
|
||||||
| ---------------------- | ------- | ------------------------------------------ |
|
| ---------------------- | ------- | ------------------------------------------ |
|
||||||
| `device_mac` | — | identity MAC of the paired phone |
|
| `device_mac` | — | identity MAC of the paired phone |
|
||||||
| `missing_after_secs` | 30 | absence confirmation before locking |
|
| `missing_after_secs` | 30 (use 60+) | absence confirmation; 30 is only the fallback, false-locks with the companion app |
|
||||||
| `presence_timeout_secs`| 15 | how fresh an update must be to count |
|
| `presence_timeout_secs`| 15 | how fresh an update must be to count |
|
||||||
| `rssi_floor` / `rssi_lock` | -90/-80 | discovery floor / out-of-range threshold |
|
| `rssi_floor` / `rssi_lock` | -90/-80 | discovery floor / out-of-range threshold |
|
||||||
| `duty.*` | see file| per-state scan window/interval |
|
| `duty.*` | see file| per-state scan window/interval |
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ use std::time::Duration;
|
|||||||
fn presence_timeout_secs() -> u64 {
|
fn presence_timeout_secs() -> u64 {
|
||||||
15
|
15
|
||||||
}
|
}
|
||||||
|
/// Fallback for configs that omit the key. 30 s false-locks with the
|
||||||
|
/// companion beacon (see config.toml.example); real configs should set 60.
|
||||||
fn missing_after_secs() -> u64 {
|
fn missing_after_secs() -> u64 {
|
||||||
30
|
30
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -83,9 +83,9 @@ async fn run(cli: Cli) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn notify_ready() {
|
pub fn notify_ready() {
|
||||||
let _ = sd_notify::notify(false, &[sd_notify::NotifyState::Ready]);
|
let _ = sd_notify::notify(&[sd_notify::NotifyState::Ready]);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn notify_stopping() {
|
pub fn notify_stopping() {
|
||||||
let _ = sd_notify::notify(false, &[sd_notify::NotifyState::Stopping]);
|
let _ = sd_notify::notify(&[sd_notify::NotifyState::Stopping]);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user