Skip to content

Commit

Permalink
fix: allow empty expire dates for accoutns
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkolenz committed Dec 13, 2023
1 parent 07c3f46 commit b453107
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

We offer the custom command `userctl` to manage users on the server.
Please do **not** use the standard Linux commands (e.g., `useradd`, `adduser`, ...)!
The script is interactive and allows to add, remove, and edit users.
The script allows to add, remove, and edit users.
Please run `sudo userctl --help` for more information.

Users on this server are identified by their university email address.
Thus, `userctl` expects the full email address as argument.
When creating student accounts, please provide `--expire-date` to automatically disable login after their project is finished.
We recommend to set the date to nine months after the account creation, this should cover most use cases.

## Process Management

Expand Down
8 changes: 4 additions & 4 deletions modules/userctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def add(
],
full_name: Annotated[
str,
typer.Option(prompt=True),
typer.Option(),
],
expire_date: Annotated[
datetime,
typer.Option(prompt=True, formats=[DATE_FORMAT]),
],
Optional[datetime],
typer.Option(formats=[DATE_FORMAT]),
] = None,
) -> None:
password = secrets.token_urlsafe()

Expand Down

0 comments on commit b453107

Please sign in to comment.