Repair docs (html, md). Update docstrings

This commit is contained in:
parent e264750187
commit 6a4ad48577
125 changed files with 3706 additions and 4913 deletions

View file

@ -15,12 +15,17 @@ from babel.support import Translations
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
CONFIG_PATH = os.getenv("GONETS_CONFIG_PATH", "/etc/gonets/config.ini")
config = configparser.ConfigParser()
config_path = "/etc/gonets/config.ini"
if not os.path.exists(config_path):
raise RuntimeError(f"Configuration file {config_path} not found")
config.read(config_path)
SECRET_KEY = config["JWT"]["secret_key"]
read_files = config.read(CONFIG_PATH)
if "JWT" in config:
SECRET_KEY = config["JWT"]["secret_key"]
elif os.getenv("SPHINX_BUILD"):
logger.warning("JWT secret not found; using dummy value for documentation build")
SECRET_KEY = "sphinx-placeholder-secret"
else:
raise RuntimeError(f"Configuration file {CONFIG_PATH} not found or missing [JWT] section")
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 30
@ -145,4 +150,4 @@ class AuthService:
except Exception as e:
logger.error(
f"Error logging out: {type(e).__name__} - {str(e)}")
raise HTTPException(status_code=500, detail=self.translations.gettext("Ошибка при выходе из системы"))
raise HTTPException(status_code=500, detail=self.translations.gettext("Ошибка при выходе из системы"))