Commit graph

110 commits

Author SHA1 Message Date
1d534cf3d3
chore(release): bump version to 0.3.14
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m16s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m11s
Updated the project version to 0.3.14 in preparation for the upcoming release. This version increment reflects new changes or bug fixes since the previous release and ensures its availability for package managers and dependency updates.
2024-10-04 15:24:42 +02:00
be9de88eeb
fix: ensure data update runs during app init
Moved `update_data` invocation to the initialization phase of the application rather than relying on the condition of running as the main module. This change ensures data is updated consistently, regardless of whether the app is run via a WSGI server or directly. This addresses initialization issues encountered in certain deployment scenarios.
2024-10-04 15:24:16 +02:00
7682f4ba7f
fix: ensure privacy policy read only if path exists
Moved path file opening and reading logic inside a conditional block to prevent attempts to access a file when no valid path is assigned. This avoids potential errors and ensures only existing files are processed.
2024-10-04 15:23:59 +02:00
065738eea2
chore: bump version to 0.3.13
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m42s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m17s
Updated the project version to 0.3.13 to reflect recent changes or improvements. This prepares the package for a new release, ensuring that versioning remains consistent and up-to-date.

This release ensures that contests are loaded again, fixing #9.
2024-10-04 07:08:43 +02:00
dbfcb24fbb
feat(contest): enhance contest data handling and UI
Refactored endpoint for contest details to improve data fetching by introducing a dedicated function for retrieving contest entries via API calls. Replaced static URL strings with dynamic `url_for` to enhance routing flexibility. Updated HTML template and stylesheet to improve layout and maintainability, shifting to a more modern and responsive design. Reduced CSS complexity by removing unnecessary styles. These changes enhance usability and prepare for future layout enhancements.
2024-10-04 07:06:26 +02:00
4bf5ac680d
refactor(UI): update contest routes and styles
Simplified contest route URLs by removing the domain, now using relative paths. Utilized a proxy function for banner URLs for enhanced handling. Revamped CSS styling for a darker theme, improving readability and updating contest display to be more flexible and mobile-friendly. Removed deprecated elements from the template to streamline the presentation.
2024-10-04 06:26:07 +02:00
c633a3ec47
feat: switch to JSON API for fetching contest data
Updated the contest data fetching logic to use the JSON API instead of scraping the HTML directly. This change improves the reliability and performance of data retrieval by utilizing a structured API endpoint.

- Replaced HTML parsing with JSON decoding
- Simplified the contest details extraction
- Updated template to display new data structure

Addresses issues with parsing inconsistencies and changes in HTML structure.
2024-10-02 13:48:25 +02:00
380041ec1b
feat(contests): revamp contest archive UX with pagination
Reworked contest archive retrieval and display to enhance user experience by implementing JSON API data fetch and pagination. Simplified archive layout with modern styling and improved error handling.

- Switched from BeautifulSoup to JSON API for data fetching
- Added pagination control with page limit and offset
- Refactored UI elements for a cleaner look in archives page
- Updated CSS for better visuals and responsiveness
2024-10-02 13:32:53 +02:00
837473fd7a
chore(release): bump version to 0.3.12
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m40s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m13s
Incrementing project version to 0.3.12 for upcoming release, which includes recent fixes and enhancements. No functional changes in this commit.
2024-10-02 12:02:20 +02:00
ef0c0a5e89
feat: ensure periodic data updates for app stability
Added instructions to README for regularly triggering `/cron/` to keep the app's cached data updated. Modified `main.py` to initialize `global_ibles` even when using a WSGI server, ensuring data consistency. This change improves the reliability and performance of the app by maintaining up-to-date data.

Relates to #9
2024-10-02 11:54:03 +02:00
8356f71fc1
fix(docs): update country for structables.bloat.cat instance
Corrected the country listing for the structables.bloat.cat instance
from Romania to Germany in the README.md. This ensures geographical
accuracy and up-to-date information for users referencing the
instance list.

Closes #8.
2024-09-11 18:17:38 +02:00
31af94cb6f
chore(release): bump version to 0.3.11
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m40s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m13s
Updated the project version to 0.3.11 to reflect recent changes.
2024-07-29 17:06:50 +02:00
e845caff0e
fix(routes): correct handling of embed files
Enhanced logic for handling file embeds to ensure proper processing of
both downloadable and embedded files. Fixed issues related to condition
checks and image embedding. This improves reliability and correctness
when rendering different types of content attachments.

