1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/FastAPI_ynh.git synced 2024-09-03 18:36:00 +02:00

fix linter

This commit is contained in:
Éric Gaspar 2023-12-15 20:36:45 +01:00
parent 7b65a58c69
commit 85d5c941da
2 changed files with 14 additions and 25 deletions

View file

@ -7,31 +7,25 @@ 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;
}
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;
if ($request_method = (POST|GET)$) {
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

View file

@ -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"
@ -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"