Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
138 lines (128 loc) · 7.44 KB
/
Copy pathCargo.toml
File metadata and controls
138 lines (128 loc) · 7.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
[package]
name = "usbguard-gui"
version = "0.3.0"
edition = "2024"
rust-version = "1.89"
description = "Unprivileged GTK4 desktop client for managing USB device authorization policy through the USBGuard daemon."
authors = ["onyks"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/onyks-os/USBGuardGUI"
documentation = "https://onyks-os.github.io/usbguard-gui/"
keywords = ["usbguard", "usb", "security", "gtk4", "linux"]
categories = ["gui"]
exclude = [
"docs/", ".github/", "SESSION_HANDOFF.md",
"scripts/clean-install-*", "scripts/verify-clean-install.py", "tests/test_clean_install*.py",
]
# ---------------------------------------------------------------------------
# Native packages (docs/architecture.md §14.2). `make package-deb` and
# `make package-rpm`; Arch has packaging/arch/PKGBUILD.
#
# None of them runs a post-install script: the distributions' own triggers
# compile the GSettings schema and refresh the icon cache. The Polkit rule is
# shipped as an inert example under /usr/share/doc (§3.6), never installed.
# ---------------------------------------------------------------------------
[package.metadata.deb]
maintainer = "onyks <github.tgwp7@aleeas.com>"
section = "admin"
priority = "optional"
# Debian and Ubuntu ship the D-Bus bridge inside the usbguard package.
depends = "$auto, libgtk-4-1 (>= 4.14), libadwaita-1-0 (>= 1.5), usbguard (>= 1.1.0)"
recommends = "polkitd | policykit-1"
extended-description = """A desktop interface for USBGuard: see which USB devices are connected and authorized, allow or block them, and read and edit the policy rules. Runs without privileges; every change is made by the USBGuard daemon after the system's own authorization checks."""
assets = [
["target/release/usbguard-gui", "usr/bin/", "755"],
["data/io.github.onyks_os.UsbguardGui.desktop", "usr/share/applications/", "644"],
["data/io.github.onyks_os.UsbguardGui.metainfo.xml", "usr/share/metainfo/", "644"],
["data/io.github.onyks_os.UsbguardGui.gschema.xml", "usr/share/glib-2.0/schemas/", "644"],
["data/icons/hicolor/scalable/apps/io.github.onyks_os.UsbguardGui.svg", "usr/share/icons/hicolor/scalable/apps/", "644"],
["data/icons/hicolor/symbolic/apps/io.github.onyks_os.UsbguardGui-symbolic.svg", "usr/share/icons/hicolor/symbolic/apps/", "644"],
["packaging/70-usbguard-gui.rules.example", "usr/share/doc/usbguard-gui/", "644"],
["README.md", "usr/share/doc/usbguard-gui/", "644"],
# Translations, compiled by `make i18n`. One line per language in po/LINGUAS.
["target/locale/fr/LC_MESSAGES/usbguard-gui.mo", "usr/share/locale/fr/LC_MESSAGES/", "644"],
["target/locale/it/LC_MESSAGES/usbguard-gui.mo", "usr/share/locale/it/LC_MESSAGES/", "644"],
["target/locale/pt_BR/LC_MESSAGES/usbguard-gui.mo", "usr/share/locale/pt_BR/LC_MESSAGES/", "644"],
]
[package.metadata.generate-rpm]
summary = "Desktop interface for USBGuard"
assets = [
{ source = "target/release/usbguard-gui", dest = "/usr/bin/usbguard-gui", mode = "755" },
{ source = "data/io.github.onyks_os.UsbguardGui.desktop", dest = "/usr/share/applications/io.github.onyks_os.UsbguardGui.desktop", mode = "644" },
{ source = "data/io.github.onyks_os.UsbguardGui.metainfo.xml", dest = "/usr/share/metainfo/io.github.onyks_os.UsbguardGui.metainfo.xml", mode = "644" },
{ source = "data/io.github.onyks_os.UsbguardGui.gschema.xml", dest = "/usr/share/glib-2.0/schemas/io.github.onyks_os.UsbguardGui.gschema.xml", mode = "644" },
{ source = "data/icons/hicolor/scalable/apps/io.github.onyks_os.UsbguardGui.svg", dest = "/usr/share/icons/hicolor/scalable/apps/io.github.onyks_os.UsbguardGui.svg", mode = "644" },
{ source = "data/icons/hicolor/symbolic/apps/io.github.onyks_os.UsbguardGui-symbolic.svg", dest = "/usr/share/icons/hicolor/symbolic/apps/io.github.onyks_os.UsbguardGui-symbolic.svg", mode = "644" },
{ source = "packaging/70-usbguard-gui.rules.example", dest = "/usr/share/doc/usbguard-gui/70-usbguard-gui.rules.example", mode = "644", doc = true },
{ source = "README.md", dest = "/usr/share/doc/usbguard-gui/README.md", mode = "644", doc = true },
# Translations, compiled by `make i18n`. One line per language in po/LINGUAS.
{ source = "target/locale/fr/LC_MESSAGES/usbguard-gui.mo", dest = "/usr/share/locale/fr/LC_MESSAGES/usbguard-gui.mo", mode = "644" },
{ source = "target/locale/it/LC_MESSAGES/usbguard-gui.mo", dest = "/usr/share/locale/it/LC_MESSAGES/usbguard-gui.mo", mode = "644" },
{ source = "target/locale/pt_BR/LC_MESSAGES/usbguard-gui.mo", dest = "/usr/share/locale/pt_BR/LC_MESSAGES/usbguard-gui.mo", mode = "644" },
]
# Fedora ships the bridge as its own package.
[package.metadata.generate-rpm.requires]
usbguard = ">= 1.1.0"
usbguard-dbus = "*"
gtk4 = ">= 4.14"
libadwaita = ">= 1.5"
[package.metadata.generate-rpm.recommends]
polkit = "*"
[dependencies]
adw = { version = "0.8", package = "libadwaita", features = ["v1_5"], optional = true }
# Each crate's choice is justified in DEPENDENCIES.md §1.1. Crates are added
# with `cargo add` at the start of the ROADMAP phase that first needs them, so
# the committed Cargo.lock only pins versions the project builds against.
#
# notify-rust is not needed:
# GIO notifications cover both the session bus and the Flatpak portal.
async-channel = "2.5.0"
futures-util = "0.3.34"
gettextrs = { version = "0.8.0", package = "gettext-rs", default-features = false, features = ["gettext-system"], optional = true }
gtk = { version = "0.10", package = "gtk4", features = ["v4_14"], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
thiserror = "2"
tokio = { version = "1.53.3", features = ["rt-multi-thread", "time", "macros", "sync"] }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
# The default async-io executor is disabled: everything runs on the one Tokio
# runtime of docs/architecture.md §5.2.
zbus = { version = "6.1.0", default-features = false, features = ["tokio", "proxy"] }
[features]
# The GTK interface. Without it the binary still builds and offers the
# headless commands (--diagnose, --list-devices, …), which is what CI jobs
# without GTK development packages build.
default = ["gui"]
gui = ["dep:gtk", "dep:adw", "dep:gettextrs", "dep:serde", "zbus/service"]
[dev-dependencies]
proptest = "1"
tokio = { version = "1.53.3", features = ["net", "rt-multi-thread", "macros", "time", "test-util"] }
zbus = { version = "6.1.0", default-features = false, features = ["tokio", "proxy", "service", "p2p"] }
[profile.release]
# Fail loudly rather than wrap silently: an integer overflow in release mode is
# a correctness bug, not a performance optimization.
overflow-checks = true
lto = true
codegen-units = 1
strip = "symbols"
# ---------------------------------------------------------------------------
# Lints — enforced by `cargo clippy -- -D warnings` in CI.
# ---------------------------------------------------------------------------
[lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"
unreachable_pub = "warn"
rust_2018_idioms = { level = "warn", priority = -1 }
[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
# Panicking paths are banned in library code: a library that panics takes the
# caller's process down with it.
unwrap_used = "warn"
expect_used = "warn"
panic = "warn"
todo = "warn"
# Project names, acronyms, and file names appear constantly in doc comments and
# are not code; pedantic's doc_markdown would flag every one of them.
doc_markdown = "allow"