Fixes issue with inconsistent file embed handling.
2024-07-29 17:06:24 +02:00
20c03bb4e0
feat: update gitignore and pyproject.toml
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m38s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m10s
- .gitignore adjusted to handle Docker builds:
  - Added `/dist/*` to ignore all files in `dist/` except `css`.
- Increased library version to 0.3.10 in pyproject.toml.
- Removed unused bootstrap JS files.

This change ensures Docker builds exclude unnecessary files, while allowing necessary CSS files in `dist/`. Additionally, the version bump addresses new project improvements and the cleanup of orphaned files.
2024-07-21 17:12:09 +02:00
c82e0961b7
chore: update version to 0.3.9 and tweak .gitignore
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m21s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m7s
Bumped the project version to 0.3.9 in preparation for the next release. Adjusted .gitignore to properly ignore /dist/ directory. No major functionality changes expected.
2024-07-07 14:44:40 +02:00
cfb81fada1
feat: encode member usernames in URLs and add docstrings
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m31s
Python Package CI/CD / Publish to PyPI (push) Successful in 1m9s
Added URL encoding for member usernames to prevent errors with special characters in profile and Instructables URLs. Improved code readability by including docstrings for route functions, and refined HTML templates to conditionally display member location only if it exists. Updated the project version to 0.3.8.
2024-07-01 15:27:23 +02:00
f576555005
feat(docker): add dev config and update prod image source
Introduce docker-compose-example-dev.yml for development environment, enabling local builds with stricter container settings (e.g., no-new-privileges, read-only).

Update docker-compose-example.yml to pull the latest version of the structables image from the registry instead of building it locally.

Ensures consistent deployment in production and better resource management during development.
2024-07-01 15:13:34 +02:00
7d81a65b2a
feat: add periodic background data update task
All checks were successful
Docker CI/CD / Docker Build and Push to Docker Hub (push) Successful in 2m34s
Python Package CI/CD / Publish to PyPI (push) Successful in 44s
Replaced the cron job for updating data with a background
thread that runs every 5 minutes within the Flask app. Updated
version to 0.3.7.

This change ensures data is refreshed regularly without
external dependencies like cron, improving deployment
simplicity and reliability.
2024-06-17 20:36:19 +02:00
556669d341
feat: add Docker CI/CD workflow for automated builds
Introduced a new Forgejo Actions workflow to automate the Docker image build and push process on tag creation. The workflow sets up the environment, including QEMU and Buildx, logs into Docker Hub, and pushes the built image. This improvement ensures consistent and efficient Docker image deployment.
2024-06-17 19:46:15 +02:00
98bc487d62
docs: update reverse proxy configuration path
Clarified the instruction for serving static files by specifying the exact path `structables/static` instead of the container's static directory. This aims to reduce confusion and ensure accurate configuration.
2024-06-17 19:12:59 +02:00
fc008032d3
docs: update README with Docker instructions and URL tweaks
Revised the URLs in the Instances section to be more concise by removing protocol prefixes. Added a new Production: Docker section to provide detailed instructions for running the application using Docker, enhancing deployment flexibility. Enhanced the Production section by renaming it to Production: Manual for clarity.

