├── www └── .gitkeep ├── rustfmt.toml ├── web ├── src │ ├── env.d.ts │ ├── components │ │ ├── Root │ │ │ ├── index.module.less │ │ │ └── index.tsx │ │ ├── NProgress │ │ │ ├── index.less │ │ │ └── index.tsx │ │ ├── ErrorElement │ │ │ ├── index.module.less │ │ │ └── index.tsx │ │ ├── Home │ │ │ ├── index.module.less │ │ │ └── index.tsx │ │ ├── Header │ │ │ ├── index.module.less │ │ │ └── index.tsx │ │ ├── ErrorBoundary │ │ │ └── index.tsx │ │ ├── DeviceCard │ │ │ ├── index.module.less │ │ │ └── index.tsx │ │ ├── AuthEdit │ │ │ └── index.tsx │ │ └── DeviceEdit │ │ │ └── index.tsx │ ├── types │ │ ├── auth.ts │ │ └── device.ts │ ├── hooks │ │ ├── useModal.ts │ │ ├── useMessage.ts │ │ ├── useTheme.ts │ │ ├── useBoolean.ts │ │ ├── useAuth.ts │ │ ├── useLocalStorage.ts │ │ └── useDevices.ts │ ├── utils │ │ └── fetcher.ts │ ├── Wol.tsx │ ├── styles │ │ └── index.less │ └── index.tsx ├── public │ ├── logo.png │ ├── favicon.ico │ └── manifest.json ├── README.md ├── rsbuild.config.ts ├── tsconfig.json ├── index.html ├── eslint.config.mjs ├── package.json └── .gitignore ├── Cross.toml ├── resources └── screenshots │ ├── 浅色主题.png │ ├── 深色主题.png │ ├── 页面认证.png │ ├── 开启页面认证.png │ └── 添加新设备.png ├── wol.example.yaml ├── .cargo └── config.toml ├── .editorconfig ├── wol.code-workspace ├── .gitignore ├── Dockerfile ├── src ├── api │ ├── mod.rs │ ├── auth.rs │ └── device.rs ├── args.rs ├── asset.rs ├── main.rs ├── settings.rs ├── wol.rs ├── errors.rs └── middleware.rs ├── Cargo.toml ├── README.md ├── .github └── workflows │ └── build.yml ├── LICENSE └── Cargo.lock /www/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | tab_spaces = 2 2 | edition = "2021" 3 | -------------------------------------------------------------------------------- /web/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /Cross.toml: -------------------------------------------------------------------------------- 1 | [target.x86_64-unknown-linux-gnu] 2 | image = "rust:latest" 3 | -------------------------------------------------------------------------------- /web/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nashaofu/wol/HEAD/web/public/logo.png -------------------------------------------------------------------------------- /web/src/components/Root/index.module.less: -------------------------------------------------------------------------------- 1 | .root { 2 | min-height: 100vh; 3 | } 4 | -------------------------------------------------------------------------------- /web/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nashaofu/wol/HEAD/web/public/favicon.ico -------------------------------------------------------------------------------- /web/src/components/NProgress/index.less: -------------------------------------------------------------------------------- 1 | #nprogress .bar { 2 | height: 4px; 3 | } 4 | -------------------------------------------------------------------------------- /resources/screenshots/浅色主题.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nashaofu/wol/HEAD/resources/screenshots/浅色主题.png -------------------------------------------------------------------------------- /resources/screenshots/深色主题.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nashaofu/wol/HEAD/resources/screenshots/深色主题.png -------------------------------------------------------------------------------- /resources/screenshots/页面认证.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nashaofu/wol/HEAD/resources/screenshots/页面认证.png -------------------------------------------------------------------------------- /web/src/types/auth.ts: -------------------------------------------------------------------------------- 1 | export interface Auth { 2 | username: string; 3 | password?: string; 4 | } 5 | -------------------------------------------------------------------------------- /resources/screenshots/开启页面认证.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nashaofu/wol/HEAD/resources/screenshots/开启页面认证.png -------------------------------------------------------------------------------- /resources/screenshots/添加新设备.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nashaofu/wol/HEAD/resources/screenshots/添加新设备.png -------------------------------------------------------------------------------- /web/src/hooks/useModal.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'antd'; 2 | 3 | export default function useModal() { 4 | const { modal } = App.useApp(); 5 | return modal; 6 | } 7 | -------------------------------------------------------------------------------- /wol.example.yaml: -------------------------------------------------------------------------------- 1 | user: null 2 | devices: 3 | - name: Windows 4 | mac: 00:00:00:00:00:00 5 | ip: 192.168.1.1 6 | netmask: 255.255.255.0 7 | port: 9 8 | -------------------------------------------------------------------------------- /web/src/hooks/useMessage.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'antd'; 2 | 3 | export default function useMessage() { 4 | const { message } = App.useApp(); 5 | return message; 6 | } 7 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.x86_64-pc-windows-msvc] 2 | rustflags = ["-C", "target-feature=+crt-static"] 3 | 4 | [target.aarch64-pc-windows-msvc] 5 | rustflags = ["-C", "target-feature=+crt-static"] 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /web/src/components/ErrorElement/index.module.less: -------------------------------------------------------------------------------- 1 | .error { 2 | height: 100vh; 3 | display: flex; 4 | align-items: center; 5 | justify-content: center; 6 | text-align: center; 7 | color: #333; 8 | } 9 | -------------------------------------------------------------------------------- /wol.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | }, 6 | { 7 | "path": "web" 8 | } 9 | ], 10 | "settings": { 11 | "cSpell.words": [ 12 | "actix", 13 | "antd" 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /web/src/hooks/useTheme.ts: -------------------------------------------------------------------------------- 1 | import useLocalStorage from './useLocalStorage'; 2 | 3 | export enum ITheme { 4 | Light = 'Light', 5 | Dark = 'Dark', 6 | } 7 | 8 | export default function useTheme() { 9 | return useLocalStorage('theme'); 10 | } 11 | -------------------------------------------------------------------------------- /web/src/types/device.ts: -------------------------------------------------------------------------------- 1 | export interface Device { 2 | uid: string; 3 | name: string; 4 | mac: string; 5 | ip: string; 6 | netmask: string; 7 | port: number; 8 | } 9 | 10 | export enum DeviceStatus { 11 | Online = "Online", 12 | Offline = "Offline", 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | 12 | wol.yaml 13 | wol.yml 14 | -------------------------------------------------------------------------------- /web/README.md: -------------------------------------------------------------------------------- 1 | # wol-web 2 | 3 | wol-web 是 Wol 的前端项目,基于 React、Antd、Rspack 开发。 4 | 5 | ## 开发 6 | 7 | ### 安装依赖 8 | 9 | 在当前目录下执行以下命令安装依赖: 10 | 11 | ```sh 12 | pnpm i 13 | ``` 14 | 15 | ### 开发 16 | 17 | 在当前目录下执行以下命令启动开发模式: 18 | 19 | ```sh 20 | pnpm dev 21 | ``` 22 | 23 | ### 打包编译 24 | 25 | 在当前目录下执行以下命令进行打包编译: 26 | 27 | ```sh 28 | pnpm build 29 | ``` 30 | -------------------------------------------------------------------------------- /web/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Wol", 3 | "short_name": "Wol", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#001529", 7 | "description": "Wol 是 wake on lan 的简写,是一个轻量、简洁的 Wol 管理服务,支持检测设备是否开机成功。", 8 | "icons": [ 9 | { 10 | "src": "logo.png", 11 | "sizes": "any" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /web/src/utils/fetcher.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | const fetcher = axios.create({ 4 | baseURL: '/api', 5 | timeout: 20000, 6 | headers: { 7 | 'Content-Type': 'application/json', 8 | }, 9 | }); 10 | 11 | fetcher.interceptors.response.use( 12 | (data) => data.data, 13 | (err) => Promise.reject(err), 14 | ); 15 | 16 | export default fetcher; 17 | -------------------------------------------------------------------------------- /web/src/components/NProgress/index.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect } from 'react'; 2 | import { start, done } from 'nprogress'; 3 | import 'nprogress/nprogress.css'; 4 | import './index.less'; 5 | 6 | export default function NProgress() { 7 | useEffect(() => { 8 | start(); 9 | return () => { 10 | done(); 11 | }; 12 | }, []); 13 | 14 | return null; 15 | } 16 | -------------------------------------------------------------------------------- /web/src/components/Home/index.module.less: -------------------------------------------------------------------------------- 1 | .home { 2 | max-width: 1300px; 3 | padding: 48px 50px; 4 | margin: 0 auto; 5 | @media (max-width: 575px) { 6 | padding: 30px 20px; 7 | } 8 | } 9 | 10 | .item { 11 | transition: all 0.3s ease; 12 | &:hover { 13 | transform: translateY(-6px); 14 | box-shadow: 0 26px 40px -24px rgba(0, 0, 0, 0.8); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=amd64 alpine:latest as builder 2 | 3 | WORKDIR /build 4 | 5 | COPY build-docker.sh . 6 | 7 | ARG TARGETARCH 8 | 9 | RUN chmod +x ./build-docker.sh 10 | RUN ./build-docker.sh 11 | 12 | FROM alpine:latest 13 | 14 | WORKDIR /opt/wol 15 | 16 | COPY --from=builder /build/wol . 17 | 18 | EXPOSE 3300 19 | 20 | ENV RUST_LOG=info \ 21 | RUST_BACKTRACE=1 22 | 23 | CMD ["/opt/wol/wol"] 24 | -------------------------------------------------------------------------------- /src/api/mod.rs: -------------------------------------------------------------------------------- 1 | mod auth; 2 | mod device; 3 | 4 | use actix_web::web; 5 | 6 | pub fn init(cfg: &mut web::ServiceConfig) { 7 | cfg 8 | .service( 9 | web::scope("/device") 10 | .service(device::all) 11 | .service(device::save) 12 | .service(device::wake) 13 | .service(device::status), 14 | ) 15 | .service(web::scope("/auth").service(auth::get).service(auth::save)); 16 | } 17 | -------------------------------------------------------------------------------- /web/rsbuild.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "@rsbuild/core"; 2 | import { pluginReact } from "@rsbuild/plugin-react"; 3 | import { pluginLess } from "@rsbuild/plugin-less"; 4 | 5 | export default defineConfig({ 6 | plugins: [pluginReact(), pluginLess()], 7 | html: { 8 | template: "./index.html", 9 | }, 10 | server: { 11 | proxy: { 12 | "/api": "http://127.0.0.1:3300", 13 | }, 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /src/args.rs: -------------------------------------------------------------------------------- 1 | use clap::Parser; 2 | use lazy_static::lazy_static; 3 | 4 | lazy_static! { 5 | pub static ref ARGS: Args = Args::parse(); 6 | } 7 | 8 | #[derive(Parser, Debug)] 9 | #[command(author, version, about, long_about = None)] 10 | pub struct Args { 11 | /// App listen port 12 | #[arg(short, long, default_value_t = 3300)] 13 | pub port: u16, 14 | 15 | /// Config file path 16 | #[arg(short, long, default_value_t = String::from("./wol.yaml"))] 17 | pub config: String, 18 | } 19 | -------------------------------------------------------------------------------- /web/src/components/Root/index.tsx: -------------------------------------------------------------------------------- 1 | import { Suspense } from 'react'; 2 | import { Layout } from 'antd'; 3 | import NProgress from '@/components/NProgress'; 4 | import Header from '@/components/Header'; 5 | import Home from '@/components/Home'; 6 | import styles from './index.module.less'; 7 | 8 | export default function Root() { 9 | return ( 10 | }> 11 | 12 |
13 | 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /web/src/components/Header/index.module.less: -------------------------------------------------------------------------------- 1 | .header { 2 | @media (max-width: 575px) { 3 | padding-inline: 20px; 4 | } 5 | } 6 | 7 | .container { 8 | display: flex; 9 | align-items: center; 10 | justify-content: space-between; 11 | max-width: 1200px; 12 | margin: 0 auto; 13 | } 14 | 15 | .logo { 16 | font-size: 28px; 17 | font-weight: 600; 18 | } 19 | 20 | .buttons { 21 | display: flex; 22 | align-items: center; 23 | } 24 | 25 | .button { 26 | margin-left: 16px; 27 | font-size: 20px; 28 | cursor: pointer; 29 | } 30 | -------------------------------------------------------------------------------- /web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "lib": ["DOM", "ES2020"], 5 | "module": "ESNext", 6 | "jsx": "react-jsx", 7 | "noEmit": true, 8 | "strict": true, 9 | "skipLibCheck": true, 10 | "isolatedModules": true, 11 | "resolveJsonModule": true, 12 | "moduleResolution": "bundler", 13 | "useDefineForClassFields": true, 14 | "allowImportingTsExtensions": true, 15 | "baseUrl": "./", 16 | "paths": { 17 | "@/*": ["src/*"] 18 | } 19 | }, 20 | "include": ["src"] 21 | } 22 | -------------------------------------------------------------------------------- /src/asset.rs: -------------------------------------------------------------------------------- 1 | use actix_web::{HttpRequest, HttpResponse, Responder, Result, error::ErrorNotFound}; 2 | use rust_embed::RustEmbed; 3 | 4 | #[derive(RustEmbed)] 5 | #[folder = "www"] 6 | struct Asset; 7 | 8 | pub async fn serve(req: HttpRequest) -> Result { 9 | let path = &req.path()[1..]; 10 | 11 | let file = Asset::get(path) 12 | .or(Asset::get("index.html")) 13 | .ok_or(ErrorNotFound("Not Found"))?; 14 | 15 | Ok( 16 | HttpResponse::Ok() 17 | .content_type(file.metadata.mimetype()) 18 | .body(file.data), 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | Wol 10 | 11 | 12 | 16 | 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /web/src/Wol.tsx: -------------------------------------------------------------------------------- 1 | import { ConfigProvider, App, theme } from 'antd'; 2 | import zhCN from 'antd/locale/zh_CN'; 3 | import useTheme, { ITheme } from './hooks/useTheme'; 4 | import Root from './components/Root'; 5 | 6 | export default function Wol() { 7 | const [themeValue] = useTheme(); 8 | const algorithm = themeValue === ITheme.Dark ? theme.darkAlgorithm : theme.defaultAlgorithm; 9 | 10 | return ( 11 | 17 | 18 | 19 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /web/src/hooks/useBoolean.ts: -------------------------------------------------------------------------------- 1 | import { useMemo, useState } from 'react'; 2 | 3 | type UseBooleanOpts = boolean | (() => boolean); 4 | interface UseBooleanAction { 5 | setTrue: () => void; 6 | setFalse: () => void; 7 | } 8 | 9 | export default function useBoolean( 10 | defaultValue: UseBooleanOpts = false, 11 | ): [boolean, UseBooleanAction] { 12 | const [state, setState] = useState(defaultValue); 13 | 14 | const actions = useMemo( 15 | () => ({ 16 | setTrue: () => setState(true), 17 | setFalse: () => setState(false), 18 | }), 19 | [], 20 | ); 21 | 22 | return [state, actions]; 23 | } 24 | -------------------------------------------------------------------------------- /web/src/styles/index.less: -------------------------------------------------------------------------------- 1 | @import "antd/dist/reset.css"; 2 | 3 | ::-webkit-scrollbar { 4 | width: 8px; 5 | height: 8px; 6 | background-color: rgba(0, 0, 0, 0.1); 7 | } 8 | 9 | ::-webkit-scrollbar-track { 10 | background-color: #f5f5f5; 11 | box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.22); 12 | } 13 | 14 | ::-webkit-scrollbar-thumb { 15 | background-color: rgba(0, 0, 0, 0.22); 16 | border-radius: 10px; 17 | } 18 | 19 | html { 20 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 21 | "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", 22 | "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; 23 | } 24 | -------------------------------------------------------------------------------- /web/src/components/ErrorElement/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Result, theme } from 'antd'; 2 | import styles from './index.module.less'; 3 | 4 | export interface ErrorElementProps { 5 | message?: string; 6 | } 7 | 8 | export default function ErrorElement({ message }: ErrorElementProps) { 9 | const { token } = theme.useToken(); 10 | 11 | return ( 12 |
19 | window.location.reload()}> 25 | 重新加载 26 | 27 | )} 28 | /> 29 |
30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wol" 3 | version = "0.1.0" 4 | edition = "2024" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | actix-web = { version = "4.11.0", default-features = false, features = [ 10 | "macros", 11 | "compat", 12 | ] } 13 | anyhow = "1.0.98" 14 | base64 = "0.22.1" 15 | clap = { version = "4.5.41", features = ["derive"] } 16 | config = { version = "0.15.13", default-features = false, features = [ 17 | "ron", 18 | "yaml", 19 | ] } 20 | dotenv = "0.15" 21 | env_logger = "0.11.8" 22 | futures-util = { version = "0.3.31", default-features = false } 23 | lazy_static = "1.5" 24 | log = "0.4.27" 25 | rust-embed = { version = "8.7.2", features = ["mime-guess"] } 26 | serde = { version = "1.0.219", features = ["derive"] } 27 | serde_yaml = "0.9.33" 28 | surge-ping = "0.8.2" 29 | -------------------------------------------------------------------------------- /web/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"; 2 | import js from "@eslint/js"; 3 | import reactHooks from "eslint-plugin-react-hooks"; 4 | import reactJsx from "eslint-plugin-react/configs/jsx-runtime.js"; 5 | import react from "eslint-plugin-react/configs/recommended.js"; 6 | import globals from "globals"; 7 | import ts from "typescript-eslint"; 8 | 9 | export default [ 10 | { languageOptions: { globals: globals.browser } }, 11 | js.configs.recommended, 12 | ...ts.configs.recommended, 13 | ...fixupConfigRules([ 14 | { 15 | ...react, 16 | settings: { 17 | react: { version: "detect" }, 18 | }, 19 | }, 20 | reactJsx, 21 | ]), 22 | { 23 | plugins: { 24 | "react-hooks": fixupPluginRules(reactHooks), 25 | }, 26 | rules: { 27 | ...reactHooks.configs.recommended.rules, 28 | }, 29 | }, 30 | { ignores: ["dist/"] }, 31 | ]; 32 | -------------------------------------------------------------------------------- /src/api/auth.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | errors::Result, 3 | settings::{Auth, SETTINGS}, 4 | }; 5 | 6 | use actix_web::{HttpResponse, Responder, get, post, web}; 7 | use serde::{Deserialize, Serialize}; 8 | 9 | #[get("/info")] 10 | async fn get() -> Result { 11 | Ok(HttpResponse::Ok().json(&SETTINGS.read()?.auth)) 12 | } 13 | 14 | #[derive(Debug, Clone, Serialize, Deserialize)] 15 | pub struct SaveAuthData { 16 | username: String, 17 | password: Option, 18 | } 19 | 20 | #[post("/save")] 21 | async fn save(data: web::Json>) -> Result { 22 | let settings = &mut SETTINGS.write()?; 23 | if let Some(data) = data.clone() { 24 | settings.auth = Some(Auth { 25 | username: data.username, 26 | password: data.password.unwrap_or(String::default()), 27 | }); 28 | } else { 29 | settings.auth = None; 30 | } 31 | settings.save()?; 32 | 33 | Ok(HttpResponse::Ok().json(&settings.auth)) 34 | } 35 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | pub mod api; 2 | pub mod args; 3 | pub mod asset; 4 | pub mod errors; 5 | pub mod middleware; 6 | pub mod settings; 7 | pub mod wol; 8 | 9 | use actix_web::{ 10 | App, HttpServer, 11 | middleware::{Logger, NormalizePath}, 12 | web, 13 | }; 14 | use dotenv::dotenv; 15 | use std::io; 16 | 17 | use args::ARGS; 18 | use asset::serve; 19 | use middleware::BasicAuth; 20 | 21 | #[actix_web::main] 22 | async fn main() -> Result<(), io::Error> { 23 | dotenv().ok(); 24 | 25 | env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); 26 | 27 | log::info!("starting HTTP server at http://0.0.0.0:{}", ARGS.port); 28 | 29 | HttpServer::new(|| { 30 | App::new() 31 | .wrap(NormalizePath::trim()) 32 | .wrap(BasicAuth) 33 | .service( 34 | web::scope("/api") 35 | .wrap(Logger::default()) 36 | .configure(api::init), 37 | ) 38 | .default_service(web::to(serve)) 39 | }) 40 | .bind(("0.0.0.0", ARGS.port))? 41 | .run() 42 | .await 43 | } 44 | -------------------------------------------------------------------------------- /web/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { StrictMode } from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import { SWRConfig, Cache } from 'swr'; 4 | import './styles/index.less'; 5 | 6 | import ErrorBoundary from './components/ErrorBoundary'; 7 | import Wol from './Wol'; 8 | 9 | function localStorageProvider() { 10 | const key = 'Wol.app-cache'; 11 | // 初始化时,我们将数据从 `localStorage` 恢复到一个 map 中。 12 | const map = new Map(JSON.parse(localStorage.getItem(key) || '[]')); 13 | 14 | // 在卸载 app 之前,我们将所有数据写回 `localStorage` 中。 15 | window.addEventListener('beforeunload', () => { 16 | const appCache = JSON.stringify(Array.from(map.entries())); 17 | localStorage.setItem(key, appCache); 18 | }); 19 | 20 | // 我们仍然使用 map 进行读写以提高性能。 21 | return map as Cache; 22 | } 23 | 24 | ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( 25 | 26 | 27 | 28 | 29 | 30 | 31 | , 32 | ); 33 | -------------------------------------------------------------------------------- /web/src/hooks/useAuth.ts: -------------------------------------------------------------------------------- 1 | import useSWR, { SWRConfiguration, useSWRConfig } from 'swr'; 2 | import useSWRMutation, { SWRMutationConfiguration } from 'swr/mutation'; 3 | import fetcher from '@/utils/fetcher'; 4 | import { Auth } from '@/types/auth'; 5 | 6 | type UseSaveAuthConfig = SWRMutationConfiguration< 7 | Auth, 8 | Error, 9 | '/auth/save', 10 | Auth | null 11 | >; 12 | 13 | export function useAuth(config?: SWRConfiguration) { 14 | return useSWR( 15 | '/auth/info', 16 | (url) => fetcher.get(url), 17 | { 18 | revalidateOnFocus: false, 19 | ...config, 20 | }, 21 | ); 22 | } 23 | 24 | export function useSaveAuth(config?: UseSaveAuthConfig) { 25 | const { mutate } = useSWRConfig(); 26 | 27 | return useSWRMutation( 28 | '/auth/save', 29 | async (url, { arg }: { arg: Auth | null }) => { 30 | const resp = await fetcher.post(url, arg); 31 | return resp; 32 | }, 33 | { 34 | ...config, 35 | onSuccess: (resp, ...args) => { 36 | config?.onSuccess?.(resp, ...args); 37 | // 清理所有本地数据 38 | mutate(() => true, undefined, { revalidate: true }); 39 | }, 40 | }, 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /web/src/components/ErrorBoundary/index.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ErrorInfo, ReactNode } from "react"; 2 | import ErrorElement from "../ErrorElement"; 3 | 4 | export interface ErrorBoundaryProps { 5 | children: ReactNode; 6 | } 7 | 8 | export interface ErrorBoundaryState { 9 | error: Error | null; 10 | } 11 | 12 | export default class ErrorBoundary extends Component< 13 | ErrorBoundaryProps, 14 | ErrorBoundaryState 15 | > { 16 | constructor(props: ErrorBoundaryProps) { 17 | super(props); 18 | this.state = { error: null }; 19 | } 20 | 21 | static getDerivedStateFromError(error: Error) { 22 | // Update state so the next render will show the fallback UI. 23 | return { error }; 24 | } 25 | 26 | componentDidCatch(error: Error, errorInfo: ErrorInfo) { 27 | // You can also log the error to an error reporting service 28 | console.log(error, errorInfo); 29 | } 30 | 31 | render() { 32 | const { error } = this.state; 33 | // eslint-disable-next-line react/prop-types 34 | const { children } = this.props; 35 | if (error) { 36 | // You can render any custom fallback UI 37 | return ; 38 | } 39 | 40 | return children; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wol-web", 3 | "private": true, 4 | "version": "0.0.3", 5 | "scripts": { 6 | "dev": "rsbuild dev", 7 | "build": "npm run lint && tsc && rsbuild build", 8 | "preview": "rsbuild preview", 9 | "lint": "eslint . --fix" 10 | }, 11 | "dependencies": { 12 | "@ant-design/icons": "^5.4.0", 13 | "antd": "^5.20.5", 14 | "axios": "^1.7.7", 15 | "classnames": "^2.5.1", 16 | "copy-to-clipboard": "^3.3.3", 17 | "lodash-es": "^4.17.21", 18 | "nanoid": "^5.0.7", 19 | "nprogress": "^0.2.0", 20 | "react": "^18.3.1", 21 | "react-dom": "^18.3.1", 22 | "swr": "^2.2.5" 23 | }, 24 | "devDependencies": { 25 | "@eslint/compat": "^1.1.1", 26 | "@eslint/js": "^9.9.1", 27 | "@rsbuild/core": "^1.0.1-rc.5", 28 | "@rsbuild/plugin-less": "^1.0.1-rc.5", 29 | "@rsbuild/plugin-react": "^1.0.1-rc.5", 30 | "@types/lodash-es": "^4.17.12", 31 | "@types/nprogress": "^0.2.3", 32 | "@types/react": "^18.3.5", 33 | "@types/react-dom": "^18.3.0", 34 | "eslint": "^9.9.1", 35 | "eslint-plugin-react": "^7.35.2", 36 | "eslint-plugin-react-hooks": "^4.6.2", 37 | "globals": "^15.9.0", 38 | "typescript": "^5.5.4", 39 | "typescript-eslint": "^8.4.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/api/device.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | errors::Result, 3 | settings::{Device, SETTINGS}, 4 | wol, 5 | }; 6 | 7 | use actix_web::{HttpResponse, Responder, get, post, web}; 8 | use serde::{Deserialize, Serialize}; 9 | use surge_ping; 10 | 11 | #[get("/all")] 12 | async fn all() -> Result { 13 | Ok(HttpResponse::Ok().json(&SETTINGS.read()?.devices)) 14 | } 15 | 16 | #[post("/save")] 17 | async fn save(data: web::Json>) -> Result { 18 | let settings = &mut SETTINGS.write()?; 19 | settings.devices = data.clone(); 20 | settings.save()?; 21 | 22 | Ok(HttpResponse::Ok().json(&settings.devices)) 23 | } 24 | 25 | #[post("/wake")] 26 | async fn wake(data: web::Json) -> Result { 27 | wol::wake(&data)?; 28 | Ok(HttpResponse::Ok().json(&data)) 29 | } 30 | 31 | #[derive(Debug, Serialize, Deserialize)] 32 | pub enum DeviceStatus { 33 | Online, 34 | Offline, 35 | } 36 | 37 | #[get("/status/{ip}")] 38 | async fn status(ip: web::Path) -> Result { 39 | let payload = [0; 8]; 40 | let device = ip.parse()?; 41 | 42 | let device_status = surge_ping::ping(device, &payload) 43 | .await 44 | .map(|_| DeviceStatus::Online) 45 | .unwrap_or(DeviceStatus::Offline); 46 | 47 | Ok(HttpResponse::Ok().json(device_status)) 48 | } 49 | -------------------------------------------------------------------------------- /web/src/components/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Button, Col, Empty, Row, Spin, 3 | } from 'antd'; 4 | import { useDevices } from '@/hooks/useDevices'; 5 | import DeviceCard from '@/components/DeviceCard'; 6 | import DeviceEdit from '../DeviceEdit'; 7 | import useBoolean from '@/hooks/useBoolean'; 8 | import styles from './index.module.less'; 9 | 10 | export default function Home() { 11 | const { data: devices = [], isLoading } = useDevices(); 12 | const [open, actions] = useBoolean(false); 13 | 14 | return ( 15 | <> 16 | 17 |
18 | {!devices.length && ( 19 | 20 | 23 | 24 | )} 25 | 26 | {devices.map((item) => ( 27 | 28 |
29 | 30 |
31 | 32 | ))} 33 |
34 |
35 |
36 | 41 | 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /web/src/components/DeviceCard/index.module.less: -------------------------------------------------------------------------------- 1 | .device { 2 | padding: 24px; 3 | transition: all 0.3s ease; 4 | display: flex; 5 | align-items: center; 6 | border-radius: 8px; 7 | position: relative; 8 | overflow: hidden; 9 | } 10 | 11 | .switch { 12 | width: 48px; 13 | height: 48px; 14 | line-height: 48px; 15 | text-align: center; 16 | font-size: 48px; 17 | cursor: pointer; 18 | border-radius: 50%; 19 | } 20 | 21 | .info { 22 | flex-grow: 1; 23 | padding-left: 24px; 24 | } 25 | 26 | .name { 27 | line-height: 24px; 28 | padding-bottom: 10px; 29 | font-size: 16px; 30 | font-weight: 600; 31 | white-space: nowrap; 32 | overflow: hidden; 33 | text-overflow: ellipsis; 34 | } 35 | 36 | .mac { 37 | line-height: 18px; 38 | font-size: 14px; 39 | white-space: nowrap; 40 | overflow: hidden; 41 | text-overflow: ellipsis; 42 | } 43 | 44 | @position-right: 24px + 20px; 45 | 46 | .online { 47 | position: absolute; 48 | top: 50%; 49 | right: @position-right; 50 | transform: translate(50%, -50%); 51 | width: 20px; 52 | height: 20px; 53 | border-radius: 50%; 54 | } 55 | 56 | .loading { 57 | position: absolute; 58 | top: 50%; 59 | right: @position-right; 60 | transform: translate(50%, -50%); 61 | font-size: 40px; 62 | } 63 | 64 | .edit { 65 | position: absolute; 66 | top: 10px; 67 | right: 10px; 68 | } 69 | 70 | .editBtn { 71 | width: 24px; 72 | height: 24px; 73 | line-height: 24px; 74 | font-size: 18px; 75 | border-radius: 50%; 76 | cursor: pointer; 77 | text-align: center; 78 | } 79 | -------------------------------------------------------------------------------- /web/src/hooks/useLocalStorage.ts: -------------------------------------------------------------------------------- 1 | import { useCallback, useSyncExternalStore } from 'react'; 2 | 3 | function getLocalStorage(key: string): T | undefined { 4 | try { 5 | const raw = localStorage.getItem(key); 6 | if (raw) { 7 | return JSON.parse(raw) as T; 8 | } 9 | } catch (err) { 10 | 11 | console.error(err); 12 | } 13 | 14 | return undefined; 15 | } 16 | 17 | const listeners = new Map void>>(); 18 | 19 | export default function useLocalStorage( 20 | key: string, 21 | ): [T | undefined, (val: T | undefined) => void] { 22 | const localStorageKey = `Wol.${key}`; 23 | 24 | const state = useSyncExternalStore( 25 | (onStoreChange) => { 26 | const keyListeners = listeners.get(key) ?? []; 27 | keyListeners.push(onStoreChange); 28 | listeners.set(key, keyListeners); 29 | return () => { 30 | const newKeyListeners = listeners.get(key) ?? []; 31 | listeners.set( 32 | key, 33 | newKeyListeners.filter((item) => item !== onStoreChange), 34 | ); 35 | }; 36 | }, 37 | () => getLocalStorage(localStorageKey), 38 | ); 39 | 40 | const setLocalStorage = useCallback( 41 | (value: T | undefined) => { 42 | if (value === undefined) { 43 | localStorage.removeItem(localStorageKey); 44 | } else { 45 | try { 46 | localStorage.setItem(localStorageKey, JSON.stringify(value)); 47 | } catch (err) { 48 | 49 | console.error(err); 50 | } 51 | } 52 | listeners.get(key)?.forEach((item) => item()); 53 | }, 54 | [localStorageKey, key], 55 | ); 56 | 57 | return [state, setLocalStorage]; 58 | } 59 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /src/settings.rs: -------------------------------------------------------------------------------- 1 | use crate::args::ARGS; 2 | 3 | use std::{env, fs, path::PathBuf, sync::RwLock}; 4 | 5 | use anyhow::{Result, anyhow}; 6 | use config::{Config, File}; 7 | use lazy_static::lazy_static; 8 | use serde::{Deserialize, Serialize}; 9 | use serde_yaml; 10 | 11 | lazy_static! { 12 | pub static ref CONFIG_FILE: PathBuf = env::current_dir() 13 | .map(|current_dir| current_dir.join(&ARGS.config).to_path_buf()) 14 | .expect("DATA_DIR parse failed"); 15 | pub static ref SETTINGS: RwLock = 16 | RwLock::new(Settings::init().expect("Settings init failed")); 17 | } 18 | 19 | #[derive(Debug, Clone, Deserialize, Serialize)] 20 | pub struct Auth { 21 | pub username: String, 22 | pub password: String, 23 | } 24 | 25 | #[derive(Debug, Clone, Deserialize, Serialize)] 26 | pub struct Device { 27 | pub name: String, 28 | pub mac: String, 29 | pub ip: String, 30 | pub port: Option, 31 | pub netmask: String, 32 | } 33 | 34 | #[derive(Debug, Clone, Serialize)] 35 | pub struct Settings { 36 | pub auth: Option, 37 | pub devices: Vec, 38 | } 39 | 40 | impl Settings { 41 | pub fn init() -> Result { 42 | let config = Config::builder() 43 | .add_source(File::with_name(&CONFIG_FILE.display().to_string()).required(false)) 44 | .build()?; 45 | 46 | let devices = match config.get::>("devices") { 47 | Ok(devices) => devices, 48 | Err(err) => { 49 | log::error!("Failed get devices from config: {err}"); 50 | 51 | if CONFIG_FILE.exists() { 52 | let filename = CONFIG_FILE 53 | .file_name() 54 | .and_then(|name| name.to_str()) 55 | .ok_or(anyhow!("Failed get config file name"))?; 56 | 57 | let target = CONFIG_FILE 58 | .parent() 59 | .ok_or(anyhow!("Failed get config file parent dirname"))? 60 | .join(format!("{filename}.backup")); 61 | 62 | log::info!( 63 | "Backup config file {} to {}", 64 | CONFIG_FILE.display(), 65 | target.display() 66 | ); 67 | 68 | fs::copy(CONFIG_FILE.as_path(), target)?; 69 | } 70 | 71 | Vec::new() 72 | } 73 | }; 74 | 75 | let auth = config.get::("auth").ok(); 76 | 77 | let settings = Settings { auth, devices }; 78 | 79 | log::debug!("Init settings: {settings:?}"); 80 | settings.save()?; 81 | Ok(settings) 82 | } 83 | 84 | pub fn save(self: &Settings) -> Result<()> { 85 | let yaml = serde_yaml::to_string(&self)?; 86 | fs::write(CONFIG_FILE.to_path_buf(), yaml)?; 87 | Ok(()) 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/wol.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{Result, anyhow}; 2 | use serde::{Deserialize, Serialize}; 3 | use std::{net::UdpSocket, result::Result as StdResult}; 4 | 5 | /** 6 | * mac address eg: FF-FF-FF-FF-FF-FF 7 | * @wiki https://en.wikipedia.org/wiki/Wake-on-LAN 8 | * @docs http://support.amd.com/TechDocs/20213.pdf 9 | */ 10 | fn parse_mac(mac: T) -> Result<[u8; 6]> { 11 | let mac = mac.to_string(); 12 | let mac_vec: Vec<&str> = mac.split(":").collect(); 13 | 14 | if mac_vec.len() != 6 { 15 | return Err(anyhow!("mac address is invalid")); 16 | } 17 | 18 | let mut mac_bytes = [0_u8; 6]; 19 | for i in 0..mac_bytes.len() { 20 | mac_bytes[i] = u8::from_str_radix(mac_vec[i], 16)?; 21 | } 22 | 23 | Ok(mac_bytes) 24 | } 25 | 26 | /** 27 | * WOL magic packet 构成: 28 | * 前6个字节为 0xff,然后是目标计算机的 MAC 地址的16次重复,总共 102 个字节。 29 | */ 30 | fn create_magic_packet(mac: [u8; 6]) -> [u8; 102] { 31 | // 前6个字节为 0xff 32 | let mut magic_packet = [0xff_u8; 102]; 33 | 34 | // MAC 地址重复 16 次 35 | magic_packet[6..].copy_from_slice(&mac.repeat(16)); 36 | 37 | magic_packet 38 | } 39 | 40 | /** 41 | * IP 转换为 u32 数值 42 | */ 43 | fn ip_to_u32(ip: &str) -> Result { 44 | let parts = ip 45 | .split('.') 46 | .map(|src| src.parse::()) 47 | .collect::, _>>()?; 48 | 49 | if parts.len() != 4 { 50 | return Err(anyhow!("ip address is invalid")); 51 | } 52 | 53 | Ok((parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3]) 54 | } 55 | 56 | /** 57 | * 根据 IP 与子网掩码计算广播地址 58 | */ 59 | fn calculate_broadcast(ip: &str, netmask: &str) -> Result { 60 | // 将 IP 地址和子网掩码转换为 u32 61 | let ip_u32 = ip_to_u32(ip)?; 62 | let netmask_u32 = ip_to_u32(netmask)?; 63 | 64 | // 计算广播地址 65 | let broadcast_u32 = ip_u32 | !netmask_u32; 66 | 67 | // 将 u32 转换回点分十进制字符串 68 | let broadcast_ip = format!( 69 | "{}.{}.{}.{}", 70 | (broadcast_u32 >> 24) & 0xFF, 71 | (broadcast_u32 >> 16) & 0xFF, 72 | (broadcast_u32 >> 8) & 0xFF, 73 | broadcast_u32 & 0xFF 74 | ); 75 | 76 | Ok(broadcast_ip) 77 | } 78 | 79 | #[derive(Debug, Serialize, Deserialize)] 80 | pub struct WakeData { 81 | ip: String, 82 | port: Option, 83 | mac: String, 84 | netmask: String, 85 | } 86 | 87 | pub fn wake(data: &WakeData) -> Result<()> { 88 | let mac = parse_mac(&data.mac)?; 89 | let magic_packet = create_magic_packet(mac); 90 | 91 | log::info!("wake magic packet {magic_packet:?}"); 92 | 93 | let broadcast = calculate_broadcast(&data.ip, &data.netmask)?; 94 | log::info!("wake broadcast address {broadcast}"); 95 | 96 | let socket = UdpSocket::bind(("0.0.0.0", 0))?; 97 | socket.set_broadcast(true)?; 98 | socket.send_to(&magic_packet, (broadcast.as_str(), data.port.unwrap_or(9)))?; 99 | 100 | Ok(()) 101 | } 102 | -------------------------------------------------------------------------------- /web/src/components/Header/index.tsx: -------------------------------------------------------------------------------- 1 | import { useCallback } from "react"; 2 | import { Layout, Switch, theme } from "antd"; 3 | import { 4 | SunOutlined, 5 | MoonOutlined, 6 | PlusCircleOutlined, 7 | LockOutlined, 8 | GithubOutlined, 9 | } from "@ant-design/icons"; 10 | import useTheme, { ITheme } from "@/hooks/useTheme"; 11 | import AuthEdit from "../AuthEdit"; 12 | import DeviceEdit from "../DeviceEdit"; 13 | import useBoolean from "@/hooks/useBoolean"; 14 | import styles from "./index.module.less"; 15 | 16 | export default function Header() { 17 | const [themeValue, setThemeValue] = useTheme(); 18 | const [deviceEditOpen, deviceEditActions] = useBoolean(false); 19 | const [authEditOpen, authEditActions] = useBoolean(false); 20 | const { token } = theme.useToken(); 21 | const style = { 22 | color: token.colorTextLightSolid, 23 | }; 24 | 25 | const onThemeValueChange = useCallback( 26 | (checked: boolean) => { 27 | if (checked) { 28 | setThemeValue(ITheme.Dark); 29 | } else { 30 | setThemeValue(ITheme.Light); 31 | } 32 | }, 33 | [setThemeValue] 34 | ); 35 | 36 | return ( 37 | <> 38 | 39 |
40 |
Wol
41 |
42 | } 45 | unCheckedChildren={} 46 | onChange={onThemeValueChange} 47 | /> 48 |
54 | 55 |
56 |
62 | 63 |
64 |
69 | window.open("https://github.com/nashaofu/wol", "_blank") 70 | } 71 | > 72 | 73 |
74 |
75 |
76 |
77 | 78 | 83 | 84 | 89 | 90 | ); 91 | } 92 | -------------------------------------------------------------------------------- /src/errors.rs: -------------------------------------------------------------------------------- 1 | use actix_web::{HttpResponse, ResponseError, body::BoxBody, http::StatusCode}; 2 | use serde::Serialize; 3 | use serde_yaml; 4 | use std::{error::Error, fmt, io, net::AddrParseError, result, sync::PoisonError}; 5 | use surge_ping::SurgeError; 6 | 7 | pub type Result = result::Result; 8 | 9 | #[derive(Debug)] 10 | pub struct AppError { 11 | pub status_code: StatusCode, 12 | pub code: u16, 13 | pub message: String, 14 | } 15 | 16 | impl fmt::Display for AppError { 17 | // This trait requires `fmt` with this exact signature. 18 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 19 | write!(f, "AppError{self:?}") 20 | } 21 | } 22 | 23 | #[derive(Serialize, Debug)] 24 | pub struct AppErrorJson { 25 | pub code: u16, 26 | pub message: String, 27 | } 28 | 29 | impl AppError { 30 | pub fn new(status_code: StatusCode, code: u16, message: M) -> Self { 31 | AppError { 32 | status_code, 33 | code, 34 | message: message.to_string(), 35 | } 36 | } 37 | 38 | pub fn from_err(err: E) -> Self { 39 | AppError::new(StatusCode::INTERNAL_SERVER_ERROR, 500, err.to_string()) 40 | } 41 | } 42 | 43 | impl ResponseError for AppError { 44 | fn status_code(&self) -> StatusCode { 45 | self.status_code 46 | } 47 | 48 | fn error_response(&self) -> HttpResponse { 49 | HttpResponse::build(self.status_code()).json(AppErrorJson { 50 | code: self.code, 51 | message: self.message.clone(), 52 | }) 53 | } 54 | } 55 | 56 | impl From for AppError { 57 | fn from(err: anyhow::Error) -> Self { 58 | log::error!("anyhow::Error {err}"); 59 | AppError::new(StatusCode::INTERNAL_SERVER_ERROR, 500, err.to_string()) 60 | } 61 | } 62 | 63 | impl From for AppError { 64 | fn from(err: AddrParseError) -> Self { 65 | log::error!("AddrParseError {err}"); 66 | AppError::new(StatusCode::INTERNAL_SERVER_ERROR, 500, err.to_string()) 67 | } 68 | } 69 | 70 | impl From for AppError { 71 | fn from(err: SurgeError) -> Self { 72 | log::error!("SurgeError {err}"); 73 | AppError::new(StatusCode::INTERNAL_SERVER_ERROR, 500, err.to_string()) 74 | } 75 | } 76 | 77 | impl From> for AppError { 78 | fn from(err: PoisonError) -> Self { 79 | log::error!("PoisonError {err}"); 80 | AppError::new(StatusCode::INTERNAL_SERVER_ERROR, 500, err.to_string()) 81 | } 82 | } 83 | 84 | impl From for AppError { 85 | fn from(err: io::Error) -> Self { 86 | log::error!("io::Error {err}"); 87 | AppError::new(StatusCode::INTERNAL_SERVER_ERROR, 500, err.to_string()) 88 | } 89 | } 90 | 91 | impl From for AppError { 92 | fn from(err: serde_yaml::Error) -> Self { 93 | log::error!("serde_yaml::Error {err}"); 94 | AppError::new(StatusCode::INTERNAL_SERVER_ERROR, 500, err.to_string()) 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /web/src/hooks/useDevices.ts: -------------------------------------------------------------------------------- 1 | import useSWR, { SWRConfiguration } from 'swr'; 2 | import useSWRMutation, { SWRMutationConfiguration } from 'swr/mutation'; 3 | import { nanoid } from 'nanoid'; 4 | import fetcher from '@/utils/fetcher'; 5 | import { Device } from '@/types/device'; 6 | 7 | type UseSaveDevicesConfig = SWRMutationConfiguration< 8 | Device[], 9 | Error, 10 | '/device/save', 11 | Device[] 12 | >; 13 | 14 | export function useDevices(config?: SWRConfiguration) { 15 | return useSWR( 16 | '/device/all', 17 | async (url) => { 18 | const resp = await fetcher.get[]>(url); 19 | const devices = resp.map((item) => ({ 20 | ...item, 21 | uid: nanoid(), 22 | })); 23 | 24 | return devices; 25 | }, 26 | { 27 | revalidateOnFocus: false, 28 | ...config, 29 | }, 30 | ); 31 | } 32 | 33 | export function useSaveDevices(config?: UseSaveDevicesConfig) { 34 | const { mutate } = useDevices(); 35 | return useSWRMutation( 36 | '/device/save', 37 | async (url, { arg }: { arg: Device[] }) => { 38 | const resp = await fetcher.post[]>( 39 | url, 40 | arg.map((item) => ({ 41 | ...item, 42 | uid: undefined, 43 | })), 44 | ); 45 | 46 | const devices: Device[] = resp.map((item) => ({ 47 | ...item, 48 | uid: nanoid(), 49 | })); 50 | 51 | await mutate(devices); 52 | 53 | return devices; 54 | }, 55 | config, 56 | ); 57 | } 58 | 59 | export function useAddDevice(config?: UseSaveDevicesConfig) { 60 | const { data: devices = [] } = useDevices(); 61 | const saveDevices = useSaveDevices(config); 62 | 63 | return { 64 | ...saveDevices, 65 | trigger: (device: Omit) => { 66 | devices.push({ 67 | ...device, 68 | uid: nanoid(), 69 | }); 70 | 71 | return saveDevices.trigger(devices); 72 | }, 73 | }; 74 | } 75 | 76 | export function useUpdateDevice(config?: UseSaveDevicesConfig) { 77 | const { data: devices = [] } = useDevices(); 78 | const saveDevices = useSaveDevices(config); 79 | 80 | return { 81 | ...saveDevices, 82 | trigger: (device: Device) => { 83 | const index = devices.findIndex((item) => item.uid === device.uid); 84 | if (index !== -1) { 85 | devices[index] = device; 86 | } 87 | 88 | return saveDevices.trigger(devices); 89 | }, 90 | }; 91 | } 92 | 93 | export function useDeleteDevice(config?: UseSaveDevicesConfig) { 94 | const { data: devices = [] } = useDevices(); 95 | const saveDevices = useSaveDevices(config); 96 | 97 | return { 98 | ...saveDevices, 99 | trigger: (device: Device) => saveDevices.trigger(devices.filter((item) => item.uid !== device.uid)), 100 | }; 101 | } 102 | 103 | export function useWakeDevice( 104 | config?: SWRMutationConfiguration, 105 | ) { 106 | return useSWRMutation( 107 | '/device/wake', 108 | async (url, { arg }: { arg: Device }) => { 109 | await fetcher.post(url, arg); 110 | // 延迟 10s, 等待机器开机 111 | await new Promise((resolve) => { 112 | setTimeout(() => resolve(), 10000); 113 | }); 114 | }, 115 | config, 116 | ); 117 | } 118 | -------------------------------------------------------------------------------- /web/src/components/AuthEdit/index.tsx: -------------------------------------------------------------------------------- 1 | import { useCallback, useEffect } from 'react'; 2 | import { 3 | Form, Input, Modal, Switch, 4 | } from 'antd'; 5 | import { get } from 'lodash-es'; 6 | import useMessage from '@/hooks/useMessage'; 7 | import { useAuth, useSaveAuth } from '@/hooks/useAuth'; 8 | import { Auth } from '@/types/auth'; 9 | 10 | export interface AuthEditModel extends Auth { 11 | enable: boolean; 12 | } 13 | 14 | export interface AuthEditProps { 15 | open: boolean; 16 | onOk: () => unknown; 17 | onCancel: () => unknown; 18 | } 19 | 20 | export default function AuthEdit({ open, onOk, onCancel }: AuthEditProps) { 21 | const [form] = Form.useForm(); 22 | const message = useMessage(); 23 | const enableValue = Form.useWatch('enable', form); 24 | 25 | const { data: auth } = useAuth(); 26 | const { isMutating: saveAuthLoading, trigger: saveAuth } = useSaveAuth({ 27 | onSuccess: () => { 28 | onOk(); 29 | message.success('保存成功'); 30 | }, 31 | onError: (err) => { 32 | message.error(get(err, 'response.data.message', '保存失败')); 33 | }, 34 | }); 35 | 36 | const loading = saveAuthLoading; 37 | 38 | const onFinish = useCallback(() => { 39 | const authModel = form.getFieldsValue(); 40 | saveAuth( 41 | authModel.enable 42 | ? { 43 | username: authModel.username, 44 | password: authModel.password, 45 | } 46 | : null, 47 | ); 48 | }, [form, saveAuth]); 49 | 50 | useEffect(() => { 51 | if (!open) { 52 | return; 53 | } 54 | 55 | form.setFieldsValue({ 56 | enable: !!auth, 57 | username: auth?.username, 58 | password: auth?.password, 59 | }); 60 | 61 | // eslint-disable-next-line react-hooks/exhaustive-deps 62 | }, [open]); 63 | 64 | return ( 65 | 80 |
87 | 94 | 95 | 96 | {enableValue && ( 97 | <> 98 | 116 | 117 | 118 | 129 | 130 | 131 | 132 | )} 133 |
134 |
135 | ); 136 | } 137 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wol 2 | 3 | Wol 是 wake on lan 的简写,是一个轻量、简洁的 Wol 管理服务,支持检测设备是否开机成功。 4 | 5 | ## 功能特性 6 | 7 | - 部署简单,且可私有部署。 8 | - 默认使用 yaml 作为配置文件,易于编辑与迁移。 9 | - 主题切换:支持浅色主题与暗黑主题。 10 | - 占用资源少,运行速度快。 11 | - 跨平台:可以在 Linux、macOS 和 Windows 操作系统上运行。 12 | - 支持 basic auth,保护服务配置 13 | - 支持检测设备是否启动(设备需支持 ping) 14 | 15 | ## 项目截图 16 | 17 | | 截图说明 | 截图 | 18 | | ------------ | ------------------------------------------------------- | 19 | | 浅色主题 | ![浅色主题](resources/screenshots/浅色主题.png) | 20 | | 深色主题 | ![深色主题](resources/screenshots/深色主题.png) | 21 | | 添加新设备 | ![添加新设备](resources/screenshots/添加新设备.png) | 22 | | 开启页面认证 | ![开启页面认证](resources/screenshots/开启页面认证.png) | 23 | | 页面认证 | ![页面认证](resources/screenshots/页面认证.png) | 24 | 25 | ## 安装和使用 26 | 27 | ### Docker 中使用(Linux 推荐) 28 | 29 | 推荐使用 Docker 安装方式,使用简单方便,只需运行如下命令: 30 | 31 | ```sh 32 | docker pull ghcr.io/nashaofu/wol:latest 33 | 34 | # 使用docker host模式 35 | docker run -d \ 36 | --name wol \ 37 | --net host \ 38 | -v /path/to/wol.yaml:/opt/wol/wol.yaml \ 39 | ghcr.io/nashaofu/wol:latest 40 | 41 | # 不使用docker host模式 42 | docker run -d \ 43 | --name wol \ 44 | -p 3300:3300 \ 45 | -v /path/to/wol.yaml:/opt/wol/wol.yaml \ 46 | ghcr.io/nashaofu/wol:latest 47 | ``` 48 | 49 | 然后在浏览器中访问 `http://127.0.0.1:3300` 即可使用。 50 | 51 | 如果需要自定义配置,可将项目根目录下的 `wol.example.yaml` 文件拷贝到 `/opt/wol` 目录下并重命名为 `wol.yaml`,具体配置参考配置章节,也可以修改启动命令,指定配置文件位置。 52 | 53 | ### 系统中使用(Windows/Mac 推荐) 54 | 55 | Windows/Mac 桌面版的 docker 不支持`--net=host`,所以推荐这种使用方式。 56 | 57 | 1. 前往[release](https://github.com/nashaofu/wol/releases)页面下载`wol-xxxx.zip`,`xxxx`表示系统架构,请根据自己的情况选择 58 | 2. 解压出`wol-xxxx.zip`中的可执行文件,然后在终端中运行即可启动服务。同时也支持在启动时指定服务的端口号与配置文件。 59 | 60 | ```bash 61 | Usage: wol [OPTIONS] 62 | 63 | Options: 64 | -p, --port App listen port [default: 3300] 65 | -c, --config Config file path [default: ./wol.yaml] 66 | -h, --help Print help 67 | -V, --version Print version 68 | ``` 69 | 70 | ## 配置 71 | 72 | 项目配置文件为`wol.yaml`,配置内容如下: 73 | 74 | ```yaml 75 | # basic auth 配置,auth 可为 null,表示关闭认证 76 | auth: 77 | username: "" 78 | password: "" 79 | # 设备列表 80 | devices: 81 | - name: Windows # 设备名称 82 | mac: 00:00:00:00:00:00 # 设备 mac 地址 83 | ip: 192.168.1.1 # 设备 ipv4 地址 84 | netmask: 255.255.255.0 # 子网掩码 85 | port: 9 # wake on lan 唤醒端口号,一般为 9、7 或者 0 86 | ``` 87 | 88 | ## 特别说明 89 | 90 | 在这个项目中,我们使用了[Wake-On-Lan(WOL)](https://en.wikipedia.org/wiki/Wake-on-LAN)技术来实现远程唤醒功能,WOL 是一种网络唤醒技术,可以让计算机在休眠或关机状态下通过局域网进行唤醒操作。 91 | 92 | 为了启用 WOL 功能,我们需要完成以下准备工作(以 Windows 为例): 93 | 94 | 1. 进入计算机的主板 BIOS 设置并打开 Wake On Lan 选项。需要注意的是,不同品牌的主板可能有不同的设置名称,因此请参考相应品牌的主板设置指南。 95 | 2. 在设备管理器中找到电脑网卡,右键属性,在电源管理选项中勾选`允许此设备唤醒计算机`以及`只允许幻数据包唤醒计算机` 96 | 3. 在 Wol 网页中添加设备,然后配置以下内容: 97 | 1. MAC 地址:配置为用于唤醒设备的网卡(通常为有线网卡)的 MAC 地址 98 | 2. IP 地址:目标主机的局域网 IP 地址 99 | 3. 子网掩码:当前网络的子网掩码,用于指定广播数据发送到哪个子网,通常可填写 255.255.255.0 100 | 4. 端口号:WOL 唤醒接收幻包的端口,通常为 0、7、8、9 101 | 102 | 完成这些步骤后,正常情况就可以通过局域网唤醒处于休眠状态或关机状态的计算机了。其中 1、2 步可参考:https://sspai.com/post/67003 103 | 104 | ## 贡献指南 105 | 106 | 如果您想为 Wol 做出贡献,可以按照以下步骤进行: 107 | 108 | 1. 克隆项目到本地: 109 | 110 | ```sh 111 | git clone https://github.com/nashaofu/wol.git 112 | ``` 113 | 114 | 2. 创建新分支: 115 | 116 | ```sh 117 | git checkout -b my-feature-branch 118 | ``` 119 | 120 | 3. 启动项目:你需要安装 rust、nodejs 与 pnpm 121 | 122 | ```sh 123 | # 启动服务端项目 124 | cargo run 125 | # 启动前端项目 126 | cd client && pnpm i && pnpm dev 127 | ``` 128 | 129 | 4. 修改并提交代码: 130 | 131 | ```sh 132 | git add . 133 | git commit -m "Add new feature" 134 | ``` 135 | 136 | 5. 推送代码到远程仓库: 137 | 138 | ```sh 139 | git push origin my-feature-branch 140 | ``` 141 | 142 | 6. 创建 Pull Request:在 GitHub 上创建一个新的 Pull Request 并等待审核。 143 | 144 | ## 许可证 145 | 146 | Wol 使用 Apache 许可证,详情请参阅 [LICENSE](LICENSE) 文件。 147 | -------------------------------------------------------------------------------- /src/middleware.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | fmt, 3 | future::{Ready, ready}, 4 | rc::Rc, 5 | }; 6 | 7 | use actix_web::{ 8 | Error, HttpResponse, ResponseError, 9 | body::BoxBody, 10 | dev::{Service, ServiceRequest, ServiceResponse, Transform, forward_ready}, 11 | http::{ 12 | StatusCode, 13 | header::{AUTHORIZATION, WWW_AUTHENTICATE}, 14 | }, 15 | }; 16 | use anyhow::{Result, anyhow}; 17 | use base64::prelude::{BASE64_STANDARD, Engine}; 18 | use futures_util::future::LocalBoxFuture; 19 | 20 | use crate::{errors::AppError, settings::SETTINGS}; 21 | 22 | fn parse_header(req: &ServiceRequest) -> Result<(String, String)> { 23 | let header = req 24 | .headers() 25 | .get(AUTHORIZATION) 26 | .ok_or(anyhow!("failed get header"))?; 27 | 28 | // "Basic *" length 29 | if header.len() < 7 { 30 | return Err(anyhow!("failed parse header")); 31 | } 32 | 33 | let mut parts = header.to_str()?.splitn(2, ' '); 34 | let is_basic = parts.next().is_some_and(|scheme| scheme == "Basic"); 35 | 36 | if !is_basic { 37 | return Err(anyhow!("failed parse header")); 38 | } 39 | 40 | let decoded = 41 | BASE64_STANDARD.decode(parts.next().ok_or(anyhow!("failed get header content"))?)?; 42 | 43 | let credentials = String::from_utf8(decoded)?; 44 | let mut credentials = credentials.splitn(2, ':'); 45 | 46 | let user_id = credentials 47 | .next() 48 | .ok_or(anyhow!("failed get user_id")) 49 | .map(|user_id| user_id.to_string())?; 50 | 51 | let password = credentials 52 | .next() 53 | .ok_or(anyhow!("failed get password")) 54 | .map(|password| password.to_string())?; 55 | 56 | Ok((user_id, password)) 57 | } 58 | 59 | // There are two steps in middleware processing. 60 | // 1. Middleware initialization, middleware factory gets called with 61 | // next service in chain as parameter. 62 | // 2. Middleware's call method gets called with normal request. 63 | pub struct BasicAuth; 64 | 65 | // Middleware factory is `Transform` trait 66 | // `S` - type of the next service 67 | // `B` - type of response's body 68 | impl Transform for BasicAuth 69 | where 70 | S: Service, Error = Error> + 'static, 71 | S::Future: 'static, 72 | B: 'static, 73 | { 74 | type Response = ServiceResponse; 75 | type Error = Error; 76 | type InitError = (); 77 | type Transform = BasicAuthMiddleware; 78 | type Future = Ready>; 79 | 80 | fn new_transform(&self, service: S) -> Self::Future { 81 | ready(Ok(BasicAuthMiddleware { 82 | service: Rc::new(service), 83 | })) 84 | } 85 | } 86 | 87 | pub struct BasicAuthMiddleware { 88 | service: Rc, 89 | } 90 | 91 | impl Service for BasicAuthMiddleware 92 | where 93 | S: Service, Error = Error> + 'static, 94 | S::Future: 'static, 95 | B: 'static, 96 | { 97 | type Response = ServiceResponse; 98 | type Error = Error; 99 | type Future = LocalBoxFuture<'static, Result>; 100 | 101 | forward_ready!(service); 102 | 103 | fn call(&self, req: ServiceRequest) -> Self::Future { 104 | let service = Rc::clone(&self.service); 105 | 106 | Box::pin(async move { 107 | let auth = { 108 | // 确保锁被释放掉, 否则 RwLock 会死锁 109 | let auth = &SETTINGS.read().map_err(AppError::from)?.auth; 110 | 111 | auth.clone() 112 | }; 113 | if let Some(auth) = auth { 114 | let (user_id, password) = parse_header(&req).map_err(|_| BasicAuthError)?; 115 | if auth.username == user_id && auth.password == password { 116 | let res = service.call(req).await?; 117 | Ok(res) 118 | } else { 119 | Err(BasicAuthError.into()) 120 | } 121 | } else { 122 | let res = service.call(req).await?; 123 | Ok(res) 124 | } 125 | }) 126 | } 127 | } 128 | 129 | #[derive(Debug)] 130 | pub struct BasicAuthError; 131 | 132 | impl fmt::Display for BasicAuthError { 133 | // This trait requires `fmt` with this exact signature. 134 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 135 | write!(f, "BasicAuthError{self:?}") 136 | } 137 | } 138 | 139 | impl ResponseError for BasicAuthError { 140 | fn status_code(&self) -> StatusCode { 141 | StatusCode::UNAUTHORIZED 142 | } 143 | 144 | fn error_response(&self) -> HttpResponse { 145 | HttpResponse::build(self.status_code()) 146 | .insert_header((WWW_AUTHENTICATE, "Basic")) 147 | .finish() 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /web/src/components/DeviceCard/index.tsx: -------------------------------------------------------------------------------- 1 | import { useCallback } from "react"; 2 | import { Dropdown, MenuProps, theme } from "antd"; 3 | import { 4 | CopyOutlined, 5 | DeleteOutlined, 6 | EditOutlined, 7 | LoadingOutlined, 8 | MoreOutlined, 9 | PoweroffOutlined, 10 | } from "@ant-design/icons"; 11 | import useSWR from "swr"; 12 | import { get } from "lodash-es"; 13 | import { Device, DeviceStatus } from "@/types/device"; 14 | import useMessage from "@/hooks/useMessage"; 15 | import useModal from "@/hooks/useModal"; 16 | import DeviceEdit from "../DeviceEdit"; 17 | import useBoolean from "@/hooks/useBoolean"; 18 | import { useDeleteDevice, useWakeDevice } from "@/hooks/useDevices"; 19 | import styles from "./index.module.less"; 20 | import fetcher from "@/utils/fetcher"; 21 | import copy from "copy-to-clipboard"; 22 | import { useAuth } from "@/hooks/useAuth"; 23 | 24 | export interface DeviceCardProps { 25 | device: Device; 26 | } 27 | 28 | export default function DeviceCard({ device }: DeviceCardProps) { 29 | const { token } = theme.useToken(); 30 | const message = useMessage(); 31 | const modal = useModal(); 32 | const [open, actions] = useBoolean(false); 33 | 34 | const { data: auth } = useAuth(); 35 | 36 | const { 37 | data: status, 38 | isLoading, 39 | mutate: fetchDeviceStatus, 40 | } = useSWR( 41 | `/device/status/${device.ip}`, 42 | (url) => fetcher.get(url), 43 | { 44 | refreshInterval: 7000, 45 | } 46 | ); 47 | 48 | const { isMutating: isWaking, trigger: wakeDevice } = useWakeDevice({ 49 | onSuccess: () => { 50 | fetchDeviceStatus(); 51 | }, 52 | onError: (err) => { 53 | message.error(get(err, "response.data.message", "开机失败")); 54 | }, 55 | }); 56 | 57 | const { trigger: deleteDevice } = useDeleteDevice({ 58 | onSuccess: () => { 59 | message.success("删除成功"); 60 | }, 61 | onError: (err) => { 62 | message.error(get(err, "response.data.message", "删除失败")); 63 | }, 64 | }); 65 | 66 | const onWake = useCallback(() => { 67 | if (isWaking) { 68 | return; 69 | } 70 | wakeDevice(device); 71 | }, [isWaking, device, wakeDevice]); 72 | 73 | const items: MenuProps["items"] = [ 74 | { 75 | key: "edit", 76 | icon: , 77 | label: "编辑", 78 | onClick: actions.setTrue, 79 | }, 80 | { 81 | key: "copy-curl", 82 | icon: , 83 | label: "拷贝 cURL", 84 | onClick: () => { 85 | const url = `${window.location.origin}/api/device/wake`; 86 | const body = JSON.stringify({ 87 | ip: device.ip, 88 | port: device.port, 89 | mac: device.mac, 90 | netmask: device.netmask, 91 | }); 92 | const token = auth ? `${auth.username}:${auth.password}` : ""; 93 | const curlArgs = [ 94 | `-X POST '${url}'`, 95 | `-H 'Content-Type: application/json'`, 96 | token ? `-H 'Authorization: Basic ${window.btoa(token)}'` : "", 97 | `--data-raw '${body}'`, 98 | ].filter(Boolean); 99 | 100 | copy(`curl ${curlArgs.join(" \\\n ")}`); 101 | message.success("cURL 已复制到剪贴板"); 102 | }, 103 | }, 104 | { 105 | key: "delete", 106 | icon: , 107 | label: "删除", 108 | onClick: () => { 109 | modal.confirm({ 110 | title: "删除", 111 | content: `确认删除设备 ${device.name} 吗?`, 112 | onOk: () => deleteDevice(device), 113 | }); 114 | }, 115 | }, 116 | ]; 117 | 118 | return ( 119 | <> 120 |
127 |
134 | 135 |
136 |
137 |
{device.name}
138 |
{device.mac}
139 |
140 | {status === DeviceStatus.Online && ( 141 |
147 | )} 148 | {(isLoading || isWaking) && ( 149 |
155 | 156 |
157 | )} 158 |
159 | 165 |
166 | 167 |
168 |
169 |
170 |
171 | 172 | 178 | 179 | ); 180 | } 181 | -------------------------------------------------------------------------------- /web/src/components/DeviceEdit/index.tsx: -------------------------------------------------------------------------------- 1 | import { useCallback, useEffect } from "react"; 2 | import { Form, Input, Modal, InputNumber } from "antd"; 3 | import { get } from "lodash-es"; 4 | import { Device } from "@/types/device"; 5 | import useMessage from "@/hooks/useMessage"; 6 | import { useAddDevice, useUpdateDevice } from "@/hooks/useDevices"; 7 | 8 | export type DeviceEditModel = Omit; 9 | 10 | export interface DeviceEditProps { 11 | device?: Device | null; 12 | open: boolean; 13 | onOk: () => unknown; 14 | onCancel: () => unknown; 15 | } 16 | 17 | export default function DeviceEdit({ 18 | device, 19 | open, 20 | onOk, 21 | onCancel, 22 | }: DeviceEditProps) { 23 | const [form] = Form.useForm(); 24 | const message = useMessage(); 25 | const { isMutating: addDeviceLoading, trigger: addDevice } = useAddDevice({ 26 | onSuccess: () => { 27 | onOk(); 28 | message.success("添加成功"); 29 | }, 30 | onError: (err) => { 31 | message.error(get(err, "response.data.message", "添加失败")); 32 | }, 33 | }); 34 | const { isMutating: updateDeviceLoading, trigger: updateDevice } = 35 | useUpdateDevice({ 36 | onSuccess: () => { 37 | onOk(); 38 | message.success("保存成功"); 39 | }, 40 | onError: (err) => { 41 | message.error(get(err, "response.data.message", "保存失败")); 42 | }, 43 | }); 44 | 45 | const loading = addDeviceLoading || updateDeviceLoading; 46 | 47 | const onFinish = useCallback(() => { 48 | const deviceModel = form.getFieldsValue(); 49 | if (device) { 50 | updateDevice({ 51 | ...deviceModel, 52 | mac: deviceModel.mac.toUpperCase(), 53 | uid: device.uid, 54 | }); 55 | } else { 56 | addDevice(deviceModel); 57 | } 58 | }, [form, device, updateDevice, addDevice]); 59 | 60 | useEffect(() => { 61 | if (!open) { 62 | return; 63 | } 64 | 65 | if (device) { 66 | form.setFieldsValue({ 67 | name: device.name, 68 | mac: device.mac.toUpperCase(), 69 | ip: device.ip, 70 | netmask: device.netmask, 71 | port: device.port, 72 | }); 73 | } else { 74 | form.resetFields(); 75 | } 76 | // eslint-disable-next-line react-hooks/exhaustive-deps 77 | }, [open]); 78 | 79 | return ( 80 | 95 |
103 | 121 | 122 | 123 | 141 | 142 | 143 | 161 | 162 | 163 | 177 | 178 | 179 | 199 | 200 | 201 |
202 |
203 | ); 204 | } 205 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | workflow_dispatch: # 手动触发 5 | push: 6 | branches: ["master"] 7 | # Publish semver tags as releases. 8 | tags: ["v*.*.*"] 9 | pull_request: 10 | branches: ["master"] 11 | 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.ref }} 14 | cancel-in-progress: true 15 | 16 | env: 17 | # Use docker.io for Docker Hub if empty 18 | REGISTRY: ghcr.io 19 | 20 | jobs: 21 | build: 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | settings: 26 | - target: x86_64-apple-darwin 27 | host: macos-latest 28 | build: | 29 | cargo build --release --target x86_64-apple-darwin && \ 30 | mkdir build && \ 31 | cp target/x86_64-apple-darwin/release/wol build/wol && \ 32 | strip -x build/wol 33 | - target: aarch64-apple-darwin 34 | host: macos-latest 35 | build: | 36 | cargo build --release --target aarch64-apple-darwin && \ 37 | mkdir build && \ 38 | cp target/aarch64-apple-darwin/release/wol build/wol && \ 39 | strip -x build/wol 40 | 41 | - target: x86_64-pc-windows-msvc 42 | host: windows-latest 43 | build: | 44 | cargo build --release --target x86_64-pc-windows-msvc 45 | md build 46 | copy target/x86_64-pc-windows-msvc/release/wol.exe build/wol.exe 47 | - target: aarch64-pc-windows-msvc 48 | host: windows-latest 49 | build: | 50 | cargo build --release --target aarch64-pc-windows-msvc 51 | md build 52 | copy target/aarch64-pc-windows-msvc/release/wol.exe build/wol.exe 53 | 54 | - target: x86_64-unknown-linux-gnu 55 | host: ubuntu-latest 56 | build: | 57 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 58 | cross build --release --target x86_64-unknown-linux-gnu && \ 59 | mkdir build && \ 60 | cp target/x86_64-unknown-linux-gnu/release/wol build/wol && \ 61 | strip -x build/wol 62 | - target: x86_64-unknown-linux-musl 63 | host: ubuntu-latest 64 | build: | 65 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 66 | cross build --release --target x86_64-unknown-linux-musl && \ 67 | mkdir build && \ 68 | cp target/x86_64-unknown-linux-musl/release/wol build/wol && \ 69 | strip -x build/wol 70 | 71 | - target: aarch64-unknown-linux-gnu 72 | host: ubuntu-latest 73 | build: | 74 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 75 | cross build --release --target aarch64-unknown-linux-gnu && \ 76 | mkdir build && \ 77 | cp target/aarch64-unknown-linux-gnu/release/wol build/wol 78 | - target: aarch64-unknown-linux-musl 79 | host: ubuntu-latest 80 | build: | 81 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 82 | cross build --release --target aarch64-unknown-linux-musl && \ 83 | mkdir build && \ 84 | cp target/aarch64-unknown-linux-musl/release/wol build/wol 85 | - target: armv7-unknown-linux-gnueabi 86 | host: ubuntu-latest 87 | build: | 88 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 89 | cross build --release --target armv7-unknown-linux-gnueabi && \ 90 | mkdir build && \ 91 | cp target/armv7-unknown-linux-gnueabi/release/wol build/wol 92 | - target: armv7-unknown-linux-gnueabihf 93 | host: ubuntu-latest 94 | build: | 95 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 96 | cross build --release --target armv7-unknown-linux-gnueabihf && \ 97 | mkdir build && \ 98 | cp target/armv7-unknown-linux-gnueabihf/release/wol build/wol 99 | - target: armv7-unknown-linux-musleabi 100 | host: ubuntu-latest 101 | build: | 102 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 103 | cross build --release --target armv7-unknown-linux-musleabi && \ 104 | mkdir build && \ 105 | cp target/armv7-unknown-linux-musleabi/release/wol build/wol 106 | - target: armv7-unknown-linux-musleabihf 107 | host: ubuntu-latest 108 | build: | 109 | cargo install cross --force --git https://github.com/cross-rs/cross && \ 110 | cross build --release --target armv7-unknown-linux-musleabihf && \ 111 | mkdir build && \ 112 | cp target/armv7-unknown-linux-musleabihf/release/wol build/wol 113 | 114 | name: build ${{ matrix.settings.target }} 115 | runs-on: ${{ matrix.settings.host }} 116 | steps: 117 | - name: Checkout repository 118 | uses: actions/checkout@v4 119 | - name: Cache cargo 120 | uses: actions/cache@v4 121 | with: 122 | path: | 123 | ~/.cargo/bin/ 124 | ~/.cargo/registry/index/ 125 | ~/.cargo/registry/cache/ 126 | ~/.cargo/git/db/ 127 | target/ 128 | key: ${{ runner.os }}-${{ matrix.settings.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} 129 | - name: Install rust toolchain 130 | uses: dtolnay/rust-toolchain@stable 131 | with: 132 | toolchain: stable 133 | target: ${{ matrix.settings.target }} 134 | 135 | - name: Install pnpm 136 | uses: pnpm/action-setup@v4 137 | with: 138 | version: 10 139 | run_install: false 140 | - name: Setup Node.js 141 | uses: actions/setup-node@v4 142 | with: 143 | node-version: latest 144 | cache: "pnpm" 145 | cache-dependency-path: web/pnpm-lock.yaml 146 | - name: Build web 147 | run: pnpm i && pnpm build 148 | working-directory: web 149 | 150 | - name: Move web files to www 151 | run: mv web/dist/* www 152 | 153 | - name: Build server 154 | run: ${{ matrix.settings.build }} 155 | 156 | - name: Upload artifact 157 | uses: actions/upload-artifact@v4 158 | with: 159 | name: wol-${{ matrix.settings.target }} 160 | path: build/ 161 | if-no-files-found: error 162 | 163 | publish: 164 | runs-on: ubuntu-latest 165 | needs: 166 | - build 167 | if: startsWith(github.ref, 'refs/tags/') 168 | steps: 169 | - name: Checkout repository 170 | uses: actions/checkout@v4 171 | - name: Download all artifact 172 | uses: actions/download-artifact@v4 173 | with: 174 | path: artifacts 175 | - name: Display structure of downloaded files 176 | run: ls -R 177 | working-directory: artifacts 178 | - name: Pack as zip file 179 | run: ls | xargs -I filename zip -r -m filename.zip filename 180 | working-directory: artifacts 181 | - name: Display structure of zip files 182 | run: ls -R 183 | working-directory: artifacts 184 | - name: Release 185 | uses: softprops/action-gh-release@v2 186 | with: 187 | files: artifacts/*.zip 188 | 189 | docker: 190 | runs-on: ubuntu-latest 191 | needs: 192 | - publish 193 | if: startsWith(github.ref, 'refs/tags/') 194 | steps: 195 | - name: Checkout repository 196 | uses: actions/checkout@v4 197 | - name: Setup QEMU 198 | uses: docker/setup-qemu-action@v3 199 | 200 | - name: Setup docker buildx 201 | uses: docker/setup-buildx-action@v3 202 | 203 | # https://github.com/docker/login-action 204 | - name: Login to ${{ env.REGISTRY }} 205 | uses: docker/login-action@v3 206 | with: 207 | registry: ${{ env.REGISTRY }} 208 | username: ${{ github.actor }} 209 | password: ${{ secrets.GITHUB_TOKEN }} 210 | 211 | - name: Build and push Docker images 212 | uses: docker/build-push-action@v6 213 | with: 214 | context: . 215 | platforms: linux/amd64,linux/arm64 216 | push: true 217 | tags: ${{ env.REGISTRY }}/nashaofu/wol:latest,${{ env.REGISTRY }}/nashaofu/wol:${{ github.ref_name }} 218 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "actix-codec" 7 | version = "0.5.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" 10 | dependencies = [ 11 | "bitflags", 12 | "bytes", 13 | "futures-core", 14 | "futures-sink", 15 | "memchr", 16 | "pin-project-lite", 17 | "tokio", 18 | "tokio-util", 19 | "tracing", 20 | ] 21 | 22 | [[package]] 23 | name = "actix-http" 24 | version = "3.11.0" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "44dfe5c9e0004c623edc65391dfd51daa201e7e30ebd9c9bedf873048ec32bc2" 27 | dependencies = [ 28 | "actix-codec", 29 | "actix-rt", 30 | "actix-service", 31 | "actix-utils", 32 | "base64 0.22.1", 33 | "bitflags", 34 | "bytes", 35 | "bytestring", 36 | "derive_more", 37 | "encoding_rs", 38 | "foldhash", 39 | "futures-core", 40 | "http", 41 | "httparse", 42 | "httpdate", 43 | "itoa", 44 | "language-tags", 45 | "local-channel", 46 | "mime", 47 | "percent-encoding", 48 | "pin-project-lite", 49 | "rand", 50 | "sha1", 51 | "smallvec", 52 | "tokio", 53 | "tokio-util", 54 | "tracing", 55 | ] 56 | 57 | [[package]] 58 | name = "actix-macros" 59 | version = "0.2.4" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" 62 | dependencies = [ 63 | "quote", 64 | "syn", 65 | ] 66 | 67 | [[package]] 68 | name = "actix-router" 69 | version = "0.5.3" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" 72 | dependencies = [ 73 | "bytestring", 74 | "cfg-if", 75 | "http", 76 | "regex-lite", 77 | "serde", 78 | "tracing", 79 | ] 80 | 81 | [[package]] 82 | name = "actix-rt" 83 | version = "2.10.0" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" 86 | dependencies = [ 87 | "futures-core", 88 | "tokio", 89 | ] 90 | 91 | [[package]] 92 | name = "actix-server" 93 | version = "2.6.0" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "a65064ea4a457eaf07f2fba30b4c695bf43b721790e9530d26cb6f9019ff7502" 96 | dependencies = [ 97 | "actix-rt", 98 | "actix-service", 99 | "actix-utils", 100 | "futures-core", 101 | "futures-util", 102 | "mio", 103 | "socket2", 104 | "tokio", 105 | "tracing", 106 | ] 107 | 108 | [[package]] 109 | name = "actix-service" 110 | version = "2.0.3" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "9e46f36bf0e5af44bdc4bdb36fbbd421aa98c79a9bce724e1edeb3894e10dc7f" 113 | dependencies = [ 114 | "futures-core", 115 | "pin-project-lite", 116 | ] 117 | 118 | [[package]] 119 | name = "actix-utils" 120 | version = "3.0.1" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" 123 | dependencies = [ 124 | "local-waker", 125 | "pin-project-lite", 126 | ] 127 | 128 | [[package]] 129 | name = "actix-web" 130 | version = "4.11.0" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "a597b77b5c6d6a1e1097fddde329a83665e25c5437c696a3a9a4aa514a614dea" 133 | dependencies = [ 134 | "actix-codec", 135 | "actix-http", 136 | "actix-macros", 137 | "actix-router", 138 | "actix-rt", 139 | "actix-server", 140 | "actix-service", 141 | "actix-utils", 142 | "actix-web-codegen", 143 | "bytes", 144 | "bytestring", 145 | "cfg-if", 146 | "derive_more", 147 | "encoding_rs", 148 | "foldhash", 149 | "futures-core", 150 | "futures-util", 151 | "impl-more", 152 | "itoa", 153 | "language-tags", 154 | "log", 155 | "mime", 156 | "once_cell", 157 | "pin-project-lite", 158 | "regex-lite", 159 | "serde", 160 | "serde_json", 161 | "serde_urlencoded", 162 | "smallvec", 163 | "socket2", 164 | "time", 165 | "tracing", 166 | "url", 167 | ] 168 | 169 | [[package]] 170 | name = "actix-web-codegen" 171 | version = "4.3.0" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" 174 | dependencies = [ 175 | "actix-router", 176 | "proc-macro2", 177 | "quote", 178 | "syn", 179 | ] 180 | 181 | [[package]] 182 | name = "addr2line" 183 | version = "0.24.2" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 186 | dependencies = [ 187 | "gimli", 188 | ] 189 | 190 | [[package]] 191 | name = "adler2" 192 | version = "2.0.1" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 195 | 196 | [[package]] 197 | name = "aho-corasick" 198 | version = "1.1.3" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 201 | dependencies = [ 202 | "memchr", 203 | ] 204 | 205 | [[package]] 206 | name = "anstream" 207 | version = "0.6.19" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" 210 | dependencies = [ 211 | "anstyle", 212 | "anstyle-parse", 213 | "anstyle-query", 214 | "anstyle-wincon", 215 | "colorchoice", 216 | "is_terminal_polyfill", 217 | "utf8parse", 218 | ] 219 | 220 | [[package]] 221 | name = "anstyle" 222 | version = "1.0.11" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" 225 | 226 | [[package]] 227 | name = "anstyle-parse" 228 | version = "0.2.7" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" 231 | dependencies = [ 232 | "utf8parse", 233 | ] 234 | 235 | [[package]] 236 | name = "anstyle-query" 237 | version = "1.1.3" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" 240 | dependencies = [ 241 | "windows-sys 0.59.0", 242 | ] 243 | 244 | [[package]] 245 | name = "anstyle-wincon" 246 | version = "3.0.9" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" 249 | dependencies = [ 250 | "anstyle", 251 | "once_cell_polyfill", 252 | "windows-sys 0.59.0", 253 | ] 254 | 255 | [[package]] 256 | name = "anyhow" 257 | version = "1.0.98" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" 260 | 261 | [[package]] 262 | name = "arraydeque" 263 | version = "0.5.1" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" 266 | 267 | [[package]] 268 | name = "autocfg" 269 | version = "1.5.0" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 272 | 273 | [[package]] 274 | name = "backtrace" 275 | version = "0.3.75" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" 278 | dependencies = [ 279 | "addr2line", 280 | "cfg-if", 281 | "libc", 282 | "miniz_oxide", 283 | "object", 284 | "rustc-demangle", 285 | "windows-targets", 286 | ] 287 | 288 | [[package]] 289 | name = "base64" 290 | version = "0.21.7" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 293 | 294 | [[package]] 295 | name = "base64" 296 | version = "0.22.1" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 299 | 300 | [[package]] 301 | name = "bitflags" 302 | version = "2.9.1" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" 305 | dependencies = [ 306 | "serde", 307 | ] 308 | 309 | [[package]] 310 | name = "block-buffer" 311 | version = "0.10.4" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 314 | dependencies = [ 315 | "generic-array", 316 | ] 317 | 318 | [[package]] 319 | name = "bytes" 320 | version = "1.10.1" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 323 | 324 | [[package]] 325 | name = "bytestring" 326 | version = "1.4.0" 327 | source = "registry+https://github.com/rust-lang/crates.io-index" 328 | checksum = "e465647ae23b2823b0753f50decb2d5a86d2bb2cac04788fafd1f80e45378e5f" 329 | dependencies = [ 330 | "bytes", 331 | ] 332 | 333 | [[package]] 334 | name = "cfg-if" 335 | version = "1.0.1" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" 338 | 339 | [[package]] 340 | name = "clap" 341 | version = "4.5.41" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" 344 | dependencies = [ 345 | "clap_builder", 346 | "clap_derive", 347 | ] 348 | 349 | [[package]] 350 | name = "clap_builder" 351 | version = "4.5.41" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" 354 | dependencies = [ 355 | "anstream", 356 | "anstyle", 357 | "clap_lex", 358 | "strsim", 359 | ] 360 | 361 | [[package]] 362 | name = "clap_derive" 363 | version = "4.5.41" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" 366 | dependencies = [ 367 | "heck", 368 | "proc-macro2", 369 | "quote", 370 | "syn", 371 | ] 372 | 373 | [[package]] 374 | name = "clap_lex" 375 | version = "0.7.5" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" 378 | 379 | [[package]] 380 | name = "colorchoice" 381 | version = "1.0.4" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" 384 | 385 | [[package]] 386 | name = "config" 387 | version = "0.15.13" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "5b1eb4fb07bc7f012422df02766c7bd5971effb894f573865642f06fa3265440" 390 | dependencies = [ 391 | "pathdiff", 392 | "ron", 393 | "serde", 394 | "winnow", 395 | "yaml-rust2", 396 | ] 397 | 398 | [[package]] 399 | name = "cpufeatures" 400 | version = "0.2.17" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" 403 | dependencies = [ 404 | "libc", 405 | ] 406 | 407 | [[package]] 408 | name = "crypto-common" 409 | version = "0.1.6" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 412 | dependencies = [ 413 | "generic-array", 414 | "typenum", 415 | ] 416 | 417 | [[package]] 418 | name = "deranged" 419 | version = "0.4.0" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" 422 | dependencies = [ 423 | "powerfmt", 424 | ] 425 | 426 | [[package]] 427 | name = "derive_more" 428 | version = "2.0.1" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" 431 | dependencies = [ 432 | "derive_more-impl", 433 | ] 434 | 435 | [[package]] 436 | name = "derive_more-impl" 437 | version = "2.0.1" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" 440 | dependencies = [ 441 | "proc-macro2", 442 | "quote", 443 | "syn", 444 | "unicode-xid", 445 | ] 446 | 447 | [[package]] 448 | name = "digest" 449 | version = "0.10.7" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 452 | dependencies = [ 453 | "block-buffer", 454 | "crypto-common", 455 | ] 456 | 457 | [[package]] 458 | name = "displaydoc" 459 | version = "0.2.5" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 462 | dependencies = [ 463 | "proc-macro2", 464 | "quote", 465 | "syn", 466 | ] 467 | 468 | [[package]] 469 | name = "dotenv" 470 | version = "0.15.0" 471 | source = "registry+https://github.com/rust-lang/crates.io-index" 472 | checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" 473 | 474 | [[package]] 475 | name = "encoding_rs" 476 | version = "0.8.35" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 479 | dependencies = [ 480 | "cfg-if", 481 | ] 482 | 483 | [[package]] 484 | name = "env_filter" 485 | version = "0.1.3" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" 488 | dependencies = [ 489 | "log", 490 | "regex", 491 | ] 492 | 493 | [[package]] 494 | name = "env_logger" 495 | version = "0.11.8" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" 498 | dependencies = [ 499 | "anstream", 500 | "anstyle", 501 | "env_filter", 502 | "jiff", 503 | "log", 504 | ] 505 | 506 | [[package]] 507 | name = "equivalent" 508 | version = "1.0.2" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 511 | 512 | [[package]] 513 | name = "fnv" 514 | version = "1.0.7" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 517 | 518 | [[package]] 519 | name = "foldhash" 520 | version = "0.1.5" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" 523 | 524 | [[package]] 525 | name = "form_urlencoded" 526 | version = "1.2.1" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 529 | dependencies = [ 530 | "percent-encoding", 531 | ] 532 | 533 | [[package]] 534 | name = "futures-core" 535 | version = "0.3.31" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 538 | 539 | [[package]] 540 | name = "futures-sink" 541 | version = "0.3.31" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 544 | 545 | [[package]] 546 | name = "futures-task" 547 | version = "0.3.31" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 550 | 551 | [[package]] 552 | name = "futures-util" 553 | version = "0.3.31" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 556 | dependencies = [ 557 | "futures-core", 558 | "futures-task", 559 | "pin-project-lite", 560 | "pin-utils", 561 | ] 562 | 563 | [[package]] 564 | name = "generic-array" 565 | version = "0.14.7" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 568 | dependencies = [ 569 | "typenum", 570 | "version_check", 571 | ] 572 | 573 | [[package]] 574 | name = "getrandom" 575 | version = "0.3.3" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" 578 | dependencies = [ 579 | "cfg-if", 580 | "libc", 581 | "r-efi", 582 | "wasi 0.14.2+wasi-0.2.4", 583 | ] 584 | 585 | [[package]] 586 | name = "gimli" 587 | version = "0.31.1" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 590 | 591 | [[package]] 592 | name = "glob" 593 | version = "0.3.2" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" 596 | 597 | [[package]] 598 | name = "hashbrown" 599 | version = "0.15.4" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" 602 | dependencies = [ 603 | "foldhash", 604 | ] 605 | 606 | [[package]] 607 | name = "hashlink" 608 | version = "0.10.0" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" 611 | dependencies = [ 612 | "hashbrown", 613 | ] 614 | 615 | [[package]] 616 | name = "heck" 617 | version = "0.5.0" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 620 | 621 | [[package]] 622 | name = "hex" 623 | version = "0.4.3" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 626 | 627 | [[package]] 628 | name = "http" 629 | version = "0.2.12" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" 632 | dependencies = [ 633 | "bytes", 634 | "fnv", 635 | "itoa", 636 | ] 637 | 638 | [[package]] 639 | name = "httparse" 640 | version = "1.10.1" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 643 | 644 | [[package]] 645 | name = "httpdate" 646 | version = "1.0.3" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 649 | 650 | [[package]] 651 | name = "icu_collections" 652 | version = "2.0.0" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" 655 | dependencies = [ 656 | "displaydoc", 657 | "potential_utf", 658 | "yoke", 659 | "zerofrom", 660 | "zerovec", 661 | ] 662 | 663 | [[package]] 664 | name = "icu_locale_core" 665 | version = "2.0.0" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" 668 | dependencies = [ 669 | "displaydoc", 670 | "litemap", 671 | "tinystr", 672 | "writeable", 673 | "zerovec", 674 | ] 675 | 676 | [[package]] 677 | name = "icu_normalizer" 678 | version = "2.0.0" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" 681 | dependencies = [ 682 | "displaydoc", 683 | "icu_collections", 684 | "icu_normalizer_data", 685 | "icu_properties", 686 | "icu_provider", 687 | "smallvec", 688 | "zerovec", 689 | ] 690 | 691 | [[package]] 692 | name = "icu_normalizer_data" 693 | version = "2.0.0" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" 696 | 697 | [[package]] 698 | name = "icu_properties" 699 | version = "2.0.1" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" 702 | dependencies = [ 703 | "displaydoc", 704 | "icu_collections", 705 | "icu_locale_core", 706 | "icu_properties_data", 707 | "icu_provider", 708 | "potential_utf", 709 | "zerotrie", 710 | "zerovec", 711 | ] 712 | 713 | [[package]] 714 | name = "icu_properties_data" 715 | version = "2.0.1" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" 718 | 719 | [[package]] 720 | name = "icu_provider" 721 | version = "2.0.0" 722 | source = "registry+https://github.com/rust-lang/crates.io-index" 723 | checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" 724 | dependencies = [ 725 | "displaydoc", 726 | "icu_locale_core", 727 | "stable_deref_trait", 728 | "tinystr", 729 | "writeable", 730 | "yoke", 731 | "zerofrom", 732 | "zerotrie", 733 | "zerovec", 734 | ] 735 | 736 | [[package]] 737 | name = "idna" 738 | version = "1.0.3" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" 741 | dependencies = [ 742 | "idna_adapter", 743 | "smallvec", 744 | "utf8_iter", 745 | ] 746 | 747 | [[package]] 748 | name = "idna_adapter" 749 | version = "1.2.1" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 752 | dependencies = [ 753 | "icu_normalizer", 754 | "icu_properties", 755 | ] 756 | 757 | [[package]] 758 | name = "impl-more" 759 | version = "0.1.9" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" 762 | 763 | [[package]] 764 | name = "indexmap" 765 | version = "2.10.0" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" 768 | dependencies = [ 769 | "equivalent", 770 | "hashbrown", 771 | ] 772 | 773 | [[package]] 774 | name = "io-uring" 775 | version = "0.7.8" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" 778 | dependencies = [ 779 | "bitflags", 780 | "cfg-if", 781 | "libc", 782 | ] 783 | 784 | [[package]] 785 | name = "is_terminal_polyfill" 786 | version = "1.70.1" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 789 | 790 | [[package]] 791 | name = "itoa" 792 | version = "1.0.15" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 795 | 796 | [[package]] 797 | name = "jiff" 798 | version = "0.2.15" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" 801 | dependencies = [ 802 | "jiff-static", 803 | "log", 804 | "portable-atomic", 805 | "portable-atomic-util", 806 | "serde", 807 | ] 808 | 809 | [[package]] 810 | name = "jiff-static" 811 | version = "0.2.15" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" 814 | dependencies = [ 815 | "proc-macro2", 816 | "quote", 817 | "syn", 818 | ] 819 | 820 | [[package]] 821 | name = "language-tags" 822 | version = "0.3.2" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" 825 | 826 | [[package]] 827 | name = "lazy_static" 828 | version = "1.5.0" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 831 | 832 | [[package]] 833 | name = "libc" 834 | version = "0.2.174" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" 837 | 838 | [[package]] 839 | name = "litemap" 840 | version = "0.8.0" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" 843 | 844 | [[package]] 845 | name = "local-channel" 846 | version = "0.1.5" 847 | source = "registry+https://github.com/rust-lang/crates.io-index" 848 | checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" 849 | dependencies = [ 850 | "futures-core", 851 | "futures-sink", 852 | "local-waker", 853 | ] 854 | 855 | [[package]] 856 | name = "local-waker" 857 | version = "0.1.4" 858 | source = "registry+https://github.com/rust-lang/crates.io-index" 859 | checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" 860 | 861 | [[package]] 862 | name = "lock_api" 863 | version = "0.4.13" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" 866 | dependencies = [ 867 | "autocfg", 868 | "scopeguard", 869 | ] 870 | 871 | [[package]] 872 | name = "log" 873 | version = "0.4.27" 874 | source = "registry+https://github.com/rust-lang/crates.io-index" 875 | checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" 876 | 877 | [[package]] 878 | name = "memchr" 879 | version = "2.7.5" 880 | source = "registry+https://github.com/rust-lang/crates.io-index" 881 | checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" 882 | 883 | [[package]] 884 | name = "mime" 885 | version = "0.3.17" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 888 | 889 | [[package]] 890 | name = "mime_guess" 891 | version = "2.0.5" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" 894 | dependencies = [ 895 | "mime", 896 | "unicase", 897 | ] 898 | 899 | [[package]] 900 | name = "miniz_oxide" 901 | version = "0.8.9" 902 | source = "registry+https://github.com/rust-lang/crates.io-index" 903 | checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" 904 | dependencies = [ 905 | "adler2", 906 | ] 907 | 908 | [[package]] 909 | name = "mio" 910 | version = "1.0.4" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" 913 | dependencies = [ 914 | "libc", 915 | "log", 916 | "wasi 0.11.1+wasi-snapshot-preview1", 917 | "windows-sys 0.59.0", 918 | ] 919 | 920 | [[package]] 921 | name = "no-std-net" 922 | version = "0.6.0" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" 925 | 926 | [[package]] 927 | name = "num-conv" 928 | version = "0.1.0" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 931 | 932 | [[package]] 933 | name = "object" 934 | version = "0.36.7" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" 937 | dependencies = [ 938 | "memchr", 939 | ] 940 | 941 | [[package]] 942 | name = "once_cell" 943 | version = "1.21.3" 944 | source = "registry+https://github.com/rust-lang/crates.io-index" 945 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 946 | 947 | [[package]] 948 | name = "once_cell_polyfill" 949 | version = "1.70.1" 950 | source = "registry+https://github.com/rust-lang/crates.io-index" 951 | checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" 952 | 953 | [[package]] 954 | name = "parking_lot" 955 | version = "0.12.4" 956 | source = "registry+https://github.com/rust-lang/crates.io-index" 957 | checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" 958 | dependencies = [ 959 | "lock_api", 960 | "parking_lot_core", 961 | ] 962 | 963 | [[package]] 964 | name = "parking_lot_core" 965 | version = "0.9.11" 966 | source = "registry+https://github.com/rust-lang/crates.io-index" 967 | checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" 968 | dependencies = [ 969 | "cfg-if", 970 | "libc", 971 | "redox_syscall", 972 | "smallvec", 973 | "windows-targets", 974 | ] 975 | 976 | [[package]] 977 | name = "pathdiff" 978 | version = "0.2.3" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" 981 | 982 | [[package]] 983 | name = "percent-encoding" 984 | version = "2.3.1" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 987 | 988 | [[package]] 989 | name = "pin-project-lite" 990 | version = "0.2.16" 991 | source = "registry+https://github.com/rust-lang/crates.io-index" 992 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 993 | 994 | [[package]] 995 | name = "pin-utils" 996 | version = "0.1.0" 997 | source = "registry+https://github.com/rust-lang/crates.io-index" 998 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 999 | 1000 | [[package]] 1001 | name = "pnet_base" 1002 | version = "0.34.0" 1003 | source = "registry+https://github.com/rust-lang/crates.io-index" 1004 | checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c" 1005 | dependencies = [ 1006 | "no-std-net", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "pnet_macros" 1011 | version = "0.34.0" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "688b17499eee04a0408aca0aa5cba5fc86401d7216de8a63fdf7a4c227871804" 1014 | dependencies = [ 1015 | "proc-macro2", 1016 | "quote", 1017 | "regex", 1018 | "syn", 1019 | ] 1020 | 1021 | [[package]] 1022 | name = "pnet_macros_support" 1023 | version = "0.34.0" 1024 | source = "registry+https://github.com/rust-lang/crates.io-index" 1025 | checksum = "eea925b72f4bd37f8eab0f221bbe4c78b63498350c983ffa9dd4bcde7e030f56" 1026 | dependencies = [ 1027 | "pnet_base", 1028 | ] 1029 | 1030 | [[package]] 1031 | name = "pnet_packet" 1032 | version = "0.34.0" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "a9a005825396b7fe7a38a8e288dbc342d5034dac80c15212436424fef8ea90ba" 1035 | dependencies = [ 1036 | "glob", 1037 | "pnet_base", 1038 | "pnet_macros", 1039 | "pnet_macros_support", 1040 | ] 1041 | 1042 | [[package]] 1043 | name = "portable-atomic" 1044 | version = "1.11.1" 1045 | source = "registry+https://github.com/rust-lang/crates.io-index" 1046 | checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" 1047 | 1048 | [[package]] 1049 | name = "portable-atomic-util" 1050 | version = "0.2.4" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" 1053 | dependencies = [ 1054 | "portable-atomic", 1055 | ] 1056 | 1057 | [[package]] 1058 | name = "potential_utf" 1059 | version = "0.1.2" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" 1062 | dependencies = [ 1063 | "zerovec", 1064 | ] 1065 | 1066 | [[package]] 1067 | name = "powerfmt" 1068 | version = "0.2.0" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1071 | 1072 | [[package]] 1073 | name = "ppv-lite86" 1074 | version = "0.2.21" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" 1077 | dependencies = [ 1078 | "zerocopy", 1079 | ] 1080 | 1081 | [[package]] 1082 | name = "proc-macro2" 1083 | version = "1.0.95" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" 1086 | dependencies = [ 1087 | "unicode-ident", 1088 | ] 1089 | 1090 | [[package]] 1091 | name = "quote" 1092 | version = "1.0.40" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 1095 | dependencies = [ 1096 | "proc-macro2", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "r-efi" 1101 | version = "5.3.0" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 1104 | 1105 | [[package]] 1106 | name = "rand" 1107 | version = "0.9.1" 1108 | source = "registry+https://github.com/rust-lang/crates.io-index" 1109 | checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" 1110 | dependencies = [ 1111 | "rand_chacha", 1112 | "rand_core", 1113 | ] 1114 | 1115 | [[package]] 1116 | name = "rand_chacha" 1117 | version = "0.9.0" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" 1120 | dependencies = [ 1121 | "ppv-lite86", 1122 | "rand_core", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "rand_core" 1127 | version = "0.9.3" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" 1130 | dependencies = [ 1131 | "getrandom", 1132 | ] 1133 | 1134 | [[package]] 1135 | name = "redox_syscall" 1136 | version = "0.5.13" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" 1139 | dependencies = [ 1140 | "bitflags", 1141 | ] 1142 | 1143 | [[package]] 1144 | name = "regex" 1145 | version = "1.11.1" 1146 | source = "registry+https://github.com/rust-lang/crates.io-index" 1147 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 1148 | dependencies = [ 1149 | "aho-corasick", 1150 | "memchr", 1151 | "regex-automata", 1152 | "regex-syntax", 1153 | ] 1154 | 1155 | [[package]] 1156 | name = "regex-automata" 1157 | version = "0.4.9" 1158 | source = "registry+https://github.com/rust-lang/crates.io-index" 1159 | checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" 1160 | dependencies = [ 1161 | "aho-corasick", 1162 | "memchr", 1163 | "regex-syntax", 1164 | ] 1165 | 1166 | [[package]] 1167 | name = "regex-lite" 1168 | version = "0.1.6" 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" 1170 | checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" 1171 | 1172 | [[package]] 1173 | name = "regex-syntax" 1174 | version = "0.8.5" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1177 | 1178 | [[package]] 1179 | name = "ron" 1180 | version = "0.8.1" 1181 | source = "registry+https://github.com/rust-lang/crates.io-index" 1182 | checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" 1183 | dependencies = [ 1184 | "base64 0.21.7", 1185 | "bitflags", 1186 | "serde", 1187 | "serde_derive", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "rust-embed" 1192 | version = "8.7.2" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "025908b8682a26ba8d12f6f2d66b987584a4a87bc024abc5bbc12553a8cd178a" 1195 | dependencies = [ 1196 | "rust-embed-impl", 1197 | "rust-embed-utils", 1198 | "walkdir", 1199 | ] 1200 | 1201 | [[package]] 1202 | name = "rust-embed-impl" 1203 | version = "8.7.2" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "6065f1a4392b71819ec1ea1df1120673418bf386f50de1d6f54204d836d4349c" 1206 | dependencies = [ 1207 | "proc-macro2", 1208 | "quote", 1209 | "rust-embed-utils", 1210 | "syn", 1211 | "walkdir", 1212 | ] 1213 | 1214 | [[package]] 1215 | name = "rust-embed-utils" 1216 | version = "8.7.2" 1217 | source = "registry+https://github.com/rust-lang/crates.io-index" 1218 | checksum = "f6cc0c81648b20b70c491ff8cce00c1c3b223bb8ed2b5d41f0e54c6c4c0a3594" 1219 | dependencies = [ 1220 | "mime_guess", 1221 | "sha2", 1222 | "walkdir", 1223 | ] 1224 | 1225 | [[package]] 1226 | name = "rustc-demangle" 1227 | version = "0.1.25" 1228 | source = "registry+https://github.com/rust-lang/crates.io-index" 1229 | checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" 1230 | 1231 | [[package]] 1232 | name = "ryu" 1233 | version = "1.0.20" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 1236 | 1237 | [[package]] 1238 | name = "same-file" 1239 | version = "1.0.6" 1240 | source = "registry+https://github.com/rust-lang/crates.io-index" 1241 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1242 | dependencies = [ 1243 | "winapi-util", 1244 | ] 1245 | 1246 | [[package]] 1247 | name = "scopeguard" 1248 | version = "1.2.0" 1249 | source = "registry+https://github.com/rust-lang/crates.io-index" 1250 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1251 | 1252 | [[package]] 1253 | name = "serde" 1254 | version = "1.0.219" 1255 | source = "registry+https://github.com/rust-lang/crates.io-index" 1256 | checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" 1257 | dependencies = [ 1258 | "serde_derive", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "serde_derive" 1263 | version = "1.0.219" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" 1266 | dependencies = [ 1267 | "proc-macro2", 1268 | "quote", 1269 | "syn", 1270 | ] 1271 | 1272 | [[package]] 1273 | name = "serde_json" 1274 | version = "1.0.141" 1275 | source = "registry+https://github.com/rust-lang/crates.io-index" 1276 | checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" 1277 | dependencies = [ 1278 | "itoa", 1279 | "memchr", 1280 | "ryu", 1281 | "serde", 1282 | ] 1283 | 1284 | [[package]] 1285 | name = "serde_urlencoded" 1286 | version = "0.7.1" 1287 | source = "registry+https://github.com/rust-lang/crates.io-index" 1288 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1289 | dependencies = [ 1290 | "form_urlencoded", 1291 | "itoa", 1292 | "ryu", 1293 | "serde", 1294 | ] 1295 | 1296 | [[package]] 1297 | name = "serde_yaml" 1298 | version = "0.9.34+deprecated" 1299 | source = "registry+https://github.com/rust-lang/crates.io-index" 1300 | checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" 1301 | dependencies = [ 1302 | "indexmap", 1303 | "itoa", 1304 | "ryu", 1305 | "serde", 1306 | "unsafe-libyaml", 1307 | ] 1308 | 1309 | [[package]] 1310 | name = "sha1" 1311 | version = "0.10.6" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 1314 | dependencies = [ 1315 | "cfg-if", 1316 | "cpufeatures", 1317 | "digest", 1318 | ] 1319 | 1320 | [[package]] 1321 | name = "sha2" 1322 | version = "0.10.9" 1323 | source = "registry+https://github.com/rust-lang/crates.io-index" 1324 | checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" 1325 | dependencies = [ 1326 | "cfg-if", 1327 | "cpufeatures", 1328 | "digest", 1329 | ] 1330 | 1331 | [[package]] 1332 | name = "signal-hook-registry" 1333 | version = "1.4.5" 1334 | source = "registry+https://github.com/rust-lang/crates.io-index" 1335 | checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" 1336 | dependencies = [ 1337 | "libc", 1338 | ] 1339 | 1340 | [[package]] 1341 | name = "slab" 1342 | version = "0.4.10" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" 1345 | 1346 | [[package]] 1347 | name = "smallvec" 1348 | version = "1.15.1" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 1351 | 1352 | [[package]] 1353 | name = "socket2" 1354 | version = "0.5.10" 1355 | source = "registry+https://github.com/rust-lang/crates.io-index" 1356 | checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" 1357 | dependencies = [ 1358 | "libc", 1359 | "windows-sys 0.52.0", 1360 | ] 1361 | 1362 | [[package]] 1363 | name = "stable_deref_trait" 1364 | version = "1.2.0" 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" 1366 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1367 | 1368 | [[package]] 1369 | name = "strsim" 1370 | version = "0.11.1" 1371 | source = "registry+https://github.com/rust-lang/crates.io-index" 1372 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1373 | 1374 | [[package]] 1375 | name = "surge-ping" 1376 | version = "0.8.2" 1377 | source = "registry+https://github.com/rust-lang/crates.io-index" 1378 | checksum = "6fda78103d8016bb25c331ddc54af634e801806463682cc3e549d335df644d95" 1379 | dependencies = [ 1380 | "hex", 1381 | "parking_lot", 1382 | "pnet_packet", 1383 | "rand", 1384 | "socket2", 1385 | "thiserror", 1386 | "tokio", 1387 | "tracing", 1388 | ] 1389 | 1390 | [[package]] 1391 | name = "syn" 1392 | version = "2.0.104" 1393 | source = "registry+https://github.com/rust-lang/crates.io-index" 1394 | checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" 1395 | dependencies = [ 1396 | "proc-macro2", 1397 | "quote", 1398 | "unicode-ident", 1399 | ] 1400 | 1401 | [[package]] 1402 | name = "synstructure" 1403 | version = "0.13.2" 1404 | source = "registry+https://github.com/rust-lang/crates.io-index" 1405 | checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 1406 | dependencies = [ 1407 | "proc-macro2", 1408 | "quote", 1409 | "syn", 1410 | ] 1411 | 1412 | [[package]] 1413 | name = "thiserror" 1414 | version = "1.0.69" 1415 | source = "registry+https://github.com/rust-lang/crates.io-index" 1416 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1417 | dependencies = [ 1418 | "thiserror-impl", 1419 | ] 1420 | 1421 | [[package]] 1422 | name = "thiserror-impl" 1423 | version = "1.0.69" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 1426 | dependencies = [ 1427 | "proc-macro2", 1428 | "quote", 1429 | "syn", 1430 | ] 1431 | 1432 | [[package]] 1433 | name = "time" 1434 | version = "0.3.41" 1435 | source = "registry+https://github.com/rust-lang/crates.io-index" 1436 | checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" 1437 | dependencies = [ 1438 | "deranged", 1439 | "itoa", 1440 | "num-conv", 1441 | "powerfmt", 1442 | "serde", 1443 | "time-core", 1444 | "time-macros", 1445 | ] 1446 | 1447 | [[package]] 1448 | name = "time-core" 1449 | version = "0.1.4" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" 1452 | 1453 | [[package]] 1454 | name = "time-macros" 1455 | version = "0.2.22" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" 1458 | dependencies = [ 1459 | "num-conv", 1460 | "time-core", 1461 | ] 1462 | 1463 | [[package]] 1464 | name = "tinystr" 1465 | version = "0.8.1" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" 1468 | dependencies = [ 1469 | "displaydoc", 1470 | "zerovec", 1471 | ] 1472 | 1473 | [[package]] 1474 | name = "tokio" 1475 | version = "1.46.1" 1476 | source = "registry+https://github.com/rust-lang/crates.io-index" 1477 | checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" 1478 | dependencies = [ 1479 | "backtrace", 1480 | "io-uring", 1481 | "libc", 1482 | "mio", 1483 | "parking_lot", 1484 | "pin-project-lite", 1485 | "signal-hook-registry", 1486 | "slab", 1487 | "socket2", 1488 | "windows-sys 0.52.0", 1489 | ] 1490 | 1491 | [[package]] 1492 | name = "tokio-util" 1493 | version = "0.7.15" 1494 | source = "registry+https://github.com/rust-lang/crates.io-index" 1495 | checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" 1496 | dependencies = [ 1497 | "bytes", 1498 | "futures-core", 1499 | "futures-sink", 1500 | "pin-project-lite", 1501 | "tokio", 1502 | ] 1503 | 1504 | [[package]] 1505 | name = "tracing" 1506 | version = "0.1.41" 1507 | source = "registry+https://github.com/rust-lang/crates.io-index" 1508 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 1509 | dependencies = [ 1510 | "log", 1511 | "pin-project-lite", 1512 | "tracing-attributes", 1513 | "tracing-core", 1514 | ] 1515 | 1516 | [[package]] 1517 | name = "tracing-attributes" 1518 | version = "0.1.30" 1519 | source = "registry+https://github.com/rust-lang/crates.io-index" 1520 | checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" 1521 | dependencies = [ 1522 | "proc-macro2", 1523 | "quote", 1524 | "syn", 1525 | ] 1526 | 1527 | [[package]] 1528 | name = "tracing-core" 1529 | version = "0.1.34" 1530 | source = "registry+https://github.com/rust-lang/crates.io-index" 1531 | checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" 1532 | dependencies = [ 1533 | "once_cell", 1534 | ] 1535 | 1536 | [[package]] 1537 | name = "typenum" 1538 | version = "1.18.0" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" 1541 | 1542 | [[package]] 1543 | name = "unicase" 1544 | version = "2.8.1" 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" 1546 | checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" 1547 | 1548 | [[package]] 1549 | name = "unicode-ident" 1550 | version = "1.0.18" 1551 | source = "registry+https://github.com/rust-lang/crates.io-index" 1552 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 1553 | 1554 | [[package]] 1555 | name = "unicode-xid" 1556 | version = "0.2.6" 1557 | source = "registry+https://github.com/rust-lang/crates.io-index" 1558 | checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 1559 | 1560 | [[package]] 1561 | name = "unsafe-libyaml" 1562 | version = "0.2.11" 1563 | source = "registry+https://github.com/rust-lang/crates.io-index" 1564 | checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" 1565 | 1566 | [[package]] 1567 | name = "url" 1568 | version = "2.5.4" 1569 | source = "registry+https://github.com/rust-lang/crates.io-index" 1570 | checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" 1571 | dependencies = [ 1572 | "form_urlencoded", 1573 | "idna", 1574 | "percent-encoding", 1575 | ] 1576 | 1577 | [[package]] 1578 | name = "utf8_iter" 1579 | version = "1.0.4" 1580 | source = "registry+https://github.com/rust-lang/crates.io-index" 1581 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 1582 | 1583 | [[package]] 1584 | name = "utf8parse" 1585 | version = "0.2.2" 1586 | source = "registry+https://github.com/rust-lang/crates.io-index" 1587 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 1588 | 1589 | [[package]] 1590 | name = "version_check" 1591 | version = "0.9.5" 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" 1593 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 1594 | 1595 | [[package]] 1596 | name = "walkdir" 1597 | version = "2.5.0" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 1600 | dependencies = [ 1601 | "same-file", 1602 | "winapi-util", 1603 | ] 1604 | 1605 | [[package]] 1606 | name = "wasi" 1607 | version = "0.11.1+wasi-snapshot-preview1" 1608 | source = "registry+https://github.com/rust-lang/crates.io-index" 1609 | checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 1610 | 1611 | [[package]] 1612 | name = "wasi" 1613 | version = "0.14.2+wasi-0.2.4" 1614 | source = "registry+https://github.com/rust-lang/crates.io-index" 1615 | checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 1616 | dependencies = [ 1617 | "wit-bindgen-rt", 1618 | ] 1619 | 1620 | [[package]] 1621 | name = "winapi-util" 1622 | version = "0.1.9" 1623 | source = "registry+https://github.com/rust-lang/crates.io-index" 1624 | checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" 1625 | dependencies = [ 1626 | "windows-sys 0.59.0", 1627 | ] 1628 | 1629 | [[package]] 1630 | name = "windows-sys" 1631 | version = "0.52.0" 1632 | source = "registry+https://github.com/rust-lang/crates.io-index" 1633 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1634 | dependencies = [ 1635 | "windows-targets", 1636 | ] 1637 | 1638 | [[package]] 1639 | name = "windows-sys" 1640 | version = "0.59.0" 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" 1642 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1643 | dependencies = [ 1644 | "windows-targets", 1645 | ] 1646 | 1647 | [[package]] 1648 | name = "windows-targets" 1649 | version = "0.52.6" 1650 | source = "registry+https://github.com/rust-lang/crates.io-index" 1651 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1652 | dependencies = [ 1653 | "windows_aarch64_gnullvm", 1654 | "windows_aarch64_msvc", 1655 | "windows_i686_gnu", 1656 | "windows_i686_gnullvm", 1657 | "windows_i686_msvc", 1658 | "windows_x86_64_gnu", 1659 | "windows_x86_64_gnullvm", 1660 | "windows_x86_64_msvc", 1661 | ] 1662 | 1663 | [[package]] 1664 | name = "windows_aarch64_gnullvm" 1665 | version = "0.52.6" 1666 | source = "registry+https://github.com/rust-lang/crates.io-index" 1667 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1668 | 1669 | [[package]] 1670 | name = "windows_aarch64_msvc" 1671 | version = "0.52.6" 1672 | source = "registry+https://github.com/rust-lang/crates.io-index" 1673 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1674 | 1675 | [[package]] 1676 | name = "windows_i686_gnu" 1677 | version = "0.52.6" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1680 | 1681 | [[package]] 1682 | name = "windows_i686_gnullvm" 1683 | version = "0.52.6" 1684 | source = "registry+https://github.com/rust-lang/crates.io-index" 1685 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1686 | 1687 | [[package]] 1688 | name = "windows_i686_msvc" 1689 | version = "0.52.6" 1690 | source = "registry+https://github.com/rust-lang/crates.io-index" 1691 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1692 | 1693 | [[package]] 1694 | name = "windows_x86_64_gnu" 1695 | version = "0.52.6" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1698 | 1699 | [[package]] 1700 | name = "windows_x86_64_gnullvm" 1701 | version = "0.52.6" 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" 1703 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1704 | 1705 | [[package]] 1706 | name = "windows_x86_64_msvc" 1707 | version = "0.52.6" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1710 | 1711 | [[package]] 1712 | name = "winnow" 1713 | version = "0.7.12" 1714 | source = "registry+https://github.com/rust-lang/crates.io-index" 1715 | checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" 1716 | dependencies = [ 1717 | "memchr", 1718 | ] 1719 | 1720 | [[package]] 1721 | name = "wit-bindgen-rt" 1722 | version = "0.39.0" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 1725 | dependencies = [ 1726 | "bitflags", 1727 | ] 1728 | 1729 | [[package]] 1730 | name = "wol" 1731 | version = "0.1.0" 1732 | dependencies = [ 1733 | "actix-web", 1734 | "anyhow", 1735 | "base64 0.22.1", 1736 | "clap", 1737 | "config", 1738 | "dotenv", 1739 | "env_logger", 1740 | "futures-util", 1741 | "lazy_static", 1742 | "log", 1743 | "rust-embed", 1744 | "serde", 1745 | "serde_yaml", 1746 | "surge-ping", 1747 | ] 1748 | 1749 | [[package]] 1750 | name = "writeable" 1751 | version = "0.6.1" 1752 | source = "registry+https://github.com/rust-lang/crates.io-index" 1753 | checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" 1754 | 1755 | [[package]] 1756 | name = "yaml-rust2" 1757 | version = "0.10.3" 1758 | source = "registry+https://github.com/rust-lang/crates.io-index" 1759 | checksum = "4ce2a4ff45552406d02501cea6c18d8a7e50228e7736a872951fe2fe75c91be7" 1760 | dependencies = [ 1761 | "arraydeque", 1762 | "encoding_rs", 1763 | "hashlink", 1764 | ] 1765 | 1766 | [[package]] 1767 | name = "yoke" 1768 | version = "0.8.0" 1769 | source = "registry+https://github.com/rust-lang/crates.io-index" 1770 | checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" 1771 | dependencies = [ 1772 | "serde", 1773 | "stable_deref_trait", 1774 | "yoke-derive", 1775 | "zerofrom", 1776 | ] 1777 | 1778 | [[package]] 1779 | name = "yoke-derive" 1780 | version = "0.8.0" 1781 | source = "registry+https://github.com/rust-lang/crates.io-index" 1782 | checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" 1783 | dependencies = [ 1784 | "proc-macro2", 1785 | "quote", 1786 | "syn", 1787 | "synstructure", 1788 | ] 1789 | 1790 | [[package]] 1791 | name = "zerocopy" 1792 | version = "0.8.26" 1793 | source = "registry+https://github.com/rust-lang/crates.io-index" 1794 | checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" 1795 | dependencies = [ 1796 | "zerocopy-derive", 1797 | ] 1798 | 1799 | [[package]] 1800 | name = "zerocopy-derive" 1801 | version = "0.8.26" 1802 | source = "registry+https://github.com/rust-lang/crates.io-index" 1803 | checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" 1804 | dependencies = [ 1805 | "proc-macro2", 1806 | "quote", 1807 | "syn", 1808 | ] 1809 | 1810 | [[package]] 1811 | name = "zerofrom" 1812 | version = "0.1.6" 1813 | source = "registry+https://github.com/rust-lang/crates.io-index" 1814 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 1815 | dependencies = [ 1816 | "zerofrom-derive", 1817 | ] 1818 | 1819 | [[package]] 1820 | name = "zerofrom-derive" 1821 | version = "0.1.6" 1822 | source = "registry+https://github.com/rust-lang/crates.io-index" 1823 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 1824 | dependencies = [ 1825 | "proc-macro2", 1826 | "quote", 1827 | "syn", 1828 | "synstructure", 1829 | ] 1830 | 1831 | [[package]] 1832 | name = "zerotrie" 1833 | version = "0.2.2" 1834 | source = "registry+https://github.com/rust-lang/crates.io-index" 1835 | checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" 1836 | dependencies = [ 1837 | "displaydoc", 1838 | "yoke", 1839 | "zerofrom", 1840 | ] 1841 | 1842 | [[package]] 1843 | name = "zerovec" 1844 | version = "0.11.2" 1845 | source = "registry+https://github.com/rust-lang/crates.io-index" 1846 | checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" 1847 | dependencies = [ 1848 | "yoke", 1849 | "zerofrom", 1850 | "zerovec-derive", 1851 | ] 1852 | 1853 | [[package]] 1854 | name = "zerovec-derive" 1855 | version = "0.11.1" 1856 | source = "registry+https://github.com/rust-lang/crates.io-index" 1857 | checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" 1858 | dependencies = [ 1859 | "proc-macro2", 1860 | "quote", 1861 | "syn", 1862 | ] 1863 | --------------------------------------------------------------------------------