From fad34ea66f2773bb7814489439820a287c8d6ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Y=C3=BBki=20Vachot?= Date: Mon, 24 Jan 2022 23:08:21 +0100 Subject: [PATCH] Update: cors prod --- backend/application/__init__.py | 2 +- backend/env.sh | 6 ------ backend/init-db1.sql | 13 ------------- backend/init-db2.sql | 14 -------------- 4 files changed, 1 insertion(+), 34 deletions(-) delete mode 100755 backend/env.sh delete mode 100755 backend/init-db1.sql delete mode 100644 backend/init-db2.sql diff --git a/backend/application/__init__.py b/backend/application/__init__.py index b68cd09..2c3ac8c 100644 --- a/backend/application/__init__.py +++ b/backend/application/__init__.py @@ -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") diff --git a/backend/env.sh b/backend/env.sh deleted file mode 100755 index da2fa7f..0000000 --- a/backend/env.sh +++ /dev/null @@ -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 diff --git a/backend/init-db1.sql b/backend/init-db1.sql deleted file mode 100755 index bbec183..0000000 --- a/backend/init-db1.sql +++ /dev/null @@ -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); \ No newline at end of file diff --git a/backend/init-db2.sql b/backend/init-db2.sql deleted file mode 100644 index 02ebdc9..0000000 --- a/backend/init-db2.sql +++ /dev/null @@ -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 -); \ No newline at end of file