added more keys
Dieser Commit ist enthalten in:
Ursprung
920da46658
Commit
4242ce0c95
|
@ -34,6 +34,10 @@ class Module(SystemdUnitModule): # type: ignore
|
||||||
elements=str,
|
elements=str,
|
||||||
help="Routes of networks that can be reached with this device",
|
help="Routes of networks that can be reached with this device",
|
||||||
),
|
),
|
||||||
|
masquerade=Types.str(
|
||||||
|
help="how the packets are modified to look like the come from the computer itself.",
|
||||||
|
choices=("true", "false", "both", "ipv4", "ipv6"),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
required_if=(("defaultdns", True, ("dns",), False),),
|
required_if=(("defaultdns", True, ("dns",), False),),
|
||||||
required_one_of=(("mac", "device", "virtualization"),),
|
required_one_of=(("mac", "device", "virtualization"),),
|
||||||
|
@ -86,6 +90,13 @@ class Module(SystemdUnitModule): # type: ignore
|
||||||
options.append("DNSSEC={}".format(systemdbool(self.get("dnssec", "allow-downgrade"))))
|
options.append("DNSSEC={}".format(systemdbool(self.get("dnssec", "allow-downgrade"))))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
if self.get("masquerade", -1) != -1:
|
||||||
|
masquerade = self.get("masquerade")
|
||||||
|
if masquerade == "true":
|
||||||
|
masquerade = "both"
|
||||||
|
elif masquerade == "false":
|
||||||
|
masquerade = "no"
|
||||||
|
options.append(f"IPMasquerade={masquerade}")
|
||||||
output += "\n".join(options)
|
output += "\n".join(options)
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
@ -187,6 +198,17 @@ options:
|
||||||
value.
|
value.
|
||||||
required: false
|
required: false
|
||||||
type: str
|
type: str
|
||||||
|
masquerade:
|
||||||
|
choices:
|
||||||
|
- 'true'
|
||||||
|
- 'false'
|
||||||
|
- both
|
||||||
|
- ipv4
|
||||||
|
- ipv6
|
||||||
|
description:
|
||||||
|
- how the packets are modified to look like the come from the computer itself.
|
||||||
|
required: false
|
||||||
|
type: str
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- name of the unit
|
- name of the unit
|
||||||
|
|
|
@ -48,7 +48,43 @@ class Module(SystemdUnitModule, SystemdReloadMixin):
|
||||||
),
|
),
|
||||||
help="List of environment variables that are set to each command before they run",
|
help="List of environment variables that are set to each command before they run",
|
||||||
),
|
),
|
||||||
workingdirectory=Types.str(help="The Directory that is used for the processes as current working directory"),
|
workingdirectory=Types.str(
|
||||||
|
help="The Directory that is used for the processes as current working directory",
|
||||||
|
),
|
||||||
|
rwpath=Types.list(
|
||||||
|
elements=Types.path(),
|
||||||
|
help="Path(s) that are readable and writable (if permission allow)",
|
||||||
|
),
|
||||||
|
ropath=Types.list(
|
||||||
|
elements=Types.path(),
|
||||||
|
help="Path(s) that are read only",
|
||||||
|
),
|
||||||
|
notreadablepath=Types.list(
|
||||||
|
elements=Types.path(),
|
||||||
|
help="Path(s) that are not accessible by the applications",
|
||||||
|
),
|
||||||
|
execpath=Types.list(
|
||||||
|
elements=Types.path(),
|
||||||
|
help="Path(s) where executable files are",
|
||||||
|
),
|
||||||
|
noexecpath=Types.list(
|
||||||
|
elements=Types.path(),
|
||||||
|
help="Path(s) which are never executable (uploaded files, user accessible paths)",
|
||||||
|
),
|
||||||
|
protecthome=Types.str(
|
||||||
|
help="if true makes user specific directories (/home, /root, /run/user) inaccessible. read-only makes them read only and tmpfs is useful to create binds in it",
|
||||||
|
choices=("true", "false", "read-only", "tmpfs"),
|
||||||
|
),
|
||||||
|
protectsystem=Types.str(
|
||||||
|
help="makes the system read only. if true /usr, /boot and /efi are read only, if full additionally /etc and if strict all except /proc, /sys and /dev",
|
||||||
|
choices=("true", "false", "full", "strict"),
|
||||||
|
),
|
||||||
|
nonewprivileges=Types.bool(
|
||||||
|
help="disables the ability to get new capabilities for processes than already granted ones",
|
||||||
|
),
|
||||||
|
statedirectory=Types.str(
|
||||||
|
help="creates an unit specific state directory in /var/lib and sets the env var STATE_DIRECTORY with the path to it. Its cleaned up after the unit is stopped"
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -60,7 +96,11 @@ class Module(SystemdUnitModule, SystemdReloadMixin):
|
||||||
|
|
||||||
def service(self):
|
def service(self):
|
||||||
section = "[Service]\n"
|
section = "[Service]\n"
|
||||||
section += "".join(
|
params = []
|
||||||
|
if self.get("environment", False):
|
||||||
|
for env in self.get("environment"):
|
||||||
|
params.append(f"Environment={env['name']}={env['value']}\n")
|
||||||
|
params.extend(
|
||||||
self.map_param(
|
self.map_param(
|
||||||
type="Type",
|
type="Type",
|
||||||
pre="ExecStartPre",
|
pre="ExecStartPre",
|
||||||
|
@ -69,8 +109,19 @@ class Module(SystemdUnitModule, SystemdReloadMixin):
|
||||||
serviceuser="User",
|
serviceuser="User",
|
||||||
servicegroup="Group",
|
servicegroup="Group",
|
||||||
workingdirectory="WorkingDirectory",
|
workingdirectory="WorkingDirectory",
|
||||||
|
environmentfile="EnvironmentFile",
|
||||||
|
protecthome="ProtectHome",
|
||||||
|
protectsystem="ProtectSystem",
|
||||||
|
rwpath="ReadWritePaths",
|
||||||
|
ropath="ReadOnlyPaths",
|
||||||
|
notreadablepath="InaccessiblePaths",
|
||||||
|
execpath="ExecPaths",
|
||||||
|
noexecpath="NoExecPaths",
|
||||||
|
statedirectory="StateDirectory",
|
||||||
|
nonewprivileges="NoNewPriviledges"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
section += "".join(params)
|
||||||
return section
|
return section
|
||||||
|
|
||||||
def unit(self) -> str:
|
def unit(self) -> str:
|
||||||
|
@ -142,11 +193,38 @@ options:
|
||||||
elements: str
|
elements: str
|
||||||
required: false
|
required: false
|
||||||
type: list
|
type: list
|
||||||
|
execpath:
|
||||||
|
default: []
|
||||||
|
description:
|
||||||
|
- Path(s) where executable files are
|
||||||
|
elements: path
|
||||||
|
required: false
|
||||||
|
type: list
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Name of the service
|
- Name of the service
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
|
noexecpath:
|
||||||
|
default: []
|
||||||
|
description:
|
||||||
|
- Path(s) which are never executable (uploaded files, user accessible paths)
|
||||||
|
elements: path
|
||||||
|
required: false
|
||||||
|
type: list
|
||||||
|
nonewprivileges:
|
||||||
|
description:
|
||||||
|
- disables the ability to get new capabilities for processes than already granted
|
||||||
|
ones
|
||||||
|
required: false
|
||||||
|
type: bool
|
||||||
|
notreadablepath:
|
||||||
|
default: []
|
||||||
|
description:
|
||||||
|
- Path(s) that are not accessible by the applications
|
||||||
|
elements: path
|
||||||
|
required: false
|
||||||
|
type: list
|
||||||
partof:
|
partof:
|
||||||
default: []
|
default: []
|
||||||
description:
|
description:
|
||||||
|
@ -171,6 +249,28 @@ options:
|
||||||
elements: str
|
elements: str
|
||||||
required: false
|
required: false
|
||||||
type: list
|
type: list
|
||||||
|
protecthome:
|
||||||
|
choices:
|
||||||
|
- 'true'
|
||||||
|
- 'false'
|
||||||
|
- read-only
|
||||||
|
- tmpfs
|
||||||
|
description:
|
||||||
|
- if true makes user specific directories (/home, /root, /run/user) inaccessible.
|
||||||
|
read-only makes them read only and tmpfs is useful to create binds in it
|
||||||
|
required: false
|
||||||
|
type: str
|
||||||
|
protectsystem:
|
||||||
|
choices:
|
||||||
|
- 'true'
|
||||||
|
- 'false'
|
||||||
|
- full
|
||||||
|
- strict
|
||||||
|
description:
|
||||||
|
- makes the system read only. if true /usr, /boot and /efi are read only, if full
|
||||||
|
additionally /etc and if strict all except /proc, /sys and /dev
|
||||||
|
required: false
|
||||||
|
type: str
|
||||||
required_by:
|
required_by:
|
||||||
default: []
|
default: []
|
||||||
description:
|
description:
|
||||||
|
@ -186,6 +286,20 @@ options:
|
||||||
elements: str
|
elements: str
|
||||||
required: false
|
required: false
|
||||||
type: list
|
type: list
|
||||||
|
ropath:
|
||||||
|
default: []
|
||||||
|
description:
|
||||||
|
- Path(s) that are read only
|
||||||
|
elements: path
|
||||||
|
required: false
|
||||||
|
type: list
|
||||||
|
rwpath:
|
||||||
|
default: []
|
||||||
|
description:
|
||||||
|
- Path(s) that are readable and writable (if permission allow)
|
||||||
|
elements: path
|
||||||
|
required: false
|
||||||
|
type: list
|
||||||
servicegroup:
|
servicegroup:
|
||||||
default: root
|
default: root
|
||||||
description:
|
description:
|
||||||
|
@ -205,6 +319,12 @@ options:
|
||||||
elements: str
|
elements: str
|
||||||
required: true
|
required: true
|
||||||
type: list
|
type: list
|
||||||
|
statedirectory:
|
||||||
|
description:
|
||||||
|
- creates an unit specific state directory in /var/lib and sets the env var STATE_DIRECTORY
|
||||||
|
with the path to it. Its cleaned up after the unit is stopped
|
||||||
|
required: false
|
||||||
|
type: str
|
||||||
type:
|
type:
|
||||||
choices:
|
choices:
|
||||||
- simple
|
- simple
|
||||||
|
|
Laden…
In neuem Issue referenzieren