Refresh repository
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2025-03-31 23:52:58 +02:00
parent ae754241ce
commit 39beb75a71
5 changed files with 607 additions and 320 deletions

39
.drone.yml Normal file
View File

@ -0,0 +1,39 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: fetch_dependencies
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
commands:
- cargo fetch
- name: code_quality
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
depends_on:
- fetch_dependencies
commands:
- rustup component add clippy
- cargo clippy -- -D warnings
- name: test
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
depends_on:
- code_quality
commands:
- cargo test
volumes:
- name: rust_registry
temp: {}

866
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
[package]
name = "hidden_server"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]
log = "0.4.22"
env_logger = "0.11.5"
actix-web = "4"
rand = "0.9.0-alpha.2"
clap = { version = "4.5.16", features = ["derive"] }
clap = { version = "4.5.16", features = ["derive"] }

4
renovate.json Normal file
View File

@ -0,0 +1,4 @@
{
"extends": ["local>renovate/presets"]
}

View File

@ -1,5 +1,5 @@
use actix_web::middleware::Logger;
use actix_web::{web, App, HttpResponse, HttpServer};
use actix_web::{App, HttpResponse, HttpServer, web};
use clap::Parser;
use hidden_server::restricted_port::is_restricted_port;
use log::LevelFilter;
@ -43,7 +43,7 @@ async fn main() -> std::io::Result<()> {
log::info!("Choosing a random port to start...");
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
let mut port: u16;
loop {
@ -67,3 +67,13 @@ async fn main() -> std::io::Result<()> {
.run()
.await
}
#[cfg(test)]
mod test {
use crate::Args;
#[test]
fn verify_cli() {
use clap::CommandFactory;
Args::command().debug_assert()
}
}