Compare commits
No commits in common. "b891d91386459211f5b4832a919fdb21801599cf" and "4b36989f8d90ab998fbce06f481fcdc889ddd66e" have entirely different histories.
b891d91386
...
4b36989f8d
|
|
@ -1,4 +1,4 @@
|
||||||
FROM rust:1.63-alpine3.16 AS builder
|
FROM rust:1.61-alpine3.15 AS builder
|
||||||
|
|
||||||
ARG DI_VER=1.2.5
|
ARG DI_VER=1.2.5
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ COPY . ./
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:3.16
|
FROM alpine:3.15
|
||||||
|
|
||||||
COPY --from=builder /app/target/release/site /bin/site
|
COPY --from=builder /app/target/release/site /bin/site
|
||||||
COPY --from=builder /app/dumb-init /bin/dumb-init
|
COPY --from=builder /app/dumb-init /bin/dumb-init
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.63"
|
channel = "1.60"
|
||||||
|
|
|
||||||
17
src/main.rs
17
src/main.rs
|
|
@ -4,8 +4,7 @@ use axum::{
|
||||||
extract::Extension,
|
extract::Extension,
|
||||||
http::StatusCode,
|
http::StatusCode,
|
||||||
middleware,
|
middleware,
|
||||||
response::Redirect,
|
routing::{get, get_service},
|
||||||
routing::{any, get, get_service},
|
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
use tower_http::{auth::RequireAuthorizationLayer, services::ServeDir, trace::TraceLayer};
|
use tower_http::{auth::RequireAuthorizationLayer, services::ServeDir, trace::TraceLayer};
|
||||||
|
|
@ -74,20 +73,6 @@ async fn main() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define some redirects
|
|
||||||
let redirects = [
|
|
||||||
("/github", "https://github.com/ChewingBever"),
|
|
||||||
("/gitea", "https://git.rustybever.be/Chewing_Bever"),
|
|
||||||
("/gitlab", "https://gitlab.com/Chewing_Bever"),
|
|
||||||
("/codeberg", "https://codeberg.org/Chewing_Bever"),
|
|
||||||
("/matrix", "https://matrix.to/#/@jef:rustybever.be"),
|
|
||||||
("/aur", "https://aur.archlinux.org/account/Chewing_Bever"),
|
|
||||||
];
|
|
||||||
|
|
||||||
for (path, url) in redirects {
|
|
||||||
app = app.route(path, any(|| async { Redirect::permanent(url) }))
|
|
||||||
}
|
|
||||||
|
|
||||||
app = app
|
app = app
|
||||||
// The fallback option is to serve the actual static files
|
// The fallback option is to serve the actual static files
|
||||||
.fallback(
|
.fallback(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue