Compare commits
No commits in common. "3b79efaa802d7225618bc7365e05ded7e364dd85" and "26d171e6d3e27370fb529ee0cc059a4b577cd0cc" have entirely different histories.
3b79efaa80
...
26d171e6d3
2 changed files with 2 additions and 8 deletions
|
|
@ -119,7 +119,6 @@ class EasyRSA:
|
|||
config = Config._
|
||||
|
||||
if (ca_password := config.crypto.ca_password) is None:
|
||||
# generate and save new CA password
|
||||
ca_password = pwd.genword(
|
||||
length=32,
|
||||
charset="ascii_62",
|
||||
|
|
@ -160,17 +159,14 @@ class EasyRSA:
|
|||
|
||||
config = Config._
|
||||
|
||||
# always include password options
|
||||
extra_args: list[str] = [
|
||||
f"--passout=pass:{self.ca_password}",
|
||||
f"--passin=pass:{self.ca_password}",
|
||||
]
|
||||
|
||||
# if given, include expiry option
|
||||
if expiry_days is not None:
|
||||
extra_args += [f"--days={expiry_days}"]
|
||||
|
||||
# if configured, include algorithm option
|
||||
if (algorithm := config.crypto.key_algorithm) is not None:
|
||||
args_map = {
|
||||
KeyAlgorithm.rsa2048: [
|
||||
|
|
@ -195,13 +191,11 @@ class EasyRSA:
|
|||
|
||||
extra_args += args_map[algorithm]
|
||||
|
||||
# call easyrsa
|
||||
self.__easyrsa(
|
||||
*extra_args,
|
||||
*easyrsa_args
|
||||
)
|
||||
|
||||
# parse the new certificate
|
||||
with open(
|
||||
self.output_directory.joinpath(cert_filename), "rb"
|
||||
) as cert_file:
|
||||
|
|
@ -211,7 +205,7 @@ class EasyRSA:
|
|||
|
||||
def init_pki(self) -> None:
|
||||
"""
|
||||
Clean working directory
|
||||
Clean the working directory
|
||||
"""
|
||||
|
||||
self.__easyrsa("init-pki")
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ async def initial_configure(
|
|||
)
|
||||
async def create_initial_admin(
|
||||
admin_user: UserCreate,
|
||||
_: Config = Depends(get_current_config),
|
||||
current_config: Config = Depends(get_current_config),
|
||||
):
|
||||
"""
|
||||
PUT ./install/admin: Create the first administrative user.
|
||||
|
|
|
|||
Loading…
Reference in a new issue