File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " admincraft-websocket" ,
3
- "version" : " 1.0.1 " ,
3
+ "version" : " 1.0.2 " ,
4
4
"description" : " WebSocket server for handling real-time communication between Admincraft and the Minecraft server" ,
5
5
"main" : " server.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const PORT = 8080;
13
13
const CERT_PATH = "./certs/server.crt" ; // Public certificate path
14
14
const KEY_PATH = "./certs/server.key" ; // Private key path
15
15
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
17
17
if ( ! SECRET_KEY ) {
18
18
throw new Error ( "SECRET_KEY is not defined in docker-compose.yml" ) ;
19
19
}
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments