Refactor project paths and handling, preserve query params, scope download/XML routes, and adapt template for canonical URLs#462
Open
cycomachead wants to merge 17 commits into
Open
Refactor project paths and handling, preserve query params, scope download/XML routes, and adapt template for canonical URLs#462cycomachead wants to merge 17 commits into
cycomachead wants to merge 17 commits into
Conversation
* 'main' of github.com:snap-cloud/snapCloud: Dump sql after migrate refactor: remove password v0 support and retire password_version column
Bumps [qs](https://github.com/ljharb/qs) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together. Updates `qs` from 6.14.1 to 6.15.2 - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](ljharb/qs@v6.14.1...v6.15.2) Updates `express` from 4.22.1 to 4.22.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/v4.22.2/History.md) - [Commits](expressjs/express@v4.22.1...v4.22.2) --- updated-dependencies: - dependency-name: qs dependency-version: 6.15.2 dependency-type: indirect - dependency-name: express dependency-version: 4.22.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
- Update robots.txt to disallow /project/ and /api/ for compliant crawlers. - Add a user-agent blocklist to return 403 for aggressive SEO bots. - Implement rate limiting (60r/s) specifically for the /project/:id XML endpoint to reduce egress costs from automated scraping. - Serve robots.txt as a static file directly from the repository. Co-authored-by: Claude Code <noreply@anthropic.com>
…ad/ai/26/1 * 'main' of github.com:snap-cloud/snapCloud: docs: move installation and deployment guides to docs directory rerun migrations feat: enhance compression logging and prevent stale CSS assets feat: implement pre-compression and global gzip configuration
Update internal UI and model call sites to use the explicit /api/v1/project/:id path instead of the bare /project/:id route. This ensures legitimate application traffic bypasses bot-mitigation rate limits targeting legacy crawler entry points. Co-authored-by: Claude Code <noreply@anthropic.com>
- Change project show route to /users/:username/projects/:projectname. - Add 301 redirects for legacy /project query parameter URLs. - Update project models to use /api/v1/ for download and XML routes. - Add support for canonical link tags using the primary domain. - Update client-side path generation to match new URL structure. Co-authored-by: Claude Code <noreply@anthropic.com>
* 'main' of github.com:snap-cloud/snapCloud: docs: move installation and deployment guides to docs directory rerun migrations feat: enhance compression logging and prevent stale CSS assets feat: implement pre-compression and global gzip configuration
Use robots.txt and mitigate AI bots
…-f792d6d6d9 Bump qs and express
- Change project show route to /users/:username/projects/:projectname. - Add 301 redirects for legacy /project query parameter URLs. - Update project models to use /api/v1/ for download and XML routes. - Add support for canonical link tags using the primary domain. - Update client-side path generation to match new URL structure. Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor project routes to use canonical URL paths and scope API endpoints
This PR cleans up project URL handling by introducing a proper RESTful path for project pages, adding 301 redirects from legacy URLs, and emitting canonical link tags to ensure search engines always index the primary domain.
Changes
/project?username=...&projectname=...→/users/:username/projects/:projectnameas the canonical project show routeGET /projectwith query params (including olduser/projectaliases) now issues a 301 redirect to the new path, preserving all parametersself.canonical_urlusingconfig.hostname(the primary domain), andviews/layout/head.etluaemits a<link rel="canonical">tag when present — ensuring secondary-domain requests still point canonically at the primary domainurl_for('site')now returns the new/users/{username}/projects/{projectname}path;url_for('download')now returns/api/v1/project/{id}Cloud.prototype.showProjectPathupdated to produce the new URL structure usingencodeURIComponentapi.luaunchanged: Theproject/:idroute remains accessible viaapi_route(both/api/v1/project/:idand/project/:id) — no breaking change to the APIReviewer Notes
api.luaroute was intentionally not changed to hard-scope under/api/v1/— that change was reverted per feedback. The model's download URL now emits the namespaced form, but the legacy short path remains supported server-side./projectGET handler normalizes the olduser/projectparam aliases and lowercases usernames to match the globalbefore_filterbehavior.Superconductor Ticket Implementation | App Preview | Guided Review