Support privateconfig for local development

Not yet supported for production deployments, that's still cloned manually for now
This commit is contained in:
AngrySoundTech
2024-07-31 16:52:51 -04:00
parent 753bbde180
commit 6540b64d15
6 changed files with 58 additions and 4 deletions

1
.gitignore vendored
View File

@@ -35,6 +35,5 @@ run
temp
### Docker ###
containers/data

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "PrivateConfig"]
path = PrivateConfig
url = git@github.com:CivMC/PrivateConfig

1
PrivateConfig Submodule

Submodule PrivateConfig added at 5689aa2525

View File

@@ -2,6 +2,13 @@
This monorepo will eventually contain all civ projects and development
## Key Technologies
- [Gradle](https://gradle.org/) Is used as an entrypoint to build all projects in this repository.
- [Docker](https://www.docker.com/) Is used to containerize any deployed services,
and provide a somewhat consistent development environment.
- [Ansible](https://www.ansible.com/) Is used to configure the target machines and for final deployment
## Developing Locally
### Plugins
@@ -32,6 +39,17 @@ Current services and exposed ports are:
| | 15672 | HTTP, Management UI | |
| grafana | 3000 | HTTP, Grafana UI | monitoring |
### Private Config
Sensitive information is stored in a private repository, and required for Ansible deployment.
If you have access to this, you can get the submodule with `git submodule init` and `git submodule update`
To use this with the local docker-compose stack,
you can use `docker compose up -f docker-compose.yml -f docker-compose.private.yml` to merge the configurations.
Hot tip: If you use different SSH keys for your Civ GitHub account, you might use an SSH alias (`git clone git@civmc.github.com:...`).
If this is the case, you can clone the submodule by setting the`GIT_SSH_COMMAND`environment variable
to `ssh -i /path/to/your/private/key` before updating the submodule.
#### Using the console
For the minecraft servers and other interactive containers, you can attach to the console to run commands:

View File

@@ -0,0 +1,33 @@
# Private Config Extension for Docker Compose.
# Requires PrivateConfig submodule to be cloned.
services:
#################
### Minecraft ###
#################
paper:
environment:
# Any Jars need to be here, comma separated so that they are not removed during sync
REMOVE_OLD_MODS_EXCLUDE: "Vulcan-2.9.0.jar"
SYNC_SKIP_NEWER_IN_DESTINATION: "true"
# Note that config and plugins are mounted into the DATA directory, to avoid propagating to the config bind mount
volumes:
- ./PrivateConfig/paper/plugins/Vulcan-2.9.0.jar:/data/plugins/Vulcan-2.9.0.jar
- ./PrivateConfig/paper/config/Vulcan/config.yml:/data/plugins/Vulcan/config.yml
- ./PrivateConfig/paper/config/HiddenOre/config.yml:/data/plugins/HiddenOre/config.yml
- ./PrivateConfig/paper/config/KiraBukkitGateway/config.yml:/data/plugins/KirraBukkitGateway/cnfig.yml
- ./PrivateConfig/paper/config/Brewery/config.yml:/data/plugins/Brewery/config.yml
- ./PrivateConfig/paper/config/Terra/packs/CivMC:/data/plugins/Terra/packs/CivMC
- ./PrivateConfig/paper/config/Votifier/config.yml:/data/plugins/Votifier/config.yml
- ./PrivateConfig/paper/config/Votifier/rsa/public.key:/data/plugins/Votifier/rsa/public.key
- ./PrivateConfig/paper/config/Votifier/rsa/private.key:/data/plugins/Votifier/rsa/private.key
- ./PrivateConfig/paper/config/DiscordSRV/config.yml:/data/plugins/DiscordSRV/config.yml
- ./PrivateConfig/paper/config/DiscordSRV/alerts.yml:/data/plugins/DiscordSRV/alerts.yml
- ./PrivateConfig/paper/config/MythicMobs:/data/plugins/MythicMobs
- ./PrivateConfig/paper/config/EvenMoreFish/baits.yml:/data/plugins/EvenMoreFish/baits.yml
- ./PrivateConfig/paper/config/EvenMoreFish/fish.yml:/data/plugins/EvenMoreFish/fish.yml
- ./PrivateConfig/paper/config/EvenMoreFish/rarities.yml:/data/plugins/EvenMoreFish/rarities.yml
- ./PrivateConfig/paper/config/EvenMoreFish/competitions.yml:/data/plugins/EvenMoreFish/competitions.yml
- ./PrivateConfig/paper/config/RandomSpawn/worlds.yml:/data/plugins/RandomSpawn/worlds.yml

View File

@@ -103,7 +103,7 @@ services:
MYSQL_PASSWORD: mariadb
MYSQL_DATABASE: mariadb
volumes:
- ./containers/provisioning/mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./containers/provisioning/mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
- ./containers/data/mariadb:/var/lib/mysql
postgres:
@@ -121,7 +121,7 @@ services:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- ./containers/provisioning/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./containers/provisioning/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
- ./containers/data/postgres:/var/lib/postgresql/data
rabbitmq:
@@ -158,4 +158,4 @@ services:
CIV_INFLUX_ORG: CivMC
CIV_INFLUX_TOKEN: admintoken
volumes:
- ./containers/provisioning/grafana:/etc/grafana/provisioning
- ./containers/provisioning/grafana:/etc/grafana/provisioning:ro