Mercurial > hg > thermostat-ng > agent
changeset 2624:56eebd386be2
Remove unused commands and scripts from distribution
Reviewed-by: neugens
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-March/022520.html
author | Elliott Baron <ebaron@redhat.com> |
---|---|
date | Tue, 21 Mar 2017 18:40:40 -0400 |
parents | bbefa12b6ebb |
children | 703a2e1f90be |
files | distribution/assembly/scripts-assembly.xml distribution/config/commands/agent-info.properties distribution/config/commands/clean-data.properties distribution/config/commands/connect.properties distribution/config/commands/disconnect.properties distribution/config/commands/exit.properties distribution/config/commands/gui.properties distribution/config/commands/list-agents.properties distribution/config/commands/list-vms.properties distribution/config/commands/ping.properties distribution/config/commands/service.properties distribution/config/commands/shell.properties distribution/config/commands/storage.properties distribution/config/commands/vm-info.properties distribution/config/commands/vm-stat.properties distribution/config/db.properties distribution/config/devsetup.input distribution/config/examples/thermostat-roles-example.properties distribution/config/examples/thermostat-users-example.properties distribution/config/shell-command/shell-prompt.conf distribution/config/storage-populator/population-config-example-simple-threads.json distribution/config/storage-populator/population-config-example-simple.json distribution/config/thermostat-roles.properties distribution/config/thermostat-users.properties distribution/config/thermostat_jaas.conf distribution/config/web-storage-service.properties distribution/config/web.auth distribution/libs/create-user.js distribution/pom.xml distribution/scripts/thermostat-devsetup distribution/scripts/thermostat-setup distribution/scripts/thermostat-webservice distribution/windows/scripts/thermostat-devsetup.cmd distribution/windows/scripts/thermostat-webservice.cmd |
diffstat | 34 files changed, 0 insertions(+), 1406 deletions(-) [+] |
line wrap: on
line diff
--- a/distribution/assembly/scripts-assembly.xml Mon Mar 20 12:47:25 2017 -0400 +++ b/distribution/assembly/scripts-assembly.xml Tue Mar 21 18:40:40 2017 -0400 @@ -48,27 +48,11 @@ <fileSet> <outputDirectory>bin</outputDirectory> <directory>scripts</directory> - <excludes> - <exclude>thermostat-webservice</exclude> - <exclude>thermostat-setup</exclude> - <exclude>thermostat-devsetup</exclude> - </excludes> <filtered>true</filtered> </fileSet> <fileSet> <outputDirectory>etc</outputDirectory> <directory>config</directory> - <includes> - <include>agent.properties</include> - <include>agent.auth</include> - <include>ssl.properties</include> - <include>thermostatrc</include> - <include>logging.properties</include> - <include>bash-complete-logging.properties</include> - <include>osgi-export.properties</include> - <include>commands/agent.properties</include> - <include>commands/help.properties</include> - </includes> <filtered>true</filtered> </fileSet> </fileSets>
--- a/distribution/config/commands/agent-info.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - -summary = show info for an agent - -description = Show info for the specified agent. - -usage = agent-info [-d <url>] [-l <level>] -a <agent-id> - -options = agentId, AUTO_DB_OPTIONS, AUTO_LOG_OPTION - -agentId.short = a -agentId.long = agentId -agentId.hasarg = true -agentId.required = true -agentId.description = agent ID - -environments = cli, shell - -command-groups=agent-info \ No newline at end of file
--- a/distribution/config/commands/clean-data.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - -summary = drop all data related to all of the specified agents - -description = Drop all data related an agent. Or, drop data for all agents with the --all flag. - -usage = clean-data [--alive] [--all] <agent_id> - -options = alive, all, AUTO_LOG_OPTION - -all.short = a -all.long = all -all.hasarg = false -all.required = false -all.description = clean data for all agents - -alive.long = alive -alive.hasarg = false -alive.required = false -alive.description = authorize deletion of live agents - -environments = cli, shell - -command-groups=database-util \ No newline at end of file
--- a/distribution/config/commands/connect.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -# In order to support web storage connections we add web bundles here -bundles = com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - -summary = persistently connect to storage - -description = Persistently connect to a storage. This will prompt for \ - username and password for authentication. - -usage = connect -d <url> [-l <level>] - -options = AUTO_LOG_OPTION, AUTO_DB_OPTIONS, dbUrl - -dbUrl.required = true - -environments = shell - -command-groups=shell-session \ No newline at end of file
--- a/distribution/config/commands/disconnect.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version} - -summary = disconnect from the currently connected storage - -description = Disconnect from the currently connected storage. Any \ - further actions that require a connection to the storage will \ - connect again and prompt for authentication. - -usage = disconnect [-l <level>] - -options = AUTO_LOG_OPTION - -environments = shell - -command-groups=shell-session \ No newline at end of file
--- a/distribution/config/commands/exit.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version} - -summary = exit the shell - -description = Exit the Thermostat shell session. Aliases: quit, q - -usage = exit - -environments = shell - -command-groups=shell-session \ No newline at end of file
--- a/distribution/config/commands/gui.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -bundles = com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - com.redhat.thermostat.common.command=${project.version}, \ - com.redhat.thermostat.client.core=${project.version}, \ - com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.client.swing=${project.version}, \ - com.redhat.thermostat.client.swing.components=${project.version}, \ - com.redhat.thermostat.filter.livingvm.core=${project.version}, \ - com.redhat.thermostat.filter.livingvm.swing=${project.version}, \ - com.redhat.thermostat.process=${project.version}, \ - -summary = launch the GUI client - -description = Launch the GUI client. The GUI client provides a graphical interface to all the features. - -usage = gui [-l <level>] [--show-splash] - -options = AUTO_LOG_OPTION, splashscreen - -splashscreen.long = show-splash -splashscreen.required = false -splashscreen.hasarg = false -splashscreen.description = display a splash screen while launching Thermostat gui - -environments = cli - -command-groups=thermostat-core \ No newline at end of file
--- a/distribution/config/commands/list-agents.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - - -summary = list all agents - -description = List all agents currently collecting data. This may also \ - include inactive agents which were collecting data at one point but \ - are no longer. - -usage = list-agents [-d <url>] [-l <level>] - -# This command does not have any options -options = AUTO_DB_OPTIONS, AUTO_LOG_OPTION - -environments = cli, shell - -command-groups=agent-info \ No newline at end of file
--- a/distribution/config/commands/list-vms.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - - -summary = list all known VMs - -description = List all known VMs. This includes both alive VMs as well as (possibly) dead VMs. - -usage = list-vms [-d <url>] [-l <level>] [-a <agent-id>] - -# This command does not have any options -options = agentId, AUTO_DB_OPTIONS, AUTO_LOG_OPTION - -agentId.short = a -agentId.long = agentId -agentId.hasarg = true -agentId.required = false -agentId.description = Show VMs only for the specified agent ID - -environments = cli, shell - -command-groups=vm-info \ No newline at end of file
--- a/distribution/config/commands/ping.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -bundles = com.redhat.thermostat.client.command=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - -summary = send a ping to a running agent - -description = Send a ping to a running agent. This uses the command \ - channel and verifies that command-channel-related functionality is \ - working correctly between the current client and the agent. - -usage = ping <agentId> [-d <url>] [-l <level>] - -options = AUTO_DB_OPTIONS, AUTO_LOG_OPTION - -environments = cli, shell - -command-groups=agent-info \ No newline at end of file
--- a/distribution/config/commands/service.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -bundles = com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.process=${project.version}, \ - com.redhat.thermostat.agent.command=${project.version}, \ - com.redhat.thermostat.storage.cli=${project.version}, \ - com.redhat.thermostat.agent.cli=${project.version}, \ - com.redhat.thermostat.agent.ipc.tcpsocket.server=${project.version}, \ - @service.extra.bundles@ - -summary = run the thermostat storage and agent - -description = Start the thermostat storage and agent as foreground processes. \ - On exit, shut them both down. This is a convenience command that is \ - deprecated. It may be removed in a future release. Use 'web-storage-service' \ - instead. - -usage = service [-l <level>] - -options = AUTO_LOG_OPTION - -environments = cli - -command-groups=thermostat-core \ No newline at end of file
--- a/distribution/config/commands/shell.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# ShellCommand is provided by the tools bundle, which is a bootstrap bundle, and requires no other bundles. -bundles = com.redhat.thermostat.client.cli=${project.version} - -summary = launch the Thermostat interactive shell - -description = Launch the Thermostat interactive shell. \ - The prompt can be customized by editing the shell-prompt.conf \ - file located in $SYSTEM_THERMOSTAT_HOME/etc/plugins.d/shell-command. \ - You can also create your own shell-prompt.conf file and place \ - it in $USER_THERMOSTAT_HOME/etc/plugins.d/shell-command. This \ - will override the properties from the system config file. See the \ - system shell-prompt.conf file for instructions on how to write the config file. - -usage = shell - -# This command does not have any options -#options = - -environments = cli - -command-groups=thermostat-core \ No newline at end of file
--- a/distribution/config/commands/storage.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -bundles = com.redhat.thermostat.process=${project.version}, \ - com.redhat.thermostat.storage.cli=${project.version}, \ - -summary = control or view the status of the thermostat storage - -description = Start, stop or view the status of thermostat storage. - -usage = storage <--start|--stop|--status> [--dryRun] [-q] [--permitLocalhostException] [-l <level>] - -options = dryRun, start|stop|status, quiet, permitLocalhostException, AUTO_LOG_OPTION - -dryRun.short = d -dryRun.long = dryRun -dryRun.hasarg = false -dryRun.required = false -dryRun.description = run the service in dry run mode - -start.long = start -start.hasarg = false -start.required = false -start.description = start the database - -stop.long = stop -stop.hasarg = false -stop.required = false -stop.description = stop the database - -status.long = status -status.hasarg = false -status.required = false -status.description = check if the database is running - -permitLocalhostException.long = permitLocalhostException -permitLocalhostException.hasarg = false -permitLocalhostException.required = false -permitLocalhostException.description = permit local host connections with no credentials - -quiet.short = q -quiet.long = quiet -quiet.hasarg = false -quiet.required = false -quiet.description = don't produce any output - -environments = cli - -command-groups=thermostat-core \ No newline at end of file
--- a/distribution/config/commands/vm-info.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - -summary = show basic information about a VM - -description = Show basic information about a VM. - -usage = vm-info [-v <vmId>] [-a <agentId>] [-d <url>] [-l <level>] - -options = agentId, vmId, AUTO_DB_OPTIONS, AUTO_LOG_OPTION - -agentId.short = a -agentId.long = agentId -agentId.hasarg = true -agentId.required = false -agentId.description = the ID of the agent to monitor - -vmId.short = v -vmId.long = vmId -vmId.hasarg = true -vmId.required = false -vmId.description = the ID of the VM to monitor - -environments= cli, shell - -command-groups=vm-info \ No newline at end of file
--- a/distribution/config/commands/vm-stat.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -bundles = com.redhat.thermostat.client.cli=${project.version}, \ - com.redhat.thermostat.storage.mongodb=${project.version}, \ - com.redhat.thermostat.web.common=${project.version}, \ - com.redhat.thermostat.web.client=${project.version}, \ - -summary = show various statistics about a VM - -description = Show various statistics about a VM. This includes cpu and \ - memory information as well as any additional information provided by \ - plugins. - -usage = vm-stat --vmId <vm> [-c] [-s <time:timeunit>] [-d <url>] [-l <level>] - -options = vmId, continuous, since, AUTO_DB_OPTIONS, AUTO_LOG_OPTION - -vmId.short = v -vmId.long = vmId -vmId.hasarg = true -vmId.required = true -vmId.description = the ID of the VM to monitor - -continuous.short = c -continuous.long = continuous -continuous.hasarg = false -continuous.required = false -continuous.description = print data continuously - -since.short = s -since.long = since -since.hasarg = true -since.required = false -since.description = print data since [-s time:timeunits] ago or print all data [-s all]. Defaults to since 10 minutes ago [-s 10:minutes] and accepts positive times \ - and days, hours, minutes, or seconds - -environments = cli, shell - -command-groups=vm-info \ No newline at end of file
--- a/distribution/config/db.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -# Copyright 2012-2014 Red Hat, Inc. -# -# This file is part of Thermostat. -# -# Thermostat is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2, or (at your -# option) any later version. -# -# Thermostat is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Thermostat; see the file COPYING. If not see -# <http://www.gnu.org/licenses/>. -# -# Linking this code with other modules is making a combined work -# based on this code. Thus, the terms and conditions of the GNU -# General Public License cover the whole combination. -# -# As a special exception, the copyright holders of this code give -# you permission to link this code with independent modules to -# produce an executable, regardless of the license terms of these -# independent modules, and to copy and distribute the resulting -# executable under terms of your choice, provided that you also -# meet, for each linked independent module, the terms and conditions -# of the license of that module. An independent module is a module -# which is not derived from or based on this code. If you modify -# this code, you may extend this exception to your version of the -# library, but you are not obligated to do so. If you do not wish -# to do so, delete this exception statement from your version. - -################################################################### -# Basic storage configuration -################################################################### - -PORT=27518 -BIND=127.0.0.1 - -################################################################### -# SSL configuration -################################################################### -# -# NOTE: Enabling this config will likely require -# MONGODB_CONNECTION_USE_SSL=true to be set in -# $THERMOSTAT_HOME/etc/ssl.properties for thermostat client -# components which wish to establish a SSL connection to the -# mongodb storage server. These components include, but are -# not limited to, web service, agent, gui, shell (all of -# which make use of ssl.properties and settings within). -# In ssl.properties an appropriate thermostat - or system - -# keystore needs to be configured which has the certificate -# as specified here in a trusted keychain. -# Configuration in this file is only required in order to -# start mongodb (the server component) with SSL enabled. -# -# Uncomment the following line in order to start storage (currently -# mongodb) with SSL enabled. -#SSL_ENABLE=true -# -# If SSL_ENABLE=true, the path to the PEM encoded private key and -# the server certificate needs to be specified. Uncomment the -# following line and set the path appropriately. -#SSL_PEM_FILE=/path/to/some/pem/file.pem -# -# If SSL_ENABLE=true, the passphrase for the server certificate -# needs to be specified. If the server key was not encrypted any -# non-empty password will work. -#SSL_KEY_PASSWORD=somepassword -
--- a/distribution/config/devsetup.input Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -yes -${mongodb.dev.username} -${mongodb.dev.password} -${mongodb.dev.password} -client-tester -tester -tester -agent-tester -tester -tester
--- a/distribution/config/examples/thermostat-roles-example.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# This file is used if the PropertiesUsernameRolesLoginModule is used -# as a delegate in the JAAS configuration *and* the 'roles.properties' option -# has not been specified for the login module. -# -# If that is the case, this file does two things: -# 1. It maps user names to roles. -# 2. Defines an optional recursive set of roles. This is useful in order to -# define role sets. Users can then be members of such defined role sets. -# Note that every line which does not have a user name (as defined in the -# corresponding users.properties file) on the left hand side of the -# equals sign ('='), represents a role. -# -# A user is assigned multiple roles by separating them by a comma ','. Every -# entity in this file which isn't a user name, will be implicitly defined as a -# role. -# -############################################################################## -# The following makes user 'agent-tester' a user suitable for running -# "thermostat agent". -agent-tester=thermostat-agent, thermostat-grant-write-files-all-agent - -############################################################################## -# The following makes user 'client-tester' a user suitable for running the GUI and/or -# shell client. needs thermostat-purge role for clean-data command to work -client-tester=thermostat-grant-read-all-client, thermostat-cmdc, thermostat-purge - -# Agent recursive role -thermostat-agent = thermostat-cmdc-verify, \ - thermostat-login, \ - thermostat-prepare-statement, \ - thermostat-purge, \ - thermostat-register-category, \ - thermostat-realm, \ - thermostat-save-file, \ - thermostat-write -# Grant agent role so as to be able to write any file -thermostat-grant-write-files-all-agent = thermostat-files-grant-write-filename-ALL - -# Client recursive role (granting a client to read all data + all files) -thermostat-grant-read-all-client = thermostat-agents-grant-read-agentId-ALL, \ - thermostat-cmdc-generate, \ - thermostat-hosts-grant-read-hostname-ALL, \ - thermostat-load-file, \ - thermostat-login, \ - thermostat-prepare-statement, \ - thermostat-query, \ - thermostat-realm, \ - thermostat-register-category, \ - thermostat-vms-grant-read-username-ALL, \ - thermostat-vms-grant-read-vmId-ALL, \ - thermostat-files-grant-read-filename-ALL, \ - thermostat-write -# Grants all command channel operations -thermostat-cmdc = thermostat-cmdc-grant-garbage-collect, \ - thermostat-cmdc-grant-dump-heap, \ - thermostat-cmdc-grant-thread-harvester, \ - thermostat-cmdc-grant-killvm, \ - thermostat-cmdc-grant-profile-vm, \ - thermostat-cmdc-grant-ping, \ - thermostat-cmdc-grant-jmx-toggle-notifications \ - thermostat-cmdc-grant-vm-byteman-instrument
--- a/distribution/config/examples/thermostat-users-example.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -# This file is used if the PropertiesUsernameRolesLoginModule is used -# as a delegate in the JAAS configuration *and* the 'users.properties' option -# has not been specified for the login module. -# -# If that is the case, this defines the database of users with corresponding -# passwords, the thermostat web storage servlet knows about. -# -# WARNING: Passwords of users are in plain text. This needs to be considered -# when using this module in production. The main goal of this login -# module is to provide a simple way to define thermostat users and -# their corresponding passwords. -# -agent-tester=tester -client-tester=tester
--- a/distribution/config/shell-command/shell-prompt.conf Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# Use this file to customize the prompt for ./thermostat shell -# -# You can also place a custom shell-prompt.conf file in -# USER_THERMOSTAT_HOME/etc/plugins.d/shell-command -# The default for this is ~/.thermostat/etc/plugins.d/shell-command -# -# shell-prompt = [value] : Sets the prompt to [value]. Use tokens to customize. -# -# The accepted tokens are: -# %url : The url of the database connected to -# %protocol : The protocol of the connection -# %host : The host of the connection -# %port : The port of the connection -# -# %user : The username used to connect -# -# %connect : The status of the connection -# Uses [connected-token] if connected and [disconnected-token] if disconnected -# -# connected-prompt=[value] : displays [value] when connected to the database -# disconnected-prompt=[value] : displays [value] when disconnected from the database -# -# [value] for connected/disconnected-prompt cannot contain the %connect token - -shell-prompt=Thermostat %connect > -connected-prompt=+ -disconnected-prompt=-
--- a/distribution/config/storage-populator/population-config-example-simple-threads.json Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -{ - "records": [ - { - "name": "agent-config", - "number": 2, - "alive": 2 - }, - { - "name": "host-info", - "number": 1 - }, - { - "name": "vm-thread-harvesting", - "number": 5 - }, - { - "name": "vm-info", - "number": 5, - "alive": 5 - }, - { - "name": "network-info", - "number": 20 - } - ], - - "relationships": [ - { - "from": "agent-config", - "to": "vm-info", - "key": "agentId" - }, - { - "from": "agent-config", - "to": "host-info", - "key": "agentId" - }, - { - "from": "agent-config", - "to": "network-info", - "key": "agentId" - }, - { - "from": "agent-config", - "to": "vm-thread-harvesting", - "key": "agentId" - }, - { - "from": "vm-info", - "to": "vm-thread-harvesting", - "key": "vmId" - } - ] -}
--- a/distribution/config/storage-populator/population-config-example-simple.json Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -{ - "records": [ - { - "name": "agent-config", - "number": 100, - "alive": 20 - }, - { - "name": "host-info", - "number": 1 - }, - { - "name": "vm-info", - "number": 50, - "alive": 40 - }, - { - "name": "network-info", - "number": 50 - } - ], - - "relationships": [ - { - "from": "agent-config", - "to": "vm-info", - "key": "agentId" - }, - { - "from": "agent-config", - "to": "host-info", - "key": "agentId" - }, - { - "from": "agent-config", - "to": "network-info", - "key": "agentId" - } - ] -}
--- a/distribution/config/thermostat-roles.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -# This file is used if the PropertiesUsernameRolesLoginModule is used -# as a delegate in the JAAS configuration *and* the 'roles.properties' option -# has not been specified for the login module. -# -# If that is the case, this file does two things: -# 1. It maps user names to roles. -# 2. Defines an optional recursive set of roles. This is useful in order to -# define role sets. Users can then be members of such defined role sets. -# Note that every line which does not have a user name (as defined in the -# corresponding users.properties file) on the left hand side of the -# equals sign ('='), represents a role. -# -# A user is assigned multiple roles by separating them by a comma ','. Every -# entity in this file which isn't a user name, will be implicitly defined as a -# role. -# -# Format is as follows: -# -# user1 = my-role, my-role2 -# user2 = new-role, role1 -# role1 = other-role -# -# Considering users 'user1' and 'user2' are defined in users.properties, the -# above would assign 'user1' the roles 'my-role' and 'my-role2'. 'user2' would -# be a member of 'new-role', 'role1' and 'other-role' (transitively via role1) -# -# -# -# Example recursive role definition allowed-to-do-everything agent-users. You -# can uncomment the following lines and assign your agent users this -# "thermostat-agent" role. -#thermostat-agent = thermostat-cmdc-verify, \ -# thermostat-login, \ -# thermostat-prepare-statement, \ -# thermostat-purge, \ -# thermostat-register-category, \ -# thermostat-realm, \ -# thermostat-save-file, \ -# thermostat-write, \ -# thermostat-files-grant-write-filename-ALL -# -# Example recursive role definition for allowed-to-see-everything client-users. -# You may uncomment the following lines and assign your client users this -# "thermostat-client" role. "thermostat-write" is needed by the notes plugin. -# It's okay to not grant this permissions, the notes functionality will not -# work. -#thermostat-client = thermostat-agents-grant-read-agentId-ALL, \ -# thermostat-cmdc-generate, \ -# thermostat-hosts-grant-read-hostname-ALL, \ -# thermostat-load-file, \ -# thermostat-login, \ -# thermostat-prepare-statement, \ -# thermostat-query, \ -# thermostat-realm, \ -# thermostat-register-category, \ -# thermostat-vms-grant-read-username-ALL, \ -# thermostat-vms-grant-read-vmId-ALL, \ -# thermostat-files-grant-read-filename-ALL, \ -# thermostat-write -# -# Example recursive role definition which allows thermostat users to -# use the clean-data command, which may perform global delete operations. -# Consider assigning this role to client users if they need to use the -# clean-data command. Note that other roles for thermostat client users -# grant read-only access - at various levels - only. -#thermostat-cmd-clean-data = thermostat-purge -# -# Example recursive role definition that grants all command channel privileges. -# You may uncomment the following lines and assign your client users this -# "thermostat-cmdc" role. -#thermostat-cmdc = thermostat-cmdc-grant-garbage-collect, \ -# thermostat-cmdc-grant-dump-heap, \ -# thermostat-cmdc-grant-thread-harvester, \ -# thermostat-cmdc-grant-killvm, \ -# thermostat-cmdc-grant-profile-vm, \ -# thermostat-cmdc-grant-ping, \ -# thermostat-cmdc-grant-jmx-toggle-notifications \ -# thermostat-cmdc-grant-vm-byteman-instrument
--- a/distribution/config/thermostat-users.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -# This file is used if the PropertiesUsernameRolesLoginModule is used -# as a delegate in the JAAS configuration *and* the 'users.properties' option -# has not been specified for the login module. -# -# If that is the case, this defines the database of users with corresponding -# passwords, the thermostat web storage servlet knows about. -# -# WARNING: Passwords of users are in plain text. This needs to be considered -# when using this module in production. The main goal of this login -# module is to provide a simple way to define thermostat users and -# their corresponding passwords. -# -# The format of this file is as follows (whitespace in usernames/passwords are -# not recommended): -# -# user1=password1 -# user2=password2 -# ... -#
--- a/distribution/config/thermostat_jaas.conf Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -ThermostatJAASLogin { - com.redhat.thermostat.web.server.auth.spi.DelegateLoginModule required debug=false; -}; - -ThermostatJAASDelegate { - com.redhat.thermostat.web.server.auth.spi.PropertiesUsernameRolesLoginModule required debug=false; -};
--- a/distribution/config/web-storage-service.properties Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# A pair of host:port on which the embedded web storage -# service will listen on. -# -# Examples (IPv4): -# 127.0.0.1:8999 -# webstorage-service.example.com:8999 -# Examples (IPv6): -# [1fff:0:a88:85a3::ac1f]:8001 -# [1fff:0:a88:85a3::ac1f]:8999 -# webstorage-service.example.com:8999 -# -# A value must be specified. -SERVLET_CONTAINER_BIND_ADDRESS=127.0.0.1:8999 - -# Set this to "true" if the embedded servlet container -# should use a TLS/SSL enabled "https" connector rather -# than a plain/unencrypted "http" connector. -# -# If you set this to "true", be sure to also configure -# keystore and password in ssl.properties since the -# server component will use the keymaterial in that -# keystore with the "thermostat" alias. It is -# highly recommended to set COMMAND_CHANNEL_USE_SSL=true -# ssl.properties as well since this will use the same -# key material for encrypting the command channel -# communication and you've just set up a proper keystore -# file anyway. -USE_SSL=false - -# Optional jetty request log configuration. -# -# Paths are relative to USER_THERMOSTAT_HOME/logs -# directory -# -# Uncomment the line below in order to enable -# request logging. -#REQUEST_LOG_FILENAME=jetty-yyyy_mm_dd.request.log - -# Optional configuration so as to control -# whether backing storage gets started with the -# front-end web endpoint. -# -# Uncomment the line below in order to -# disable starting of backing storage. -#START_BACKING_STORAGE=false
--- a/distribution/config/web.auth Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -# Credentials to use for connecting to the backing storage -# (currently mongodb). Uncomment the following two blocks in -# order to use this username/password for the connection. - -# Username to use for connecting to the backing storage -# implementation -# username=some-username - -# Password to use for connecting to the backing storage -# implementation -# password=some-password
--- a/distribution/libs/create-user.js Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -db = db.getSiblingDB("thermostat") -var v = db.version() -var majorVersion = v.substring(0, v.indexOf('.')) -var minorMicro = v.substr(v.indexOf('.') + 1) -var minorVersion = minorMicro.substr(0, minorMicro.indexOf('.')) -try { - if ( majorVersion < 2 || ( majorVersion == 2 && minorVersion <= 2 ) ) { - // mongodb version 2.2 and below don't have the third argument. - // this should create the user as read + write. - db.addUser("$USERNAME","$PASSWORD") - } else if ( majorVersion == 2 && minorVersion <= 4 ) { - db.addUser({ user: "$USERNAME", pwd: "$PASSWORD", roles: [ "readWrite" ] }) - } else if ( majorVersion == 2 ) { - db.createUser({ user: "$USERNAME", pwd: "$PASSWORD", roles: [ "readWrite" ] }) - } else if ( majorVersion == 3 ) { - db = db.getSiblingDB("admin") - // role 'hostManager' is required to permit the fsync operation after creating the users - db.createUser({ user: "thermostat-admin", pwd: "$PASSWORD", roles: [ "dbOwner", "userAdminAnyDatabase", "hostManager" ] }) - db.auth("thermostat-admin", "$PASSWORD") - db = db.getSiblingDB("thermostat") - db.createUser({ user: "$USERNAME", pwd: "$PASSWORD", roles: [ "readWrite" ] }) - // on Windows (which is mongodb 3 and up only), ensure the new users are written to disk - // (Windows has a hard shutdown sometimes) - db = db.getSiblingDB("admin") - db.runCommand({ fsync: 1, async: false }) - } else { - throw "Unknown mongo version: " + v - } - // Exit with a success return code. - quit(0) -} catch (e) { - print(e) - // Be sure to leave the script with a non-zero code - quit(1) -}
--- a/distribution/pom.xml Mon Mar 20 12:47:25 2017 -0400 +++ b/distribution/pom.xml Tue Mar 21 18:40:40 2017 -0400 @@ -390,9 +390,6 @@ <chmod file="${project.build.directory}/image/bin/thermostat-common" perm="644" /> <chmod file="${project.build.directory}/image/bin/thermostat-ipc-client-common" perm="644" /> <chmod file="${project.build.directory}/tools/*" perm="755" /> - <chmod file="${project.build.directory}/image/etc/thermostat-roles.properties" perm="600" /> - <chmod file="${project.build.directory}/image/etc/thermostat-users.properties" perm="600" /> - <chmod file="${project.build.directory}/image/etc/web.auth" perm="600" /> <chmod file="${project.build.directory}/image/etc/agent.auth" perm="600" /> </target> </configuration>
--- a/distribution/scripts/thermostat-devsetup Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -#!/bin/bash -# -# Copyright 2012-2014 Red Hat, Inc. -# -# This file is part of Thermostat. -# -# Thermostat is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2, or (at your -# option) any later version. -# -# Thermostat is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Thermostat; see the file COPYING. If not see -# <http://www.gnu.org/licenses/>. -# -# Linking this code with other modules is making a combined work -# based on this code. Thus, the terms and conditions of the GNU -# General Public License cover the whole combination. -# -# As a special exception, the copyright holders of this code give -# you permission to link this code with independent modules to -# produce an executable, regardless of the license terms of these -# independent modules, and to copy and distribute the resulting -# executable under terms of your choice, provided that you also -# meet, for each linked independent module, the terms and conditions -# of the license of that module. An independent module is a module -# which is not derived from or based on this code. If you modify -# this code, you may extend this exception to your version of the -# library, but you are not obligated to do so. If you do not wish -# to do so, delete this exception statement from your version. -# -##################################################################### -# A script aiding thermostat developers to configure thermostat -# so as to get a working thermostat instance after a development -# build. -# -# This script calls thermostat-setup with canned input coming from -# file devsetup.input and then copies an appropriate agent.auth -# file into the right place. - -# Source thermostat-common from same directory as this script -. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/thermostat-common - -DEV_INPUT="$THERMOSTAT_HOME/etc/devsetup.input" - -# Call the setup script -"$THERMOSTAT" setup -c < "$DEV_INPUT" -exit $?
--- a/distribution/scripts/thermostat-setup Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -#!/bin/bash -# -# Copyright 2012-2014 Red Hat, Inc. -# -# This file is part of Thermostat. -# -# Thermostat is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2, or (at your -# option) any later version. -# -# Thermostat is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Thermostat; see the file COPYING. If not see -# <http://www.gnu.org/licenses/>. -# -# Linking this code with other modules is making a combined work -# based on this code. Thus, the terms and conditions of the GNU -# General Public License cover the whole combination. -# -# As a special exception, the copyright holders of this code give -# you permission to link this code with independent modules to -# produce an executable, regardless of the license terms of these -# independent modules, and to copy and distribute the resulting -# executable under terms of your choice, provided that you also -# meet, for each linked independent module, the terms and conditions -# of the license of that module. An independent module is a module -# which is not derived from or based on this code. If you modify -# this code, you may extend this exception to your version of the -# library, but you are not obligated to do so. If you do not wish -# to do so, delete this exception statement from your version. -# -##################################################################### -# Source thermostat-common from same directory as this script -. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/thermostat-common - -echo "THIS SCRIPT IS DEPRECATED! Please use 'thermostat setup -c' instead." 1>&2 -# Call the thermostat non-gui version of setup -${THERMOSTAT_HOME}/bin/thermostat setup -c
--- a/distribution/scripts/thermostat-webservice Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -#!/bin/bash -# -# Copyright 2012-2014 Red Hat, Inc. -# -# This file is part of Thermostat. -# -# Thermostat is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2, or (at your -# option) any later version. -# -# Thermostat is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Thermostat; see the file COPYING. If not see -# <http://www.gnu.org/licenses/>. -# -# Linking this code with other modules is making a combined work -# based on this code. Thus, the terms and conditions of the GNU -# General Public License cover the whole combination. -# -# As a special exception, the copyright holders of this code give -# you permission to link this code with independent modules to -# produce an executable, regardless of the license terms of these -# independent modules, and to copy and distribute the resulting -# executable under terms of your choice, provided that you also -# meet, for each linked independent module, the terms and conditions -# of the license of that module. An independent module is a module -# which is not derived from or based on this code. If you modify -# this code, you may extend this exception to your version of the -# library, but you are not obligated to do so. If you do not wish -# to do so, delete this exception statement from your version. -# -##################################################################### -# -read -d '' help_text <<"END_OF_HELP" -thermostat-webservice: A convenience script for starting and stopping -tomcat with thermostat web storage application deployed. - -This script is intended to be an aid for developers to start up -tomcat and deploy thermostat web storage app. It is assumed that -there is already a backing storage running that the web app can -connect to, and that the web.xml file from the build image is -correctly configured for this backing storage connection. See -the file: - - web/war/target/thermostat-web-war-0.16.0-SNAPSHOT/WEB-INF/web.xml - -In addition, an appropriate user and role configuration must be -present in the build image. See the files: - - distribution/target/image/etc/thermostat-users.properties - distribution/target/image/etc/thermostat-roles.properties - -An agent requires authentication configuration in order to connect -to secured storage. See the file: - - ~/.thermostat/etc/agent.auth - -Possible contents of thermostat-users.properties: - - agent-tester=tester - client-tester=tester - -Corresponding potential thermostat-roles.properties: - - agent-tester=thermostat-agent, thermostat-files-grant-write-filename-ALL - client-tester=thermostat-client, thermostat-cmdc-allPrivs, \\ - thermostat-files-grant-read-filename-ALL - thermostat-agent=thermostat-write, thermostat-prepare-statement, \\ - thermostat-save-file, thermostat-purge, \\ - thermostat-register-category, thermostat-cmdc-verify, \\ - thermostat-login, thermostat-realm - thermostat-client=thermostat-agents-grant-read-agentId-ALL, \\ - thermostat-hosts-grant-read-hostname-ALL, \\ - thermostat-vms-grant-read-vmId-ALL, \\ - thermostat-vms-grant-read-username-ALL, thermostat-realm, \\ - thermostat-login, thermostat-query, \\ - thermostat-prepare-statement, thermostat-cmdc-generate, \\ - thermostat-load-file, thermostat-get-count, \\ - thermostat-register-category - thermostat-cmdc-allPrivs = thermostat-cmdc-grant-garbage-collect, \\ - thermostat-cmdc-grant-dump-heap, \\ - thermostat-cmdc-grant-thread-harvester, \\ - thermostat-cmdc-grant-killvm, \\ - thermostat-cmdc-grant-ping, \\ - thermostat-cmdc-grant-jmx-toggle-notifications - -Please be familiar with these privileges to decide whether this -set of users and roles is appropriate for you or your testing. - -Contents of ~/.thermostat/etc/agent.auth that would be valid with the above: - - username=agent-tester - password=tester - -Here is typical use of this script: - - $ echo ${USER_FLUFF} > distribution/target/image/etc/thermostat-users.properties - $ echo ${ROLE_FLUFF} > distribution/target/image/etc/thermostat-roles.properties - $ echo ${AGENT_FLUFF} > ~/.thermostat/etc/agent.auth - $ ./distribution/target/image/bin/thermostat storage --start - $ ./distribution/target/image/bin/thermostat-webservice -t /path/to/tomcat start - $ ./distribution/target/image/bin/thermostat agent -d http://127.0.0.1:8080/thermostat/storage - $ ./distribution/target/image/bin/thermostat gui - - ... and so forth. - - ./distribution/target/image/bin/thermostat-webservice -t /path/to/tomcat stop - ./distribution/target/image/bin/thermostat storage --stop - -NOTE: Use of this script to start tomcat will blow away webapps/thermostat -in your tomcat directory and replace it with the corresponding contents -from your build image. - -NOTE2: If tomcat is already running, results of this script are undefined. - -. -END_OF_HELP -# - -TOMCAT_DIR=tomcat - -usage() { - echo "Usage: " - echo " thermostat-webservice [-t <root of tomcat directory>] <start|stop>" -} - -do_help() { - echo "$help_text" - usage -} - -check_valid_args() { - if [ "x${FUNCTION}" = "x" ] ; then - echo "You must specify either start, stop, or help." - usage - exit 1 - fi - if [ ! -d ${TOMCAT_DIR} ] ; then - echo "Tomcat directory does not exist: ${TOMCAT_DIR}" - usage - exit 1 - fi -} - -process_args() { - while [ $# -gt 0 ]; do - THIS_ARG=$1 - shift - if [ $THIS_ARG = "-h" -o $THIS_ARG = "--help" -o $THIS_ARG = "help" ] ; then - do_help - exit - break - elif [ $THIS_ARG = "-t" ] ; then - TOMCAT_DIR=$1 - shift - elif [ $THIS_ARG = "start" -o $THIS_ARG = "stop" ] ; then - FUNCTION=$THIS_ARG - else - echo "Unrecognized argument: $THIS_ARG" - exit 1 - fi - done - check_valid_args -} - -do_start() { - rm -rf webapps/thermostat - cp -r "$TH/web/war/target/thermostat-web-war-@project.version@" webapps/thermostat - if [ $CYGWIN_MODE -eq 1 ]; then - JAVA_OPTS="-Djava.security.auth.login.config=`cygpath -w ${TH}/distribution/target/image/etc/thermostat_jaas.conf`" ./bin/startup.sh - else - JAVA_OPTS="-Djava.security.auth.login.config=${TH}/distribution/target/image/etc/thermostat_jaas.conf" ./bin/startup.sh - fi -} - -do_stop() { - ./bin/shutdown.sh -} - -do_function() { - TH="$(pwd)" - cd ${TOMCAT_DIR} - case $1 in - start ) - do_start - ;; - stop ) - do_stop - ;; - esac - cd ${TH} -} - -process_args $* -do_function $FUNCTION - -# Please be familiar with these privileges to decide whether this -# set of users and roles is appropriate for you or your testing. -# -#TH="$(pwd)" -#cd path/to/tomcat -#rm -rf webapps/thermostat -#cp -r $TH/web/war/target/thermostat-web-war-0.16.0-SNAPSHOT webapps/thermostat -#export JAVA_OPTS="-Djava.security.auth.login.config=${TH}/distribution/target/image/etc/thermostat_jaas.conf" -#./bin/startup.sh -#cd $TH -#./distribution/target/image/bin/thermostat storage --start -#mkdir -p ~/.thermostat/etc -#echo -e "username=agent-tester\npassword=tester" > ~/.thermostat/etc/agent.auth -#./distribution/target/image/bin/thermostat agent -d http://127.0.0.1:8080/thermostat/storage -
--- a/distribution/windows/scripts/thermostat-devsetup.cmd Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -@echo off - -:: Copyright 2016 Red Hat, Inc. -:: -:: This file is part of Thermostat. -:: -:: Thermostat is free software; you can redistribute it and/or modify -:: it under the terms of the GNU General Public License as published -:: by the Free Software Foundation; either version 2, or (at your -:: option) any later version. -:: -:: Thermostat is distributed in the hope that it will be useful, but -:: WITHOUT ANY WARRANTY; without even the implied warranty of -:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -:: General Public License for more details. -:: -:: You should have received a copy of the GNU General Public License -:: along with Thermostat; see the file COPYING. If not see -:: <http://www.gnu.org/licenses/>. -:: -:: Linking this code with other modules is making a combined work -:: based on this code. Thus, the terms and conditions of the GNU -:: General Public License cover the whole combination. -:: -:: As a special exception, the copyright holders of this code give -:: you permission to link this code with independent modules to -:: produce an executable, regardless of the license terms of these -:: independent modules, and to copy and distribute the resulting -:: executable under terms of your choice, provided that you also -:: meet, for each linked independent module, the terms and conditions -:: of the license of that module. An independent module is a module -:: which is not derived from or based on this code. If you modify -:: this code, you may extend this exception to your version of the -:: library, but you are not obligated to do so. If you do not wish -:: to do so, delete this exception statement from your version. - -setlocal - -%~dp0\thermostat-common.cmd - -echo thermostat-devsetup not implemented on Windows.
--- a/distribution/windows/scripts/thermostat-webservice.cmd Mon Mar 20 12:47:25 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -@echo off - -:: Copyright 2017 Red Hat, Inc. -:: -:: This file is part of Thermostat. -:: -:: Thermostat is free software; you can redistribute it and/or modify -:: it under the terms of the GNU General Public License as published -:: by the Free Software Foundation; either version 2, or (at your -:: option) any later version. -:: -:: Thermostat is distributed in the hope that it will be useful, but -:: WITHOUT ANY WARRANTY; without even the implied warranty of -:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -:: General Public License for more details. -:: -:: You should have received a copy of the GNU General Public License -:: along with Thermostat; see the file COPYING. If not see -:: <http://www.gnu.org/licenses/>. -:: -:: Linking this code with other modules is making a combined work -:: based on this code. Thus, the terms and conditions of the GNU -:: General Public License cover the whole combination. -:: -:: As a special exception, the copyright holders of this code give -:: you permission to link this code with independent modules to -:: produce an executable, regardless of the license terms of these -:: independent modules, and to copy and distribute the resulting -:: executable under terms of your choice, provided that you also -:: meet, for each linked independent module, the terms and conditions -:: of the license of that module. An independent module is a module -:: which is not derived from or based on this code. If you modify -:: this code, you may extend this exception to your version of the -:: library, but you are not obligated to do so. If you do not wish -:: to do so, delete this exception statement from your version. - -setlocal - -%~dp0\thermostat-common.cmd - -echo thermostat-webservice not implemented on Windows. -exit 1 - -set TOMCAT_DIR=tomcat - -process_args() { - while [ $# -gt 0 ]; do - THIS_ARG=$1 - shift - if [ $THIS_ARG = "-h" -o $THIS_ARG = "--help" -o $THIS_ARG = "help" ] ; then - do_help - exit - break - elif [ $THIS_ARG = "-t" ] ; then - TOMCAT_DIR=$1 - shift - elif [ $THIS_ARG = "start" -o $THIS_ARG = "stop" ] ; then - FUNCTION=$THIS_ARG - else - echo "Unrecognized argument: $THIS_ARG" - exit 1 - fi - done - check_valid_args -} - -do_start() { - rm -rf webapps/thermostat - cp -r "$TH/web/war/target/thermostat-web-war-@project.version@" webapps/thermostat - if [ $CYGWIN_MODE -eq 1 ]; then - JAVA_OPTS="-Djava.security.auth.login.config=`cygpath -w ${TH}/distribution/target/image/etc/thermostat_jaas.conf`" ./bin/startup.sh - else - JAVA_OPTS="-Djava.security.auth.login.config=${TH}/distribution/target/image/etc/thermostat_jaas.conf" ./bin/startup.sh - fi -} - -do_stop() { - ./bin/shutdown.sh -} - -do_function() { - TH="$(pwd)" - cd %TOMCAT_DIR% - case $1 in - start ) - do_start - ;; - stop ) - do_stop - ;; - esac - cd ${TH} -} - -process_args $* -do_function $FUNCTION - -:: Please be familiar with these privileges to decide whether this -:: set of users and roles is appropriate for you or your testing. -:: -:: TH="$(pwd)" -:: cd path/to/tomcat -:: rm -rf webapps/thermostat -:: cp -r $TH/web/war/target/thermostat-web-war-0.16.0-SNAPSHOT webapps/thermostat -:: export JAVA_OPTS="-Djava.security.auth.login.config=${TH}/distribution/target/image/etc/thermostat_jaas.conf" -:: ./bin/startup.sh -:: cd $TH -:: ./distribution/target/image/bin/thermostat storage --start -:: mkdir -p ~/.thermostat/etc -:: echo -e "username=agent-tester\npassword=tester" > ~/.thermostat/etc/agent.auth -:: ./distribution/target/image/bin/thermostat agent -d http://127.0.0.1:8080/thermostat/storage - - -rem functions - -:usage - echo Usage: - echo thermostat-webservice [-t <root of tomcat directory>] <start|stop> - exit /b 0 - - -:check_valid_args - if "x%FUNCTION%" = "x" ( - echo "You must specify either start, stop, or help." - call usage - exit /b 1 - ) - if not exist %TOMCAT_DIR% ( - echo "Tomcat directory does not exist: %TOMCAT_DIR%" - call usage - exit /b 1 - fi - exit /b 0 - - -print_help: -echo thermostat-webservice: A convenience script for starting and stopping -echo tomcat with thermostat web storage application deployed. -echo -echo This script is intended to be an aid for developers to start up -echo tomcat and deploy thermostat web storage app. It is assumed that -echo there is already a backing storage running that the web app can -echo connect to, and that the web.xml file from the build image is -echo correctly configured for this backing storage connection. See -echo the file: -echo -echo web/war/target/thermostat-web-war-0.16.0-SNAPSHOT/WEB-INF/web.xml -echo -echo In addition, an appropriate user and role configuration must be -echo present in the build image. See the files: -echo -echo distribution/target/image/etc/thermostat-users.properties -echo distribution/target/image/etc/thermostat-roles.properties -echo -echo An agent requires authentication configuration in order to connect -echo to secured storage. See the file: -echo -echo ~/.thermostat/etc/agent.auth -echo -echo Possible contents of thermostat-users.properties: -echo -echo agent-tester=tester -echo client-tester=tester -echo -echo Corresponding potential thermostat-roles.properties: -echo -echo agent-tester=thermostat-agent, thermostat-files-grant-write-filename-ALL -echo client-tester=thermostat-client, thermostat-cmdc-allPrivs, \\ -echo thermostat-files-grant-read-filename-ALL -echo thermostat-agent=thermostat-write, thermostat-prepare-statement, \\ -echo thermostat-save-file, thermostat-purge, \\ -echo thermostat-register-category, thermostat-cmdc-verify, \\ -echo thermostat-login, thermostat-realm -echo thermostat-client=thermostat-agents-grant-read-agentId-ALL, \\ -echo thermostat-hosts-grant-read-hostname-ALL, \\ -echo thermostat-vms-grant-read-vmId-ALL, \\ -echo thermostat-vms-grant-read-username-ALL, thermostat-realm, \\ -echo thermostat-login, thermostat-query, \\ -echo thermostat-prepare-statement, thermostat-cmdc-generate, \\ -echo thermostat-load-file, thermostat-get-count, \\ -echo thermostat-register-category -echo thermostat-cmdc-allPrivs = thermostat-cmdc-grant-garbage-collect, \\ -echo thermostat-cmdc-grant-dump-heap, \\ -echo thermostat-cmdc-grant-thread-harvester, \\ -echo thermostat-cmdc-grant-killvm, \\ -echo thermostat-cmdc-grant-ping, \\ -echo thermostat-cmdc-grant-jmx-toggle-notifications -echo -echo Please be familiar with these privileges to decide whether this -echo set of users and roles is appropriate for you or your testing. -echo -echo Contents of ~\.thermostat\etc\agent.auth that would be valid with the above: -echo -echo username=agent-tester -echo password=tester -echo -echo Here is typical use of this script: -echo -echo $ echo %USER_FLUFF% > distribution\target\image\etc\thermostat-users.properties -echo $ echo %ROLE_FLUFF% > distribution\target\image\etc\thermostat-roles.properties -echo $ echo %AGENT_FLUFF% > ~\.thermostat\etc\agent.auth -echo $ .\distribution\target\image\bin\thermostat storage --start -echo $ .\distribution\target\image\bin\thermostat-webservice -t \path\to\tomcat start -echo $ .\distribution\target\image\bin\thermostat agent -d http:/127.0.0.1:8080/thermostat/storage -echo $ .\distribution\target\image\bin\thermostat gui -echo -echo ... and so forth. -echo -echo .\distribution\target\image\bin\thermostat-webservice -t \path\to\tomcat stop -echo .\distribution\target\image\bin\thermostat storage --stop -echo -echo NOTE: Use of this script to start tomcat will blow away webapps/thermostat -echo in your tomcat directory and replace it with the corresponding contents -echo from your build image. -echo -echo NOTE2: If tomcat is already running, results of this script are undefined. -echo -echo . - -:done -exit /b 0 -