Page MenuHomePhabricator

App : remove hard-coded localhost address in Oauth connexions
Closed, ResolvedPublic

Description

Hard coded localhost prevents smooth tests when deployed online.

Reproduce bug

Screenshot from 2025-03-19 16-16-41.png (782×1 px, 75 KB)

Screenshot from 2025-03-19 16-16-52.png (782×1 px, 175 KB)

Screenshot from 2025-03-19 16-17-04.png (782×1 px, 165 KB)

Proposal approach

Refactor code to set host and Oauth as config.ini variables.

  • Rely more on config.ini variables, with [oauth]
  • Clean settings.py's assignements and conditionals
  • Deprecate hard-coded localhost (127.0.0.1:) in rest of the code.
Rely more on config.ini

✅ See commit :

Update instances config.ini
  • Toolforge [EDIT]: NOW OUR SHARED TEST DEPLOYMENT SERVER
  • Vercel [EDIT]: PROJECT CLOSED.
Deprecate hard-coded localhost

With the help of AI agents, check and possibly replace localhost in the code by suitable variables calls as in :

Update documentation
  • Identify files (note: I believe none needs update but double check is better)
  • Update documentation
See also

Event Timeline

Yug renamed this task from Refactor code with host and Oauth variables. to Remove hard-coded localhost address in Oauth connexions.Mar 19 2025, 3:29 PM
Yug changed the task status from Open to In Progress.
Yug triaged this task as Medium priority.
Yug updated the task description. (Show Details)
Yug updated the task description. (Show Details)

Aditya hello,

Following your debugging Thursday evening, I spread your changes to the repository via this commit.

I suggested further edits, what do you think ?

@Pushkar7077 hello,

Update or close lingualibre-client.vercel.app ?

With https://lingua-libre.toolforge.org now online, working, and documented we now have a free web hosting with multiple distributed open source wikimedian maintainers via Tooladmin > lingua-libre.

This lead me I think your Vercel's lingualibre-client app project is now redundant and can be closed altogether.

Still, I'm unfamiliar with Vercel and your full working process. Please could your share the pros of maintaining a Vercel app which I may be unaware of. Then we move accordingly.

  • **If Vercel App is no more needed*, then this Vercel can be closed. We have doc/toolforge-deployment.md and I can onboard you as well.
  • If Vercel App still needed, you may git pull and update your config.ini.sample.

Your static site Vercel is still useful to test embeding of the app (from https://lingua-libre.toolforge.org).

Let me know.

Yug updated the task description. (Show Details)

Note : we (volunteers) still have a few replacements to implement. See the two last elements in section Deprecate hard-coded localhost above and associated error when at step 4 > click on locator Lexeme :

Content-Security-Policy: (Report-Only policy) The page’s settings would block the loading of a resource (connect-src) at http://127.0.0.1:8080/api/locutors/my/5/recordings/Q150 because it violates the following directive:

image.png (224×959 px, 100 KB)

Yug renamed this task from Remove hard-coded localhost address in Oauth connexions to App : remove hard-coded localhost address in Oauth connexions.Apr 9 2025, 2:15 PM

Understood. So we now focus on toolforge to deploy the App in next phase (moving to pre-release).

As described above in the task, we still have the vite.config.js#L13 and front-end/src/utils/getLocutorRecordings.js#L9 which need to remove the hard coded localhost.

Yug updated the task description. (Show Details)
Yug closed this task as Resolved.EditedMay 2 2025, 12:59 PM
Yug claimed this task.

Resolved thanks to @Pushkar7077 during the Wikimedia-Hackathon-2025.