Compare commits

..

No commits in common. "main" and "v1.0.0-beta.70" have entirely different histories.

634 changed files with 40056 additions and 66323 deletions

View file

@ -1,44 +0,0 @@
hyperglass/hyperglass/static
**/node_modules
**/node_modules/.pnpm
.DS_Store
hyperglass/ui/.env*
hyperglass.json
custom.*[js, html]
.next
out/
fonts/
__pycache__
.python-version
.venv
.mypy_cache
.pytest_cache
.ruff_cache
*.so
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
*.rdb
*.py[cod]
.ipynb*

23
.flake8 Normal file
View file

@ -0,0 +1,23 @@
[flake8]
max-line-length=88
count=True
show-source=False
statistics=True
exclude=.git, __pycache__, hyperglass/api/examples/*.py, hyperglass/compat/_sshtunnel.py, test.py
filename=*.py
per-file-ignores=
hyperglass/main.py:E402
# Disable classmethod warning for validator decorators
hyperglass/models/*.py:N805,E0213,R0903,E501,C0301
hyperglass/models/api/*.py:N805,E0213,R0903,E501,C0301
hyperglass/models/commands/*.py:N805,E0213,R0903,E501,C0301
hyperglass/parsing/models/*.py:N805,E0213,R0903
hyperglass/configuration/models/*.py:N805,E0213,R0903,E501,C0301
# Disable unused import warning for modules
hyperglass/*/__init__.py:F401
hyperglass/models/*/__init__.py:F401
ignore=W503,C0330,R504,D202,S403,S301
select=B, BLK, C, D, E, F, I, II, N, P, PIE, S, R, W
disable-noqa=False
hang-closing=False
max-complexity=10

View file

@ -0,0 +1,30 @@
---
name: Feature Request
about: Suggest an idea for this project
labels: enhancement
assignees: checktheroads
---
<!--
If the answer to any of these questions is "no", your feature request will most likely be rejected (but will still be considered).
- Is the new feature only applicable to one Network Operating System (https://hyperglass.io/docs/platforms)?
- Would the new feature work only on mobile, or only on desktop?
- Would the new feature only support IPv4, or IPv6?
- Is the new feature something that can be reasonably customized by hyperglass end-users?
-->
# Feature Description
<!-- Describe the solution or change you would like. -->
### Is your feature request related to a problem? Please describe.
<!-- If yes, a clear and concise description of what the problem is. -->
# Environment & Use Case
<!-- Describe your use case for hyperglass, the environment on which it runs, the predominant network device type, and any other relevant details. -->
# Additional Context
<!-- Add any other context or screenshots about the feature request here. -->

View file

@ -1,49 +0,0 @@
name: Feature Request
description: Suggest an idea for hyperglass
labels:
- feature
assignees:
- thatmattlove
body:
- type: markdown
attributes:
value: >
If the answer to any of these questions is "no", your feature request will most likely be rejected (but may still be considered).
- Is the new feature _only_ applicable to one [platform](https://hyperglass.dev/platforms)?
- Would the new feature work only on mobile, or only on desktop?
- Would the new feature only support IPv4, or IPv6?
- Is the new feature something that can be reasonably customized by hyperglass users?
- type: input
id: version
attributes:
label: Version
description: What version of hyperglass are you currently running?
placeholder: v2.0.4
validations:
required: true
- type: textarea
id: feature-details
attributes:
label: Feature Details
description: Describe the solution or change you would like in detail.
validations:
required: true
- type: dropdown
id: feature-type
validations:
required: true
attributes:
label: Feature Type
multiple: true
options:
- New Platform
- Web UI
- New Functionality
- Change to Existing Functionality
- type: textarea
id: use-case
validations:
required: true
attributes:
label: Use Case
description: How will this feature benefit hyperglass users (providers, end-users, or both)?

63
.github/ISSUE_TEMPLATE/2-bug-report.md vendored Normal file
View file

@ -0,0 +1,63 @@
---
name: Bug Report
about: Report a problem or unexpected behavior
labels: bug
assignees: checktheroads
---
<!-- Please provide a general summary of the issue in the Title. -->
# Bug Description
<!-- A clear and concise description of the bug. -->
# Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
# Steps to Reproduce
<!-- Provide steps necessary to reproduce this issue. -->
## Local Configurations
<!-- If possible, please a link to a live example and the relevant sections of your hyperglass.yaml, commands.yaml, or devices.yaml in a code block. -->
```
<configs>
```
## Logs
<!-- If an error occurred, please paste the relevant error message(s) in the below code block. -->
```
<logs>
```
# Possible Solution
<!-- If you think you know what would fix this, please share your ideas. -->
# Environment
## Server
<!-- Please paste the output from `hyperglass system-info` below: (available in 1.0.0-beta.52+) -->
<!-- If, for some reason, that doesn't work, please include the following:
- OS:
- Python Version:
- hyperglass Version:
-->
## Client
- OS & Version: <!-- (e.g. Windows 10, macOS 10.15, Ubuntu Linux 18.04) -->
- Browser: <!-- (e.g. Chrome, Safari, Firefox, etc.) -->
### Smartphone Details (if applicable)
- Device: <!-- (e.g. iPhone, Samsung) -->
- OS: <!-- (e.g. iOS 13.1, Android 11) -->
- Browser: <!-- (e.g. Safari, Chrome) -->

View file

@ -1,98 +0,0 @@
name: Bug Report
description: Report a problem or unexpected behavior
labels:
- possible-bug
assignees:
- thatmattlove
body:
- type: dropdown
id: deployment-type
validations:
required: true
attributes:
label: Deployment Type
description: How are you running hyperglass?
multiple: false
options:
- Docker
- Manual
- Other (please explain)
- type: input
id: version
attributes:
label: Version
description: What version of hyperglass are you currently running?
placeholder: v2.0.4
validations:
required: true
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: Steps to Reproduce
description: >
Describe in detail the exact steps one can take to reproduce this bug.
If reporting a UI bug, be sure to include screenshots, browser version, and operating system and platform.
If you've deployed hyperglass manually, be sure to include Python and NodeJS versions.
placeholder: |
1. Click the thing
2. Type the stuff
3. See the error
- type: textarea
id: expected-behavior
validations:
required: true
attributes:
label: Expected Behavior
description: What did you expect to happen?
placeholder: A thing should have happened.
- type: textarea
id: observed-behavior
validations:
required: true
attributes:
label: Observed Behavior
description: What actually happened?
placeholder: An error was shown.
- type: textarea
id: configuration
attributes:
label: Configuration
description: hyperglass [config](https://hyperglass.dev/configuration/config) file in YAML format.
placeholder: |
org_name: Beloved Hyperglass User
plugins: []
primary_asn: 65000
request_timeout: 90
site_description: Beloved Hyperglass User Network Looking Glass
site_title: Beloved Hyperglass User
render: yaml
- type: textarea
id: devices
attributes:
label: Devices
description: >
hyperglass [devices](https://hyperglass.dev/configuration/devices) file in YAML format
**with passwords obfuscated or removed**.
placeholder: |
devices:
- name: New York, NY
address: 192.0.2.1
platform: cisco_ios
credential:
username: ***
password: ***
- name: San Francisco, CA
address: 192.0.2.2
platform: juniper
credential:
username: ***
password: ***
render: yaml
- type: textarea
id: logs
attributes:
label: Logs
description: Include any relevant log messages related to the bug.
render: console

View file

@ -1,5 +1 @@
blank_issues_enabled: false
contact_links:
- name: Contributing Policy
url: https://github.com/thatmattlove/hyperglass/blob/main/CONTRIBUTING.md
about: Please read through the contributing policy before opening an issue or pull request.
blank_issues_enabled: true

View file

@ -1,4 +1,4 @@
<!-- PLEASE CONSULT CONTRIBUTING POLICY PRIOR TO WORKING ON HYPERGLASS -->
<!-- PLEASE CONSULT CONTRIBUTING.MD PRIOR TO WORKING ON HYPERGLASS -->
<!-- Provide a general summary of your changes in the Title. -->

View file

@ -1,71 +1,48 @@
name: Backend Testing
on:
push:
paths:
- hyperglass/**
- .github/**
pull_request:
on: [push, pull_request]
jobs:
backend:
name: Backend Tests
strategy:
fail-fast: false
matrix:
node-version: [20.x]
pnpm-version: [8]
redis-version: [latest]
python-version: ["3.11", "3.12"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
backend:
name: Backend Tests
strategy:
fail-fast: false
matrix:
node-version: [14.x]
redis-version: [5, 6]
poetry-version: [1.1.4]
python-version: [3.6, 3.8]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Git Checkout
uses: actions/checkout@v3
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Rye
uses: sksat/setup-rye@v0.23.1
- name: Install Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install PNPM
uses: pnpm/action-setup@v3
with:
version: ${{ matrix.pnpm-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.1.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Install Python Dependencies
run: poetry install
- name: Prepare
run: |
mkdir -p "$HOME/hyperglass"
echo "HYPERGLASS_APP_PATH=$HOME/hyperglass" >> $GITHUB_ENV
echo "HYPERGLASS_HOST=127.0.0.1" >> $GITHUB_ENV
echo "HYPERGLASS_PORT=8001" >> $GITHUB_ENV
- name: Run Flake8
run: poetry run flake8 hyperglass
- name: Install
run: rye sync
- name: Activate virtualenv
run: |
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Lint (Rye)
run: rye lint
- name: Tests (PyTest)
run: pytest hyperglass --ignore hyperglass/plugins/external
- name: Run hyperglass
run: ".tests/ga-backend-app.sh"
- name: Run hyperglass
run: '.tests/ga-backend-app.sh'

View file

@ -1,57 +1,35 @@
name: Frontend Testing
on:
push:
paths:
- hyperglass/ui/**
- .github/**
pull_request:
on: [push, pull_request]
jobs:
frontend:
name: Frontend Tests
strategy:
fail-fast: false
matrix:
node-version: [20.x]
pnpm-version: [8]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
working-directory: ./hyperglass/ui
steps:
- name: Git Checkout
uses: actions/checkout@v3
frontend:
name: Frontend Tests
strategy:
fail-fast: false
matrix:
node-version: [14.x]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
env:
working-directory: ./hyperglass/ui
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install PNPM
uses: pnpm/action-setup@v3
with:
version: ${{ matrix.pnpm-version }}
- name: Install Dependencies
working-directory: ${{ env.working-directory }}
run: yarn install
- name: Install Dependencies
working-directory: ${{ env.working-directory }}
run: pnpm install
- name: TypeScript
run: ./.tests/pre-commit-frontend.sh --typescript
- name: Create empty hyperglass.json
working-directory: ${{ env.working-directory }}
run: echo '{}' > hyperglass.json
- name: ESLint
run: ./.tests/pre-commit-frontend.sh --eslint
- name: Formatting
working-directory: ${{ env.working-directory }}
run: pnpm run format:check
- name: Lint
working-directory: ${{ env.working-directory }}
run: pnpm run lint
- name: Check Types
working-directory: ${{ env.working-directory }}
run: pnpm run typecheck
- name: Tests
working-directory: ${{ env.working-directory }}
run: pnpm run test
- name: Prettier
run: ./.tests/pre-commit-frontend.sh --prettier

18
.github/workflows/installer.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Installer Testing
on: [push, pull_request]
jobs:
installer:
name: Installer Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Run hyperglass
run: "sudo bash ./install.sh"

37
.github/workflows/release-pypi.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: Release to PyPI
on:
release:
types: [published]
jobs:
release:
name: Release to PyPI
strategy:
fail-fast: false
matrix:
python-version: [3.6]
poetry-version: [1.1.4]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Build hyperglass
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry build
- name: Publish hyperglass release
run: poetry publish

18
.gitignore vendored
View file

@ -1,32 +1,20 @@
# Project
static/
TODO*
.env
hyperglass/hyperglass/static
test.py
.DS_Store
.idea
*_old.py
.vscode
old_*.py
*.rdb
#
# Github Default from https://github.com/martinohanlon/flightlight/issues/1
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
.ipynb*
# Pyenv
.python-version
.venv
# MyPy
.mypy_cache
# Pytest
.pytest_cache
# Ruff
.ruff_cache
# C extensions
*.so

14
.isort.cfg Normal file
View file

@ -0,0 +1,14 @@
[settings]
skip_glob = hyperglass/api/examples/*.py
line_length = 88
indent = ' '
include_trailing_comma = True
multi_line_output = 3
balanced_wrapping = True
length_sort = True
force_single_line = False
import_heading_stdlib = Standard Library
import_heading_thirdparty = Third Party
import_heading_firstparty = Project
import_heading_localfolder = Local
known_third_party = starlette,fastapi,inquirer

37
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,37 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: flake8
stages:
- commit
- repo: local
hooks:
- id: typescript
name: TypeScript
files: 'hyperglass/ui/*'
exclude: 'hyperglass/ui/node_modules|hyperglass/ui/.next'
stages:
- commit
entry: ./.tests/pre-commit-frontend.sh --typescript
language: script
- repo: local
hooks:
- id: eslint
name: ESLint
files: 'hyperglass/ui/*'
exclude: 'hyperglass/ui/node_modules|hyperglass/ui/.next'
stages:
- commit
entry: ./.tests/pre-commit-frontend.sh --eslint
language: script
- repo: local
hooks:
- id: prettier
name: Prettier
files: 'hyperglass/ui/*'
exclude: 'hyperglass/ui/node_modules|hyperglass/ui/.next'
stages:
- commit
entry: ./.tests/pre-commit-frontend.sh --prettier
language: script

View file

@ -1,14 +0,0 @@
lg.example.com:443 {
tls person@example.com
file_server {
root /etc/hyperglass/static/ui
index /etc/hyperglass/static/ui/index.html
}
file_server /custom {
root /etc/hyperglass/static/custom
}
file_server /images {
root /etc/hyperglass/static/images
}
reverse_proxy localhost:8001
}

View file

@ -1,65 +0,0 @@
{
"vrfs": {
"default": {
"routerId": "198.18.0.1",
"vrf": "default",
"bgpRouteEntries": {
"198.18.2.0/24": {
"totalPaths": 1,
"bgpAdvertisedPeerGroups": {},
"maskLength": 24,
"bgpRoutePaths": [
{
"asPathEntry": {
"asPathType": "External",
"asPath": "65002 65003"
},
"med": 8675309,
"localPreference": 100,
"weight": 0,
"peerEntry": {
"peerRouterId": "198.18.0.2",
"peerAddr": "198.18.0.2"
},
"reasonNotBestpath": "noReason",
"timestamp": 1612996830,
"nextHop": "198.18.0.2",
"routeType": {
"atomicAggregator": false,
"origin": "Igp",
"suppressed": false,
"queued": false,
"valid": true,
"ecmpContributor": false,
"luRoute": false,
"active": true,
"stale": false,
"ecmp": false,
"backup": false,
"ecmpHead": false,
"ucmp": false
},
"routeDetail": {
"origin": "Igp",
"labelStack": [],
"isLeaked": false,
"tunnelRibEligible": false,
"extCommunityList": [],
"extCommunityListRaw": [],
"communityList": ["65002:1"],
"rxSafi": "Unicast",
"bgpContributors": [],
"recvdFromRRClient": false,
"igpMetric": 1,
"largeCommunityList": [],
"domainPath": []
}
}
],
"address": "198.18.2.0"
}
},
"asn": "65001"
}
}
}

View file

@ -1,15 +0,0 @@
[Unit]
Description=hyperglass
PartOf=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=true
WorkingDirectory=/opt/hyperglass
EnvironmentFile=/etc/hyperglass/hyperglass.env
ExecStart=/usr/bin/docker compose up -d --remove-orphans
ExecStop=/usr/bin/docker compose down
[Install]
WantedBy=multi-user.target

View file

@ -1,13 +0,0 @@
[Unit]
Description=hyperglass
After=network.target
Requires=redis-server
[Service]
User=root
Group=root
EnvironmentFile=/etc/hyperglass/hyperglass.env
ExecStart=python3 -m hyperglass.console start
[Install]
WantedBy=multi-user.target

View file

@ -1,49 +0,0 @@
server {
listen 80;
listen [::]:80;
server_name lg.example.com;
return 301 https://$host$request_uri;
}
server {
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate <path to cert chain>
ssl_certificate_key <path to key>
client_max_body_size 2M;
server_name lg.example.com;
root /etc/hyperglass/static;
location / {
try_files $uri $uri/ /ui /ui/$uri =404;
index /ui/index.html;
}
location /openapi.json {
try_files $uri @proxy_to_app;
}
location /custom/ {
try_files $uri $uri/ /custom;
}
location /images/ {
try_files $uri $uri/ /images;
}
location /api {
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://[::1]:8001;
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,774 +0,0 @@
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/18.2R3/junos">
<route-information xmlns="http://xml.juniper.net/junos/18.2R3/junos-routing">
<!-- keepalive -->
<route-table>
<table-name>
inet.0
</table-name>
<destination-count>
851482
</destination-count>
<total-route-count>
3145808
</total-route-count>
<active-route-count>
851445
</active-route-count>
<holddown-route-count>
1
</holddown-route-count>
<hidden-route-count>
94
</hidden-route-count>
<rt junos:style="detail">
<rt-destination>
1.1.1.0
</rt-destination>
<rt-prefix-length>
24
</rt-prefix-length>
<rt-entry-count junos:format="4 entries">
4
</rt-entry-count>
<rt-announced-count>
1
</rt-announced-count>
<rt-entry>
<active-tag>
*
</active-tag>
<current-active />
<last-active />
<protocol-name>
BGP
</protocol-name>
<preference>
170
</preference>
<preference2>
-176
</preference2>
<nh-type>
Router
</nh-type>
<nh-index>
1007
</nh-index>
<nh-address>
0x36d576ac
</nh-address>
<nh-reference-count>
1337511
</nh-reference-count>
<nh-kernel-id>
0
</nh-kernel-id>
<gateway>
62.115.189.136
</gateway>
<nh junos:indent="16">
<nh-string>
Next hop
</nh-string>
<to>
62.115.189.136
</to>
<via>
xe-0/1/1.0
</via>
<selected-next-hop />
<session>
4e3
</session>
</nh>
<rt-entry-state>
Active Ext
</rt-entry-state>
<local-as>
14525
</local-as>
<peer-as>
1299
</peer-as>
<age junos:seconds="2634431">
4w2d 11:47:11
</age>
<validation-state>
valid
</validation-state>
<med-plus-igp>
0
</med-plus-igp>
<task-name>
BGP_1299.62.115.189.136
</task-name>
<announce-bits>
5
</announce-bits>
<announce-tasks>
0-KRT 6-BGP_RT_Background 8-Resolve tree 3 10-Aggregate 12-RT
</announce-tasks>
<as-path>
AS path: 1299 13335 I
Aggregator: 13335 141.101.72.1
AS path: Recorded
</as-path>
<bgp-path-attributes>
<attr-as-path-effective>
<aspath-effective-string>
AS path:
</aspath-effective-string>
<attr-value>
1299 13335 I
</attr-value>
<flags>
</flags>
</attr-as-path-effective>
<attr-aggregator>
<attr-length>
11
</attr-length>
<attr-value>
<aggr-as-number>
13335
</aggr-as-number>
<aggr-router-id>
141.101.72.1
</aggr-router-id>
</attr-value>
</attr-aggregator>
</bgp-path-attributes>
<communities>
<community>
1299:35000
</community>
<community>
14525:0
</community>
<community>
14525:41
</community>
<community>
14525:600
</community>
<community>
14525:1021
</community>
<community>
14525:2840
</community>
<community>
14525:3001
</community>
<community>
14525:4001
</community>
<community>
14525:9003
</community>
</communities>
<bgp-rt-flag>
Accepted
</bgp-rt-flag>
<local-preference>
175
</local-preference>
<peer-id>
2.255.254.43
</peer-id>
</rt-entry>
<rt-entry>
<active-tag>
</active-tag>
<protocol-name>
BGP
</protocol-name>
<preference>
200
</preference>
<preference2>
-251
</preference2>
<nh-type>
Indirect
</nh-type>
<nh-index>
0
</nh-index>
<nh-address>
0x159d47bc
</nh-address>
<nh-reference-count>
546747
</nh-reference-count>
<nh-kernel-id>
0
</nh-kernel-id>
<gateway>
199.34.94.1
</gateway>
<nh-type>
Router
</nh-type>
<nh-index>
897
</nh-index>
<nh junos:indent="16">
<nh-string>
Next hop
</nh-string>
<to>
100.64.0.21
</to>
<via>
et-0/0/2.3601
</via>
<selected-next-hop />
<label-element>
0x4261200
</label-element>
<label-element-parent>
0x0
</label-element-parent>
<label-element-refcount>
4
</label-element-refcount>
<label-element-childcount>
2
</label-element-childcount>
<label-element-lspid>
0
</label-element-lspid>
<session>
53c
</session>
</nh>
<protocol-nh junos:indent="16">
<to>
199.34.94.1
</to>
<indirect-nh>
0xa010e00 1048620 INH Session ID: 0x53e
</indirect-nh>
</protocol-nh>
<rt-entry-state>
Int Ext
</rt-entry-state>
<inactive-reason>
Route Preference
</inactive-reason>
<local-as>
14525
</local-as>
<peer-as>
14525
</peer-as>
<age junos:seconds="1766791">
2w6d 10:46:31
</age>
<metric>
0
</metric>
<metric2>
1000
</metric2>
<validation-state>
unverified
</validation-state>
<med-plus-igp>
1000
</med-plus-igp>
<task-name>
BGP_14525.199.34.94.1
</task-name>
<as-path>
AS path: 13335 I
Aggregator: 13335 172.68.129.1
AS path: Recorded
</as-path>
<bgp-path-attributes>
<attr-as-path-effective>
<aspath-effective-string>
AS path:
</aspath-effective-string>
<attr-value>
13335 I
</attr-value>
<flags>
</flags>
</attr-as-path-effective>
<attr-aggregator>
<attr-length>
11
</attr-length>
<attr-value>
<aggr-as-number>
13335
</aggr-as-number>
<aggr-router-id>
172.68.129.1
</aggr-router-id>
</attr-value>
</attr-aggregator>
</bgp-path-attributes>
<communities>
<community>
13335:10232
</community>
<community>
13335:19000
</community>
<community>
13335:20050
</community>
<community>
13335:20500
</community>
<community>
13335:20530
</community>
<community>
14525:0
</community>
<community>
14525:20
</community>
<community>
14525:600
</community>
<community>
14525:1021
</community>
<community>
14525:2840
</community>
<community>
14525:3003
</community>
<community>
14525:4003
</community>
<community>
14525:9009
</community>
</communities>
<bgp-rt-flag>
Accepted
</bgp-rt-flag>
<local-preference>
250
</local-preference>
<peer-id>
199.34.94.1
</peer-id>
</rt-entry>
<rt-entry>
<active-tag>
</active-tag>
<protocol-name>
BGP
</protocol-name>
<preference>
200
</preference>
<preference2>
-251
</preference2>
<nh-type>
Indirect
</nh-type>
<nh-index>
0
</nh-index>
<nh-address>
0x20040a2c
</nh-address>
<nh-reference-count>
600203
</nh-reference-count>
<nh-kernel-id>
0
</nh-kernel-id>
<gateway>
199.34.94.2
</gateway>
<nh-type>
Router
</nh-type>
<nh-index>
1243
</nh-index>
<nh junos:indent="16">
<nh-string>
Next hop
</nh-string>
<to>
100.64.0.22
</to>
<via>
et-0/0/2.3601
</via>
<selected-next-hop />
<label-element>
0x8b6e880
</label-element>
<label-element-parent>
0x0
</label-element-parent>
<label-element-refcount>
4
</label-element-refcount>
<label-element-childcount>
2
</label-element-childcount>
<label-element-lspid>
0
</label-element-lspid>
<session>
532
</session>
</nh>
<protocol-nh junos:indent="16">
<to>
199.34.94.2
</to>
<indirect-nh>
0xa010800 1048619 INH Session ID: 0x5c1
</indirect-nh>
</protocol-nh>
<rt-entry-state>
NotBest Int Ext
</rt-entry-state>
<inactive-reason>
Not Best in its group - Router ID
</inactive-reason>
<local-as>
14525
</local-as>
<peer-as>
14525
</peer-as>
<age junos:seconds="242">
4:02
</age>
<metric>
0
</metric>
<metric2>
1000
</metric2>
<validation-state>
unverified
</validation-state>
<med-plus-igp>
1000
</med-plus-igp>
<task-name>
BGP_14525.199.34.94.2
</task-name>
<as-path>
AS path: 13335 I
Aggregator: 13335 172.68.129.1
AS path: Recorded
</as-path>
<bgp-path-attributes>
<attr-as-path-effective>
<aspath-effective-string>
AS path:
</aspath-effective-string>
<attr-value>
13335 I
</attr-value>
<flags>
</flags>
</attr-as-path-effective>
<attr-aggregator>
<attr-length>
11
</attr-length>
<attr-value>
<aggr-as-number>
13335
</aggr-as-number>
<aggr-router-id>
172.68.129.1
</aggr-router-id>
</attr-value>
</attr-aggregator>
</bgp-path-attributes>
<communities>
<community>
13335:10232
</community>
<community>
13335:19000
</community>
<community>
13335:20050
</community>
<community>
13335:20500
</community>
<community>
13335:20530
</community>
<community>
14525:0
</community>
<community>
14525:20
</community>
<community>
14525:600
</community>
<community>
14525:1021
</community>
<community>
14525:2840
</community>
<community>
14525:3003
</community>
<community>
14525:4003
</community>
<community>
14525:9009
</community>
</communities>
<bgp-rt-flag>
Accepted
</bgp-rt-flag>
<local-preference>
250
</local-preference>
<peer-id>
199.34.94.2
</peer-id>
</rt-entry>
<rt-entry>
<active-tag>
</active-tag>
<protocol-name>
BGP
</protocol-name>
<preference>
200
</preference>
<preference2>
-251
</preference2>
<nh-type>
Indirect
</nh-type>
<nh-index>
0
</nh-index>
<nh-address>
0x1e049e7c
</nh-address>
<nh-reference-count>
135307
</nh-reference-count>
<nh-kernel-id>
0
</nh-kernel-id>
<gateway>
216.250.230.2
</gateway>
<nh-type>
Router
</nh-type>
<nh-index>
0
</nh-index>
<nh junos:indent="16">
<nh-string>
Next hop
</nh-string>
<to>
100.64.0.52
</to>
<via>
et-0/0/1.3605
</via>
<weight>
0x1
</weight>
<selected-next-hop />
<label-element>
0x8b6f980
</label-element>
<label-element-parent>
0x0
</label-element-parent>
<label-element-refcount>
13
</label-element-refcount>
<label-element-childcount>
5
</label-element-childcount>
<label-element-lspid>
0
</label-element-lspid>
<session>
0
</session>
</nh>
<nh junos:indent="16">
<nh-string>
Next hop
</nh-string>
<to>
100.64.0.140
</to>
<via>
et-0/0/2.3607
</via>
<weight>
0x1
</weight>
<label-element>
0x8b6f980
</label-element>
<label-element-parent>
0x0
</label-element-parent>
<label-element-refcount>
13
</label-element-refcount>
<label-element-childcount>
5
</label-element-childcount>
<label-element-lspid>
0
</label-element-lspid>
<session>
0
</session>
</nh>
<protocol-nh junos:indent="16">
<to>
216.250.230.2
</to>
<indirect-nh>
0xa00f600 1048607 INH Session ID: 0x54c
</indirect-nh>
</protocol-nh>
<rt-entry-state>
NotBest Int Ext
</rt-entry-state>
<inactive-reason>
Not Best in its group - Router ID
</inactive-reason>
<local-as>
14525
</local-as>
<peer-as>
14525
</peer-as>
<age junos:seconds="1367556">
2w1d 19:52:36
</age>
<metric>
0
</metric>
<metric2>
1000
</metric2>
<validation-state>
unverified
</validation-state>
<med-plus-igp>
1000
</med-plus-igp>
<task-name>
BGP_14525.216.250.230.2
</task-name>
<as-path>
AS path: 13335 I
Aggregator: 13335 141.101.73.1
</as-path>
<bgp-path-attributes>
<attr-as-path-effective>
<aspath-effective-string>
AS path:
</aspath-effective-string>
<attr-value>
13335 I
</attr-value>
</attr-as-path-effective>
<attr-aggregator>
<attr-length>
11
</attr-length>
<attr-value>
<aggr-as-number>
13335
</aggr-as-number>
<aggr-router-id>
141.101.73.1
</aggr-router-id>
</attr-value>
</attr-aggregator>
</bgp-path-attributes>
<communities>
<community>
13335:10014
</community>
<community>
13335:19000
</community>
<community>
13335:20050
</community>
<community>
13335:20500
</community>
<community>
13335:20530
</community>
<community>
14525:0
</community>
<community>
14525:20
</community>
<community>
14525:600
</community>
<community>
14525:1021
</community>
<community>
14525:2840
</community>
<community>
14525:3003
</community>
<community>
14525:4002
</community>
<community>
14525:9009
</community>
</communities>
<bgp-rt-flag>
Accepted
</bgp-rt-flag>
<local-preference>
250
</local-preference>
<peer-id>
216.250.230.2
</peer-id>
</rt-entry>
</rt>
</route-table>
</route-information>
<cli>
<banner>
</banner>
</cli>
</rpc-reply>

View file

@ -1,201 +0,0 @@
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/18.2R3/junos">
<route-information xmlns="http://xml.juniper.net/junos/18.2R3/junos-routing">
<!-- keepalive -->
<route-table>
<table-name>
inet.0
</table-name>
<destination-count>
851462
</destination-count>
<total-route-count>
3145810
</total-route-count>
<active-route-count>
851425
</active-route-count>
<holddown-route-count>
1
</holddown-route-count>
<hidden-route-count>
94
</hidden-route-count>
<rt junos:style="detail">
<rt-destination>
199.34.94.96
</rt-destination>
<rt-prefix-length>
30
</rt-prefix-length>
<rt-entry-count junos:format="1 entry">
1
</rt-entry-count>
<rt-announced-count>
1
</rt-announced-count>
<rt-state>
</rt-state>
<rt-entry>
<active-tag>
*
</active-tag>
<current-active />
<last-active />
<protocol-name>
BGP
</protocol-name>
<preference>
200
</preference>
<preference2>
-451
</preference2>
<nh-type>
Indirect
</nh-type>
<nh-index>
0
</nh-index>
<nh-address>
0x159d47bc
</nh-address>
<nh-reference-count>
546728
</nh-reference-count>
<nh-kernel-id>
0
</nh-kernel-id>
<gateway>
199.34.94.1
</gateway>
<nh-type>
Router
</nh-type>
<nh-index>
897
</nh-index>
<nh junos:indent="16">
<nh-string>
Next hop
</nh-string>
<to>
100.64.0.21
</to>
<via>
et-0/0/2.3601
</via>
<selected-next-hop />
<label-element>
0x4261200
</label-element>
<label-element-parent>
0x0
</label-element-parent>
<label-element-refcount>
4
</label-element-refcount>
<label-element-childcount>
2
</label-element-childcount>
<label-element-lspid>
0
</label-element-lspid>
<session>
53c
</session>
</nh>
<protocol-nh junos:indent="16">
<to>
199.34.94.1
</to>
<indirect-nh>
0xa010e00 1048620 INH Session ID: 0x53e
</indirect-nh>
</protocol-nh>
<rt-entry-state>
Active Int Ext
</rt-entry-state>
<local-as>
14525
</local-as>
<peer-as>
14525
</peer-as>
<age junos:seconds="1767263">
2w6d 10:54:23
</age>
<metric>
0
</metric>
<metric2>
1000
</metric2>
<validation-state>
unverified
</validation-state>
<med-plus-igp>
1000
</med-plus-igp>
<task-name>
BGP_14525.199.34.94.1
</task-name>
<announce-bits>
4
</announce-bits>
<announce-tasks>
0-KRT 8-Resolve tree 3 10-Aggregate 12-RT
</announce-tasks>
<as-path>
AS path: I
AS path: Recorded
</as-path>
<bgp-path-attributes>
<attr-as-path-effective>
<aspath-effective-string>
AS path:
</aspath-effective-string>
<attr-value>
I
</attr-value>
<flags>
</flags>
</attr-as-path-effective>
</bgp-path-attributes>
<communities>
<community>
14525:0
</community>
<community>
14525:1
</community>
<community>
14525:1021
</community>
<community>
14525:2840
</community>
<community>
14525:3003
</community>
<community>
14525:4003
</community>
</communities>
<bgp-rt-flag>
Accepted
</bgp-rt-flag>
<local-preference>
450
</local-preference>
<peer-id>
199.34.94.1
</peer-id>
</rt-entry>
</rt>
</route-table>
</route-information>
<cli>
<banner>
</banner>
</cli>
</rpc-reply>

View file

@ -1,10 +0,0 @@
devices:
- name: Example Device
address: 127.0.0.1
credential:
username: test
password: test
platform: juniper
attrs:
source4: 127.0.0.1
source6: 2001:db8::1

52
.tests/app/setup.sh Executable file
View file

@ -0,0 +1,52 @@
#!/usr/bin/env bash
echo "[INFO] Starting Redis..."
redis-server &
cd /tmp/hyperglass
echo "[INFO] Starting setup..."
poetry run hyperglass setup -d
echo "[SUCCESS] Setup completed."
sleep 2
echo "listen_address: 127.0.0.1" >> /root/hyperglass/hyperglass.yaml
echo "[INFO] Starting UI build."
poetry run hyperglass build-ui
if [[ ! $? == 0 ]]; then
echo "[ERROR] Failed to start hyperglass."
exit 1
else
echo "[SUCCESS] UI build completed."
fi
echo "[INFO] Starting hyperglass..."
poetry run hyperglass start &> /var/log/hyperglassci.log &
sleep 180
if [[ ! $? == 0 ]]; then
echo "[ERROR] Failed to start hyperglass."
exit 1
else
echo "[SUCCESS] Started hyperglass."
fi
echo "[INFO] Running HTTP test..."
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8001)
echo "[INFO] Status code: $STATUS"
if [[ ! $? == 0 ]]; then
echo "[ERROR] HTTP test failed."
exit 1
elif [[ ! "$STATUS" == "200" ]]; then
echo "[ERROR] HTTP test failed. Startup log:"
cat /var/log/hyperglassci.log
exit 1
fi
echo "[SUCCESS] Tests ran successfully."
exit 0

View file

@ -0,0 +1,31 @@
FROM ubuntu:bionic as base
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
WORKDIR /tmp
RUN apt-get update \
&& apt-get install -y git curl net-tools \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y python3 python3-pip python3-venv redis-server nodejs yarn \
# && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 \
#
# Pinning Poetry installer to this specific version. As of 2020 07 24, the script from master
# fails to install due to Python 2's executable matching first. See #2106
#
&& curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/e70ee3112ab06374dfef4ab84e6dded2382cc7dd/get-poetry.py | python3 \
&& python3 --version \
&& echo "NodeJS $(node --version)" \
&& echo "Yarn $(yarn --version)"
COPY ./ /tmp/hyperglass
ENV PATH=$PATH:/root/.poetry/bin
FROM base as install
WORKDIR /tmp/hyperglass
RUN poetry install --no-ansi
FROM install as setup
WORKDIR /tmp/hyperglass
COPY .tests/app/setup.sh /tmp/setup.sh
RUN ls -lsah /tmp

View file

@ -1,12 +0,0 @@
---
routers:
- name: Example Device
address: 127.0.0.1
group: Test
credential:
username: test
password: test
platform: juniper
directives:
- builtins: false
- juniper_bgp_route

View file

@ -1,17 +0,0 @@
juniper_bgp_route:
name: BGP Route
groups:
- Global
rules:
- condition: '1.0.0.1/32'
action: deny
- condition: '0.0.0.0/0'
ge: 8
le: 25
command: 'show route protocol bgp table inet.0 {target} detail'
- condition: '::/0'
ge: 16
le: 64
command: 'show route protocol bgp table inet6.0 {target} detail'
field:
description: IP Address or Prefix

View file

@ -1,23 +1,23 @@
#!/usr/bin/env bash
LOG_FILE="$HOME/hyperglass-ci.log"
touch /tmp/hyperglass.log
. .venv/bin/activate
export POETRY_HYPERGLASS_UI_BUILD_TIMEOUT="600"
echo "[INFO] Set build timeout to $POETRY_HYPERGLASS_UI_BUILD_TIMEOUT seconds"
echo "[INFO] Starting setup..."
python3 -m hyperglass.console setup -d &>$LOG_FILE
poetry run hyperglass setup -d &> $LOG_FILE
echo "[SUCCESS] Setup completed."
sleep 2
echo "[INFO] Copying directives.yaml file..."
cp ./.tests/directives.yaml $HOME/hyperglass/directives.yaml
echo "[INFO] Copying devices.yaml file..."
cp ./.tests/devices.yaml $HOME/hyperglass/devices.yaml
cp ./hyperglass/examples/devices.yaml $HOME/hyperglass/devices.yaml
echo "[INFO] Setting listen_address..."
echo "listen_address: 127.0.0.1" >> $HOME/hyperglass/hyperglass.yaml
echo "[INFO] Starting UI build."
python3 -m hyperglass.console build-ui &>$LOG_FILE
poetry run hyperglass build-ui &> $LOG_FILE
if [[ ! $? == 0 ]]; then
echo "[ERROR] Failed to build hyperglass ui."
@ -29,7 +29,7 @@ else
fi
echo "[INFO] Starting hyperglass..."
python3 -m hyperglass.console start &>$LOG_FILE &
poetry run hyperglass start &> $LOG_FILE &
sleep 120
if [[ ! $? == 0 ]]; then

View file

@ -0,0 +1,5 @@
FROM ubuntu:bionic as base
WORKDIR /tmp
COPY .tests/install/ubuntu/setup.sh /tmp/init.sh
COPY ./install.sh /tmp/install.sh
RUN bash /tmp/init.sh

17
.tests/install/ubuntu/setup.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
echo "[INFO] Disabling multiverse repos..."
sed -i -e '/multiverse/s/^#*/#\ /g' /etc/apt/sources.list
cat /etc/apt/sources.list
echo "[INFO] Updating package repos..."
apt-get update &> /dev/null
echo "[INFO] Installing apt-utils..."
apt-get install -y apt-utils > /dev/null
echo "[INFO] Installing base dependencies..."
apt-get install -y curl git gnupg dialog build-essential > /dev/null
echo '[SUCCESS] Completed build'
exit 0

