mirror of
https://github.com/netinvent/npbackup.git
synced 2024-11-10 17:15:28 +08:00
WIP: upgrade server, fix headers
This commit is contained in:
parent
c4896a0b95
commit
8264811389
5 changed files with 10 additions and 12 deletions
|
@ -8,7 +8,7 @@ __author__ = "Orsiris de Jong"
|
|||
__copyright__ = "Copyright (C) 2023 NetInvent"
|
||||
__license__ = "GPL-3.0-only"
|
||||
__build__ = "202303101"
|
||||
__version__ = "0.0.1"
|
||||
__version__ = "1.0.0"
|
||||
|
||||
|
||||
DEVEL=True
|
||||
|
@ -19,10 +19,6 @@ from upgrade_server import configuration
|
|||
from ofunctions.logger_utils import logger_get_logger
|
||||
|
||||
|
||||
#ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
#config_file = 'upgrade_server.conf'
|
||||
#config_dict = configuration.load_config(os.path.join(ROOT_DIR, config_file)
|
||||
|
||||
config_dict = configuration.load_config()
|
||||
try:
|
||||
listen = config_dict['http_server']['listen']
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
__intname__ = "npbackup.upgrade_server.api"
|
||||
__author__ = "Orsiris de Jong"
|
||||
__copyright__ = "Copyright (C) 2023 NetInvent"
|
||||
__license__ = "GPL-3.0-only"
|
||||
__build__ = "202303101"
|
||||
__appname__ = "npbackup.upgrader"
|
||||
__author__ = "Alan Smithee"
|
||||
__build__ = "2022112201"
|
||||
__version__ = "1.0-beta"
|
||||
|
||||
|
||||
from typing import Literal
|
||||
import logging
|
||||
|
@ -47,7 +50,7 @@ def get_current_username(credentials: HTTPBasicCredentials = Depends(security)):
|
|||
|
||||
|
||||
@app.get("/")
|
||||
async def api_root():
|
||||
async def api_root(auth = Depends(get_current_username)):
|
||||
if crud.is_enabled():
|
||||
return {
|
||||
"app": __appname__,
|
||||
|
|
|
@ -8,7 +8,7 @@ __author__ = "Orsiris de Jong"
|
|||
__copyright__ = "Copyright (C) 2023 NetInvent"
|
||||
__license__ = "GPL-3.0-only"
|
||||
__build__ = "202303101"
|
||||
__version__ = "0.0.1"
|
||||
|
||||
|
||||
import os
|
||||
from ruamel.yaml import YAML
|
||||
|
|
|
@ -8,7 +8,7 @@ __author__ = "Orsiris de Jong"
|
|||
__copyright__ = "Copyright (C) 2023 NetInvent"
|
||||
__license__ = "GPL-3.0-only"
|
||||
__build__ = "202303101"
|
||||
__version__ = "0.0.1"
|
||||
|
||||
|
||||
import os
|
||||
from typing import Optional, Union
|
||||
|
|
|
@ -8,7 +8,6 @@ __author__ = "Orsiris de Jong"
|
|||
__copyright__ = "Copyright (C) 2023 NetInvent"
|
||||
__license__ = "GPL-3.0-only"
|
||||
__build__ = "202303101"
|
||||
__version__ = "0.0.1"
|
||||
|
||||
|
||||
from enum import Enum
|
||||
|
|
Loading…
Reference in a new issue