Skip to content

Commit 8b84826

Browse files
committed
chore: new release changes
- lock cors to defined values only
1 parent 56308b0 commit 8b84826

5 files changed

Lines changed: 22 additions & 6 deletions

File tree

Readme.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,17 @@ Feel free to reach out if you have anything else you'd like to see!
4141

4242
Vertigo has now entered its **Alpha release** stage! You can try it out by downloading the latest ZIP from the [releases section](https://github.com/anonhacker47/vertigo/releases).
4343

44-
After extracting the ZIP, run the app using the appropriate script for your operating system:
44+
After extracting the ZIP, follow these steps:
45+
46+
1. **Create a `.env` file** in the root directory of the app and set your secret key:
47+
48+
```env
49+
SECRET_KEY=your-very-secret-key
50+
```
51+
52+
This key is used for authentication tokens and other security-related features. You can also configure other settings by refering config.py or .flaskenv.
53+
54+
2. Run the app using the appropriate script for your operating system:
4555

4656
- **Linux**:
4757
Run `launch.sh`

vertigo-backend/.flaskenv

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ FLASK_APP=run.py
22
FLASK_DEBUG=1
33
REFRESH_TOKEN_IN_BODY=false
44
REFRESH_TOKEN_IN_COOKIE=true
5-
ACCESS_TOKEN_MINUTES=60
6-
PACKAGE_VERSION=0.0.2
5+
ACCESS_TOKEN_MINUTES=60

vertigo-backend/api/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def create_app(config_class=Config):
2020
static_folder = "./wwwroot/static",
2121
template_folder = "./wwwroot")
2222
app.config.from_object(config_class)
23-
23+
2424
app.config['user_path'] = os.path.abspath("./Config/User/")
2525
app.config['sql_path'] = os.path.abspath("./Config/")
2626

@@ -40,7 +40,9 @@ def create_app(config_class=Config):
4040
db.init_app(app)
4141
ma.init_app(app)
4242
if app.config['USE_CORS']: # pragma: no branch
43-
cors.init_app(app)
43+
cors.init_app(app,resources={r"/api/*": {"origins": app.config['CORS_ORIGINS']}},
44+
supports_credentials=app.config.get('CORS_SUPPORTS_CREDENTIALS', False)
45+
)
4446
mail.init_app(app)
4547
apifairy.init_app(app)
4648

vertigo-backend/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class Config:
3131
USE_CORS = as_bool(os.environ.get('USE_CORS') or 'yes')
3232
CORS_SUPPORTS_CREDENTIALS = True
3333

34+
raw_origins = os.environ.get('CORS_ORIGINS', '')
35+
CORS_ORIGINS = [origin.strip() for origin in raw_origins.split(',') if origin.strip()]
36+
37+
PACKAGE_VERSION = os.environ.get('PACKAGE_VERSION', '0.0.1')
38+
3439
# API documentation
3540
APIFAIRY_TITLE = 'Vertigo API'
3641
APIFAIRY_VERSION = '0.0.2'

vertigo-ui/.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
VITE_Base_URL=""
2-
PACKAGE_VERSION=0.0.2
2+
PACKAGE_VERSION=0.0.3

0 commit comments

Comments
 (0)