NATS
NATS is a connective technology built for the ever increasingly hyper-connected world. It is a single technology that enables applications to securely communicate across any combination of cloud vendors, on-premise, edge, web and mobile, and devices. NATS consists of a family of open source products that are tightly integrated but can be deployed easily and independently. NATS is being used globally by thousands of companies, spanning use-cases including microservices, edge computing, mobile, IoT and can be used to augment or replace traditional messaging.
Ports
Add an allocation on the node for each port.
- Client Port 4222
Install
- Installer image
- ghcr.io/ptero-eggs/installers:debian
- Install script
- 58 lines
Image
- Alpine ghcr.io/ptero-eggs/yolks:alpine
Startup
The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.
5 variables
Startup command
./nats-server --port 4222 --store_dir $HOME/data ${JETSTREAM:+-js} ${USERNAME:+--user "{{USERNAME}}"} ${PASSWORD:+--pass "{{PASSWORD}}"} ${AUTH_TOKEN:+--auth "{{AUTH_TOKEN}}"}Dotted values come from the server settings. These values are examples.
User required for connections.
USERNAMEUsers can edit
nullable|string|max:20
Password required for connections.
PASSWORDUsers can edit
nullable|string|max:20
Authorization token required for connections. If set, Username/Password based authentication will be disabled.
AUTH_TOKENUsers can edit
nullable|string|max:255
Enable JetStream functionality.
JETSTREAMUsers can edit
required|boolean|in:0,1
Version to install
VERSIONUsers can edit
required|string|max:20
Wings
- Stop command
- ^C (SIGINT)
- Running when the console shows
- Server is ready
Readme
NATS
From the NATS website
NATS is a connective technology built for the ever increasingly hyper-connected world. It is a single technology that enables applications to securely communicate across any combination of cloud vendors, on-premise, edge, web and mobile, and devices. NATS consists of a family of open source products that are tightly integrated but can be deployed easily and independently. NATS is being used globally by thousands of companies, spanning use-cases including microservices, edge computing, mobile, IoT and can be used to augment or replace traditional messaging.
Configuration
Set the username/password or auth token configuration under the start variables
Server Ports
Ports required to run the server in a table format.
| Port | default |
|---|---|
| Client Port | 4222 |
Problem with this egg?
Open an issue on GitHub. Include your Panel and Wings versions.
Install script 58 lines bash in ghcr.io/ptero-eggs/installers:debian Show Hide
#!/bin/bash
# Detect OS architecture to download the correct binary
OS_ARCH=$(uname -m)
case "$OS_ARCH" in
x86_64)
OS_ARCH="amd64"
;;
aarch64 | arm64)
OS_ARCH="arm64"
;;
*)
echo "Unsupported architecture: $OS_ARCH"
exit 1
;;
esac
echo "Detected architecture: $OS_ARCH"
# Find the version and download URL from GitHub releases
if [ -z "$VERSION" ] || [ "$VERSION" = "latest" ]; then
echo "Downloading latest version..."
RELEASE_INFO=$(curl -s https://api.github.com/repos/nats-io/nats-server/releases/latest)
TAG_NAME=$(echo "$RELEASE_INFO" | jq -r .tag_name)
DOWNLOAD_URL=$(echo "$RELEASE_INFO" | jq -r ".assets[] | select(.name | test(\"nats-server-.*-linux-$OS_ARCH.*.tar.gz\")) | .browser_download_url")
echo "Latest version is $TAG_NAME"
echo "Download URL: $DOWNLOAD_URL"
else
# Ensure VERSION starts with 'v'
VERSION=$(echo "$VERSION" | sed -E 's/^v*//')
VERSION="v$VERSION"
echo "Downloading version $VERSION..."
RELEASE_INFO=$(curl -s https://api.github.com/repos/nats-io/nats-server/releases/tags/$VERSION)
if [ "$(echo "$RELEASE_INFO" | jq -r .message)" = "Not Found" ]; then
echo "Version $VERSION not found."
exit 1
fi
TAG_NAME=$(echo "$RELEASE_INFO" | jq -r .tag_name)
DOWNLOAD_URL=$(echo "$RELEASE_INFO" | jq -r ".assets[] | select(.name | test(\"nats-server-.*-linux-$OS_ARCH.*.tar.gz\")) | .browser_download_url")
echo "Version is $TAG_NAME"
fi
if [ -z "$DOWNLOAD_URL" ]; then
echo "No suitable download URL found for version $VERSION and architecture $OS_ARCH."
exit 1
fi
echo "Download URL: $DOWNLOAD_URL"
# Download release
wget "$DOWNLOAD_URL" -O /tmp/nats-server.tar.gz
# Extract files
tar -xzf /tmp/nats-server.tar.gz --strip-components=1 -C /tmp
# Copy nats-server binary and set permissions
cp -f /tmp/nats-server /mnt/server
chmod +x /mnt/server/nats-server