UserVM Handbook: Difference between revisions

From Computernewb Wiki
Jump to navigation Jump to search
No edit summary
(typescript)
Line 14: Line 14:
sudo apt install git # Debian
sudo apt install git # Debian
}}
}}
=== Clone the source ===
=== Prepare the server ===
Now let's clone the source. This is assuming you're in your home directory but you can clone it wherever
Now let's clone the source. This is assuming you're in your home directory but you can clone it wherever
{{code|
{{code|
git clone https://github.com/computernewb/collab3 collab-vm-server
git clone https://github.com/computernewb/collabvm-1.2.ts.git
cd collabvm-1.2.ts
cd collab-vm-server
git checkout release/1.2.11
}}
}}
Next, we need to install Node.js, as well as the server dependencies.
=== Install build dependencies ===
First, node:
Next, we need to install some build dependencies. First, the compile tools:
{{code|
{{code|
sudo apt install build-essential clang # Debian
sudo apt install npm nodejs # Debian
sudo pacman --needed -S clang base-devel # Arch
sudo pacman --needed -S npm nodejs # Arch
}}
}}
Then run the included script to install required libraries:
Then install dependencies
{{code|
{{code|
npm i
scripts/grab_deps_linux.sh
}}
}}
Note that this only works on Debian or Arch-based distros. For other distros you'll need to track down the dependencies yourself, these are: libvncserver, cairo, boost, sqlite, turbojpeg
=== Enable reverse proxying mode ===
Next, we need to enable reverse proxying mode, as proxying behind nginx with SSL is required for a UserVM.
{{code|
sed -i 's/\/\/#define WEBSOCKETMM_SUPPORT_PROXYING/#define WEBSOCKETMM_SUPPORT_PROXYING/g' src/websocketmm/websocket_user.cpp
}}
Lastly, you should switch to listening on 127.0.0.1 rather than 0.0.0.0, which keeps the port CollabVM is running on closed. This is necessary in reverse proxy mode as anyone with the port can spoof their ip by setting the X-Forwarded-For header.
{{code|
sed -i 's/0.0.0.0/127.0.0.1/g' src/Main.cpp
}}
=== Build the server ===
Finally, build the server
Finally, build the server
{{code|
{{code|
npm run build
<nowiki>make CC=clang CXX=clang++ JPEG=1</nowiki>
}}
}}

Revision as of 23:08, 13 February 2023

Welcome to the official guide on setting up a UserVM.

Prerequisites

You'll need:

  • A machine with decent specs (8GB of RAM and a modern CPU, probably)
  • A Linux distribution; You can pick any mainstream distro, for the purposes of this guide I recommend either Debian/Devuan or Arch/Artix. I recommend the OpenRC versions (Devuan/Artix) but that's just preference, pick what you're comfortable with. Yes, Ubuntu will work, it's terrible though
  • Basic knowledge of how computers and Linux systems work. We aren't going to hold your hand, you need to be comfortable with a command line
  • A few hours

Compiling the server

Install Git

First up make sure you have git installed:

sudo pacman -S --needed git # Arch
sudo apt install git # Debian

Prepare the server

Now let's clone the source. This is assuming you're in your home directory but you can clone it wherever

git clone https://github.com/computernewb/collabvm-1.2.ts.git
cd collabvm-1.2.ts

Next, we need to install Node.js, as well as the server dependencies. First, node:

sudo apt install npm nodejs # Debian
sudo pacman --needed -S npm nodejs # Arch

Then install dependencies

npm i

Finally, build the server

npm run build