Skip to content

Commit

Permalink
Merge pull request #60 from Spyderisk/59-reset-on-start-behaviour
Browse files Browse the repository at this point in the history
Clarifies reset.on-start options (#59)
  • Loading branch information
kenmeacham authored Nov 21, 2023
2 parents 4ea5b62 + bf73d52 commit c2b8228
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ N.B. The links in the user interface for the attack graph image does not work in

Please also note that the default setup is to recreate all databases on initial
start-up. In order to persist any installed knowledgebases and created system
models, you should ensure that `RESET_ON_START=false` in your `.env` file, prior to re-running `./gradlew assemble
bootTest`.
models, you should ensure that the environment variable `RESET_ON_START=false` prior to re-running `./gradlew assemble bootTest`.
In the bash shell, that can be done with `export RESET_ON_START=false`.
Alternatively, put `RESET_ON_START=false` in your `.env` file and "source" it with `set -a; source .env; set +a`.

## Installing Docker

Expand Down Expand Up @@ -721,7 +722,7 @@ docker-compose down

In all these cases, the (Docker disk) volumes are persisted and named volumes
will be reattached to new containers, during restart. Assuming that you have
`reset.on.start=false` in your `application.properties` file, this also means
`RESET_ON_START=false` in your `.env` file, this also means
that any knowledgebases (domain models), system models, palettes, etc will be
persisted after restarting the containers.

Expand All @@ -738,11 +739,11 @@ docker-compose exec ssm bash
./gradlew assemble bootTest
```

b) Leave containers running, but set `reset.on.start=true` in your
`application.properties` file, then restart Spyderisk, e.g.
b) Leave containers running, but set `RESET_ON_START=true` then restart Spyderisk, e.g.

```shell
docker-compose exec ssm bash
export RESET_ON_START=true
./gradlew assemble bootTest
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public void run(String... args) {
}
logger.warn("No domain models currently installed! Options include:");
String restartMsg = production ? "restart Spyderisk (docker-compose down -v; docker-compose up -d)"
: "restart Spyderisk (ensure reset.on.start=true in application properties)";
: "restart Spyderisk (ensure RESET_ON_START=true in your .env file)";

logger.warn("1) Copy required domain model zip bundles into {} then " + restartMsg, kbSourceFolder);
logger.warn("2) Manually install each required domain model (knowledgebase) via the Spyderisk Knowledgebase Manager page");
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application-production.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# STW - temporarily commented out
# logging levels need to be consistent with the policy in logback.xml
#logging.level.uk.ac.soton.itinnovation.security.systemmodeller=WARN

# Ensure that the databases are not reset on start
reset.on.start=false
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ spring.application.version=@VERSION@
server.port=8081
######### WARNING: This property should match (API_)END_POINT in /src/main/webapp/config/config.js #########
server.servlet.contextPath=/system-modeller

# If true then reset the MongoDB and triplestore databases on start-up.
# In the development environment, this is overridden in the docker-compose.yml file which in turn may be configured by a .env file.
# In a production environment (with the "production" Spring profile set) this is overridden by the value in application-production.properties
reset.on.start=true

# Knowledgebase source location (domain model zip bundles to install)
Expand Down

0 comments on commit c2b8228

Please sign in to comment.