Skip to content

SolarSSH Deployment Guide

Matt Magoffin edited this page Jun 29, 2017 · 4 revisions

This guide describes how to deploy the SolarSSH server application. SolarSSH is designed to be easily deployed into the cloud or onto private infrastructure. As SolarSSH builds on top of the SolarNetwork API, it can be deployed outside the core SolarNetwork infrastructure and customized to suit other needs.

Requirements

The application is a Java web application, and requires a Servlet 3.1 or higher servlet container to run in. It requires Java 8 or higher.

Additionally, any SolarNode that will work with SolarSSH must be configured to support it. Recent standard SolarNode images are already configured to support SolarSSH running on ssh.solarnetwork.net. See the SolarNode SolarSSH setup guide for more details.

Runtime configuration

The runtime can be configured using properties provided in the following ways:

  1. JNDI servlet environment settings, available at java:config/env. In Tomcat this can be provided via a context.xml file. There is an example of this in the config/example directory.
  2. JVM system properties, by passing on the command line. For example -Dssh.host=ssh.example.com.
  3. A classpath application-test.properties file, added to the build at compile time. This can be useful during development, to tweak the settings to suit the developer. This resource is not checked into source control, so it must be created by the developer.
  4. A classpath application.properties file, added to the build at compile time. This is provided by default and serves as the default runtime settings.

Logging

Logging is handled by Logback, controlled via a classpath logback.xml resource added to the build at compile time. The app maintains two log files:

  1. logs/solarssh.log
  2. logs/solarssh-audit.log

The first contains general log messages, while the audit log contains just auditing information about sessions.

Both logs are configured to rotate based on a maximum size of 2MB, with 21 total log files persisted before deleting the oldest.

Another classpath resource, logback-test.xml can be added, which will take precedence over the logback.xml file. That resource is not checked into source control, so developers can create that resource to suit their preferences.

Building

The project uses Gradle for builds. From the command line, run ./gradlew build to perform a full build. That will produce a WAR file like build/libs/solarssh-X.war where X is the application version.

The project also supports the Eclipse IDE, as long as the Buildship plugin is installed. Simply import the project into Eclipse, and you can then deploy the app into a servlet 3.1 runtime, like Tomcat 8.5.

Clone this wiki locally