Skip to content

Setup Instructions

Dilan Gilluly edited this page Oct 29, 2024 · 4 revisions

The following are the setup instructions for the Ticket Auction Manager platform.

Setting up the server

First you need to setup the server. The way I chose to do it is via Docker/Docker Compose. There are some options using environment variables.

docker run -v ./data.db:/tam/server/data.db dbob16/tam-server

Should host a very simple version of it with SQLite, which would only be recommended for one-at-a-time entry.

For a production ready solution for your event, you can start with the steps below:

Create folders

First is you need to create folders. I'd suggest not creating them in a home directory which is encrypted, as Docker will forget the host side of the volume when the host reboots.

I've had the best luck when creating a folder on root, or in a directory like /opt or /var, depending on if you're running on a regular or immutable distribution. For the 2024 Theme Basket Auction I ran Debian Bookworm with the latest Docker Engine installed from here, with no issues.

I'll just suggest the root level folder that I've used before:

# mkdir -p /dc-stacks/eventname/certs
# cd /dc-stacks/eventname

That should be enough to continue. The rest of this will assume you remain cd'd in the /dc-stacks/eventname folder

Download needed files

Download docker-compose.yml:

# wget -O docker-compose.yml https://github.com/dbob16/tam-api/raw/refs/heads/main/docker-compose/docker-compose.yml

Download .env:

# wget -O .env https://github.com/dbob16/tam-api/raw/refs/heads/main/docker-compose/.env

Download nginx.conf:

# wget -O nginx.conf https://github.com/dbob16/tam-api/raw/refs/heads/main/docker-compose/nginx.conf

Download and run certs script:

# wget -O certs/gen_certs.sh https://github.com/dbob16/tam-api/raw/refs/heads/main/docker-compose/certs/gen_certs.sh
# cd certs
# chmod +x gen_certs.sh
# ./gen_certs.sh

Answer the Country, State, and Organization name at the very least. This maybe important later to add exceptions to your web browser.

Change Directory back to eventname: # cd ../

Uncomment lines

To enable TLS security, you can uncomment the lines below the following statement in docker-compose.yml, by removing the # symbol and one space for each line.

# Enable ssl by uncommenting these following lines and putting nginx.crt (server certificate) and nginx.key (server key) in certs

So uncomment lines 44-65 to enable TLS.

To enable autoheal (automatic restarting if a service stops responding), you uncomment the lines below the following statement to enable that feature, by removing the # symbol and one space from each of the lines.

# Enable restarting of unhealthy services by uncommenting the following lines:

Uncomment lines 68-75 to enable autoheal.

Changing DB password and API_PW:

You can change the DB password and implement API Password security by editing the following in .env:

# If you change anything, change the value after the = sign on the line below
# Just sticking with characters in either of the ranges helps guarantee that
# there won't be any issues with it:
# a-z, A-Z, 0-9

DB_PASSWORD=password

# The following enables secure mode if you put a value after the equals (which
# will be your password)

API_PW=

As the comments in the file says, changing the value after DB_PASSWORD= will change the database password. And adding a value after API_PW= will require the use of API keys for production use.

Launch the Server

To launch the server use the following two commands:

# docker compose pull
# docker compose up -d

The first command downloads the uncommented service images named in docker-compose.yml and the second one will launch them in the background. If you have to shut down the service completely, while in the /dc-stacks/eventname directory:

# docker compose down

Ready to use

Now you can click the Settings button from a TAM client (downloadable on the releases page) and specify either of the following in the fields.

Base URL:

For plain-text implementation:

http://IP_OR_DOMAIN_NAME:8000/

For TLS implementation:

https://IP_OR_DOMAIN_NAME:8443/

API_PW

If you specified a password by adding to the API_PW= line in .env specify the same password in this box.

Computer Name

Specify the name of your computer for later reference if needed.

image

Clone this wiki locally