Key setup fucking works

This commit is contained in:
iamBadgers
2026-04-11 13:45:06 -07:00
parent c63e9b19bd
commit c89a17c71f
4 changed files with 23 additions and 15 deletions

View File

@@ -1,5 +1,8 @@
import docker
from game_tables import GameTable
from key_tables import KeyTable
import shutil
import os
def build_container_routing_labels(prefix: str, strip_prefix=True):
@@ -23,7 +26,6 @@ def build_container_routing_labels(prefix: str, strip_prefix=True):
return labels
def stop_container(docker_id):
try:
client = docker.from_env()
@@ -34,7 +36,7 @@ def stop_container(docker_id):
return False
def start_foundry_container(table: GameTable, version=12):
def start_foundry_container(table: GameTable, key: KeyTable, version=12):
client = docker.from_env()
container = None
@@ -50,11 +52,13 @@ def start_foundry_container(table: GameTable, version=12):
else:
image = "felddy/foundryvtt:{version}".format(version=version)
labels = build_container_routing_labels(table.game_table_link, False)
os.makedirs("/data/" + table.game_table_link + "/Config", exist_ok=True)
shutil.copyfile(src="/data/keys/" + key.key_file, dst="/data/"+table.game_table_link+"/Config/license.json")
volumes = {
"/home/cow/Projects/dockertesting/server_data_mount/{prefix}".format(
"/home/cow/Projects/dockertesting/data/{prefix}".format(
prefix=table.game_table_link
): {"bind": "/data", "mode": "rw"},
"/home/cow/Projects/dockertesting/server_data_mount/foundry_cache": {
"/home/cow/Projects/dockertesting/data/container_cache": {
"bind": "/data/container_cache"
},
}