The premiere event and unit management site for Civil Air Patrol
Current units running the Event Manager suite:
- MD001 - Maryland Wing
- MD003 - Frederick Composite Squadron
- MD007 - Calvert Cadet Squadron
- MD008 - Harford Composite Squadron
- MD013 - Towson Composite Squadron
- MD023 - Arundel Composite Squadron
- MD028 - Col. Mary S. Feik Composite Squadron
- MD039 - Carroll Composite Squadron
- MD041 - Group 1
- MD042 - Group 2
- MD043 - Group 3
- MD079 - Easton Composite Squadron
- MD071 - Bethesda - Chevy Chase Composite Squadron
- MD089 - St. Mary's Composite Squadron
- MD091 - Mt. Airy Composite Squadron
Table Of Contents
- Requirements for building and running
- Server configuration
- Using Command Line Utilities
- Building and running the server
- Alternatively...
- Developing EvMPlus.org
In order to build and run the code for production, you will need Docker and Docker Compose installed. It is highly recommended that Docker BuildKit is used when setting up images. Code should theoretically work on Windows, but is solely tested on Linux.
This program depends on the following to fully function:
- MySQL server
- AWS SMTP credentials
- AWS DNS credentials
- Google keys and calendar setup
- A Discord bot token
- CAPWATCH credentials
- reCAPTCHA keys
- Client setup
Each of these sections will require creating files in the keys folder which have just the access token required. After the server is appropriately configured, you should have the following structure in the keys
folder:
- certbot: Contains certbot configuration, and can be ignored as it is automatically handled
- google-keys:
- {}.json: A credential file for the service account that is used to handle Google calendar credentials
- aws_ssl_keys: AWS DNS credentials used to acquire Let's Encrypt SSL keys
- aws_access_key_id: AWS SES credentials
- aws_secret_access_key: AWS SES credentials
- capwatch_capid: CAPID of member downloading CAPWATCH files
- capwatch_orgid: ORGID of the organization to download CAPWATCH files for
- capwatch_password: The password of the member who is downloading CAPWATCH information
- db_password: The password for the MySQL database
- db_user: The username for the MySQL database. Currently, can only be
em
- discord_client_token: The token for managing the Discord bot
- recaptcha_secret: The secret reCAPTCHA key for the server
At the end of all of these files in ./keys, ensure that there are no newline characters at the end (with the exception of aws_ssl_keys)
Additionally, the following folders are required in the /srv
folder:
- /srv/mysql
- /srv/uploads
- /srv/backups
Create the files ./keys/db_user
and ./keys/db_password
. Place the text em
in the db_user
file. Create a new database password and place that text in the db_password
file
When creating the MySQL database for the first time using docker-compose [-f docker-compose.dev.yml] up mysql
, docker-compose [-f docker-compose.dev.yml] up main
, or docker-compose up proxy
, check the logs for "Generated root password" and store this root password in keys/mysql_root_password
. Docker compose will complain when initially starting up; just touch the file and make sure it exists and is empty, and replace the file with the generated root password.
- Acquire AWS credentials
- Manage the IAM user created to allow access to SMTP
- Store the AWS credentials in
./keys/aws_access_key_id
and./keys/aws_secret_access_key
Only required for setting up SSL keys for HTTPS traffic as opposed to HTTP traffic
- Acquire AWS credentials
- Manage IAM user created to allow access to DNS
- Store the AWS crednetials in
./keys/aws_ssl_keys
according to the documentation
- Service account setup
- Go to the Google Cloud console
- Create a new project
- In the navigation menu, go to 'APIs & Services' -> 'Library'
- Find the Google Calendar API, and enable it
- In the navigation menu, go to 'IAM & Admin' -> 'Service accounts'
- Click 'Create service account' at the top
- Give it a name, and give it 'Project Owner' as a role
- Don't grant access to any users
- Back at the 'Service accounts' page, in the actions menu on the right, click 'Create key'
- Select JSON
- Save this to the
./keys/google-keys
directory- Be sure to name it according to the following format:
${accountID}.json
, where accountID is the ID of the account you will be creating later
- Be sure to name it according to the following format:
- Google calendar setup
- Create a Google calendar
- On the calendar, add the service account from before with the ability to 'Manage Events and Sharing'
- Copy the ID of this Google calendar, it will be needed for the account setup step later
- Create a bot and get its token.
- After creating the bot, set up permissions
- On the 'Bot' page of the application, check 'Presence Intent' and 'Server Members Intent'
- On the 'OAuth2' page of the application, select 'bot' and 'applications.commands'. For the bot permissions that show up, check 'Administrator'. Save the link that shows up
- Add the bot to a development Discord server by using the OAuth2 link generated in the previous step
- Store the bot token created in step 1 in the
./keys/discord_client_token
file
- Request CAPWATCH download permissions
- Store the ORGID in the
./keys/capwatch_orgid
file, as well as your CAP ID and eServices password in./keys/capwatch_capid
and./keys/capwatch_password
, respectively
-
Create a new site using the v2 'I'm not a Robot' reCAPTCHA option
- Be sure to add your domain
-
Store the public key in
./packages/client/.env
, under the key REACT_APP_RECAPTCHA_KEY, e.g.REACT_APP_RECAPTCHA_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
-
Store the provided secret key in
./keys/recaptcha_secret
, e.g. '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe'
The packages/client/.env
file should also have the following content:
REACT_APP_RECAPTCHA_KEY=your public key here
REACT_APP_VERSION=$npm_package_version
REACT_APP_HOST_NAME=your hostname here
your public key here
and your hostname here
should be replaced with their respective values
First, run docker-compose up -d util-cli
, and keep note of the name of the container created. Then, run docker attach {container-name}
you will be provided a shell from which you can run different utilities to perform administrative actions. Administrative actions include adding SSL keys for signin tokens, creating accounts, downloading CAPWATCH files, importing CAPWATCH files, and sending global notifications.
By running docker-compose up -d mysqlsh
, keeping note of the name of the container created, and then running docker attach {container-name}
, you will be dropped into a mysqlsh session
To import a new CAPWATCH file, run docker-compose up download_capwatch_update
By running docker-compose up main
, it will build and start the MySQL database as well as the server itself. To get SSL for HTTPS as well, modify and then run scripts/init-nginx-ssl.sh
with your email and then use docker-compose up main proxy
instead.
From inside the util-cli container started here, you can run the createAccount.js
file to start the process of creating an account that can be used to process data
To access the site, you have to use a domain name that starts with the account ID you used earlier. For instance, to access the md089
account, you would go to md089.evmplus.org
.
If you are a unit commander or unit IT officer looking to implement this for your squadron, you can instead send an email to [email protected]
to request an official EvMPlus.org website.
This will take advantage of the hosting and support already available, and will allow for cross unit communication with units already established under the EvMPlus.org domain.
CAPWATCH data for all Maryland Wing members and units is already being handled.
There is currently a feature request being worked on which will allow you as a unit commander or unit IT officer to upload your own CAPWATCH data to a evmplus.org hosted unit. This feature request can be tracked here.