Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Set a secure secret key for the Flask server before running in production:
export FLASK_SECRET_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
```

Do **NOT** commit your secret key to version control. If `FLASK_SECRET_KEY` is not set, a temporary random key will be generated automatically (suitable for local development only).
Do **NOT** commit your secret key to version control. If `FLASK_SECRET_KEY` is not set, `startserver` / `startserver.bat` generate a temporary random key for that run (suitable for local development only); when running `main.py` directly, set `FLASK_ENV=development` instead.

For a detailed and more scientific documentation, please read our extensive [open-access research paper on CONTROL-CORE](https://doi.org/10.1109/ACCESS.2022.3161471). This paper has a complete discussion on the CONTROL-CORE architecture and deployment, together with the commands to execute the studies in different programming languages and programming environments (Ubuntu, Windows, MacOS, Docker, and distributed execution).

Expand Down
4 changes: 3 additions & 1 deletion startserver
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
cd fri/server
# main.py refuses to start without a secret key; use a throwaway one for local runs
export FLASK_SECRET_KEY="${FLASK_SECRET_KEY:-$(head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \n')}"
if ! command -v python3 >/dev/null 2>&1; then
python main.py
else
Expand All @@ -8,7 +10,7 @@ fi

if [ $? -ne 0 ]; then
echo ""
echo "Error: Make sure modules are installed from fri/requirements.txt"
echo "Error: the server exited with an error (see above). If a module is missing:"
echo "Run: pip install -r fri/requirements.txt"
echo ""
fi
4 changes: 3 additions & 1 deletion startserver.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
cd fri\server
rem main.py refuses to start without a secret key; use a throwaway one for local runs
if not defined FLASK_SECRET_KEY for /f %%k in ('python -c "import secrets; print(secrets.token_hex(32))"') do @set "FLASK_SECRET_KEY=%%k"
python main.py
if errorlevel 1 (
echo.
echo Error: Make sure modules are installed from fri/requirements.txt
echo Error: the server exited with an error ^(see above^). If a module is missing:
echo Run: pip install -r fri/requirements.txt
echo.
)
Loading