INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: docker image works great but no mcws access  (Read 1431 times)

zeltak

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 494
docker image works great but no mcws access
« on: March 24, 2024, 04:09:26 pm »

Hi all

first thank you for @max for his amazing docker image

im struggling trough with getting the web server (mcws) to work for me

the IP address of the docker image is 192.168.1.37, and I turned iff (for now) authentication, yet I cant see to interact with mcws,ie this wont work

curl http://192.168.1.37:52199/MCWS/v1/Control/MCC\?Command\=10000 -O /dev/null

it simply does nothing and the CLI show an error

zsh: no such file or directory: http://192.168.1.37:52199/MCWS/v1/Control/MCC?Command=10000

any clue guys?

thx alot

Z
 
Logged

HaWi

  • Citizen of the Universe
  • *****
  • Posts: 946
Re: docker image works great but no mcws access
« Reply #1 on: March 24, 2024, 05:39:31 pm »

Could it be that the port number is wrong? I've gotten myself in trouble with that before.
Logged
rPi5/8GB, Debian 12 Bookworm on SSD | JRMark (33.0.37 64 bit): 2784
MacBookPro (2013), 2.6 GHz Quad-Core Intel Core i7, MacOS 11.7.17 | JRMark (33.0.41 64 bit): 3826
Mac Studio M2 Max, 64GB, 1TB SSD, macOS Sequoia 15.1.1 | JRMark (33.0.41 64 bit): 9056
Docker Container (shiomax) DS1819+ | JRMark (33.0.37 64 bit): 1431
JRemote 3.43
MO 4Media 1.5.7 | Marantz SR7007 (RSL 5.1) HDMI to MacBookPro

zeltak

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 494
Re: docker image works great but no mcws access
« Reply #2 on: March 24, 2024, 09:09:08 pm »

thx!

you mean the port on the docker JRiver install itself?

In the jriver server it does say

TCP Port: 52199

thx alot

Z
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: docker image works great but no mcws access
« Reply #3 on: March 25, 2024, 03:07:28 pm »

curl http://192.168.1.37:52199/MCWS/v1/Control/MCC\?Command\=10000 -O /dev/null

With media network enabled you can type that into the browser 192.168.1.37:52199 to get to Panel. Might be easier than curl?

If you canīt get there either 52199 is blocked by your firewall or you are using bridge networking and have not forwarded 52199 in docker or you have not enabled media network in mc.
Logged

zeltak

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 494
Re: docker image works great but no mcws access
« Reply #4 on: March 25, 2024, 05:11:13 pm »

thx @max096

wow Panel does work wonder then why does the curl command dosent

Im a bit at loss since media network is enabled

thx

Z
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: docker image works great but no mcws access
« Reply #5 on: March 28, 2024, 03:48:41 pm »


any clue guys?

try wrapping the url in single quotes or using

Code: [Select]
alias curl='noglob curl'
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2618
Re: docker image works great but no mcws access
« Reply #6 on: March 28, 2024, 04:45:35 pm »

curl http://192.168.1.37:52199/MCWS/v1/Control/MCC\?Command\=10000 -O /dev/null

it simply does nothing and the CLI show an error

zsh: no such file or directory: http://192.168.1.37:52199/MCWS/v1/Control/MCC?Command=10000

It's lowercase -o /dev/null.
Uppercase -O is telling it to write to a file called "MCC\?Command\=10000" or similar (perhaps the full URL as a filename, depends on curl variant), which cannot be created, or you're running in a folder with no write permissions.
Also, not sure you need to escape the ? and = symbols.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: docker image works great but no mcws access
« Reply #7 on: March 28, 2024, 04:52:42 pm »

Also, not sure you need to escape the ? and = symbols.
you do need to escape the ? in zsh (or quote the URL or use noglob)
Logged

zeltak

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 494
Re: docker image works great but no mcws access
« Reply #8 on: March 29, 2024, 12:20:09 pm »

Hi all really appreciate all the comments but I think im more confused then ever and nothings works haha

so I have MC setup in a docker on my nas (192.168.1.37), which will never play anything just serve files to MBP and MB air.

I have been using a local library for years on Mac with curl commands to control/intereact with MC, ie

Code: [Select]
curl http://localhost:52199/MCWS/v1/Control/MCC\?Command\=10000 -O /dev/null
but playback is done ie via MC on MBP

now im confused :

1) do I need to run this command still on MBP (localhost) or do I need to run it on the server, ie:

Code: [Select]
curl http://192.168.1.37:52199/MCWS/v1/Control/MCC\?Command\=10000 -O /dev/null

2) how do I authenticate? I cant for the life of me get it to work after I enabled authentication (since starting to use a "server") at all

I tried this

Code: [Select]
curl http://USER:PASS:localhost:52199/MCWS/v1/Control/MCC\?Command\=10000 -O /dev/null
but dosent seem to work

any help would be truly appreciate as im totally lost :)

best

Z
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: docker image works great but no mcws access
« Reply #9 on: March 29, 2024, 01:25:34 pm »

but playback is done ie via MC on MBP
do you mean you now have 2 instances of MC? one is the server which is running in docker, the other running locally on the MBP and which is actually playing content?

if so, you have 2 choices

1) tell the server to be able to control client zones, send the command to the server targeting the client zone (this will be easier to do using a more explicit command like MCWS/v1/Playback/Pause)
2) enable media server on the client, send the command to localhost as you have been doing since forever

probably 2) is simpler

2)I tried this

Code: [Select]
curl http://USER:PASS:localhost:52199/MCWS/v1/Control/MCC\?Command\=10000 -O /dev/null

basic auth is http://USER:PASS@localhost:52199/etc

or curl -u USER:PASS http://localhost:52199/etc
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2618
Re: docker image works great but no mcws access
« Reply #10 on: March 29, 2024, 04:05:10 pm »

Code: [Select]
C:\Temp> curl --help
Usage: curl [options...] <url>
 -d, --data <data>          HTTP POST data
 -f, --fail                 Fail fast with no output on HTTP errors
 -h, --help <category>      Get help for commands
 -i, --include              Include protocol response headers in the output
 -o, --output <file>        Write to file instead of stdout
 -O, --remote-name          Write output to a file named as the remote file
 -s, --silent               Silent mode
 -T, --upload-file <file>   Transfer local FILE to destination
 -u, --user <user:password> Server user and password
 -A, --user-agent <name>    Send User-Agent <name> to server
 -v, --verbose              Make the operation more talkative
 -V, --version              Show version number and quit

This is not the full help, this menu is stripped into categories.
Use "--help category" to get an overview of all categories.
For all options use the manual or "--help all".

It's -o /dev/null, not -O /dev/null
For user/pass add a -u user:pass

Send you curl commands to the localhost, assuming it's connected to the NAS/Docker library. MCWS needs to be enabled of course.
Logged

zeltak

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 494
Re: docker image works great but no mcws access
« Reply #11 on: March 30, 2024, 02:51:44 pm »

thank you both!!

that solved it, really appreciate your help guys!

Z
Logged
Pages: [1]   Go Up