Commit graph

18 commits

Author SHA1 Message Date
6c0cf84d2a
Merge pull request 'Add Docker support' (#1) from vlnst/small:Docker into main
Reviewed-on: #1
2024-10-20 18:23:50 +00:00
0c64c92fab
Add Docker support 2024-10-11 21:05:04 +03:00
bf512f5e07
fix(proxy): specify Forwarded headers in ProxyFix
Updated the ProxyFix middleware configuration to explicitly include Forwarded headers for IP address, protocol, host, and port. This enhances reliability of request data handling when the app is behind a reverse proxy, ensuring correct client information is passed to the app.
2024-09-27 07:26:02 +02:00
e3eba93f4e
docs: remove redundant 'plugins' line in README
The 'plugins = python3' line in the uwsgi.ini example should be unnecessary when installing uwsgi from pip. This simplifies the configuration instructions and avoids potential confusion for users.
2024-09-26 07:52:06 +02:00
907df9dc1f
fix(docs): clarify proxy fix usage with reverse proxies
Added additional context to the explanation of the ProxyFix middleware in the README. It now details how to recognize issues with the `X-Forwarded-Host` header, such as the URL displaying internal IP and port instead of the domain name. This improvement helps users better understand when to enable the `PROXY_FIX` environment variable.
2024-09-26 07:45:52 +02:00
c67746ea89
feat: enhance deployment and proxy support
- Updated README to include detailed production deployment steps using uWSGI and Caddy for better performance and scalability.
- Added setup instructions for local development.
- Integrated ProxyFix middleware in the app to handle headers from reverse proxies, improving compatibility with various proxy setups.

Addresses better production readiness and proxy configuration.
2024-09-26 07:44:10 +02:00
ceb49bc114
refactor: simplify app initialization by removing factory
Streamlined the Flask app setup by eliminating the factory function and directly initializing the app and registering blueprints in the global scope. This reduces complexity and improves readability. No functional changes introduced.
2024-09-19 19:03:44 +02:00
7d208780aa
fix(article): handle gist fetch errors gracefully
Added try-except block around gist fetch to handle potential
errors more gracefully by printing error messages instead of
failing silently. This improves debugging and user experience
when fetching GitHub gists in articles.
2024-09-19 18:59:03 +02:00
d09267cd6c
docs: update features in README
Added details on image proxying and GitHub gists embedding to the README. Clarified iframe loading behavior to improve documentation regarding user consent. This makes the README more comprehensive and informs users about these functionalities.
2024-09-19 18:56:28 +02:00
2afc069724
feat: add iframe proxy for enhanced security
Introduced a proxy mechanism for handling iframes to improve security by preventing direct embedding of external content. External iframe URLs are now encoded and passed through a proxy endpoint, which renders a new template warning users about potential security risks.

Additionally, added button styles to CSS for consistent user experience and created an iframe security notice template.
2024-09-19 18:53:37 +02:00
e96a39448a
feat: add support for iFrames and GitHub Gists in articles
Enhanced the Article model to include IFrame and GithubGist nodes, enabling rendering of embedded content such as iframes and GitHub gists. Implemented a new GithubClient to fetch gist content and updated MediumClient to handle iframe and gist types. Added styles and template support for iframes and gists in articles.

These changes improve the flexibility of article content, enabling richer media experiences.
2024-09-19 18:45:30 +02:00
2e766781eb
fix(template): correct URL formatting in home.html
Removed an unnecessary 'https://' prefix in the small URL example
to ensure proper URL rendering in the home page. This change
fixes an issue where the URL template would display incorrectly,
potentially causing confusion for users.
2024-09-19 14:23:56 +02:00
2ece00e255
fix(article.html): clean up redundant tag wrapping
Consolidated opening and closing tags for text elements, removing unnecessary line breaks. This improves readability and reduces the complexity of the HTML structure, ensuring better maintainability. No functional changes are introduced.
2024-09-19 14:22:35 +02:00
87a261d7ef
refactor: remove unused config settings
Simplified app initialization by removing the `Config` class and cleaning up unused configuration settings. This reduces redundancy and potential confusion in the codebase.
2024-09-19 14:21:18 +02:00
d790b0b17a
feat: enhance content type handling and code styling
- Added 'type' attribute to the Text dataclass to support HTML tag designation.
- Trimmed text content and assigned types in MediumClient to improve consistency.
- Updated article template to dynamically use text types, allowing for more flexible HTML structure.
- Applied CSS styling for 'pre' tags to enhance code block appearance.

These changes improve the semantic structure of articles and enhance the visual presentation of code blocks in the user interface.
2024-09-19 14:19:20 +02:00
b6c7277535
fix(home.html): ensure full URL string for consistency
Updated the instructional text to replace "medium.com" with the full "https://medium.com/" URL to avoid potential confusion and ensure users receive a clear and consistent guideline. This should enhance the user experience by providing explicit directions.
2024-09-19 14:18:58 +02:00
0a90c556d5
refactor: remove unnecessary imports in const.py
Cleaned up unused os imports in the configuration module to improve readability and reduce clutter. This change has no impact on functionality. No related issues.
2024-09-19 09:15:41 +02:00
675f5195fe
feat: initialize project structure for Small
Add initial project structure for Small, a clean frontend for reading Medium articles. This setup includes:

- Basic Flask app configuration with necessary dependencies.
- RESTful endpoint to fetch and serve Medium articles.
- Templates and static assets for the user interface.
- Utility functions for parsing Medium article IDs.
- Custom error pages (404 and 500) for nicer error handling.
- Project metadata files such as .gitignore, README, LICENSE, and pyproject.toml for project setup and documentation.

This structure sets the foundation for further development and feature additions.
2024-09-19 09:14:05 +02:00