Mozilla Hubs

From My Mnemonic Rhyme
Jump to navigation Jump to search

Online resources

https://github.com/mozilla/hubs

https://github.com/mozilla/hubs-compose/

https://github.com/albirrkarim/mozilla-hubs-installation-detailed

https://github.com/mozilla/reticulum

https://github.com/mozilla/hubs-ops

https://hubs.mozilla.com/labs/hubs-starter-file-for-blender/

https://hubs.mozilla.com/labs/ez-bake-lightmapping/

Edit Rooms

You need to allow "Remixing" in Spoke (by ticking the checkbox after pressing the blue "Publish to Hubs..." button, see:

https://imgur.com/RMQFDYo.png

VM for Hubs-compose

Use any VM hypervisor (e.g., virtualbox) and create a VM with >2 Cores , >100GB disk space, and >4 GB RAM.

Mount following IMAGE: https://www.releases.ubuntu.com/22.04.3/ubuntu-22.04.3-live-server-amd64.iso

Attention: Some users experienced issues in the subsequent hubs-compose install process when using newer image versions!

Hubs-compose

Restart One Liner

sudo ./bin/down && sudo ./bin/up && sudo mutagen-compose -f docker-compose.yml ps -a

Base installation

sudo apt install vim git docker docker-compose tmux htop
sudo systemctl enable docker --now
# attention: newer versions (17.4) also caused trouble!
wget https://github.com/mutagen-io/mutagen/releases/download/v0.17.2/mutagen_linux_amd64_v0.17.2.tar.gz
wget https://github.com/mutagen-io/mutagen-compose/releases/download/v0.17.2/mutagen-compose_linux_amd64_v0.17.2.tar.gz
tar xvzf mutagen_linux_amd64_v0.17.2.tar.gz
tar xvzf mutagen-compose_linux_amd64_v0.17.2.tar.gz
rm -f mutagen-compose_linux_amd64_v0.17.2.tar.gz mutagen_linux_amd64_v0.17.2.tar.gz
sudo mv mutagen mutagen-compose /usr/local/bin/
git clone https://github.com/mozilla/hubs-compose.git
cd hubs-compose
sudo mutagen daemon start
sudo ./bin/init

Verify if everything is up and running:

sudo mutagen-compose -f docker-compose.yml ps -a

Fix your hosts file (on your local computer). Find the VM IP address, e.g., via

ip addr show

If you use linux it is /etc/hosts if you use Widows it is c:\Windows\System32\drivers\etc\hosts

192.168.0.X   hubs.local                                                                                                                            
192.168.0.X   hubs-proxy.local                                                                                                                      
192.168.0.X   hubs-assets.local                                                                                                                     
192.168.0.X   hubs-link.local  

Accept the self-signed certificate for all of the following URLs (ps -a for the respective ports):

https://hubs.local:8989

https://hubs.local:8080

https://hubs.local:9090

https://hubs.local:4000

Important config locations:

~/hubs-compose/services/reticulum/config/dev.exs
~/hubs-compose/services/hubs/webpack.config.js
~/hubs-compose/services/hubs/admin/webpack.config.js

Activate admin account

Stop docker container and start it with a shell as entry point and manually start the reticulum server. Using the iex shell, create an admin account.

sudo mutagen-compose stop reticulum
sudo mutagen-compose run -it --entrypoint=sh reticulum

Now we should be inside the container - indicated by /code #

iex -S mix phx.server
Ret.Account |> Ret.Repo.all() |> Enum.at(0) |> Ecto.Changeset.change(is_admin: true) |> Ret.Repo.update!()

Email

https://github.com/mozilla/reticulum/issues/653

edit ~/hubs-compose/services/retriculum/config/dev.exs


config :ret, Ret.Mailer,
  # adapter: Bamboo.LocalAdapter
  adapter: Bamboo.SMTPAdapter,
  server: "smtp.gmail.com",
  hostname: "your.fqdn",
  port: 465,
  username: "xxxxxxxxxxxx@gmail.com",
  password: "xxxxxxxxxxxx",
  tls: :always, # can be `:always` or `:never`
  ssl: true, # can be `true`
  retries: 1

Hints

- If the admin panel stays blank. Visit all open ports via browser and accept the self-signed certificate.

- If mutagen is complaining about deamon/version conflict. Try downgrading to 17.2. I faced similar issues with version 17.4.

Hubs against public reticulum

https://tobias-weiss.org:8888/

Manage start with pm2

https://github.com/Unitech/pm2

npm install pm2 -g

pm2 start "npm run dev" --name hubs

pm2 restart hubs --watch