Merge branch 'dev' of ssh://git.commumedia.org:2222/alex/headquarter into dev

This commit is contained in:
Fusion
2026-05-24 20:13:17 +02:00
2 changed files with 20 additions and 8 deletions
+12 -2
View File
@@ -78,8 +78,13 @@ class MountItem(BaseModel):
@classmethod
def validate_files(cls, v: dict) -> dict:
for path in v.keys():
if ".." in path or path.startswith("/") or not path:
if ".." in path or not path:
raise ValueError(f"Invalid file path: {path}")
if path.startswith("/"):
raise ValueError(
f"Mount file paths must be relative (got: {path}). "
f"The mount target defines the absolute container path."
)
return v
@@ -103,8 +108,13 @@ class ConfigProfileCreate(BaseModel):
@classmethod
def validate_files(cls, v: dict) -> dict:
for path in v.keys():
if ".." in path or path.startswith("/") or not path:
if ".." in path or not path:
raise ValueError(f"Invalid file path: {path}")
if path.startswith("/"):
raise ValueError(
f"File paths must be relative (got: {path}). "
f"Use Mounts for absolute container paths."
)
return v
@field_validator("env_vars")
+8 -6
View File
@@ -343,8 +343,8 @@ export const ConfigProfilesPage = () => {
<div className="form-section">
<h4>Environment Variables</h4>
{Object.entries(formData.env_vars || {}).map(([key, value]) => (
<div key={key} className="form-row">
{Object.entries(formData.env_vars || {}).map(([key, value], idx) => (
<div key={idx} className="form-row">
<input
type="text"
value={key}
@@ -387,8 +387,9 @@ export const ConfigProfilesPage = () => {
<div className="form-section">
<h4>Files</h4>
{Object.entries(formData.files || {}).map(([path, content]) => (
<div key={path} className="file-entry">
<p className="muted">Relative paths written to the instance directory. Use Mounts below for absolute container paths.</p>
{Object.entries(formData.files || {}).map(([path, content], idx) => (
<div key={idx} className="file-entry">
<input
type="text"
value={path}
@@ -414,6 +415,7 @@ export const ConfigProfilesPage = () => {
<div className="form-section">
<h4>Mounts</h4>
<p className="muted">Bind directories into the container at absolute paths. Files are relative to the mount target.</p>
{(formData.mounts || []).map((mount, index) => (
<div key={index} className="mount-entry card">
<div className="form-row">
@@ -442,8 +444,8 @@ export const ConfigProfilesPage = () => {
</div>
<div className="mount-files">
{Object.entries(mount.files).map(([path, content]) => (
<div key={path} className="file-entry">
{Object.entries(mount.files).map(([path, content], idx) => (
<div key={idx} className="file-entry">
<input
type="text"
value={path}