defaults.py 3.17 KB
Newer Older
1 2 3
#!/usr/bin/env python
#
# ULG - Universal Looking Glass
4
# (C) 2012 CZ.NIC, z.s.p.o.
5 6 7 8 9 10 11 12 13 14 15 16 17 18
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.

19 20 21
# Router config file
config_file = '/etc/ulg/config.py'

22
# HTML presentation settings
23
header = 'Universal looking glass'
24 25
refresh_interval = 5                             # interval of html refresh
usage_limit = 1                                  # maximum concurrently processed requests
26
range_step = 100                                 # number of table lines in the decorated output per page
27

28
# Default settings
29
always_start_thread = True # True is highly recommended
30
debug = True
31
rescan_on_display = False
32 33 34 35
persistent_storage_file = '/tmp/ulg.data'
session_dir = '/tmp'
usage_counter_file = '/tmp/ulg.lock'
log_file = '/tmp/ulg.log'
36
default_bird_sock = '/var/run/bird.ctl'
37
default_bird_sock_timeout = 30
38
default_bin_birdc = '/usr/sbin/birdc'
39
bin_whois = '/usr/bin/whois'
40
timeout = 180
41 42 43 44

# Template dir relative to the index.py script
template_dir = 'templates'
index_template_file = 'index.html'
45
whois_template_file = 'whois.html'
46
table_decorator_template_file = 'tabledecorator.html'
47 48 49

# Paths to external programs
bin_ssh = '/usr/bin/ssh'
50
bin_telnet = '/usr/bin/telnet'
51 52

# Output (localized) strings
53 54 55 56 57 58
STRING_ANY='any'
STRING_PARAMETER='Parameter'
STRING_COMMAND='Command'
STRING_ERROR_COMMANDRUN='Error encountered while preparing or running command'
STRING_BAD_PARAMS='Verification of command or parameters failed.'
STRING_SESSION_OVERLIMIT = "<em>Limit of maximum concurrently running sessions and/or queries has been reached. The command can not be executed now. Please try again later.</em>"
59
STRING_ARBITRARY_ERROR = "Error encountered. Operation aborted. See log for further details."
60 61
STRING_IPADDRESS = "IP address"
STRING_IPSUBNET = "IP subnet"
62 63 64
STRING_MACADDRESS = "MAC address"
STRING_NONEORINTORIPADDRESS = "None or Interface or IP address"
STRING_INTERFACE = "Interface"
65
STRING_SOCKET_TIMEOUT = "Socket communication timed out. See log."
66
STRING_PEERID = "Peer ID"
67
STRING_RTABLE = "Routing Table"
68
STRING_DETAILS = "Details of"
69
STRING_UNKNOWN = "(unknown)"
70 71
STRING_BGP_GRAPH='BGP graph'
STRING_BGP_GRAPH_ERROR='Error: Can not produce image out of the received output.'
72
STRING_EMPTY=' '
73 74 75

# URL generator functions
def getASNURL(asn):
76
    return 'https://apps.db.ripe.net/search/query.html?searchtext=%s&flags=C&sources=&grssources=RIPE;AFRINIC;APNIC;ARIN;LACNIC;JPIRR;RADB&inverse=&types=AUT_NUM' % asn
77 78 79

def getIPPrefixURL(prefix):
    return 'https://apps.db.ripe.net/search/query.html?searchtext=%s&flags=C&sources=&grssources=RIPE;AFRINIC;APNIC;ARIN;LACNIC;JPIRR;RADB&inverse=&types=INET6NUM;INETNUM' % prefix