diff --git a/README.md b/README.md index b8e67dc..121f7c1 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in This Application install a FastAPI application "Hello Word" ready to be customized by your own code -**Shipped version:** 1.0~ynh1 +**Shipped version:** 1.0~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 5ca7936..676ec37 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Cette application installe une application FastAPI "Hello world" prête à être personnalisée par votre propre code. -**Version incluse :** 1.0~ynh1 +**Version incluse :** 1.0~ynh2 ## Captures d’écran diff --git a/conf/__init__.py b/conf/__init__.py index 4b9b58c..5703e85 100644 --- a/conf/__init__.py +++ b/conf/__init__.py @@ -5,7 +5,8 @@ from fastapi import FastAPI UVICORN_ROOT_PATH = os.environ.get('UVICORN_ROOT_PATH') -app = FastAPI(root_path=UVICORN_ROOT_PATH) +#app = FastAPI(root_path=UVICORN_ROOT_PATH) +app = FastAPI() @app.get("/") def read_root(): diff --git a/conf/nginx.conf b/conf/nginx.conf index 3505ee9..57e2c51 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,31 +7,32 @@ location __PATH__/ { # Wide-open CORS config for nginx # From : https://enable-cors.org/server_nginx.html if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + more_set_headers "Access-Control-Allow-Origin: *"; + more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS"; # # Custom headers and headers various browsers *should* be OK with but aren't # - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; + more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"; # # Tell client that this pre-flight info is valid for 20 days # - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain; charset=utf-8'; - add_header 'Content-Length' 0; + more_set_headers "Access-Control-Max-Age: 1728000"; + more_set_headers "Content-Type: text/plain; charset=utf-8"; + more_set_headers "Content-Length: 0"; return 204; } if ($request_method = 'POST') { - add_header 'Access-Control-Allow-Origin' '*' always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; - add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; + more_set_headers "Access-Control-Allow-Origin: * always"; + more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS always"; + more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range always"; + more_set_headers "Access-Control-Expose-Headers: Content-Length,Content-Range always"; } + if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*' always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; - add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; + more_set_headers "Access-Control-Allow-Origin: * always"; + more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS always"; + more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range always"; + more_set_headers "Access-Control-Expose-Headers: Content-Length,Content-Range always"; } # this is needed if you have file import via upload enabled diff --git a/manifest.toml b/manifest.toml index d4ba193..e6068d4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "my_FastAPI_app" description.en = "Custom Web app to run a FastAPI program written in Python" description.fr = "Une application web personnalisée pour faire tourner une application FastAPI écrite en Python" -version = "1.0~ynh1" +version = "1.0~ynh2" maintainers = ["leonarf"] @@ -19,8 +19,11 @@ code = "https://github.com/leonarf/FastAPI_ynh" yunohost = ">= 11.2.5" architectures = "all" multi_instance = true + ldap = "not_relevant" + sso = "not_relevant" + disk = "50M" ram.build = "350M" ram.runtime = "50M" @@ -39,7 +42,7 @@ ram.runtime = "50M" [install.password] help.en = "Password that you will need to upload your code on YunoHost" - help.fr = "Le mot de passe que vous utiliserez pour téléverser votre code sur Yunohost" + help.fr = "Le mot de passe que vous utiliserez pour téléverser votre code sur YunoHost" type = "password" [resources] @@ -47,24 +50,16 @@ ram.runtime = "50M" allow_sftp = true allow_ssh = true home = "/home/yunohost.app/__APP__" - # This will provision/deprovision a unix system user [resources.install_dir] [resources.data_dir] - # This will create/remove the data dir as /home/yunohost.app/$app - # and store the corresponding setting $data_dir dir = "/home/yunohost.app/__APP__" [resources.permissions] - # This will configure SSOwat permission for $domain/$path/ - # The initial allowed group of user is configured via the init_main_permission question (public=visitors, private=all_users) main.url = "/" [resources.ports] - # This will pick a random port for reverse-proxying and store it as the $port setting [resources.apt] - # This will automatically install/uninstall the following apt packages - # and implicitly define the $phpversion setting as 8.0 (if phpX.Y-foobar dependencies are listed) packages = "python3-dev, python3-pip, python3-venv" diff --git a/scripts/change_url b/scripts/change_url index 0512850..65a653e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,7 +29,6 @@ ynh_script_progression --message="Updating systemd service..." --weight=1 ynh_add_systemd_config - #================================================= # GENERIC FINALISATION #=================================================