|
| 1 | +# Customization Guide |
| 2 | + |
| 3 | +If you're self-hosting Networking Toolbox, you can customize the branding for your instance with a few env vars. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Networking Toolbox supports customization through environment variables. This allows you to: |
| 8 | +- Brand the application with your organization's name |
| 9 | +- Use a custom logo/icon |
| 10 | +- Set default themes and layouts |
| 11 | +- Maintain consistency across your organization |
| 12 | + |
| 13 | +**Important:** These customizations only affect the default values. Users can still customize their personal preferences through the settings menu, and those will be stored in their browser's localStorage. |
| 14 | + |
| 15 | +## Getting Started |
| 16 | + |
| 17 | +Download the [`.env.example`](https://gist.githubusercontent.com/Lissy93/3c5f85dc0e2263a4706d3e136f0a076e/raw/62a00f625c920ac9e1cafe60721213e2ea233581/.env.example) to `.env` in the root of your project. |
| 18 | + |
| 19 | +1. Copy `.env.example` to `.env`: |
| 20 | + ```bash |
| 21 | + curl -o .env https://gist.githubusercontent.com/Lissy93/3c5f85dc0e2263a4706d3e136f0a076e/raw/62a00f625c920ac9e1cafe60721213e2ea233581/.env.example |
| 22 | + ``` |
| 23 | + |
| 24 | +2. Edit `.env` and uncomment/modify the variables you want to customize |
| 25 | + |
| 26 | +3. Restart your application to apply changes |
| 27 | + |
| 28 | +## Available Customizations |
| 29 | + |
| 30 | +### Site Branding |
| 31 | + |
| 32 | +```bash |
| 33 | +# Customize your site name and description |
| 34 | +NTB_SITE_NAME=My Network Tools |
| 35 | +NTB_SITE_TITLE=My Network Tools |
| 36 | +NTB_SITE_DESCRIPTION=Professional networking utilities for your team |
| 37 | +``` |
| 38 | + |
| 39 | +### Custom Logo |
| 40 | + |
| 41 | +Use a custom logo image in the navbar: |
| 42 | + |
| 43 | +```bash |
| 44 | +NTB_SITE_ICON=/logo.svg |
| 45 | +``` |
| 46 | + |
| 47 | +Place your logo image in the `static/` directory and reference it with a leading slash. Supported formats: SVG, PNG, JPG, WebP. |
| 48 | + |
| 49 | +### Default Layout |
| 50 | + |
| 51 | +Set the default homepage layout: |
| 52 | + |
| 53 | +```bash |
| 54 | +# Options: categories, default, minimal, carousel, bookmarks, small-icons, list, search, empty |
| 55 | +NTB_HOMEPAGE_LAYOUT=categories |
| 56 | +``` |
| 57 | + |
| 58 | +### Default Navbar Display |
| 59 | + |
| 60 | +Control what appears in the top navigation: |
| 61 | + |
| 62 | +```bash |
| 63 | +# Options: default, bookmarked, frequent, none |
| 64 | +NTB_NAVBAR_DISPLAY=default |
| 65 | +``` |
| 66 | + |
| 67 | +### Default Theme |
| 68 | + |
| 69 | +Set the default color theme: |
| 70 | + |
| 71 | +```bash |
| 72 | +# Options: dark, light, midnight, arctic, ocean, purple, cyberpunk, terminal, lightpurple, muteddark, solarized |
| 73 | +NTB_DEFAULT_THEME=dark |
| 74 | +``` |
| 75 | + |
| 76 | +## Example Configurations |
| 77 | + |
| 78 | +### Corporate Branding Example |
| 79 | + |
| 80 | +```bash |
| 81 | +NTB_SITE_NAME=Acme Corp Network Tools |
| 82 | +NTB_SITE_TITLE=Acme Corp Network Tools |
| 83 | +NTB_SITE_DESCRIPTION=Internal networking utilities for Acme Corp IT team |
| 84 | +NTB_SITE_ICON=/acme-logo.svg |
| 85 | +NTB_DEFAULT_THEME=light |
| 86 | +NTB_HOMEPAGE_LAYOUT=list |
| 87 | +``` |
| 88 | + |
| 89 | +### Minimalist Setup Example |
| 90 | + |
| 91 | +```bash |
| 92 | +NTB_SITE_NAME=NetUtils |
| 93 | +NTB_SITE_DESCRIPTION=Simple network utilities |
| 94 | +NTB_DEFAULT_THEME=muteddark |
| 95 | +NTB_HOMEPAGE_LAYOUT=search |
| 96 | +NTB_NAVBAR_DISPLAY=none |
| 97 | +``` |
| 98 | + |
| 99 | +## Docker Deployment |
| 100 | + |
| 101 | +When using Docker, pass environment variables with the `-e` flag or use a `.env` file: |
| 102 | + |
| 103 | +```bash |
| 104 | +docker run -p 5000:5000 \ |
| 105 | + -e NTB_SITE_NAME="My Network Tools" \ |
| 106 | + -e NTB_DEFAULT_THEME="light" \ |
| 107 | + lissy93/networking-toolbox |
| 108 | +``` |
| 109 | + |
| 110 | +Or with docker-compose: |
| 111 | + |
| 112 | +```yaml |
| 113 | +services: |
| 114 | + networking-toolbox: |
| 115 | + image: lissy93/networking-toolbox |
| 116 | + ports: |
| 117 | + - "5000:5000" |
| 118 | + environment: |
| 119 | + - NTB_SITE_NAME=My Network Tools |
| 120 | + - NTB_DEFAULT_THEME=light |
| 121 | + - NTB_SITE_ICON=/custom-logo.svg |
| 122 | + volumes: |
| 123 | + - ./static:/app/static # For custom logo |
| 124 | +``` |
| 125 | +
|
| 126 | +## Notes |
| 127 | +
|
| 128 | +- All environment variables must be prefixed with `NTB_` to be accessible |
| 129 | +- Changes require an application restart to take effect |
| 130 | +- The managed instance at [networking-toolbox.as93.net](https://networking-toolbox.as93.net) uses the default values |
| 131 | +- User preferences set through the UI take precedence over these defaults |
| 132 | +- Invalid values will fallback to the default settings |
| 133 | + |
| 134 | + |
0 commit comments