Fix routing errors] (#289)
This commit is contained in:
parent
6bf5dbabee
commit
0cbc2001e2
@ -5,17 +5,17 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- db-data:/var/lib/postgresql/data
|
- db-data:/var/lib/postgresql/data
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- "5432:5432"
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: postgres
|
POSTGRES_DB: postgres
|
||||||
POSTGRES_USER: labrinth
|
POSTGRES_USER: labrinth
|
||||||
POSTGRES_PASSWORD: labrinth
|
POSTGRES_PASSWORD: labrinth
|
||||||
POSTGRES_HOST_AUTH_METHOD: trust
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
meilisearch:
|
meilisearch:
|
||||||
image: getmeili/meilisearch
|
image: getmeili/meilisearch:v0.19.0
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
ports:
|
ports:
|
||||||
- 7700:7700
|
- "7700:7700"
|
||||||
volumes:
|
volumes:
|
||||||
- meilisearch-data:/data.ms
|
- meilisearch-data:/data.ms
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
13
src/main.rs
13
src/main.rs
@ -247,9 +247,6 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.max_age(3600),
|
.max_age(3600),
|
||||||
)
|
)
|
||||||
.wrap(
|
.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())
|
RateLimiter::new(MemoryStoreActor::from(store.clone()).start())
|
||||||
.with_identifier(|req| {
|
.with_identifier(|req| {
|
||||||
let connection_info = req.connection_info();
|
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(),
|
parse_strings_from_var("RATE_LIMIT_IGNORE_IPS").unwrap_or_default(),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.app_data(pool.clone())
|
.app_data(web::Data::new(pool.clone()))
|
||||||
.app_data(file_host.clone())
|
.app_data(web::Data::new(file_host.clone()))
|
||||||
.app_data(indexing_queue.clone())
|
.app_data(web::Data::new(indexing_queue.clone()))
|
||||||
.app_data(search_config.clone())
|
.app_data(web::Data::new(search_config.clone()))
|
||||||
.app_data(ip_salt.clone())
|
.app_data(web::Data::new(ip_salt.clone()))
|
||||||
.configure(routes::v1_config)
|
.configure(routes::v1_config)
|
||||||
.configure(routes::v2_config)
|
.configure(routes::v2_config)
|
||||||
.service(routes::index_get)
|
.service(routes::index_get)
|
||||||
|
|||||||
@ -29,7 +29,7 @@ use actix_web::web;
|
|||||||
|
|
||||||
pub fn v2_config(cfg: &mut web::ServiceConfig) {
|
pub fn v2_config(cfg: &mut web::ServiceConfig) {
|
||||||
cfg.service(
|
cfg.service(
|
||||||
web::scope("/v2/")
|
web::scope("v2")
|
||||||
.configure(auth_config)
|
.configure(auth_config)
|
||||||
.configure(tags_config)
|
.configure(tags_config)
|
||||||
.configure(projects_config)
|
.configure(projects_config)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ mod versions;
|
|||||||
|
|
||||||
pub fn v1_config(cfg: &mut web::ServiceConfig) {
|
pub fn v1_config(cfg: &mut web::ServiceConfig) {
|
||||||
cfg.service(
|
cfg.service(
|
||||||
web::scope("/api/v1/")
|
web::scope("api/v1")
|
||||||
.configure(super::auth_config)
|
.configure(super::auth_config)
|
||||||
.configure(tags_config)
|
.configure(tags_config)
|
||||||
.configure(mods_config)
|
.configure(mods_config)
|
||||||
@ -25,7 +25,7 @@ pub fn v1_config(cfg: &mut web::ServiceConfig) {
|
|||||||
|
|
||||||
pub fn tags_config(cfg: &mut web::ServiceConfig) {
|
pub fn tags_config(cfg: &mut web::ServiceConfig) {
|
||||||
cfg.service(
|
cfg.service(
|
||||||
web::scope("/tag/")
|
web::scope("tag")
|
||||||
.service(tags::category_list)
|
.service(tags::category_list)
|
||||||
.service(tags::category_create)
|
.service(tags::category_create)
|
||||||
.service(super::tags::category_delete)
|
.service(super::tags::category_delete)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user