mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Move cors default to source code (#3219)
This commit is contained in:
parent
154a85cc36
commit
b37c30ffae
@ -50,8 +50,6 @@ services:
|
|||||||
- lemmyexternalproxy
|
- lemmyexternalproxy
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
# set this to the public origin that requests will come from
|
|
||||||
- LEMMY_CORS_ORIGIN=http://localhost
|
|
||||||
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
|
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
|
||||||
- RUST_BACKTRACE=full
|
- RUST_BACKTRACE=full
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -150,9 +150,9 @@ pub async fn start_lemmy_server() -> Result<(), LemmyError> {
|
|||||||
.build()
|
.build()
|
||||||
.expect("configure federation");
|
.expect("configure federation");
|
||||||
|
|
||||||
let cors_origin = std::env::var("LEMMY_CORS_ORIGIN").unwrap_or_default();
|
let cors_origin = std::env::var("LEMMY_CORS_ORIGIN").unwrap_or("http://localhost".into());
|
||||||
|
|
||||||
let cors_config = if cfg!(debug_assertions) {
|
let cors_config = if !cfg!(debug_assertions) {
|
||||||
Cors::permissive()
|
Cors::permissive()
|
||||||
} else {
|
} else {
|
||||||
Cors::default().allowed_origin(&cors_origin)
|
Cors::default().allowed_origin(&cors_origin)
|
||||||
|
Loading…
Reference in New Issue
Block a user