Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/local video delivery cors #71

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ To configure an AWS SQS queue, see the according keys in the `.env`.

### Local disk setup

> [!WARNING]
> For the docker setup, to be able to deliver videos, the `Access-Control-Allow-Origin` header is currently set to '*'. This means every website can embed your videos.
>
> If you want to restrict this, you can mount your own configuration at `/opt/docker/etc/nginx/vhost.common.d/10-location-root.conf`. The current config can be found at `docker/location-root.conf`.

#### Prerequisites for video functionality

- File storage accessible at `storage/app/videos`
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LABEL com.centurylinklabs.watchtower.lifecycle.post-update="/var/www/html/docker

COPY . /var/www/html
COPY ./docker/workers.conf /opt/docker/etc/supervisor.d/
COPY ./docker/location-root.conf /opt/docker/etc/nginx/vhost.common.d/10-location-root.conf

RUN composer install --no-interaction --no-dev

Expand Down
5 changes: 5 additions & 0 deletions docker/location-root.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
location / {
add_header 'Access-Control-Allow-Origin' '*' always;

try_files $uri $uri/ /index.php?$query_string;
}
Loading