To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit e63d66ea authored by Liam Hayes's avatar Liam Hayes
Browse files

small changes so it works on ec2

parent dfe69c52
# How to install onto remote machine
\ No newline at end of file
# How to install onto remote machine
## AWS EC2 setup
On AWS EC2:
- Launch t2.small Ubuntu-18.04 instance.
On local machine:
- Edit /etc/hosts to give the IP the name "windatlas"
- Edit ~/.ssh/config to give default username "ubuntu" and identity file
- SSH: "ssh windatlas"
On remote machine:
- Install pyenv, poetry and postgres.
- git clone the repo
- cd windatlas
- poetry install
- vim ~/.bashrc, add 'export DJANGO_LOCATION="ec2"' to the end
## Database setup
On remote machine:
- sudo -u postgres psql
- CREATE DATABASE windatlas_db;
- CREATE USER windatlas_user WITH PASSWORD 'windatlas_password';
- ALTER ROLE windatlas_user SET client_encoding TO 'utf8';
- ALTER ROLE windatlas_user SET default_transaction_isolation TO 'read committed';
- ALTER ROLE windatlas_user SET timezone TO 'UTC';
- GRANT ALL PRIVILEGES ON DATABASE windatlas_db TO windatlas_user;
- \q
......@@ -23,12 +23,14 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'f^+ew0$9kq*i+57+oyy#v587et5*&a+3k+i9e(he$#$l(!s7x!'
# used when settings need to change depending on location (home or EC2 instance)
LOCATION = os.environ['DJANGO_LOCATION']
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = (LOCATION == 'home')
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
......@@ -78,13 +80,24 @@ WSGI_APPLICATION = 'windatlas.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
if LOCATION == 'home':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
elif LOCATION == 'ec2':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'windatlas_db',
'USER': 'windatlas_user',
'PASSWORD': 'windatlas_password',
'HOST': 'localhost',
'PORT': '',
}
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment