Skip to content

Latest commit

 

History

History
124 lines (81 loc) · 7.54 KB

README.md

File metadata and controls

124 lines (81 loc) · 7.54 KB

TED Commando

TED Commando is a simple web server application to allow TED 5000, TED Home, and TED Pro systems to post energy data that can be exported into simple billing reports. This is intended to allow users to replace the Billing Export functionality of TED Commander by hosting this on their own server.

Getting Started

Hosting Requirements

For cloud hosting the commando server, we suggest using Digital Ocean as a host. For most installations, the following Droplet Configuration should work:

  • Basic Plan ($5/mo as of May 2020)
  • 1GB/1CPU
  • 25 GB SSD Disk
  • 1000 GB Transfer
  • Operating System: Ubuntu 18.04.xx LTS
    Make a note or copy your root password

Once the droplet is created you should assign a floating ip to the server so that it never changes in case the droplet needs to be recreated. This will allow you to re-use the same IP address if the droplet needs to be recreated in the future. (Select the Droplet and Select Networking to assign floating IP)

Advanced/Optional Settings:

While the service can be accessed via an IP address, we highly recommend you assign a domain name to the server. This is required if you plan on using HTTPS to access your server.

We also recommend you configure the droplet to take Nightly Snapshots so the server can be recovered in case something goes wrong.

If setting up a Firewall, you will need to allow the following ports to pass through:

  • Port 80: TCP
  • Port: 443: TCP (only required if you are setting up https access)

If possible, we recommend configuring the firewall to restict the IPs only the computers and TED devices that will be accessing the server. If this can't be done, then global access is fine although we do recommend configuring the server for HTTPS/TLS in that case.

Other Hosts

Other hosts, such as Amazon Web Services , Microsoft Azure, or self hosting can also be used. The same hardware/software specifications for Digial Ocean can be used when provisioning with the other services.

Installation Instructions

These instructions assume that we are starting with a clean install of Ubuntu 18.04LTS and that no other packages have been installed.

Select Droplet. Select Access to open console. Once the console is visible, enter the user name root and your root password.

To install a basic server (no-HTTPS/TLS), you can run the following commands:

  • wget https://raw.githubusercontent.com/theenergydetective/commando/master/scripts/install.sh
  • chmod 777 install.sh
  • sudo ./install.sh

Once complete, the server will be configured, and you will be able to access it via: http://<ip of server>

Upgrade

If you have alreay installed Commando and would like to run the latest version, you can run the following commands:

  • wget https://raw.githubusercontent.com/theenergydetective/commando/master/scripts/upgrade.sh
  • chmod 777 upgrade.sh
  • sudo ./upgrade.sh

TLS Configuration

To configure your server for HTTPS (TLS) we suggest configuring the server to issue a LetsEncrypt.

NOTE: You must NOT redirect all HTTP traffic to HTTPS. TED systems can only post data over HTTP.
When running certbot following the instructions in the above guide, be sure to chose option 1 when presented with the following prompt:

Output  
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.  
-------------------------------------------------------------------------------  
1: No redirect - Make no further changes to the webserver configuration.  
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for  
new sites, or if you're confident your site works on HTTPS. You can undo this  
change by editing your web server's configuration.  
-------------------------------------------------------------------------------  
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):  

First Time Running

When you first access the web page, you will be presented with the following screen.

enter image description here

For the Domain, this can either be the fully qualified domain name (FQDN) of the server, or the public IP address if you have a floating IP assigned. If operating the server on a LAN, this can be the LAN IP address of the server.

The Activation Key is optional. Specifying this key will allow you to restrict which TED units can post to this server. If it is left blank, any TED device can use 3rd party activation to post to this server. Please refer to the product manuals for instructions on how to configure the TED device to use 3rd Party posting.

Password Reset

If you need to reset your password on the server, you will need to:

  • log into the server console
  • Run the following script: sudo /opt/commando/lib/reset_admin.sh

Developer Notes

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Prerequisites

Windows Notes

  • If developing on Windows, you must pass the following property as a VM option as H2 requires and absolute path.

-Dspring.datasource.url=jdbc:h2:file:C:/opt/data/commando

How to Build

  • Clone or download the source code and extract it.
  • Start in the root Commando directory (same directory as pom.xml)
  • Be sure all of the pre-requisits are installed.
  • After node is installed, run npm install from the commando/src/main/resources/frontend/command-app directory.
  • Run the following from the command prompt: mvn clean package install -DskipTests
  • If using WSL for Angular/Node, then the maven command line must be run from there as well.

Significant Project Libraries