2021-09-12 17:13:43 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from fastapi.security.api_key import APIKey
|
|
|
|
|
|
|
|
import subprocess
|
2021-09-12 17:26:09 +00:00
|
|
|
from .security import get_system_key
|
2021-09-12 17:13:43 +00:00
|
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
|
|
|
|
|
|
@router.post("/system/update")
|
|
|
|
def update(access_token: APIKey = Depends(get_system_key)):
|
|
|
|
output = subprocess.check_output(['git', 'pull'], encoding='utf-8')
|
2021-12-01 07:00:49 +00:00
|
|
|
sys.exit(4)
|