VinylDNS Portal
Supplies a UI for and offers authentication into VinylDNS.
Running Unit Tests
First, startup sbt: build/sbt.sh
.
Next, you can run all tests by simply running test
, or you can run an individual test by running test-only *MySpec
Running Frontend Tests
The front end tests can be run from the test/portal/fuctional
directory by simply running make
.
Building Locally
- You must have npm, if you don't have npm, follow instructions here https://www.npmjs.com/get-npm.
- Run
npm install
to install all dependencies, this includes those needed for testing. If you just want to run the portal thennpm install --production
would suffice - You must have grunt, if you don't have grunt, run
npm install -g grunt
. Then rungrunt default
from the root of the portal project - Create a local.conf file in the portal conf folder for your settings if desired.
- Follow the instructions for building vinyl locally on the vinyl readme
- Start vinyl with
sbt run
. Vinyl will start on localhost on port 9000. - Run the portal with
sbt -Djavax.net.ssl.trustStore="./private/trustStore.jks" -Dhttp.port=8080 run
- In a web browser go to localhost:9001
Working locally
Often times as a developer you want to work with the portal locally in a "real" setting against your own LDAP server. If your LDAP server requires SSL certs, you will need to create a trust store (or register the SSL certs on your local machine). If you create a trust store, you will need to make the trust store available so that you can start the portal locally and test.
- Create a trust store and save your certs.
- Pass the trust store in when you start sbt. This can be on the command line like...
sbt -Djavax.net.ssl.trustStore="./private/trustStore.jks"
Updating the trustStore Certificates
When some event causes the LDAP lookup to fail because of SSL certificate issues, follow the following steps to update
the trustStore
with the new certificates.
- Get the new certificate with
openssl s_client -connect <ldap server>:<port>
. This will display the certificate on the screen. - Copy everything from
-----BEGIN CERTIFICATE-----
to-----END CERTIFICATE-----
including the begin and end markers to the clipboard. - Open a new file in your favorite text editor
- Paste the clipboard contents into the file
- Save the file and give it a name to be used in the next steps. (ex.
new-ad-ssl-cert.pem
) keytool -printcert -file <your file name>
to view the file and check for errorskeytool -importcert -file <your file name> -keystore trustStore.jks -alias <alias for this cert>
(ex.new-ad-cert
)- Enter the trustStore password when prompted (look in application.conf)
- Answer yes to trust the certificate
The trustStore is now updated with the new certificate. You can delete the certificate file it is no longer needed.