---
# System prepended metadata

title: Grundfos Developer Setup scratchpad

---

# Grundfos Developer Setup scratchpad

A list of things encountered during onboarding that could be adressed in a better, in no particular order.

## SSH setup
* Generating a private key and using it for checking out Grundfos repositories.
* Securing the private key with a passphrase / use of SSH agent.
* Bitbucket does not show how to clone with SSH unless you have added a public SSH key to your account.

## Maven issues
* Not being able to download resources from http:// URLs for the WKND tutorial
* Nexus HTTPS certificate is not trusted before installing Grundfos Root CA to the global java cacerts keystore
    * More than one keystore is installed by the Corretto installer
* If changing Nexus URLs from https:// to http://, you also have to use port 8081

## WKND tutorial
* Implement `node-run-all` when using `npm run watch`. Windows does not support parallel processes using ampersand (&)
* Administrator privileges might be needed for some installation steps
* Versions of `nodejs` and `npm` used in the tutorial conflicts with the ones used by `grundfos-development-setup`
* The `repo` tool does not work on windows, even when installed the recommended cygwin packages
* Examples and hints are shown for vscode and not IntelliJ idea
* We had to manually install service pack 6.5.10 for the AEM instance used for the tutoria.l

## Grundfos-development-setup
* There is no way to override AEM runmodes from the command line

## Grundfos-aem-base
* Rename `.env.example` to `.env` and comment out line 7. Replace `false` from line 10 to `true`
* Running `mvn install` in the root of the project will use versions of node and npm installed by maven. Running the same thing in the `aem-base-ui` subfolder will use system versions of node and npm
* The default npm version (5.6.0) for node v10.2.1 does not work with the project. Version 6.9.0 does work, but is only triggered when running maven from the root of the project.
* ~~`npm run watch` seems to run, but the proxy on localhost:3000 times out when trying to connect to it.~~
* On linux building of the `aem-base-ui` subproject will fail with an audit error. 
    * This can be fixed by running `./node/npm install --no-audit` manually

## Other

* More indepth guide on how to checkout grundfos projects *and make sure they work* would be nice
* A tutorial on how AEM Java debugging works might be a good idea
* VScode vs IntelliJ Idea

## Fixes and guides

* Installing Grundfos Root CA to make various tools trust the nexus server
    * Run "certmgr" from the start menu and navigate to Trusted Root Certification Authorities => Certificates = Grundfos Root CA.
    * Rightclick on the certificate and click All tasks => Export
    * Save the certificate somewhere it is easy to find
    * For curl: Open git-bash as administrator and the following command:
      `cat "/c/path/to/Grundfos root CA.cer" >> /mingw64/ssl/certs/ca-bundle.crt`
    * For java/maven: Open a command prompt as administrator and run the following command:
      `keytool -import -trustcacerts -keystore "C:\Program Files\Amazon Corretto\jdk1.8.0_322\jre\lib\security\cacerts" -storepass changeit -alias GrundfosRootCA -file "c:\path\to\Grundfos root CA.cer"`

# Jubk's scratchpad for a docker setup

```
Containers:
 Base:
  Configuration
   Must be configurable via environment variables
  Software:
    Corretto java
    Maven
    Grundfos development setup
    SSH-client
    repo
    node / npm / nvm
    editors and command line tools
  Volumes
    crx-quickstart
    /code (host-mounted)
  Startup
    Defaults for environments
    npm version
    ssh configuration

Pros:
 Common dependencies
 A fix from one developer can be easily distributed to others
 First time startup is a single command
 Easy to restart from scratch
 Full environment with one setup (if using docker-compose)

Cons:
 Extra layer of abstraction
 Existing setup is not docker-friendly
 Getting SSH to work inside containers might be a PITA
 IDE integration is unknown
 Overlap with automation implemented in Maven
 Docker containers wil be headless / no gui

Needs examination:
 Existing infrastructure / repo
  - Nexus?
 Legal stuff (licenses)
 Security
  - What do we depend on / which dependencies can give us vulnerabilities
 How to handle logging from AEM instances

```
