make an App::Netdisco dist using Module::Install

This commit is contained in:
Oliver Gorwits
2012-12-17 18:31:16 +00:00
parent 6a0aa7864e
commit 05086e8b78
125 changed files with 428 additions and 127 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,4 @@
Netdisco/environments/*
Netdisco/share/environments/*
Netdisco/logs/*
*.swp
*.pid

View File

@@ -2,6 +2,7 @@
[NEW FEATURES]
* Relocate into App::Netdisco namespace
* Update OUI data when the DB schema is deployed/upgraded
2.00_008 - 2012-12-16

131
Netdisco/MANIFEST Normal file
View File

@@ -0,0 +1,131 @@
bin/nd-dbic-versions
bin/netdisco-daemon
bin/netdisco-db-deploy
bin/netdisco-web
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Scripts.pm
inc/Module/Install/Share.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/App/Netdisco.pm
lib/App/Netdisco/Daemon/DB.pm
lib/App/Netdisco/Daemon/DB/Result/Admin.pm
lib/App/Netdisco/Daemon/Worker/Interactive.pm
lib/App/Netdisco/Daemon/Worker/Interactive/DeviceActions.pm
lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm
lib/App/Netdisco/Daemon/Worker/Interactive/Util.pm
lib/App/Netdisco/Daemon/Worker/Manager.pm
lib/App/Netdisco/DB.pm
lib/App/Netdisco/DB/Result/Admin.pm
lib/App/Netdisco/DB/Result/Device.pm
lib/App/Netdisco/DB/Result/DeviceIp.pm
lib/App/Netdisco/DB/Result/DeviceModule.pm
lib/App/Netdisco/DB/Result/DevicePort.pm
lib/App/Netdisco/DB/Result/DevicePortLog.pm
lib/App/Netdisco/DB/Result/DevicePortPower.pm
lib/App/Netdisco/DB/Result/DevicePortSsid.pm
lib/App/Netdisco/DB/Result/DevicePortVlan.pm
lib/App/Netdisco/DB/Result/DevicePortWireless.pm
lib/App/Netdisco/DB/Result/DevicePower.pm
lib/App/Netdisco/DB/Result/DeviceRoute.pm
lib/App/Netdisco/DB/Result/DeviceVlan.pm
lib/App/Netdisco/DB/Result/Log.pm
lib/App/Netdisco/DB/Result/Node.pm
lib/App/Netdisco/DB/Result/NodeIp.pm
lib/App/Netdisco/DB/Result/NodeMonitor.pm
lib/App/Netdisco/DB/Result/NodeNbt.pm
lib/App/Netdisco/DB/Result/NodeWireless.pm
lib/App/Netdisco/DB/Result/Oui.pm
lib/App/Netdisco/DB/Result/Process.pm
lib/App/Netdisco/DB/Result/Session.pm
lib/App/Netdisco/DB/Result/Subnet.pm
lib/App/Netdisco/DB/Result/Topology.pm
lib/App/Netdisco/DB/Result/User.pm
lib/App/Netdisco/DB/Result/UserLog.pm
lib/App/Netdisco/DB/Result/Virtual/ActiveNode.pm
lib/App/Netdisco/DB/Result/Virtual/ActiveNodeWithAge.pm
lib/App/Netdisco/DB/Result/Virtual/DeviceLinks.pm
lib/App/Netdisco/DB/Result/Virtual/DevicePortVlanNative.pm
lib/App/Netdisco/DB/Result/Virtual/DevicePortVlanTagged.pm
lib/App/Netdisco/DB/Result/Virtual/NodeWithAge.pm
lib/App/Netdisco/DB/ResultSet/Device.pm
lib/App/Netdisco/DB/ResultSet/DevicePort.pm
lib/App/Netdisco/DB/ResultSet/Node.pm
lib/App/Netdisco/DB/ResultSet/NodeIp.pm
lib/App/Netdisco/DB/schema_versions/Netdisco-DB-1-2-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/Netdisco-DB-1-3-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/Netdisco-DB-1-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/Netdisco-DB-2-3-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/Netdisco-DB-2-PostgreSQL.sql
lib/App/Netdisco/DB/schema_versions/Netdisco-DB-3-PostgreSQL.sql
lib/App/Netdisco/Util/Connect.pm
lib/App/Netdisco/Util/DeviceProperties.pm
lib/App/Netdisco/Util/Permissions.pm
lib/App/Netdisco/Util/Web.pm
lib/App/Netdisco/Web.pm
lib/App/Netdisco/Web/AuthN.pm
lib/App/Netdisco/Web/Device.pm
lib/App/Netdisco/Web/Inventory.pm
lib/App/Netdisco/Web/PortControl.pm
lib/App/Netdisco/Web/Search.pm
Makefile.PL
MANIFEST This list of files
META.yml
share/config.yml
share/environments/development.yml
share/environments/production.yml
share/public/500.html
share/public/css/bootstrap.min.css
share/public/css/font-awesome.css
share/public/css/nd_print.css
share/public/css/netdisco.css
share/public/css/toastr.css
share/public/dispatch.cgi
share/public/dispatch.fcgi
share/public/font/fontawesome-webfont.eot
share/public/font/fontawesome-webfont.svg
share/public/font/fontawesome-webfont.ttf
share/public/font/fontawesome-webfont.woff
share/public/images/crystalclear_mag.png
share/public/images/diagona_settings.png
share/public/images/dusseldorf_settings.png
share/public/images/glyphicons_072_bookmark.png
share/public/images/matte_basic_pin.png
share/public/images/splashyfish_left.png
share/public/images/splashyfish_right.png
share/public/images/tango_sweep.png
share/public/images/vaga_copy.png
share/public/javascripts/bootstrap.min.js
share/public/javascripts/d3.min.js
share/public/javascripts/jquery-deserialize.js
share/public/javascripts/jquery-history.js
share/public/javascripts/jquery-latest.min.js
share/public/javascripts/netdisco.js
share/public/javascripts/netdisco_portcontrol.js
share/public/javascripts/toastr.js
share/views/ajax/device/addresses.tt
share/views/ajax/device/details.tt
share/views/ajax/device/netmap.tt
share/views/ajax/device/ports.tt
share/views/ajax/search/device.tt
share/views/ajax/search/node_by_ip.tt
share/views/ajax/search/node_by_mac.tt
share/views/ajax/search/port.tt
share/views/ajax/search/vlan.tt
share/views/device.tt
share/views/index.tt
share/views/inventory.tt
share/views/js/common.js
share/views/js/device.js
share/views/js/search.js
share/views/layouts/main.tt
share/views/report.tt
share/views/search.tt
share/views/sidebar/device/ports.tt
share/views/sidebar/search/device.tt
share/views/sidebar/search/node.tt

70
Netdisco/MANIFEST.SKIP Normal file
View File

@@ -0,0 +1,70 @@
\.bak$
\.pid$
\.swp$
^share/environments/(?!production|development)
test.pl
logs/.*
lib/auto/App/Netdisco
^MANIFEST\.
#!start included /home/oliver/perl-profiles/dancer/lib/perl5/ExtUtils/MANIFEST.SKIP
# Avoid version control files.
\bRCS\b
\bCVS\b
\bSCCS\b
,v$
\B\.svn\b
\B\.git\b
\B\.gitignore\b
\b_darcs\b
\B\.cvsignore$
# Avoid VMS specific MakeMaker generated files
\bDescrip.MMS$
\bDESCRIP.MMS$
\bdescrip.mms$
# Avoid Makemaker generated and utility files.
\bMANIFEST\.bak
\bMakefile$
\bblib/
\bMakeMaker-\d
\bpm_to_blib\.ts$
\bpm_to_blib$
\bblibdirs\.ts$ # 6.18 through 6.25 generated this
# Avoid Module::Build generated and utility files.
\bBuild$
\b_build/
\bBuild.bat$
\bBuild.COM$
\bBUILD.COM$
\bbuild.com$
# Avoid temp and backup files.
~$
\.old$
\#$
\b\.#
\.bak$
\.tmp$
\.#
\.rej$
# Avoid OS-specific files/dirs
# Mac OSX metadata
\B\.DS_Store
# Mac OSX SMB mount metadata files
\B\._
# Avoid Devel::Cover and Devel::CoverX::Covered files.
\bcover_db\b
\bcovered\b
# Avoid MYMETA files
^MYMETA\.
#!end included /home/oliver/perl-profiles/dancer/lib/perl5/ExtUtils/MANIFEST.SKIP

44
Netdisco/Makefile.PL Normal file
View File

@@ -0,0 +1,44 @@
use inc::Module::Install;
name 'App-Netdisco';
all_from 'lib/App/Netdisco.pm';
requires 'DBD::Pg' => 0;
requires 'DBD::SQLite' => 0;
requires 'DBIx::Class' => 0;
requires 'DBIx::Class::Helper::Row::SubClass' => 0;
requires 'Daemon::Generic' => 0;
requires 'Dancer' => 0;
requires 'Dancer::Plugin::DBIC' => 0;
requires 'File::ShareDir' => 0;
requires 'HTML::Entities' => 0;
requires 'HTTP::Tiny' => 0;
requires 'List::MoreUtils' => 0;
requires 'Net::MAC' => 0;
requires 'NetAddr::IP' => 0;
requires 'Path::Class' => 0;
requires 'Role::Tiny' => 0;
requires 'SNMP::Info' => 0;
requires 'SQL::Translator' => 0;
requires 'Socket6' => 0;
requires 'Template' => 0;
requires 'YAML' => 0;
requires 'namespace::clean' => 0;
install_share 'share';
install_script 'bin/nd-dbic-versions';
install_script 'bin/netdisco-daemon';
install_script 'bin/netdisco-db-deploy';
install_script 'bin/netdisco-web';
no_index directory => 'logs';
no_index directory => 'lib/auto';
resources
homepage => 'http://netdisco.org/',
bugtracker => 'http://sourceforge.net/tracker/?group_id=80033&atid=558508',
repository => 'git://netdisco.git.sourceforge.net/gitroot/netdisco/netdisco-ng',
MailingList => 'https://lists.sourceforge.net/lists/listinfo/netdisco-users';
WriteAll;

View File

@@ -1 +0,0 @@
../config.yml

View File

@@ -1,12 +1,13 @@
#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::Netdisco;
use Dancer ':script';
use Dancer::Plugin::DBIC 'schema';
use Netdisco::DB;
use App::Netdisco::DB;
use Getopt::Long;
=head1 nd-dbic-versions
@@ -22,10 +23,7 @@ specification.
=cut
schema('netdisco')->create_ddl_dir(
'PostgreSQL', $version, $sql_dir, $preversion );
my $sql_dir = $Netdisco::DB::schema_versions_dir;
my $sql_dir = $App::Netdisco::DB::schema_versions_dir;
my $version = schema('netdisco')->schema_version;
my ( $preversion, $help );
@@ -49,3 +47,7 @@ $sql_dir
ENDHELP
exit(1);
};
schema('netdisco')->create_ddl_dir(
'PostgreSQL', $version, $sql_dir, $preversion );

View File

@@ -1,5 +1,9 @@
#!/usr/bin/env perl
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::Netdisco;
use Dancer qw/:moose :script/;
use Dancer::Plugin::DBIC 'schema';
@@ -61,7 +65,7 @@ sub gd_run_body {
$pp->start(sub {
print STDERR ">>> new $next_role worker starting...\n";
with "Netdisco::Daemon::Worker::$next_role";
with "App::Netdisco::Daemon::Worker::$next_role";
$gd->worker_begin if $gd->can('worker_begin');
$gd->worker_body;
$gd->worker_end if $gd->can('worker_end');

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::Netdisco;
use Dancer ':script';
use Dancer::Plugin::DBIC 'schema';

View File

@@ -1,5 +1,9 @@
#!/usr/bin/env perl
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::Netdisco;
use Dancer;
use Netdisco::Web;
use App::Netdisco::Web;
dance;

View File

@@ -0,0 +1,44 @@
package App::Netdisco;
use strict;
use warnings FATAL => 'all';
use 5.10.0;
use File::ShareDir 'module_dir';
use Path::Class;
our $VERSION = '2.00_009';
BEGIN {
if (not length $ENV{DANCER_APPDIR}
or not -f file($ENV{DANCER_APPDIR}, 'config.yml')) {
my $auto = dir(File::ShareDir::module_dir('App::Netdisco'))->absolute;
$ENV{DANCER_APPDIR} ||= $auto->stringify;
$ENV{DANCER_CONFDIR} ||= $auto->stringify;
$ENV{DANCER_ENVDIR} ||= $auto->subdir('environments')->stringify;
$ENV{DANCER_PUBLIC} ||= $auto->subdir('public')->stringify;
$ENV{DANCER_VIEWS} ||= $auto->subdir('views')->stringify;
}
}
=head1 App::Netdisco
Netdisco is an Open Source web-based network management tool.
=head1 AUTHOR
Oliver Gorwits <oliver@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by The Netdisco Developer Team.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
1;

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB;
package App::Netdisco::DB;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -20,7 +20,7 @@ our $VERSION = 3; # schema version used for upgrades, keep as integer
use Path::Class;
use File::Basename;
my (undef, $libpath, undef) = fileparse( $INC{ 'Netdisco/DB.pm' } );
my (undef, $libpath, undef) = fileparse( $INC{ 'App/Netdisco/DB.pm' } );
our $schema_versions_dir = Path::Class::Dir->new($libpath)
->subdir("DB", "schema_versions")->stringify;

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Admin;
package App::Netdisco::DB::Result::Admin;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Device;
package App::Netdisco::DB::Result::Device;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -91,7 +91,7 @@ all the interface IP aliases configured on the Device.
=cut
__PACKAGE__->has_many( device_ips => 'Netdisco::DB::Result::DeviceIp', 'ip' );
__PACKAGE__->has_many( device_ips => 'App::Netdisco::DB::Result::DeviceIp', 'ip' );
=head2 vlans
@@ -100,7 +100,7 @@ configured on or known by this Device.
=cut
__PACKAGE__->has_many( vlans => 'Netdisco::DB::Result::DeviceVlan', 'ip' );
__PACKAGE__->has_many( vlans => 'App::Netdisco::DB::Result::DeviceVlan', 'ip' );
=head2 ports
@@ -108,7 +108,7 @@ Returns the set of ports on this Device.
=cut
__PACKAGE__->has_many( ports => 'Netdisco::DB::Result::DevicePort', 'ip' );
__PACKAGE__->has_many( ports => 'App::Netdisco::DB::Result::DevicePort', 'ip' );
=head2 port_vlans
@@ -121,7 +121,7 @@ only on Ports on this Device.
=cut
__PACKAGE__->has_many(
port_vlans => 'Netdisco::DB::Result::DevicePortVlan',
port_vlans => 'App::Netdisco::DB::Result::DevicePortVlan',
'ip', { join_type => 'RIGHT' }
);

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DeviceIp;
package App::Netdisco::DB::Result::DeviceIp;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -42,7 +42,7 @@ Returns the entry from the C<device> table to which this IP alias relates.
=cut
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip' );
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip' );
=head2 device_port
@@ -53,7 +53,7 @@ routed port or virtual interface).
__PACKAGE__->add_unique_constraint(['alias']);
__PACKAGE__->belongs_to( device_port => 'Netdisco::DB::Result::DevicePort',
__PACKAGE__->belongs_to( device_port => 'App::Netdisco::DB::Result::DevicePort',
{ 'foreign.port' => 'self.port', 'foreign.ip' => 'self.ip' } );
1;

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DeviceModule;
package App::Netdisco::DB::Result::DeviceModule;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DevicePort;
package App::Netdisco::DB::Result::DevicePort;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -72,7 +72,7 @@ Returns the Device table entry to which the given Port is related.
=cut
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip');
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip');
=head2 nodes / active_nodes / nodes_with_age / active_nodes_with_age
@@ -88,7 +88,7 @@ days/weeks/months/years".
=cut
__PACKAGE__->has_many( nodes => 'Netdisco::DB::Result::Node',
__PACKAGE__->has_many( nodes => 'App::Netdisco::DB::Result::Node',
{
'foreign.switch' => 'self.ip',
'foreign.port' => 'self.port',
@@ -96,7 +96,7 @@ __PACKAGE__->has_many( nodes => 'Netdisco::DB::Result::Node',
{ join_type => 'LEFT' },
);
__PACKAGE__->has_many( nodes_with_age => 'Netdisco::DB::Result::Virtual::NodeWithAge',
__PACKAGE__->has_many( nodes_with_age => 'App::Netdisco::DB::Result::Virtual::NodeWithAge',
{
'foreign.switch' => 'self.ip',
'foreign.port' => 'self.port',
@@ -104,7 +104,7 @@ __PACKAGE__->has_many( nodes_with_age => 'Netdisco::DB::Result::Virtual::NodeWit
{ join_type => 'LEFT' },
);
__PACKAGE__->has_many( active_nodes => 'Netdisco::DB::Result::Virtual::ActiveNode',
__PACKAGE__->has_many( active_nodes => 'App::Netdisco::DB::Result::Virtual::ActiveNode',
{
'foreign.switch' => 'self.ip',
'foreign.port' => 'self.port',
@@ -112,7 +112,7 @@ __PACKAGE__->has_many( active_nodes => 'Netdisco::DB::Result::Virtual::ActiveNod
{ join_type => 'LEFT' },
);
__PACKAGE__->has_many( active_nodes_with_age => 'Netdisco::DB::Result::Virtual::ActiveNodeWithAge',
__PACKAGE__->has_many( active_nodes_with_age => 'App::Netdisco::DB::Result::Virtual::ActiveNodeWithAge',
{
'foreign.switch' => 'self.ip',
'foreign.port' => 'self.port',
@@ -132,7 +132,7 @@ database.
=cut
__PACKAGE__->belongs_to( neighbor_alias => 'Netdisco::DB::Result::DeviceIp',
__PACKAGE__->belongs_to( neighbor_alias => 'App::Netdisco::DB::Result::DeviceIp',
{ 'foreign.alias' => 'self.remote_ip' },
{ join_type => 'LEFT' },
);
@@ -144,7 +144,7 @@ device port.
=cut
__PACKAGE__->might_have( power => 'Netdisco::DB::Result::DevicePortPower', {
__PACKAGE__->might_have( power => 'App::Netdisco::DB::Result::DevicePortPower', {
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
});
@@ -155,7 +155,7 @@ port, where the VLANs are all tagged.
=cut
__PACKAGE__->has_many( port_vlans_tagged => 'Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
__PACKAGE__->has_many( port_vlans_tagged => 'App::Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
{
'foreign.ip' => 'self.ip',
'foreign.port' => 'self.port',
@@ -185,7 +185,7 @@ The JOIN is of type LEFT, in case the OUI table has not been populated.
=cut
__PACKAGE__->belongs_to( oui => 'Netdisco::DB::Result::Oui',
__PACKAGE__->belongs_to( oui => 'App::Netdisco::DB::Result::Oui',
sub {
my $args = shift;
return {

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DevicePortLog;
package App::Netdisco::DB::Result::DevicePortLog;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DevicePortPower;
package App::Netdisco::DB::Result::DevicePortPower;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -39,7 +39,7 @@ Returns the entry from the C<port> table for which this Power entry applies.
=cut
__PACKAGE__->belongs_to( port => 'Netdisco::DB::Result::DevicePort', {
__PACKAGE__->belongs_to( port => 'App::Netdisco::DB::Result::DevicePort', {
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
});

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DevicePortSsid;
package App::Netdisco::DB::Result::DevicePortSsid;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DevicePortVlan;
package App::Netdisco::DB::Result::DevicePortVlan;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -50,7 +50,7 @@ VLAN is configured.
=cut
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip' );
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip' );
=head2 port
@@ -58,7 +58,7 @@ Returns the entry from the C<port> table on which this VLAN is configured.
=cut
__PACKAGE__->belongs_to( port => 'Netdisco::DB::Result::DevicePort', {
__PACKAGE__->belongs_to( port => 'App::Netdisco::DB::Result::DevicePort', {
'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port',
});
@@ -69,7 +69,7 @@ detail, typically in order that the C<name> can be retrieved.
=cut
__PACKAGE__->belongs_to( vlan => 'Netdisco::DB::Result::DeviceVlan', {
__PACKAGE__->belongs_to( vlan => 'App::Netdisco::DB::Result::DeviceVlan', {
'foreign.ip' => 'self.ip', 'foreign.vlan' => 'self.vlan',
});

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DevicePortWireless;
package App::Netdisco::DB::Result::DevicePortWireless;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DevicePower;
package App::Netdisco::DB::Result::DevicePower;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DeviceRoute;
package App::Netdisco::DB::Result::DeviceRoute;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::DeviceVlan;
package App::Netdisco::DB::Result::DeviceVlan;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -45,7 +45,7 @@ Returns the entry from the C<device> table on which this VLAN entry was discover
=cut
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device', 'ip' );
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device', 'ip' );
=head2 port_vlans_tagged
@@ -53,7 +53,7 @@ Link relationship for C<tagging_ports>, see below.
=cut
__PACKAGE__->has_many( port_vlans_tagged => 'Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
__PACKAGE__->has_many( port_vlans_tagged => 'App::Netdisco::DB::Result::Virtual::DevicePortVlanTagged',
{ 'foreign.ip' => 'self.ip', 'foreign.vlan' => 'self.vlan' },
);
@@ -63,7 +63,7 @@ Link relationship to support C<native_ports>, see below.
=cut
__PACKAGE__->has_many( port_vlans_native => 'Netdisco::DB::Result::Virtual::DevicePortVlanNative',
__PACKAGE__->has_many( port_vlans_native => 'App::Netdisco::DB::Result::Virtual::DevicePortVlanNative',
{ 'foreign.ip' => 'self.ip', 'foreign.vlan' => 'self.vlan' },
);

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Log;
package App::Netdisco::DB::Result::Log;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Node;
package App::Netdisco::DB::Result::Node;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -60,7 +60,7 @@ database but the relation is being used in C<search()>.
=cut
__PACKAGE__->belongs_to( device => 'Netdisco::DB::Result::Device',
__PACKAGE__->belongs_to( device => 'App::Netdisco::DB::Result::Device',
{ 'foreign.ip' => 'self.switch' }, { join_type => 'LEFT' } );
=head2 device_port
@@ -74,7 +74,7 @@ database but the relation is being used in C<search()>.
=cut
# device port may have been deleted (reconfigured modules?) but node remains
__PACKAGE__->belongs_to( device_port => 'Netdisco::DB::Result::DevicePort',
__PACKAGE__->belongs_to( device_port => 'App::Netdisco::DB::Result::DevicePort',
{ 'foreign.ip' => 'self.switch', 'foreign.port' => 'self.port' },
{ join_type => 'LEFT' }
);
@@ -89,7 +89,7 @@ the current Node's.
=cut
__PACKAGE__->has_many( ips => 'Netdisco::DB::Result::NodeIp',
__PACKAGE__->has_many( ips => 'App::Netdisco::DB::Result::NodeIp',
{ 'foreign.mac' => 'self.mac', 'foreign.active' => 'self.active' } );
=head2 oui
@@ -101,7 +101,7 @@ The JOIN is of type LEFT, in case the OUI table has not been populated.
=cut
__PACKAGE__->belongs_to( oui => 'Netdisco::DB::Result::Oui', 'oui',
__PACKAGE__->belongs_to( oui => 'App::Netdisco::DB::Result::Oui', 'oui',
{ join_type => 'LEFT' } );
=head1 ADDITIONAL COLUMNS

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::NodeIp;
package App::Netdisco::DB::Result::NodeIp;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
@@ -50,7 +50,7 @@ The JOIN is of type LEFT, in case the OUI table has not been populated.
=cut
__PACKAGE__->belongs_to( oui => 'Netdisco::DB::Result::Oui',
__PACKAGE__->belongs_to( oui => 'App::Netdisco::DB::Result::Oui',
sub {
my $args = shift;
return {
@@ -77,7 +77,7 @@ include independent C<active> fields.
=cut
__PACKAGE__->has_many( node_ips => 'Netdisco::DB::Result::NodeIp',
__PACKAGE__->has_many( node_ips => 'App::Netdisco::DB::Result::NodeIp',
{ 'foreign.mac' => 'self.mac' } );
=head2 nodes
@@ -93,7 +93,7 @@ See also the C<node_sightings> helper routine, below.
=cut
__PACKAGE__->has_many( nodes => 'Netdisco::DB::Result::Node',
__PACKAGE__->has_many( nodes => 'App::Netdisco::DB::Result::Node',
{ 'foreign.mac' => 'self.mac' } );
my $search_attr = {

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::NodeMonitor;
package App::Netdisco::DB::Result::NodeMonitor;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::NodeNbt;
package App::Netdisco::DB::Result::NodeNbt;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::NodeWireless;
package App::Netdisco::DB::Result::NodeWireless;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Oui;
package App::Netdisco::DB::Result::Oui;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Process;
package App::Netdisco::DB::Result::Process;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Session;
package App::Netdisco::DB::Result::Session;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Subnet;
package App::Netdisco::DB::Result::Subnet;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::Topology;
package App::Netdisco::DB::Result::Topology;
use strict;
use warnings;

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::User;
package App::Netdisco::DB::Result::User;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::DB::Result::UserLog;
package App::Netdisco::DB::Result::UserLog;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

View File

@@ -1,10 +1,10 @@
use utf8;
package Netdisco::DB::Result::Virtual::ActiveNode;
package App::Netdisco::DB::Result::Virtual::ActiveNode;
use strict;
use warnings;
use base 'Netdisco::DB::Result::Node';
use base 'App::Netdisco::DB::Result::Node';
__PACKAGE__->load_components('Helper::Row::SubClass');
__PACKAGE__->subclass;

View File

@@ -1,10 +1,10 @@
use utf8;
package Netdisco::DB::Result::Virtual::ActiveNodeWithAge;
package App::Netdisco::DB::Result::Virtual::ActiveNodeWithAge;
use strict;
use warnings;
use base 'Netdisco::DB::Result::Virtual::ActiveNode';
use base 'App::Netdisco::DB::Result::Virtual::ActiveNode';
__PACKAGE__->load_components('Helper::Row::SubClass');
__PACKAGE__->subclass;

View File

@@ -1,4 +1,4 @@
package Netdisco::DB::Result::Virtual::DeviceLinks;
package App::Netdisco::DB::Result::Virtual::DeviceLinks;
use strict;
use warnings;

View File

@@ -1,10 +1,10 @@
use utf8;
package Netdisco::DB::Result::Virtual::DevicePortVlanNative;
package App::Netdisco::DB::Result::Virtual::DevicePortVlanNative;
use strict;
use warnings;
use base 'Netdisco::DB::Result::DevicePortVlan';
use base 'App::Netdisco::DB::Result::DevicePortVlan';
__PACKAGE__->load_components('Helper::Row::SubClass');
__PACKAGE__->subclass;

View File

@@ -1,10 +1,10 @@
use utf8;
package Netdisco::DB::Result::Virtual::DevicePortVlanTagged;
package App::Netdisco::DB::Result::Virtual::DevicePortVlanTagged;
use strict;
use warnings;
use base 'Netdisco::DB::Result::DevicePortVlan';
use base 'App::Netdisco::DB::Result::DevicePortVlan';
__PACKAGE__->load_components('Helper::Row::SubClass');
__PACKAGE__->subclass;

View File

@@ -1,10 +1,10 @@
use utf8;
package Netdisco::DB::Result::Virtual::NodeWithAge;
package App::Netdisco::DB::Result::Virtual::NodeWithAge;
use strict;
use warnings;
use base 'Netdisco::DB::Result::Node';
use base 'App::Netdisco::DB::Result::Node';
__PACKAGE__->load_components('Helper::Row::SubClass');
__PACKAGE__->subclass;

View File

@@ -1,4 +1,4 @@
package Netdisco::DB::ResultSet::Device;
package App::Netdisco::DB::ResultSet::Device;
use base 'DBIx::Class::ResultSet';
use strict;

View File

@@ -1,4 +1,4 @@
package Netdisco::DB::ResultSet::DevicePort;
package App::Netdisco::DB::ResultSet::DevicePort;
use base 'DBIx::Class::ResultSet';
use strict;

View File

@@ -1,4 +1,4 @@
package Netdisco::DB::ResultSet::Node;
package App::Netdisco::DB::ResultSet::Node;
use base 'DBIx::Class::ResultSet';
use strict;

View File

@@ -1,4 +1,4 @@
package Netdisco::DB::ResultSet::NodeIp;
package App::Netdisco::DB::ResultSet::NodeIp;
use base 'DBIx::Class::ResultSet';
use strict;

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::Daemon::DB;
package App::Netdisco::Daemon::DB;
use strict;
use warnings;
@@ -13,7 +13,7 @@ our $VERSION = 1; # schema version used for upgrades, keep as integer
use Path::Class;
use File::Basename;
my (undef, $libpath, undef) = fileparse( $INC{ 'Netdisco/Daemon/DB.pm' } );
my (undef, $libpath, undef) = fileparse( $INC{ 'App/Netdisco/Daemon/DB.pm' } );
our $schema_versions_dir = Path::Class::Dir->new($libpath)
->subdir("DB", "schema_versions")->stringify;

View File

@@ -1,5 +1,5 @@
use utf8;
package Netdisco::Daemon::DB::Result::Admin;
package App::Netdisco::Daemon::DB::Result::Admin;
use strict;
use warnings;

View File

@@ -1,4 +1,4 @@
package Netdisco::Daemon::Worker::Interactive;
package App::Netdisco::Daemon::Worker::Interactive;
use Dancer qw/:moose :syntax :script/;
use Dancer::Plugin::DBIC 'schema';
@@ -8,8 +8,8 @@ use Role::Tiny;
use namespace::clean;
# add dispatch methods for interactive actions
with 'Netdisco::Daemon::Worker::Interactive::DeviceActions',
'Netdisco::Daemon::Worker::Interactive::PortActions';
with 'App::Netdisco::Daemon::Worker::Interactive::DeviceActions',
'App::Netdisco::Daemon::Worker::Interactive::PortActions';
sub worker_body {
my $self = shift;

View File

@@ -1,7 +1,7 @@
package Netdisco::Daemon::Worker::Interactive::DeviceActions;
package App::Netdisco::Daemon::Worker::Interactive::DeviceActions;
use Netdisco::Util::Connect qw/snmp_connect get_device/;
use Netdisco::Daemon::Worker::Interactive::Util ':all';
use App::Netdisco::Util::Connect qw/snmp_connect get_device/;
use App::Netdisco::Daemon::Worker::Interactive::Util ':all';
use Role::Tiny;
use namespace::clean;

View File

@@ -1,8 +1,8 @@
package Netdisco::Daemon::Worker::Interactive::PortActions;
package App::Netdisco::Daemon::Worker::Interactive::PortActions;
use Netdisco::Util::Connect ':all';
use Netdisco::Util::Permissions ':all';
use Netdisco::Daemon::Worker::Interactive::Util ':all';
use App::Netdisco::Util::Connect ':all';
use App::Netdisco::Util::Permissions ':all';
use App::Netdisco::Daemon::Worker::Interactive::Util ':all';
use Role::Tiny;
use namespace::clean;

View File

@@ -1,4 +1,4 @@
package Netdisco::Daemon::Worker::Interactive::Util;
package App::Netdisco::Daemon::Worker::Interactive::Util;
# support utilities for Daemon Actions

View File

@@ -1,9 +1,9 @@
package Netdisco::Daemon::Worker::Manager;
package App::Netdisco::Daemon::Worker::Manager;
use Dancer qw/:moose :syntax :script/;
use Dancer::Plugin::DBIC 'schema';
use Netdisco::Util::DeviceProperties 'is_discoverable';
use App::Netdisco::Util::DeviceProperties 'is_discoverable';
use Try::Tiny;
use Role::Tiny;

View File

@@ -1,4 +1,4 @@
package Netdisco::Util::Connect;
package App::Netdisco::Util::Connect;
use Dancer qw/:syntax :script/;
use Dancer::Plugin::DBIC 'schema';
@@ -17,7 +17,7 @@ our %EXPORT_TAGS = (
/],
);
=head1 Netdisco::Util::Connect
=head1 App::Netdisco::Util::Connect
A set of helper subroutines to support parts of the Netdisco application.

View File

@@ -1,4 +1,4 @@
package Netdisco::Util::DeviceProperties;
package App::Netdisco::Util::DeviceProperties;
use Dancer qw/:syntax :script/;
use Dancer::Plugin::DBIC 'schema';
@@ -18,7 +18,7 @@ our %EXPORT_TAGS = (
/],
);
=head1 Netdisco::Util::DeviceProperties;
=head1 App::Netdisco::Util::DeviceProperties;
A set of helper subroutines to support parts of the Netdisco application.

View File

@@ -1,9 +1,9 @@
package Netdisco::Util::Permissions;
package App::Netdisco::Util::Permissions;
use Dancer qw/:syntax :script/;
use Dancer::Plugin::DBIC 'schema';
use Netdisco::Util::DeviceProperties ':all';
use App::Netdisco::Util::DeviceProperties ':all';
use base 'Exporter';
our @EXPORT = ();
@@ -16,7 +16,7 @@ our %EXPORT_TAGS = (
/],
);
=head1 Netdisco::Util::Permissions
=head1 App::Netdisco::Util::Permissions
A set of helper subroutines to support parts of the Netdisco application.

View File

@@ -1,4 +1,4 @@
package Netdisco::Util::Web;
package App::Netdisco::Util::Web;
use base 'Exporter';
our @EXPORT = ();
@@ -11,7 +11,7 @@ our %EXPORT_TAGS = (
/],
);
=head1 Netdisco::Util::Web
=head1 App::Netdisco::Util::Web
A set of helper subroutines to support parts of the Netdisco application.

View File

@@ -1,4 +1,4 @@
package Netdisco::Web;
package App::Netdisco::Web;
use Dancer ':syntax';
use Dancer::Plugin::Ajax;
@@ -9,11 +9,11 @@ use Socket6 (); # to ensure dependency is met
use HTML::Entities (); # to ensure dependency is met
use URI::QueryParam (); # part of URI, to add helper methods
use Netdisco::Web::AuthN;
use Netdisco::Web::Search;
use Netdisco::Web::Device;
use Netdisco::Web::PortControl;
use Netdisco::Web::Inventory;
use App::Netdisco::Web::AuthN;
use App::Netdisco::Web::Search;
use App::Netdisco::Web::Device;
use App::Netdisco::Web::PortControl;
use App::Netdisco::Web::Inventory;
hook 'before_template' => sub {
my $tokens = shift;

View File

@@ -1,4 +1,4 @@
package Netdisco::Web::AuthN;
package App::Netdisco::Web::AuthN;
use Dancer ':syntax';
use Dancer::Plugin::DBIC;

View File

@@ -1,11 +1,11 @@
package Netdisco::Web::Device;
package App::Netdisco::Web::Device;
use Dancer ':syntax';
use Dancer::Plugin::Ajax;
use Dancer::Plugin::DBIC;
use NetAddr::IP::Lite ':lower';
use Netdisco::Util::Web (); # for sort_port
use App::Netdisco::Util::Web (); # for sort_port
hook 'before' => sub {
# list of port detail columns
@@ -241,7 +241,7 @@ ajax '/ajax/content/device/ports' => sub {
if param('c_neighbors');
# sort ports (empty set would be a 'no records' msg)
my $results = [ sort { &Netdisco::Util::Web::sort_port($a->port, $b->port) } $set->all ];
my $results = [ sort { &App::Netdisco::Util::Web::sort_port($a->port, $b->port) } $set->all ];
return unless scalar @$results;
content_type('text/html');

View File

@@ -1,4 +1,4 @@
package Netdisco::Web::Inventory;
package App::Netdisco::Web::Inventory;
use Dancer ':syntax';
use Dancer::Plugin::DBIC;

View File

@@ -1,4 +1,4 @@
package Netdisco::Web::PortControl;
package App::Netdisco::Web::PortControl;
use Dancer ':syntax';
use Dancer::Plugin::Ajax;

View File

@@ -1,4 +1,4 @@
package Netdisco::Web::Search;
package App::Netdisco::Web::Search;
use Dancer ':syntax';
use Dancer::Plugin::Ajax;

View File

@@ -0,0 +1 @@
../../../share

View File

@@ -22,7 +22,7 @@ plugins:
DBIC:
# alter dsn/user/pass for your local Netdisco DB
netdisco:
schema_class: 'Netdisco::DB'
schema_class: 'App::Netdisco::DB'
dsn: 'dbi:Pg:dbname=netdisco;host=localhost'
user: 'netdisco'
pass: 'netdisco'
@@ -32,7 +32,7 @@ plugins:
# please do not change/remove this schema unless you
# know what you're doing!
daemon:
schema_class: 'Netdisco::Daemon::DB'
schema_class: 'App::Netdisco::Daemon::DB'
dsn: 'dbi:SQLite:dbname=/tmp/netdisco-daemon.db'
options:
RaiseError: 1

View File

@@ -20,7 +20,7 @@ plugins:
DBIC:
# alter dsn/user/pass for your local Netdisco DB
netdisco:
schema_class: 'Netdisco::DB'
schema_class: 'App::Netdisco::DB'
dsn: 'dbi:Pg:dbname=netdisco;host=localhost'
user: 'changeme'
pass: 'netdisco'
@@ -30,7 +30,7 @@ plugins:
# please do not change/remove this schema unless you
# know what you're doing!
daemon:
schema_class: 'Netdisco::Daemon::DB'
schema_class: 'App::Netdisco::Daemon::DB'
dsn: 'dbi:SQLite:dbname=/tmp/netdisco-daemon.db'
options:
RaiseError: 1

View File

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

View File

Before

Width:  |  Height:  |  Size: 1001 B

After

Width:  |  Height:  |  Size: 1001 B

View File

Before

Width:  |  Height:  |  Size: 819 B

After

Width:  |  Height:  |  Size: 819 B

View File

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 671 B

View File

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 773 B

View File

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

Some files were not shown because too many files have changed in this diff Show More