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

Load config from environment variables #4342

Merged
merged 55 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
22a9f4d
Updating python library versions
bitbyt3r Nov 5, 2022
522eb08
Starting to work on tests
bitbyt3r Nov 5, 2022
80927a4
Adding tests to CI pipeline
bitbyt3r Nov 5, 2022
8ace33a
Merge remote-tracking branch 'origin/main' into next
bitbyt3r Feb 5, 2023
d53ecfb
839/970 tests passing
bitbyt3r Feb 5, 2023
a09fd14
Merge branch 'main' into next
bitbyt3r Aug 4, 2023
7916ce8
Upgrading to latest packages, except sqlalchemy
bitbyt3r Aug 5, 2023
bf1f1c6
Fixed some tests, reverted viewonly changes
bitbyt3r Aug 5, 2023
50ce763
Skipping broken tests, fixing others
bitbyt3r Aug 5, 2023
6fb226c
Templating branch
bitbyt3r Aug 5, 2023
2ed463e
Templating branch
bitbyt3r Aug 5, 2023
45fd3ed
Restoring sideboard-development.ini.template
bitbyt3r Aug 5, 2023
33415ab
Merge branch 'main' into next
bitbyt3r Aug 5, 2023
d756d98
Merge branch 'main' into next
bitbyt3r Mar 15, 2024
6bfd458
Reverting migrations
bitbyt3r Mar 15, 2024
abb0454
Reverting tests
bitbyt3r Mar 15, 2024
e53ee31
Reverting JSONB changes
bitbyt3r Mar 15, 2024
909b71c
Labelling initial image
bitbyt3r Mar 15, 2024
52c1a83
Using sideboard:next for now
bitbyt3r Mar 15, 2024
66154bf
Monkeypatch around authorizenet
bitbyt3r Mar 15, 2024
143462e
Adding bleach
bitbyt3r Mar 15, 2024
52c8270
Adding aztec-code-generator
bitbyt3r Mar 15, 2024
a49fe16
Using main sideboard
bitbyt3r Apr 14, 2024
dba2fbe
Removing reference to pkg_resources
bitbyt3r Apr 14, 2024
c21e016
Merge branch 'main' into next
bitbyt3r Apr 14, 2024
6907588
Hacky hacks for authorizenet
bitbyt3r Apr 14, 2024
27f8332
Using forked authorizenet
bitbyt3r Apr 14, 2024
d1eb414
Bumping authorize.net
bitbyt3r Apr 14, 2024
9ce2d3a
Bumping authorizenet
bitbyt3r Apr 14, 2024
b66cad3
Bumping authorizenet
bitbyt3r Apr 14, 2024
0d0c851
Updating all deps
bitbyt3r Apr 14, 2024
a2179f9
Updating all deps
bitbyt3r Apr 14, 2024
16f7857
Bumping authorizenet
bitbyt3r Apr 14, 2024
0b33e1f
Reverting remaaining JSONB changes
bitbyt3r Apr 14, 2024
24e70cb
Disabling tests
bitbyt3r Apr 14, 2024
ddd1cf6
Fixing regex string
bitbyt3r Apr 14, 2024
f1a914c
Merge branch 'main' into next
bitbyt3r Apr 14, 2024
a22410b
Accepting new fourth return from iter_choices
bitbyt3r Apr 14, 2024
eacbd68
Fixing frozen list concatenation
bitbyt3r Apr 14, 2024
f4fe980
Fixing mappingproxy -> dict
bitbyt3r Apr 14, 2024
011bd47
Fixing params definition
bitbyt3r Apr 14, 2024
61c9432
Fixing args
bitbyt3r Apr 14, 2024
f5af3a0
Fixing args
bitbyt3r Apr 14, 2024
78eecaf
Fixing params default value
bitbyt3r Apr 14, 2024
1c6d093
Loading config from environment
bitbyt3r Apr 15, 2024
a0e5ace
Working on docs
bitbyt3r Apr 15, 2024
60c2524
Fixing periods in config vars
bitbyt3r Apr 16, 2024
3db3d50
Updated make_config.py for interactive use
bitbyt3r Apr 16, 2024
1241e9c
Adding support for generating uber config in prod
bitbyt3r Apr 16, 2024
587cc36
Fixing override priority
bitbyt3r Apr 16, 2024
edf4972
Parsing secrets from env
bitbyt3r Apr 16, 2024
9d4c858
Update docker compose file and override templates
kitsuta Apr 17, 2024
71b7a4f
Removing helm chart for now
bitbyt3r Apr 17, 2024
f177a91
Removing empty docs
bitbyt3r Apr 17, 2024
74a61ec
Removing reference to missing docs
bitbyt3r Apr 17, 2024
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
14 changes: 14 additions & 0 deletions .github/workflows/ci-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,23 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# TODO: Enable tests once we can run Postgres in CI
# - name: Build Test Docker Image
# uses: docker/build-push-action@v2
# with:
# build-args: BRANCH=${{ github.ref_name }}
# context: "."
# push: false
# tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}-test
# target: test

# - name: Execute Tests
# run: docker run ghcr.io/${{ github.repository }}:${{ github.ref_name }}-test

- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
build-args: BRANCH=${{ github.ref_name }}
context: "."
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
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
37 changes: 7 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.4.0

FROM ghcr.io/magfest/sideboard:main
FROM ghcr.io/magfest/sideboard:main as build
ARG PLUGINS="[]"
MAINTAINER RAMS Project "code@magfest.org"
LABEL version.rams-core ="0.1"
Expand All @@ -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,29 +25,10 @@ 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

FROM build as release
ENTRYPOINT ["/usr/local/bin/uber-wrapper.sh"]
CMD ["uber"]
CMD ["uber"]
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 `magfest@example.com` 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
Loading