]> Untitled Git - lemmy.git/commitdiff
Adding current domain from settings to CORs. (#3231)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 21 Jun 2023 00:29:48 +0000 (20:29 -0400)
committerGitHub <noreply@github.com>
Wed, 21 Jun 2023 00:29:48 +0000 (20:29 -0400)
.woodpecker.yml
docker/test_deploy.sh
src/lib.rs

index 9bdcbd6ac9623ec562a1889b6560b0dba34973a2..5134d58891589004ac975f5dfc41b52888c9fb78 100644 (file)
@@ -164,7 +164,8 @@ pipeline:
       repo: dessalines/lemmy
       dockerfile: docker/Dockerfile
       platforms: linux/amd64
-      build_args: RUST_RELEASE_MODE=release
+      build_args:
+        - RUST_RELEASE_MODE=release
       auto_tag: true
     when:
       event: tag
@@ -176,7 +177,8 @@ pipeline:
       repo: dessalines/lemmy
       dockerfile: docker/Dockerfile
       platforms: linux/amd64
-      build_args: RUST_RELEASE_MODE=release
+      build_args:
+        - RUST_RELEASE_MODE=release
       tag: dev
     when:
       event: cron
index ff4eb5b9ffbd523e480660e8d10327dc77171084..8bf06f23c72f87098a2249248e0ebb33e8109bc9 100755 (executable)
@@ -5,8 +5,8 @@ export COMPOSE_DOCKER_CLI_BUILD=1
 export DOCKER_BUILDKIT=1
 
 # Rebuilding dev docker
-sudo docker build ../ -f . -t "dessalines/lemmy:dev"
-sudo docker push "dessalines/lemmy:dev"
+pushd ..
+sudo docker build . -f docker/Dockerfile --build-arg RUST_RELEASE_MODE=release -t "dessalines/lemmy:dev" --platform=linux/amd64 --push
 
 # Run the playbook
 # pushd ../../../lemmy-ansible
index 811b8fea36a99385e753fffe45bb48575fe028ba..b76dd106c18a6fa7b09c3a982c3e41ae3c816041 100644 (file)
@@ -150,12 +150,13 @@ pub async fn start_lemmy_server() -> Result<(), LemmyError> {
       .build()
       .expect("configure federation");
 
-    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()
     } else {
-      Cors::default().allowed_origin(&cors_origin)
+      let cors_origin = std::env::var("LEMMY_CORS_ORIGIN").unwrap_or("http://localhost".into());
+      Cors::default()
+        .allowed_origin(&cors_origin)
+        .allowed_origin(&settings.get_protocol_and_hostname())
     };
 
     App::new()