38
.tests/pre-commit-frontend.sh Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/env bash
UI_DIR="$(pwd)/hyperglass/ui"
check_typescript () {
cd $UI_DIR
node_modules/.bin/tsc --noEmit
}
check_eslint () {
cd $UI_DIR
node_modules/.bin/eslint .
}
check_prettier () {
cd $UI_DIR
node_modules/.bin/prettier -c -w .
}
for arg in "$@"
do
if [ "$arg" == "--typescript" ]
then
check_typescript
exit $?
elif [ "$arg" == "--eslint" ]
then
check_eslint
exit $?
elif [ "$arg" == "--prettier" ]
then
check_prettier
exit $?
else
echo "Arguments --typescript, --eslint, or --prettier required."
exit 1
fi
done

View file

@ -1,9 +0,0 @@
{
"yaml.format.singleQuote": true,
"python.linting.mypyEnabled": false,
"python.linting.enabled": false,
"biome.lspBin": "./hyperglass/ui/node_modules/.bin/biome",
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "always"
}
}

View file

@ -2,261 +2,19 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 2.0.4 - 2024-06-30
## 1.0.0-beta70 - 2021-01-05
### Fixed
- [#264](https://github.com/thatmattlove/hyperglass/issues/264): Fixed issue where IPv6 traceroutes fail on Juniper devices due to `traceroute: wait must be >1 sec.` error. Thanks @renatoornelas!
- [#267](https://github.com/thatmattlove/hyperglass/issues/267): Fixed issue where responses were incorrectly cached, resulting in no data being shown in the AS Path viewer.
- [#268](https://github.com/thatmattlove/hyperglass/issues/268): Fixed issue where some Mikrotik commands failed to execute properly.
- [#269](https://github.com/thatmattlove/hyperglass/issues/269): Updated documentation regarding `structured.rpki.mode`.
- Removed unnecessary logging statements which caused logging errors.
- Fixed issue where validation of structured BGP route data may have failed under certain conditions.
### Changed
- Error responses are no longer cached.
## 2.0.3 - 2024-06-16
### Fixed
- [#262](https://github.com/thatmattlove/hyperglass/issues/262): Fix issue where Mikrotik output was improperly parsed and displayed an error as a result.
- Fixed issue where incorrect error styles were displayed.
- Fixed issue where 'results' accordion component did not re-open when closed.
- Fixed issue where pattern-based directive rules failed validation.
### Changed
- Set default logo width (back) to 50%, adjusted how the `web.logo.width` setting is handled in the UI.
## 2.0.2 - 2024-06-01
### Fixed
- [#257](https://github.com/thatmattlove/hyperglass/issues/257): Fix issue where if `web.location_display_mode` is set to `dropdown` (automatically or otherwise), the menu would remain open but become detached from the main element because the Query Type element came into view.
- [#253](https://github.com/thatmattlove/hyperglass/issues/253): _Actually_ fix issue where configuration values were improperly prepended with the `HYPERGLASS_APP_PATH` value.
- [#258](https://github.com/thatmattlove/hyperglass/issues/258): Center logo alignment on small screens.
- Fix broken license link in default credit menu.
### Added
- Added license to docs.
- [#254](https://github.com/thatmattlove/hyperglass/issues/254): Users may specify their own DNS over HTTPS provider if desired.
## 2.0.1 - 2024-05-31
### Fixed
- [#244](https://github.com/thatmattlove/hyperglass/issues/244): Fix issue with UI build where UI build directory already existed and therefore could not be created.
- [#249](https://github.com/thatmattlove/hyperglass/issues/249): Fix issue where configuration values were improperly prepended with the `HYPERGLASS_APP_PATH` value.
- [#251](https://github.com/thatmattlove/hyperglass/issues/251): Fix issue where browser-based DNS resolution did not show, causing FQDN queries to fail due to validation.
- Fix issue where logo was improperly sized on small screens.
## 2.0.0 - 2024-05-28
_v2.0.0 is a major release of hyperglass. Many things have changed, and it is likely best to redeploy hyperglass in a new environment to migrate to v2._
### Added
- Commands are now defined as [directives](https://hyperglass.dev/configuration/directives), which is a configuration definition of one or more commands to run on a device. A directive defines:
- What command (or commands) to run on the device
- Type of UI field, text input or select
- If the field can accept multiple values
- Help information to show about the directive
- Validation rules
- hyperglass now supports Docker, and using Docker is the default and recommended method for deployment.
- The list of locations (devices) is displayed as a gallery when the number of devices is 5 or less. This is a default value and is configurable.
- hyperglass now supports custom [input or output plugins](https://hyperglass.dev/plugins).
- Input Plugins: Apply custom validation logic or transform user input before the query is sent to a device.
- Output Plugins: Interact with the output from a device before it's displayed to the user.
- [#206](https://github.com/thatmattlove/hyperglass/issues/206): OpenBGPD is natively supported by hyperglass.
- [#176](https://github.com/thatmattlove/hyperglass/issues/176): Custom javascript or HTML can be injected into the web page (for tracking applications such as Google Analytics).
- [#173](https://github.com/thatmattlove/hyperglass/issues/173): Any output, such as BGP Communities, can be highlighted in the UI by defining [highlight patterns](https://hyperglass.dev/configuration/config/web-ui#highlighting).
- [#155](https://github.com/thatmattlove/hyperglass/issues/155): A user can now use the "My IP" button to insert their own IP into the query target field.
- [#143](https://github.com/thatmattlove/hyperglass/issues/143): Any HTTP endpoint may be configured as device from which to collect output.
### Fixed
- [#229](https://github.com/thatmattlove/hyperglass/issues/229): Fixed an issue where the logo was not visible when using Firefox.
- [#180](https://github.com/thatmattlove/hyperglass/issues/180): Fixed an issue where certain FQDNs were considered invalid.
- [#178](https://github.com/thatmattlove/hyperglass/issues/178): Fixed an issue where parsing of Arista EOS routes failed if MED is unset.
- [#145](https://github.com/thatmattlove/hyperglass/issues/145): Fixed an issue where menu links were improperly generated.
## 1.0.4 - 2021-07-03
### Fixed
- [#148](https://github.com/thatmattlove/hyperglass/issues/148): Update Debian/Ubuntu Python package name in installer and documentation.
- [#151](https://github.com/thatmattlove/hyperglass/issues/151): Fix issue with Junos structured output parsing from d1160fe where hyperglass would always query both IPv4 and IPv6 for any query type.
### Changed
- Improve handling of Junos XML errors. When a Junos device returns an error in the XML output, it will be displayed in the UI.
- Improve `hyperglass system-info` output. NodeJS version is now included in the output.
## 1.0.3 - 2021-06-23
_1.0.3 is a cosmetic release to factor in code-level changes related to the repository name change from checktheroads to thatmattlove._
## 1.0.2 - 2021-06-18
### Fixed
- [#150](https://github.com/thatmattlove/hyperglass/issues/150): Fix handling of BIRD AS_PATH/Community targets.
## 1.0.1 - 2021-06-17
### Fixed
- UI: fix body overflow issue
## 1.0.0 - 2021-05-30
### BREAKING CHANGES
- The `external_link`, `help`, and `terms` parameters no longer exist and have been replaced with generic `links` and `menus` options.
- The transitionary `frr_ssh` and `bird_ssh` NOS parameters no longer exist — `frr` and `bird` can now be used for SSH-based connectivity. hyperglass-agent users must now use `frr_legacy` and `bird_legacy` until hyperglass-agent is fully deprecated.
### Fixed
- [#139](https://github.com/thatmattlove/hyperglass/issues/139): Fix an issue where the API cannot be queried by device name.
### Changed
- Updated UI dependencies
### Added
- [#140](https://github.com/thatmattlove/hyperglass/issues/140): Genericize links and menus so that multiple links and/or menus can be defined and fully customized.
## 1.0.0-beta.82 - 2021-04-22
### BREAKING CHANGE
**NodeJS 14.15 or later is required**. See [the docs](https://hyperglass.dev/docs/getting-started) for installation instructions.
### Fixed
- [#135](https://github.com/thatmattlove/hyperglass/issues/135): Fix an issue where Juniper indirect next-hops were empty.
- Fix an issue where Juniper structured AS_PATH or Community queries would appear to fail if one address family (IPv4 or IPv6) had an empty response. For example, if an AS_PATH query for `.* 29414 .*` was made (which only returns IPv4 routes), the query would fail.
### Changed
- Updated major Python dependencies (FastAPI, Scrapli, Netmiko, Pydantic, Uvicorn, Gunicorn, etc.)
- Updated UI dependencies
- [#128](https://github.com/thatmattlove/hyperglass/pull/128): Add `best` to all Juniper BGP Route queries. See [Juniper docs](https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/ref/command/show-route-best.html) for more details.
### Added
- The driver for devices can now be overridden with the `driver` parameter.
## 1.0.0-beta.81 - 2021-04-10
### Fixed
- [#124](https://github.com/thatmattlove/hyperglass/issues/124): Fix an issue where networks weren't always sorted alphabetically.
- [#126](https://github.com/thatmattlove/hyperglass/issues/126): Fix rendering of markdown tables.
- [#132](https://github.com/thatmattlove/hyperglass/issues/132): Fix an issue where iBGP routes on Arista devices caused output parsing to fail.
- [#133](https://github.com/thatmattlove/hyperglass/issues/133): Use body styles for background/foreground color, allowing the user to override the `light` and `dark` colors per the docs.
- Fix an issue with select menu list style.
### 1.0.0-beta.80 - 2021-03-03
### Fixed
- Fix an issue where the UI did not properly filter and detect the correct Query VRF when only one was defined.
- [#121](https://github.com/thatmattlove/hyperglass/issues/121): Fix issue with select menu styling in light mode.
### 1.0.0-beta.79 - 2021-02-26
### BREAKING CHANGE
**Major changes have been made to how VRFs are defined and handled.** Previously, you would signal to hyperglass that a VRF was the "default" VRF (meaning, a VRF does not need to be specified in any commands) by setting `name: default` in the VRF block. This limitation meant that a VRF named `default` _had_ to be defined, and that any users who keep their global routing table in a non-default VRF must define it separately.
Moving forward, the `name` field is only used to define the name of the VRF **as known by the device**. To signal that hyperglass should use the device's default VRF, set `default: true` on the VRF. **This is not the default**.
### Fixed
- Fix an issue where long-running commands, such as traceroutes that never complete, time out and display an error instead of the output.
### Changed
- Don't do external RPKI lookups for non global unicast prefixes.
- Migrate to palette-by-numbers for theming.
- Update UI dependencies.
### 1.0.0-beta.78 - 2021-02-12
### Added
- Experimental table output/structured data support for Arista EOS.
### Fixed
- Corrected warning color on active routes in table output.
### Changed
- Caught fetch errors now display the HTTP status text in the UI, instead of the caught error message.
### 1.0.0-beta.77 - 2021-02-10
**POTENTIALLY BREAKING CHANGE**: The device `display_name` field is being deprecated, in favor of a single `name` field, which will be displayed to the end user. The `display_name` field still works, but you should migrate away from it as soon as possible.
### Fixed
- [#117](https://github.com/thatmattlove/hyperglass/issues/117): Fix naming and mapping of the Arista EOS driver. `arista` and `arista_eos` will both work now.
### Changed
- Removed `display_name` field from device model. The `name` field will be used in the UI. If a `display_name` is defined, it will be used, for backwards compatibility.
### 1.0.0-beta.76 - 2021-02-06
**NOTICE**: *[hyperglass-agent](https://github.com/thatmattlove/hyperglass-agent) will be deprecated soon. Use `frr_ssh` or `bird_ssh` for SSH connectivity in the meantime.*
### Added
- FRR & BIRD may now be accessed via standard SSH using the `frr_ssh` and `bird_ssh` NOS. [See the docs](https://hyperglass.dev/docs/platforms#caveats) for important caveats.
### Changed
- `port` in `devices.yaml` now defaults to 22 if not specified.
### Fixed
- AS Path graph view now uses [dagre](https://github.com/dagrejs/dagre) to properly arrange each AS.
- Added timeout argument to `hyperglass start --build` - fixes issue where running a UI build in this way failed due to a missing timeout argument error.
### 1.0.0-beta.75 - 2021-01-28
### Changed
- Default UI build timeout is now 180 seconds.
- The hyperglass `build-ui` CLI command now accepts a `--timeout` argument to override the UI build timeout.
### 1.0.0-beta.74 - 2021-01-25
### Changed
- The Scrapli driver no longer specifically ignores the system's SSH config file.
- Updated UI dependencies.
### Fixed
- [#109](https://github.com/thatmattlove/hyperglass/issues/109): Remove the custom error page, because it doesn't work and doesn't really add much.
### 1.0.0-beta.73 - 2021-01-18
### Added
- [#106](https://github.com/thatmattlove/hyperglass/issues/106): Add built-in support for Nokia SR OS (thanks @paunadeu!).
### Changed
- [#105](https://github.com/thatmattlove/hyperglass/issues/105): Check NodeJS version on startup to ensure the minimum supported version is present.
- Update UI dependencies.
### Fixed
- [#107](https://github.com/thatmattlove/hyperglass/issues/107): Fix footer menu styling so it doesn't overflow the viewport, especially on mobile.
### 1.0.0-beta.72 - 2021-01-16
### Fixed
- [#104](https://github.com/thatmattlove/hyperglass/issues/104): Handle the usage of `juniper_junos` as a NOS. `juniper_junos` will now automatically be mapped to `juniper`.
- Fix an issue with dual RP juniper devices and structured output, where output containing `{master}` outside of the XML output was improperly stripped out, causing a parsing failure.
### Changed
- **BREAKING**: The installer no longer generates a Systemd service file. While this was likely convenient for most, it introduced significant complexity and caused most installations using `~/hyperglass` as the app path to fail, with no clear way to resolve it. Further, while Systemd is arguably the most common, it is not the *only* process manager available. As such, the docs will be updated with a Systemd example, much like the current reverse proxy documentation.
### 1.0.0-beta.71 - 2021-01-10
### Added
- Added Google Analytics Support. Use the `google_analytics` field for the tracking ID in `hyperglass.yaml`.
### Changed
- Minor frontend code improvements.
### 1.0.0-beta.70 - 2021-01-05
### Fixed
- [#100](https://github.com/thatmattlove/hyperglass/issues/100): Fix result panel bug where incorrect panels would open, or panels would not open at all. Resolved by accessing internal state of the `Accordion />` component via `useAccordionContext()` instead of directly changing the index prop via state.
- [#100](https://github.com/checktheroads/hyperglass/issues/100): Fix result panel bug where incorrect panels would open, or panels would not open at all. Resolved by accessing internal state of the `Accordion />` component via `useAccordionContext()` instead of directly changing the index prop via state.
### Changed
- Query results now automatically cancel when each result panel unmounts (e.g. when one clicks the back button).
### 1.0.0-beta.69 - 2021-01-03
## 1.0.0-beta69 - 2021-01-03
### Fixed
@ -267,14 +25,14 @@ Moving forward, the `name` field is only used to define the name of the VRF **as
- Setup no longer adds example files
### 1.0.0-beta.67 - 2021-01-02
## 1.0.0-beta67 - 2021-01-02
### Fixed
- Fix handling of `web.theme.default_color_mode`. Starting in 1.0.0-beta.65, it was completely ignored and used the library's default of `light`. Now, it's handled properly.
- Fix table output layout issues, particularly on mobile.
### 1.0.0-beta.66 - 2021-01-02
## 1.0.0-beta66 - 2021-01-02
### Fixed
@ -285,11 +43,11 @@ Moving forward, the `name` field is only used to define the name of the VRF **as
- `web.theme.colors.black` and `web.theme.colors.white` are now `web.theme.colors.dark` and `web.theme.colors.light respectively`
### 1.0.0-beta.65 - 2021-01-01
## 1.0.0-beta65 - 2021-01-01
### Added
- [#72](https://github.com/thatmattlove/hyperglass/issues/72): _EXPERIMENTAL_ BGP map support for devices supporting structured output (Juniper Junos, currently).
- [#72](https://github.com/checktheroads/hyperglass/issues/72): _EXPERIMENTAL_ BGP map support for devices supporting structured output (Juniper Junos, currently).
### Fixed
@ -300,23 +58,23 @@ Moving forward, the `name` field is only used to define the name of the VRF **as
- `web.text.title` and `web.text.subtitle` now carry a 32 character limit for simpler styling.
- Various UI layout, styling improvements, and stability improvements.
### 1.0.0-beta.63 - 2020-10-18
## 1.0.0-beta63 - 2020-10-18
### Added
- [#87](https://github.com/thatmattlove/hyperglass/issues/87): [TNSR] Support. To add a TNSR device, use the `tnsr` [NOS key](https://hyperglass.dev/docs/adding-devices#all-device-parameters).
- [#87](https://github.com/checktheroads/hyperglass/issues/87): [TNSR] Support. To add a TNSR device, use the `tnsr` [NOS key](https://hyperglass.io/docs/adding-devices#all-device-parameters).
### Fixed
- Fix an issue causing hyperglass custom exceptions to not be properly raised, which caused more generic error messages in the UI/API.
### 1.0.0-beta.62 - 2020-10-17
## 1.0.0-beta62 - 2020-10-17
### Fixed
- Fix an issue causing exceptions not to be logged to the log file (but logged to stdout).
### 1.0.0-beta.61 - 2020-10-11
## 1.0.0-beta61 - 2020-10-11
### POTENTIALLY BREAKING CHANGE
@ -328,17 +86,17 @@ When hyperglass starts up, it will check to see if `~/hyperglass` or `/etc/hyper
### Added
- [#81](https://github.com/thatmattlove/hyperglass/issues/81): Add support for SSH key authentication. See [the docs](https://hyperglass.dev/docs/adding-devices#credential) for more details.
- [#81](https://github.com/checktheroads/hyperglass/issues/81): Add support for SSH key authentication. See [the docs](https://hyperglass.io/docs/adding-devices#credential) for more details.
### 1.0.0-beta.60 - 2020-10-10
## 1.0.0-beta60 - 2020-10-10
### Fixed
- [#90](https://github.com/thatmattlove/hyperglass/issues/90): Fix a typing error that caused ping & traceroute queries to fail for certain devices.
- [#90](https://github.com/checktheroads/hyperglass/issues/90): Fix a typing error that caused ping & traceroute queries to fail for certain devices.
### Added
- [#82](https://github.com/thatmattlove/hyperglass/issues/82): Add support for Redis password authentication. Authentication can be configured in the following manner:
- [#82](https://github.com/checktheroads/hyperglass/issues/82): Add support for Redis password authentication. Authentication can be configured in the following manner:
```yaml
# hyperglass.yaml
@ -352,7 +110,7 @@ This would correspond with the following stanza in the Redis configuration file:
requirepass examplepassword
```
### 1.0.0-beta.59 - 2020-10-05
## 1.0.0-beta59 - 2020-10-05
### Added
@ -364,11 +122,11 @@ requirepass examplepassword
- Improve output parsing scalability - parsers can now be defined on a per-NOS basis regardless of whether or not structured-data is used.
- Restructure model locations & importing to remove some complexities.
### 1.0.0-beta.58 - 2020-09-28
## 1.0.0-beta58 - 2020-09-28
### Changed
- [#79](https://github.com/thatmattlove/hyperglass/issues/79): Run the UI build on startup & clarify docs.
- [#79](https://github.com/checktheroads/hyperglass/issues/79): Run the UI build on startup & clarify docs.
- Removed all f-strings from log messages.
- Migrate icon library to [@meronex/icons](https://github.com/meronex/meronex-icons) for better tree-shaking.
- Improve console (stdout) logging
@ -376,16 +134,16 @@ requirepass examplepassword
### Fixed
- [#74](https://github.com/thatmattlove/hyperglass/issues/74): Fix UI build failures caused by `.alias.js`.
- [#75](https://github.com/thatmattlove/hyperglass/issues/75): Fix whitespace stripping of query target.
- [#77](https://github.com/thatmattlove/hyperglass/issues/77): Allow dashes in FQDN validation pattern.
- [#83](https://github.com/thatmattlove/hyperglass/issues/83): Fix lack of support for `protocol-nh` field in Juniper XML BGP table.
- [#74](https://github.com/checktheroads/hyperglass/issues/74): Fix UI build failures caused by `.alias.js`.
- [#75](https://github.com/checktheroads/hyperglass/issues/75): Fix whitespace stripping of query target.
- [#77](https://github.com/checktheroads/hyperglass/issues/77): Allow dashes in FQDN validation pattern.
- [#83](https://github.com/checktheroads/hyperglass/issues/83): Fix lack of support for `protocol-nh` field in Juniper XML BGP table.
### 1.0.0-beta.57 - 2020-07-30
## 1.0.0-beta57 - 2020-07-30
### BREAKING CHANGE
If you use [hyperglass-agent](https://github.com/thatmattlove/hyperglass-agent), you must upgrade your version of hyperglass-agent to 0.1.6 or later. If using hyperglass-agent with SSL, this release will require you to re-generate & re-send your SSL certificates to hyperglass:
If you use [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent), you must upgrade your version of hyperglass-agent to 0.1.6 or later. If using hyperglass-agent with SSL, this release will require you to re-generate & re-send your SSL certificates to hyperglass:
```console
$ hyperglass-agent certificate
@ -399,7 +157,7 @@ $ hyperglass-agent send-certificate
- Refactored device, query, proxy models to no longer scrub unsupported characters from the device name for the purposes of Python class attribute accessing.
- Updated hyperglass-agent docs.
### 1.0.0-beta.56 - 2020-07-28
## 1.0.0-beta56 - 2020-07-28
### Changed
@ -408,25 +166,25 @@ $ hyperglass-agent send-certificate
### Fixed
- [#56](https://github.com/thatmattlove/hyperglass/issues/56): Fix a silent Redis connection error if the Redis server was anything other than `localhost`, preventing hyperglass from starting.
- [#56](https://github.com/checktheroads/hyperglass/issues/56): Fix a silent Redis connection error if the Redis server was anything other than `localhost`, preventing hyperglass from starting.
### 1.0.0-beta.55 - 2020-07-27
## 1.0.0-beta55 - 2020-07-27
### Changed
- Removed JS favicon build process in favor of native Python implementation ([favicons](https://github/thatmattlove/favicons))
- Removed JS favicon build process in favor of native Python implementation ([favicons](https://github/checktheroads/favicons))
### 1.0.0-beta.54 - 2020-07-25
## 1.0.0-beta54 - 2020-07-25
### Fixed
- Queries to hyperglass-agent devices failed due to the error `AttributeError: 'AgentConnection' object has no attribute 'collect'`
### 1.0.0-beta.53 - 2020-07-23
## 1.0.0-beta53 - 2020-07-23
### Added
- **BREAKING CHANGE**: [Scrapli](https://github.com/carlmontanari/scrapli) is now used for SSH connectivity to Cisco IOS, Cisco IOS-XE, Cisco IOS-XR, Cisco NX-OS Juniper Junos, and Arista EOS, which should improve the speed at which output is gathered from devices. _As of this release, Cisco IOS/IOS-XE and Juniper Junos have been directly tested and worked without issue. However, if you discover any anomalies with any of these operating systems, please [open an issue](https://github.com/thatmattlove/hyperglass/issues)._
- **BREAKING CHANGE**: [Scrapli](https://github.com/carlmontanari/scrapli) is now used for SSH connectivity to Cisco IOS, Cisco IOS-XE, Cisco IOS-XR, Cisco NX-OS Juniper Junos, and Arista EOS, which should improve the speed at which output is gathered from devices. _As of this release, Cisco IOS/IOS-XE and Juniper Junos have been directly tested and worked without issue. However, if you discover any anomalies with any of these operating systems, please [open an issue](https://github.com/checktheroads/hyperglass/issues)._
### Changed
@ -438,31 +196,31 @@ $ hyperglass-agent send-certificate
- UI: Error messages couldn't be copied with the copy button
### 1.0.0-beta.52 - 2020-07-19
## 1.0.0-beta52 - 2020-07-19
### Added
- API route `/api/info`, which displays general system information such as the name of the organization and version of hyperglass.
- API docs configuration parameters for the `/api/info` route.
- [#63](https://github.com/thatmattlove/hyperglass/issues/63): Minimum RAM requirements.
- [#63](https://github.com/checktheroads/hyperglass/issues/63): Minimum RAM requirements.
- `hyperglass system-info` CLI command to gather system CPU, Memory, Disk, Python Version, hyperglass Version, & OS info. _Note: this information is only gathered if you run the command, and even then, is printed to the console and not otherwise shared or exported_.
### Changed
- Updated docs dependencies.
- Improved YAML alias & anchor docs.
- [#55](https://github.com/thatmattlove/hyperglass/issues/55): Removed YAML alias & anchors from default examples to avoid confusion.
- [#55](https://github.com/checktheroads/hyperglass/issues/55): Removed YAML alias & anchors from default examples to avoid confusion.
### Fixed
- API docs logo URL now displays correctly.
- [#62](https://github.com/thatmattlove/hyperglass/issues/62): Added `epel-release` to CentOS installation instructions.
- [#59](https://github.com/thatmattlove/hyperglass/issues/59): Fixed copy output for Juniper devices on non-table output query types.
- [#62](https://github.com/checktheroads/hyperglass/issues/62): Added `epel-release` to CentOS installation instructions.
- [#59](https://github.com/checktheroads/hyperglass/issues/59): Fixed copy output for Juniper devices on non-table output query types.
- [hyperglass-agent #6](https://github.com/hyperglass-agent/issues/6): Fixed hyperglass-agent documentation issues.
- Improve command customization docs.
- [#61](https://github.com/thatmattlove/hyperglass/issues/61): Fixed copy output for table data. Output is now a bulleted list of parsed data.
- [#61](https://github.com/checktheroads/hyperglass/issues/61): Fixed copy output for table data. Output is now a bulleted list of parsed data.
### 1.0.0-beta.51 - 2020-07-13
## 1.0.0-beta51 - 2020-07-13
### Changed
@ -471,10 +229,10 @@ $ hyperglass-agent send-certificate
### Fixed
- [#54](https://github.com/thatmattlove/hyperglass/issues/54): A Junos parsing error caused routes with no communities to raise an error.
- [#54](https://github.com/checktheroads/hyperglass/issues/54): A Junos parsing error caused routes with no communities to raise an error.
- Pre-validated config files are no longer logged on startup unless debugging is enabled.
### 1.0.0-beta.50 - 2020-07-12
## 1.0.0-beta50 - 2020-07-12
### Added
@ -491,10 +249,10 @@ $ hyperglass-agent send-certificate
### Fixed
- [#54](https://github.com/thatmattlove/hyperglass/issues/54): A Junos structured/table output parsing error caused routes with multiple next-hops to raise an error.
- [#54](https://github.com/checktheroads/hyperglass/issues/54): A Junos structured/table output parsing error caused routes with multiple next-hops to raise an error.
- RPKI validation no longer occurs twice (once on serialization of the output, once on validation of the API response).
### 1.0.0-beta.49 - 2020-07-05
## 1.0.0-beta49 - 2020-07-05
### Changed
@ -506,11 +264,11 @@ $ hyperglass-agent send-certificate
- Route lookups for private (RFC 1918) addresses failed due to an unnecessary lookup to [bgp.tools](https://bgp.tools)
### 1.0.0-beta.48 - 2020-07-04
## 1.0.0-beta48 - 2020-07-04
### Added
- New NOS: **VyOS**. [See docs for important caveats](https://hyperglass.dev/docs/commands).
- New NOS: **VyOS**. [See docs for important caveats](https://hyperglass.io/docs/commands).
### Fixed
@ -518,18 +276,18 @@ $ hyperglass-agent send-certificate
- When copying the opengraph image, the copied image was not deleted.
- Default traceroute help link now _actually_ points to the new docs site.
### 1.0.0-beta.47 - 2020-07-04
## 1.0.0-beta47 - 2020-07-04
### Added
- Opengraph images are now automatically generated in the correct format from any valid image file.
- Better color mode toggle icons (they now match [hyperglass.dev](https://hyperglass.dev)).
- Better color mode toggle icons (they now match [hyperglass.io](https://hyperglass.io)).
### Changed
- Improved SEO & Accessibility for UI.
- Default traceroute help link now points to new docs site.
- Slightly different default black & white colors (they now match [hyperglass.dev](https://hyperglass.dev)).
- Slightly different default black & white colors (they now match [hyperglass.io](https://hyperglass.io)).
- Various docs site improvements
### Fixed
@ -539,13 +297,13 @@ $ hyperglass-agent send-certificate
- Generated favicon manifest files now go to the correct directory.
- Various docs site fixes
### 1.0.0-beta.46 - 2020-06-28
## 1.0.0-beta46 - 2020-06-28
### Added
- Support for hyperglass-agent [0.1.5](https://github.com/thatmattlove/hyperglass-agent)
- Support for hyperglass-agent [0.1.5](https://github.com/checktheroads/hyperglass-agent)
### 1.0.0-beta.45 - 2020-06-27
## 1.0.0-beta45 - 2020-06-27
### Changed
@ -556,7 +314,7 @@ $ hyperglass-agent send-certificate
- Webhook construction bugs that caused webhooks not to send
- Empty response handling for table output
### 1.0.0-beta.44 - 2020-06-26
## 1.0.0-beta44 - 2020-06-26
### Added
@ -566,13 +324,13 @@ $ hyperglass-agent send-certificate
- If webhooks were enabled, a hung test connection to RIPEStat would cause the query to time out
### 1.0.0-beta.43 - 2020-06-22
## 1.0.0-beta43 - 2020-06-22
### Fixed
- Logo path handling in UI
### 1.0.0-beta.42 - 2020-06-21
## 1.0.0-beta42 - 2020-06-21
### Added
@ -580,4 +338,4 @@ $ hyperglass-agent send-certificate
### Changed
- **BREAKING CHANGE**: The `logo` section now requires the full path for logo files. See [the docs](https://hyperglass.dev/docs/ui/logo) for details.
- **BREAKING CHANGE**: The `logo` section now requires the full path for logo files. See [the docs](https://hyperglass.io/docs/ui/logo) for details.

View file

@ -8,7 +8,7 @@ This isnt an exhaustive list of things that you cant do. Rather, take it i
This code of conduct applies to all spaces managed by the hyperglass community. This includes mailing lists, the issue tracker, Telegram groups, Gitter communities, and any other forums created by the project team which the community uses for communication. In addition, violations of this code outside these spaces may affect a person's ability to participate within them.
If you believe someone is violating the code of conduct, we ask that you report it by emailing [matt@hyperglass.dev](mailto:matt@hyperglass.dev).
If you believe someone is violating the code of conduct, we ask that you report it by emailing [conduct@hyperglass.io](mailto:conduct@hyperglass.io).
**Be friendly and patient.** Be welcoming. We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.

View file

@ -1,18 +1,18 @@
hyperglass is primarily maintained by me, [Matt Love](https://github.com/thatmattlove). This was my first ever open source application, and as such, it's kind of my "baby". When I first started writing hyperglass, I knew _nothing_ about development, Python, JavaScript/TypeScript, or GitHub. I was a network engineer trying to solve a problem and learn a few things while I was at it.
hyperglass is primarily maintained by me, [Matt Love](https://github.com/checktheroads). This is my first ever open source application, and as such, it's kind of my "baby". When I first started writing hyperglass, I knew _nothing_ about development, Python, Javascript, or Github. I was a network engineer trying to solve a problem and learn a few things while I was at it.
Because I've been solo-maintaining and building hyperglass since around April 2019, I've become pretty particular about things that might seem trivial to someone just trying to help out. While I welcome development contributions, please don't be offended if pull requests are denied, if I request things to be done a certain way, or if I integrate something similar to your changes separately from your PR. To help understand why, here are some of the development design goals for hyperglass:
Because I've been solo-maintaining and building hyperglass since around April 2019, I've become pretty particular about things that might seem trivial to someone just trying to help out. While I **absolutely welcome development contributions**, please don't be offended if pull requests are denied, or if I request things to be done a certain way. To help understand why, here are some of the development design goals for hyperglass:
- **Pristine code quality**
- [Black](https://github.com/python/black) formatting for Python.
- Strict adherence to ESLint/Prettier configs for frontend code.
- _ZERO_ linting errors.
- [Black](https://github.com/python/black) formatting for Python
- Strict adherence to ESLint/Prettier configs for Javascript/React
- _ZERO_ linting errors
- Linting exceptions only used when there is _no other way_, and should be accompanied with comments about why there is no other way.
- **No hard-coding**
- Anything visible to the end-user _must_ be customizable by the administrator. If it's not, or can't be, leave code or PR comments as to why.
- This includes things like timeouts, error messages, etc.
- **Mobile & Accessible**
- All UI element must be available on both desktop and mobile devices.
- UI must achieve a 100 Lighthouse/PageInsights score for accessibility.
- All UI element must be available on both desktop and mobile devices
- UI must achieve a 100 Lighthouse/PageInsights score for accessibility
- **IPv6 Support**
- Any new device support must include IPv6 commands.
- All frontend and backend code must support IPv6, both for running the application and processing queries.
- Any new device support must include IPv6 commands
- All frontend and backend code must support IPv6, both for running the application and processing queries

View file

@ -1,24 +0,0 @@
FROM python:3.12.3-alpine as base
WORKDIR /opt/hyperglass
ENV HYPERGLASS_APP_PATH=/etc/hyperglass
ENV HYPERGLASS_HOST=0.0.0.0
ENV HYPERGLASS_PORT=8001
ENV HYPERGLASS_DEBUG=false
ENV HYPERGLASS_DEV_MODE=false
ENV HYPERGLASS_REDIS_HOST=redis
ENV HYPEGLASS_DISABLE_UI=true
ENV HYPERGLASS_CONTAINER=true
COPY . .
FROM base as ui
WORKDIR /opt/hyperglass/hyperglass/ui
RUN apk add build-base pkgconfig cairo-dev nodejs npm
RUN npm install -g pnpm
RUN pnpm install -P
FROM ui as hyperglass
WORKDIR /opt/hyperglass
RUN pip3 install -e .
EXPOSE ${HYPERGLASS_PORT}
CMD ["python3", "-m", "hyperglass.console", "start"]

View file

@ -1,6 +1,6 @@
The Clear BSD License
Copyright (c) 2024 Matthew Love
Copyright (c) 2020 Matthew Love
All rights reserved.
Redistribution and use in source and binary forms, with or without

View file

@ -11,60 +11,73 @@
<div align="center">
[**Documentation**](https://hyperglass.dev)&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;[**Live Demo**](https://demo.hyperglass.dev/)
[**Documentation**](https://hyperglass.io)&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;[**Screenshots**](https://hyperglass.io/screenshots)&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;[**Live Demo**](https://demo.hyperglass.io/)
[![Frontend Tests](https://img.shields.io/github/actions/workflow/status/thatmattlove/hyperglass/frontend.yml?label=Frontend%20Tests&style=for-the-badge)](https://github.com/thatmattlove/hyperglass/actions/workflows/frontend.yml)
[![Backend Tests](https://img.shields.io/github/actions/workflow/status/thatmattlove/hyperglass/backend.yml?label=Backend%20Tests&style=for-the-badge)](https://github.com/thatmattlove/hyperglass/actions/workflows/backend.yml)
[![PyPI](https://img.shields.io/pypi/v/hyperglass?style=for-the-badge)](https://pypi.org/project/hyperglass/)
![PyPI - Downloads](https://img.shields.io/pypi/dm/hyperglass?color=%2340798C&style=for-the-badge)
[![GitHub Contributors](https://img.shields.io/github/contributors/checktheroads/hyperglass?color=40798C&style=for-the-badge)](https://github.com/checktheroads/hyperglass)
[![Gitter](https://img.shields.io/gitter/room/checktheroads/hyperglass?color=ff5e5b&style=for-the-badge)](https://gitter.im/hyperglass)
[![Telegram](https://img.shields.io/badge/chat-telegram-blue?style=for-the-badge&color=blue&logo=telegram)](https://t.me/hyperglasslg)
[![Frontend Tests](https://img.shields.io/github/workflow/status/checktheroads/hyperglass/Frontend%20Testing?label=Frontend%20Tests&style=for-the-badge)](https://github.com/checktheroads/hyperglass/actions?query=workflow%3A%Frontend+Testing%22)
[![Backend Tests](https://img.shields.io/github/workflow/status/checktheroads/hyperglass/Backend%20Testing?label=Backend%20Tests&style=for-the-badge)](https://github.com/checktheroads/hyperglass/actions?query=workflow%3A%Backend+Testing%22)
[![Installer Tests](https://img.shields.io/github/workflow/status/checktheroads/hyperglass/Installer%20Testing?label=Installer%20Tests&style=for-the-badge)](https://github.com/checktheroads/hyperglass/actions?query=workflow%3A%Installer+Testing%22)
<br/>
hyperglass is intended to make implementing a looking glass too easy not to do, with the lofty goal of improving the internet community at large by making looking glasses more common across autonomous systems of any size.
<br/>
⚠️ **v1.0.0** *is currently in beta. While everything should work, some things might not. Documentation and the live demo are not yet complete. For a fully working and documented version of hyperglass, **please go to the [v0 branch](https://github.com/checktheroads/hyperglass/tree/v0)**.*
</div>
### [Changelog](https://hyperglass.dev/changelog)
### [Changelog](https://github.com/checktheroads/hyperglass/blob/v1.0.0/CHANGELOG.md)
## Features
- BGP Route, BGP Community, BGP AS Path, Ping, & Traceroute, or [add your own commands](https://hyperglass.dev/configuration/directives).
- BGP Route, BGP Community, BGP AS Path, Ping, & Traceroute
- Full IPv6 support
- Customizable everything: features, theme, UI/API text, error messages, commands
- Built-in support for:
- Arista EOS
- BIRD
- Cisco IOS
- Cisco NX-OS
- Cisco IOS-XR
- FRRouting
- Huawei VRP
- Juniper Junos
- Mikrotik
- Nokia SR OS
- OpenBGPD
- TNSR
- VyOS
- Configurable support for any other [supported platform](https://hyperglass.dev/platforms)
- Built in support for:
- Arista EOS
- BIRD
- Cisco IOS-XR
- Cisco IOS/IOS-XE
- Cisco NX-OS
- FRRouting
- Huawei
- Juniper JunOS
- Mikrotik
- TNSR
- VyOS
- Configurable support for any other [supported platform](https://hyperglass.io/docs/platforms)
- Optionally access devices via an SSH proxy/jump server
- Access-list/prefix-list style query control to whitelist or blacklist query targets
- VRF support
- Access List/prefix-list style query control to whitelist or blacklist query targets on a per-VRF basis
- REST API with automatic, configurable OpenAPI documentation
- Modern, responsive UI built on [ReactJS](https://reactjs.org/), with [NextJS](https://nextjs.org/) & [Chakra UI](https://chakra-ui.com/), written in [TypeScript](https://www.typescriptlang.org/)
- Query multiple devices simultaneously
- Browser-based DNS-over-HTTPS resolution of FQDN queries
*To request support for a specific platform, please [submit a Github Issue](https://github.com/thatmattlove/hyperglass/issues/new) with the **feature** label.*
*To request support for a specific platform, please [submit a Github Issue](https://github.com/checktheroads/hyperglass/issues/new) with the **enhancement** label.*
### [Get Started →](https://hyperglass.dev/installation)
### [Get Started →](https://hyperglass.io/)
## Community
- [Slack](https://netdev.chat/)
- [Telegram](https://t.me/hyperglasslg)
- [Gitter](https://gitter.im/hyperglass)
- [Twitter](https://twitter.com/checktheroads)
- [Keybase](https://keybase.io/team/hyperglass)
Any users, potential users, or contributors of hyperglass are welcome to join and discuss usage, feature requests, bugs, and other things.
**hyperglass is developed with the express intention of being free to the networking community**.
*However, if you're feeling particularly helpful or generous, small donations are welcome.*
*However, the hyperglass demo does cost [@checktheroads](https://github.com/checktheroads) $60/year for the [hyperglass.io](https://hyperglass.io) domain. If you're feeling particularly helpful and want to help offset that cost, small donations are welcome.*
[![Donate](https://img.shields.io/badge/Donate-blue.svg?logo=paypal&style=for-the-badge)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZQFH3BB2B5M3E&source=url)
@ -72,9 +85,10 @@ Any users, potential users, or contributors of hyperglass are welcome to join an
hyperglass is built entirely on open-source software. Here are some of the awesome libraries used, check them out too!
- [FastAPI](https://fastapi.tiangolo.com/)
- [Netmiko](https://github.com/ktbyers/netmiko)
- [Litestar](https://litestar.dev)
- [Pydantic](https://docs.pydantic.dev/latest/)
- [Scrapli](https://github.com/carlmontanari/scrapli)
- [Pydantic](https://pydantic-docs.helpmanual.io/)
- [Chakra UI](https://chakra-ui.com/)
[![GitHub](https://img.shields.io/github/license/thatmattlove/hyperglass?color=330036&style=for-the-badge)](https://github.com/thatmattlove/hyperglass/blob/main/LICENSE)
[![GitHub](https://img.shields.io/github/license/checktheroads/hyperglass?color=330036&style=for-the-badge)](https://github.com/checktheroads/hyperglass/blob/v1.0.0/LICENSE)

View file

@ -1,48 +0,0 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": [
"node_modules",
"dist",
".next/",
"out/",
"favicon-formats.ts",
"custom.*[js, html]",
"hyperglass.json"
]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noUselessTypeConstraint": "off",
"noBannedTypes": "off"
},
"style": {
"noInferrableTypes": "off",
"noNonNullAssertion": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
}
}
},
"formatter": {
"indentStyle": "space",
"lineWidth": 100,
"indentWidth": 2
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"bracketSpacing": true,
"semicolons": "always",
"arrowParentheses": "asNeeded",
"trailingComma": "all"
}
}
}

View file

@ -1,21 +0,0 @@
services:
redis:
image: "redis:alpine"
hyperglass:
depends_on:
- redis
environment:
- HYPERGLASS_APP_PATH=/etc/hyperglass
- HYPERGLASS_HOST=${HYPERGLASS_HOST-0.0.0.0}
- HYPERGLASS_PORT=${HYPERGLASS_PORT-8001}
- HYPERGLASS_DEBUG=${HYPERGLASS_DEBUG-false}
- HYPERGLASS_DEV_MODE=${HYPERGLASS_DEV_MODE-false}
- HYPERGLASS_REDIS_HOST=${HYPERGLASS_REDIS_HOST-redis}
- HYPEGLASS_DISABLE_UI=${HYPEGLASS_DISABLE_UI-false}
- HYPERGLASS_CONTAINER=${HYPERGLASS_CONTAINER-true}
- HYPERGLASS_ORIGINAL_APP_PATH=${HYPERGLASS_APP_PATH}
build: .
ports:
- "${HYPERGLASS_PORT-8001}:${HYPERGLASS_PORT-8001}"
volumes:
- ${HYPERGLASS_APP_PATH-/etc/hyperglass}:/etc/hyperglass

28
docs/.gitignore vendored Normal file → Executable file
View file

@ -1,10 +1,20 @@
# Dependencies
/node_modules
# Production
/build
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env*
*.tsbuildinfo
*.tmp*
*.log
node_modules/
fonts/
.next
out
pages/changelog.mdx
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

33
docs/README.md Executable file
View file

@ -0,0 +1,33 @@
# Website
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
### Installation
```
$ yarn
```
### Local Development
```
$ yarn start
```
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
### Build
```
$ yarn build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
### Deployment
```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

View file

@ -1,29 +0,0 @@
type ColorProps = {
hex: string;
noText?: boolean;
};
export const Color = (props: ColorProps) => {
const { hex, noText = false } = props;
return (
<span className="color-swatch-container">
<span className={["nx-rounded-sm", "color-swatch"].join(" ")} />
<code>{noText ? "" : hex}</code>
<style jsx>{`
span.color-swatch-container {
display: inline-flex;
align-items: ${noText ? "flex-end" : "center"};
justify-content: space-between;
}
span.color-swatch {
display: inline-flex;
background-color: ${hex};
height: 1.5rem;
width: 1.5rem;
padding: 0.5rem 0.5rem;
margin-right: ${noText ? "unset" : "0.5rem"};
}
`}</style>
</span>
);
};

View file

@ -1,36 +0,0 @@
import NextLink from "next/link";
import { Button } from "nextra/components";
const DocsIcon = () => (
<svg
width="16"
height="16"
fill="currentColor"
viewBox="0 0 16 16"
xmlns="http://www.w3.org/2000/svg"
className="bi bi-file-earmark-text-fill"
>
<title>Docs</title>
<path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0M9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1M4.5 9a.5.5 0 0 1 0-1h7a.5.5 0 0 1 0 1zM4 10.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m.5 2.5a.5.5 0 0 1 0-1h4a.5.5 0 0 1 0 1z" />
</svg>
);
export interface DocsButtonProps extends React.ComponentProps<"button"> {
href: string;
side?: "left" | "right";
}
export const DocsButton = (props: DocsButtonProps) => {
const { href, side = "left", ...rest } = props;
return (
<NextLink href={href}>
<Button
title="Docs"
className={`nx-p-0 nx-m${side === "left" ? "r" : "l"}-2`}
{...rest}
>
<DocsIcon />
</Button>
</NextLink>
);
};

View file

@ -1,14 +0,0 @@
export const NotSupported = (props: React.ComponentProps<"svg">) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="#edae49"
viewBox="0 0 16 16"
{...props}
>
<title>Not Supported</title>
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" />
</svg>
);

View file

@ -1,44 +0,0 @@
import { Code, Table, Td, Th, Tr } from "nextra/components";
import platforms from "~/platforms.json";
import { NotSupported } from "./not-supported-icon";
import { Supported } from "./supported-icon";
export const SupportedPlatforms = () => (
<ul className="nx-mt-2 first:nx-mt-0 ltr:nx-ml-6 rtl:nx-mr-6">
{platforms.reduce<React.ReactNode[]>((final, platform) => {
if (platform.native) {
const element = (
<li key={platform.name}>
<Supported style={{ display: "inline", marginRight: "0.5rem" }} />
{platform.name}
</li>
);
final.push(element);
}
return final;
}, [])}
</ul>
);
export const PlatformTable = () => (
<Table>
<tbody>
<Tr>
<Th>Platform Keys</Th>
<Th>Natively Supported</Th>
</Tr>
{platforms.map((spec) => (
<Tr key={spec.keys.join("--")}>
<Td>
{spec.keys.map((key) => (
<Code className="nx-mx-2" key={key}>
{key}
</Code>
))}
</Td>
<Td align="center">{spec.native ? <Supported /> : <NotSupported />}</Td>
</Tr>
))}
</tbody>
</Table>
);

View file

@ -1,13 +0,0 @@
export const Supported = (props: React.ComponentProps<"svg">) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="#35b246"
viewBox="0 0 16 16"
{...props}
>
<title>Supported</title>
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" />
</svg>
);

20
docs/docs/.gitignore vendored Executable file
View file

@ -0,0 +1,20 @@
# Dependencies
/node_modules
# Production
/build
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View file

@ -0,0 +1,379 @@
---
id: adding-devices
title: Adding Devices
sidebar_label: Adding Devices
keywords:
[hyperglass, authentication, ssl, proxy, access list, prefix list, acl, help]
description: Adding devices to hyperglass
---
import Link from "@docusaurus/Link";
import R from "../src/components/Required";
import MiniNote from "../src/components/MiniNote";
import Code from "../src/components/JSXCode";
<div class="table--full-width" />
## Adding Devices
To add, as an example, a Cisco router, add the following to your `devices.yaml`, with the relevant details changed for your device:
```yaml title="devices.yaml"
routers:
- name: router01.pop01
address: 10.0.0.1
network: AS65000
credential:
username: username
password: password
display_name: Phoenix, AZ
port: 22
nos: cisco_ios
vrfs:
- name: default
ipv4:
source_address: 192.0.2.1
ipv6:
source_address: 2001:db8::1
```
## All Device Parameters
| Parameter | Type | Description |
| :------------------ | :-----: | :----------------------------------------------------------------------------------------------------------------- |
| <R/> `name` | String | Device hostname. This is not user-facing. |
| <R/> `address` | String | Device management hostname or IP address. |
| <R/> `network` | String | Primary network this device is a member of. Used for device grouping. Usually something like 'AS65000'. |
| <R/> `display_name` | String | Device's user-facing name. |
| <R/> `port` | Integer | TCP port used to connect to the device. |
| <R/> `nos` | String | Network Operating System. <MiniNote>Must be a <Link to="platforms">supported platform</Link>.</MiniNote> |
| `structured_output` | Boolean | Disabled output parsing to structured data. |
| <R/>`credential` | | [Device Credential Configuration](#credential) |
| <R/>`vrfs` | | [Device VRF Configuration](#vrfs) |
| `proxy` | | [SSH Proxy Configuration](#proxy) |
| `ssl` | | [SSL Configuration](#ssl) for devices using [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent). |
### `proxy`
Any device that uses SSH (see [platforms](platforms) for breakdown) can be accessed through an intermediary SSH "proxy". The process is nearly identical to using local SSH tunneling, e.g. `ssh -L local_port:remote_device:remote_port username@proxy_server -p proxy_port`.
| Parameter | Type | Default | Description |
| :---------------- | :-----: | :------------ | :--------------------------------------------------------------------------------------------------------------- |
| <R/> `name` | String | | Proxy hostname. |
| <R/> `address` | String | | Proxy management hostname or IP address. |
| <R/> `credential` | | | [Proxy Credential Configuration](#credential) |
| `nos` | String | `'linux_ssh'` | Proxy's network operating system. <MiniNote>Must be a <Link to="platforms">supported platform</Link>.</MiniNote> |
| `port` | Integer | `22` | TCP port user to connect to the proxy. |
:::important
Currently, only `linux_ssh` has been tested and validated for use as an SSH proxy.
:::
### `credential`
While all devices require a credential mapping, the credential values themselves may be used in different ways depending on the device NOS. For SSH devices, the credential is used as a typical SSH username and password.
For HTTP devices (i.e. devices using [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent)), the username is ignored and the password is used as a secret for [JSON Web Token](https://tools.ietf.org/html/rfc7519) encoding/decoding.
| Parameter | Type | Description |
| :-------------- | :----- | :----------------------------------------------------------- |
| <R/> `username` | String | Username |
| `password` | String | Password <MiniNote>Passwords will never be logged</MiniNote> |
| `key` | Path | Path to SSH Private Key |
To use SSH key authentication, simply specify the path to the SSH private key with `key:`. If the key is encrypted, set the private key's password to the with the `password:` field, and hyperglass will use it to decrypt the SSH key.
### `ssl`
HTTP devices may optionally use SSL for the connection between hyperglass and the device. This is **disabled** by default, which means devices will use unencrypted HTTP by default.
If SSL is enabled, the public key of the device must be provided in the form of an accessible absolute file path. With SSL enabled and a valid certificate specified, every connection to the device will use HTTPS in addition to payload encoding with [JSON Web Tokens](https://tools.ietf.org/html/rfc7519).
| Parameter | Type | Description |
| :---------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | Enable or disable the use of SSL. <MiniNote>If enabled, a certificate file must be specified (hyperglass does not support connecting to a device over an unverified SSL session).</MiniNote> |
| <R/> `cert` | String | Absolute path to agent's public RSA key. |
### `vrfs`
The VRFs section is a list of available VRFs for a given device. Each VRF may be configured with the following fields:
| Parameter | Type | Description |
| :------------- | :----- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <R/> `name` | String | The VRF's name, as known **by the device**. <MiniNote>hyperglass sends this field to the device for queries, so it needs to match the device's configuration.</MiniNote> |
| `display_name` | String | The VRF's user-facing name. This field's value is visible in the UI. <MiniNote>If this is not specified, hyperglass will try to create a "pretty" display name based on the `name` field.</MiniNote> |
| `info` | | [Per-VRF Contextual Help Configuration](#info) |
| `ipv4` | | [VRF's IPv4 Configuration](#ipv4) |
| `ipv6` | | [VRF's IPv6 Configuration](#ipv6) |
#### `ipv4`
May be set to `null` to disable IPv4 for this VRF, on the parent device.
| Parameter | Type | Description |
| :-------------------- | :------ | :-------------------------------------------------------------------- |
| <R/> `source_address` | String | Device's source IPv4 address for directed queries (ping, traceroute). |
| `force_cidr` | Boolean | `true` | Convert IP host queries to actual advertised containing prefix length |
| `access_list` | | <Link to="#access_list">IPv4 Access List Configuration</Link> |
#### `ipv6`
May be set to `null` to disable IPv6 for this VRF, on the parent device.
| Parameter | Type | Default | Description |
| :-------------------- | :------ | :------ | :-------------------------------------------------------------------- |
| <R/> `source_address` | String | | Device's source IPv6 address for directed queries (ping, traceroute). |
| `force_cidr` | Boolean | `true` | Convert IP host queries to actual advertised containing prefix length |
| `access_list` | | | [IPv6 Access List Configuration](#access_list) |
:::note
The `force_cidr` option will ensure that a **BGP Route** query for an IP host (/32 IPv4, /128 IPv6) is converted to its containing prefix. For example, a query for `1.1.1.1` would be converted to a query for `1.1.1.0/24`. This is because not all platforms support a BGP lookup for a host (this is primary a problem with IPv6, but the option applies to both address families).
When `force_cidr`is set to `true`, hyperglass will perform a lookup via the [bgp.tools](https://bgp.tools) whois API to get the advertised prefix for an IP host.
:::
#### `access_list`
The `access_list` block can be thought of like a prefix-list from Cisco IOS. It is a list of rules, where the first matching rule is the action executed.
| Parameter | Type | Default | Description |
| :------------- | :------ | :-----------: | :-------------------------------------------------------------------------- |
| <R/> `network` | String | | This rule's IPv4 or IPv6 base prefix |
| `action` | String | `'permit'` | This rule's action. Must be `permit` or `deny` |
| `ge` | Integer | `0` | To match this rule, the target prefix must be greater than or equal to `ge` |
| `le` | Integer | `32` \| `128` | To match this rule, the target prefix must be less than or equal to `le` |
#### `info`
Each VRF may enable, disable, or customize the contextual help menu for each enabled query type. The following parameters may be defined under any query type:
| Parameter | Type | Default | Description |
| :-------- | :------ | :-----: | :-------------------------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the help menu for this command. |
| `file` | String | | Path to a plain text or markdown file containing customized help information for this command. |
| `params` | Object | | Any arbitrary key/value pairs where the value will replace any occurrences of the key when wrapped in braces (e.g. `{key}`) |
For example:
```yaml title="devices.yaml"
routers:
- name: router01
vrfs:
- name: demo_vrf
info:
bgp_route:
enable: true
file: /etc/hyperglass/customer_bgp_route.md
params:
vrf_name: Customer A
ping:
enable: false
bgp_community:
enable: true
file: /etc/hyperglass/customer_bgp_community.md
params:
vrf_name: Customer A
community: "65000"
```
## Telnet
Telnet support is provided via the underlying device connection handling framework, [Netmiko](https://github.com/ktbyers/netmiko). To connect to a device via serial, add the suffix `_telnet` to the device's `nos` value and set the `port` value to `23`.
For example:
```yaml {3-4} title="devices.yaml"
routers:
- name: router01
nos: cisco_ios_telnet
port: 23
...
```
## Full Example
Below is a full example with nearly every available knob turned:
```yaml title="devices.yaml"
routers:
# HTTP/hyperglass-agent device
- name: router01
display_name: HTTP Router
address: 192.0.2.1
network:
name: primary
display_name: AS65000
credential:
username: madeup
password: txeTTIqwhKSJi4V3tefXQASf5AyGZ6cPsycS9nYLpKk
ssl:
enable: true
cert: /etc/hyperglass/certs/router01.pem
port: 8080
nos: frr
vrfs:
- name: default
ipv4:
source_address: 192.0.2.1
access_list:
- network: 10.0.0.0/8
action: deny
ge: 8
le: 32
- network: 0.0.0.0/0
action: permit
le: 24 # Only allow /24 or smaller prefixes
ipv6:
source_address: 2001:db8::1
access_list:
- network: ::/0
action: permit
proxy: null
# SSH/netmiko device
- name: router02
address: 10.0.0.1
network:
name: primary
display_name: AS65000
credential:
username: user
password: pass
display_name: SSH Router
port: 22
nos: cisco_ios
vrfs:
- name: default
ipv4:
source_address: 192.0.2.2
access_list:
- network: 10.0.0.0/8
action: deny
ge: 8
le: 32
- network: 0.0.0.0/0
action: permit
ipv6:
source_address: 2001:db8::2
access_list:
- network: ::/0
action: permit
le: 64 # Only allow /64 or smaller prefixes
- name: special_customer
display_name: Customer Name
ipv4:
source_address: 172.16.0.1
access_list:
- network: 172.16.0.0/16
action: allow
ipv6: null # disable IPv6 for this VRF
info:
bgp_route:
file: /etc/hyperglass/help/customer_bgp_route.md
params:
customer_name: Customer Name
proxy:
name: jump_server
address: 10.0.1.100
port: 22
credential:
username: user
password: pass
nos: linux_ssh
```
## YAML Anchors & Aliases
If you have a lot of devices with shared configuration parameters, you may want to look into **YAML Anchors and Aliases**. If you've never used them before, they can be pretty weird looking at first read. Atlassian [has a pretty decent guide](https://confluence.atlassian.com/bitbucket/yaml-anchors-960154027.html).
Here's an example of using this to share two sets of credentials among multiple devices:
```yaml title="devices.yaml"
my_credentials:
- credential: &credential1
username: madeup1
password: gY018mR4gx4sVqc0
- credential: &credential2
username: madeup2
password: 0eMEJ4ZpB6ofkiIF
routers:
- name: router01
credential: *credential1
- name: router02
credential: *credential2
- name: router03
credential: *credential1
- name: router04
credential: *credential2
```
:::important
Nothing other than the `routers` key is read by hyperglass. In the above example, `my_credentials` is just an arbitrary list of mappings, is completely optional, and can be named whatever you want.
:::
For a more complex example, here's an example of how to use YAML aliases & anchors to share a common VRF configuration among multiple devices, while overriding key variables such as the `source_address` key:
```yaml title="devices.yaml"
my_vrfs:
- &default
name: default
display_name: Global
ipv4:
access_list: &default_ipv4_acl
- network: 10.0.0.0/8
action: deny
- network: 192.168.0.0/16
action: deny
- network: 172.16.0.0/12
action: deny
- network: 0.0.0.0/0
action: permit
ge: 8
le: 24
ipv6:
access_list: &default_ipv6_acl
- network: ::/0
action: permit
ge: 32
le: 64
- &customer_a
name: customer_a
display_name: Customer A
ipv4:
access_list: &customer_a_ipv4_acl
- network: 10.0.0.0/8
action: permit
- network: 0.0.0.0/0
action: deny
ipv6: null
routers:
- name: router01
vrfs:
- <<: *default
ipv4:
source_address: 192.0.2.1
access_list: *default_ipv4_acl
ipv6:
source_address: 2001:db8::1
access_list: *default_ipv6_acl
- <<: *customer_a
ipv4:
source_address: 10.0.0.1
access_list: *customer_a_ipv4_acl
- name: router02
vrfs:
- <<: *default
ipv4:
source_address: 192.0.2.2
access_list: *default_ipv4_acl
ipv6:
source_address: 2001:db8::2
access_list: *default_ipv6_acl
- <<: *customer_a
ipv4:
source_address: 10.0.0.2
access_list: *customer_a_ipv4_acl
```

View file

@ -0,0 +1,81 @@
---
id: installation
title: Linux Agent Installation
sidebar_label: Installation
keywords: [configuration, linux, frr, frrouting, bird, agent]
description: Install hyperglass-agent on your system
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
:::important In Progress
Documentation for [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent) is in progress!
:::
## Installation
### Dependencies
On the Linux server running [FRRouting](https://frrouting.org/) or [BIRD](https://bird.network.cz/), make sure Python 3.6+ is installed:
<Tabs
defaultValue="debian"
values={[
{ label: 'Ubuntu', value: 'ubuntu' },
{ label: 'Debian', value: 'debian' },
{ label: 'RHEL/CentOS', value: 'rhel' }]}>
<TabItem value="ubuntu">
```shell-session
$ sudo apt install -y python3.6-dev python3-pip
```
</TabItem>
<TabItem value="debian">
```shell-session
$ sudo apt install -y python3 python3-pip libssl-dev
```
</TabItem>
<TabItem value="rhel">
You can install python from the CentOS 7 repository:
```shell-session
$ sudo yum install python3-devel python3-pip
```
But you can also use the [SCL repository](https://www.softwarecollections.org/en/scls/rhscl/rh-python36/)
```shell-session
$ sudo yum install centos-release-scl
$ sudo yum install rh-python36
```
</TabItem>
</Tabs>
You can then verify your Python 3 version:
```shell-session
$ python3 --version
Python 3.6.9
```
### Application
Now that Python 3.6+ is installed, you can install the hyperglass agent:
```shell-session
$ pip3 install hyperglass-agent
```
:::important More coming soon
Documentation for [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent) is in progress!
:::

View file

@ -0,0 +1,64 @@
---
id: parameters
title: Agent Configuration Parameters
sidebar_label: Parameters
keywords: [hyperglass, agent, hyperglass-agent, configuration, parameters]
description: hyperglass-agent configuration parameters.
---
import M from "../../src/components/MiniNote";
import PL from "../../src/components/PageLink";
<div class="table--full-width" />
## Configuration File
hyperglass-agent configuration consists of one [YAML](https://yaml.org/) configuration files:
- `config.yaml`
The configuration file may be located in one of the following directories:
- `/etc/hyperglass-agent`
- `~/hyperglass-agent`
## Global Settings
| Parameter | Type | Default | Description |
| :------------------ | :-----: | :------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| `debug` | Boolean | `false` | Enable application-wide debug mode. **This will generate a log of logs!** |
| `listen_address` | String | `'0.0.0.0'` | Local IPv4/IPv6 Address the hyperglass-agent application listens on to respond to hyperglass queries. |
| `listen_port` | Integer | `8080` or `8443` | Local TCP port the hyperglass-agent application listens on to respond to hyperglass queries. |
| `mode` | String | `'frr'` | FRRouting or BIRD agent mode. |
| `secret` | String | Randomly generated | Password used to sign [JWT](https://jwt.io) tokens. <M>The <code>secret</code> must match the <code>password</code> in hyperglass.</M> |
| `valid_duration` | Integer | `60` | Duration in seconds for which any query is valid. Used as the `exp` claim in the JWT. |
| `not_found_message` | String | `'{target} not found. ({afi})'` | Message returned if the response is empty. `{target}` will be replaced with the `query_target` and `{afi}` will be replaced with the address-family. |
### Subsections
From the top level, the following subsections may be defined and configured:
| Section | Description | All Options |
| :-------- | :------------------------------------- | :-----------------------: |
| `ssl` | Redis server & cache timeout settings. | <PL to="#ssl">➡️</PL> |
| `logging` | API documentation settings. | <PL to="#logging">➡️</PL> |
## SSL
| Parameter | Type | Default | Description |
| :-------- | :------: | :------------------------------ | :----------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the SSL/HTTPS. |
| `cert` | FilePath | `<install path>/agent_cert.pem` | Valid path to SSL certificate public key. |
| `key` | FilePath | `<install path>/agent_key.pem` | Valid path to SSL certificate private key. |
While you can use your own SSL certificates, hyperglass-agent will generate self-signed certificates for you by default. They will be generated during the [setup process](setup.mdx), or you can run the `hyperglass-agent certificate` command.
## Logging
By default, hyperglass-agent writes all log messages to a log file located at `/tmp/hyperglass-agent.log`. This behavior and other file logging parameters may be overridden if needed:
| Parameter | Type | Default | Description |
| :---------- | :------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `directory` | FilePath | `/tmp/` | Directory at which to write the log file `hyperglass-agent.log`. Use `false` to disable file logging. |
| `format` | String | `'text'` | `'text'` for plain text non-structured logging, `'json'` for JSON structured logging. If JSON is enabled, the log file name will be `hyperglass-agent.log.json` |
| `max_size` | String | `'50MB'` | Maximum log file size before old logs are overwritten. |

55
docs/docs/agent/setup.mdx Normal file
View file

@ -0,0 +1,55 @@
---
id: setup
title: Linux Agent Setup
sidebar_label: Setup
keywords: [configuration, linux, frr, frrouting, bird, agent]
description: Configure hyperglass-agent
---
import M from "../../src/components/MiniNote";
:::caution Time & NTP
Before you get too far, check to make sure your hyperglass server and hyperglass-agent system are both properly synchronized with an NTP server. During the setup process and on every interaction, hyperglass and hyperglass-agent exchange [JWT](https://jwt.io/) tokens with a relatively short window (**60 seconds, by default**) in which to validate the payload. If the system clock on either system is askew by too much, this exchange can fail.
:::
## Setup
To automatically create an application directory, generate SSL certificates, generate and symlink a systemd file, and generate a random secret, run:
```shell-session
$ hyperglass-agent setup
```
During the setup process, you'll be prompted to:
- Select an installation directory.<M>Must be <code>/etc/hyperglass-agent</code> or <code>~/hyperglass-agent</code></M>
- Update hyperglass's `devices.yaml` file with a generated secret
- Verify the hostname of the device. <M>The hostname you verify is used to generate the agent's SSL certificate, and needs to be DNS-resolvable by hyperglass.</M>
- Select IP addresses from the device's interfaces that hyperglass would use to communicate with the agent. <M>The IP addresses are added as Subject Alternative Names to the generated SSL certificate, so that you can point hyperglass to the agent by IP address if needed, but still leverage SSL validation.</M>
- Enter the URL of your hyperglass. <M>hyperglass-agent will send the public key of your SSL certificate to hyperglass, so that future communication between hyperglass and hyperglass-agent is authenticated and encrypted.</M>
After these prompts, the agent's SSL public & private keys and a configuration file will be generated and saved to your installation directory. A systemd service file will also be generated, saved to your installation directory, and symlinked to `/etc/systemd/system/hyperglass-agent.service`.
:::note
You can also run the setup wizard with certain options disabled, if needed:
```shell-session
$ hyperglass-agent setup --help
Usage: hyperglass-agent setup [OPTIONS]
Run the setup wizard
Options:
--no-config Don't regenerate config file
--no-certs Don't regenerate certificates
--no-systemd Don't generate a systemd file
--no-send Don't send the SSL certificate to hyperglass
--force Force regeneration of config file
-h, --help Show this message and exit.
```
:::
:::important More coming soon
Documentation for [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent) is in progress!
:::

132
docs/docs/commands.mdx Normal file
View file

@ -0,0 +1,132 @@
---
id: commands
title: Command Customization
sidebar_label: Command Customization
keywords:
[
hyperglass,
commands,
customize,
cisco,
ios,
ios-xe,
ios-xr,
juniper,
junos,
arista,
eos,
huawei,
vrp,
]
description: Custom Commands
---
hyperglass comes with built in support for the following platforms:
- Cisco IOS & IOS-XE
- Cisco IOS-XR
- Juniper JunOS
- Arista EOS
- Huawei VRP
- VyOS
:::warning VyOS & VRFs
As of `vyos-1.3-rolling-202007050117` which is the latest release VyOS has been tested with hyperglass, VyOS does not support BGP or other dynamic routing protocols in a VRF. As such, the default BGP commands for VyOS **omit the VRF from the command**.
:::
Default commands for each of these network operating systems are built into hyperglass. However, you may override any of them or even add commands for another Network Operating System (NOS), as long as it's [supported](platforms).
To define custom commands, add a `commands.yaml` file to your installation directory (`/etc/hyperglass`,
`~/hyperglass`).
Each command definition carries the following structure:
```yaml title="commands.yaml"
command_name:
ipv4_default:
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...
ipv6_default:
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...
ipv4_vpn:
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...
ipv6_vpn:
bgp_route: ...
bgp_aspath: ...
bgp_community: ...
ping: ...
traceroute: ...
```
`ipv4_default` and `ipv6_default` reference the commands used in the default routing table/VRF, while `ipv4_vpn` and `ipv6_vpn` reference the commands used in **any** configured VRF. Every command will have the following keywords replaced:
| Keyword | Description |
| :--------- | :--------------------------------------------------------------- |
| `{target}` | Query Target (IP address, community, AS Path). |
| `{vrf}` | If it's a VRF query, the [name of the VRF](adding-devices#vrfs). |
## Overriding Built-In Commands
As an example, you could override the default Juniper `bgp_route` command for the default routing table like this:
```yaml {4} title="commands.yaml"
---
juniper:
ipv4_default:
bgp_route: "show route protocol bgp {target} terse"
```
If the NOS key (`juniper`, in this case) matches the [supported platform key](platforms), only the command you specify will be overridden.
## Adding a Custom Command Set
You can define any arbitrary set of commands to use for any supported device. When defining a custom command, **you must define _all_ commands**, even if they're disabled in your [configuration](query-settings) or otherwise unused.
```yaml title="commands.yaml"
---
special_commands:
ipv4_default:
bgp_route: "show ip route {target}"
bgp_aspath: "show ip bgp as-path {target}"
bgp_community: "show ip bgp community {target}"
ping: "ping {target}"
traceroute: "traceroute {target}"
ipv6_default:
bgp_route: "show ipv6 route {target}"
bgp_aspath: "show ipv6 bgp as-path {target}"
bgp_community: "show ipv6 bgp community {target}"
ping: "ping6 {target}"
traceroute: "traceroute6 {target}"
ipv4_vpn:
bgp_route: "show ip route {target} vrf {vrf}"
bgp_aspath: "show ip bgp as-path {target} vrf {vrf}"
bgp_community: "show ip bgp community {target} vrf {vrf}"
ping: "ping {target} vrf {vrf}"
traceroute: "traceroute {target} vrf {vrf}"
ipv6_vpn:
bgp_route: "show ipv6 route {target} vrf {vrf}"
bgp_aspath: "show ipv6 bgp as-path {target} vrf {vrf}"
bgp_community: "show ipv6 bgp community {target} vrf {vrf}"
ping: "ping6 {target} vrf {vrf}"
traceroute: "traceroute6 {target} vrf {vrf}"
```
After adding the custom command to `commands.yaml`, reference its name under the device's `commands:` key in `devices.yaml`:
```yaml {4} title="devices.yaml"
---
routers:
- name: specialrouter01
commands: special_commands
```

139
docs/docs/getting-started.mdx Executable file
View file

@ -0,0 +1,139 @@
---
id: getting-started
title: Getting Started
sidebar_label: Getting Started
keywords: [install, configuration]
description: Getting started with hyperglass
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
## Automatic installation
If your system runs on:
- Ubuntu Linux
- ~~CentOS/Red Had Linux~~
- macOS (requires [homebrew](https://brew.sh))
You should be able to proceed with the automatic installation:
```shell-session
$ curl https://install.hyperglass.io | sudo bash
```
:::caution Piping to bash
You should be <i>very</i> worried when someone asks you to do what I just did. Downloading a bash script from the internet and piping it to `bash` with root privileges is a terrible idea, unless you fully trust the source. Please don't trust me - go [look at the code](https://github.com/checktheroads/hyperglass/blob/v1.0.0/install.sh) and determine for your self if it's safe to execute. If you feel it's not, please proceed with the manual installation (and [tell me why](https://github.com/checktheroads/hyperglass/issues), so I can fix it).
:::
## Manual Installation
### System Dependencies
#### Python
hyperglass is written in Python 3 and requires Python version 3.6 as a minimum dependency.
If you're confident upgrading your system's version of Python won't break your system (many Linux operating systems rely heavily on Python for package management and other system functions), you can install Python 3.6:
<Tabs
defaultValue="debian"
values={[
{ label: 'Debian/Ubuntu', value: 'debian' },
{ label: 'RHEL/CentOS', value: 'rhel' }]}>
<TabItem value="debian">
```shell-session
$ sudo apt install -y python3.6-dev python3-pip
```
</TabItem>
<TabItem value="rhel">
Documentation for CentOS is still in-progress. However, it's been determined that these dependencies _may_ also be required, depending on the version of CentOS:
```shell-session
$ sudo yum install libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel \
freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel \
harfbuzz-devel fribidi-devel libraqm-devel libimagequant-devel \
libxcb-devel ncurses-devel
```
Until further testing with CentOS can be done, you should install the above dependencies _before_ installing Python 3. You may have to uninstall and re-install Python 3 if these dependencies weren't already installed.
You can install python from the CentOS 7 repository:
```shell-session
$ sudo yum install python3-devel python3-pip
```
But you can also use the [SCL repository](https://www.softwarecollections.org/en/scls/rhscl/rh-python36/)
```shell-session
$ sudo yum install centos-release-scl
$ sudo yum install rh-python36
```
</TabItem>
</Tabs>
You can then verify your Python 3 version:
```shell-session
$ python3 --version
Python 3.6.9
```
#### Other Dependencies
The hyperglass UI is written in [ReactJS](https://reactjs.org/). As such, some Javascript dependencies are required. hyperglass also relies on [Redis](https://redis.io/) for caching purposes.
<Tabs
defaultValue="debian"
values={[
{ label: 'Debian/Ubuntu', value: 'debian' },
{ label: 'RHEL/CentOS', value: 'rhel' }]}>
<TabItem value="debian">
```shell-session
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
$ sudo apt update
$ sudo apt install -y nodejs yarn redis-server
$ sudo systemctl enable redis-server
$ sudo systemctl restart redis-server
```
</TabItem>
<TabItem value="rhel">
```shell-session
$ curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
$ curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
$ sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
$ sudo yum -y install gcc-c++ make nodejs yarn redis
$ sudo systemctl enable redis
$ sudo systemctl restart redis
```
</TabItem>
</Tabs>
### Application
```shell-session
$ pip3 install hyperglass
```

View file

@ -0,0 +1,53 @@
---
id: introduction
title: Introduction
sidebar_label: Introduction
description: Welcome to hyperglass
---
import Link from "@docusaurus/Link";
import useBaseUrl from "@docusaurus/useBaseUrl";
import classnames from "classnames";
import styles from "./styles.module.css";
## What is hyperglass?
**hyperglass** is an open source network looking glass written by a network engineer for other network engineers. The purpose of a looking glass is to provide customers, peers, and complete strangers with unattended visibility into the an operator's network.
hyperglass was created with the lofty goal of benefiting the internet community at-large by providing a faster, easier, and more secure way for operators to provide looking glass services to their customers, peers, and other network operators.
## Features
- BGP Route, BGP Community, BGP AS Path, Ping, & Traceroute
- Full IPv6 support
- Customizable everything: features, theme, UI/API text, error messages, commands
- Built in support for:
- Arista EOS
- BIRD
- Cisco IOS-XR
- Cisco IOS/IOS-XE
- Cisco NX-OS
- FRRouting
- Huawei
- Juniper JunOS
- Mikrotik
- TNSR
- VyOS
- Configurable support for any other [supported platform](platforms.mdx)
- Optionally access devices via an SSH proxy/jump server
- VRF support
- Access List/prefix-list style query control to whitelist or blacklist query targets on a per-VRF basis
- REST API with automatic, configurable OpenAPI documentation
- Modern, responsive UI built on [ReactJS](https://reactjs.org/), with [NextJS](https://nextjs.org/) & [Chakra UI](https://chakra-ui.com/)
- Query multiple devices simultaneously
- Browser-based DNS-over-HTTPS resolution of FQDN queries
<Link
className={classnames(
"button button--outline button--secondary button--lg",
styles.getStarted
)}
to={useBaseUrl("docs/getting-started")}
>
Get Started
</Link>

30
docs/docs/license.mdx Normal file
View file

@ -0,0 +1,30 @@
---
id: license
title: License
sidebar_label: License
keywords: [hyperglass, license, open source]
description: hyperglass License
---
import Datetime from "../src/components/Datetime";
import styles from "./styles.module.css";
### The Clear BSD License
Copyright © <Datetime className={styles.year} year/> Matthew Love
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

124
docs/docs/logging.mdx Normal file
View file

@ -0,0 +1,124 @@
---
id: logging
title: Logging & Webhooks
sidebar_label: Logging & Webhooks
keywords: [hyperglass, logging, webhook, hooks, syslog]
description: hyperglass Logging
---
hyperglass supports multiple types of logging, for both application troubleshooting and general reporting.
<div class="table--full-width" />
## File Logging
By default, hyperglass writes all log messages to a log file located at `/tmp/hyperglass.log`. This behavior and other file logging parameters may be overridden if needed:
| Parameter | Type | Default | Description |
| :---------- | :----: | :------- | :------------------------------------------------- |
| `directory` | String | `'/tmp'` | Valid directory where the log file can be written. |
| `format` | String | `'text'` | Log format - may be either `'text'` or `'json'`. |
| `max_size` | String | `'50MB'` | Maximum log file size before logs are rotated. |
The `logging` subsection contains additional subsections of its own for configuring other logging methods:
| Section | Description | All Options |
| :------- | :-------------------- | :------------------------------------: |
| `syslog` | Syslog settings | <PageLink to="#syslog">➡️</PageLink> |
| `http` | HTTP webhook settings | <PageLink to="#webhooks">➡️</PageLink> |
:::note
You do not have to set `enable: false` to disable syslogging or webhooks - if there is no configuration under the `syslog` or `http` subsections, it the option is disabled by default. The `enable` option exists for easy toggling without having to delete the other settings.
:::
## Syslog
If syslogging is enabled, all of the same log messages written to the file and/or stdout will be forwarded to the syslog server.
| Parameter | Type | Default | Description |
| :-------- | :-----: | :------ | :------------------------------------------------ |
| `enable` | Boolean | `true` | Optionally disable syslogging even if configured. |
| `host` | String | | Syslog target IP address or hostname. |
| `port` | Integer | `514` | Syslog target UDP port number. |
## Webhooks
If http logging is enabled, an HTTP POST will be sent to the configured target every time a query is submitted, _after_ it is validated.
| Parameter | Type | Default | Description |
| :----------- | :-----: | :---------- | :-------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Optionally disable webhooks even if configured. |
| `host` | String | | HTTP URL to webhook target. |
| `headers` | Mapping | | Any arbitrary mappings, which will be sent as HTTP headers. |
| `params` | Mapping | | Any arbitrary mappings, which will be sent as URL parameters (e.g. `http://example.com/log?param=value`). |
| `verify_ssl` | Boolean | `true` | Verify SSL certificate of target. |
| `timeout` | Integer | `5` | Time in seconds before request times out. |
| `provider` | String | `'generic'` | Webhook provider. |
### Supported Providers
| Provider | Parameter Value |
| :--------------------------------------------------------------------------------------------------- | --------------: |
| Generic | `'generic'` |
| [Microsoft Teams](https://www.microsoft.com/en-us/microsoft-365/microsoft-teams/group-chat-software) | `'msteams'` |
| [Slack](https://slack.com/) | `'slack'` |
### Authentication
Basic and API key authentication are supported.
| Parameter | Type | Default | Description |
| :--------- | :----: | :-------- | :------------------------------------------------------------------------ |
| `mode` | String | `'basic'` | Authentication mode. Must be `'basic'` or `'api_key'` |
| `username` | String | | Username for basic authentication. |
| `password` | String | | Password for basic authentication, or API Key for API key authentication. |
:::important
If `api_key` is used, the header `X-API-Key: {key}` is added to the request, where `{key}` is the password.
:::
### Webhook Data Structure
If the `provider` field is set to `'generic'`, the webhook will POST JSON data in the following format:
```json
{
"query_location": "router01",
"query_type": "bgp_route",
"query_vrf": "default",
"query_target": "1.1.1.0/24",
"headers": {
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
"referer": "http://lg.example.com/",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-US,en;q=0.9,fr;q=0.8,lb;q=0.7,la;q=0.6"
},
"source": "192.0.2.1",
"network": {
"prefix": "192.0.2.0/24",
"asns": ["64496"]
}
}
```
## Full example
```yaml title="hyperglass.yaml"
logging:
directory: /var/log
format: json
max_size: 10 MB
syslog:
host: syslog.example.com
http:
host: "https://example.com/logs"
authentication:
mode: basic
username: your username
password: your password
headers:
X-Special-Header: your header value
params:
app: hyperglass # URL would be https://example.com/logs?app=hyperglass
verify_ssl: false
```

53
docs/docs/messages.mdx Normal file
View file

@ -0,0 +1,53 @@
---
id: messages
title: Messages
sidebar_label: Messages
keywords: [configuration, messages, text, ui, customization]
description: hyperglass messages configuration
---
import Link from "@docusaurus/Link";
import Code from "../src/components/JSXCode";
All user-facing status messages can be customized if needed.
<div class="table--full-width" />
| Parameter | Type | Default | Description |
| :--------------------- | :----: | :-------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `acl_denied` | String | `'"{target} is a member of {denied_network}, which is not allowed."'` | Displayed when a query target is explicitly denied by a matched VRF's ACL entry. `{target}` and `{denied_network}` will be replaced with the denied query target and the ACL entry that caused it to be denied. |
| `acl_not_allowed` | String | `'{target} is not allowed.'` | Displayed when a query target is implicitly denied by a matched VRF's ACL. `{target}` will be replaced with the denied query target. |
| `authentication_error` | String | `'Authentication error occurred.'` | Displayed when hyperglass is unable to authenticate to a configured device. Usually, this indicates a configuration error. `{device_name}` and `{error}` will be replaced with the device in question and the specific connection error. |
| `connection_error` | String | `'Error connecting to {device_name}: {error}'` | Displayed when hyperglass is unable to connect to a configured device. Usually, this indicates a configuration error. `{device_name}` and `{error}` will be replaced with the device in question and the specific connection error. |
| `feature_not_enabled` | String | `'{feature} is not enabled for {device_name}.'` | Displayed when a query type is submitted that is not supported or disabled. The UI performs validation of supported query types prior to submitting any requests, so this is primarily relevant to the hyperglass API. `{feature}` and `{device_name}` will be replaced with the disabled feature and the selected device/location. |
| `general` | String | `'Something went wrong.'` | Displayed when generalized errors occur. Seeing this error message may indicate a bug in hyperglass, as most other errors produced are highly contextual. If you see this in the wild, try enabling <Link to="/docs/configuration#global-settings"><Code>debug</Code></Link> mode and review the logs to pinpoint the source of the error. |
| `invalid_field` | String | `'{input} is an invalid {field}.'` | Displayed when a query field contains an invalid or unsupported value. `{input}` and `{field}` will be replaced with the invalid input value and corresponding field name. |
| `invalid_input` | String | `'{target} is not a valid {query_type} target.'` | Displayed when a query target's value is invalid in relation to the corresponding query type. `{target}` and `{query_type}` will be replaced with the invalid target and corresponding query type. |
| `no_input` | String | `'{field} must be specified.'` | Displayed when no a required field is not specified. `{field}` will be replaced with the `display_name` of the field that was omitted. |
| `no_output` | String | `'The query completed, but no matching results were found.'` | Displayed when hyperglass can connect to a device and execute a query, but the response is empty. |
| `no_response` | String | `'No response.'` | Displayed when hyperglass can connect to a device, but no output is able to be read. Seeing this error may indicate a bug in hyperglass or one of its dependencies. If you see this in the wild, try enabling <Link to="/docs/configuration#global-settings"><Code>debug</Code></Link> mode and review the logs to pinpoint the source of the error. |
| `parsing_error` | String | `'An error occurred while parsing the query output.'` | Displayed when hyperglass can connect to a device and execute a query, but the response cannot be parsed. |
| `request_timeout` | String | `'Request timed out.'` | Displayed when the <Link to="/docs/configuration#global-settings"><Code>request_timeout</Code></Link> time expires. |
| `vrf_not_associated` | String | `'VRF {vrf_name} is not associated with {device_name}.'` | Displayed when a query request's VRF field value contains a VRF that is not configured or associated with the corresponding location/device. The UI automatically filters out VRFs that are not configured on a selected device, so this error is most likely to appear when using the hyperglass API. `{vrf_name}` and `{device_name}` will be replaced with the VRF in question and corresponding device. |
| `vrf_not_found` | String | `'VRF {vrf_name} is not defined.'` | Displayed when a query VRF is not configured on any devices. The UI only shows configured VRFs, so this error is most likely to appear when using the hyperglass API. `{vrf_name}` will be replaced with the VRF in question. |
## Example
```yaml title="hyperglass.yaml"
messages:
acl_denied: "{target} is a member of {denied_network}, which is not allowed."
acl_not_allowed: "{target} is not allowed."
authentication_error: Authentication error occurred.
connection_error: "Error connecting to {device_name}: {error}"
feature_not_enabled: "{feature} is not enabled for {device_name}."
general: Something went wrong.
invalid_field: "{input} is an invalid {field}."
invalid_input: "{target} is not a valid {query_type} target."
no_input: "{field} must be specified."
no_output: The query completed, but no matching results were found.
no_response: No response.
parsing_error: An error occurred while parsing the query output.
request_timeout: Request timed out.
vrf_not_associated: VRF {vrf_name} is not associated with {device_name}.
vrf_not_found: VRF {vrf_name} is not defined.
```

90
docs/docs/parameters.mdx Normal file
View file

@ -0,0 +1,90 @@
---
id: parameters
title: Configuration Parameters
sidebar_label: Parameters
keywords: [hyperglass, configuration, parameters]
description: hyperglass configuration parameters.
---
import MiniNote from "../src/components/MiniNote";
import PageLink from "../src/components/PageLink";
hyperglass is meant to be _extremely_ customizable, but with reasonable defaults that most operators won't need to override. Even though there are a _lot_ of configuration options, all of them can be left untouched and hyperglass will work (although, it's recommended to at least set the organization name).
:::tip Validation
On the back end, hyperglass uses strict configuration schema validation, so it's virtually impossible to configure hyperglass incorrectly without receiving a contextual warning about what's missing or incorrect about a configuration.
:::
## Configuration Files
hyperglass configuration consists of three separate [YAML](https://yaml.org/) configuration files:
- `hyperglass.yaml`
- Defines configuration parameters for the application and UI
<MiniNote>This file is not required for hyperglass to run</MiniNote>
- `devices.yaml`
- Defines devices (routers), SSH proxy servers, and credentials
<MiniNote>
This file <strong>is required</strong> for hyperglass to run
</MiniNote>
- `commands.yaml`
- Defines commands for custom network operating systems, or overrides default hyperglass command sets.
<MiniNote>This file is not required for hyperglass to run</MiniNote>
Configuration files may be located in one of the following directories:
- `/etc/hyperglass`
- `~/hyperglass`
## Global Settings
The following global settings can be set in `hyperglass.yaml`:
| Parameter | Type | Default | Description |
| :--------------------- | :--------------: | :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `debug` | Boolean | `false` | Enable application-wide debug mode. **This will generate a lot of logs!** |
| `developer_mode` | Boolean | `false` | If enabled, the hyperglass backend (Python) and frontend (React/Javascript) applications are "unlinked", so that React tools can be used for front end development. A `<Debugger />` convenience component is also displayed in the UI for easier UI development.' |
| `primary_asn` | String | `'65000'` | Your network's primary ASN. This field is used to set some useful defaults such as the subtitle and PeeringDB URL. |
| `org_name` | String | `'Beloved Hyperglass User'` | Your organization's name. This field is used in the UI & API documentation to set fields such as `<meta/>` HTML tags for SEO and the terms & conditions footer component. |
| `site_title` | String | `'hyperglass'` | The name of your hyperglass site. This field is used in the UI & API documentation to set fields such as the `<title/>` HTML tag, and the terms & conditions footer component. |
| `site_description` | String | `'{org_name} Network Looking Glass'` | A short description of your hyperglass site. This field is used in th UI & API documentation to set the `<meta name="description"/>` tag. `{org_name}` may be used to insert the value of the `org_name` field. |
| `site_keywords` | List | | Keywords pertaining to your hyperglass site. This field is used to generate `<meta name="keywords"/>` HTML tags, which helps tremendously with [SEO](https://support.google.com/webmasters/answer/7451184). |
| `request_timeout` | Integer | `90` | Global timeout in seconds for all requests. The UI uses this field's exact value when submitting queries. The backend uses this field's value, minus one second, for its own timeout handling. This is to ensure a contextual timeout error is presented to the end user in the event of a backend application timeout. |
| `listen_address` | String | `'localhost'` | Local IPv4/IPv6 Address the hyperglass application listens on to serve web traffic. |
| `listen_port` | Integer | `8001` | Local TCP port the hyperglass application listens on to serve web traffic. |
| `cors_origins` | List | `[]` | Allowed [CORS](https://developer.mozilla.org/docs/Web/HTTP/CORS) hosts. By default, no CORS hosts are allowed. |
| `netmiko_delay_factor` | Integer \| Float | `0.1` | Override the [Netmiko global delay factor](https://ktbyers.github.io/netmiko/docs/netmiko/index.html). |
:::note
The `netmiko_delay_factor` parameter should only be used if you're experiencing strange SSH connection issues. By default, Netmiko uses a `global_delay_factor` of `1`, which tends to be a bit slow for running a simple show command. hyperglass overrides this to `0.1` by default, but you can override this to whatever value suits your environment if needed.
:::
### Subsections
From the top level, the following subsections may be defined and configured:
| Section | Description | All Options |
| :----------- | :-------------------------------------------------- | :-------------------------------------------: |
| `cache` | Redis server & cache timeout settings. | <PageLink to="response-caching">➡️</PageLink> |
| `docs` | API documentation settings. | <PageLink to="rest-api">➡️</PageLink> |
| `logging` | File, syslog, and webhook settings. | <PageLink to="logging">➡️</PageLink> |
| `messages` | Customize almost all user-facing UI & API messages. | <PageLink to="messages">➡️</PageLink> |
| `queries` | Enable, disable, or configure query types. | <PageLink to="query-settings">➡️</PageLink> |
| `structured` | Configure structured data features. | <PageLink to="table-output">➡️</PageLink> |
| `web` | Web UI & branding settings. | <PageLink to="ui/configuration">➡️</PageLink> |
### Example
```yaml title="hyperglass.yaml"
debug: false
developer_mode: false
org_name: Beloved Hyperglass User
site_title: hyperglass
site_description: "{org_name} Network Looking Glass"
site_keywords: [hyperglass, looking glass, routing, bgp]
request_timeout: 30
listen_address: "127.0.0.1"
listen_port: 8001
log_file: /tmp/hyperglass.log
cors_origins: [lg.example.com, 192.0.2.1]
```

99
docs/docs/platforms.mdx Normal file
View file

@ -0,0 +1,99 @@
---
id: platforms
title: Supported Platforms
sidebar_label: Supported Platforms
description: Platforms supported by hyperglass
---
## HTTP
<div class="table--full-width" />
The following platforms use [hyperglass-agent](agent/installation.mdx) for connection handling. When configuring the `nos` property of a device, use the value in the **Key** column.
| Name | Key |
| --------- | ------ |
| BIRD | `bird` |
| FRRouting | `frr` |
## SSH
The following platforms use [Netmiko](https://github.com/ktbyers/netmiko) or [Scrapli](https://github.com/carlmontanari/scrapli) for connection handling. When configuring the `nos` property of a device, use the value in the **Key** column.
| Name | Key |
| ------------------------- | --------------------- |
| A10 | `a10` |
| Accedian | `accedian` |
| Alcatel AOS | `alcatel_aos` |
| Alcatel SROS | `alcatel_sros` |
| Apresia Systems AEOS | `apresia_aeos` |
| Arista vEOS | `arista_eos` |
| Aruba | `aruba_os` |
| Avaya ERS | `avaya_ers` |
| Avaya VSP | `avaya_vsp` |
| Calix B6 | `calix_b6` |
| Check Point GAiA | `checkpoint_gaia` |
| Ciena SAOS | `ciena_saos` |
| Cisco ASA | `cisco_asa` |
| Cisco IOS | `cisco_ios` |
| Cisco NX-OS | `cisco_nxos` |
| Cisco SG-300 | `cisco_s300` |
| Cisco IOS-XE | `cisco_xe` |
| Cisco IOS-XR | `cisco_xr` |
| Citrix Netscaler | `netscaler` |
| CloudGenix ION | `cloudgenix_ion` |
| Coriant | `coriant` |
| Dell OS6 | `dell_os6` |
| Dell OS9 | `dell_os9` |
| Dell OS10 | `dell_os10` |
| Dell PowerConnect | `dell_powerconnect` |
| Endace | `endace` |
| Eltex | `eltex` |
| Eltex ESR | `eltex_esr` |
| Enterasys | `enterasys` |
| Extreme | `extreme` |
| Extreme ERS | `extreme_ers` |
| Extreme EXOS | `extreme_exos` |
| Extreme/Brocade NetIron | `extreme_netiron` |
| Extreme NOS | `extreme_nos` |
| Extreme/Brocade SLX | `extreme_slx` |
| Extreme/Brocade VDX | `extreme_vdx` |
| Extreme VSP | `extreme_vsp` |
| Extreme Wing | `extreme_wing` |
| F5 LTM | `f5_ltm` |
| F5 TMSH | `f5_tmsh` |
| F5 Linux | `f5_linux` |
| Flex VNF | `flexvnf` |
| Fortinet | `fortinet` |
| Generic Terminal Server | `generic_termserver` |
| HPE/3COM Comware | `hp_comware` |
| HPE ProCurve | `hp_procurve` |
| Huawei | `huawei` |
| Huawei VRPv8 | `huawei_vrpv8` |
| IPInfusion OcNOS | `ipinfusion_ocnos` |
| Juniper | `juniper` |
| Juniper JunOS | `juniper_junos` |
| Juniper ScreenOS | `juniper_screenos` |
| Keymile | `keymile` |
| Keymile NOS | `keymile_nos` |
| Linux | `linux` |
| Mikrotik RouterOS | `mikrotik_routeros` |
| Mikrotik SwitchOS | `mikrotik_switchos` |
| Mellanox | `mellanox` |
| Mellanox MLNX-OS | `mellanox_mlnxos` |
| MRV LX | `mrv_lx` |
| MRV Optiswitch | `mrv_optiswitch` |
| Nokia SROS | `nokia_sros` |
| OneAccess OneOS | `oneaccess_oneos` |
| OVS Linux | `ovs_linux` |
| Palo Alto Networks PAN-OS | `paloalto_panos` |
| Pluribus | `pluribus` |
| Quanta Mesh | `quanta_mesh` |
| RAD ETX | `rad_etx` |
| Ruckus/Brocade FastIron | `ruckus_fastiron` |
| Ruijie OS | `ruijie_os` |
| TNSR | `tnsr` |
| Ubuiquiti EdgeRouter | `ubiquiti_edge` |
| Ubuiquiti EdgeSwitch | `ubiquiti_edgeswitch` |
| Vyatta VyOS | `vyatta_vyos` |
| VyOS | `vyos` |

119
docs/docs/production.mdx Normal file
View file

@ -0,0 +1,119 @@
---
id: production
title: Production
sidebar_label: Production
description: Running hyperglass in production
---
## System Requirements
### CPU
In order to function properly in a production environment, hyperglass leverages [Gunicorn](https://gunicorn.org/) as an application-layer HTTP server. You don't really need to know anything about Gunicorn to use hyperglass, but there is one important factor: each Gunicorn "worker" (a process, or thread, in essence) directly maps to the number of CPU cores on your hyperglass system. Per the [Gunicorn docs](https://docs.gunicorn.org/en/latest/settings.html#workers), hyperglass uses the conservative value of 2x workers per CPU core.
To determine the number of CPU cores on the system, Python's [multiprocessing](https://docs.python.org/3/library/multiprocessing.html) library, and the number of cores returned _does_ factor in hyperthreading. For example, if your system has 4 cores provisioned, and the processors support hyperthreading, hyperglass will see this as 8 cores, and will provision 2 workers per core, for a final result of 16 workers.
#### Why does this matter?
While hyperglass is, to the extent possible, fully [asynchronous](https://docs.python.org/3/library/asyncio.html) (which means tasks may be run while waiting on other tasks to complete), this asynchronism is currently only applicable to **each request**. This means that with a single worker process, while one request is being processed, a second request must wait until the first request completes. If the first request is long-running for whatever reason, the second request may time out (this also applies to running multiple queries at the same time, in the same session).
To combat this, hyperglass uses the above worker strategy. **Ultimately, it's important to provision the appropriate number of CPU cores, corresponding to the number of concurrent sessions you might expect to have in your environment** (keeping in mind that if your system supports hyperthreading, each core equates to two workers).
:::note
When [debug](configuration.mdx#global-settings) is set to `true`, the number of workers is set to 1.
:::
### Memory
Testing shows that hyperglass is extremely memory efficient at runtime. For example, running 4 simulations BGP Route queries, with two devices utilizing [hyperglass-agent](https://github.com/checktheroads/hyperglass-agent), and two devices utilizing SSH, the server increased RAM utilization by about 20MB during execution, and went back down afterwards.
However, at build time, there are some fairly memory-intensive tasks which _will_ time out or cause strange errors without the proper amount of RAM. Testing suggests **2GB of RAM is sufficient**, however **4GB is the ideal minimum amount of RAM**.
### Storage
At **build**, hyperglass consumes approximately **196 MB** of storage. 194 MB of this is front-end dependencies, which are downloaded and installed when running a UI build. The other 2 MB is the hyperglass code itself. Once again, the minimum system requirements for most Linux distributions should be sufficient.
## Reverse Proxy
You'll want to run hyperglass behind a reverse proxy in production to serve the static files more efficiently and offload SSL. Any reverse proxy should work, but hyperglass has been specifically tested with [Caddy](https://caddyserver.com/) and [NGINX](https://www.nginx.com/). Sample configs for both can be found below.
### Caddy
The following file can be placed anywhere, and referenced at runtime with `sudo caddy run -config <file name>`. The highlighted lines should be replaced with your installation's specific variables.
```text {1,2,4,5,8,11} title="Caddy"
lg.example.com:443 {
tls person@example.com
file_server {
root /etc/hyperglass/static/ui
index /etc/hyperglass/static/ui/index.html
}
file_server /custom {
root /etc/hyperglass/static/custom
}
file_server /images {
root /etc/hyperglass/static/images
}
reverse_proxy localhost:8001
}
```
:::tip
The `tls` directive will tell Caddy to automatically use Let's Encrypt to generate SSL certificates for hyperglass.
:::
### NGINX
The following file can be placed at `/etc/nginx/sites-enabled/hyperglass`. It supports IPv6, and will automatically redirect to HTTPS. The highlighted lines should be replaced with your installation's specific variables.
```nginx {4,9,10,17,19} title="NGINX"
server {
listen 80;
listen [::]:80;
server_name lg.example.com;
return 301 https://$host$request_uri;
}
server {
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate <path to cert chain>
ssl_certificate_key <path to key>
client_max_body_size 2M;
server_name lg.example.com;
root /etc/hyperglass/static;
location / {
try_files $uri $uri/ /ui /ui/$uri =404;
index /ui/index.html;
}
location /openapi.json {
try_files $uri @proxy_to_app;
}
location /custom/ {
try_files $uri $uri/ /custom;
}
location /images/ {
try_files $uri $uri/ /images;
}
location /api {
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://[::1]:8001;
}
}
```

View file

@ -0,0 +1,162 @@
---
id: query-settings
title: Query Settings
sidebar_label: Query Settings
keywords: [hyperglass, queries]
description: hyperglass query types
---
import Code from "../src/components/JSXCode";
import MiniNote from "../src/components/MiniNote";
import RP from "../src/components/RegexPattern";
<div class="table--full-width" />
Each query type may be disabled, enabled, or customized. The `display_name` parameter defines how the query type will be displayed in the UI's Query Type select element.
## `bgp_route`
| Parameter | Type | Default | Description |
| :------------- | :-----: | :------------ | :----------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the BGP Route query type. |
| `display_name` | String | `'BGP Route'` | Text displayed for the BGP Route query type in the UI. |
#### Example
<!-- prettier-ignore -->
```yaml title="hyperglass.yaml"
queries:
bgp_route:
display_name: BGP Route
enable: true
```
## `bgp_community`
| Parameter | Type | Default | Description |
| :------------- | :-----: | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `enable` | Boolean | `true` | Enable or disable the BGP Community query type. |
| `display_name` | String | `'BGP Community'` | Text displayed for the BGP Community query type in the UI. |
| `mode` | String | `'input'` | `input` mode requires the user to type the community value in the target element. `select` mode allows the user to select a community from a preconfigured list of communities. |
| `communities` | | | [BGP Community Definitions](#community-definitions) for `select` mode. |
| `pattern` | | | [BGP Community Regular Expression Patterns](#community-patterns) for `input` mode. |
### Community Definitions
If using `select` mode, you may define a list of communities the users can choose from. Each community definition uses the following schema:
| Parameter | Type | Description | Example |
| :------------- | :----: | :--------------------- | :----------------------- |
| `community` | String | Community value | `'64496:1001'` |
| `display_name` | String | Community display name | `'64496:1001'` |
| `description` | String | Community description | `'North America Routes'` |
#### Example
```yaml title="hyperglass.yaml"
queries:
bgp_community:
enable: true
mode: select
communities:
- community: 64496:1001
display_name: 64496:1001
description: North America Routes
- community: 64496:1002
display_name: 64496:1002
description: Europe Routes
```
### Community Patterns
If using `input` mode, hyperglass allows you to override the default regular expression patterns used to validate UI and API queries. hyperglass supports [Decimal (well known)](https://tools.ietf.org/html/rfc1997) communities, [Extended AS](https://tools.ietf.org/html/rfc4360) communities, and [Large](https://tools.ietf.org/html/rfc8092) communities.
| Parameter | Type | Default | Description |
| :------------ | :----: | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |
| `decimal` | String | <RP pattern="community_decimal"/> | Regular expression pattern for validating decimal type BGP Community strings. |
| `extended_as` | String | <RP pattern="community_extended"/> | Regular expression pattern for validating extended AS type BGP Community strings, e.g. `65000:1` |
| `large` | String | <RP pattern="community_large"/> | Regular expression pattern for validating [large community](http://largebgpcommunities.net/) strings, e.g. `65000:65001:65002` |
#### Example
<!-- prettier-ignore -->
```yaml title="hyperglass.yaml"
queries:
bgp_community:
enable: true
mode: input
pattern:
decimal: '^[0-9]{1,10}$'
extended_as: '^([0-9]{0,5})\:([0-9]{1,5})$'
large: '^([0-9]{1,10})\:([0-9]{1,10})\:[0-9]{1,10}$'
```
:::caution
Regular expression patterns must be enclosed in single quotes, e.g. `'^.*$'`
:::
## `bgp_aspath`
| Parameter | Type | Default | Description |
| :------------- | :-----: | :-------------- | :---------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the BGP AS Path query type. |
| `display_name` | String | `'BGP AS Path'` | Text displayed for the BGP AS Path query type in the UI. |
| `pattern` | | | [BGP AS Path Settings & Regular Expression Patterns](#as-path-patterns) |
#### Example
<!-- prettier-ignore -->
```yaml title="hyperglass.yaml"
queries:
bgp_aspath:
display_name: BGP AS Path
enable: true
pattern:
asdot: '^(\^|^\_)((\d+\.\d+)\_|(\d+\.\d+)\$|(\d+\.\d+)\(\_\.\+\_\))+$'
asplain: '^(\^|^\_)(\d+\_|\d+\$|\d+\(\_\.\+\_\))+$'
mode: asplain
```
### AS Path Patterns
AS Path regular expression patterns may also be customized, should you wish to more granularly control what your network considers a valid AS Path pattern. hyperglass makes two "modes" available for validation - [**`asplain`** and **`asdot`**](https://tools.ietf.org/html/rfc5396).
| Parameter | Type | Default | Description |
| :-------- | :----: | :----------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode` | String | `'asplain'` | Set ASN display mode. This field is dependent on how your network devices are configured. <MiniNote>Must be <Code>asplain</Code> or <Code>asdot</Code></MiniNote> |
| `asplain` | String | <RP pattern="aspath_asplain"/> | Regular expression pattern for validating **asplain** type BGP AS Path queries. |
| `asdot` | String | <RP pattern="aspath_asdot"/> | Regular expression pattern for validating **asdot** type BGP AS Path queries. |
## `ping`
| Parameter | Type | Default | Description |
| :------------- | :-----: | :------- | :------------------------------------------------ |
| `enable` | Boolean | `true` | Enable or disable the Ping query type. |
| `display_name` | String | `'Ping'` | Text displayed for the Ping query type in the UI. |
#### Example
<!-- prettier-ignore -->
```yaml title="hyperglass.yaml"
queries:
ping:
display_name: Ping
enable: true
```
## `traceroute`
| Parameter | Type | Default | Description |
| :------------- | :-----: | :------------- | :------------------------------------------------------ |
| `enable` | Boolean | `true` | Enable or disable the Traceroute query type. |
| `display_name` | String | `'Traceroute'` | Text displayed for the Traceroute query type in the UI. |
#### Example
<!-- prettier-ignore -->
```yaml title="hyperglass.yaml"
queries:
traceroute:
display_name: Traceroute
enable: true
```

View file

@ -0,0 +1,35 @@
---
id: response-caching
title: Response Caching
sidebar_label: Response Caching
keywords: [configuration, cache, timeout]
description: hyperglass caching configuration
---
hyperglass uses [Redis](https://redis.io/) for cache storage. Every query is cached and automatically expired from the cache after a configurable timeout period.
Common Redis parameters are configurable, in case you already have a dedicated Redis server you'd prefer to use, instead of running it on the same server as hyperglass:
| Parameter | Type | Default | Description |
| :---------- | :-----: | :------------ | :----------------------------------------------------------------------------------------------------- |
| `host` | String | `'localhost'` | Redis server IP address or hostname. |
| `port` | Integer | `6379` | Redis server TCP port. |
| `database` | Integer | `1` | Database ID for hyperglass. |
| `password` | String | `None` | Password for [Redis password authentication](https://redis.io/topics/security#authentication-feature). |
| `timeout` | Integer | `120` | Time in seconds query output will be kept in the Redis cache. |
| `show_text` | Boolean | `true` | Show the [cache message](ui/text) in the hyperglass UI. |
:::important Caching
hyperglass caches every query response to a Redis database, and always responds to a request with the cached value. If hyperglass receives a query for which it has no matching cached entry, the query parameters are used to created a new cache entry, hyperglass executes the request normally, writes the response to the cache, and then returns the response to the end user.
:::
## Example
```yaml title="hyperglass.yaml"
cache:
database: 0
host: localhost
port: 6379
show_text: true
timeout: 120
```

86
docs/docs/rest-api.mdx Normal file
View file

@ -0,0 +1,86 @@
---
id: rest-api
title: REST API
sidebar_label: REST API
keywords: [configuration, api, rest]
description: Configure the REST API
---
import Link from "@docusaurus/Link";
import MiniNote from "../src/components/MiniNote";
import Code from "../src/components/JSXCode";
import PageLink from "../src/components/PageLink";
The hyperglass API is based on the powerful [FastAPI](https://fastapi.tiangolo.com/) framework, which includes automatic API documentation using the [OpenAPI](https://www.openapis.org/) specification. If you plan to provide your users with API access to your hyperglass instance, it is highly recommended to leave this enabled.
FastAPI provides built in support for both [Swagger UI](https://swagger.io/tools/swagger-ui/) and [Redoc](https://redocly.github.io/redoc/), which are open source projects that create a pretty web UI from an OpenAPI specification.
## Settings
| Parameter | Type | Default | Description |
| :------------ | :-----: | :--------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the API documentation. |
| `title` | String | `'{site_title} API Documentation'` | API documentation title. `{site_title}` will be replaced with the <Link to="/docs/configuration#global-settings"><Code>site_title</Code></Link> parameter. |
| `description` | String | | API documentation description appearing below the title. |
| `base_url` | String | `'https://lg.example.net'` | The base URL for your hyperglass site. Used by OpenAPI for dynamically creating hyperlinks. |
| `mode` | String | `'redoc'` | OpenAPI UI library to use for the hyperglass API docs. <MiniNote>Must be <Code>redoc</Code> or <Code>swagger</Code></MiniNote> |
| `uri` | String | `'/api/docs'` | HTTP URI/path where API documentation can be accessed. |
| `openapi_uri` | String | `'/openapi.json'` | Path to the automatically generated `openapi.json` file. |
| `queries` | | | `/queries` endpoint settings <PageLink to="#queries">➡️</PageLink> |
| `query` | | | `/query` endpoint settings <PageLink to="#query">➡️</PageLink> |
| `devices` | | | `/devices` endpoint settings <PageLink to="#devices">➡️</PageLink> |
### `queries`
| Parameter | Type | Default | Description |
| :------------ | :----: | :--------------------------------- | :----------------------------------------------------------- |
| `title` | String | `'Supported Queries'` | Displayed as the header text above the API endpoint section. |
| `description` | String | `'List of supported query types.'` | Displayed inside each API endpoint section. |
| `summary` | String | `'Query Types'` | Displayed beside the API endpoint URI. |
### `query`
| Parameter | Type | Default | Description |
| :------------ | :----: | :----------------------------------------- | :----------------------------------------------------------- |
| `title` | String | `'Submit Query'` | Displayed as the header text above the API endpoint section. |
| `description` | String | `'Request a query response per-location.'` | Displayed inside each API endpoint section. |
| `summary` | String | `'Query the Looking Glass'` | Displayed beside the API endpoint URI. |
### `devices`
| Parameter | Type | Default | Description |
| :------------ | :----: | :---------------------------------------------------------------------------------------------- | :----------------------------------------------------------- |
| `title` | String | `'Devices'` | Displayed as the header text above the API endpoint section. |
| `description` | String | `'List of all devices/locations with associated identifiers, display names, networks, & VRFs.'` | Displayed inside each API endpoint section. |
| `summary` | String | `'Devices List'` | Displayed beside the API endpoint URI. |
## Example
```yaml title="hyperglass.yaml"
docs:
base_url: https://lg.example.net
description: ""
devices:
description:
List of all devices/locations with associated identifiers, display
names, networks, & VRFs.
summary: Devices List
title: Devices
enable: true
mode: redoc
openapi_uri: /openapi.json
queries:
description: List of supported query types.
summary: Query Types
title: Supported Queries
query:
description: Request a query response per-location.
summary: Query the Looking Glass
title: Submit Query
title: "{site_title} API Documentation"
uri: /api/docs
```
:::note From the developer
I'm partial to Redoc, partially because I find it to be more aesthetically pleasing, and partially because it's written in [ReactJS](https://reactjs.org/), just like the hyperglass UI. At some point, I plan to migrate away from the built-in Redoc page and integrate Redoc directly with hyperglass.
:::

82
docs/docs/setup.mdx Normal file
View file

@ -0,0 +1,82 @@
---
id: setup
title: Setup
sidebar_label: Setup
keywords: [install, setup]
description: hyperglass Setup
---
import Link from "@docusaurus/Link";
After hyperglass is [installed](getting-started.mdx), you can run the `hyperglass --help` command to see the available options:
```shell-session
$ hyperglass --help
Usage: hyperglass [OPTIONS] COMMAND [ARGS]...
hyperglass Command Line Interface
Options:
-v, --version 🔢 hyperglass version
-h, --help 🙏 Show this help message
Commands:
build-ui 🦋 Create a new UI build
clear-cache 🧼 Clear the Redis cache
secret 🔒 Generate agent secret
setup 🧰 Run the setup wizard
start 🚀 Start web server
```
## Setup Wizard
To start the setup wizard, run `hyperglass setup`.
You'll receive the following prompts:
### Installation Directory
```shell-session
[?] Choose a directory for hyperglass: /Users/ml/hyperglass
> /home/user/hyperglass
/etc/hyperglass
```
hyperglass requires a directory on your system to store configuration files, the web UI, logos, etc. You may choose between the current user's home directory or `/etc`.
### Systemd Service
```shell-session
Do you want to generate a systemd service file? [y/N]:
```
hyperglass also includes a [systemd](https://systemd.io/) service file, which can be installed if you use systemd. If selected, a systemd service file will be generated and copied to the installation directory. Then, it will be symlinked to `/etc/systemd/system`. All you need to do to enable the service is run:
```shell-session
$ sudo systemctl enable hyperglass
```
## UI Build
After running the setup, the `build-ui` command needs to be run for the first time. This command creates the required file structure for the UI, initializes frontend dependencies, and generates favicons.
:::note
If your system's compute resources are too low, the `build-ui` step will likely fail. See the [system requirements](production.mdx) section for more information.
:::
```shell-session
$ hyperglass build-ui
✅ Completed UI build in development mode
```
## Startup
To start hyperglass at the console run `hyperglass start`.
:::important
hyperglass won't start without a `devices.yaml` file. See the [Adding Devices](adding-devices.mdx) section for instructions on how add devices.
:::
```shell-session
$ hyperglass start
```

View file

@ -0,0 +1,11 @@
.getStarted[class][class]:not(.button--active):not(:hover) {
color: var(--ifm-color-secondary);
}
.getStarted[class][class]:not(.button--active):hover {
color: var(--ifm-color-white);
}
.year {
color: var(--ifm-color-primary);
}

View file

@ -0,0 +1,67 @@
---
id: table-output
title: Table Output
sidebar_label: Table Output
description: Configure structured data parameters
---
Devices that support responding to a query with structured or easily parsable data can have their response data placed into an easier to read table (or JSON, when using the [REST API](rest-api)). Currently, the following platforms have structured data supported in hyperglass:
- Juniper Junos
:::note
Unlike with standard text output, devices with structured data enabled do not support customization of their commands. This is because the response must be something hyperglass is preconfigured to understand and parse, so hyperglass must maintain control over the specific command to run for a given platform.
:::
<div class="table--full-width" />
The `structured` subsection contains multiple subsections of its own:
| Section | Description | All Options |
| :------------ | :--------------------------------- | :---------------------------------------: |
| `communities` | Include or exclude BGP communities | <PageLink to="#communities">➡️</PageLink> |
| `rpki` | Configure RPKI validation | <PageLink to="#rpki">➡️</PageLink> |
## `communities`
| Parameter | Type | Default | Description |
| :-------- | :----: | :------: | :------------------------------------------------------------------------------------------------------------------------------------ |
| `mode` | String | `'deny'` | `'deny'` denies any matching patterns and permits anything else. `'permit'` only permits matching patterns and denies everything else |
| `items` | List | `[]` | List of regular expression patterns to match |
:::note Regular Expressions with YAML
If you're using any regex patterns with special characters, you'll probably need to wrap the patterns in single quotes, to denote a raw string. For example:
```yaml
normal_string: Normal String
raw_string: '^Raw\sString$'
```
:::
## `rpki`
| Parameter | Type | Default |
| :-------- | :----: | :--------: |
| `mode` | String | `'router'` |
### `router` mode
`router` mode uses the RPKI state from the perspective of the router. This means if your network is not using Origin Validation, the RPKI state will be shown as "Not Verified". Otherwise, the corresponding RPKI state will be shown.
### `external` mode
`external` mode takes each prefix, the last ASN in the `AS_PATH` and requests the RPKI validation state via the [Cloudflare RPKI Portal](https://rpki.cloudflare.com/).
## Example
```yaml title="hyperglass.yaml"
structured:
communities:
mode: permit
items:
- '65000:\d+'
- '65[1-4]00:\d+'
rpki:
mode: external
```

View file

@ -0,0 +1,105 @@
---
id: configuration
title: UI Configuration
sidebar_label: Configuration
keywords: [hyperglass, looking glass, web ui, gui, theme, colors, branding]
description: Customize the Web UI
---
import Link from "@docusaurus/Link";
import R from "../../src/components/Required";
import MiniNote from "../../src/components/MiniNote";
import Code from "../../src/components/JSXCode";
import PageLink from "../../src/components/PageLink";
## Build
hyperglass is build with [NextJS](https://nextjs.org/), a [React](https://reactjs.org/)-based UI framework that supports server-side rendering and static exporting, which contribute to hyperglass's speed and SEO-friendliness. At startup, hyperglass creates a new "UI build", which is a static export of the site and includes some elements of the [configuration](parameters).
This UI build process can be run manually via the hyperglass CLI:
```shell-session
$ hyperglass build-ui
✅ Completed UI build in production mode
```
Or with the `--build` CLI flag on startup:
```shell-session
$ hyperglass start --build
```
The UI build will run automatically any time the hyperglass configuration or version changes.
## Sections
<div class="table--full-width" />
The `web` subsection contains multiple subsections of its own, should you wish to customize various aspects of the UI:
| Section | Description | All Options |
| :-------------- | :----------------------------- | :-----------------------------------------: |
| `credit` | Developer credit & GitHub Link | <PageLink to="#credit">➡️</PageLink> |
| `dns_provider` | DNS over HTTPS Provider | <PageLink to="#dns_provider">➡️</PageLink> |
| `external_link` | Link to external site | <PageLink to="#external_link">➡️</PageLink> |
| `greeting` | Greeting Modal | <PageLink to="#greeting">➡️</PageLink> |
| `logo` | Logo & Favicons | <PageLink to="logo">➡️</PageLink> |
| `opengraph` | [OpenGraph](https://ogp.me/) | <PageLink to="#opengraph">➡️</PageLink> |
| `terms` | Terms & Conditions | <PageLink to="#terms">➡️</PageLink> |
| `text` | Text, title, & names | <PageLink to="text">➡️</PageLink> |
| `theme` | Colors & Fonts | <PageLink to="theme">➡️</PageLink> |
### `credit`
| Parameter | Type | Default | Description |
| :-------- | :-----: | :-----: | :--------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the display of developer credit & link to hyperglass GitHub repository |
:::note From the developer
If your organization's policy allows, and you don't mind, I request that you keep `credit` enabled. Remember: my goal for this project is get more networks to use looking glasses to make all of our lives easier. Because it's primarily other network operators who will use this tool to begin with, I'd love for any operators that use your looking glass to know where they can get their own.
:::
### `dns_provider`
| Parameter | Type | Default | Description |
| :-------- | :----: | :------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | String | `'cloudflare'` | DNS over HTTPS provider for in-browser DNS resolution. Cloudflare & Google supported. <MiniNote>Must be <Code>cloudflare</Code> or <Code>google</Code></MiniNote> |
### `external_link`
| Parameter | Type | Default | Description |
| :-------- | :-----: | :---------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the display of an external link |
| `title` | String | `'PeeringDB'` | Link title/label |
| `url` | String | `'https://www.peeringdb.com/asn/{primary_asn}'` | Target URL. `{primary_asn}` will be replaced with the `primary_asn` value from <Link to="/docs/configuration#global-settings">Global Settings</Link> |
### `greeting`
| Parameter | Type | Default | Description |
| :--------- | :-----: | :----------- | :------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `false` | Enable or disable the greeting modal. |
| `file` | String | | Path to a [markdown](https://www.markdownguide.org/) file containing the modal body content. |
| `title` | String | `'Welcome'` | Modal title. |
| `button` | String | `'Continue'` | Button text. |
| `required` | Boolean | `false` | If `true` the user must click the button in order to submit a query. |
### `opengraph`
If you're not familiar with [OpenGraph](https://ogp.me/), it's the thing that generates the pretty pictures, titles, and descriptions for links when you post them to sites/tools such as Facebook, Twitter, Slack, etc.
By default, [this Opengraph image](/opengraph.jpg) is set. If you define one with `image`, hyperglass will automatically generate an Opengraph image using the following methodology:
- If the image is already 1200x630, it will be used
- If the image is or is not 1200x630, but contains transparency (like in a `.png` formatted image), it will be converted to a JPEG file with the [`black`](theme#colors) used as the background color.
| Parameter | Type | Description |
| :-------- | :----: | :---------------------- |
| `image` | String | Path to opengraph image |
### `terms`
| Parameter | Type | Default | Description |
| :-------- | :-----: | :-------- | :-------------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or display the display of terms & conditions |
| `file` | String | | Path to a plain text or markdown file with content to override the default terms & conditions |
| `title` | String | `'Terms'` | Terms & conditions title |

72
docs/docs/ui/example.mdx Normal file
View file

@ -0,0 +1,72 @@
---
id: example
title: Example UI Configuration
sidebar_label: Example
keywords:
[hyperglass, looking glass, web ui, gui, theme, colors, branding, example]
description: See how to the hyperglass UI should be configured.
---
## Example
```yaml title="hyperglass.yaml"
web:
credit:
enable: true
dns_provider:
name: cloudflare
external_link:
enable: true
title: PeeringDB
url: https://www.peeringdb.com/asn/{primary_asn}
help_menu:
enable: true
file: null
title: Help
logo:
dark: /home/ubuntu/hyperglass/hyperglass-light.svg
light: /home/ubuntu/hyperglass/hyperglass-dark.svg
favicon: /home/ubuntu/hyperglass/hyperglass-icon.svg
height: null
width: "75%"
opengraph:
image: /home/ubuntu/hyperglass/hyperglass-opengraph.png
terms:
enable: true
file: null
title: Terms
text:
cache: Results will be cached for 2 minutes.
fqdn_tooltip: "Use {protocol}"
query_location: Location
query_target: Target
query_type: Query Type
query_vrf: Routing Table
subtitle: AS65001
title: hyperglass
title_mode: text_only
theme:
default_color_mode: light
colors:
black: "#121212"
blue: "#314cb6"
cyan: "#118ab2"
danger: "#d84b4b"
error: "#ff6b35"
gray: "#c1c7cc"
green: "#35b246"
orange: "#ff6b35"
pink: "#f2607d"
primary: "#118ab2"
purple: "#8d30b5"
red: "#d84b4b"
secondary: "#314cb6"
success: "#35b246"
teal: "#35b299"
warning: "#edae49"
white: "#f7f7f7"
yellow: "#edae49"
fonts:
body: Nunito
mono: Fira Code
```

99
docs/docs/ui/logo.mdx Normal file
View file

@ -0,0 +1,99 @@
---
id: logo
title: Logo
sidebar_label: Logo
keywords: [hyperglass, looking glass, web ui, gui, branding, logo]
description: Customize the Logo & Favicon
---
## `logo`
| Parameter | Type | Default | Description |
| :-------- | :-----: | :-------------- | :-------------------------------------------- |
| `light` | String | hyperglass logo | Path to logo that will be used in light mode |
| `dark` | String | hyperglass logo | Path to logo that will be used in dark mode |
| `favicon` | String | hyperglass icon | Path to logo that will be used as the favicon |
| `width` | String | `100%` | Maximum logo width as a percentage |
| `height` | Integer | | Maximum logo height as a percentage |
### Favicon
It's very easy to customize the favicon imaged used by hyperglass. If you're not familiar with the term, the favicon is the icon used by the browser in tabs, windows, or bookmarks:
![](/screenshots/screenshot-favicons.jpg)
During the [UI build process](setup.mdx#ui-build) hyperglass automatically generates favicon files in all of the many formats required for cross-platform, cross-browser support.
#### Supported Formats
- `.jpg`
- `.jpeg`
- `.png`
- `.svg`
:::caution Icon File Size
Generating the favicons is very CPU-intensive, and therefore has the tendency of timing out if the icon file is very large. If you receive a timeout error when starting hyperglass or running the `hyperglass build-ui` command, try reducing the size of the icon file. **File sizes of around 200 KB** have been known to succeed without too much overhead.
:::
The following icons types are generated:
```
android-chrome-36x36.png
android-chrome-48x48.png
android-chrome-72x72.png
android-chrome-96x96.png
android-chrome-144x144.png
android-chrome-192x192.png
android-chrome-256x256.png
android-chrome-384x384.png
android-chrome-512x512.png
apple-touch-icon-57x57.png
apple-touch-icon-60x60.png
apple-touch-icon-72x72.png
apple-touch-icon-76x76.png
apple-touch-icon-114x114.png
apple-touch-icon-120x120.png
apple-touch-icon-144x144.png
apple-touch-icon-152x152.png
apple-touch-icon-167x167.png
apple-touch-icon-180x180.png
apple-touch-icon-1024x1024.png
apple-touch-icon-precomposed.png
apple-touch-icon.png
apple-touch-startup-image-640x1136.png
apple-touch-startup-image-750x1334.png
apple-touch-startup-image-828x1792.png
apple-touch-startup-image-1125x2436.png
apple-touch-startup-image-1136x640.png
apple-touch-startup-image-1242x2208.png
apple-touch-startup-image-1242x2688.png
apple-touch-startup-image-1334x750.png
apple-touch-startup-image-1536x2048.png
apple-touch-startup-image-1620x2160.png
apple-touch-startup-image-1668x2224.png
apple-touch-startup-image-1668x2388.png
apple-touch-startup-image-1792x828.png
apple-touch-startup-image-2048x1536.png
apple-touch-startup-image-2048x2732.png
apple-touch-startup-image-2160x1620.png
apple-touch-startup-image-2208x1242.png
apple-touch-startup-image-2224x1668.png
apple-touch-startup-image-2388x1668.png
apple-touch-startup-image-2436x1125.png
apple-touch-startup-image-2688x1242.png
apple-touch-startup-image-2732x2048.png
coast-228x228.png
favicon-16x16.png
favicon-32x32.png
favicon-48x48.png
favicon.ico
firefox_app_60x60.png
firefox_app_128x128.png
firefox_app_512x512.png
mstile-70x70.png
mstile-144x144.png
mstile-150x150.png
mstile-310x150.png
mstile-310x310.png
yandex-browser-50x50.png
```

38
docs/docs/ui/text.mdx Normal file
View file

@ -0,0 +1,38 @@
---
id: text
title: Text
sidebar_label: Text
keywords: [hyperglass, looking glass, web ui, gui, branding, text, messages]
description: Customize the text used in the web UI
---
## `text`
| Parameter | Type | Default | Description |
| :--------------- | :----: | :-------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cache_prefix` | String | `'Results cached for '` | Text displayed with the cache timeout countdown. |
| `cache_icon` | String | `'Cached Response from {time}'` | Text displayed when a user hovers over the lightning bolt icon, which is displayed when a response from the server was a cached response. `{time}` is replaced with the _original_ query's timestamp. |
| `completed_time` | String | `'Completed in {seconds}'` | Text displayed when a user hovers over the success icon for a query result. `{seconds}` will be replaced with 'n seconds' where n is the time a query took to complete. |
| `fqdn_message` | String | `'Your browser has resolved {fqdn} to'` | Text displayed when prompting a user to select a resolve IPv4 or IPv6 address for an FQDN query. |
| `fqdn_error` | String | `'Unable to resolve {fqdn}'` | Text displayed when an FQDN is not resolvable. |
| `fqdn_button` | String | `'Try Again'` | Button text used when an FQDN is not resolvable. |
| `query_location` | String | `'Location'` | Query Location (router) form label. |
| `query_target` | String | `'Target'` | Query Target (IP/hostname/community/AS Path) form label. |
| `query_type` | String | `'Query Type'` | Query Type (BGP Route, Ping, Traceroute, etc.) form label. |
| `query_vrf` | String | `'Routing Table'` | Query VRF form label. |
| `subtitle` | String | `'Network Looking Glass'` | Subtitle text. value. |
| `title` | String | `'hyperglass'` | Title text. |
| `title_mode` | String | `'text_only'` | Set the title mode. <MiniNote>Must be <Code>text_only</Code>, <Code>logo_only</Code>, <Code>logo_subtitle</Code>, or <Code>all</Code></MiniNote> |
### Title Mode
The `title_mode` parameter behaves in the following manner:
<div className="table--full-width" />
| Mode | Behavior |
| --------------- | ------------------------------------------------------------------- |
| `text_only` | Shows the [`title`](#text) and [`subtitle`](#text) only. |
| `logo_only` | Shows the [`logo`](ui/logo) only. |
| `logo_subtitle` | Shows the [`logo`](ui/logo) and [`subtitle`](#text) only. |
| `all` | Shows the [`logo`](ui/logo), [`title`](#text), [`subtitle`](#text). |

58
docs/docs/ui/theme.mdx Normal file
View file

@ -0,0 +1,58 @@
---
id: theme
title: Theme
sidebar_label: Theme
keywords: [hyperglass, looking glass, web ui, gui, branding, theme]
description: Customize Theme
---
import Color from "../../src/components/Color";
import Font from "../../src/components/Font";
import PageLink from "../../src/components/PageLink";
## `theme`
### Parameters
| Parameter | Type | Description |
| :------------------- | :----: | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| `default_color_mode` | String | Sets the default color mode. Must be `light` or `dark`. If no default mode is specified, hyperglass will use the browser's preferred color mode. |
### Subsections
| Section | Description | All Options |
| :------- | :----------- | :----------------------------------: |
| `colors` | Theme colors | <PageLink to="#colors">➡️</PageLink> |
| `fonts` | Theme fonts | <PageLink to="#fonts">➡️</PageLink> |
#### `colors`
| Parameter | Type | Default | Description |
| :---------- | :----: | :--------------------- | :------------------------------------- |
| `primary` | String | | Primary accent color |
| `secondary` | String | | Secondary accent color |
| `success` | String | | Success message/status color |
| `warning` | String | | Warning message/status color |
| `error` | String | | Error message/status color |
| `danger` | String | | Danger message/status color |
| `dark` | String | <Color hex="#121212"/> | Used as background color in dark mode |
| `light` | String | <Color hex="#f5f6f7"/> | Used as background color in light mode |
| `red` | String | <Color hex="#d84b4b"/> | Used as `danger` color if undefined |
| `orange` | String | <Color hex="#ff6b35"/> | Used as `error` color if undefined |
| `yellow` | String | <Color hex="#edae49"/> | Used as `warning` color if undefined |
| `green` | String | <Color hex="#35b246"/> | Used as `success` color if undefined |
| `cyan` | String | <Color hex="#118ab2"/> | Used as `primary` color if undefined |
| `blue` | String | <Color hex="#314cb6"/> | Used as `secondary` color if undefined |
| `teal` | String | <Color hex="#35b299"/> | |
| `pink` | String | <Color hex="#f2607d"/> | |
| `purple` | String | <Color hex="#8d30b5"/> | |
| `gray` | String | <Color hex="#c1c7cc"/> | |
#### `fonts`
Currently, only [Google Fonts](https://fonts.google.com/) are supported.
| Parameter | Type | Default | Description |
| :-------- | :----: | :----------------------- | :-------------------------------------- |
| `body` | String | <Font name="Nunito"/> | Main body font |
| `mono` | String | <Font name="Fira Code"/> | Monospace font, used for command output |

25
docs/docs/upgrading.mdx Normal file
View file

@ -0,0 +1,25 @@
---
id: upgrading
title: Upgrading hyperglass
sidebar_label: Upgrading
keywords: [hyperglass, looking glass, upgrade, upgrading, version]
description: How to upgrade hyperglass
---
## Upgrade Process
To upgrade hyperglass, stop the currently-running service and upgrade via PyPI:
```shell-session
$ sudo systemctl stop hyperglass
$ sudo pip3 install -U hyperglass
```
## Check Current version
To check the current version of hyperglass, run the following command:
```shell-session
$ sudo hyperglass --version
hyperglass version: 1.0.0-beta.19
```

100
docs/docusaurus.config.js Executable file
View file

@ -0,0 +1,100 @@
const githubURL = "https://github.com/checktheroads/hyperglass";
const { googleTrackingId, algoliaKey } = process.env;
const docusaurusConfig = {
title: "hyperglass",
tagline: "the network looking glass that tries to make the internet better.",
url: "https://hyperglass.io",
baseUrl: "/",
favicon: "img/favicon.ico",
organizationName: "checktheroads",
projectName: "hyperglass",
themeConfig: {
image: "opengraph.jpg",
googleAnalytics: {
trackingID: googleTrackingId || " ",
anonymizeIP: false,
},
algolia: {
apiKey: algoliaKey || "dev",
indexName: "hyperglass",
},
navbar: {
links: [
{ to: "docs/introduction", label: "Docs", position: "left" },
{ to: "screenshots", label: "Screenshots", position: "left" },
{ href: "https://demo.hyperglass.io", label: "Demo", position: "left" },
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Introduction",
to: "docs/introduction",
},
{
label: "Getting Started",
to: "docs/getting-started",
},
{
label: "Configuration",
to: "docs/parameters",
},
],
},
{
title: "Community",
items: [
{
label: "Telegram",
href: "https://t.me/hyperglasslg",
},
{
label: "Gitter",
href: "https://gitter.im/hyperglass",
},
{
label: "Keybase",
href: "https://keybase.io/team/hyperglass",
},
],
},
{
title: "Social",
items: [
{
label: "GitHub",
href: githubURL,
},
{
label: "Twitter",
href: "https://twitter.com/checktheroads",
},
],
},
],
},
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
editUrl: githubURL + "/edit/v1.0.0/docs/",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
},
],
],
plugins: ["@docusaurus/plugin-google-analytics"],
};
module.exports = docusaurusConfig;

View file

@ -1,80 +0,0 @@
interface Favicon {
rel: string | null;
dimensions: [number, number];
image_format: string;
prefix: string;
}
export default [
{ dimensions: [48, 48], image_format: "ico", prefix: "favicon", rel: null },
{ dimensions: [16, 16], image_format: "png", prefix: "favicon", rel: "icon" },
{ dimensions: [32, 32], image_format: "png", prefix: "favicon", rel: "icon" },
{ dimensions: [64, 64], image_format: "png", prefix: "favicon", rel: "icon" },
{ dimensions: [96, 96], image_format: "png", prefix: "favicon", rel: "icon" },
{ dimensions: [180, 180], image_format: "png", prefix: "favicon", rel: "icon" },
{
dimensions: [57, 57],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [60, 60],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [72, 72],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [76, 76],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [114, 114],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [120, 120],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [144, 144],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [152, 152],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [167, 167],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{
dimensions: [180, 180],
image_format: "png",
prefix: "apple-touch-icon",
rel: "apple-touch-icon",
},
{ dimensions: [70, 70], image_format: "png", prefix: "mstile", rel: null },
{ dimensions: [270, 270], image_format: "png", prefix: "mstile", rel: null },
{ dimensions: [310, 310], image_format: "png", prefix: "mstile", rel: null },
{ dimensions: [310, 150], image_format: "png", prefix: "mstile", rel: null },
{ dimensions: [196, 196], image_format: "png", prefix: "favicon", rel: "shortcut icon" },
] as Favicon[];

34
docs/generateSitemap.js Normal file
View file

@ -0,0 +1,34 @@
const fs = require("fs");
const globby = require("globby");
const prettier = require("prettier");
(async () => {
const pages = await globby(["docs/**/*{.js,.mdx}"]);
const sitemap = `
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${pages
.map((page) => {
const path = page
.replace("pages", "")
.replace(".js", "")
.replace(".mdx", "");
const route = path === "/index" ? "" : path;
console.log("Added entry to sitemap:", path, route);
return `
<url>
<loc>${`https://hyperglass.io/${route}`}</loc>
</url>
`;
})
.join("")}
</urlset>
`;
const formatted = prettier.format(sitemap, {
parser: "html",
});
fs.writeFileSync("static/sitemap.xml", formatted);
})();

8
docs/global.d.ts vendored
View file

@ -1,8 +0,0 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
NODE_ENV: 'development' | 'production';
CF_PAGES_BRANCH: string;
}
}
}

View file

@ -1,7 +0,0 @@
.logo {
color: #d84b4b;
}
html[class~=dark] .logo {
color: #fff;
}

5
docs/next-env.d.ts vendored
View file

@ -1,5 +0,0 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View file

@ -1,35 +0,0 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import withNextra from "nextra";
function copyChangelog() {
const dir = path.dirname(fileURLToPath(import.meta.url));
const src = path.resolve(dir, "..", "CHANGELOG.md");
const data = fs.readFileSync(src);
const replaced = data.toString().replace("# Changelog\n\n", "");
const dst = path.resolve(dir, "pages", "changelog.mdx");
fs.writeFileSync(dst, replaced);
}
copyChangelog();
/**
* @type {import('nextra').NextraConfig}
*/
const nextraConfig = {
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
};
/**
* @type {import('next').NextConfig}
*/
const config = {
images: {
unoptimized: true,
},
output: "export",
};
export default withNextra(nextraConfig)(config);

48
docs/package.json Normal file → Executable file
View file

@ -1,24 +1,42 @@
{
"name": "hyperglass-docs",
"version": "2.0.0",
"description": "hyperglass documentation",
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"start": "next start",
"typecheck": "tsc --noEmit"
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
},
"author": "thatmattlove <matt@hyperglass.dev>",
"license": "BSD-3-Clause-Clear",
"dependencies": {
"next": "^14.1.1",
"nextra": "3.0.0-alpha.24",
"nextra-theme-docs": "3.0.0-alpha.24",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"@docusaurus/core": "^2.0.0-alpha.58",
"@docusaurus/preset-classic": "^2.0.0-alpha.58",
"classnames": "^2.2.6",
"globby": "^11.0.1",
"prismjs": "^1.19.0",
"prop-types": "^15.7.2",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"use-media": "^1.4.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/node": "^20.11.24",
"typescript": "^5.3.3"
"prettier": "^2.0.5"
},
"prettier": {
"[yaml]": {
"singleQuote": true
}
}
}

View file

@ -1,42 +0,0 @@
export default {
index: { title: "Introduction", theme: { breadcrumb: false } },
"---": {
type: "separator",
},
installation: "Installation",
configuration: "Configuration",
platforms: "Platforms",
plugins: "Plugins",
documentation: {
title: "Documentation",
type: "menu",
items: {
installation: {
title: "Installation",
href: "/installation",
},
configuration: {
title: "Configuration",
href: "/configuration",
},
plugins: {
title: "Plugins",
href: "/plugins",
},
changelog: {
title: "Changelog",
href: "/changelog",
},
license: {
title: "License",
href: "/license",
},
},
},
demo: {
title: "Demo",
type: "page",
href: "https://demo.hyperglass.dev",
newWindow: true,
},
};

View file

@ -1,7 +0,0 @@
export default {
overview: "Overview",
config: "Config File",
devices: "Devices File",
directives: "Directives File",
examples: "Examples",
};

View file

@ -1,44 +0,0 @@
---
title: Configuration File
description: hyperglass config.yaml file reference
---
The `config.yaml` file is broken into multiple sections:
## Top Level Parameters
| Parameter | Type | Default Value | Description |
| :----------------- | :-------------- | :------------------------------- | :------------------------------------------------------------ |
| `org_name` | String | Beloved Hyperglass User | Your organization's name. |
| `plugins` | List of Strings | | List of hyperglass [plugins](/plugins) to load. |
| `primary_asn` | String | 65000 | Your organization's primary ASN. Used to set default UI text. |
| `request_timeout` | Number | 90 | Global timeout in seconds for all requests. |
| `site_description` | String | `org_name` Network Looking Glass | `<meta>` description, also used in the API documentation. |
| `site_title` | String | `org_name` | Browser title, also used in the default terms & conditions. |
#### Example with Defaults
```yaml filename="config.yaml"
org_name: Beloved Hyperglass User
plugins: []
primary_asn: 65000
request_timeout: 90
site_description: Beloved Hyperglass User Network Looking Glass
site_title: Beloved Hyperglass User
```
## Other Configuration Sections
| Parameter | Docs | Description |
| :----------- | :--------------------------------------------------------------------- | :--------------------------------------------------------------- |
| `cache` | [Caching Docs](/configuration/config/caching.mdx) | Customize how hyperglass caches responses. |
| `logging` | [Logging Docs](/configuration/config/logging.mdx) | Customize file logging, syslog, webhooks, etc. |
| `messages` | [Messages Docs](/configuration/config/messages.mdx) | Customize messages shown to users. |
| `structured` | [Structured Output Docs](/configuration/config/structured-ouptput.mdx) | Customize how hyperglass handles structured output from devices. |
| `web` | [Web UI Docs](/configuration/config/web-ui.mdx) | Customize the look and feel of hyperglass's web UI. |
## Caveats
### Arista EOS
For whatever reason, the tested version of Arista EOS does not supply certain details about routes in its JSON output when running commands `show ip bgp regex <pattern>` or `show ip bgp community <community>`. Specifically, the the route's timestamp and any attached communities are not supplied. When these commands are used with Arista EOS, hyperglass sets the timestamp to the current time, and the community to an empty list.

View file

@ -1,8 +0,0 @@
export default {
"api-docs": "API Docs",
caching: "Caching",
logging: "Logging & Webhooks",
messages: "Messages",
"structured-output": "Structured Output",
"web-ui": "Web UI",
};

View file

@ -1,72 +0,0 @@
## API Docs
hyperglass automatically generates documentation for the REST API. The `docs` section allows users to customize the look, feel, and text used for the REST API documentation.
| Parameter | Type | Default Value | Description |
| :----------------- | :------ | :----------------------------- | :---------------------------------------------------------------------------------------------- |
| `docs.base_url` | String | https://lg.example.com | Used for REST API samples. See the [demo](https://demo.hyperglass.dev/api/docs) for an example. |
| `docs.enable` | Boolean | `true` | Enable or disable the REST API documentation. |
| `docs.path` | String | /api/docs | Path to the REST API documentation. |
| `docs.title` | String | `site_title` API Documentation | API docs title. Uses the `site_title` parameter from the [global](#global) parameters. |
| `docs.description` | String | | API docs description. Appears below the title. |
The documentation for API endpoints follow a common schema:
- `devices`
- `info`
- `queries`
- `query`
### Schema
| Parameter | Type | Description |
| :------------ | :----- | :------------------------------------------------------------------------------- |
| `title` | String | API endpoint title, displayed as the header text above the API endpoint section. |
| `description` | String | API endpoint description, displayed inside each API endpoint section. |
| `summary` | String | API endpoint summary, displayed beside the API endpoint path. |
### Parameters
| Parameter | Default Value |
| :------------------------- | :------------------------------------------------------------------------------------------ |
| `docs.devices.title` | Devices |
| `docs.devices.description` | List of all devices/locations with associated identifiers, display names, networks, & VRFs. |
| `docs.devices.summary` | Devices List |
| `docs.info.title` | System Information |
| `docs.info.description` | General information about this looking glass. |
| `docs.info.summary` | System Information |
| `docs.queries.title` | Supported Queries |
| `docs.queries.description` | List of supported query types. |
| `docs.queries.summary` | Query Types |
| `docs.query.title` | Supported Query |
| `docs.query.description` | Request a query response per-location. |
| `docs.query.summary` | Query the Looking Glass |
#### Example with Defaults
```yaml filename="config.yaml"
docs:
base_url: https://lg.example.com
enable: true
mode: redoc
path: /api/docs
title: Beloved Hyperglass User Looking Glass API Documentation
description: null
# API Endpoints ↓
devices:
title: Devices
description: List of all devices/locations with associated identifiers, display names, networks, & VRFs.
summary: Devices List
info:
title: System Information
description: General information about this looking glass.
summary: System Information
queries:
title: Supported Queries
description: List of supported query types.
summary: Query Types
query:
title: Supported Query
description: Request a query response per-location.
summary: Query the Looking Glass
```

View file

@ -1,16 +0,0 @@
## Cache
hyperglass automatically caches responses to reduce the number of times devices are queried for the same information.
| Parameter | Type | Default Value | Description |
| :---------------- | :------ | :------------ | :------------------------------------------------------------------------------ |
| `cache.timeout` | Number | 120 | Number of seconds for which to cache device responses. |
| `cache.show_text` | Boolean | True | If true, an indication that a user is viewing cached information will be shown. |
### Example with Defaults
```yaml filename="config.yaml"
cache:
timeout: 120
show_text: true
```

View file

@ -1,90 +0,0 @@
## Logging
Console, file, HTTP, and/or syslog logging configuration.
| Parameter | Type | Default Value | Description |
| :---------- | :----- | :------------ | :---------------------------------------------- |
| `directory` | String | /tmp | Path to directory where logs will be created. |
| `format` | String | text | Log text format, must be `text` or `json`. |
| `max_size` | String | 50MB | Maximum log file size before being overwritten. |
### Syslog
| Parameter | Type | Default Value | Description |
| :-------- | :----- | :------------ | :---------------------- |
| `host` | String | | Syslog target host. |
| `port` | Number | 514 | Syslog target UDP port. |
##### Syslog Example
```yaml filename="config.yaml" copy
logging:
syslog:
host: log.example.com
port: 514
```
### HTTP Logging
If enabled, logs will be sent by HTTP `POST` method.
| Parameter | Type | Default Value | Description |
| :----------- | :------ | :------------ | :---------------------------------------------- |
| `provider` | String | generic | Must be `generic`, `msteams`, or `slack`. |
| `host` | String | | URL |
| `headers` | Map | | |
| `params` | Map | | |
| `verify_ssl` | Boolean | true | Enable or disable SSL certificate verification. |
| `timeout` | Number | 5 | HTTP connection timeout in seconds. |
#### Authentication
Authentication is supported using HTTP basic authentication or an API key.
| Parameter | Type | Default Value | Description |
| :----------------------------- | :----- | :------------ | :--------------------------------------------------------------------------------------------------------- |
| `http.authentication.mode` | String | basic | Must be `basic` or `api_key`. |
| `http.authentication.username` | String | | Basic authentication username if `mode` is set to `basic`. |
| `http.authentication.password` | String | | Basic authentication password if `mode` is set to `basic`, or API key value if `mode` is set to `api_key`. |
| `http.authentication.header` | String | X-API-Key | Header name if `mode` is set to `api_key`. |
#### Examples
##### Generic
```yaml filename="config.yaml" copy
logging:
http:
provider: generic
host: https://httpbin.org
headers:
x-special-header: super special header value
params:
source: hyperglass
verify_ssl: true
timeout: 5
authentication:
mode: basic
username: your username
password: super secret password
```
In the above example, hyperglass will send a `POST` request to `https://httpbin.org?source=hyperglass` with Basic Authentication headers set.
##### Microsoft Teams Webhook
```yaml filename="config.yaml" copy
logging:
http:
provider: msteams
host: <MS Teams webhook URL>
```
##### Slack
```yaml filename="config.yaml" copy
logging:
http:
provider: slack
host: <Slack webhook URL>
```

View file

@ -1,23 +0,0 @@
## Message Customization
hyperglass provides as much control over user-facing text/messages as possible. The following messages may be adjusted as needed:
| Parameter | Type | Default Value | Description |
| :------------------------------ | :----- | :------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `messages.authentication_error` | String | Authentication error occurred. | Displayed when hyperglass is unable to authenticate to a device. Usually, this indicates a configuration error. |
| `messages.connection_error` | String | Error connecting to \{device_name\}: \{error\} | Displayed when hyperglass is unable to connect to a device. Usually, this indicates a configuration error. `{device_name}` and `{error}` will be used to display the device in question and the specific connection error. |
| `messages.general` | String | Something went wrong. | Displayed when errors occur that hyperglass didn't anticipate or handle correctly. Seeing this error message may indicate a bug in hyperglass. If you see this in the wild, try enabling [debug mode](#global) and review the logs to pinpoint the source of the error. |
| `messages.invalid_input` | String | \{target\} is not valid. | Displayed when a query target's value is invalid in relation to the corresponding query type. `{target}` will be used to display the invalid target. |
| `messages.invalid_query` | String | \{target\} is not a valid \{query_type\} target. | Displayed when a query target's value is invalid in relation to the corresponding query type. `{target}` and `{query_type}` may be used to display the invalid target and corresponding query type. |
| `messages.no_input` | String | \{field\} must be specified. | Displayed when a required field is not specified. `{field}` will be used to display the name of the field that was omitted. |
| `messages.no_output` | String | The query completed, but no matching results were found. | Displayed when hyperglass can connect to a device and execute a query, but the response is empty. |
| `messages.not_found` | String | \{type\} '\{name\}' not found. | Displayed when an object property does not exist in the configuration. `{type}` corresponds to a user-friendly name of the object type (for example, 'Device'), `{name}` corresponds to the object name that was not found. |
| `messages.request_timeout` | String | Request timed out. | Displayed when the [`request_timeout`](#global) time expires. |
| `messages.target_not_allowed` | String | \{target\} is not allowed. | Displayed when a query target is implicitly denied by a configured rule. `{target}` will be used to display the denied query target. |
##### Example
```yaml filename="config.yaml"
message:
general: Something with wrong.
```

View file

@ -1,61 +0,0 @@
## Structured
Devices that support responding to a query with structured or easily parsable data can have their response data placed into an easier to read table (or JSON, when using the REST API). Currently, the following platforms have structured data supported in hyperglass:
- Arista EOS
- Juniper Junos
When structured output is available, hyperglass checks the RPKI state of each BGP prefix returned using one of two methods:
1. From the router's perspective
2. From the perspective of [Cloudflare's RPKI Service](https://rpki.cloudflare.com/)
Additionally, hyperglass provides the ability to control which BGP communities are shown to the end user.
| Parameter | Type | Default Value | Description |
| :----------------------------- | :-------------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------- |
| `structured.rpki.mode` | String | router | Use `router` to use the router's view of the RPKI state (1 above), or `external` to use Cloudflare's view (2 above). |
| `structured.communities.mode` | String | deny | Use `deny` to deny any communities listed in `structured.communities.items`, or `permit` to _only_ permit communities listed. |
| `structured.communities.items` | List of Strings | | List of communities to match. |
### RPKI Examples
#### Show RPKI State from the Device's Perspective
```yaml filename="config.yaml" copy {2}
structured:
rpki:
mode: router
```
#### Show RPKI State from a Public/External Perspective
```yaml filename="config.yaml" copy {2}
structured:
rpki:
mode: external
```
### Community Filtering Examples
#### Deny Listed Communities by Regex pattern
```yaml filename="config.yaml" {5-6}
structured:
communities:
mode: deny
items:
- '^65000:1\d+$' # don't show any communities starting with 65000:1. 65000:1234 would be denied, but 65000:4321 would be permitted.
- "65000:2345" # don't show the 65000:2345 community.
```
#### Permit only Listed Communities
```yaml filename="config.yaml" {5-6}
structured:
communities:
mode: permit
items:
- "^65000:.*$" # permit any communities starting with 65000, but no others.
- "1234:1" # permit only the 1234:1 community.
```

View file

@ -1,294 +0,0 @@
import { Callout } from "nextra/components";
import { Color } from "~/components/color";
## Web UI
hyperglass provides extensive customization options for the look and feel of the web UI.
| Parameter | Type | Default Value | Description |
| :-------------------------- | :----- | :------------ | :----------------------------------------------------------------------------------------------------------------------------------------- |
| `web.location_display_mode` | String | auto | Show the locations field as a `dropdown`, `gallery`. When using `auto`, if there are more than 5 location groups, `dropdown` will be used. |
| `web.custom_javascript` | String | | Path to a javascript file that will be loaded with the website. |
| `web.custom_html` | String | | Path to a custom HTML file that will be loaded with the website and rendered beneath the app. |
### DNS over HTTPS
[DNS over HTTPS](https://www.rfc-editor.org/rfc/rfc8484) is used to look up an FQDN query target from the perspective of the user's browser.
| Parameter | Type | Default Value | Description |
| :------------------ | :----- | :------------------------------------- | :-------------------------------------------------------------------------- |
| `dns_provider.name` | String | cloudflare | If `cloudflare` or `google` are provided, no URL is necessary. |
| `dns_provider.url` | String | `https://cloudflare-dns.com/dns-query` | Provide a custom DNS over HTTPS URL if you'd like to use your own resolver. |
### Logo
| Parameter | Type | Default Value | Description |
| :----------------- | :--------------- | :------------ | :------------------------------------------------- |
| `web.logo.light` | String | | Path to logo to show in light mode. |
| `web.logo.dark` | String | | Path to logo to show in dark mode. |
| `web.logo.favicon` | String | | Path to icon/logo from which to generate favicons. |
| `web.logo.width` | Number or String | 100% | Width of logo, either as pixels or a percentage. |
| `web.logo.height` | Number or String | | Height of logo, either as pixels or a percentage. |
##### Example
```yaml filename="config.yaml" copy
web:
logo:
light: /path/to/light-logo.svg
dark: /path/to/dark-logo.svg
favicon: /path/to/favicon.svg
width: 100%
height: null
```
### Greeting
The greeting is an optional modal/popup window that will present itself to users in the Web UI. It can be used for anything you want; for example:
- A data privacy acknowledgement that must be acknowledged prior to proceeding
- Information about your company
- Instructions on how to use hyperglass
| Parameter | Type | Default Value | Description |
| :---------------------- | :------ | :------------ | :--------------------------------------------------------------------------------------------------- |
| `web.greeting.enable` | Boolean | False | Enable or disable the greeting. |
| `web.greeting.file` | String | | Path to markdown or plain text file that contains greeting content. |
| `web.greeting.title` | String | Welcome | Text to be used as the greeting title. |
| `web.greeting.button` | String | Continue | Text to be used for the button that acknowledges/closes the greeting. |
| `web.greeting.required` | Boolean | False | If `true`, users cannot close the modal or run any queries until the greeting has been acknowledged. |
##### Example
```yaml filename="config.yaml" copy
web:
greeting:
enable: true
file: /path/to/your/file.md
title: Welcome
button: Continue
required: false
```
### OpenGraph
[OpenGraph](https://ogp.me/) is the thing that generates the pretty pictures, titles, and descriptions for links when you post them to sites/tools such as Facebook, Twitter, Slack, etc. By default, [this Opengraph image](/opengraph.jpg) is used, but you can provide your own image. You don't need to worry about sizing or formatting it properly, hyperglass will handle this for you.
| Parameter | Type | Default Value | Description |
| :-------------------- | :----- | :------------ | :---------------------------- |
| `web.opengraph.image` | String | | Path to your OpenGraph image. |
### Highlighting
hyperglass can highlight special values in your router output and provide users with additional information about the content. For example, your organization's BGP communities or IP address space can be visually highlighted, and a tooltip can be shown when a user hovers over the highlighted value.
Each value you wish to be highlighted is defined with the following schema:
| Parameter | Type | Default Value | Description |
| :-------- | :----- | :------------ | :------------------------------------------------------ |
| `pattern` | String | | RegEx pattern or string to match against router output. |
| `label` | String | | Tooltip value when the highlighted text is hovered. |
| `color` | String | | Color name from [`web.theme.colors`](#colors). |
##### Example
```yaml filename="config.yaml" copy
web:
highlight:
- pattern: "65000:1234"
label: Special snowflake community that does a thing
color: primary
- pattern: '^192\.0\.2\.[0-9]+$'
label: Magical IP Address
color: blue
```
### Menus
hyperglass can show completely-customizable menus in the footer. Each menu can be configured with the following schema:
| Parameter | Type | Default Value | Description |
| :-------- | :----- | :------------ | :------------------------------------------------------------------------------------------------------------------------- |
| `title` | String | | Menu title, will be the text that shows on footer. |
| `content` | String | | Plain text or markdown content of the menu or path to a file that contains plain text or markdown content. |
| `side` | String | left | Side of the footer with which the menu will be grouped. |
| `order` | Number | 0 | Optionally specify an order for each menu item. If not specified, menus will be rendered in the order they are configured. |
##### Example
```yaml filename="config.yaml" copy
web:
menus:
- title: Terms & Conditions
content:
| **Don't** break stuff!
_please_
side: right
order: 1
- title: Help
content: /path/to/help/file.md
side: left
order: 0
```
### Links
hyperglass can show customizable links to anything you think your users might find helpful. Each link can be configured with the following schema:
| Parameter | Type | Default Value | Description |
| :---------- | :------ | :------------ | :-------------------------------------------------------------------------------------------------------------------- |
| `title` | String | | Link text. |
| `url` | String | | Link URL. |
| `show_icon` | Boolean | True | If `true`, an icon indicating the link is an external link is shown. |
| `side` | String | left | Side of the footer with which the link will be grouped. |
| `order` | Number | 0 | Optionally specify an order for each link. If not specified, links will be rendered in the order they are configured. |
##### Example
```yaml filename="config.yaml" copy
web:
links:
- title: PeeringDB
url: https://www.peeringdb.com/65000
show_icon: true
side: right
order: 1
- title: Our Website
url: https://example.com
show_icon: false
side: left
order: 0
```
### Credit
| Parameter | Type | Default | Description |
| :-------- | :-----: | :-----: | :--------------------------------------------------------------------------------------- |
| `enable` | Boolean | `true` | Enable or disable the display of developer credit & link to hyperglass GitHub repository |
<Callout emoji="❤️" type="info">
**Note from the Developer**
<br /> If your organization's policy allows, and you don't mind, I request that you keep `credit`
enabled. Remember: my goal for this project is get more networks to use looking glasses to make all
of our lives easier. Because it's primarily other network operators who will use this tool to begin
with, I'd love for any operators that use your looking glass to know where they can get their own.
</Callout>
### Text
Most of the text in the hyperglass UI can be overridden to suit your needs.
| Parameter | Type | Default Value | Description |
| :--------------------------- | :----- | :------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `web.text.title_mode` | String | logo_only | See [title mode section](#title-mode) |
| `web.text.title` | String | hyperglass | Title text. |
| `web.text.subtitle` | String | Network Looking Glass | Subtitle text. |
| `web.text.query_location` | String | Location | Text used to label the query location (router) field. |
| `web.text.query_type` | String | Query Type | Text used to label the query type (directive) field. |
| `web.text.query_target` | String | Target | Text used to label the query target field. |
| `web.text.fqdn_tooltip` | String | Use \{protocol\} | Tooltip text used when a user hovers over the FQDN tooltip. |
| `web.text.fqdn_message` | String | Your browser has resolved \{fqdn\} to | Text used when prompting a user to select a resolve IPv4 or IPv6 address for an FQDN query. |
| `web.text.fqdn_error` | String | Unable to resolve \{fqdn\} | Text used when an FQDN is not resolvable. |
| `web.text.fqdn_error_button` | String | Try Again | Button text used when an FQDN is not resolvable. |
| `web.text.cache_prefix` | String | Results cached for | Text displayed with the cache timeout countdown. |
| `web.text.cache_icon` | String | Cached from \{time\} UTC | Text used when a user hovers over the cache icon, which is displayed when a response was a cached response. `{time}` is replaced with the _original_ query's timestamp. |
| `web.text.complete_time` | String | Completed in \{seconds\} | Text used when a user hovers over the success icon for a query result. `{seconds}` will be replaced with 'n seconds' where n is the time a query took to complete. |
| `web.text.rpki_invalid` | String | Invalid | Text used in table output when a route's RPKI status is invalid. |
| `web.text.rpki_valid` | String | Valid | Text used in table output when a route's RPKI status is valid. |
| `web.text.rpki_unknown` | String | No ROAs Exist | Text used in table output when a route's RPKI status is unknown. |
| `web.text.rpki_unverified` | String | Not Verified | Text used in table output when a route's RPKI status is unverified. |
| `web.text.no_communities` | String | No Communities | Text used in table output when a route has no communities. |
| `web.text.ip_error` | String | Unable to determine IP Address | Error displayed if hyperglass is unable to determine the user's IP. |
| `web.text.no_ip` | String | No \{protocol\} Address | Text displayed if the user doesn't have an IP address of \{protocol\} (IPv4 or IPv6). |
| `web.text.ip_select` | String | Select an IP Address | Text used to label the IP Address selection for the user's IP. |
| `web.text.ip_button` | String | My IP | Text used for the user IP button. |
#### Title Mode
Available title modes are:
| `title_mode` Value | Action |
| :----------------- | :------------------------------------------------------------------ |
| `logo_only` | Only the logo is displayed, no title or subtitle will be visible. |
| `text_only` | Only the title and subtitle are displayed, no logo will be visible. |
| `logo_subtitle` | Only the logo and subtitle are displayed, no title will be visible. |
| `all` | Logo, title, and subtitle will all be visible. |
##### Example
```yaml filename="config.yaml"
web:
text:
title: Our Looking Glass
subtitle: Company Name, Inc.
title_mode: text_only
```
### Theme
hyperglass allows you to customize the colors and fonts used in the Web UI.
| Parameter | Type | Default Value | Description |
| :----------------------------- | :----- | :------------ | :--------------------------------------------------------------------------------------------------------------- |
| `web.theme.default_color_mode` | String | | Set hyperglass's default color mode. By default, the user's system preference is used. Must be `light` or `dark` |
#### Colors
##### Intrinsic Colors
| Parameter | Default Value |
| :------------------------ | :---------------------- |
| `web.theme.colors.black` | <Color hex="#000000" /> |
| `web.theme.colors.white` | <Color hex="#ffffff" /> |
| `web.theme.colors.dark` | <Color hex="#010101"/> |
| `web.theme.colors.light` | <Color hex="#f5f6f7"/> |
| `web.theme.colors.gray` | <Color hex="#c1c7cc"/> |
| `web.theme.colors.red` | <Color hex="#d84b4b"/> |
| `web.theme.colors.orange` | <Color hex="#ff6b35"/> |
| `web.theme.colors.yellow` | <Color hex="#edae49"/> |
| `web.theme.colors.green` | <Color hex="#35b246"/> |
| `web.theme.colors.blue` | <Color hex="#314cb6"/> |
| `web.theme.colors.teal` | <Color hex="#35b299"/> |
| `web.theme.colors.cyan` | <Color hex="#118ab2"/> |
| `web.theme.colors.pink` | <Color hex="#f2607d"/> |
| `web.theme.colors.purple` | <Color hex="#8d30b5"/> |
##### Functional Colors
| Parameter | Default Value |
| :--------------------------- | :--------------------- |
| `web.theme.colors.primary` | <Color hex="#118ab2"/> |
| `web.theme.colors.secondary` | <Color hex="#314cb6"/> |
| `web.theme.colors.success` | <Color hex="#35b246"/> |
| `web.theme.colors.warning` | <Color hex="#edae49"/> |
| `web.theme.colors.error` | <Color hex="#ff6b35"/> |
| `web.theme.colors.danger` | <Color hex="#d84b4b"/> |
###### Example
To override hyperglass's primary color, it's recommended to override its mapped intrinsic color. For example, to override the default primary color to <Color hex="#00ffff" noText /> cyan:
```yaml filename="config.yaml"
web:
theme:
colors:
cyan: "#00ffff"
```
#### Fonts
hyperglass's fonts are loaded from [Google Fonts](https://fonts.google.com/). Any Google font name may be specified to override the default fonts.
| Parameter | Type | Default Value | Description |
| :--------------------- | :----- | :------------ | :--------------------------------------------------------------------------------------- |
| `web.theme.fonts.body` | String | Nunito | Font for all standard body text, including headings. |
| `web.theme.fonts.mono` | String | Fire Code | Font for all monospace text such as inline code or code blocks, including device output. |
##### Example
```yaml filename="config.yaml"
web:
theme:
fonts:
body: Inter
```

View file

@ -1,135 +0,0 @@
import { Callout } from "nextra/components";
import { SupportedPlatforms } from "~/components/platforms";
import { DocsButton } from "~/components/docs-button";
## Device Configuration Parameters
Each configured device may have the following parameters:
| Parameter | Type | Default Value | Description |
| :------------------ | :-------------- | :------------ | :----------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | String | | Display name of the device. |
| `description` | String | | Description of the device, displayed as a subtle label. |
| `avatar` | String | | Path to an avatar/logo image for this site. Used when [`web.location_display_mode`](/configuration/config/web-ui.mdx) is set to `gallery`. |
| `address` | String | | IPv4 address, IPv6 address, or hostname of the device. |
| `group` | String | | Group name, used to visually group devices in the UI. |
| `port` | Number | | TCP port on which to connect to the device. |
| `platform` | String | | Device platform/OS. Must be a [supported platform](/platforms.mdx). |
| `structured_output` | Boolean | True | Disable structured output for a device that supports it. |
| `directives` | List of Strings | | Enable referenced directives configured in the [directives config file](/configuration/directives.mdx). |
| `driver` | String | netmiko | Specify which driver to use for this device. Currently, only `netmiko` is supported. |
| `driver_config` | Mapping | | Mapping/dict of options to pass to the connection driver. |
| `attrs` | Mapping | | Mapping/dict of variables, as referenced in configured directives. |
| `credential` | Mapping | | Mapping/dict of a [credential configuration](/configuration/devices/credentials.mdx). |
| `http` | Mapping | | Mapping/dict of [HTTP client options](/configuration/devices/http-device.mdx), if this device is connected via HTTP. |
| `proxy` | Mapping | | Mapping/dict of [SSH proxy config](/configuration/devices/ssh-proxy.mdx) to use for this device's requests. |
<Callout type="tip">
hyperglass ships with predefined [directives](/configuration/directives.mdx) (commands) for the following [platforms](platforms.mdx):
<SupportedPlatforms />
All built in directives require that the following `attrs` be defined on each device using the directive:
| Attribute | Value |
| :-------- | :-------------------------------------------------------- |
| `source4` | IPv4 address used to source Ping and Traceroute commands. |
| `source6` | IPv6 address used to source Ping and Traceroute commands. |
**Example**
```yaml filename="devices.yaml" {5-7} copy
devices:
- name: New York, NY
address: 192.0.2.1
platform: cisco_ios
attrs:
source4: 192.0.2.1
source6: "2001:db8::1"
```
</Callout>
<Callout type="warning">
If you do not utilize IPv6 in your network, you'll need to create your own directive that only
has IPv4 commands.
</Callout>
## Examples
### Simple
```yaml filename="devices.yaml" copy
devices:
- name: New York, NY
address: 192.0.2.1
platform: cisco_ios
credential:
username: you
password: your password
- name: San Francisco, CA
address: 192.0.2.2
platform: juniper
credential:
username: you
password: your password
```
<h3 className="_font-semibold _tracking-tight _text-slate-900 dark:_text-slate-100 _mt-8 _text-2xl">
{" "}
<DocsButton href="/configuration/directives" /> With Directives
</h3>
In this example, an additional directive `cisco-show-lldp-neighbors` is added to the built-in directives.
```yaml filename="devices.yaml" copy {8-9}
devices:
- name: New York, NY
address: 192.0.2.1
platform: cisco_ios
credential:
username: you
password: your password
directives:
- cisco-show-lldp-neighbors
```
<h3 className="_font-semibold _tracking-tight _text-slate-900 dark:_text-slate-100 _mt-8 _text-2xl">
{" "}
<DocsButton href="/configuration/directives" /> Disable Built-in Directives
</h3>
In this example, _only_ the `cisco-show-lldp-neighbors` directive will be available. Built-in directives are disabled.
```yaml filename="devices.yaml" copy {8-10}
devices:
- name: New York, NY
address: 192.0.2.1
platform: cisco_ios
credential:
username: you
password: your password
directives:
- builtin: false
- cisco-show-lldp-neighbors
```
<h3 className="_font-semibold _tracking-tight _text-slate-900 dark:_text-slate-100 _mt-8 _text-2xl">
{" "}
<DocsButton href="/configuration/directives" /> Enable Specifc Built-in Directives
</h3>
In this example, only specified built-in directives are made available.
```yaml filename="devices.yaml" copy {8-9}
devices:
- name: New York, NY
address: 192.0.2.1
platform: cisco_ios
credential:
username: you
password: your password
directives:
- builtin: [bgp_route, traceroute]
```

View file

@ -1,5 +0,0 @@
export default {
credentials: "Credentials",
"http-device": "HTTP Device",
"ssh-proxy": "SSH Proxy",
};

View file

@ -1,35 +0,0 @@
Each device must be configured with credentials with which hyperglass can log into the device and execute commands.
## Credential Configuration
| Parameter | Type | Default Value | Description |
| :-------------------- | :----- | :------------ | :----------------------------------------------------- |
| `credential.username` | String | | Username to use for authentication to the device. |
| `credential.password` | String | | Password to use for authentication to the device. |
| `credential.key` | String | | Path to SSH key used for authentication to the device. |
### Examples
#### Username & Password
```yaml filename="devices.yaml" copy {5-7}
devices:
- name: New York, NY
address: 192.0.2.1
platform: cisco_ios
credential:
username: you
password: your password
```
#### SSH Private Key
```yaml filename="devices.yaml" copy {5-7}
devices:
- name: San Francisco, CA
address: 192.0.2.2
platform: juniper
credential:
username: you
key: /path/to/your/ssh/key
```

View file

@ -1,85 +0,0 @@
hyperglass supports collecting output from a generic HTTP endpoint.
## HTTP Configuration
| Parameter | Type | Default Value | Description |
| :---------------------- | :------ | :------------ | :--------------------------------------------------------------------------------------------------------------------- |
| `http.attribute_map` | Mapping | | Mapping/dict of hyperglass query fields as keys, and hyperglass query field replacements as values. |
| `http.basic_auth` | Mapping | | If basic authentication is required, provide a mapping/dict containing the basic authentication username and password. |
| `http.body_format` | String | json | Body format, options are `json` `yaml` `xml` `text` |
| `http.follow_redirects` | Boolean | `false` | Follow HTTP redirects from server. |
| `http.headers` | Mapping | | Mapping/dict of http headers to append to requests. |
| `http.method` | String | GET | HTTP method to use for requests. |
| `http.path` | String | / | HTTP URI/Path. |
| `http.query` | Mapping | | Mapping/Dict of URL Query Parameters. |
| `http.retries` | Number | 0 | Number of retries to perform before request failure. |
| `http.scheme` | String | https | HTTP schema, must be `http` or `https` |
| `http.source` | String | | Request source IP address. |
| `http.ssl_ca` | String | | Path to SSL CA certificate file for SSL validation. |
| `http.ssl_client` | String | | Path to client SSL certificates for request. |
| `http.timeout` | Number | 5 | Request timeout in seconds. |
| `http.verify_ssl` | Boolean | `true` | If `false`, invalid certificates for HTTPS hosts will be ignored. |
### Example
#### Basic
The following example will send an HTTP POST request to `https://192.0.2/path/to/query/device` with HTTP basic authentication, and will not verify the SSL certificate.
```yaml filename="devices.yaml" copy
devices:
- name: New York, NY
address: 192.0.2.1
http:
path: /path/to/query/device
method: POST
verify_ssl: false
basic_auth:
username: you
password: your password
```
Given the following hyperglass query:
| Field | Value |
| :------------- | :------------------ |
| Query Target | `192.0.2.0/24` |
| Query Location | `your_location` |
| Query Type | `example_directive` |
The body of the request will be:
```json
{
"query_target": "192.0.2.0/24",
"query_location": "your_location",
"query_type": "example_directive"
}
```
#### Non-HTTPS Request
The following example will send an HTTP GET request to `http://192.0.2.1/path/to/query/device`:
```yaml filename="devices.yaml" {6} copy
devices:
- name: New York, NY
address: 192.0.2.1
http:
path: /path/to/query/device
scheme: http
```
#### Header Authentication
The following example will send an HTTP GET request to `https://192.0.2.1/path/to/query/device` with an `Authorization` header:
```yaml filename="devices.yaml" {6-7} copy
devices:
- name: New York, NY
address: 192.0.2.1
http:
path: /path/to/query/device
headers:
Authorization: your special token
```

View file

@ -1,30 +0,0 @@
In cases where access to the devices is secured behind a "jump box" or other intermediary server/device, hyperglass can use SSH local port forwarding to SSH to an intermedary device first, and then to the device.
## SSH Proxy Configuration
| Parameter | Type | Default Value | Description |
| :----------------- | :------ | :------------ | :----------------------------------------------------------------------------------- |
| `proxy.address` | String | | IPv4 address, IPv6 address, or hostname of SSH proxy. |
| `proxy.port` | Number | 22 | TCP port to use for connecting to the SSH proxy. |
| `proxy.platform` | String | linux_ssh | Currently, only `linux_ssh` is supported. |
| `proxy.credential` | Mapping | | Mapping/dict of a [credential configuration](/configuration/config/credentials.mdx). |
### Examples
#### Use an SSH Proxy When Connecting to a Device
```yaml filename="devices.yaml" copy
devices:
- name: New York, NY
address: 192.0.2.1
credential:
username: you
password: your password
proxy:
address: 203.0.113.1
credential:
username: your proxy username
password: your proxy password
```
In the above example, the credentials `your proxy username`/`your proxy password` will be used to authenticate from the hyperglass server to the SSH proxy, and the credentials `you`/`your password` will be used to authentiate from the SSH proxy to the device.

View file

@ -1,186 +0,0 @@
import { Callout } from "nextra/components";
## What is a directive?
<Callout type="tip">
A <strong style={{color: "#ff5e5b"}}>directive</strong> is a defined configuration for one or more **commands** to run on a device. For example, a BGP Route query is a built-in directive. A directive defines:
- What command (or commands) to run on the device
- Type of UI field, text input or select
- If the field can accept multiple values
- Help information to show about the directive
- Validation rules
</Callout>
Each directive has the following options:
| Parameter | Type | Default Value | Description |
| :------------------- | :-------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | String | | Display name of the directive. |
| `rules` | List of Rules | | List of [rule configs](#rules) |
| `field` | Mapping | | Mapping/dict of [fields config](#fields) |
| `info` | String | | File path to markdown-formatted help information about the directive. |
| `plugins` | List of Strings | | List of plugin names to use with this directive. |
| `groups` | List of Strings | | List of names by which directives are grouped in the UI. |
| `multiple` | Boolean | `false` | Command supports receiving multiple values. For example, Cisco IOS's `show ip bgp community` accepts multiple communities as arguments. |
| `multiple_separator` | String | `" "` | String by which multiple values are separated. For example, a list of values `[65001, 65002, 65003]` would be rendered as `65001 65002 65003` for when the command is run. |
## Rules
A rule is a way of saying "if a query target matches the rule's conditions, run this command".
| Parameter | Type | Default Value | Description |
| :---------- | :-------------- | :------------ | :--------------------------------------------------------------------------------------------- |
| `condition` | String | | Regular expression to match or IP prefix in which the value being evaluated must be contained. |
| `action` | String | permit | `permit` or `deny` the directive target when this rule is matched. |
| `commands` | List of Strings | | Commands to run when this rule matches. `{target}` is replaced with the query target. |
### IP Rule
| Parameter | Type | Default Value | Description |
| :------------------ | :------ | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ge` | Number | 0 | Prefix length greater than defined will be matched. |
| `le` | Number | 32,128 | `32` for IPv4 evaluations, `128` for IPv6 evaluations. Prefix length less than defined will be matched. |
| `allow_reserved` | Boolean | `false` | Allow reserved ([RFC1918](https://www.rfc-editor.org/rfc/rfc1918), [RFC5735](https://www.rfc-editor.org/rfc/rfc5735), [RFC5737](https://www.rfc-editor.org/rfc/rfc5737.html), etc.) addresses to pass validation. |
| `allow_unspecified` | Boolean | `false` | Allow unspecified addresses (`0.0.0.0` `::`) to pass validation. |
| `allow_loopback` | Boolean | `false` | Allow [loopback addresses](https://www.rfc-editor.org/rfc/rfc1700.html) (`127.0.0.0/8` `::1`) to pass validation. |
#### Examples
##### Require IPv4 Queries between /8 and /24
```yaml filename="directives.yaml" {5-6} /{target} {mask}/ copy
your-directive:
name: IP Route
rules:
- condition: 0.0.0.0/0
ge: 8
le: 24
command: "show ip route {target} {mask}"
```
Given a query target of 198.18.0.0/15, the command run on the device would be:
```none /198.18.0.0 255.254.0.0/
show ip route 198.18.0.0 255.254.0.0
```
##### Deny a Specific Prefix
```yaml filename="directives.yaml" {5} copy
your directive:
name: BGP Route
rules:
- condition: "192.0.2.0/24"
action: deny
- condition: "0.0.0.0/0"
command: "show ip bgp {target}"
```
In this example, a query of any IP address or prefix contained within 192.0.2.0/24 will result in an error.
##### Run Multiple Commands
```yaml filename="directives.yaml" /{target}/ {6-7} copy
your-directive:
name: BGP Communities
rules:
- condition: "65000:[0-9]+"
commands:
- "show route table inet.0 community {target} detail"
- "show route table inet6.0 community {target} detail"
```
In this example, a query of `65000:1` would result in the following commands being sent to the device:
```none /65000:1/
show route table inet.0 community 65000:1 detail
show route table inet6.0 community 65000:1 detail
```
The output for both commands will be shown as the query result.
### Regex Validation
To validate input by regex pattern, just specify a regex pattern as the `condition`
```yaml filename="directives.yaml" copy
your-directive:
name: DNS Query
rules:
- condition: '^.+\.yourdomain\.com$'
```
### No Validation
```yaml filename="directives.yaml" /{target}/ copy {4}
your-directive:
name: IP Route
rules:
- condition: null
command: show ip route {target}
```
In this example, any query would pass, regardless of query input. For instance, if a user selected this directive/query type and queried `your mom`, the real command sent to the device will be:
```none /your mom/
show ip route your mom
```
## Fields
### Text Input
| Parameter | Type | Default Value | Description |
| :------------ | :----- | :------------ | :---------------------------------------------------- |
| `description` | String | | Field description, displayed as a label or help text. |
| `validation` | String | | Regex pattern to validate text input. |
### Select
| Parameter | Type | Default Value | Description |
| :------------ | :-------------- | :------------ | :---------------------------------------------------- |
| `description` | String | | Field description, displayed as a label or help text. |
| `options` | List of Options | | |
#### Options
Each select option uses the following schema:
| Parameter | Type | Default Value | Description |
| :------------ | :----- | :------------ | :------------------------------------------------------- |
| `description` | String | | Field description, displayed as a label or help text. |
| `name` | String | | If specified, will be used as the option's display name. |
| `value` | String | | Option value sent to the device. |
### Examples
Example of a text directive expecting a string value matching a regex pattern:
```yaml filename="directives.yaml" copy {6-7}
your-directive:
name: IP Route
rules:
- condition: null
command: show ip route {target}
field:
validation: '[0-9a-f\.\:]+'
```
Example of a select directive:
```yaml filename="directives.yaml" copy {6-12}
your-directive:
name: BGP Community
rules:
- condition: null
command: show ip bgp community {target}
field:
options:
- value: "65001:1"
description: Provider A Routes
- value: "65001:2"
description: Provider B Routes
```

View file

@ -1,5 +0,0 @@
export default {
"basic-configuration": "Basic Configuration",
"add-your-own-command": "Add Your Own Command",
"customize-the-ui": "Customize the UI",
};

View file

@ -1,60 +0,0 @@
import { Steps } from "nextra/components";
## Add Your Own Command
While hyperglass does come with several built-in [directives](/configuration/configuration/directives.mdx) (commands), you can also add your own. For example, say you want to add a command that shows the BGP summary from a device:
<Steps>
### Create the Directive
```yaml filename="directives.yaml" copy
show-bgp-summary:
name: BGP Summary
rules:
- condition: null
command: show bgp all summary
field: null
```
### Associate the Directive with the Device
```yaml filename="devices.yaml" {5-6} copy
devices:
- name: Your Router
address: 192.0.2.1
platform: cisco_ios
directives:
- show-bgp-summary
```
</Steps>
## Default Directives
By default, all built-in directives are _also_ enabled. If you wish to _only_ enable directives you specify, you can use `builtins: false` as a directive:
```yaml filename="devices.yaml" {6-7} copy
devices:
- name: Your Router
address: 192.0.2.1
platform: cisco_ios
directives:
- builtins: false
- show-bgp-summary
```
In the above example, _only_ the `show-bgp-summary` directive will be enabled.
You can also selectively enable certain built-in directives:
```yaml filename="devices.yaml" {6} copy
devices:
- name: Your Router
address: 192.0.2.1
platform: cisco_ios
directives:
- builtins: [bgp_route, traceroute]
```
In the above example, _only_ the BGP Route and Traceroute built-in directives will be enabled.

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