README
This commit is contained in:
parent
d19a8b9c59
commit
97ade1f2e3
4 changed files with 72 additions and 0 deletions
31
README.md
Normal file
31
README.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# GoatHacks Registration Management
|
||||
|
||||
This is a rewrite of the original (commit 198f56f2c47831c2f8c192fbb45a47f7b1fb4e5b)
|
||||
management system for Flask 2.1 and Postgres. The focus was on maintainability
|
||||
in the future and easy modifications for future years.
|
||||
|
||||
## Setting up a development environment
|
||||
The `Makefile` should have a bunch of useful recipes for you. Once you clone the
|
||||
repo for the first time, run `make init_env`, which will set up the virtual
|
||||
environment for development. If the dependencies ever change, you can run `make
|
||||
upgrade_env` to install the new packages.
|
||||
|
||||
To test your code, run `make daemon`, which will start a development server. It
|
||||
will automatically reload after your changes.
|
||||
|
||||
## Setting up for production
|
||||
|
||||
You can use your choice of WSGI server. Instructions are provided below for
|
||||
uWSGI. Please ensure a current (3.x) version of Python and Pip.
|
||||
|
||||
1. pip install uwsgi # or the equivalent for your distribution's package manager
|
||||
2. mkdir -p /etc/uwsgi/apps-available
|
||||
3. mkdir -p /var/log/uwsgi
|
||||
4. sudo chown -R nginx:nginx /var/log/uwsgi
|
||||
5. mkdir -p /var/app
|
||||
6. git clone https://github.com/WPI-ACM/Hack-WPI-Python /var/app/goathacks
|
||||
7. cd /var/app/goathacks && make init_env
|
||||
8. cp /var/app/goathacks/contrib/goathacks.ini /etc/uwsgi/apps-available/goathacks.ini
|
||||
9. cp /var/app/goathacks/contrib/goathacks.service /etc/systemd/system/goathacks.service
|
||||
10. cp /var/app/goathacks/goathacks/config.py.example /var/app/goathacks/goathacks/config.py
|
||||
11. $EDITOR /var/app/goathacks/goathacks/config.py
|
15
contrib/goathacks.ini
Normal file
15
contrib/goathacks.ini
Normal file
|
@ -0,0 +1,15 @@
|
|||
[uwsgi]
|
||||
base = /var/app/goathacks
|
||||
wsgi-file = %(base)/goathacks.py
|
||||
home = %(base)/.venv
|
||||
pythonpath = %(base)
|
||||
|
||||
socket = %(base)/%n.sock
|
||||
chmod-socket=666
|
||||
|
||||
callable=app
|
||||
|
||||
logto = /var/log/uwsgi/%n.log
|
||||
touch-reload = %(base/.uwsgi-touch
|
||||
|
||||
max-requests=1000
|
15
contrib/goathacks.service
Normal file
15
contrib/goathacks.service
Normal file
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=%i uWSGI app
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/uwsgi \
|
||||
--ini /etc/uwsgi/apps-available/%i.ini \
|
||||
--socket /var/run/uwsgi/%i.socket
|
||||
User=www-data
|
||||
Group=www-data
|
||||
Restart=on-failure
|
||||
KillSignal=SIGQUIT
|
||||
Type=notify
|
||||
StandardError=syslog
|
||||
NotifyAccess=all
|
11
contrib/goathacks.socket
Normal file
11
contrib/goathacks.socket
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Socket for uWSGI app %i
|
||||
|
||||
[Socket]
|
||||
ListenStream=/var/run/uwsgi/%i.socket
|
||||
SocketUser=www-data
|
||||
SocketGroup=www-data
|
||||
SocketMode=0660
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
Loading…
Add table
Reference in a new issue