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

Add base router for webapp #233

Merged
merged 7 commits into from
Sep 17, 2024

Conversation

lcduong
Copy link
Contributor

@lcduong lcduong commented Sep 17, 2024

In order to config subpath for video application, I update base path for webapp component, using basePath from config file

  1. By setting base for VueRouter, every route will behind basePath.
  2. Update validation for domain word, allow add subpath

Summary by Sourcery

Add a base path configuration for the web application router to support subpath routing, update domain validation to allow subpaths, and adjust development server settings to accommodate new subdomains.

New Features:

  • Introduce a base path configuration for the VueRouter in the web application, allowing routes to be prefixed with a specified base path from the configuration file.

Enhancements:

  • Update the domain validation regex to allow subpaths in the domain field, enhancing flexibility in domain configurations.

Build:

  • Modify the public and allowed hosts in the Vue development server configuration to reflect new subdomain changes.

Chores:

  • Update the logo URL in the configuration and theme files to include the new base path.

Copy link

sourcery-ai bot commented Sep 17, 2024

Reviewer's Guide by Sourcery

This pull request implements a base router for the webapp, allowing configuration of a subpath for the video application. The changes involve updating the base path for the webapp component using a basePath from the config file. This affects routing, CORS settings, and domain validation.

File-Level Changes

Change Details Files
Implement base path routing for the webapp
  • Add basePath configuration in config.js
  • Update VueRouter base configuration to use basePath
  • Modify route resolution to use relative path instead of full pathname
  • Adjust router replacements to use relative path
webapp/src/main.js
webapp/config.js
webapp/src/router/index.js
Update CORS settings and domain validation
  • Modify CORS origin regex whitelist to allow subdomains and specific domains
  • Update domain validator regex to allow subpaths
  • Create a new migration file for the updated domain field
server/venueless/settings.py
server/venueless/core/models/world.py
server/venueless/core/migrations/0066_alter_world_domain.py
Update development server configuration and default paths
  • Change development server public domain from video-dev.eventyay.com to app-test.eventyay.com
  • Update allowed hosts for development server
  • Modify default logo URL to include '/video/' prefix
webapp/vue.config.js
webapp/config.js
webapp/src/theme.js

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @lcduong - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The CORS origin whitelist has been simplified. Could you clarify if the removal of specific subdomains (like video-dev.eventyay.com) is intentional and won't cause issues for existing users?
  • The domain validation regex has been updated to allow subpaths. While this aligns with the PR's goal, please review to ensure it's not overly permissive and doesn't introduce security risks.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@mariobehling mariobehling merged commit 942e140 into fossasia:development Sep 17, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants