Created and maintained by: TheReddKing (TechX)
python -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
yarn
cp .env.example .env
cd client && yarn
Then edit your .env file. Once your database url is correct (you can use createdb template if you have postgres)
python manage.py db init
python manage.py db migrate
python manage.py db upgrade
yarn run dev
or (if you want to debug server side scripts)
yarn start
yarn run dev-server
Look at the HOWTHISWASMADE.md file for more information
You first need to actually create a heroku application. You can also use the app.json to deploy (you can read about it somewhere else)
Then you need to copy over the environmental variables from your local computer
sed 's/#[^("|'')]*$//;s/^#.*$//' .env | \
xargs heroku config:set
Afterwards, a simple heroku push will configure everything
git push heroku master
Instructions to be loosely followed, use your own judgement. Only tested once on Fedora 30 servers, and I may have forgotten to write down a command or two.
- Enable mail scripts.
- Run from a computer with AFS, once
cd'd into the locker:mkdir -p Scripts/dormspam fs sa daemon.scripts rlidwk Scripts/dormspam cd Scripts/dormspam git clone <backend.git> backend cp backend/mail_scripts/* ../../mail_scripts/ # Will overwrite procmailrc!
- Run from a Scripts server:
cd ~/Scripts/dormspam/backend python3 -m venv --system-site-packages env # --system-site-packages for mysqlclient, which currently won't install in a venv. . env/bin/activate pip install --upgrade pip wheel pip install -r requirements.txt deactivate
- Make the database, and create
.envwith the database info. - From a Scripts server:
cd ~/Scripts/dormspam/backend . env/bin/activate python manage.py db init python manage.py db migrate python manage.py db upgrade deactivate
- Build the frontend on your own computer.
- Update the frontend's
.env. - Update
homepageinpackage.json. npm run build
- Update the frontend's
- Copy over the
buildfolder to~/Scripts/dormspam/backend/server/buildon AFS. - In the
web_scriptsdirectory you want, make.htaccess:And makeAuthType SSLCert Require valid-user ErrorDocument 401 /__scripts/needcerts RewriteEngine On RewriteRule ^$ index.fcgi/ [QSA,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]
index.fcgi:#!/afs/athena.mit.edu/<path/to/locker>/Scripts/dormspam/backend/env/bin/python import sys, os backend = os.environ['HOME'] + '/Scripts/dormspam/backend' sys.path.insert(0, backend) os.chdir(backend) from flup.server.fcgi import WSGIServer from server.app import app if __name__ == '__main__': WSGIServer(app).run()