Skip to content

Commit

Permalink
Merge pull request #4342 from magfest/config_refactor
Browse files Browse the repository at this point in the history
Load config from environment variables
  • Loading branch information
bitbyt3r authored Apr 17, 2024
2 parents 50b2d32 + 74a61ec commit 1c5d360
Show file tree
Hide file tree
Showing 26 changed files with 375 additions and 451 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ uber/static/fonts/free3of9.pkl
*.DS_Store
.vscode/*
.history
.lh*
.lh*
config*.ini
sideboard.ini
30 changes: 1 addition & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ ADD requirements*.txt plugins/uber/
ADD setup.py plugins/uber/
ADD uber/_version.py plugins/uber/uber/

RUN /app/env/bin/paver install_deps
RUN --mount=type=cache,target=/root/.cache /app/env/bin/paver install_deps

ADD uber-development.ini.template ./uber-development.ini.template
ADD sideboard-development.ini.template ./sideboard-development.ini.template
ADD uber-wrapper.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/uber-wrapper.sh
ADD rebuild-config.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/rebuild-config.sh

RUN <<EOF cat >> PLUGINS.json
$PLUGINS
Expand All @@ -29,30 +25,6 @@ RUN jq -r '.[] | "git clone --depth 1 --branch \(.branch|@sh) \(.repo|@sh) \(.pa

ADD . plugins/uber/

# These are just semi-reasonable defaults. Use either -e or --env-file to set what you need
# I.e.:
# docker run -it -e HOST=192.168.0.10 -e PORT=80 ghcr.io/magfest/ubersystem:main
# or
# echo "HOST=192.168.0.10" > uberenv
# docker run -it --env-file uberenv ghcr.io/magfest/ubersystem:main
ENV HOST=0.0.0.0
ENV PORT=8282
ENV HOSTNAME=localhost
ENV DEFAULT_URL=
ENV DEBUG=false
ENV SESSION_HOST=redis
ENV SESSION_PORT=6379
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
ENV SESSION_PREFIX=uber
ENV BROKER_PROTOCOL=amqp
ENV BROKER_HOST=rabbitmq
ENV BROKER_PORT=5672
ENV BROKER_USER=celery
ENV BROKER_PASS=celery
ENV BROKER_VHOST=uber
ENV BROKER_PREFIX=uber

FROM build as test
RUN /app/env/bin/pip install mock pytest
CMD /app/env/bin/python3 -m pytest plugins/uber
Expand Down
59 changes: 47 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,66 @@
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) [![Build Status](https://travis-ci.org/magfest/ubersystem.svg)](https://travis-ci.org/magfest/ubersystem) [![Coverage Status](https://coveralls.io/repos/github/magfest/ubersystem/badge.svg?branch=master)](https://coveralls.io/github/magfest/ubersystem?branch=master)

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

# The Ubersystem Project

The Ubersystem Project is a web app written in Python and designed for high
customization to suit any event's needs. It's aimed largely at fandom events
and can track things like registration, events, staffers, groups, dealers,
jobs, game checkouts, etc.

This app was originally developed by [MAGFest](http://magfest.org) as their
This app was originally developed by [MAGFest](https://magfest.org) as their
internal registration system, named Ubersystem, and is now open source and
available for anyone to use. Eternal thanks to
[Eli Courtwright](https://github.com/EliAndrewC) for tirelessly developing
Ubersystem for over ten years.

# Background
Ubersystem is a single-tenant, single-event system. You must deploy an instance of Ubersystem for each event that you host.

Ubersystem is a plugin for [sideboard](https://github.com/magfest/sideboard), and uses the sideboard plugin mechanism to
support customization. Most events end up creating a plugin with their theming, custom business logic, and other bespoke
needs. See [magprime](https://github.com/magfest/magprime) for a fully-fledged event plugin with many customizations.

Ubersystem has many names! You may hear reference to RAMS (Registration And Management System), Reggie, Uber, and Ubersystem.
These names are all used to refer both to the code in this repository as well as individual events' instantiations of
Ubersystem with their own modifications.

# Installation
## Development Instances (Docker Compose)
Most developers choose to use [docker compose](https://docs.docker.com/compose/) to deploy their local instances.

The [docker-compose.yml](docker-compose.yml) file in the root of this repo will provision a barebones Ubersystem server
with a cherrypy web worker, celery task runner and scheduler, rabbitmq message broker, and postgresql database.

Additionally, it will mount the repository directory into the containers at `/app/plugins/uber` so that code changes will
immediately be available inside the containers.

To install Ubersystem using docker compose do the following:

1. Install [Docker Desktop](https://docs.docker.com/desktop/), or if on Linux [Docker Engine](https://docs.docker.com/engine/install/)
2. Clone this repository `git clone https://github.com/magfest/ubersystem.git`
3. Enter the repository directory `cd ubersystem`
4. Start the server `docker compose up`

At this point you should see the containers starting up. After everything has launched you can connect to uber by going to:
[http://localhost/](http://localhost/).

On first startup you can create an admin user by navigating to [http://localhost/accounts/insert_test_admin](http://localhost/accounts/insert_test_admin).
After doing this you can log in using `[email protected]` as a username and `magfest` as a password.

Now that you have a working instance you can look at the [configuration guide](configuration.md) to start customizing your instance or
check out the [sample event plugin](https://github.com/magfest/sample-event) to dive deeper into making Ubersystem your own.

# Installation / Development
## Installation
To install via vagrant, follow the instructions at https://github.com/magfest/reggie-formula.
| :exclamation: If you didn't get a working instance check out the [troubleshooting guide](docs/troubleshooting.md). |
|---------------------------------------------------------------------------------------------------------------|

To install via Docker, follow the instructions at https://github.com/RAMSProject/quickstart.
## Production Instances
There are many ways to successfully deploy an Ubersystem instance. Currently, MAGFest is using [Amazon ECS](https://aws.amazon.com/ecs/)
deployed using [this Terraform code](https://github.com/magfest/terraform-aws-magfest). Other groups use Docker Compose for their production
instances.

To install ubersystem the Hard Way™️ take a look at
[INSTALL.manually.md](/INSTALL.manually.md).
For large deployments we provide a helm chart for deploying Ubersystem on [Kubernetes](https://kubernetes.io/).

## Setup
After installing Ubersystem, please refer to the [Stripe instructions](/STRIPE.md) to set up immediate payment processing.
After installing Ubersystem, please refer to the [Stripe instructions](docs/stripe.md) to set up immediate payment processing.

## Reference
Here are [some quick reference notes](DBUTILS.md) on common PostgreSQL tasks.
Here are [some quick reference notes](docs/dbutils.md) on common PostgreSQL tasks.
188 changes: 0 additions & 188 deletions development-defaults.ini

This file was deleted.

Loading

0 comments on commit 1c5d360

Please sign in to comment.