Skip to content

Commit 87e29ca

Browse files
committed
chore: update version to 1.0.2 and add PowerShell script for container testing
1 parent 804234f commit 87e29ca

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "admincraft-websocket",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "WebSocket server for handling real-time communication between Admincraft and the Minecraft server",
55
"main": "server.js",
66
"scripts": {

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const PORT = 8080;
1313
const CERT_PATH = "./certs/server.crt"; // Public certificate path
1414
const KEY_PATH = "./certs/server.key"; // Private key path
1515
const MAX_MESSAGES_PER_SECOND = 5; // Rate limiting configuration
16-
const MC_NAME = process.env.MC_NAME || "minecraft";
16+
const MC_NAME = process.env.MC_NAME || "minecraft"; // Minecraft container name
1717
if (!SECRET_KEY) {
1818
throw new Error("SECRET_KEY is not defined in docker-compose.yml");
1919
}

test-start-container.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PowerShell script to test the start of the admincraft-websocket container
2+
3+
# Configuration variables
4+
$SECRET_KEY = "your_secret_key_here" # Change this to a secure value
5+
$USE_SSL = $false
6+
$MC_NAME = "minecraft"
7+
8+
# Convert boolean to string for environment variable
9+
$USE_SSL_STRING = if ($USE_SSL) { "true" } else { "false" }
10+
11+
Write-Host "Building Docker image..." -ForegroundColor Cyan
12+
docker build -t admincraft-websocket .
13+
14+
Write-Host "Starting admincraft-websocket container..." -ForegroundColor Green
15+
docker run -d --name admincraft-websocket `
16+
-p 8080:8080 `
17+
-e SECRET_KEY=$SECRET_KEY `
18+
-e USE_SSL=$USE_SSL_STRING `
19+
-e MC_NAME=$MC_NAME `
20+
-v /var/run/docker.sock:/var/run/docker.sock `
21+
--restart unless-stopped `
22+
admincraft-websocket
23+
24+
Write-Host "Container started! WebSocket server is available at http://localhost:8080" -ForegroundColor Yellow
25+
Write-Host "Remember to change the SECRET_KEY value in this script for production use." -ForegroundColor Red

0 commit comments

Comments
 (0)