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

Update base path when access from server #234

Merged
merged 11 commits into from
Sep 18, 2024

Conversation

lcduong
Copy link
Contributor

@lcduong lcduong commented Sep 18, 2024

Summary by Sourcery

Update the base path configuration for both the Vue.js frontend and Django backend to ensure consistent URL handling and asset referencing. This includes setting a global public path in the Vue.js config and using a configurable base path in Django for URL redirection.

Enhancements:

  • Update the public path in the Vue.js configuration to '/video' for consistent asset referencing.

Deployment:

  • Introduce a BASE_PATH setting in the Django settings to allow dynamic base path configuration for URL redirection.

Copy link

sourcery-ai bot commented Sep 18, 2024

Reviewer's Guide by Sourcery

This pull request updates the base path configuration for the application, affecting both the frontend and backend. It introduces a global path setting in the Vue.js configuration and modifies the server-side code to use a configurable base path.

File-Level Changes

Change Details Files
Add global path setting in Vue.js configuration
  • Set publicPath to '/video'
  • Update manifest icon paths to include '/video' prefix
webapp/vue.config.js
Implement configurable base path in server-side code
  • Add BASE_PATH setting in Django settings file
  • Use BASE_PATH in world admin token redirection
server/venueless/control/views.py
server/venueless/settings.py

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 and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 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.

Comment on lines -207 to 208
return redirect(f"https://{world.domain}/#token={token}")
return redirect(f"https://{world.domain}{base_path}/#token={token}")

Copy link

Choose a reason for hiding this comment

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

suggestion: Consider handling potential double slashes in URL construction

If base_path is empty or starts with a slash, this could potentially lead to double slashes in the URL. Consider using a URL joining function or method to handle this edge case more robustly.

from urllib.parse import urljoin

return redirect(urljoin(f"https://{world.domain}", f"{base_path}/#token={token}"))

@mariobehling mariobehling merged commit 835f97d into fossasia:development Sep 18, 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