Compare commits
3 Commits
13257ce085
...
d929d961f1
Author | SHA1 | Date |
---|---|---|
|
d929d961f1 | |
|
eee84f7d25 | |
|
ec2fd05fdf |
|
@ -9,9 +9,11 @@ import importlib
|
|||
import logging
|
||||
import uuid
|
||||
import argparse
|
||||
import yaml
|
||||
from flask import Flask, request
|
||||
from flask_executor import Executor
|
||||
from flask_restx import Api
|
||||
from flasgger import Swagger
|
||||
from werkzeug.exceptions import HTTPException
|
||||
from systemd.journal import JournalHandler
|
||||
|
||||
|
@ -71,7 +73,7 @@ api = Api(app,
|
|||
version='0.50',
|
||||
title = "OpenGnsys Git API",
|
||||
description = "API for managing disk images stored in Git",
|
||||
doc = "/swagger/")
|
||||
doc = "/apidocs/")
|
||||
|
||||
|
||||
executor = Executor(app)
|
||||
|
@ -85,6 +87,7 @@ for filename in os.listdir(blueprints_dir):
|
|||
log.info("Loading %s/%s", blueprints_dir, filename)
|
||||
|
||||
module_name = filename.replace(".py", "")
|
||||
swagger_file = os.path.join(blueprints_dir, filename.replace(".py", ".yaml"))
|
||||
|
||||
log.info("Importing %s", module_name)
|
||||
importlib.invalidate_caches()
|
||||
|
@ -93,6 +96,17 @@ for filename in os.listdir(blueprints_dir):
|
|||
|
||||
app.register_blueprint(module.blueprint)
|
||||
|
||||
if os.path.exists(swagger_file):
|
||||
log.info("Loading Swagger documentation from %s...", swagger_file)
|
||||
|
||||
with open(swagger_file, "r", encoding='utf-8') as file:
|
||||
swagger_template = yaml.safe_load(file)
|
||||
|
||||
swagger = Swagger(app, template=swagger_template)
|
||||
else:
|
||||
log.warning("Swagger not found for this module, looked in %s", swagger_file)
|
||||
|
||||
|
||||
|
||||
@app.errorhandler(HTTPException)
|
||||
def handle_exception(e):
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,7 @@ Descarga, instala y configura Forgejo, crea los repositorios por defecto, y conf
|
|||
Crear el archivo `/etc/apt/sources.list.d/opengnsys.sources` con este contenido:
|
||||
|
||||
Types: deb
|
||||
URIs: https://ognproject.evlt.uma.es/debian-opengnsys/
|
||||
URIs: https://ognproject.evlt.uma.es/debian-opengnsys/opengnsys
|
||||
Suites: noble
|
||||
Components: main
|
||||
Signed-By:
|
||||
|
|
|
@ -31,7 +31,7 @@ import datetime
|
|||
import tqdm
|
||||
|
||||
#FORGEJO_VERSION="8.0.3"
|
||||
FORGEJO_VERSION="9.0.3"
|
||||
FORGEJO_VERSION="10.0.3"
|
||||
FORGEJO_URL=f"https://codeberg.org/forgejo/forgejo/releases/download/v{FORGEJO_VERSION}/forgejo-{FORGEJO_VERSION}-linux-amd64"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue