MycroftAI / mimic-recording-studio

Mimic Recording Studio is a Docker-based application you can install to record voice samples, which can then be trained into a TTS voice with Mimic2
Apache License 2.0
493 stars 111 forks source link

Avoid hardcoding the `localhost` variable in the source. #95

Open zaddok opened 1 year ago

zaddok commented 1 year ago

The file src/App/api/index.js hardcodes a variable const apiRoot = "http://localhost:5000/";

This is less than ideal because it causes problems if people don't have a standard setup. i.e. run on their docker server that is onto n their computer, run on a vps, etc....

Can we at least document the existence of this setting in the readme, or perhaps make it a docker config setting somehow, or just remove the variable?

kudanai commented 1 year ago

Adding some more context to this:

The backend allows setting APIPORT in docker-compose.yml which is necessary in recent versions of MacOS because port 5000 conflicts with AirPlay.

However, changing this env alone is not enough and requires modifying the hardcoded value as mentioned above.

ZionPi commented 1 year ago

Yes ,if future visitors got errors like mrs-frontend | Could not open index.js in the editor. mrs-frontend | mrs-frontend | To set up the editor integration, add something like REACT_EDITOR=atom to the .env.local file in your project folder and restart the development server. Learn more: https://goo.gl/MMTaZt beside change ports and APIPORT value in /mimic-recording-studio/docker-compose.yml you should also change value in /mimic-recording-studio/frontend/src/App/api/index.js,which is hardcoded.

marshalleq commented 11 months ago

Thanks very much to @zaddok and @kudanai I think this may be the solution to my problem. Trying it now! It works! It works! It works! (On Mac).

Thanks very much. You're right this should be in the documentation as I would have gotten it working weeks ago when I first tried it.

marshalleq commented 11 months ago

I'd argue this is not an enhancement, since it blocks other functionality. I.e. docker is meant to respect a port change, but it doesn't because this value is hardcoded. Also, it's required in order to get this running on Mac. Doesn't sound like an enhancement to me.