Fix routing errors] (#289)

This commit is contained in:
Geometrically 2022-02-06 16:35:52 -07:00 committed by GitHub
parent 6bf5dbabee
commit 0cbc2001e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 14 deletions

View File

@ -5,17 +5,17 @@ services:
volumes:
- db-data:/var/lib/postgresql/data
ports:
- 5432:5432
- "5432:5432"
environment:
POSTGRES_DB: postgres
POSTGRES_USER: labrinth
POSTGRES_PASSWORD: labrinth
POSTGRES_HOST_AUTH_METHOD: trust
meilisearch:
image: getmeili/meilisearch
image: getmeili/meilisearch:v0.19.0
restart: on-failure
ports:
- 7700:7700
- "7700:7700"
volumes:
- meilisearch-data:/data.ms
environment:

View File

@ -247,9 +247,6 @@ async fn main() -> std::io::Result<()> {
.max_age(3600),
)
.wrap(
// This is a hacky workaround to allowing the frontend server-side renderer to have
// an unlimited rate limit, since there is no current way with this library to
// have dynamic rate-limit max requests
RateLimiter::new(MemoryStoreActor::from(store.clone()).start())
.with_identifier(|req| {
let connection_info = req.connection_info();
@ -276,11 +273,11 @@ async fn main() -> std::io::Result<()> {
parse_strings_from_var("RATE_LIMIT_IGNORE_IPS").unwrap_or_default(),
),
)
.app_data(pool.clone())
.app_data(file_host.clone())
.app_data(indexing_queue.clone())
.app_data(search_config.clone())
.app_data(ip_salt.clone())
.app_data(web::Data::new(pool.clone()))
.app_data(web::Data::new(file_host.clone()))
.app_data(web::Data::new(indexing_queue.clone()))
.app_data(web::Data::new(search_config.clone()))
.app_data(web::Data::new(ip_salt.clone()))
.configure(routes::v1_config)
.configure(routes::v2_config)
.service(routes::index_get)

View File

@ -29,7 +29,7 @@ use actix_web::web;
pub fn v2_config(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/v2/")
web::scope("v2")
.configure(auth_config)
.configure(tags_config)
.configure(projects_config)

View File

@ -10,7 +10,7 @@ mod versions;
pub fn v1_config(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/api/v1/")
web::scope("api/v1")
.configure(super::auth_config)
.configure(tags_config)
.configure(mods_config)
@ -25,7 +25,7 @@ pub fn v1_config(cfg: &mut web::ServiceConfig) {
pub fn tags_config(cfg: &mut web::ServiceConfig) {
cfg.service(
web::scope("/tag/")
web::scope("tag")
.service(tags::category_list)
.service(tags::category_create)
.service(super::tags::category_delete)