Compare commits
No commits in common. "57058e5c0f70787e4ea682e557a9341b1a023934" and "55daeaecf631b823c21a11f10869fcc11c4ce49f" have entirely different histories.
57058e5c0f
...
55daeaecf6
|
@ -65,7 +65,7 @@ checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -315,7 +315,7 @@ dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"scratch",
|
"scratch",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -332,7 +332,7 @@ checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -526,7 +526,7 @@ checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -589,26 +589,6 @@ dependencies = [
|
||||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "git-version"
|
|
||||||
version = "0.3.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19"
|
|
||||||
dependencies = [
|
|
||||||
"git-version-macro",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "git-version-macro"
|
|
||||||
version = "0.3.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 2.0.48",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "h2"
|
name = "h2"
|
||||||
version = "0.3.15"
|
version = "0.3.15"
|
||||||
|
@ -1030,7 +1010,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1132,7 +1112,7 @@ dependencies = [
|
||||||
"pest_meta",
|
"pest_meta",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1163,7 +1143,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1199,7 +1179,7 @@ dependencies = [
|
||||||
"proc-macro-error-attr",
|
"proc-macro-error-attr",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1216,9 +1196,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.78"
|
version = "1.0.47"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
|
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
@ -1364,7 +1344,6 @@ dependencies = [
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"futures",
|
"futures",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"git-version",
|
|
||||||
"handlebars",
|
"handlebars",
|
||||||
"http",
|
"http",
|
||||||
"hyper",
|
"hyper",
|
||||||
|
@ -1519,9 +1498,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.35"
|
version = "1.0.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
@ -1723,7 +1702,7 @@ dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"rust-embed-utils",
|
"rust-embed-utils",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1887,7 +1866,7 @@ checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2030,7 +2009,7 @@ dependencies = [
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2050,17 +2029,6 @@ dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "syn"
|
|
||||||
version = "2.0.48"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"unicode-ident",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.3.0"
|
version = "3.3.0"
|
||||||
|
@ -2110,7 +2078,7 @@ checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2192,7 +2160,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2276,7 +2244,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2536,7 +2504,7 @@ dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2570,7 +2538,7 @@ checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.105",
|
"syn",
|
||||||
"wasm-bindgen-backend",
|
"wasm-bindgen-backend",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# https://whitfin.io/speeding-up-rust-docker-builds/
|
# https://whitfin.io/speeding-up-rust-docker-builds/
|
||||||
# TODO: https://stackoverflow.com/questions/57389547/how-to-define-the-context-for-a-docker-build-as-a-specific-commit-on-one-of-the
|
# TODO: https://stackoverflow.com/questions/57389547/how-to-define-the-context-for-a-docker-build-as-a-specific-commit-on-one-of-the
|
||||||
|
|
||||||
# docker pull rust:1.75-slim-buster
|
# docker pull rust:1.66-slim-buster
|
||||||
FROM rust@sha256:981dda194caa72aa466cb8789aa6d18ee1af22bc77f1c0b8dc9690f5d3e8fe82 as build
|
FROM rust@sha256:98c9b1fca0c9a6183369daf9efadb57c634340ae877bb027aeadf72afdd086a3 as build
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ENV USER root
|
ENV USER root
|
||||||
|
@ -78,4 +78,7 @@ WORKDIR /home/ptth_user
|
||||||
COPY --from=build /ptth/target/release/ptth_relay ./
|
COPY --from=build /ptth/target/release/ptth_relay ./
|
||||||
COPY --from=build /ptth/handlebars/relay ./handlebars/relay
|
COPY --from=build /ptth/handlebars/relay ./handlebars/relay
|
||||||
|
|
||||||
|
ARG git_version
|
||||||
|
RUN echo -n "$git_version" > ./git_version.txt
|
||||||
|
|
||||||
CMD ["/usr/bin/tini", "--", "./ptth_relay"]
|
CMD ["/usr/bin/tini", "--", "./ptth_relay"]
|
||||||
|
|
|
@ -8,11 +8,12 @@ DOCKER_TAG="ptth:latest"
|
||||||
|
|
||||||
mkdir -p app_packages
|
mkdir -p app_packages
|
||||||
|
|
||||||
git archive --format=tar "$GIT_COMMIT" | sudo docker build -t "$DOCKER_TAG" -
|
git archive --format=tar "$GIT_COMMIT" | sudo docker build -t "$DOCKER_TAG" --build-arg "git_version=$GIT_COMMIT" -
|
||||||
|
|
||||||
sudo docker run --rm "$DOCKER_TAG" tar -c \
|
sudo docker run --rm "$DOCKER_TAG" tar -c \
|
||||||
ptth_relay \
|
ptth_relay \
|
||||||
handlebars \
|
handlebars \
|
||||||
|
git_version.txt \
|
||||||
| gzip > "app_packages/ptth_relay_$GIT_COMMIT_SHORT.tar.gz"
|
| gzip > "app_packages/ptth_relay_$GIT_COMMIT_SHORT.tar.gz"
|
||||||
|
|
||||||
sudo docker build -f app_package_Dockerfile -t ptth_app_host:latest .
|
sudo docker build -f app_package_Dockerfile -t ptth_app_host:latest .
|
||||||
|
|
|
@ -38,7 +38,6 @@ tracing-futures = "0.2.4"
|
||||||
tracing-subscriber = "0.2.15"
|
tracing-subscriber = "0.2.15"
|
||||||
|
|
||||||
ptth_core = { path = "../ptth_core", version = "2.0.0" }
|
ptth_core = { path = "../ptth_core", version = "2.0.0" }
|
||||||
git-version = "0.3.9"
|
|
||||||
|
|
||||||
[dependencies.reqwest]
|
[dependencies.reqwest]
|
||||||
version = "0.11.13"
|
version = "0.11.13"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
pub fn read () -> &'static str {
|
pub async fn read () -> Option <String> {
|
||||||
git_version::git_version!(args = ["--abbrev=16", "--always", "--dirty=-modified"])
|
tokio::fs::read_to_string ("git_version.txt").await.ok ()
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ struct ServerEntry <'a> {
|
||||||
#[derive (Serialize)]
|
#[derive (Serialize)]
|
||||||
struct ServerListPage <'a> {
|
struct ServerListPage <'a> {
|
||||||
dev_mode: bool,
|
dev_mode: bool,
|
||||||
git_version: &'static str,
|
git_version: Option <String>,
|
||||||
servers: Vec <ServerEntry <'a>>,
|
servers: Vec <ServerEntry <'a>>,
|
||||||
news_url: Option <String>,
|
news_url: Option <String>,
|
||||||
connected_server_count: usize,
|
connected_server_count: usize,
|
||||||
|
@ -308,7 +308,7 @@ async fn handle_server_list_internal (state: &Relay)
|
||||||
dev_mode = guard.iso.dev_mode.is_some ();
|
dev_mode = guard.iso.dev_mode.is_some ();
|
||||||
news_url = guard.news_url.clone ();
|
news_url = guard.news_url.clone ();
|
||||||
}
|
}
|
||||||
let git_version = git_version::read ();
|
let git_version = git_version::read ().await;
|
||||||
|
|
||||||
let server_list = scraper_api::v1_server_list (&state).await;
|
let server_list = scraper_api::v1_server_list (&state).await;
|
||||||
|
|
||||||
|
@ -780,7 +780,12 @@ pub async fn run_relay (
|
||||||
{
|
{
|
||||||
let handlebars = Arc::new (load_templates (asset_root)?);
|
let handlebars = Arc::new (load_templates (asset_root)?);
|
||||||
|
|
||||||
info! ("ptth_relay Git version: {}", git_version::read ());
|
if let Some (x) = git_version::read ().await {
|
||||||
|
info! ("ptth_relay Git version: {:?}", x);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
info! ("ptth_relay not built from Git");
|
||||||
|
}
|
||||||
|
|
||||||
if let Some (config_reload_path) = config_reload_path {
|
if let Some (config_reload_path) = config_reload_path {
|
||||||
let state_2 = state.clone ();
|
let state_2 = state.clone ();
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
convert::TryFrom,
|
convert::TryFrom,
|
||||||
|
error::Error,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::Context;
|
|
||||||
use clap::{App, SubCommand};
|
use clap::{App, SubCommand};
|
||||||
use tracing_subscriber::{
|
use tracing_subscriber::{
|
||||||
fmt,
|
fmt,
|
||||||
|
@ -21,7 +21,7 @@ use ptth_relay::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main () -> anyhow::Result<()> {
|
async fn main () -> Result <(), Box <dyn Error>> {
|
||||||
fmt ()
|
fmt ()
|
||||||
.with_env_filter (EnvFilter::from_default_env ())
|
.with_env_filter (EnvFilter::from_default_env ())
|
||||||
.with_span_events (FmtSpan::CLOSE)
|
.with_span_events (FmtSpan::CLOSE)
|
||||||
|
@ -48,7 +48,7 @@ async fn main () -> anyhow::Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let config_path = PathBuf::from ("config/ptth_relay.toml");
|
let config_path = PathBuf::from ("config/ptth_relay.toml");
|
||||||
let config = Config::from_file (&config_path).await.context("couldn't load ptth_relay.toml")?;
|
let config = Config::from_file (&config_path).await?;
|
||||||
|
|
||||||
let (shutdown_rx, forced_shutdown) = ptth_core::graceful_shutdown::init_with_force ();
|
let (shutdown_rx, forced_shutdown) = ptth_core::graceful_shutdown::init_with_force ();
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
<p class="fine">
|
<p class="fine">
|
||||||
Rendered by PTTH relay server.
|
Rendered by PTTH relay server.
|
||||||
Copyright 2020-2024 "Trish" ReactorScram. Licensed under the
|
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
|
||||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
||||||
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -90,11 +90,15 @@ AIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAA" rel="icon" type="image/x-icon" />
|
||||||
<a href="../audit_log">Audit log</a>
|
<a href="../audit_log">Audit log</a>
|
||||||
|
|
||||||
<div style="color: #888; padding-top: 1em;">
|
<div style="color: #888; padding-top: 1em;">
|
||||||
|
{{#if git_version}}
|
||||||
Git version: {{git_version}}
|
Git version: {{git_version}}
|
||||||
|
{{else}}
|
||||||
|
Not built from Git
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Rendered by PTTH relay server.
|
Rendered by PTTH relay server.
|
||||||
Copyright 2020-2024 "Trish" ReactorScram. Licensed under the
|
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
|
||||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
||||||
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -131,7 +131,7 @@ AIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAA" rel="icon" type="image/x-icon" />
|
||||||
|
|
||||||
<p class="fine">
|
<p class="fine">
|
||||||
Rendered by PTTH end server.
|
Rendered by PTTH end server.
|
||||||
Copyright 2020-2024 "Trish" ReactorScram. Licensed under the
|
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
|
||||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
||||||
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
<p class="fine">
|
<p class="fine">
|
||||||
Rendered by PTTH end server.
|
Rendered by PTTH end server.
|
||||||
Copyright 2020-2024 "Trish" ReactorScram. Licensed under the
|
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
|
||||||
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
|
||||||
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -4,4 +4,3 @@ set -euo pipefail
|
||||||
|
|
||||||
cargo check --target x86_64-pc-windows-gnu -p ptth -p ptth_quic
|
cargo check --target x86_64-pc-windows-gnu -p ptth -p ptth_quic
|
||||||
cargo check --target x86_64-unknown-linux-gnu -p ptth -p ptth_quic
|
cargo check --target x86_64-unknown-linux-gnu -p ptth -p ptth_quic
|
||||||
cargo test -p ptth -p ptth_quic
|
|
||||||
|
|
Loading…
Reference in New Issue