feat: more tools and rename

This commit is contained in:
Strix 2023-10-20 00:48:58 +02:00
parent a5f81bcaef
commit af9268cbc0
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
8 changed files with 40 additions and 4 deletions

View file

@ -2,4 +2,9 @@
> Do **NOT** run these tools in this directory.
> Run them from the *main* directory.
Tools used for the IXVD infra
Tools used for the IXVD infra
Prefix legend:
- `server-*`, these tools will modify only the current server.
- `repo/*`, these tools will modify the repo.
- `setup/*`, setup scripts

View file

@ -0,0 +1,3 @@
#!/bin/sh
cp -r servers/skel/. servers/${1:-$(hostname)}

View file

@ -0,0 +1,15 @@
#!/bin/sh
# manage docker-compose with this macro
if ! [ -d "servers/$(hostname)" ]; then
echo "couldn't find servers/$(hostname)"
exit 1
fi
dc_args="-p $(hostname)"
for f in servers/$(hostname)/docker-compose.d/*.yml; do
dc_args="$dc_args -f $f"
done
docker-compose $dc_args $@

View file

@ -2,8 +2,10 @@
if grep -q "debian" /etc/os-release; then
echo "installing packages..."
apt update
apt install \
apt update -y
apt install -y \
cifs-utils \
restic
restic \
docker.io \
docker-compose
fi

11
tools/setup/40-docker.sh Normal file
View file

@ -0,0 +1,11 @@
#!/bin/sh
if ! docker network inspect proxy &> /dev/null; then
echo "creating proxy network..."
docker network create proxy
fi
if ! docker network inspect internal &> /dev/null; then
echo "creating internal network..."
docker network create internal
fi