Skip to content

Commit de34f1d

Browse files
authored
Add NATS egg (#56)
* Create egg-n-a-t-s.json * Create README.md
1 parent 2103381 commit de34f1d

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

nats/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# NATS
2+
3+
## From the [NATS](https://nats.io/) website
4+
5+
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.
6+
7+
## Configuration
8+
9+
Set the username/password or auth token configuration under the start variables
10+
11+
12+
### Server Ports
13+
14+
Ports required to run the server in a table format.
15+
16+
| Port | default |
17+
| --------------- | ------- |
18+
| Client Port | 4222 |

nats/egg-n-a-t-s.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
3+
"meta": {
4+
"version": "PTDL_v2",
5+
"update_url": null
6+
},
7+
"exported_at": "2025-10-06T11:40:39+00:00",
8+
"name": "NATS",
9+
"author": "eggs@purpleflaghosting.com",
10+
"description": "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.",
11+
"features": [],
12+
"docker_images": {
13+
"ghcr.io\/ptero-eggs\/yolks:alpine": "ghcr.io\/ptero-eggs\/yolks:alpine"
14+
},
15+
"file_denylist": [],
16+
"startup": ".\/nats-server --port {{SERVER_PORT}} --store_dir $HOME\/data ${JETSTREAM:+-js} ${USERNAME:+--user \"{{USERNAME}}\"} ${PASSWORD:+--pass \"{{PASSWORD}}\"} ${AUTH_TOKEN:+--auth \"{{AUTH_TOKEN}}\"}",
17+
"config": {
18+
"files": "{}",
19+
"startup": "{\r\n \"done\": \"Server is ready\"\r\n}",
20+
"logs": "{}",
21+
"stop": "^C"
22+
},
23+
"scripts": {
24+
"installation": {
25+
"script": "#!\/bin\/bash\r\n\r\n# Detect OS architecture to download the correct binary\r\nOS_ARCH=$(uname -m)\r\ncase \"$OS_ARCH\" in\r\n x86_64)\r\n OS_ARCH=\"amd64\"\r\n ;;\r\n aarch64 | arm64)\r\n OS_ARCH=\"arm64\"\r\n ;;\r\n *)\r\n echo \"Unsupported architecture: $OS_ARCH\"\r\n exit 1\r\n ;;\r\nesac\r\necho \"Detected architecture: $OS_ARCH\"\r\n\r\n# Find the version and download URL from GitHub releases\r\nif [ -z \"$VERSION\" ] || [ \"$VERSION\" = \"latest\" ]; then\r\n echo \"Downloading latest version...\"\r\n RELEASE_INFO=$(curl -s https:\/\/api.github.com\/repos\/nats-io\/nats-server\/releases\/latest)\r\n TAG_NAME=$(echo \"$RELEASE_INFO\" | jq -r .tag_name)\r\n DOWNLOAD_URL=$(echo \"$RELEASE_INFO\" | jq -r \".assets[] | select(.name | test(\\\"nats-server-.*-linux-$OS_ARCH.*.tar.gz\\\")) | .browser_download_url\")\r\n echo \"Latest version is $TAG_NAME\"\r\n echo \"Download URL: $DOWNLOAD_URL\"\r\nelse\r\n # Ensure VERSION starts with 'v'\r\n VERSION=$(echo \"$VERSION\" | sed -E 's\/^v*\/\/')\r\n VERSION=\"v$VERSION\"\r\n\r\n echo \"Downloading version $VERSION...\"\r\n RELEASE_INFO=$(curl -s https:\/\/api.github.com\/repos\/nats-io\/nats-server\/releases\/tags\/$VERSION)\r\n if [ \"$(echo \"$RELEASE_INFO\" | jq -r .message)\" = \"Not Found\" ]; then\r\n echo \"Version $VERSION not found.\"\r\n exit 1\r\n fi\r\n TAG_NAME=$(echo \"$RELEASE_INFO\" | jq -r .tag_name)\r\n DOWNLOAD_URL=$(echo \"$RELEASE_INFO\" | jq -r \".assets[] | select(.name | test(\\\"nats-server-.*-linux-$OS_ARCH.*.tar.gz\\\")) | .browser_download_url\")\r\n echo \"Version is $TAG_NAME\"\r\n\r\nfi\r\n\r\nif [ -z \"$DOWNLOAD_URL\" ]; then\r\n echo \"No suitable download URL found for version $VERSION and architecture $OS_ARCH.\"\r\n exit 1\r\nfi\r\necho \"Download URL: $DOWNLOAD_URL\"\r\n\r\n# Download release\r\nwget \"$DOWNLOAD_URL\" -O \/tmp\/nats-server.tar.gz\r\n\r\n# Extract files\r\ntar -xzf \/tmp\/nats-server.tar.gz --strip-components=1 -C \/tmp\r\n\r\n# Copy nats-server binary and set permissions\r\ncp -f \/tmp\/nats-server \/mnt\/server\r\nchmod +x \/mnt\/server\/nats-server",
26+
"container": "ghcr.io\/ptero-eggs\/installers:debian",
27+
"entrypoint": "bash"
28+
}
29+
},
30+
"variables": [
31+
{
32+
"name": "Username",
33+
"description": "User required for connections.",
34+
"env_variable": "USERNAME",
35+
"default_value": "",
36+
"user_viewable": true,
37+
"user_editable": true,
38+
"rules": "nullable|string|max:20",
39+
"field_type": "text"
40+
},
41+
{
42+
"name": "Password",
43+
"description": "Password required for connections.",
44+
"env_variable": "PASSWORD",
45+
"default_value": "",
46+
"user_viewable": true,
47+
"user_editable": true,
48+
"rules": "nullable|string|max:20",
49+
"field_type": "text"
50+
},
51+
{
52+
"name": "Auth Token",
53+
"description": "Authorization token required for connections. If set, Username\/Password based authentication will be disabled.",
54+
"env_variable": "AUTH_TOKEN",
55+
"default_value": "",
56+
"user_viewable": true,
57+
"user_editable": true,
58+
"rules": "nullable|string|max:255",
59+
"field_type": "text"
60+
},
61+
{
62+
"name": "Enable JetStream",
63+
"description": "Enable JetStream functionality.",
64+
"env_variable": "JETSTREAM",
65+
"default_value": "1",
66+
"user_viewable": true,
67+
"user_editable": true,
68+
"rules": "required|boolean|in:0,1",
69+
"field_type": "text"
70+
},
71+
{
72+
"name": "VERSION",
73+
"description": "Version to install",
74+
"env_variable": "VERSION",
75+
"default_value": "latest",
76+
"user_viewable": true,
77+
"user_editable": true,
78+
"rules": "required|string|max:20",
79+
"field_type": "text"
80+
}
81+
]
82+
}

0 commit comments

Comments
 (0)