admin
Administrator endpoints: users, groups, stores, installed apps, templates.
attributelogger= logging.getLogger(__name__)attributestatus_router= APIRouter(route_class=EncryptedRoute)attributerouter= APIRouter(prefix='/api/admin', dependencies=[Depends(verify_admin)], route_class=EncryptedRoute)func_gpu_list() -> list[GPUInfo]Return the detected GPUs as API models.
Returns
list[app.models.GPUInfo]funcadmin_status(user=Depends(verify_token)) -> dict[str, Any]Return the caller's role, settings and host statistics.
paramuserdict[str, Any]= Depends(verify_token)Returns
dict[str, typing.Any]funcget_management_data() -> dict[str, Any]Return users, groups and server details for the dashboard.
Returns
dict[str, typing.Any]func_require_safe_name(name, kind) -> strValidate a store or template name for use in file paths.
paramnamestrparamkindstrReturns
strfuncget_app_stores() -> list[AppStore]List configured app stores.
Returns
list[app.models.AppStore]funcadd_app_store(decrypted_body=Depends(get_decrypted_request_body)) -> AppStoreAdd an app store.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.AppStorefuncdelete_app_store(store_name) -> ResponseRemove an app store.
paramstore_namestrReturns
fastapi.Responsefuncget_available_apps(url, store_name, refresh=False) -> list[dict[str, Any]]Return the apps published by a store (cached unless refresh).
paramurlstrparamstore_namestrparamrefreshbool= FalseReturns
list[dict[str, typing.Any]]func_save_logo(app_id, logo) -> str | NonePersist a base64 logo as a PNG icon and return the icon URL.
paramapp_idstrApp the icon belongs to.
paramlogostr | NoneBase64 image data, an existing URL, or None.
Returns
str | None/api/app_icon/<id> when data was saved, otherwise logo unchanged.
func_normalise_scripts(provider_config) -> NoneTurn empty autostart script strings into None in place.
paramprovider_configdict[str, Any]Returns
Nonefunc_with_status(app) -> InstalledAppWithStatusAttach image metadata to an installed app.
paramappInstalledAppReturns
app.models.InstalledAppWithStatusfunclist_installed_apps() -> list[InstalledAppWithStatus]List installed apps with image status.
Returns
list[app.models.InstalledAppWithStatus]funcinstall_app(decrypted_body=Depends(get_decrypted_request_body)) -> InstalledAppInstall an app from a store entry sent by the admin UI.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.InstalledAppfuncupdate_installed_app(app_id, decrypted_body=Depends(get_decrypted_request_body)) -> InstalledAppReplace an installed app with a full definition.
paramapp_idstrparamdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.InstalledAppfuncpatch_installed_app(app_id, decrypted_body=Depends(get_decrypted_request_body)) -> InstalledAppPartially update an installed app.
Record fields (users, groups, app_template, auto_update,
home_directories) are applied directly; any other InstalledApp
field is merged into the record's overrides.
paramapp_idstrparamdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.InstalledAppfuncdelete_installed_app(app_id) -> ResponseUninstall an app (and purge a meta-app's icon and home template).
paramapp_idstrReturns
fastapi.Responsefunccheck_app_update(app_id) -> ImageUpdateCheckResponseCompare the local image digest with the registry.
paramapp_idstrReturns
app.models.ImageUpdateCheckResponsefuncpull_latest_app_image(app_id) -> ImagePullResponsePull the latest image of an app and refresh its autostart cache.
paramapp_idstrReturns
app.models.ImagePullResponsefunccreate_meta_app(decrypted_body=Depends(get_decrypted_request_body)) -> InstalledAppCreate a meta-app: a copy of an installed app with its own home template.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.InstalledAppfunclaunch_meta_for_customization(decrypted_body=Depends(get_decrypted_request_body), auth_user=Depends(verify_admin)) -> dict[str, str]Launch a meta-app with its home template mounted read-write.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)paramauth_userdict[str, Any]= Depends(verify_admin)Returns
dict[str, str]funcget_app_templates() -> list[dict[str, Any]]List app templates.
Returns
list[dict[str, typing.Any]]funcsave_app_template(decrypted_body=Depends(get_decrypted_request_body)) -> AppTemplateCreate or replace a template.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
app.models.AppTemplatefuncdelete_app_template(template_name) -> ResponseDelete a user template.
paramtemplate_namestrReturns
fastapi.Responsefuncget_all_sessions() -> list[UserSessionList]List every session grouped by user.
Returns
list[app.models.UserSessionList]funcstop_any_session(session_id) -> ResponseStop any user's session.
paramsession_idstrReturns
fastapi.Responsefunccreate_admin(decrypted_body=Depends(get_decrypted_request_body)) -> dict[str, Any]Create an administrator.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
dict[str, typing.Any]funcdelete_admin(username) -> ResponseDelete an administrator.
paramusernamestrReturns
fastapi.Responsefunccreate_user(decrypted_body=Depends(get_decrypted_request_body)) -> dict[str, Any]Create a user.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
dict[str, typing.Any]funcupdate_user(username, decrypted_body=Depends(get_decrypted_request_body)) -> dict[str, Any]Replace a user's settings.
paramusernamestrparamdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
dict[str, typing.Any]funcdelete_user(username) -> ResponseDelete a user and their storage.
paramusernamestrReturns
fastapi.Responsefunc_require_storage_user(username) -> NoneEnsure a user exists and has persistent storage enabled.
paramusernamestrReturns
Nonefunc_require_admin_user(username) -> NoneEnsure username is an administrator.
paramusernamestrReturns
Nonefunclist_user_home_dirs(username) -> dict[str, list[str]]List a user's home directories.
paramusernamestrReturns
dict[str, list[str]]funccreate_user_home_dir(username, decrypted_body=Depends(get_decrypted_request_body)) -> dict[str, str]Create a home directory for a user.
paramusernamestrparamdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
dict[str, str]funcdelete_user_home_dir(username, home_name) -> ResponseDelete a user's home directory.
paramusernamestrparamhome_namestrReturns
fastapi.Responsefunclist_admin_home_dirs(username) -> dict[str, list[str]]List an administrator's home directories.
paramusernamestrReturns
dict[str, list[str]]funccreate_admin_home_dir(username, decrypted_body=Depends(get_decrypted_request_body)) -> dict[str, str]Create a home directory for an administrator.
paramusernamestrparamdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
dict[str, str]funcdelete_admin_home_dir(username, home_name) -> ResponseDelete an administrator's home directory.
paramusernamestrparamhome_namestrReturns
fastapi.Responsefunccreate_group(decrypted_body=Depends(get_decrypted_request_body)) -> dict[str, Any]Create a group.
paramdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
dict[str, typing.Any]funcupdate_group(group_name, decrypted_body=Depends(get_decrypted_request_body)) -> dict[str, Any]Replace a group's settings.
paramgroup_namestrparamdecrypted_bodydict[str, Any]= Depends(get_decrypted_request_body)Returns
dict[str, typing.Any]funcdelete_group(group_name) -> ResponseDelete a group.
paramgroup_namestrReturns
fastapi.Response