*** Warning: Instructions to get Trunk-Server dev running entirely Local using MIN.IO for storage. Please take note that this does NOT cover SSL and should not be used as an edge facing service as it is not secure. ***
-
Set static IP for trunk-server
-
Set DNS for admin account: Point
api
to the trunk-server IP. -
Install Ubuntu Server 24.04
-
Update system:
sudo apt update sudo apt upgrade
-
Add subdomains to
/etc/hosts
:127.0.0.1 openmhz.test account.openmhz.test api.openmhz.test admin.openmhz.test media.openmhz.test
-
Flush DNS cache:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
-
Create a file in your user's home directory for AWS credentials:
mkdir ~/.aws nano credentials
Add the following content to the file:
[default] aws_access_key_id = [..] aws_secret_access_key = [..]
-
Update and install prerequisites:
sudo apt update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings
-
Add Docker's official GPG key:
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc
-
Add Docker repository to APT sources:
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
Update system and install Docker:
sudo apt update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- It is possible to run MinIO on the same machine (though not recommended).
- Follow the MinIO installation guide for Linux: MinIO Installation Docs
- For a small home setup, use Single-Node Single-Drive (SNSD) or Standalone mode.
- Create a bucket (this is where you will store audio from TrunkServer).
- Set Access Policy for the bucket to Public (Reminder: This is for local, NON-Internet only).
- Create an Access Key and Secret:
- Copy the secret as you can only view it once. If lost, create a new key and delete the old one.
-
Clone the repository:
git clone https://github.com/openmhz/trunk-server cd trunk-server
-
Copy example environment file:
cp test.env.example test.env
-
Edit the environment file:
nano test.env
Add the following:
export S3_PROFILE='default' export S3_REGION='us-east-1' export S3_ENDPOINT='http://minio.domain.com:9000' export S3_BUCKET='bucketname'
Save and exit.
-
Adjust
uploads.js
to work with MinIO path:nano ~/trunk-server/backend/controllers/uploads.js
- In Nano, press
ALT+n
to show line numbers. - Around line 50, add the following crucial line:
const client = new S3Client({ requestHandler: new NodeHttpHandler({ httpsAgent: agent, }), credentials: fromIni({ profile: s3_profile }), endpoint: s3_endpoint, region: s3_region, maxAttempts: 2, forcePathStyle: true, });
- In Nano, press
-
Build and start the server:
./docker-test.sh build # This will take a while ./docker-test.sh up -d # This starts the server as a daemon
-
Make sure you have the following commands available when running
./docker-test.sh
:./docker-test.sh build ./docker-test.sh up -d ./docker-test.sh down
-
Go to
account.(yourtrunkservername).(yourdomain).com
. -
Click Register.
-
Fill out the form and click Register (nothing will happen right away).
-
Connect to the right Docker container:
docker exec -i -t $(docker ps -a | grep mongo | awk '{print $1}') /bin/bash
-
Access MongoDB shell:
mongosh
-
Select the
scanner
database:use scanner
-
Find and update user to confirm email:
db.users.find() db.users.updateOne( { "_id" : ObjectId("63a620d0a63b087b005f6726") }, { $set: { "confirmEmail" : true }, $currentDate: { lastModified: true } } )
docker-compose logs --follow --tail 50
./docker-test.sh build