peace on earth
This commit is contained in:
parent
1528f0a2b0
commit
0d2260f983
4
.env
4
.env
@ -1,11 +1,11 @@
|
|||||||
STEAMAPPID=232330
|
STEAMAPPID=232330
|
||||||
STEAMAPP=css
|
STEAMAPP=css
|
||||||
|
|
||||||
SRCDS_TOKEN=C02633B3395EA6BEF7D8DFBA440ABB7F
|
SRCDS_TOKEN=3C403551712E10420F08F5CA337F9B21
|
||||||
SRCDS_RCONPW="reebok"
|
SRCDS_RCONPW="reebok"
|
||||||
SRCDS_PW="6"
|
SRCDS_PW="6"
|
||||||
|
|
||||||
SRCDS_STARTMAP="surf_fornax"
|
SRCDS_STARTMAP="surf_anzchamps"
|
||||||
SRCDS_HOSTNAME="megastructure surf"
|
SRCDS_HOSTNAME="megastructure surf"
|
||||||
SRCDS_MAXPLAYERS=16
|
SRCDS_MAXPLAYERS=16
|
||||||
|
|
||||||
|
|||||||
23
k8s.yaml
23
k8s.yaml
@ -243,27 +243,17 @@ spec:
|
|||||||
value: "/tmp/mapsdl"
|
value: "/tmp/mapsdl"
|
||||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||||
value: "/app/credentials/service-account.json"
|
value: "/app/credentials/service-account.json"
|
||||||
- name: MAPS_WISHLIST
|
- name: MAPS_LIST_FILE
|
||||||
value: |
|
value: "/cfg/mapcycle.txt"
|
||||||
surf_anzchamps
|
|
||||||
surf_boreas
|
|
||||||
surf_deathstar
|
|
||||||
surf_ebony
|
|
||||||
surf_fornax
|
|
||||||
surf_garden
|
|
||||||
surf_in_space
|
|
||||||
surf_kepler
|
|
||||||
surf_kitsune
|
|
||||||
surf_kitsune2
|
|
||||||
surf_lt_omnific
|
|
||||||
surf_pantheon
|
|
||||||
surf_utopia_njv
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: fastdl-maps
|
- name: fastdl-maps
|
||||||
mountPath: /maps
|
mountPath: /maps
|
||||||
- name: credentials
|
- name: credentials
|
||||||
mountPath: /app/credentials
|
mountPath: /app/credentials
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
- name: cfg
|
||||||
|
mountPath: /cfg
|
||||||
|
readOnly: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: fastdl-maps
|
- name: fastdl-maps
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
@ -271,5 +261,8 @@ spec:
|
|||||||
- name: credentials
|
- name: credentials
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /run/desktop/mnt/host/c/Users/ntr/code/surf_megastructure/src/mapsdl/credentials
|
path: /run/desktop/mnt/host/c/Users/ntr/code/surf_megastructure/src/mapsdl/credentials
|
||||||
|
- name: cfg
|
||||||
|
configMap:
|
||||||
|
name: cfg
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@ -17,6 +17,7 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libtinfo5 \
|
libtinfo5 \
|
||||||
libcurl3-gnutls \
|
libcurl3-gnutls \
|
||||||
unzip \
|
unzip \
|
||||||
|
bzip2 \
|
||||||
rcon \
|
rcon \
|
||||||
neovim \
|
neovim \
|
||||||
tmux \
|
tmux \
|
||||||
|
|||||||
18
src/cssds/cfg/motd.txt
Normal file
18
src/cssds/cfg/motd.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<html>
|
||||||
|
<body style="background:#0a0a0a;color:#00ff88;font-family:monospace;padding:20px;">
|
||||||
|
<pre style="font-size:6px;line-height:1.1;">
|
||||||
|
███╗ ███╗███████╗ ██████╗ █████╗ ███████╗████████╗██████╗ ██╗ ██╗ ██████╗████████╗██╗ ██╗██████╗ ███████╗
|
||||||
|
████╗ ████║██╔════╝██╔════╝ ██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║ ██║██╔════╝╚══██╔══╝██║ ██║██╔══██╗██╔════╝
|
||||||
|
██╔████╔██║█████╗ ██║ ███╗███████║███████╗ ██║ ██████╔╝██║ ██║██║ ██║ ██║ ██║██████╔╝█████╗
|
||||||
|
██║╚██╔╝██║██╔══╝ ██║ ██║██╔══██║╚════██║ ██║ ██╔══██╗██║ ██║██║ ██║ ██║ ██║██╔══██╗██╔══╝
|
||||||
|
██║ ╚═╝ ██║███████╗╚██████╔╝██║ ██║███████║ ██║ ██║ ██║╚██████╔╝╚██████╗ ██║ ╚██████╔╝██║ ██║███████╗
|
||||||
|
╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
||||||
|
███████╗██╗ ██╗██████╗ ███████╗
|
||||||
|
██╔════╝██║ ██║██╔══██╗██╔════╝
|
||||||
|
███████╗██║ ██║██████╔╝█████╗
|
||||||
|
╚════██║██║ ██║██╔══██╗██╔══╝
|
||||||
|
███████║╚██████╔╝██║ ██║██║
|
||||||
|
╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -69,21 +69,6 @@ install_surf() {
|
|||||||
echo "Installed SourceMod $SOURCEMOD_VERSION"
|
echo "Installed SourceMod $SOURCEMOD_VERSION"
|
||||||
echo "--------------------------------------------------------------"
|
echo "--------------------------------------------------------------"
|
||||||
fi
|
fi
|
||||||
# Install sm-json (required for JSON zone loading - pure SourcePawn library)
|
|
||||||
if [ ! -f "$CSTRIKE/addons/sourcemod/scripting/include/json.inc" ]; then
|
|
||||||
cd /tmp
|
|
||||||
wget "https://github.com/clugg/sm-json/archive/refs/tags/v5.0.1.zip" -O sm-json-v5.0.1.zip
|
|
||||||
unzip -o sm-json-v5.0.1.zip
|
|
||||||
cp -r sm-json-5.0.1/addons/* "$CSTRIKE/addons/" 2>/dev/null || true
|
|
||||||
rm -rf sm-json-v5.0.1.zip sm-json-5.0.1/
|
|
||||||
echo "--------------------------------------------------------------"
|
|
||||||
echo "Installed sm-json v5.0.1"
|
|
||||||
echo "--------------------------------------------------------------"
|
|
||||||
else
|
|
||||||
echo "--------------------------------------------------------------"
|
|
||||||
echo "sm-json already installed"
|
|
||||||
echo "--------------------------------------------------------------"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install sm_closestpos (required for ghost/replay functionality)
|
# Install sm_closestpos (required for ghost/replay functionality)
|
||||||
if [ ! -f "$CSTRIKE/addons/sourcemod/extensions/closestpos.ext.so" ]; then
|
if [ ! -f "$CSTRIKE/addons/sourcemod/extensions/closestpos.ext.so" ]; then
|
||||||
@ -211,8 +196,8 @@ install_surf() {
|
|||||||
cd /tmp
|
cd /tmp
|
||||||
wget "https://github.com/jason-e/rngfix/releases/download/v1.1.3/rngfix_1.1.3.zip"
|
wget "https://github.com/jason-e/rngfix/releases/download/v1.1.3/rngfix_1.1.3.zip"
|
||||||
unzip -o "rngfix_1.1.3.zip"
|
unzip -o "rngfix_1.1.3.zip"
|
||||||
cp -r addons/* "$CSTRIKE/addons/" 2>/dev/null || true
|
cp -r rngfix_1.1.3/* "$CSTRIKE/addons/sourcemod/" 2>/dev/null || true
|
||||||
rm -rf "rngfix_1.1.3.zip" addons/
|
rm -rf "rngfix_1.1.3.zip" rngfix_1.1.3/
|
||||||
echo "--------------------------------------------------------------"
|
echo "--------------------------------------------------------------"
|
||||||
echo "Installed RNGFix v1.1.3"
|
echo "Installed RNGFix v1.1.3"
|
||||||
echo "--------------------------------------------------------------"
|
echo "--------------------------------------------------------------"
|
||||||
@ -451,6 +436,7 @@ EOF
|
|||||||
cfg() {
|
cfg() {
|
||||||
cd
|
cd
|
||||||
cp src/cfg/server.cfg cssds/cstrike/cfg/
|
cp src/cfg/server.cfg cssds/cstrike/cfg/
|
||||||
|
cp src/cfg/motd.txt cssds/cstrike/
|
||||||
cp cfg/mapcycle.txt cssds/cstrike/cfg/
|
cp cfg/mapcycle.txt cssds/cstrike/cfg/
|
||||||
sed -i "s|sv_downloadurl .*|sv_downloadurl \"${FASTDL_URL:-}/cstrike/\"|" "$CSTRIKE/cfg/server.cfg"
|
sed -i "s|sv_downloadurl .*|sv_downloadurl \"${FASTDL_URL:-}/cstrike/\"|" "$CSTRIKE/cfg/server.cfg"
|
||||||
}
|
}
|
||||||
@ -513,6 +499,7 @@ run_cssds() {
|
|||||||
|
|
||||||
./srcds_run -game cstrike \
|
./srcds_run -game cstrike \
|
||||||
-port "${SRCDS_PORT}" \
|
-port "${SRCDS_PORT}" \
|
||||||
|
+sv_setsteamaccount "${SRCDS_TOKEN}" \
|
||||||
+maxplayers "${SRCDS_MAXPLAYERS}" \
|
+maxplayers "${SRCDS_MAXPLAYERS}" \
|
||||||
+map "$startmap" \
|
+map "$startmap" \
|
||||||
-ip "${SRCDS_IP}"
|
-ip "${SRCDS_IP}"
|
||||||
|
|||||||
@ -7,8 +7,17 @@ import {
|
|||||||
downloadAndExtractMaps,
|
downloadAndExtractMaps,
|
||||||
} from "./common.ts";
|
} from "./common.ts";
|
||||||
|
|
||||||
|
function loadMapList(): string[] {
|
||||||
|
const listFile = Deno.env.get("MAPS_LIST_FILE");
|
||||||
|
if (listFile) {
|
||||||
|
const text = Deno.readTextFileSync(listFile);
|
||||||
|
return text.split("\n").map(s => s.replace(/\/\/.*/, "").trim()).filter(Boolean);
|
||||||
|
}
|
||||||
|
return (Deno.env.get("MAPS_WISHLIST") || "").split("\n").map(s => s.trim()).filter(Boolean);
|
||||||
|
}
|
||||||
|
|
||||||
const CONFIG = {
|
const CONFIG = {
|
||||||
maps: (Deno.env.get("MAPS_WISHLIST") || "").split("\n").map(s => s.trim()).filter(Boolean),
|
maps: loadMapList(),
|
||||||
mapsDir: Deno.env.get("MAPS_DIR") || "/home/ntr/surf_megastructure/data/cssds/cstrike/maps",
|
mapsDir: Deno.env.get("MAPS_DIR") || "/home/ntr/surf_megastructure/data/cssds/cstrike/maps",
|
||||||
tempDir: Deno.env.get("TEMP_DIR") || "/tmp/mapsdl",
|
tempDir: Deno.env.get("TEMP_DIR") || "/tmp/mapsdl",
|
||||||
serviceAccountPath: Deno.env.get("GOOGLE_APPLICATION_CREDENTIALS") || "./credentials/service-account.json",
|
serviceAccountPath: Deno.env.get("GOOGLE_APPLICATION_CREDENTIALS") || "./credentials/service-account.json",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user