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

Theme System: Public serving of files #5405

Merged
merged 3 commits into from
Jan 14, 2025
Merged

Conversation

ssddanbrown
Copy link
Member

@ssddanbrown ssddanbrown commented Jan 13, 2025

Allows files to be placed within a public/ folder within a theme directory which the contents of will served by BookStack for access. For #3904

A file placed at <theme_folder>/public/cat.jpg could be accessible at /theme/<theme_folder>/cat.jpg.
Theme name included for potential multi-theme compatibility.

Considerations

  • Only "web safe" content-types are provided (to limit access surface area of serving html/php files).
  • A static 1 day cache time it set on served files (could be override at webserver level if needed).

Todo

  • Testing
  • Update dev docs for theme systems

Doc Updates

  • Note potential breaking change/exposure if a public/ theme folder already exists.

Allows files to be placed within a "public" folder within a theme
directory which the contents of will served by BookStack for access.

- Only "web safe" content-types are provided.
- A static 1 day cache time it set on served files.

For #3904
Existing mime sniffer wasn't great at distinguishing between plaintext
file types, so added a custom extension based mapping for common web
formats that may be expected to be used with this.
@ssddanbrown ssddanbrown merged commit 786a434 into development Jan 14, 2025
9 checks passed
@ssddanbrown ssddanbrown deleted the public_theme_files branch January 14, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant