Spaces:
Runtime error
Runtime error
Download src/config.rs from ankeke2026/ankeke: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/spaces/ankeke2026/ankeke/resolve/main/src/config.rs
- Command line
-
hf download hf://spaces/ankeke2026/ankeke/src/config.rs
-
curl -L -o config.rs https://huggingface.co/spaces/ankeke2026/ankeke/resolve/main/src/config.rs
1 kB
| // SPDX-License-Identifier: AGPL-3.0-only | |
| // Copyright (C) 2025 Moew72 <Moew72@proton.me> | |
| use std::fs; | |
| use std::io::Read; | |
| use std::sync::LazyLock; | |
| use serde::Deserialize; | |
| pub(crate) static CONFIG: LazyLock<Config> = LazyLock::new(|| { | |
| if fs::exists("sign.config.toml").unwrap() { | |
| let mut buf = Vec::new(); | |
| fs::File::open("sign.config.toml") | |
| .unwrap() | |
| .read_to_end(&mut buf) | |
| .unwrap(); | |
| toml::from_slice::<Config>(&buf).unwrap() | |
| } else { | |
| Config::default() | |
| } | |
| }); | |
| pub(crate) struct Config { | |
| pub(crate) module_path: String, | |
| pub(crate) listen: String, | |
| pub(crate) offset: usize, | |
| pub(crate) version: String, | |
| } | |
| impl Default for Config { | |
| fn default() -> Self { | |
| Self { | |
| module_path: "./wrapper.node".to_string(), | |
| listen: "127.0.0.1:8080".to_string(), | |
| offset: 0x5ADE220, | |
| version: "3.2.19-39038".to_string(), | |
| } | |
| } | |
| } | |