christofmuc / JammerNetz

OpenSource internet jam sessions, aka Networked Music Performance software.
GNU Affero General Public License v3.0
50 stars 11 forks source link

please add an instruction how to install a server on Linux #4

Closed rubo77 closed 3 years ago

rubo77 commented 4 years ago

I already have a server running docker images, but by the Readme, it seems a bit unclear what you have to do to run a server on your linux mashine.

please add a script, that you can use to install this in 5 minutes ;)

christofmuc commented 4 years ago

Good point, that largely depends on your environment.

Three options:

  1. You build natively on Linux. Then you will have a JammerNetzServer executable that you just need to run, no parameters required. The client compiled on the Linux machine needs to be packed and shipped to other Linux clients wanting to connect.
  2. You have cross compiled the Linux server from your Windows machine (that's what I do). Then you'd basically copy the JammerNetzServer executable to the Linux box, and launch it there. I do this via scp over SSH, then ssh into the server and launch it. The Windows client you built will have the same random key as you server and will be able to connect to it.
  3. You automatically provision a new AWS EC2 instance

I think 1) is easy (just launch the executable), but you'd need to distribute the client. If you already have 2), you're nearly done, you just need to copy the Linux executable to a suitable server machine and launch it. If you want to do 3), I already have a branch that does it, but needs more work.

I will look at the read me again and see what I can improve.

christofmuc commented 4 years ago

@rubo77 With commit 971a574fac1b8eaf558596cf3df2f3a36f6faad6 I refreshed the README a bit and also fixed the docker files, they were a bit dusted since we had added the flatbuffers third party lib. That should give you a bit more information.

rubo77 commented 4 years ago

Cool, so I just copy paste those 5 commands and that is it? https://github.com/christofmuc/JammerNetz/blob/master/README.md#native-linux-builds

rubo77 commented 4 years ago

But that is just the server and Linux clients, am I right?

To get a Windows client, you need to build in Windows?

@christofmuc : Can't you just provide a working Windows exe?

christofmuc commented 4 years ago

Yes, you're right, with those command you get a matching Linux Server and Client. You can then deploy the client to other machines and enter the IP address of the server, and it should work.

To compile a Windows client, you need to build in Windows. And for the Windows client to be able to talk to the Linux server, you need to use the same shared secret key, because currently that is compiled into the binary. I know that is suboptimal, but I have not had time yet to devise a more secure and easuer key exchange.

This is also why a Windows client I build would allow you to connect to my server only, and actually I don't want that ;-)

To copy the secret from the Linux machine to the Windows client just copy the file "common/resources/RandomNumbers.bin" from the Linux machine to the Windows machine (same place), then both client and server use the same encryption key and will be able to talk to each other.

Sorry for the inconvenience, but we're really doing a cross platform client server connection with some low level libraries, no http/SSL or similar allowed, so there are some hoops to jump through. Once we would have a better key exchange/secret sharing, we could also provide prebuild binaries for Server and Client for Linux, Mac, and Windows.

christofmuc commented 3 years ago

To add to that, the latest master version I made last week no longer requries the shared secret to be compiled into the executables, but the server program takes a single command line paramter with the name of a file containing the 72 byte key, and the UI client has a button to browse for the shared secret file.

christofmuc commented 3 years ago

Closing this, as the new JammerNetz 2.0.0 has the option to load the shared secret from the command line on the server, and from the UI for the client. With this change, I can supply precompiled binaries for Windows.

Compiling on Linux is straightforward with the provided instructions.