3 Commits

Author SHA1 Message Date
d59a3fc4a5 1.0.0-rc.2 xdg-open and tls bug fix 2021-08-23 17:47:56 +08:00
8db0f82d08 0.8.3-beta firefox dark mode bug fix 2021-08-23 15:27:48 +08:00
e407395080 0.8.2-beta Update Github automatic build 2021-08-23 14:18:14 +08:00
5 changed files with 46 additions and 44 deletions

View File

@ -14,8 +14,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-assets-linux:
runs-on: ubuntu-latest
upload-assets:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: taiki-e/upload-rust-binary-action@v1
@ -25,29 +31,3 @@ jobs:
zip: windows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-assets-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: web
tar: unix
zip: windows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-assets-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
# - run: vcpkg integrate install
# - run: vcpkg install openssl:x64-windows-static-md
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: web
tar: unix
zip: windows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2
Cargo.lock generated
View File

@ -2488,7 +2488,7 @@ checksum = "acdb075a845574a1fa5f09fd77e43f7747599301ea3417a9fbffdeedfc1f4a29"
[[package]]
name = "web"
version = "0.8.1-beta"
version = "1.0.0-rc"
dependencies = [
"actix-files",
"actix-http",

View File

@ -3,7 +3,7 @@ authors = ["Tim_Paik <timpaikc@outlook.com>"]
description = "simple http server written in rust"
edition = "2018"
name = "web"
version = "0.8.1-beta"
version = "1.0.0-rc"
[dependencies]
actix-files = "0.5"

View File

@ -492,7 +492,13 @@ async fn main() -> std::io::Result<()> {
std::process::Command::new("explorer").arg(url).spawn().ok();
} else if cfg!(target_os = "macos") {
std::process::Command::new("open").arg(url).spawn().ok();
} else if cfg!(target_os = "linux") {
} else if cfg!(target_os = "linux")
|| cfg!(target_os = "android")
|| cfg!(target_os = "freebsd")
|| cfg!(target_os = "dragonfly")
|| cfg!(target_os = "openbsd")
|| cfg!(target_os = "netbsd")
{
std::process::Command::new("xdg-open").arg(url).spawn().ok();
}
};
@ -572,7 +578,7 @@ async fn main() -> std::io::Result<()> {
}
}
}
if data.starts_with("[ERROR]") {
if data.starts_with("[ERROR]") || data.starts_with("TLS alert") {
writeln!(buf, "\r{}", red.value(data))
} else {
writeln!(buf, "\r{}", green.value(data))
@ -581,7 +587,6 @@ async fn main() -> std::io::Result<()> {
.init();
let addr = if let Some(matches) = matches.subcommand_matches("doc") {
info!("[INFO] Generating document (may take a while)");
let mut cargo_toml = match std::fs::File::open("./Cargo.toml") {
Ok(file) => file,
Err(e) => {
@ -605,6 +610,7 @@ async fn main() -> std::io::Result<()> {
}
};
let crate_name = contents.package.name;
info!("[INFO] Generating document (may take a while)");
match std::process::Command::new("cargo").arg("doc").output() {
Ok(output) => {
let output = std::str::from_utf8(&output.stderr).unwrap_or("");
@ -745,7 +751,7 @@ async fn main() -> std::io::Result<()> {
);
let mut config = rustls::ServerConfig::new(rustls::NoClientAuth::new());
let cert_chain = rustls::internal::pemfile::certs(cert).unwrap();
let mut keys = rustls::internal::pemfile::rsa_private_keys(key).unwrap();
let mut keys = rustls::internal::pemfile::pkcs8_private_keys(key).unwrap();
config.set_single_cert(cert_chain, keys.remove(0)).unwrap();
server.bind_rustls(addr, config)
} else {

View File

@ -18,6 +18,7 @@
#header,
#meta,
#listing {
font-family: sans-serif;
padding: 0;
margin: 0;
border-spacing: 0;
@ -131,22 +132,37 @@
}
@media (prefers-color-scheme: dark) {
html {
color: #444444;
filter: invert(1);
html,
body,
#header,
#meta,
#listing {
color: #cacaca;
background: #000000;
}
#listing a span {
filter: invert(1);
#header nav span a {
color: #cacaca;
}
#header {
padding: 1.5rem 5% 1rem;
background-color: #0e0e0e;
}
#listing table {
border-top: 1px dashed #999999;
}
#listing th,
#listing td {
border-bottom: 1px dashed #999999;
}
#listing .goup svg,
#listing .file svg {
fill: #444444;
}
#listing .dir svg {
filter: invert(1);
fill: #cacaca;
}
#header a,