diff --git a/.env.dist b/.env.dist index 0910c22..32463fa 100644 --- a/.env.dist +++ b/.env.dist @@ -1,6 +1,7 @@ # Common FLASK_SECRET="" DISCORD_BOT_TOKEN="" +ORIGIN="https://example.com" # Database DB_HOST="" diff --git a/truthseeker/__init__.py b/truthseeker/__init__.py index dca9bcb..3994896 100644 --- a/truthseeker/__init__.py +++ b/truthseeker/__init__.py @@ -23,7 +23,10 @@ class TruthSeekerApp(flask.Flask): self.config["SECRET_KEY"] = os.getenv("FLASK_SECRET") - self.socketio_app = SocketIO(self,cors_allowed_origins=["https://truthinquiry.simailadjalim.fr","http://127.0.0.1:5000"]) + self.socketio_app = SocketIO( + self, + cors_allowed_origins=(os.getenv("ORIGIN"), "http://127.0.0.1:5000", "http://localhost:5000") + ) self.discord_bot = discord_bot.DiscordBot() token = os.getenv("DISCORD_BOT_TOKEN")