From 9571c45634548727c94304890a584c108e0a46f1 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 8 Jun 2013 20:54:30 +0100 Subject: [PATCH] sanitize configuration files --- Netdisco/lib/App/Netdisco.pm | 4 +- .../lib/App/Netdisco/Manual/Configuration.pod | 4 +- .../lib/App/Netdisco/Manual/Developing.pod | 4 +- .../lib/App/Netdisco/Manual/ReleaseNotes.pod | 17 ++- Netdisco/share/config.yml | 127 +++++++++--------- Netdisco/share/environments/deployment.yml | 51 ++++--- Netdisco/share/environments/development.yml | 49 ------- TODO | 1 - 8 files changed, 111 insertions(+), 146 deletions(-) delete mode 100644 Netdisco/share/environments/development.yml diff --git a/Netdisco/lib/App/Netdisco.pm b/Netdisco/lib/App/Netdisco.pm index 32d60e69..717e8c8f 100644 --- a/Netdisco/lib/App/Netdisco.pm +++ b/Netdisco/lib/App/Netdisco.pm @@ -212,8 +212,8 @@ documentation for further information. =head2 Plugins -App::Netdisco includes a Plugin subsystem for customizing the web user -interface. See L for further information. +Netdisco includes a Plugin subsystem for customizing the web user interface. +See L for further information. =head2 Developing diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index e749b7ce..cc93de26 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -310,9 +310,9 @@ field to use as the management IP address for a device. =head3 C -Value: Boolean. Default: C. +Value: Boolean. Default: C. -Set to true to allow Netdisco to be able to change the default VLAN on an +Set to false to prevent Netdisco from changing the default VLAN on an interface. =head3 C diff --git a/Netdisco/lib/App/Netdisco/Manual/Developing.pod b/Netdisco/lib/App/Netdisco/Manual/Developing.pod index 524af458..6a31658d 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Developing.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Developing.pod @@ -242,8 +242,8 @@ port names). If you're working on code in the web application, it's possible to have the app restart itself each time you save a file in your editor. The following command will watch the C and C folder trees for changes, and you -probably want to switch to the C dancer configuration for -additional logging: +probably want to edit your C configuration to enable +additional logging (see L): DANCER_ENVIRONMENT=development DBIC_TRACE_PROFILE=console DBIC_TRACE=1 \ ~/bin/localenv starman -R lib,share bin/netdisco-web-fg diff --git a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod index 401dfddc..eaf738bd 100644 --- a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod +++ b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod @@ -4,10 +4,25 @@ App::Netdisco::Manual::ReleaseNotes - Release Notes =head1 Introduction -This document will list only the most important changes with each release of +This document will list only the most significant changes with each release of Netdisco. You are B recommended to read this document each time you install and upgrade. +=head1 2.008000 + +=head2 Heath Advice + +This release contains the first version of our new poller, which handles +device and node discovery. Please make sure to backup any existing Netdisco +database before trying it out. + +=head2 Other Changes + +You can remove any settings from C<~/environments/deployment.yml> which you +didn't edit or add to the file yourself. All defaults are now properly +embedded within the application. See the new C sample which +ships with this distribution for an example. + =head1 2.006000 =head2 Incompatible Changes diff --git a/Netdisco/share/config.yml b/Netdisco/share/config.yml index cf88dd50..3098c512 100644 --- a/Netdisco/share/config.yml +++ b/Netdisco/share/config.yml @@ -1,40 +1,27 @@ # This is the main configuration file for Netdisco web and daemon apps -# all the settings in this file will be loaded at Dancer's startup. +# +# DO NOT EDIT THIS FILE +# +# Overrides should go to ~/environments/deployment.yml +# See App::Netdisco::Manual::Configuration for explanations -# Web app env-related settings should go to environments/$env.yml +# ---------------- +# GENERAL SETTINGS +# ---------------- -# application's name -appname: "Netdisco" - -# The default web layout to use for your application (located in -# views/layouts/main.tt) -layout: "main" - -# when the charset is set to UTF-8 Dancer will handle for you -# all the magic of encoding and decoding. You should not care -# about unicode within your app when this setting is set (recommended). -charset: "UTF-8" - -# web sessions stored on disk -session: "YAML" - -# HTTP port to listen on -port: 5000 - -# logging format +log: 'warning' +logger: 'file' logger_format: '[%P] %L @%D> %m' -# web output template settings -template: "template_toolkit" -engines: - template_toolkit: - encoding: 'utf8' - start_tag: '[%' - end_tag: '%]' - PRE_CHOMP: 1 - -# Netdisco stuff (can be overidden in the environment .yml) +# ------------ +# WEB FRONTEND +# ------------ +domain_suffix: '' +no_auth: false +port: 5000 +path: '/' +behind_proxy: false web_plugins: - Inventory - Report::DuplexMismatch @@ -47,38 +34,29 @@ web_plugins: - Search::Port - Device::Details - Device::Ports -# - Device::Modules + # - Device::Modules - Device::Neighbors - Device::Addresses +web_plugins_extra: [] -discover_no: [] -discover_only: [] - -snmpver: 2 -snmpretries: 2 -snmptimeout: 1000000 - -# If unset, Netdisco uses "NETDISCO_HOME/netdisco-mibs", assuming you're -# using the netdisco-deploy script to download MIBs there. Otherwise, set -# this, for example: -# -# mibhome: /usr/share/netdisco/mibs - -# If unset, loads all MIBs in the mibhome directory. -# mibdirs: -# - cisco -# - rfc -# - net-snmp +# ------------- +# NETDISCO CORE +# ------------- +# mibhome is discovered from environment +# mibdirs defaults to contents of mibhome community: ['public'] community_rw: ['private'] - -# rights control for Interactive jobs -vlanctl: 1 -portctl_uplinks: 0 -portctl_nophones: 1 -portctl_vlans: 1 - +snmpver: 2 +snmptimeout: 1000000 +snmpretries: 2 +discover_no: [] +discover_only: [] +discover_no_type: [] +macsuck_all_vlans: false +macsuck_no_unnamed: false +macsuck_bleed: false +store_wireless_client: true ignore_interfaces: - 'EOBC' - 'unrouted VLAN' @@ -96,16 +74,23 @@ ignore_interfaces: - 'Virtual-Access\d+' - '(E|T)\d \d\/\d\/\d' - 'Vlan1' +ignore_private_nets: false +reverse_sysname: false +vlanctl: true +portctl_nophones: false +portctl_vlans: false +portctl_uplinks: false +no_port_control: false + +# -------------- +# BACKEND DAEMON +# -------------- workers: - # how many daemon processes for this node interactives: 2 pollers: 2 - # sleep time between polls of the database job queue sleep_time: 5 -# what housekeeping tasks should this node *schedule* -# (it only does them if workers->pollers is non-zero) #housekeeping: # discoverall: # when: '0 9 * * *' @@ -115,3 +100,23 @@ workers: # macwalk: # when: # hour: '*/2' + +# --------------- +# DANCER INTERNAL +# --------------- + +charset: 'UTF-8' +warnings: false +show_errors: false +engines: + template_toolkit: + encoding: 'utf8' + start_tag: '[%' + end_tag: '%]' + PRE_CHOMP: 1 +layout: 'main' +session: 'YAML' +template: 'template_toolkit' +route_cache: true +appname: 'Netdisco' + diff --git a/Netdisco/share/environments/deployment.yml b/Netdisco/share/environments/deployment.yml index 01711569..1917dae2 100644 --- a/Netdisco/share/environments/deployment.yml +++ b/Netdisco/share/environments/deployment.yml @@ -1,21 +1,13 @@ -# configuration file for production environment +# +# NETDISCO 2 CONFIGURATION FILE +# +# Settings in this file override share/config.yml +# See App::Netdisco::Manual::Configuration for more info. -# only log warning and error messsages -log: "warning" +# ------------------ +# ESSENTIAL SETTINGS +# ------------------ -# log message to a file in logs/ -logger: "file" - -# don't consider warnings critical -warnings: 0 - -# hide errors -show_errors: 0 - -# cache route resolution for maximum performance -route_cache: 1 - -# database connections plugins: DBIC: # alter dsn/user/pass for your local Netdisco DB @@ -28,20 +20,23 @@ plugins: RaiseError: 1 AutoCommit: 1 -# uncomment and set to 1 to disable authentication/login -# no_auth: 0 +# -------------------- +# RECOMMENDED SETTINGS +# -------------------- # will be stripped from fqdn when displayed in the web UI -# also, do not forget the leading dot -# domain_suffix: '.example.com' +# also, do not forget the leading dot. +# domain_suffix: '.example.com' -# local settings for Netdisco poller and port changes +# uncomment and set to true to disable authentication/login. +# no_auth: false -# If unset, loads all MIBs -# mibdirs: -# - cisco -# - rfc -# - net-snmp +# community: ['public'] +# community_rw: ['private'] + +# if unset, Netdisco loads all MIBs in mibhome directory. +# mibdirs: +# - cisco +# - rfc +# - net-snmp -community: ['public'] -community_rw: ['private'] diff --git a/Netdisco/share/environments/development.yml b/Netdisco/share/environments/development.yml deleted file mode 100644 index 9c08e46f..00000000 --- a/Netdisco/share/environments/development.yml +++ /dev/null @@ -1,49 +0,0 @@ -# configuration file for development environment - -# the logger engine to use -# console: log messages to STDOUT (your console where you started the -# application server) -# file: log message to a file in log/ -logger: "console" - -# the log level for this environement -# core is the lowest, it shows Dancer's core log messages as well as yours -# (debug, warning and error) -log: "debug" - -# should Dancer consider warnings as critical errors? -warnings: 1 - -# should Dancer show a stacktrace when an error is caught? -show_errors: 1 - -# database connections -plugins: - DBIC: - # alter dsn/user/pass for your local Netdisco DB - netdisco: - schema_class: 'App::Netdisco::DB' - dsn: 'dbi:Pg:dbname=netdisco;host=localhost' - user: 'netdisco' - pass: 'netdisco' - options: - RaiseError: 1 - AutoCommit: 1 - -# uncomment and set to 1 to disable authentication/login -no_auth: 1 - -# will be stripped from fqdn when displayed in the web UI -# also, do not forget the leading dot -# domain_suffix: '.example.com' - -# local settings for Netdisco poller and port changes - -mibdirs: - - cisco - - rfc - - net-snmp - -community: ['public'] -community_rw: ['private'] - diff --git a/TODO b/TODO index 32b215b2..6c27605d 100644 --- a/TODO +++ b/TODO @@ -32,4 +32,3 @@ DOCS * port column plugins * add css and js for plugin * site_plugins -* nd-import-topology