Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lemmy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
lemmy
Commits
b214d3dc
Unverified
Commit
b214d3dc
authored
1 year ago
by
Dessalines
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Adding current domain from settings to CORs. (#3231)
parent
8179b0da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.woodpecker.yml
+4
-2
4 additions, 2 deletions
.woodpecker.yml
docker/test_deploy.sh
+2
-2
2 additions, 2 deletions
docker/test_deploy.sh
src/lib.rs
+5
-4
5 additions, 4 deletions
src/lib.rs
with
11 additions
and
8 deletions
.woodpecker.yml
+
4
−
2
View file @
b214d3dc
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
docker/test_deploy.sh
+
2
−
2
View file @
b214d3dc
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
5
−
4
View file @
b214d3dc
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment