Skip to content

Commit

Permalink
Merge pull request #493 from netbox-community/develop
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
tobiasge authored Apr 27, 2021
2 parents cb5ffa0 + 60428d5 commit 676ca79
Show file tree
Hide file tree
Showing 34 changed files with 305 additions and 207 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
name: Checks syntax of our code
steps:
- uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- uses: actions/setup-python@v2
- name: Lint Code Base
uses: github/super-linter@v3
Expand All @@ -39,7 +42,7 @@ jobs:
build_cmd:
- ./build-latest.sh
- PRERELEASE=true ./build-latest.sh
- ./build-next.sh
- ./build.sh feature
- ./build.sh develop
docker_from:
- '' # use the default of the build script
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build_cmd:
- ./build-latest.sh
- PRERELEASE=true ./build-latest.sh
- ./build-next.sh
- ./build.sh feature
- ./build.sh develop
fail-fast: false
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ configuration/*
!configuration/configuration.py
!configuration/extra.py
configuration/ldap/*
!configuration/ldap/extra.py
!configuration/ldap/ldap_config.py
!configuration/logging.py
!configuration/plugins.py
prometheus.yml
super-linter.log
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ It runs NetBox's own unit tests and ensures that all initializers work:
IMAGE=netboxcommunity/netbox:latest ./test.sh
```

## About
## Support

This repository is currently maintained and funded by [nxt][nxt].

[nxt]: https://nxt.engineering/en/
This repository is currently maintained by the community.
Please consider sponsoring the maintainers of this project.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.2.0
39 changes: 0 additions & 39 deletions build-next.sh

This file was deleted.

28 changes: 28 additions & 0 deletions configuration/ldap/extra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
####
## This file contains extra configuration options that can't be configured
## directly through environment variables.
## All vairables set here overwrite any existing found in ldap_config.py
####

# # This Python script inherits all the imports from ldap_config.py
# from django_auth_ldap.config import LDAPGroupQuery # Imported since not in ldap_config.py

# # Sets a base requirement of membetship to netbox-user-ro, netbox-user-rw, or netbox-user-admin.
# AUTH_LDAP_REQUIRE_GROUP = (
# LDAPGroupQuery("cn=netbox-user-ro,ou=groups,dc=example,dc=com")
# | LDAPGroupQuery("cn=netbox-user-rw,ou=groups,dc=example,dc=com")
# | LDAPGroupQuery("cn=netbox-user-admin,ou=groups,dc=example,dc=com")
# )

# # Sets LDAP Flag groups variables with example.
# AUTH_LDAP_USER_FLAGS_BY_GROUP = {
# "is_staff": (
# LDAPGroupQuery("cn=netbox-user-ro,ou=groups,dc=example,dc=com")
# | LDAPGroupQuery("cn=netbox-user-rw,ou=groups,dc=example,dc=com")
# | LDAPGroupQuery("cn=netbox-user-admin,ou=groups,dc=example,dc=com")
# ),
# "is_superuser": "cn=netbox-user-admin,ou=groups,dc=example,dc=com",
# }

# # Sets LDAP Mirror groups variables with example groups
# AUTH_LDAP_MIRROR_GROUPS = ["netbox-user-ro", "netbox-user-rw", "netbox-user-admin"]
55 changes: 55 additions & 0 deletions configuration/logging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# # Remove first comment(#) on each line to implement this working logging example.
# # Add LOGLEVEL environment variable to netbox if you use this example & want a different log level.
# from os import environ

# # Set LOGLEVEL in netbox.env or docker-compose.overide.yml to override a logging level of INFO.
# LOGLEVEL = environ.get('LOGLEVEL', 'INFO')

# LOGGING = {

# 'version': 1,
# 'disable_existing_loggers': False,
# 'formatters': {
# 'verbose': {
# 'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
# 'style': '{',
# },
# 'simple': {
# 'format': '{levelname} {message}',
# 'style': '{',
# },
# },
# 'filters': {
# 'require_debug_false': {
# '()': 'django.utils.log.RequireDebugFalse',
# },
# },
# 'handlers': {
# 'console': {
# 'level': LOGLEVEL,
# 'filters': ['require_debug_false'],
# 'class': 'logging.StreamHandler',
# 'formatter': 'simple'
# },
# 'mail_admins': {
# 'level': 'ERROR',
# 'class': 'django.utils.log.AdminEmailHandler',
# 'filters': ['require_debug_false']
# }
# },
# 'loggers': {
# 'django': {
# 'handlers': ['console'],
# 'propagate': True,
# },
# 'django.request': {
# 'handlers': ['mail_admins'],
# 'level': 'ERROR',
# 'propagate': False,
# },
# 'django_auth_ldap': {
# 'handlers': ['console',],
# 'level': LOGLEVEL,
# }
# }
# }
13 changes: 13 additions & 0 deletions configuration/plugins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Add your plugins and plugin settings here.
# Of course uncomment this file out.

# To learn how to build images with your required plugins
# See https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins

# PLUGINS = ["netbox_bgp"]

# PLUGINS_CONFIG = {
# "netbox_bgp": {
# ADD YOUR SETTINGS HERE
# }
# }
5 changes: 5 additions & 0 deletions docker-compose.override.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: '3.4'
services:
netbox:
ports:
- 8000:8080
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ services:
- ./reports:/etc/netbox/reports:z,ro
- ./scripts:/etc/netbox/scripts:z,ro
- netbox-media-files:/opt/netbox/netbox/media:z
ports:
- "8080"
netbox-worker:
<<: *netbox
depends_on:
Expand Down
4 changes: 1 addition & 3 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,4 @@ echo "✅ Initialisation is done."

# Launch whatever is passed by docker
# (i.e. the RUN instruction in the Dockerfile)
#
# shellcheck disable=SC2068
exec $@
exec "$@"
8 changes: 4 additions & 4 deletions initializers/custom_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
## Examples:

# - name: link_to_repo
# text: 'Link to Netbox Docker'
# url: 'https://github.com/netbox-community/netbox-docker'
# link_text: 'Link to Netbox Docker'
# link_url: 'https://github.com/netbox-community/netbox-docker'
# new_window: False
# content_type: device
# - name: link_to_localhost
# text: 'Link to localhost'
# url: 'http://localhost'
# link_text: 'Link to localhost'
# link_url: 'http://localhost'
# new_window: True
# content_type: device
9 changes: 9 additions & 0 deletions initializers/devices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@
# position: 3
# custom_field_data:
# text_field: Description
# - name: server04
# device_role: server
# device_type: Other
# site: SING 1
# location: cage 101
# face: front
# position: 3
# custom_field_data:
# text_field: Description
32 changes: 3 additions & 29 deletions initializers/groups.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
## To list all permissions, run:
##
## docker-compose run --rm --entrypoint /bin/bash netbox
## $ ./manage.py migrate
## $ ./manage.py shell
## > from django.contrib.auth.models import Permission
## > print('\n'.join([p.codename for p in Permission.objects.all()]))
##
## Permission lists support wildcards. See the examples below.
##
## Examples:

# applications:
# users:
# - technical_user
# - technical_user
# readers:
# users:
# - reader
# - reader
# writers:
# users:
# - writer
# permissions:
# - delete_device
# - delete_virtualmachine
# - add_*
# - change_*
# vm_managers:
# permissions:
# - '*_virtualmachine'
# device_managers:
# permissions:
# - '*device*'
# creators:
# permissions:
# - add_*
# - writer
File renamed without changes.
48 changes: 48 additions & 0 deletions initializers/object_permissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# all.ro:
# actions:
# - view
# description: 'Read Only for All Objects'
# enabled: true
# groups:
# - applications
# - readers
# object_types: all
# users:
# - jdoe
# all.rw:
# actions:
# - add
# - change
# - delete
# - view
# description: 'Read/Write for All Objects'
# enabled: true
# groups:
# - writers
# object_types: all
# network_team.rw:
# actions:
# - add
# - change
# - delete
# - view
# description: "Network Team Permissions"
# enabled: true
# object_types:
# circuits:
# - circuit
# - circuittermination
# - circuittype
# - provider
# dcim: all
# ipam:
# - aggregate
# - ipaddress
# - prefix
# - rir
# - role
# - routetarget
# - service
# - vlan
# - vlangroup
# - vrf
2 changes: 1 addition & 1 deletion initializers/power_panels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# site: AMS 1
# - name: power panel SING 1
# site: SING 1
# rack_group: cage 101
# location: cage 101
2 changes: 1 addition & 1 deletion initializers/racks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# text_field: Description
# - site: SING 1
# name: rack-03
# group: cage 101
# location: cage 101
# role: Role 3
# type: 4-post-cabinet
# width: 19
Expand Down
25 changes: 8 additions & 17 deletions initializers/users.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
## To list all permissions, run:
##
## docker-compose run --rm --entrypoint /bin/bash netbox
## $ ./manage.py migrate
## $ ./manage.py shell
## > from django.contrib.auth.models import Permission
## > print('\n'.join([p.codename for p in Permission.objects.all()]))
##
## Permission lists support wildcards. See the examples below.
##
## Examples:

# technical_user:
# api_token: 0123456789technicaluser789abcdef01234567 # must be looooong!
# reader:
# password: reader
# writer:
# password: writer
# permissions:
# - delete_device
# - delete_virtualmachine
# - add_*
# - change_*
# jdoe:
# first_name: John
# last_name: Doe
# api_token: 0123456789jdoe789abcdef01234567jdoe
# is_active: True
# is_superuser: False
# is_staff: False
# email: [email protected]
Loading

0 comments on commit 676ca79

Please sign in to comment.