+1
-1
Cargo.toml
+1
-1
Cargo.toml
···
15
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
16
hyper-util = { version = "0.1.16", features = ["client", "client-legacy"] }
17
tower-http = { version = "0.6", features = ["cors", "compression-zstd"] }
18
-
tower_governor = "0.8.0"
19
hex = "0.4"
20
jwt-compact = { version = "0.8.0", features = ["es256k"] }
21
scrypt = "0.11"
···
15
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
16
hyper-util = { version = "0.1.16", features = ["client", "client-legacy"] }
17
tower-http = { version = "0.6", features = ["cors", "compression-zstd"] }
18
+
tower_governor = { version = "0.8.0", features = ["axum", "tracing"] }
19
hex = "0.4"
20
jwt-compact = { version = "0.8.0", features = ["es256k"] }
21
scrypt = "0.11"
+5
-1
README.md
+5
-1
README.md
···
80
path /xrpc/com.atproto.server.getSession
81
path /xrpc/com.atproto.server.updateEmail
82
path /xrpc/com.atproto.server.createSession
83
path /@atproto/oauth-provider/~api/sign-in
84
}
85
86
handle @gatekeeper {
87
-
reverse_proxy http://localhost:8080
88
}
89
90
reverse_proxy http://localhost:3000
···
80
path /xrpc/com.atproto.server.getSession
81
path /xrpc/com.atproto.server.updateEmail
82
path /xrpc/com.atproto.server.createSession
83
+
path /xrpc/com.atproto.server.createAccount
84
path /@atproto/oauth-provider/~api/sign-in
85
}
86
87
handle @gatekeeper {
88
+
reverse_proxy http://localhost:8080 {
89
+
#Makes sure the cloudflare ip is proxied and able to be picked up by pds gatekeeper
90
+
header_up X-Forwarded-For {http.request.header.CF-Connecting-IP}
91
+
}
92
}
93
94
reverse_proxy http://localhost:3000
+1
-1
justfile
+1
-1
justfile
+6
-1
src/main.rs
+6
-1
src/main.rs
···
20
use std::{env, net::SocketAddr};
21
use tower_governor::GovernorLayer;
22
use tower_governor::governor::GovernorConfigBuilder;
23
use tower_http::compression::CompressionLayer;
24
use tower_http::cors::{Any, CorsLayer};
25
use tracing::log;
···
172
let create_session_governor_conf = GovernorConfigBuilder::default()
173
.per_second(60)
174
.burst_size(5)
175
.finish()
176
.expect("failed to create governor config for create session. this should not happen and is a bug");
177
···
179
let sign_in_governor_conf = GovernorConfigBuilder::default()
180
.per_second(60)
181
.burst_size(5)
182
.finish()
183
.expect(
184
"failed to create governor config for sign in. this should not happen and is a bug",
···
207
create_account_governor_conf.burst_size(burst);
208
}
209
210
-
let create_account_governor_conf = create_account_governor_conf.finish().expect(
211
"failed to create governor config for create account. this should not happen and is a bug",
212
);
213
···
20
use std::{env, net::SocketAddr};
21
use tower_governor::GovernorLayer;
22
use tower_governor::governor::GovernorConfigBuilder;
23
+
use tower_governor::key_extractor::SmartIpKeyExtractor;
24
use tower_http::compression::CompressionLayer;
25
use tower_http::cors::{Any, CorsLayer};
26
use tracing::log;
···
173
let create_session_governor_conf = GovernorConfigBuilder::default()
174
.per_second(60)
175
.burst_size(5)
176
+
.key_extractor(SmartIpKeyExtractor)
177
.finish()
178
.expect("failed to create governor config for create session. this should not happen and is a bug");
179
···
181
let sign_in_governor_conf = GovernorConfigBuilder::default()
182
.per_second(60)
183
.burst_size(5)
184
+
.key_extractor(SmartIpKeyExtractor)
185
.finish()
186
.expect(
187
"failed to create governor config for sign in. this should not happen and is a bug",
···
210
create_account_governor_conf.burst_size(burst);
211
}
212
213
+
let create_account_governor_conf = create_account_governor_conf
214
+
.key_extractor(SmartIpKeyExtractor)
215
+
.finish().expect(
216
"failed to create governor config for create account. this should not happen and is a bug",
217
);
218