Update: cors prod

This commit is contained in:
Yûki VACHOT 2022-01-24 23:08:21 +01:00
parent a8a9319f88
commit fad34ea66f
4 changed files with 1 additions and 34 deletions

View file

@ -10,7 +10,7 @@ def create_app(flask_env='development'):
app = Flask(__name__, instance_relative_config=False)
origin = app.config.get('ALLOW_ORIGIN')
if origin is None:
origin = ['http://127.0.0.1:4200', 'http://localhost:4200']
origin = ['http://10.1.1.10:4200', 'https://10.1.1.10:4200', 'http://127.0.0.1:4200', 'http://localhost:4200']
CORS(app, supports_credentials=True, origins=origin)
if flask_env == 'production':
app.config.from_object("config.ProductionConfig")

View file

@ -1,6 +0,0 @@
export FLASK_APP=app.py
export FLASK_ENV=development
export FLASK_DEBUG=1
export PYTHONUNBUFFERED=1
export DATABASE_URL_USERS=postgresql://flaskaled1:aled1@localhost:5433/flaskaledDb1
export DATABASE_URL_LOGS=postgresql://flaskaled2:aled2@localhost:5434/flaskaledDb2

View file

@ -1,13 +0,0 @@
-- Table: users
CREATE TABLE IF NOT EXISTS users
(
id serial PRIMARY KEY,
email character varying(320) NOT NULL,
nickname character varying(50) NOT NULL,
hash_pass bytea NOT NULL,
salt bytea NOT NULL,
is_admin boolean NOT NULL DEFAULT FALSE
);
INSERT INTO users VALUES(0,'admin@admin.admin','Admin',decode('e5ed79b503704ed20a1d250770db68182118de7fe0236db9bbfb0dd9684087d6', 'hex'),decode('7012f69f1ac7c23c5dca498c30fa94527b507cc9e40fab9bae284d1465a37724', 'hex'),TRUE);

View file

@ -1,14 +0,0 @@
-- Table: logs
CREATE TABLE IF NOT EXISTS logs
(
id serial PRIMARY KEY,
date timestamp NOT NULL,
id_user integer,
ip character varying(15) NOT NULL,
"table" character varying(25) NOT NULL,
action character varying(50) NOT NULL,
message character varying(512) NOT NULL,
has_succeeded boolean NOT NULL,
status_code smallint NOT NULL
);