Skip to content

Commit

Permalink
Improve Dockerized Test Deployment documentation (#1179)
Browse files Browse the repository at this point in the history
* Improve Dockerized Test Deployment documentation

* Add curly brackets to align with other variables
  • Loading branch information
roger2hk committed Oct 20, 2023
1 parent fb73b3f commit 7f372ca
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions trillian/examples/deployment/docker/ctfe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ serving production logs!
- github.com/google/certificate-transparency-go

The instructions below assume you've checked out the repositories within
`~/git/`, but if you have them in another location then just use a different
`/workspaces/`, but if you have them in another location then just use a different
path when you run the command.

```bash
# Terminal 1
export GIT_HOME=/workspaces
```

```bash
# Terminal 2
export GIT_HOME=/workspaces
```

## Deploying

We will use 2 terminal sessions to the machine you will use for hosting the
Expand All @@ -27,16 +37,16 @@ First bring up the trillian instance and the database:

```bash
# Terminal 1
cd ~/git/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/
cd ${GIT_HOME}/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/
docker compose up
```

This brings up everything except the CTFE. Now to provision the logs.

```bash
# Terminal 2
cd ~/git/trillian/
docker exec -i ctfe-db mysql -pzaphod -Dtest < ./storage/mysql/schema/storage.sql
cd ${GIT_HOME}/trillian/
docker exec -i ctfe-db mariadb -pzaphod -Dtest < ./storage/mysql/schema/storage.sql
```

The CTFE requires some configuration files. First prepare a directory containing
Expand All @@ -49,8 +59,8 @@ more than a few hours then pick a less temporary location on your filesystem.
CTFE_CONF_DIR=/tmp/ctfedocker
mkdir ${CTFE_CONF_DIR}
TREE_ID=$(go run github.com/google/trillian/cmd/createtree@master --admin_server=localhost:8090)
sed "s/@TREE_ID@/$TREE_ID/" ~/git/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/ct_server.cfg > ${CTFE_CONF_DIR}/ct_server.cfg
cp ./trillian/testdata/fake-ca.cert ${CTFE_CONF_DIR}
sed "s/@TREE_ID@/${TREE_ID}/" ${GIT_HOME}/certificate-transparency-go/trillian/examples/deployment/docker/ctfe/ct_server.cfg > ${CTFE_CONF_DIR}/ct_server.cfg
cp ${GIT_HOME}/certificate-transparency-go/trillian/testdata/fake-ca.cert ${CTFE_CONF_DIR}
docker volume create --driver local --opt type=none --opt device=${CTFE_CONF_DIR} --opt o=bind ctfe_config
```

Expand All @@ -67,7 +77,6 @@ then the following command should return tree head for tree size 0.

```bash
# Terminal 2
cd ~/git/certificate-transparency-go
cd ${GIT_HOME}/certificate-transparency-go
go run ./client/ctclient get-sth --log_uri http://localhost:8080/testlog
```

0 comments on commit 7f372ca

Please sign in to comment.