Author SHA1 Message Date
DragonSlayer_14 f73ba4b1d6 Merge pull request 'Merge dev in testing: Feat: Fügt config.toml hinzu, welche die gitea-Registry konfiguriert.' (#6) from dev into testing
Testing Build, Check & Preview Release / Build, Check & Create Preview Release (push) Successful in 31s
Reviewed-on: #6
2026-08-26 17:22:45 +00:00
DragonSlayer_14 d7845349e8 Merge branch 'testing' into dev 2026-08-26 17:22:37 +00:00
DragonSlayer_14 7bea78f194 Merge remote-tracking branch 'origin/dev' into dev 2026-08-26 19:21:56 +02:00
DragonSlayer_14 87c1a1c09c Feat: Fügt config.toml hinzu, welche die gitea-Registry konfiguriert. 2026-08-26 19:21:52 +02:00
DragonSlayer_14 d781f3f97b Merge pull request 'Merge dev in testing: Feat: Ersetzt is_run_as_root durch die Implementation von Crate sudo_ctdra' (#5) from dev into testing
Testing Build, Check & Preview Release / Build, Check & Create Preview Release (push) Failing after 15s
Reviewed-on: #5
2026-08-26 17:15:41 +00:00
DragonSlayer_14 a4f27ce091 Merge branch 'testing' into dev 2026-08-26 17:15:32 +00:00
DragonSlayer_14 61b016775e Merge remote-tracking branch 'origin/dev' into dev 2026-08-26 19:14:54 +02:00
DragonSlayer_14 439ccd60d4 Feat: Hebt Version auf 1.0.3 2026-08-26 19:14:49 +02:00
DragonSlayer_14 1c99387d6f Feat: Ersetzt is_run_as_root durch die Implementation von Crate sudo_ctdra 2026-08-26 19:14:30 +02:00
DragonSlayer_14 bf32d82ae7 Feat: Ersetzt is_run_as_root durch die Implementation von Crate sudo_ctdra 2026-08-26 19:13:36 +02:00
DragonSlayer_14 34f61bba5f Merge remote-tracking branch 'origin/dev' into dev 2026-08-26 18:53:20 +02:00
DragonSlayer_14 d351a8b6be Fix: Passt LICENSE an 2026-08-26 18:53:16 +02:00
5 changed files with 26 additions and 29 deletions
+9
View File
@@ -0,0 +1,9 @@
[registry]
default = "gitea"
[registries.gitea]
index = "sparse+https://gitea.creative-dragonslayer.de/api/packages/Rust-Crates/cargo/" # Sparse index
# index = "https://gitea.creative-dragonslayer.de/Rust-Crates/_cargo-index.git" # Git
[net]
git-fetch-with-cli = true
Generated
+11 -2
View File
@@ -10,11 +10,11 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "config-ctdra"
version = "1.0.2"
version = "1.0.3"
dependencies = [
"confy",
"libc",
"serde",
"sudo-ctdra",
]
[[package]]
@@ -141,6 +141,15 @@ dependencies = [
"serde_core",
]
[[package]]
name = "sudo-ctdra"
version = "1.0.0"
source = "sparse+https://gitea.creative-dragonslayer.de/api/packages/Rust-Crates/cargo/"
checksum = "2c2746122bbe36f821de70db3ca4ad24edfb77118fc6a6bc7693082b50d23e5f"
dependencies = [
"libc",
]
[[package]]
name = "syn"
version = "3.0.4"
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "config-ctdra"
version = "1.0.2"
version = "1.0.3"
edition = "2024"
authors = ['DragonSlayer_14']
readme = "README.md"
@@ -11,7 +11,7 @@ description = "Einfache, threadsichere Konfigurationsverwaltung für Rust mit au
[dependencies]
confy = "2.0.0"
serde = { version = "1.0.229", features = ["derive"] }
libc = "1.0.0-alpha.4"
sudo-ctdra = { version = "1.0.0", registry = "gitea" }
[profile.release]
debug = "none"
+3 -3
View File
@@ -208,8 +208,8 @@ If you develop a new program, and you want it to be of the greatest possible use
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
DockerUpdater
Copyright (C) 2026 Linuxapps
config
Copyright (C) 2026 Rust-Crates
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
@@ -221,7 +221,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
DockerUpdater Copyright (C) 2026 Linuxapps
config Copyright (C) 2026 Rust-Crates
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
+1 -22
View File
@@ -36,6 +36,7 @@ use std::sync::{OnceLock, RwLock};
pub use confy::ConfyError;
use serde::de::DeserializeOwned;
use serde::Serialize;
use sudo_ctdra::is_run_as_root;
/// Optionaler benutzerdefinierter Programmname für die Konfigurationspfade.
static PROGRAM_NAME: OnceLock<RwLock<Option<String>>> = OnceLock::new();
@@ -56,28 +57,6 @@ static GLOBAL_CONFIGS: OnceLock<RwLock<HashMap<TypeId, &'static (dyn Any + Send
/// Standardname für Konfigurationsdateien.
const DEFAULT_CONFIG_NAME: &str = "config";
/// Prüft, ob das Programm mit Root-/Administrator-Rechten ausgeführt wird.
///
/// # Returns
///
/// * `true` - Das Programm läuft mit erhöhten Rechten (z. B. UID 0 unter Linux/Unix)
/// * `false` - Das Programm läuft mit normalen Benutzerrechten
pub fn is_run_as_root() -> bool {
#[cfg(target_os = "windows")]
{
std::process::Command::new("net")
.args(["session"])
.output()
.map(|output| output.status.success())
.unwrap_or(false)
}
#[cfg(not(target_os = "windows"))]
{
unsafe { libc::geteuid() == 0 }
}
}
/// Setzt den Programmnamen für die Pfadermittlung explizit.
pub fn set_program_name(name: impl Into<String>) {
let lock = PROGRAM_NAME.get_or_init(|| RwLock::new(None));