Addresses better readability and ease of use for setting up instances.
2024-06-17 19:10:38 +02:00
0f91a929d2
Merge pull request 'Add Docker' (#6) from vlnst/structables:docker into main
Reviewed-on: #6
2024-06-17 16:44:33 +00:00
2ca209042e
Add Docker support 2024-06-17 18:40:34 +03:00
923854c322
Add new instance structables.bloat.cat 2024-06-17 17:54:05 +03:00
cc450e10ff
feat: add markdown support for privacy policy
All checks were successful
Python Package CI/CD / Publish to PyPI (push) Successful in 39s
Introduced markdown rendering for the privacy policy alongside plain text support. This change enriches the presentation of the privacy policy by allowing markdown-formatted files. To facilitate this, the markdown2 library was added as a dependency, and the logic in the privacy policy route was adjusted to prioritize `.md` files over `.txt` when available. This update also includes a minor version bump and the addition of a markdown-related entry to `.gitignore`. These changes enhance the flexibility and user experience by supporting more visually structured privacy policies.

The removal of the default privacy file path (`privacy.txt`) from the environment configuration encourages explicit file path specification, accommodating the new markdown feature more seamlessly.
2024-06-08 20:07:58 +02:00
b2721c7de1
chore: bump structables version to 0.3.5
All checks were successful
Python Package CI/CD / Publish to PyPI (push) Successful in 37s
Incremented the project version in pyproject.toml to release new features and fixes. This version bump includes performance improvements and bug fixes that enhance the overall stability of the structables package.
2024-05-26 18:32:31 +02:00
6255587753
feat(privacy-policy): render HTML content safely
Some checks failed
Python Package CI/CD / Publish to PyPI (push) Failing after 36s
Updated the privacy policy template to render HTML content safely by applying the `safe` filter to the content variable. This change ensures that HTML content stored in the `content` variable is rendered correctly in the browser, without escaping HTML tags, enhancing the page's flexibility in displaying rich content. This approach assumes the content is pre-sanitized and safe to render, mitigating potential cross-site scripting (XSS) vulnerabilities.
2024-05-26 18:30:40 +02:00
9c8c9b6c17
feat: dynamic privacy policy loading
Enhanced the privacy policy display functionality to dynamically load content from a configurable file path. The path is specified via the `STRUCTABLES_PRIVACY_FILE` environment variable, allowing for greater flexibility and easier updates to the privacy policy without needing to redeploy the application. If the specified file is unreachable or the environment variable is unset, the system gracefully falls back to a default message, ensuring the site remains compliant with privacy policy disclosures under various circumstances. This change streamlines content management and improves the adaptability of the application to legal and policy requirements.
2024-05-26 18:28:38 +02:00
2d4df9bae1
feat: Add PyPI publishing workflow
Introduced a Forgejo Actions workflow for automatically publishing new versions to PyPI upon pushing tags. This enhancement automates the release process for Python packages, ensuring that tagged commits trigger a build and publish sequence in a controlled, containerized environment. The workflow includes steps for setting up the environment, installing dependencies, and securely uploading the package using stored PyPI tokens.

By automating the release pipeline, this change aims to reduce manual errors, streamline version releases, and support continuous delivery practices for Python projects.
2024-05-26 08:57:14 +02:00
e88058af35
chore: bump version to 0.3.4
Incremented the project version to 0.3.4 in pyproject.toml, preparing for a new release. This version bump reflects the latest minor fixes and improvements.
2024-05-26 08:51:11 +02:00
3812d675fc
feat: enhance file download handling
Improved the file download process by appending filenames to the proxy URLs, facilitating proper naming of downloaded files. Updated the proxy function to accept an optional filename parameter, which is then used to set the 'Content-Disposition' header for file downloads. This ensures that files downloaded through the proxy are saved with their original names, improving user experience and file management. Additionally, modified the main route to pass file names to the proxy URLs for both image and non-image files, aligning with the enhanced proxy functionality.

This change addresses user feedback regarding difficulties in identifying and organizing downloaded files, by ensuring files retain their names post-download, thus making it easier for users to recognize and manage their downloads effectively.
2024-05-26 08:50:22 +02:00
ef1566d20b
feat: bump structables version to 0.3.3
Increase the version of structables to 0.3.3 in preparation for a new release. This version bump reflects recent enhancements and bug fixes. It ensures users have access to the latest features and improvements in the structables package.
2024-05-25 17:21:54 +02:00
cbf596aee7
feat: revamp footer layout and improve section separation
Redesigned the footer in `footer.html` to use a light background with dark text, adopting a more modern aesthetic and enhancing readability. The layout now utilizes a responsive grid, separating content into two columns for better organization on wider screens.

In `index.html`, added conditional rendering of horizontal rules between sections, omitting the rule after the last section. This change improves visual flow and reduces unnecessary visual clutter on the page.

These changes collectively enhance the user interface's look and feel, aligning with modern web design practices and improving overall user experience.
2024-05-25 17:21:23 +02:00
75ae8ada4f
feat: Bump structables version to 0.3.2
Increased structables project version in pyproject.toml to reflect the latest updates and improvements added. This version increment is critical for package management and distribution, ensuring users receive the most recent features, bug fixes, and performance enhancements.
2024-05-25 17:10:50 +02:00
b320099c44
feat: enhance project search for teachers
Extended the `projects_search` function and adjusted `category_page` logic to specifically cater to searches initiated by teachers. This update introduces a `teachers` flag that, when set to true, modifies the search criteria to include projects tagged for teachers, thereby streamlining the retrieval of educational content. This change aims to improve the user experience for educators by making relevant projects more accessible.

By distinguishing teacher-initiated searches with a dedicated filter, the platform can now offer more tailored content, thus enhancing its value as an educational resource.
2024-05-25 17:10:19 +02:00
70e4b9ddee
chore: bump project version to 0.3.1
Incremented the project version in pyproject.toml to release minor fixes and improvements. This version update ensures users have access to the latest enhancements and bug fixes, maintaining the smooth and efficient operation of the Structables package.
2024-05-25 17:01:18 +02:00
6c22ddac8e
feat: Refactor app initialization for clarity
Refactored app initialization in `main.py` by encapsulating the Flask server start-up configuration into a `main` function. This change improves code readability and organization, making the execution flow clearer, especially when the application starts or is debugged. Previously, the server start-up logic was directly in the global scope guarded by `if __name__ == "__main__":`, making the logic slightly less organized. Moving this into a dedicated function allows for potential expansion and easier testing. Additionally, ensured data initialization occurs after server start-up to align with best practices for initial data loading.
2024-05-25 17:00:44 +02:00
bcc31368f9
docs: clarify project lineage in README
Revised the project description for Structables in the README to streamline the explanation of its ancestry. The adjustment clarifies that Structables is a fork of snowcatridge10's Indestructables, which in turn is a fork of Cobra's Destructables, making the project's lineage easier to understand without the prior mention of removing Selenium. This change aims to provide a clearer and more concise project background to new contributors and users.
2024-05-25 16:51:15 +02:00
bc9074fc2b
feat: implement dynamic content loading and config management
Introduce dynamic loading of project data and streamlined configuration management. This update modularizes the codebase, separating routes and utilities for improved maintainability and scalability. It also adds a new configuration system to manage environment variables more efficiently, ensuring a seamless setup process for different environments. The refactor includes the addition of Typesense API key retrieval for enhanced search capabilities and the initialization of the application with environment-specific settings, providing a foundation for further feature development and optimization.

The change underscores a shift towards a more maintainable and scalable architecture, setting the stage for future enhancements and features. By organizing the route and utility functions into separate modules, the codebase becomes easier to navigate and extend. The new config management approach centralizes settings, aiding in the smooth adaptation to varying deployment conditions. Additionally, the introduction of dynamic project data loading aims to keep the content fresh and relevant, improving the user experience.

This commit marks a significant step in the project's evolution, streamlining its structure and paving the way for continuous improvement and growth.
2024-05-25 16:48:15 +02:00
a014283775
feat: humanize project titles in listing
Convert slugged project head titles to readable format in the projects listing page by applying `unslugify` to the title before rendering. This enhances UI readability, making project titles more accessible and understandable to users. The change only affects how titles are displayed, with no impact on underlying data structures or URL schemes.
2024-05-25 15:42:40 +02:00
c60da5ec3a
feat: Enhance project channel search flexibility
Introduced `unslugify` function to expand search capabilities by generating possible original titles from slugs, allowing for a broader search when matching project channels. This function is utilized in the `project_list` method to attempt queries with different variants of a channel's name, enhancing the likelihood of matching user-desired content. The update optimizes search functionality and user experience by accommodating varied naming conventions.

Version incremented to 0.2.2 in project metadata to reflect new feature addition and improvements.
2024-05-25 15:14:27 +02:00
c593904a19
feat: Enhance error handling responses with correct status codes
Updated error handlers for 404, 400, 429, and 500 HTTP error responses to explicitly return the corresponding status codes along with the error templates. This change ensures that responses not only serve the correct error pages but also reflect the appropriate HTTP status codes, improving compliance with HTTP standards and enhancing the clarity of the server's response to clients.

This adjustment aids in proper error diagnostics and handling by both the client applications and search engines, potentially influencing SEO and user experience positively by ensuring that web crawlers correctly interpret the nature of the errors.

Resolves issues related to ambiguous HTTP status codes in error responses.
2024-05-25 15:04:26 +02:00
db9f4d9207
refactor(main): optimize server startup process
Moved `update_data()` to execute before entering the main conditional logic in the server startup process. This adjustment ensures that data initialization occurs immediately upon server start, outside of the main function's scope. The change eliminates redundant print statements and streamlines the startup sequence, potentially improving the startup time and overall server responsiveness from the moment it goes live. This modification leads to a cleaner and more efficient codebase, enhancing maintainability and readability.
2024-05-25 15:03:52 +02:00
6c5faf6c19
feat(main.py): Normalize external links for sitemap
To ensure consistency within our sitemap, we've introduced logic that normalizes external channel links to relative paths. This change detects links starting with "https://" and transforms them into relative paths by stripping the protocol and domain parts. This adjustment facilitates better integration with the site's navigation structure, eliminating potential issues with external link handling and improving the user experience when accessing these channels through the sitemap.
2024-05-25 14:57:52 +02:00
ee6cc2de6d
feat(sitemap): redesign UI for improved navigation
The sitemap page has undergone a significant redesign for enhanced user navigation. The update introduces a card-based layout with updated CSS for better visuals and user interaction, focusing on accessibility and aesthetics. The redesigned sitemap now features a containerized layout with cards, improving the overall page structure and readability. Each group within the sitemap is now displayed as a card, making individual sections more distinguishable and easier to navigate. This change aims to provide a more engaging user experience by making information easier to find and the page more pleasant to interact with.
2024-05-23 17:23:04 +02:00
d10381c687
feat: Update Matrix link and add issue-reporting guide
Updated the Matrix room link to ensure users are directed to the correct communication channel. Additionally introduced a new section on opening issues to guide users in reporting problems or providing feedback through the appropriate repositories and discussion forums. This enhancement aims to improve community engagement and streamline the feedback process.
2024-05-23 17:15:13 +02:00
de11b2843d
feat: bump version to 0.2.1, update .gitignore
Incremented the project version to 0.2.1, preparing for a new release with minor improvements and bug fixes. Additionally, refined the .gitignore file to explicitly include the distribution directory, ensuring build artifacts are not accidentally committed to version control. This step aligns with best practices for Python project maintenance and distribution.
2024-05-23 09:05:26 +02:00
0b4676b720
refactor: streamline README and enhance project visibility
Updated the project documentation and .gitignore for a cleaner structure and enhanced visibility. The README now integrates dynamic badges for real-time status like support links, PyPI version, and latest commit info, offering a quick overview of the project status at a glance. These changes aim to make the project more accessible to potential contributors and users by providing essential information more efficiently. Additionally, the `.gitignore` file has been updated to include the `dist/` directory, preventing the accidental inclusion of distribution files in the repository, thus maintaining a cleaner project structure.

The restructuring of the README content, including a simplified approach to setting up development and production environments, aligns with best practices, making it easier for new contributors to get started. Furthermore, the changes enhance project documentation coherence and readability by embedding relevant badges and updating linkage paths for better navigation.
2024-05-23 08:27:21 +02:00
85d5c88294
feat: Introduce pyproject.toml for build configuration
Migrated project dependencies and metadata into a newly added `pyproject.toml`, aligning with modern Python packaging practices. Removed `requirements.txt` as dependencies are now specified in the unified project configuration. Restructured the project by moving Python code, static assets, and templates into a `src/structables` directory to encapsulate project components better and facilitate packaging. Moreover, refactor `main.py` to read environment variables earlier, streamline argument parsing, and ensure configurations are correctly applied before the Flask app initialization. This reorganization supports better project scalability, simplifies the build process, and enhances maintainability by consolidating project configurations and dependencies.

Note: The usage of `pyproject.toml` requires tools that support PEP 518 and might necessitate updates to CI/CD pipelines or developer workflows.
2024-05-23 08:06:36 +02:00
25a07d797b
feat(article layout): Improve readability and multimedia integration
Revamped the article template to enhance visual appeal and user engagement. Introduced a modern, centered layout for article headers, enriched steps display, and standardized multimedia elements with rounded corners and shadows for a cohesive look. Adjustments ensure content is more engaging and accessible, encouraging longer visitor sessions and interaction. This change aligns with the goal of providing a more immersive user experience while maintaining the site's aesthetic consistency.

Refactored CSS to support these changes, defining variables for easier future theme adjustments and promoting code reuse across similar elements. The update signifies a pivotal shift towards a refined and flexible presentation of articles, potentially increasing visitor retention and satisfaction.
2024-05-23 07:30:45 +02:00