Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SESSION_COOKIE_NAME and secret_key being random values #209

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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: 2 additions & 0 deletions bin/LAUNCH.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ else
exit 1
fi

export AIL_APP_SECRET_KEY="$(LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom | head -c 200; echo)"

export PATH=$AIL_VENV/bin:$PATH
export PATH=$AIL_HOME:$PATH
export PATH=$AIL_REDIS:$PATH
Expand Down
10 changes: 8 additions & 2 deletions installing_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ set -e
## bash debug mode toggle below
#set -x

sudo apt-get update
# if running as root (eg inside a base ubuntu docker container)
if [ "$EUID" -eq 0 ]; then
apt-get update
apt-get install -y sudo
else
sudo apt-get update
fi

sudo apt-get install python3-pip virtualenv python3-dev python3-tk libfreetype6-dev \
screen g++ unzip libsnappy-dev cmake -qq

sudo apt-get install automake libtool make gcc pkg-config -qq
sudo apt-get install automake libtool make gcc pkg-config git -qq

#Needed for downloading jemalloc
sudo apt-get install wget -qq
Expand Down
4 changes: 2 additions & 2 deletions var/www/Flask_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@
# ========= =========#

# ========= Cookie name ========
app.config.update(SESSION_COOKIE_NAME='ail_framework_{}'.format(uuid.uuid4().int))
app.config.update(SESSION_COOKIE_NAME='ail_session')

# ========= session ========
app.secret_key = str(random.getrandbits(256))
app.secret_key = os.getenv('AIL_APP_SECRET_KEY', 'ailAppSecretKey')
login_manager = LoginManager()
login_manager.login_view = 'root.login'
login_manager.init_app(app)
Expand Down
Loading