diff --git a/Cargo.lock b/Cargo.lock
index 7b16e84..c5e1ac7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -70,16 +70,6 @@ dependencies = [
"tower-service",
]
-[[package]]
-name = "axum-client-ip"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfb5a3ddd6367075d50629546fb46710584016ae7704cd03b6d41cb5be82e5a"
-dependencies = [
- "axum",
- "forwarded-header-value",
-]
-
[[package]]
name = "axum-core"
version = "0.3.2"
@@ -1724,7 +1714,6 @@ name = "xssbook"
version = "0.0.1"
dependencies = [
"axum",
- "axum-client-ip",
"bytes",
"image",
"lazy_static",
diff --git a/Cargo.toml b/Cargo.toml
index 272112f..55be8cf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,6 @@ edition = "2021"
[dependencies]
tokio = { version = "1.23.0", features = ["full"] }
axum = { version = "0.6.4", features = ["headers", "query"] }
-axum-client-ip = "0.3.1"
tower-http = { version = "0.3.5", features = ["fs"] }
tower_governor = "0.0.4"
tower-cookies = "0.8.0"
diff --git a/public/css/home.css b/public/css/home.css
index b68314d..60dc3a5 100644
--- a/public/css/home.css
+++ b/public/css/home.css
@@ -80,7 +80,7 @@ body {
}
.icons {
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAMaCAMAAABESx1iAAAC/VBMVEVHcEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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fiyRrS337r1ja9+9Ru3br1dbT778kbOL38War74FVl85YvQ4Gtf//rXsBUymn0OCV9zDCJdFkpi6RJNNqXJ1ngQPDpKEj7RhGdN2/us1r4udIVFY4OjI3ruXJRANrXB/o6LFzs2mzCC9uQaVTTfrPWKfBzqogOqrFlu2bdbKWLNvpDRGPA1ZOA1YmREzzideiY/f2tmxJmfHwrl5ztH9M0dH4dlrV/pa0h3OTToLfPmEeV5y3rVpowMTiKngcrUxmsgBYNXbfKcFHe54uTMUx+ciFyAi4jK9Y1uNP0M9LPWr1SnO1vg/wDZSSIGDqRwtgAAAABJRU5ErkJggg==');
+ background-image: url('/images/icons.png');
display: inline-block;
width: 18px;
height: 18px;
diff --git a/public/css/main.css b/public/css/main.css
index 1926ed9..0314b3f 100644
--- a/public/css/main.css
+++ b/public/css/main.css
@@ -188,7 +188,7 @@ select {
border: 1px solid var(--light);
color: var(--extreme);
font-size: 15px;
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAADFBMVEVMaXEFBQUFBQUFBQXG+MOgAAAAA3RSTlMAn3BcqiM3AAAAOUlEQVQIW53BsQ2AMAwAMJelV6C80qPYw4k9JmskbqA2px5uNIlcoxF7FmbFxuhckA2iwNzgev3wAR4FDUQbc/qhAAAAAElFTkSuQmCC");
+ background-image: url("/image/arrow.png");
background-position: right 10px center;
background-repeat: no-repeat;
background-size: 15px;
@@ -291,7 +291,7 @@ footer {
cursor: pointer;
background-size: 20px;
background-position: right;
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAADFBMVEVgZ3FHcExgZ3FgZ3Fd28LEAAAAA3RSTlOfAHBcPEovAAAASklEQVQIW2MIBQMG7FRmaGgmUG5PaKgdkNovGvIPSPkfDf4IpII/+h8FUiF/7EVB2u3/gE3x/4hMQQShSqAaoNqhhkGNhlqE2y0A1E85Y0JErBoAAAAASUVORK5CYII=');
+ background-image: url('/image/close.png');
}
.hidden {
diff --git a/public/css/profile.css b/public/css/profile.css
index 1077919..4aff91b 100644
--- a/public/css/profile.css
+++ b/public/css/profile.css
@@ -67,7 +67,7 @@ body {
background-color: var(--secondary);
z-index: 10000 !important;
text-align: center;
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGGnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHja7VlbtuMoDPzXKmYJRiAEy+F5zuxglj8l7DxvOp1Hf7Z9YzuAhagqhMil8d+/k/7B4b3fKIimmGPccIQcMhc8pG0/yrq6LazrOjwfde62nM4VjCJvLfevKR7tT+XubGC/FTzJlaHUjop6W5HDYT/dGTo68uaROdEPQ7mdXV4V7jBQ9mFtMSe9HkId+/14f4cBH7JLPZXK0fjue1Cg1wX9eObhnd9w9Tsonr19PPmCB4er94ADT4pnQZmVnIYKQB7hdD4yPJrmanjY6IaV85N7XE73bAU+mvg7kOP5/rCcnDxmZUF/1XNIxxPflle/1d2jO/TtM2dPc40ZoyghAup4DOo0lPWEdjASrOtEcC1uio/AhK4z40xQdYMU+tbQY8Vzdgy6pguuu+KmG+veXIOLgQex4oG5sV+FyStnbovJYKebrD777hNIbov24Pnsi1vd5q3R6i2h5+7QlB2MObzy9knvvjCnTQXntnTGCn4xG9hww5izK5qBETcPUGUBfDrvD+PVg0ExlG2KZABbdxNV3CUS+EW0R0PBfZ+DTvthABCha4EzzoMBsOa8uOg2ZVbnAGQCQQWusw9cwYAT4Q4nOXgfwU1i6xqvqFtNWRjFhHIEMzAhPmKeJTBUQFYIAv1oSNBQES9BRKKoJMlSoo8hSoxRowXFol4DqWhU1aRZS/IpJEkxaUopp5I5ewRNyTFrTjnnUtBngeWCtwsalFK5+hqqUI1Va6q5lgb5tNCkxaYttdxK5+474kePXXvquZfhBqQ0wpARh4408igTUpueZpgy49SZZp7lzNpB64/zDdbcwRovpqyhnllDqerJhLNwIsYZCGMKDoyrUQBBs3G2J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AgIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiCiAgICAgIHN0RXZ0OmNoYW5nZWQ9Ii8iCiAgICAgIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZGJjMjRlYWMtODdmMC00YjJjLWI2MzAtYTBhOTIxY2I1MmJmIgogICAgICBzdEV2dDpzb2Z0d2FyZUFnZW50PSJHaW1wIDIuMTAgKExpbnV4KSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMy0wMS0zMVQxNzo1MDozNS0wNTowMCIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7KJrUFAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5wEfFjIjpTMVIgAAAlFJREFUaN7t2E2ITXEYx/HPHTNehmlMGSXyMiILJBsbid2QHZZsZj8bL2WtMKLYiJWXkhVJsZLUkJeUl0JCTZJB42UwZphmxsIzdZtmxr3m3OPeOt86nc69z/n/n985z/P8n/MnIyMjIyMjI6OimYcL+IWhEh+fcAwzCnUuV6DdTDzAQjxFV4kf2mLMxV2sR19SA++LJ9WW0tufjHMx554kB76FAdSmGMr1GER7IcZVBQ46JXLjR0JOVmMp6sax6cZPTEtSSJJswzs8x0ccKiJXJ8x99CYwzkr04xvO4GXkQesY9r0xd9kJORCOb4nrxhB2Z6JC0g6tmjh/z3N0IHJmQqQt5GKcT2E/rkchuVRpOSLyoS9vFT8f60ZF5cgws7AWi/5iV7CQ6hK/yfpYD0bShZtJTlSqHJmKI+iIkls2FBNaq/Ak4n8AnWgax34JmsspR6qwN9qKbuzApmhtXmHOKPdswOcQvKschDRFYzmEG1iQ99/2aP4eRc4M0xIiO3Ev7j0bYflfhLREy9GH3WP0Ta3haDum43BcP8b8cP50/HY77+2lIqQRl/McWl7gN82HOF8dpfvdGWH2GqvTELIZ72PStnEWtJGcCBFHMWkMm2Z8QU+MXxIhtTgZznRg3T+U++YC7JbhRcyTuJB+PMtLyroSl/yGKAaJr+zVmI2tsZtSaobLsqSF9GMF3pbjXlUxLcpguYooRsib+G7YmKJvDbG+fE0ytA5GtbmCh1EeS0nOn81AMWeirMG1yJWhFI4eHM/lcjUyMjIyMjIyMiqT3wkE0qfVNfiiAAAAAElFTkSuQmCC');
+ background-image: url('/image/change.png');
cursor: pointer;
}
diff --git a/public/image/arrow.png b/public/image/arrow.png
new file mode 100644
index 0000000..8220278
Binary files /dev/null and b/public/image/arrow.png differ
diff --git a/public/image/change.png b/public/image/change.png
new file mode 100644
index 0000000..1fcbfea
Binary files /dev/null and b/public/image/change.png differ
diff --git a/public/image/close.png b/public/image/close.png
new file mode 100644
index 0000000..516bf05
Binary files /dev/null and b/public/image/close.png differ
diff --git a/public/image/icons.png b/public/image/icons.png
new file mode 100644
index 0000000..39a2d74
Binary files /dev/null and b/public/image/icons.png differ
diff --git a/public/js/main.js b/public/js/main.js
index ffbc1f3..5737173 100644
--- a/public/js/main.js
+++ b/public/js/main.js
@@ -33,11 +33,11 @@ function remove(id) {
}
function pfp(id) {
- return ``
+ return ``
}
function banner(id) {
- return ``
+ return ``
}
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
diff --git a/src/main.rs b/src/main.rs
index 74f0a0b..e8f17b0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,14 +5,13 @@ use axum::{
response::Response,
RequestExt, Router, extract::DefaultBodyLimit,
};
-use axum_client_ip::ClientIp;
use std::{net::SocketAddr, process::exit, fs};
use tower_cookies::CookieManagerLayer;
use tracing::{error, info, metadata::LevelFilter};
use tracing_subscriber::{
filter::filter_fn, prelude::__tracing_subscriber_SubscriberExt, util::SubscriberInitExt, Layer,
};
-use types::http::ResponseCode;
+use types::{http::ResponseCode, extract::RequestIp};
use crate::api::{pages, image};
@@ -38,7 +37,7 @@ async fn log(mut req: Request, next: Next) -> Response
where
B: Send + Sync + 'static + HttpBody,
{
- let Ok(ClientIp(ip)) = req.extract_parts::().await else {
+ let Ok(RequestIp(ip)) = req.extract_parts::().await else {
return next.run(req).await
};
@@ -79,7 +78,7 @@ async fn main() {
.layer(middleware::from_fn(serve))
.nest("/", pages::router())
.nest("/api", api::router())
- .nest("/image", image::router())
+ .nest("/cdn", image::router())
.layer(CookieManagerLayer::new())
.layer(DefaultBodyLimit::max(512_000));
diff --git a/src/types/extract.rs b/src/types/extract.rs
index 54f250a..4d7ac51 100644
--- a/src/types/extract.rs
+++ b/src/types/extract.rs
@@ -1,14 +1,13 @@
-use std::io::{Read, Cursor};
+use std::{io::{Read, Cursor}, net::{IpAddr, SocketAddr}};
use axum::{
async_trait,
body::HttpBody,
- extract::{FromRequest, FromRequestParts},
+ extract::{FromRequest, FromRequestParts, ConnectInfo},
http::{request::Parts, Request},
response::Response,
BoxError, RequestExt,
};
-use axum_client_ip::ClientIp;
use bytes::Bytes;
use image::{io::Reader, ImageFormat, DynamicImage};
use serde::de::DeserializeOwned;
@@ -23,6 +22,57 @@ use crate::{
},
};
+pub struct RequestIp(pub IpAddr);
+
+#[async_trait]
+impl FromRequestParts for RequestIp
+where
+ S: Send + Sync,
+{
+ type Rejection = Response;
+
+ async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result {
+
+ let headers = &parts.headers;
+
+ let forwardedfor = headers.get("x-forwarded-for")
+ .and_then(|h| h.to_str().ok())
+ .and_then(|h|
+ h.split(',')
+ .rev()
+ .find_map(|s| s.trim().parse::().ok())
+ );
+
+ if let Some(forwardedfor) = forwardedfor {
+ return Ok(RequestIp(forwardedfor))
+ }
+
+ let realip = headers.get("x-real-ip")
+ .and_then(|hv| hv.to_str().ok())
+ .and_then(|s| s.parse::().ok());
+
+ if let Some(realip) = realip {
+ return Ok(RequestIp(realip))
+ }
+
+ let realip = headers.get("x-real-ip")
+ .and_then(|hv| hv.to_str().ok())
+ .and_then(|s| s.parse::().ok());
+
+ if let Some(realip) = realip {
+ return Ok(RequestIp(realip))
+ }
+
+ let info = parts.extensions.get::>();
+
+ if let Some(info) = info {
+ return Ok(RequestIp(info.0.ip()))
+ }
+
+ Err(ResponseCode::Forbidden.text("You have no ip"))
+ }
+}
+
pub struct AuthorizedUser(pub User);
#[async_trait]
@@ -189,7 +239,7 @@ where
S: Send + Sync,
{
- let Ok(ClientIp(ip)) = req.extract_parts::().await else {
+ let Ok(RequestIp(ip)) = req.extract_parts::().await else {
tracing::error!("Failed to read client ip");
return Err(ResponseCode::InternalServerError.text("Failed to read client ip"));
};
@@ -224,7 +274,7 @@ where
B::Error: Into,
S: Send + Sync,
{
- let Ok(ClientIp(ip)) = req.extract_parts::().await else {
+ let Ok(RequestIp(ip)) = req.extract_parts::().await else {
tracing::error!("Failed to read client ip");
return Err(ResponseCode::InternalServerError.text("Failed to read client ip"));
};