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

[Enhancement] - Add LYCHEE_UPLOADS_URL to secure-headers.php #533

Closed
hxrsmurf opened this issue May 4, 2020 · 2 comments
Closed

[Enhancement] - Add LYCHEE_UPLOADS_URL to secure-headers.php #533

hxrsmurf opened this issue May 4, 2020 · 2 comments
Labels
enhancement New feature or request Project for volunteers The team has no plans to work on it (e.g. lack of time) but an external contribution is accepted

Comments

@hxrsmurf
Copy link
Contributor

hxrsmurf commented May 4, 2020

Sorry I'm new to PHP. I can't seem to figure out how to add the LYCHEE_UPLOADS_URL environment variable to the secure-headers.php to allow images to be loaded from another server (CDN). This may also be useful for others that want to off-load the images,

@ildyria ildyria added the Project for volunteers The team has no plans to work on it (e.g. lack of time) but an external contribution is accepted label May 4, 2020
@ildyria
Copy link
Member

ildyria commented May 4, 2020

You can use env('LYCHEE_UPLOADS_URL', 'https://lycheeorg.github.io/') to access the environment variable and add it around https://github.com/LycheeOrg/Lychee/blob/master/config/secure-headers.php#L394

https://lycheeorg.github.io/will be a safe default value by default.

@ildyria ildyria added the enhancement New feature or request label May 4, 2020
@hxrsmurf
Copy link
Contributor Author

hxrsmurf commented May 4, 2020

Thank you. I feel like an idiot. I was missing the / in the ENV variable. That's why I couldn't get the env PHP function to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Project for volunteers The team has no plans to work on it (e.g. lack of time) but an external contribution is accepted
Projects
None yet
Development

No branches or pull requests

2 participants