innernet/client/Cargo.toml
refi64 dbac0dc530
hostsfile: Copy the SELinux context to the temp file before overwrite (#273)
* hostsfile: Copy the SELinux context to the temp file before overwrite

On SELinux-enabled systems, /etc/hosts has a different type `net_conf_t`
than the other files in /etc, so the temporary file that overwrites it
ends up with the wrong context, resulting in many system services
becoming unable to access the file. To fix this, manually look up the
context /etc/hosts has and copy it to the temporary file before
the rename.

In order to avoid depending on libselinux on systems that don't use it,
this support is gated behind the new "selinux" feature. It *is*
installed and enabled in the Dockerfile, however, in order to ensure
that it still builds.

* Appease clippy

* Add info about selinux feature to README.md

* Remove unused ClientError struct

* Reformatted & repositioned and improved doc about selinux

---------

Co-authored-by: Brian Schwind <brianmschwind@gmail.com>
Co-authored-by: Jürgen Botz <jurgen@botz.org>
2024-07-01 10:16:43 +09:00

77 lines
2.6 KiB
TOML

[package]
authors = [
"Jake McGinty <me@jakebot.org>",
"Brian Schwind <brian@tonari.no>",
"Ryo Kawaguchi <ryo@tonari.no>",
"Matěj Laitl <matej@tonari.no>",
]
description = "A client to manage innernet network interfaces."
edition = "2021"
homepage = "https://github.com/tonarino/innernet"
license = "MIT"
name = "client"
publish = false
readme = "README.md"
repository = "https://github.com/tonarino/innernet"
version = "1.6.1"
[[bin]]
name = "innernet"
path = "src/main.rs"
[dependencies]
anyhow = "1"
colored = "2"
clap = { version = "4.3", features = ["derive", "wrap_help"] }
clap_complete = "4.3"
dialoguer = { version = "0.10", default-features = false }
hostsfile = { path = "../hostsfile" }
indoc = "2.0.1"
ipnet = { version = "2.4", features = ["serde"] }
log = "0.4"
regex = { version = "1", default-features = false, features = ["std"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
shared = { path = "../shared", default-features = false }
ureq = { version = "2", default-features = false, features = ["json"] }
wireguard-control = { path = "../wireguard-control" }
[dev-dependencies]
once_cell = "1.17.1"
tempfile = "3"
[features]
selinux = ["hostsfile/selinux"]
[package.metadata.deb]
assets = [
["target/release/innernet", "usr/bin/", "755"],
["innernet@.service", "usr/lib/systemd/system/", "644"],
["../doc/innernet.8.gz", "usr/share/man/man8/", "644"],
["../doc/innernet.completions.bash", "etc/bash_completion.d/innernet", "644"],
["../doc/innernet.completions.fish", "usr/share/fish/vendor_completions.d/innernet.fish", "644"],
["../doc/innernet.completions.zsh", "usr/share/zsh/site-functions/_innernet", "644"],
]
depends = "libc6, libgcc1, systemd"
recommends = "wireguard"
extended-description = "innernet client binary for fetching peer information and conducting admin tasks such as adding a new peer."
maintainer = "tonari <hey@tonari.no>"
name = "innernet"
priority = "optional"
section = "net"
[package.metadata.rpm]
package = "innernet"
[package.metadata.rpm.cargo]
buildflags = ["--release"]
[package.metadata.rpm.files]
"../../doc/innernet.8.gz" = { path = "/usr/share/man/man8/innernet.8.gz" }
"../innernet@.service" = { path = "/usr/lib/systemd/system/innernet@.service" }
"../../doc/innernet.completions.bash" = { path = "/etc/bash_completion.d/innernet" }
"../../doc/innernet.completions.fish" = { path = "/usr/share/fish/vendor_completions.d/innernet.fish" }
"../../doc/innernet.completions.zsh" = { path = "/usr/share/zsh/site-functions/_innernet" }
[package.metadata.rpm.targets]
innernet = { path = "/usr/bin/innernet" }