This commit is contained in:
parent
ae754241ce
commit
39beb75a71
39
.drone.yml
Normal file
39
.drone.yml
Normal 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
866
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -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
4
renovate.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": ["local>renovate/presets"]
|
||||
}
|
||||
|
14
src/main.rs
14
src/main.rs
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user