From 599527b27a9223ba9c0170fb3d12a7339316a171 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 7 Jun 2013 21:42:08 -0300 Subject: Adding onion::monitor --- manifests/monitor.pp | 27 +++++ templates/armrc.erb | 320 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 347 insertions(+) create mode 100644 manifests/monitor.pp create mode 100644 templates/armrc.erb diff --git a/manifests/monitor.pp b/manifests/monitor.pp new file mode 100644 index 0000000..d6d0f03 --- /dev/null +++ b/manifests/monitor.pp @@ -0,0 +1,27 @@ +# Generate the hash using 'tor --hash-password ' +class onion::monitor( + $control_password = hiera('onion::monitor::control_password'), + $hashed_control_password = hiera('onion::monitor::hashed_control_password') +) { + tor::daemon::control{ "control": + port => 9051, + ensure => present, + hashed_control_password => $hashed_control_password, + } + + file { '/root/.arm': + ensure => directory, + owner => root, + group => root, + mode => 0644, + } + + file { '/root/.arm/armrc': + ensure => present, + owner => root, + group => root, + mode => 0640, + source => template('onion/armrc.erb'), + require => File['/root/.arm'], + } +} diff --git a/templates/armrc.erb b/templates/armrc.erb new file mode 100644 index 0000000..1bf80d1 --- /dev/null +++ b/templates/armrc.erb @@ -0,0 +1,320 @@ +# Startup options +startup.controlPassword <%= control_password %> +startup.interface.ipAddress 127.0.0.1 +startup.interface.port 9051 +startup.interface.socket /var/run/tor/control +startup.blindModeEnabled false +startup.events N3 +startup.dataDirectory ~/.arm + +# Seconds between querying information +queries.resourceUsage.rate 5 +queries.connections.minRate 5 +queries.refreshRate.rate 5 + +# allows individual panels to be included/excluded +features.panels.show.graph true +features.panels.show.log true +features.panels.show.connection true +features.panels.show.config true +features.panels.show.torrc true +features.panels.show.interpretor true + +# Read the proc contents directly instead of calling ps, netstat, and other +# resolvers. This provides very sizable performance benefits (around 90% +# faster lookups) but this is only available on Linux. +queries.useProc true + +# Renders the interface with color if set and the terminal supports it +features.colorInterface true + +# Replaces all colored content (ie, anything that isn't white) with this +# color. Valid options are: +# none, red, green, yellow, blue, cyan, magenta, black, white +features.colorOverride none + +# If arm is attached to an arm started tor instance when it shuts down then +# offers to shut down tor too if true, otherwise skips this prompt. +features.offerTorShutdownOnQuit false + +# Includes unicode characters in the interface. +features.printUnicode true + +# Checks the torrc for issues, warning and hilighting problems if true +features.torrc.validate true + +# Set this if you're running in a chroot jail or other environment where tor's +# resources (log, state, etc) should have a prefix in their paths. +features.pathPrefix + +# If set, arm appends any log messages it reports while running to the given +# log file. This does not take filters into account or include prepopulated +# events. +features.logFile + +# If true, the header panel always shows the file descriptor usage. Otherwise +# this is only displayed when we're running out. +features.showFdUsage false + +# Seconds to wait on user input before refreshing content +features.redrawRate 5 + +# Rate (seconds) to periodically redraw the screen, disabled if zero. This +# shouldn't be necessary, but can correct issues if the terminal gets into a +# funky state. +features.refreshRate 5 + +# Confirms promt to confirm when quiting if true +features.confirmQuit true + +# Allows arm to start when there's no running tor instance if true, otherwise +# we terminate right away. This is ignored if the user provides an option +# specifying how to connect to tor (ie, a 'startup.interface.*' option or +# startup argument). +features.allowDetachedStartup true + +# Paremters for the log panel +# --------------------------- +# showDateDividers +# show borders with dates for entries from previous days +# showDuplicateEntries +# shows all log entries if true, otherwise collapses similar entries with an +# indicator for how much is being hidden +# entryDuration +# number of days log entries are kept before being dropped (if zero then +# they're kept until cropped due to caching limits) +# maxLinesPerEntry +# max number of lines to display for a single log entry +# prepopulate +# attempts to read past events from the log file if true +# prepopulateReadLimit +# maximum entries read from the log file, used to prevent huge log files from +# causing a slow startup time. +# maxRefreshRate +# rate limiting (in milliseconds) for drawing the log if updates are made +# rapidly (for instance, when at the DEBUG runlevel) +# regex +# preconfigured regular expression pattern, up to five will be loaded + +features.log.showDateDividers true +features.log.showDuplicateEntries false +features.log.entryDuration 7 +features.log.maxLinesPerEntry 6 +features.log.prepopulate true +features.log.prepopulateReadLimit 5000 +features.log.maxRefreshRate 300 +#features.log.regex My First Regex Pattern +#features.log.regex ^My Second Regex Pattern$ + +# Paremters for the config panel +# --------------------------- +# order +# three comma separated configuration attributes, options including: +# 0 -> Category, 1 -> Option Name, 2 -> Value, 3 -> Arg Type, +# 4 -> Arg Usage, 5 -> Summary, 6 -> Description, 7 -> Man Entry, +# 8 -> Is Default +# selectionDetails.height +# rows of data for the panel showing details on the current selection, this +# is disabled entirely if zero +# features.config.prepopulateEditValues +# when editing config values the current value is prepopulated if true, and +# left blank otherwise +# state.colWidth.* +# column content width +# state.showPrivateOptions +# tor provides config options of the form "__