6 Commits

Author SHA1 Message Date
9cbfb0f25f fixed bug with utilizing arbitrary keys 2024-05-01 21:12:39 -04:00
db3ed868e6 fixed bug where Default keys were overridden 2024-05-01 21:11:40 -04:00
489ecbdeef Update README.md 2024-05-01 21:08:48 -04:00
df26d33740 optimize history display 2024-04-30 21:47:03 -04:00
152600cc7d cleanup 2024-04-30 21:46:56 -04:00
de937fb502 Update README.md 2024-04-30 20:37:47 -04:00
6 changed files with 18 additions and 11 deletions

View File

@ -2,11 +2,11 @@
## Demo
COMING SOON
[autopve_demo.webm](https://github.com/natankeddem/autopve/assets/44515217/827bdd22-5311-43c1-9452-a56fa11998aa)
## Information
GUI configurable web server for Proxmox automated installation.
GUI configurable web server for Proxmox automated installation. More information about the automated installation feature built into the Proxmox installation media can be found [here](https://pve.proxmox.com/wiki/Automated_Installation).
## Features
@ -45,3 +45,10 @@ GUI configurable web server for Proxmox automated installation.
The configuration GUI can be accessed at `http://host:8080`. Answers are hosted at `http://host:8080/answer`.
### OPNsense Setup
For Unbound you will need to enable TXT records and make an appropriate host override entry.
![image](https://github.com/natankeddem/autopve/assets/44515217/997f15b7-e46f-4320-9d19-23feffcb4fdc)
![image](https://github.com/natankeddem/autopve/assets/44515217/e680fff0-e8b0-4236-88e9-0cd45ce1088c)

View File

@ -371,4 +371,4 @@ class JsonEditor(ui.json_editor):
def __init__(self, properties: Dict, *, on_select: Optional[Callable] = None, on_change: Optional[Callable] = None) -> None:
super().__init__(properties, on_select=on_select, on_change=on_change)
self.classes("jse-theme-dark")
self.tailwind.height("[640px]").width("[640px]")
self.tailwind.height("[320px]").width("[640px]")

View File

@ -20,13 +20,13 @@ def build():
@app.post("/answer")
async def post_answer(request: Request) -> PlainTextResponse:
def response(answer: str, system_info: Dict[str, Any], data: Dict[str, Any]):
toml = tomlkit.dumps(default_data)
toml = tomlkit.dumps(data)
toml_fixed = ""
for line in toml.splitlines():
if len(line) > 0 and line[0] == '"':
line = line.replace('"', "", 2)
toml_fixed = toml_fixed + line + "\n"
r = history.Request(answer=answer, response=toml_fixed, system_info=dict(system_info))
r = history.Request(answer=answer, response=toml_fixed, system_info=copy.deepcopy(system_info))
history.History.add_history(r)
for client in Client.instances.values():
if not client.has_socket_connection:
@ -37,12 +37,12 @@ def build():
system_info = await request.json()
system_info_raw = json.dumps(system_info)
default_data = dict(storage.answer("Default"))
default_data = copy.deepcopy(storage.answer("Default"))
answers = list(storage.answers.keys())
if "Default" in answers:
answers.remove("Default")
for answer in answers:
answer_data = dict(storage.answer(answer))
answer_data = copy.deepcopy(storage.answer(answer))
if "match" in answer_data:
if len(answer_data["match"]) > 0 and answer_data["match"] in system_info_raw:
if "global" in default_data and "global" in answer_data:

View File

@ -60,7 +60,7 @@ class Tab:
"control": el.FInput(
key,
password=True if key == "root_password" else False,
autocomplete=keys[key]["options"] if "options" in keys[key] else None,
autocomplete=keys[key]["options"] if key in keys and "options" in keys[key] else None,
on_change=lambda e, key=key: set_key(key, e.value),
),
"row": key_row,
@ -78,7 +78,7 @@ class Tab:
def set_key(key, value: str):
if len(value) > 0:
if "type" in keys[key]:
if key in keys and "type" in keys[key]:
if keys[key]["type"] == "list":
self.picked_keys[key] = value[1:-1].split(",")
elif keys[key]["type"] == "int":

View File

@ -84,7 +84,7 @@ class History(Tab):
el.JsonEditor(properties=properties)
with ui.tab_panel(response_tab):
response = e.args["data"]["response"]
ui.code(response).tailwind.height("[640px]").width("[640px]")
ui.code(response).tailwind.height("[320px]").width("[640px]")
with el.WRow() as row:
row.tailwind.height("[40px]")

View File

@ -1,7 +1,7 @@
version: "3.8"
services:
bale:
autopve:
image: ghcr.io/natankeddem/autopve:latest
ports:
- 8080:8080