Skip to content

Commit

Permalink
Add UUID for the Admin organisation when deploying (#183)
Browse files Browse the repository at this point in the history
* Update template.env - Add ADMIN_ORG

* Update docker-compose.yml - Add ADMIN_ORG_UUID

* Update configure_misp.sh - Add uuid to database
  • Loading branch information
stevengoossensB authored Nov 13, 2024
1 parent 5e60a88 commit 7468cd9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/files/configure_misp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ init_user() {
echo "UPDATE $MYSQL_DATABASE.organisations SET name = \"${ADMIN_ORG}\" where id = 1;" | ${MYSQL_CMD}
fi

if [ ! -z "$ADMIN_ORG_UUID" ]; then
echo "UPDATE $MYSQL_DATABASE.organisations SET uuid = \"${ADMIN_ORG_UUID}\" where id = 1;" | ${MYSQL_CMD}
fi

if [ -n "$ADMIN_KEY" ]; then
echo "... setting admin key to '${ADMIN_KEY}'"
CHANGE_CMD=(sudo -u www-data /var/www/MISP/app/Console/cake User change_authkey 1 "${ADMIN_KEY}")
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ services:
- "ADMIN_PASSWORD=${ADMIN_PASSWORD}"
- "ADMIN_KEY=${ADMIN_KEY}"
- "ADMIN_ORG=${ADMIN_ORG}"
- "ADMIN_ORG_UUID=${ADMIN_ORG_UUID}"
- "GPG_PASSPHRASE=${GPG_PASSPHRASE}"
# OIDC authentication settings
- "OIDC_ENABLE=${OIDC_ENABLE}"
Expand Down
2 changes: 2 additions & 0 deletions template.env
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ LIBFAUP_COMMIT=3a26d0a
ADMIN_EMAIL=
# name of org #1, default to MISP's default (ORGNAME)
ADMIN_ORG=
# uuid of org #1, defaults to an automatically generated one
ADMIN_ORG_UUID=
# defaults to an automatically generated one
ADMIN_KEY=
# defaults to MISP's default (admin)
Expand Down

0 comments on commit 7468cd9

Please sign in to comment.