mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-21 14:17:08 +00:00
Adding current domain from settings to CORs. (#3231)
This commit is contained in:
parent
8179b0daf2
commit
b214d3dc00
|
@ -164,7 +164,8 @@ pipeline:
|
||||||
repo: dessalines/lemmy
|
repo: dessalines/lemmy
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
build_args: RUST_RELEASE_MODE=release
|
build_args:
|
||||||
|
- RUST_RELEASE_MODE=release
|
||||||
auto_tag: true
|
auto_tag: true
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
@ -176,7 +177,8 @@ pipeline:
|
||||||
repo: dessalines/lemmy
|
repo: dessalines/lemmy
|
||||||
dockerfile: docker/Dockerfile
|
dockerfile: docker/Dockerfile
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
build_args: RUST_RELEASE_MODE=release
|
build_args:
|
||||||
|
- RUST_RELEASE_MODE=release
|
||||||
tag: dev
|
tag: dev
|
||||||
when:
|
when:
|
||||||
event: cron
|
event: cron
|
||||||
|
|
|
@ -5,8 +5,8 @@ export COMPOSE_DOCKER_CLI_BUILD=1
|
||||||
export DOCKER_BUILDKIT=1
|
export DOCKER_BUILDKIT=1
|
||||||
|
|
||||||
# Rebuilding dev docker
|
# Rebuilding dev docker
|
||||||
sudo docker build ../ -f . -t "dessalines/lemmy:dev"
|
pushd ..
|
||||||
sudo docker push "dessalines/lemmy:dev"
|
sudo docker build . -f docker/Dockerfile --build-arg RUST_RELEASE_MODE=release -t "dessalines/lemmy:dev" --platform=linux/amd64 --push
|
||||||
|
|
||||||
# Run the playbook
|
# Run the playbook
|
||||||
# pushd ../../../lemmy-ansible
|
# pushd ../../../lemmy-ansible
|
||||||
|
|
|
@ -150,12 +150,13 @@ 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("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)
|
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()
|
App::new()
|
||||||
|
|
Loading…
Reference in a new issue