text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```shell #!/bin/bash function install_with_brew() { # Will get the latest version in brew. # As of writing, 3.6 and later won't work with PyInstaller so this method is avoided for now. brew update; brew install python3; } function install_with_pkg() { wget -O python3.pkg path_to_url sudo installer -pkg python3.pkg -target /; } install_with_pkg pip3 install --upgrade virtualenv; virtualenv venv -p python3; # Now run `source venv/bin/activate` in the shell where the virtualenv should be used ```
/content/code_sandbox/scripts/ci/setup_venv_osx.sh
shell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
132
```powershell $msipath = "$PSScriptRoot\node-installer.msi" function RunCommand ($command, $command_args) { Write-Host $command $command_args Start-Process -FilePath $command -ArgumentList $command_args -Wait -Passthru } function InstallNode () { DownloadNodeMSI InstallNodeMSI } function DownloadNodeMSI () { $url = "path_to_url" $start_time = Get-Date Write-Output "Downloading node msi" Invoke-WebRequest -Uri $url -OutFile $msipath Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)" } function InstallNodeMSI () { $install_args = "/qn /log node_install.log /i $msipath" $uninstall_args = "/qn /x $msipath" RunCommand "msiexec.exe" $install_args #if (-not(Test-Path $python_home)) { # Write-Host "Python seems to be installed else-where, reinstalling." # RunCommand "msiexec.exe" $uninstall_args # RunCommand "msiexec.exe" $install_args #} } function main () { InstallNode rm $msipath } main ```
/content/code_sandbox/scripts/ci/install_node.ps1
powershell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
295
```shell #!/bin/bash # # We should create a release checklist to ensure releases are consistent. # # Create an annotated tag #git tag -a $ ```
/content/code_sandbox/scripts/chores/make-release.sh
shell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
32
```powershell # Sample script to install Python and pip under Windows # Authors: Olivier Grisel, Jonathan Helmus, Kyle Kastner, and Alex Willmer # # Find the latest version of this script at: # path_to_url $MINICONDA_URL = "path_to_url" $BASE_URL = "path_to_url" $GET_PIP_URL = "path_to_url" $GET_PIP_PATH = "C:\get-pip.py" $PYTHON_PRERELEASE_REGEX = @" (?x) (?<major>\d+) \. (?<minor>\d+) \. (?<micro>\d+) (?<prerelease>[a-z]{1,2}\d+) "@ function Download ($filename, $url) { $webclient = New-Object System.Net.WebClient $basedir = $pwd.Path + "\" $filepath = $basedir + $filename if (Test-Path $filename) { Write-Host "Reusing" $filepath return $filepath } # Download and retry up to 3 times in case of network transient errors. Write-Host "Downloading" $filename "from" $url $retry_attempts = 2 for ($i = 0; $i -lt $retry_attempts; $i++) { try { $webclient.DownloadFile($url, $filepath) break } Catch [Exception]{ Start-Sleep 1 } } if (Test-Path $filepath) { Write-Host "File saved at" $filepath } else { # Retry once to get the error message if any at the last try $webclient.DownloadFile($url, $filepath) } return $filepath } function ParsePythonVersion ($python_version) { if ($python_version -match $PYTHON_PRERELEASE_REGEX) { return ([int]$matches.major, [int]$matches.minor, [int]$matches.micro, $matches.prerelease) } $version_obj = [version]$python_version return ($version_obj.major, $version_obj.minor, $version_obj.build, "") } function DownloadPython ($python_version, $platform_suffix) { $major, $minor, $micro, $prerelease = ParsePythonVersion $python_version if (($major -le 2 -and $micro -eq 0) ` -or ($major -eq 3 -and $minor -le 2 -and $micro -eq 0) ` ) { $dir = "$major.$minor" $python_version = "$major.$minor$prerelease" } else { $dir = "$major.$minor.$micro" } if ($prerelease) { if (($major -le 2) ` -or ($major -eq 3 -and $minor -eq 1) ` -or ($major -eq 3 -and $minor -eq 2) ` -or ($major -eq 3 -and $minor -eq 3) ` ) { $dir = "$dir/prev" } } if (($major -le 2) -or ($major -le 3 -and $minor -le 4)) { $ext = "msi" if ($platform_suffix) { $platform_suffix = ".$platform_suffix" } } else { $ext = "exe" if ($platform_suffix) { $platform_suffix = "-$platform_suffix" } } $filename = "python-$python_version$platform_suffix.$ext" $url = "$BASE_URL$dir/$filename" $filepath = Download $filename $url return $filepath } function InstallPython ($python_version, $architecture, $python_home) { Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home if (Test-Path $python_home) { Write-Host $python_home "already exists, skipping." return $false } if ($architecture -eq "32") { $platform_suffix = "" } else { $platform_suffix = "amd64" } $installer_path = DownloadPython $python_version $platform_suffix $installer_ext = [System.IO.Path]::GetExtension($installer_path) Write-Host "Installing $installer_path to $python_home" $install_log = $python_home + ".log" if ($installer_ext -eq '.msi') { InstallPythonMSI $installer_path $python_home $install_log } else { InstallPythonEXE $installer_path $python_home $install_log } if (Test-Path $python_home) { Write-Host "Python $python_version ($architecture) installation complete" } else { Write-Host "Failed to install Python in $python_home" Get-Content -Path $install_log Exit 1 } } function InstallPythonEXE ($exepath, $python_home, $install_log) { $install_args = "/quiet InstallAllUsers=1 TargetDir=$python_home" RunCommand $exepath $install_args } function InstallPythonMSI ($msipath, $python_home, $install_log) { $install_args = "/qn /log $install_log /i $msipath TARGETDIR=$python_home" $uninstall_args = "/qn /x $msipath" RunCommand "msiexec.exe" $install_args if (-not(Test-Path $python_home)) { Write-Host "Python seems to be installed else-where, reinstalling." RunCommand "msiexec.exe" $uninstall_args RunCommand "msiexec.exe" $install_args } } function RunCommand ($command, $command_args) { Write-Host $command $command_args Start-Process -FilePath $command -ArgumentList $command_args -Wait -Passthru } function InstallPip ($python_home) { $pip_path = $python_home + "\Scripts\pip.exe" $python_path = $python_home + "\python.exe" if (-not(Test-Path $pip_path)) { Write-Host "Installing pip..." $webclient = New-Object System.Net.WebClient $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) Write-Host "Executing:" $python_path $GET_PIP_PATH & $python_path $GET_PIP_PATH } else { Write-Host "pip already installed." } } function DownloadMiniconda ($python_version, $platform_suffix) { if ($python_version -eq "3.4") { $filename = "Miniconda3-3.5.5-Windows-" + $platform_suffix + ".exe" } else { $filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe" } $url = $MINICONDA_URL + $filename $filepath = Download $filename $url return $filepath } function InstallMiniconda ($python_version, $architecture, $python_home) { Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home if (Test-Path $python_home) { Write-Host $python_home "already exists, skipping." return $false } if ($architecture -eq "32") { $platform_suffix = "x86" } else { $platform_suffix = "x86_64" } $filepath = DownloadMiniconda $python_version $platform_suffix Write-Host "Installing" $filepath "to" $python_home $install_log = $python_home + ".log" $args = "/S /D=$python_home" Write-Host $filepath $args Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru if (Test-Path $python_home) { Write-Host "Python $python_version ($architecture) installation complete" } else { Write-Host "Failed to install Python in $python_home" Get-Content -Path $install_log Exit 1 } } function InstallMinicondaPip ($python_home) { $pip_path = $python_home + "\Scripts\pip.exe" $conda_path = $python_home + "\Scripts\conda.exe" if (-not(Test-Path $pip_path)) { Write-Host "Installing pip..." $args = "install --yes pip" Write-Host $conda_path $args Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru } else { Write-Host "pip already installed." } } function main () { InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON InstallPip $env:PYTHON } main ```
/content/code_sandbox/scripts/ci/install_python.ps1
powershell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
1,949
```shell #!/bin/bash set -e echoerr() { echo "$@" 1>&2; } function get_platform() { # Will return "linux" for GNU/Linux # I'd just like to interject for a moment... # path_to_url # Will return "macos" for macOS/OS X # Will return "windows" for Windows/MinGW/msys _platform=$(uname | tr '[:upper:]' '[:lower:]') if [[ $_platform == "darwin" ]]; then _platform="macos"; elif [[ $_platform == "msys"* ]]; then _platform="windows"; elif [[ $_platform == "mingw"* ]]; then _platform="windows"; elif [[ $_platform == "linux" ]]; then # Nothing to do true; else echoerr "ERROR: $_platform is not a valid platform"; exit 1; fi echo $_platform; } function get_version() { $(dirname "$0")/getversion.sh; } function get_arch() { _arch="$(uname -m)" echo $_arch; } platform=$(get_platform) version=$(get_version) arch=$(get_arch) echo "Platform: $platform, arch: $arch, version: $version" function build_zip() { echo "Zipping executables..." pushd dist; filename="activitywatch-${version}-${platform}-${arch}.zip" echo "Name of package will be: $filename" if [[ $platform == "windows"* ]]; then 7z a $filename activitywatch; else zip -r $filename activitywatch; fi popd; echo "Zip built!" } function build_setup() { filename="activitywatch-${version}-${platform}-${arch}-setup.exe" echo "Name of package will be: $filename" innosetupdir="/c/Program Files (x86)/Inno Setup 6" if [ ! -d "$innosetupdir" ]; then echo "ERROR: Couldn't find innosetup which is needed to build the installer. We suggest you install it using chocolatey. Exiting." exit 1 fi # Windows installer version should not include 'v' prefix, see: path_to_url version_no_prefix="$(echo $version | sed -e 's/^v//')" env AW_VERSION=$version_no_prefix "$innosetupdir/iscc.exe" scripts/package/activitywatch-setup.iss mv dist/activitywatch-setup.exe dist/$filename echo "Setup built!" } build_zip if [[ $platform == "windows"* ]]; then build_setup fi echo echo "-------------------------------------" echo "Contents of ./dist" ls -l dist echo "-------------------------------------" ```
/content/code_sandbox/scripts/package/package-all.sh
shell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
607
```shell #!/bin/bash # TODO: Merge with scripts/package/getversion.sh # set -e if [[ $TRAVIS_TAG ]]; then _version=$TRAVIS_TAG; elif [[ $APPVEYOR_REPO_TAG_NAME ]]; then _version=$APPVEYOR_REPO_TAG_NAME; else # Exact _version=$(git describe --tags --abbrev=0 --exact-match 2>/dev/null) if [[ -z $_version ]]; then # Latest tag + commit ID _version="$(git describe --tags --abbrev=0).dev-$(git rev-parse --short HEAD)" fi fi echo $_version; ```
/content/code_sandbox/scripts/package/getversion.sh
shell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
140
```shell #!/bin/bash # pick the latest zip # NOTE: this assumes that the latest built zip is the only zip in the directory ZIP_FILE=`ls ./dist/ -1 | grep zip | sort -r | head -1` unzip ./dist/$ZIP_FILE # fetch deps wget path_to_url chmod +x linuxdeploy-x86_64.AppImage wget path_to_url chmod +x appimagetool-x86_64.AppImage # create AppRun echo '#!/bin/sh DIR="$(dirname "$(readlink -f "${0}")")" "${DIR}"/aw-qt "$@"' > activitywatch/AppRun chmod a+x ./activitywatch/AppRun # build appimage ./linuxdeploy-x86_64.AppImage --appdir activitywatch --executable ./activitywatch/aw-qt --output appimage --desktop-file ./activitywatch/aw-qt.desktop --icon-file ./activitywatch/media/logo/logo.png --icon-filename activitywatch APPIMAGE_FILE=`ls -1 | grep AppImage| grep -i ActivityWatch` cp -v $APPIMAGE_FILE ./dist/activitywatch-linux-x86_64.AppImage ```
/content/code_sandbox/scripts/package/package-appimage.sh
shell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
244
```shell #!/usr/bin/bash # Setting the shell is required, as `sh` doesn't support slicing. # Fail fast set -e # Verbose commands for CI verification set -x VERSION=$(scripts/package/getversion.sh) # Slice off the "v" from the tag, which is probably guaranteed VERSION_NUM=${VERSION:1} echo $VERSION_NUM PKGDIR="activitywatch_$VERSION_NUM" # Package tools sudo apt-get install sed jdupes wget if [ -d "PKGDIR" ]; then sudo rm -rf $PKGDIR fi # .deb meta files mkdir -p $PKGDIR/DEBIAN # activitywatch's install location mkdir -p $PKGDIR/opt # Allows aw-qt to autostart. mkdir -p $PKGDIR/etc/xdg/autostart # Allows users to manually start aw-qt from their start menu. mkdir -p $PKGDIR/usr/share/applications # While storing the control file in a variable here, dumping it in a file is so unnecessarily # complicated that it's easier to just dump move and sed. cp ./scripts/package/deb/control $PKGDIR/DEBIAN/control sed -i "s/SCRIPT_VERSION_HERE/${VERSION_NUM}/" $PKGDIR/DEBIAN/control # Verify the file content cat $PKGDIR/DEBIAN/control # The entire opt directory (should) consist of dist/activitywatch/* cp -r dist/activitywatch/ $PKGDIR/opt/ # Hard link duplicated libraries # (I have no idea what this is for) jdupes -L -r -S -Xsize-:1K $PKGDIR/opt/ sudo chown -R root:root $PKGDIR # Prepare the .desktop file sudo sed -i 's!Exec=aw-qt!Exec=/opt/activitywatch/aw-qt!' $PKGDIR/opt/activitywatch/aw-qt.desktop sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/etc/xdg/autostart/ sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/usr/share/applications/ dpkg-deb --build $PKGDIR sudo mv activitywatch_${VERSION_NUM}.deb dist/activitywatch-${VERSION}-linux-x86_64.deb ```
/content/code_sandbox/scripts/package/package-deb.sh
shell
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
489
```inno setup ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "ActivityWatch" #define MyAppVersion GetEnv('AW_VERSION') #define MyAppPublisher "ActivityWatch Contributors" #define MyAppURL "path_to_url" #define MyAppExeName "aw-qt.exe" #define RootDir "..\.." #define DistDir "..\..\dist" #pragma verboselevel 9 [Setup] ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) ; NOTE: the double {{ are used to escape the { character (needed for the AppId) AppId={{F226B8F4-3244-46E6-901D-0CE8035423E4} AppName={#MyAppName} AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL="path_to_url" AppUpdatesURL="path_to_url" DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) PrivilegesRequired=lowest PrivilegesRequiredOverridesAllowed=dialog OutputDir={#DistDir} OutputBaseFilename=activitywatch-setup SetupIconFile="{#RootDir}\aw-qt\media\logo\logo.ico" UninstallDisplayName={#MyAppName} UninstallDisplayIcon={app}\{#MyAppExeName} Compression=lzma SolidCompression=yes WizardStyle=modern [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked Name: "StartMenuEntry" ; Description: "Start ActivityWatch when Windows starts"; GroupDescription: "Windows Startup"; MinVersion: 4,4; [Files] Source: "{#DistDir}\activitywatch\aw-qt.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#DistDir}\activitywatch\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: StartMenuEntry; [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent ; Removes the previously installed version before installing the new one ; NOTE: Doesn't work? And also discouraged by the docs ;[InstallDelete] ;Type: filesandordirs; Name: "{app}\" ```
/content/code_sandbox/scripts/package/activitywatch-setup.iss
inno setup
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
721
```python # -*- coding: utf-8 -*- from __future__ import unicode_literals import plistlib import os.path # Use like this: dmgbuild -s settings.py "Test Volume" test.dmg # You can actually use this file for your own application (not just TextEdit) # by doing e.g. # # dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg # .. Useful stuff .............................................................. application = defines.get('app', 'dist/ActivityWatch.app') appname = os.path.basename(application) def icon_from_app(app_path): plist_path = os.path.join(app_path, 'Contents', 'Info.plist') with open(plist_path, "rb") as f: plist = plistlib.load(f) icon_name = plist['CFBundleIconFile'] icon_root,icon_ext = os.path.splitext(icon_name) if not icon_ext: icon_ext = '.icns' icon_name = icon_root + icon_ext return os.path.join(app_path, 'Contents', 'Resources', icon_name) # .. Basics .................................................................... # Uncomment to override the output filename # filename = 'test.dmg' # Uncomment to override the output volume name # volume_name = 'Test' # Volume format (see hdiutil create -help) format = defines.get('format', 'UDBZ') # Volume size size = defines.get('size', None) # Files to include files = [ application ] # Symlinks to create symlinks = { 'Applications': '/Applications' } # Volume icon # # You can either define icon, in which case that icon file will be copied to the # image, *or* you can define badge_icon, in which case the icon file you specify # will be used to badge the system's Removable Disk icon # #icon = '/path/to/icon.icns' badge_icon = icon_from_app(application) # Where to put the icons icon_locations = { appname: (140, 120), 'Applications': (500, 120) } show_status_bar = False show_tab_view = False show_toolbar = False show_pathbar = False show_sidebar = False sidebar_width = 180 # Window position in ((x, y), (w, h)) format window_rect = ((100, 100), (640, 280)) default_view = 'icon-view' show_icon_preview = False # Set these to True to force inclusion of icon/list view settings (otherwise # we only include settings for the default view) include_icon_view_settings = 'auto' include_list_view_settings = 'auto' # .. Icon view configuration ................................................... arrange_by = None grid_offset = (0, 0) grid_spacing = 100 scroll_position = (0, 0) label_pos = 'bottom' # or 'right' text_size = 16 icon_size = 128 # .. List view configuration ................................................... # Column names are as follows: # # name # date-modified # date-created # date-added # date-last-opened # size # kind # label # version # comments # list_icon_size = 16 list_text_size = 12 list_scroll_position = (0, 0) list_sort_by = 'name' list_use_relative_dates = True list_calculate_all_sizes = False, list_columns = ('name', 'date-modified', 'size', 'kind', 'date-added') list_column_widths = { 'name': 300, 'date-modified': 181, 'date-created': 181, 'date-added': 181, 'date-last-opened': 181, 'size': 97, 'kind': 115, 'label': 100, 'version': 75, 'comments': 300, } list_column_sort_directions = { 'name': 'ascending', 'date-modified': 'descending', 'date-created': 'descending', 'date-added': 'descending', 'date-last-opened': 'descending', 'size': 'descending', 'kind': 'ascending', 'label': 'ascending', 'version': 'ascending', 'comments': 'ascending', } ```
/content/code_sandbox/scripts/package/dmgbuild-settings.py
python
2016-04-27T15:26:09
2024-08-16T18:38:46
activitywatch
ActivityWatch/activitywatch
11,595
927
```javascript export const BUILD_ENVS = { dev: 'development', prod: 'production', }; export const BASE_URL = 'control'; ```
/content/code_sandbox/client/constants.js
javascript
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
29
```go //go:build !next package main import ( "embed" // Embed tzdata in binary. // // See path_to_url _ "time/tzdata" "github.com/AdguardTeam/AdGuardHome/internal/home" ) // Embed the prebuilt client here since we strive to keep .go files inside the // internal directory and the embed package is unable to embed files located // outside of the same or underlying directory. //go:embed build var clientBuildFS embed.FS func main() { home.Main(clientBuildFS) } ```
/content/code_sandbox/main.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
124
```javascript import { merge } from 'webpack-merge'; import common from './webpack.common.js'; export default merge(common, { stats: 'minimal', performance: { hints: false, }, }); ```
/content/code_sandbox/client/webpack.prod.js
javascript
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
43
```javascript import { merge } from 'webpack-merge'; import yaml from 'js-yaml'; import fs from 'fs'; import { BASE_URL } from './constants.js'; import common from './webpack.common.js'; const ZERO_HOST = '0.0.0.0'; const LOCALHOST = '127.0.0.1'; const DEFAULT_PORT = 80; /** * Get document, or throw exception on error * @returns {{bind_host: string, bind_port: number}} */ const importConfig = () => { try { const doc = yaml.safeLoad(fs.readFileSync('../AdguardHome.yaml', 'utf8')); const { bind_host, bind_port } = doc; return { bind_host, bind_port, }; } catch (e) { console.error(e); return { bind_host: ZERO_HOST, bind_port: DEFAULT_PORT, }; } }; const getDevServerConfig = (proxyUrl = BASE_URL) => { const { bind_host: host, bind_port: port } = importConfig(); const { DEV_SERVER_PORT } = process.env; const devServerHost = host === ZERO_HOST ? LOCALHOST : host; const devServerPort = DEV_SERVER_PORT || port + 8000; return { hot: true, open: true, host: devServerHost, port: devServerPort, proxy: { [proxyUrl]: `path_to_url{devServerHost}:${port}`, }, }; }; export default merge(common, { devtool: 'eval-source-map', ...(process.env.WEBPACK_DEV_SERVER ? { devServer: getDevServerConfig(BASE_URL) } : undefined), }); ```
/content/code_sandbox/client/webpack.dev.js
javascript
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
358
```javascript module.exports = { rules: { "selector-type-no-unknown": true, "block-closing-brace-empty-line-before": "never", "block-no-empty": true, "block-opening-brace-newline-after": "always", "block-opening-brace-space-before": "always", "color-hex-case": "lower", "color-named": "never", "color-no-invalid-hex": true, "length-zero-no-unit": true, "declaration-block-trailing-semicolon": "always", "custom-property-empty-line-before": ["always", { "except": [ "after-custom-property", "first-nested" ] }], "declaration-block-no-duplicate-properties": true, "declaration-colon-space-after": "always", "declaration-empty-line-before": ["always", { "except": [ "after-declaration", "first-nested", "after-comment" ] }], "font-weight-notation": "numeric", "indentation": [4, { "except": ["value"] }], "max-empty-lines": 2, "no-missing-end-of-source-newline": true, "number-leading-zero": "always", "property-no-unknown": true, "rule-empty-line-before": ["always-multi-line", { "except": ["first-nested"], "ignore": ["after-comment"] }], "string-quotes": "double", "value-list-comma-space-after": "always", "unit-case": "lower" } } ```
/content/code_sandbox/client/.stylelintrc.js
javascript
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
340
```go //go:build next package main import ( "embed" "github.com/AdguardTeam/AdGuardHome/internal/next/cmd" ) // Embed the prebuilt client here since we strive to keep .go files inside the // internal directory and the embed package is unable to embed files located // outside of the same or underlying directory. //go:embed build var frontend embed.FS func main() { cmd.Main(frontend) } ```
/content/code_sandbox/main_next.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
96
```javascript module.exports = { "disableEmoji": true, "list": [ "+ ", "* ", "- ", ], "maxMessageLength": 64, "minMessageLength": 3, "questions": [ "type", "scope", "subject", "body", "issues", ], "scopes": [ "", "ui", "global", "filtering", "home", "dnsforward", "dhcpd", "querylog", "documentation", ], "types": { "+ ": { "description": "A new feature", "emoji": "", "value": "+ " }, "* ": { "description": "A code change that neither fixes a bug or adds a feature", "emoji": "", "value": "* " }, "- ": { "description": "A bug fix", "emoji": "", "value": "- " } } }; ```
/content/code_sandbox/changelog.config.js
javascript
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
213
```javascript import path from 'path'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import { CleanWebpackPlugin } from 'clean-webpack-plugin'; import CopyPlugin from 'copy-webpack-plugin'; import MiniCssExtractPlugin from 'mini-css-extract-plugin'; import * as url from 'url'; import { BUILD_ENVS } from './constants.js'; // eslint-disable-next-line no-underscore-dangle const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); const RESOURCES_PATH = path.resolve(__dirname); const ENTRY_REACT = path.resolve(RESOURCES_PATH, 'src/index.tsx'); const ENTRY_INSTALL = path.resolve(RESOURCES_PATH, 'src/install/index.tsx'); const ENTRY_LOGIN = path.resolve(RESOURCES_PATH, 'src/login/index.tsx'); const HTML_PATH = path.resolve(RESOURCES_PATH, 'public/index.html'); const HTML_INSTALL_PATH = path.resolve(RESOURCES_PATH, 'public/install.html'); const HTML_LOGIN_PATH = path.resolve(RESOURCES_PATH, 'public/login.html'); const ASSETS_PATH = path.resolve(RESOURCES_PATH, 'public/assets'); const PUBLIC_PATH = path.resolve(__dirname, '../build/static'); const PUBLIC_ASSETS_PATH = path.resolve(PUBLIC_PATH, 'assets'); const BUILD_ENV = BUILD_ENVS[process.env.BUILD_ENV]; const isDev = BUILD_ENV === BUILD_ENVS.dev; const config = { mode: BUILD_ENV, target: 'web', context: RESOURCES_PATH, entry: { main: ENTRY_REACT, install: ENTRY_INSTALL, login: ENTRY_LOGIN, }, output: { path: PUBLIC_PATH, filename: '[name].[chunkhash].js', }, resolve: { modules: ['node_modules'], extensions: ['.js', '.jsx', '.ts', '.tsx'], }, module: { rules: [ { test: /\.ya?ml$/, type: 'json', use: 'yaml-loader', }, { test: /\.css$/i, use: [ { loader: MiniCssExtractPlugin.loader, }, { loader: 'css-loader', options: { importLoaders: 1, }, }, { loader: 'postcss-loader', }, ], }, { test: /\.tsx?$/, exclude: /node_modules/, use: { loader: 'ts-loader', }, }, ], }, plugins: [ new CleanWebpackPlugin({ root: PUBLIC_PATH, verbose: false, dry: false, }), new HtmlWebpackPlugin({ inject: true, cache: false, chunks: ['main'], template: HTML_PATH, }), new HtmlWebpackPlugin({ inject: true, cache: false, chunks: ['install'], filename: 'install.html', template: HTML_INSTALL_PATH, }), new HtmlWebpackPlugin({ inject: true, cache: false, chunks: ['login'], filename: 'login.html', template: HTML_LOGIN_PATH, }), new MiniCssExtractPlugin({ filename: isDev ? '[name].css' : '[name].[hash].css', chunkFilename: isDev ? '[id].css' : '[id].[hash].css', }), new CopyPlugin({ patterns: [ { from: ASSETS_PATH, to: PUBLIC_ASSETS_PATH, }, ], }), ], }; export default config; ```
/content/code_sandbox/client/webpack.common.js
javascript
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
727
```yaml 'coverage': 'status': 'project': 'default': 'target': '40%' 'threshold': null 'patch': false 'changes': false ```
/content/code_sandbox/.codecov.yml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
41
```css /* Disable Auto Zoom in Input - Safari on iPhone path_to_url */ @media screen and (max-width: 767px) { input, select, textarea { font-size: 1rem; } } .login { display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; min-height: 100vh; } [data-theme='dark'] .login__logo { filter: invert(1); } .login__form { margin: auto; padding: 40px 15px 100px; width: 100%; max-width: 24rem; } .login__info { position: relative; text-align: center; } .login__message, .login__link { font-size: 14px; font-weight: 400; letter-spacing: 0; } @media screen and (min-width: 992px) { .login__message { position: absolute; top: 40px; padding: 0 15px; } } .form__group { position: relative; margin-bottom: 15px; } .form__message { font-size: 11px; } .form__message--error { color: var(--red); } ```
/content/code_sandbox/client/src/login/Login/Login.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
271
```css /* Disable Auto Zoom in Input - Safari on iPhone path_to_url */ @media screen and (max-width: 767px) { input, select, textarea { font-size: 1rem; } } .setup { min-height: calc(100vh - 345px); line-height: 1.48; } @media screen and (min-width: 768px) { .setup { padding: 50px 0; min-height: calc(100vh - 141px); } } .setup__container { max-width: 650px; margin: 0 auto; padding: 30px 20px; line-height: 1.6; background-color: var(--card-bgcolor); box-shadow: 0 1px 4px rgba(74, 74, 74, 0.36); border-radius: 3px; } [data-theme='dark'] .setup__container { box-shadow: none; border: 1px solid var(--card-border-color); } @media screen and (min-width: 768px) { .setup__container { width: 650px; padding: 40px 30px; } } .setup__logo { display: block; margin: 0 auto 40px; max-width: 140px; } [data-theme='dark'] .setup__logo { filter: invert(1); } .setup__nav { text-align: center; } .setup__step { margin-bottom: 25px; } .setup__title { margin-bottom: 30px; font-size: 28px; text-align: center; font-weight: 700; } .setup__subtitle { margin-bottom: 10px; font-size: 17px; font-weight: 700; } .setup__desc { margin-bottom: 20px; font-size: 15px; } .setup__group { margin-bottom: 35px; } .setup__group:last-child { margin-bottom: 0; } .setup__progress { font-size: 13px; text-align: center; } .setup__progress-wrap { height: 4px; margin: 20px -20px -30px -20px; overflow: hidden; background-color: #eaeaea; border-radius: 0 0 3px 3px; } @media screen and (min-width: 768px) { .setup__progress-wrap { margin: 20px -30px -40px -30px; } } .setup__progress-inner { width: 0; height: 100%; font-size: 1.2rem; line-height: 20px; color: #fff; text-align: center; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); transition: width 0.6s ease; background: linear-gradient(45deg, rgba(99, 125, 120, 1) 0%, rgba(88, 177, 101, 1) 100%); } .btn-standard { padding-left: 20px; padding-right: 20px; } .form__message { font-size: 11px; } .form__message--error { color: var(--red); } .setup__button { min-width: 120px; padding-left: 30px; padding-right: 30px; } .setup__error { margin: -5px 0 5px; } .divider--small { margin-top: 1rem; margin-bottom: 1rem; } ```
/content/code_sandbox/client/src/install/Setup/Setup.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
802
```css .schedule__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .schedule__row:last-child { margin-bottom: 0; } .schedule__rows { margin-bottom: 24px; } .schedule__day { display: none; min-width: 110px; } .schedule__day--mobile { display: block; min-width: 50px; } @media screen and (min-width: 767px) { .schedule__row { justify-content: flex-start; } .schedule__day { display: block; } .schedule__day--mobile { display: none; } .schedule__actions { margin-left: 32px; white-space: nowrap; } } .schedule__time { min-width: 110px; } .schedule__button { border: 0; } .schedule__days { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; } .schedule__button-day { display: flex; justify-content: center; align-items: center; min-width: 60px; height: 32px; font-size: 14px; line-height: 14px; color: #495057; background-color: transparent; border: 1px solid var(--card-border-color); border-radius: 4px; cursor: pointer; outline: 0; } .schedule__button-day[data-active='true'] { color: var(--btn-success-bgcolor); border-color: var(--btn-success-bgcolor); } .schedule__time-wrap { margin-bottom: 24px; } .schedule__time-row { display: flex; align-items: center; gap: 16px; } .schedule__time-select { display: flex; align-items: center; } .schedule__error { margin-top: 4px; font-size: 13px; color: #cd201f; } .schedule__timezone { margin-bottom: 24px; } .schedule__current-timezone { margin-bottom: 16px; } .schedule__info { margin-bottom: 24px; } .schedule__notice { font-size: 13px; } .schedule__info-title { margin-bottom: 8px; } .schedule__info-row { display: flex; align-items: center; margin-bottom: 4px; } .schedule__info-icon { width: 24px; height: 24px; margin-right: 8px; color: #495057; flex-shrink: 0; } ```
/content/code_sandbox/client/src/components/Filters/Services/ScheduleForm/styles.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
581
```css .toasts { position: fixed; right: 24px; bottom: 24px; z-index: 105; width: 345px; } @media (max-width: 425px) { .toasts { right: 0; width: 100%; } } .toast { display: flex; align-items: flex-start; margin-bottom: 12px; padding: 16px; font-weight: 600; color: #ffffff; border-radius: 4px; background-color: rgba(236, 53, 53, 0.75); } .toast--success { background-color: rgba(90, 173, 99, 0.75); } .toast:last-child { margin-bottom: 0; } .toast__content { flex: 1 1 auto; margin: 0 12px 0 0; text-overflow: ellipsis; overflow: hidden; } .toast__content a { font-weight: 600; color: #fff; text-decoration: underline; } .toast__dismiss { display: block; flex: 0 0 auto; padding: 0; background: transparent; border: 0; cursor: pointer; } .toast__dismiss:hover, .toast__dismiss:focus { outline: none; } .toast-enter { opacity: 0.01; } .toast-enter-active { opacity: 1; transition: all 0.3s ease-out; } .toast-exit { opacity: 1; } .toast-exit-active { opacity: 0.01; transition: all 0.3s ease-out; } ```
/content/code_sandbox/client/src/components/Toasts/Toast.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
368
```css :root { --black: #131313; --bgcolor: #f5f7fb; --mcolor: #495057; --scolor: rgba(74, 74, 74, 0.7); --border-color: rgba(0, 40, 100, 0.12); --header-bgcolor: #fff; --card-bgcolor: #fff; --card-border-color: rgba(0, 40, 100, 0.12); --ctrl-bgcolor: #fff; --ctrl-select-bgcolor: rgba(69, 79, 94, 0.12); --ctrl-dropdown-color: #212529; --ctrl-dropdown-bgcolor-focus: #f8f9fa; --ctrl-dropdown-color-focus: #16181b; --btn-success-bgcolor: #5eba00; --form-disabled-bgcolor: #f8f9fa; --form-disabled-color: #495057; --rt-nodata-bgcolor: rgba(255, 255, 255, 0.8); --rt-nodata-color: rgba(0, 0, 0, 0.5); --modal-overlay-bgcolor: rgba(255, 255, 255, 0.75); --logs__table-bgcolor: #fff; --logs__row--blue-bgcolor: #e5effd; --logs__row--white-bgcolor: #fff; --detailed-info-color: #888888; --yellow-pale: rgba(247, 181, 0, 0.1); --green79: #67b279; --gray-a5: #a5a5a5; --gray-d8: #d8d8d8; --gray-f3: #f3f3f3; --loading-bg: rgba(255, 255, 255, 0.48); --font-family-monospace: Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace; --font-size-disable-autozoom: 1rem; --alert-message-color: #24426c; --alert-message-border: #cbdbf2; --alert-message-bg: #dae5f5; --checkbox-bg: #e2e2e2; --radio-bg: #ffffff; } [data-theme='dark'] { --black: #ffffff; --bgcolor: #131313; --mcolor: #e6e6e6; --scolor: #a5a5a5; --header-bgcolor: #131313; --border-color: #222; --card-bgcolor: #1c1c1c; --card-border-color: #3d3d3d; --ctrl-bgcolor: #1c1c1c; --ctrl-select-bgcolor: #3d3d3d; --ctrl-dropdown-color: #fff; --ctrl-dropdown-bgcolor-focus: #000; --ctrl-dropdown-color-focus: #fff; --btn-success-bgcolor: #67b279; --form-disabled-bgcolor: #2d2d2d; --form-disabled-color: #a5a5a5; --logs__text-color: #f3f3f3; --rt-nodata-bgcolor: #1c1c1c; --rt-nodata-color: #fff; --modal-overlay-bgcolor: rgba(19, 19, 19, 0.75); --logs__table-bgcolor: #3d3d3d; --logs__row--blue-bgcolor: #467fcf; --logs__row--white-bgcolor: #1c1c1c; --detailed-info-color: #fff; --gray300: #f3f3f3; --loading-bg: #131313; --alert-message-color: #e6e6e6; --alert-message-border: #363648; --alert-message-bg: #363648; --checkbox-bg: #a4a4a4; --radio-bg: #a4a4a4; } body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; } /* Disable Auto Zoom in Input - Safari on iPhone path_to_url */ @media screen and (max-width: 767px) { input, select, textarea { font-size: var(--font-size-disable-autozoom); } } .status { margin-top: 30px; } .container--wrap { min-height: calc(100vh - 372px); } @media screen and (min-width: 768px) { .container--wrap { min-height: calc(100vh - 168px); } } @media screen and (min-width: 992px) { .container--wrap { min-height: calc(100vh - 187px); } } .loading-bar { position: fixed; top: 0; left: 0; z-index: 103; height: 3px; background: linear-gradient(45deg, rgba(99, 125, 120, 1) 0%, rgba(88, 177, 101, 1) 100%); } .modal-body--medium { max-height: 20rem; overflow-y: auto; } .modal-body--filters { max-height: 600px; overflow-y: auto; } .modal-body__item:not(:first-child) { padding-top: 1.5rem; } .font-monospace { font-family: var(--font-family-monospace); } .mw-75 { max-width: 75% !important; } .cursor--not-allowed { cursor: not-allowed; } .ReactModal__Body--open { overflow: hidden; } a.btn-success.disabled { color: #fff; } ```
/content/code_sandbox/client/src/components/App/index.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,315
```css .form__button { margin-left: 1.5rem; } @media (max-width: 500px) { .form__button { margin-left: 0; margin-top: 1rem; display: block; } } ```
/content/code_sandbox/client/src/components/Settings/FormButton.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
55
```css .form__group { position: relative; margin-bottom: 15px; } .form__group:last-child { margin-bottom: 0; } .form__group--settings:last-child { margin-bottom: 20px; } .form__group--inner { max-width: 300px; margin-top: -10px; margin-left: 40px; font-size: 14px; } .form__group--input { max-width: 300px; margin: 0 1.5rem 10px; } .form__group--checkbox { margin-bottom: 25px; } .form__group--inner .form__group--checkbox { margin-bottom: 12px; } .form__group--inner .form__group--checkbox:last-child { margin-bottom: 0; } .form__inline { display: flex; justify-content: flex-start; } .btn-standard { padding-left: 20px; padding-right: 20px; } .btn-large { min-width: 150px; } .form-control--textarea { min-height: 110px; transition: 0.3s ease-in-out background-color; } .form-control--textarea-small { min-height: 90px; } .form-control--textarea-large { min-height: 240px; } .form__message { font-size: 11px; } .form__message--error { color: #cd201f; } .form__message--left-pad { padding-left: 0.85rem; } .interface__title { font-size: 13px; font-weight: 700; } .interface__ip:after { content: ', '; } .interface__ip:last-child:after { content: ''; } .form__desc { margin-top: 10px; font-size: 13px; color: var(--scolor); } .form__desc--top { margin: 0 0 8px; } .form__label--bold { font-weight: 700; } .form__label--with-desc { margin-bottom: 0; } .form__label--bot { margin-bottom: 10px; } .form__label--top { margin-top: 10px; } .form__status { margin-top: 10px; font-size: 14px; line-height: 1.7; } .encryption__list { padding-left: 0; } .encryption__list li { list-style: inside; } .btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; background-color: transparent; overflow: hidden; } .btn-icon--green { color: var(--green); } .btn-icon-sm { width: 23px; height: 23px; min-width: 23px; padding: 5px; } .custom-control-label, .custom-control-label:before { transition: 0.3s ease-in-out background-color, 0.3s ease-in-out color; } .custom-select:disabled { background-color: #f9f9f9; } .custom-select { transition: 0.3s ease-in-out background-color, 0.3s ease-in-out color; } ```
/content/code_sandbox/client/src/components/Settings/Settings.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
714
```css .service { display: flex; flex-direction: row-reverse; align-items: center; margin-bottom: 15px; padding: 10px 15px; border: 1px solid var(--card-border-color); border-radius: 4px; cursor: pointer; } .service__text { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } @media screen and (min-width: 768px) { .services { display: flex; flex-flow: row wrap; } .service { flex-grow: 0; flex-shrink: 0; flex-basis: calc(99.9% * 4 / 12 - (30px - 30px * 4 / 12)); max-width: calc(99.9% * 4 / 12 - (30px - 30px * 4 / 12)); width: calc(99.9% * 4 / 12 - (30px - 30px * 4 / 12)); } .service--global { flex-basis: 1; max-width: 100%; width: 100%; } .service:nth-child(1n) { margin-right: 30px; margin-left: 0; } .service:nth-child(3n) { margin-right: 0; margin-left: auto; } } .service__icon { width: 20px; height: 20px; flex-shrink: 0; margin-right: 10px; color: #495057; } .service__icon svg { width: 20px; height: 20px; fill: #495057; } .service--global .service__icon { display: none; } .service__icon--table { margin-bottom: 3px; color: #9aa0ac; } .service__switch { margin-left: auto; border: 1px solid rgba(150, 150, 150, 0.12); } .custom-switch-input:checked ~ .service__switch { background-color: #cd201f; } .custom-switch-input:focus ~ .service__switch { box-shadow: 0 0 0 2px #cd201f3b; border-color: #ec4241; } .custom-switch-input:disabled ~ .service__switch, .custom-switch-input:disabled ~ .service__text, .custom-switch-input:disabled ~ .service__icon { opacity: 0.5; cursor: pointer; } ```
/content/code_sandbox/client/src/components/Settings/Clients/Service.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
564
```css .dhcp-form__button { margin: 0 1rem; } .page-title--dhcp { display: flex; align-items: center; } .col__dhcp { flex: 0 0 50%; max-width: 50%; padding-right: 0; } .dhcp__interfaces { padding-bottom: 1rem; } .dhcp__interfaces-info { padding: 0.5rem 0.75rem 0; line-break: anywhere; } @media (max-width: 991.98px) { .dhcp-form__button { margin: 0.5rem 0; display: block; } .page-title--dhcp { flex-direction: column; align-items: flex-start; padding-bottom: 0.5rem; } .col__dhcp { flex: 0 0 100%; max-width: 100%; padding-right: 0.75rem; } .dhcp__interfaces { flex-direction: column; padding-bottom: 0.5rem; } } ```
/content/code_sandbox/client/src/components/Settings/Dhcp/index.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
235
```css .version { font-size: 0.8rem; } @media screen and (min-width: 1280px) { .version { font-size: 0.85rem; } } .version__value { font-weight: 600; } @media screen and (min-width: 992px) { .version__value { max-width: 100%; overflow: visible; } } .version__link { position: relative; display: inline-block; border-bottom: 1px dashed #495057; cursor: pointer; } .version__text { display: flex; align-items: center; justify-content: center; } @media screen and (min-width: 992px) { .version__text { justify-content: flex-end; } } ```
/content/code_sandbox/client/src/components/ui/Version.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
172
```css .topline { position: relative; z-index: 102; margin-bottom: 0; padding: 0.75rem 0; } ```
/content/code_sandbox/client/src/components/ui/Topline.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
35
```css .checkbox { display: inline-block; margin: 0; } .checkbox--single { display: block; margin: 2px auto 6px; } .checkbox--single .checkbox__label:before { margin-right: 0; } .checkbox--settings .checkbox__label:before { top: 2px; margin-right: 20px; } .checkbox--settings .checkbox__label-title { margin-bottom: 2px; font-weight: 600; } .checkbox--form .checkbox__label:before { top: 1px; margin-right: 10px; } .checkbox__label { position: relative; display: flex; align-items: flex-start; justify-content: center; font-size: 14px; font-weight: 400; user-select: none; cursor: pointer; } .checkbox__label:before { content: ''; position: relative; top: 1px; display: inline-block; vertical-align: middle; width: 20px; height: 20px; min-width: 20px; margin-right: 10px; background-color: var(--checkbox-bg); background-repeat: no-repeat; background-position: center center; background-size: 12px 10px; border-radius: 3px; transition: 0.3s ease-in-out box-shadow, 0.3s ease-in-out opacity; } .checkbox__label .checkbox__label-text { line-height: 1.3; } .checkbox__label .checkbox__label-text .md__paragraph { display: inline-block; vertical-align: baseline; margin: 0; text-align: left; line-height: 1.3; } .checkbox__input { position: absolute; opacity: 0; } .checkbox__input:checked + .checkbox__label:before { background-image: url(data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashLjIiLz48L3N2Zz4=); } .checkbox__input:focus + .checkbox__label:before { box-shadow: 0 0 1px 1px rgba(74, 74, 74, 0.32); } .checkbox__input:disabled + .checkbox__label { cursor: default; color: var(--gray); } .checkbox__input:disabled + .checkbox__label:before { opacity: 0.6; } .checkbox__label-text { max-width: 515px; line-height: 1.5; } .checkbox__label-text--long { max-width: initial; } .checkbox__label-title { display: block; line-height: 1.5; } .checkbox__label-subtitle { display: block; line-height: 1.5; color: var(--scolor); } ```
/content/code_sandbox/client/src/components/ui/Checkbox.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
621
```css .nav-tabs .nav-link.active { border-color: var(--btn-success-bgcolor); color: var(--btn-success-bgcolor); background: transparent; } .nav-tabs .nav-link.active:hover { border-color: #4b9400; color: #4b9400; } .nav-icon { width: 15px; height: 15px; margin-right: 6px; stroke: #9aa0ac; } .nav-tabs .nav-link.active .nav-icon, .nav-tabs .nav-item.show .nav-icon { stroke: var(--green-74); } .nav-tabs .nav-link.active:hover .nav-icon, .nav-tabs .nav-item.show:hover .nav-icon { stroke: #58a273; } .nav-tabs .nav-link { width: 100%; border: 0; padding: 20px 0; } .header { position: relative; padding: 5px 0; z-index: 102; } .mobile-menu { position: fixed; z-index: 103; top: 0; right: calc(100% + 5px); display: block; width: 250px; height: 100vh; transition: transform 0.3s ease; background-color: var(--header-bgcolor); overflow-y: auto; } .mobile-menu--active { transform: translateX(255px); box-shadow: 15px 0 50px rgba(0, 0, 0, 0.1); } .nav-tabs .nav-link--back { height: 63px; padding: 20px 0 21px; font-weight: 600; } .nav-tabs .nav-link--account { max-width: 160px; font-size: 0.9rem; text-overflow: ellipsis; overflow: hidden; } .header-brand-img { height: 24px; } .nav-tabs .nav-item.show .nav-link { color: var(--green-74); background-color: #fff; border-bottom-color: var(--green-74); } .header__right { display: flex; align-items: center; justify-content: flex-end; min-width: 100px; } .header__logout { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; min-width: 25px; padding: 2px; margin-left: 10px; color: #9aa0ac; } .header__logout:hover, .header__logout:focus { color: #6e7687; } .header__logout-icon { height: 100%; } .header__row { display: flex; align-items: center; } .header__container { width: 100%; max-width: 1200px; padding-right: 0.75rem; padding-left: 0.75rem; margin-right: auto; margin-left: auto; } .header__column:last-child { margin-left: auto; } .nav-tabs { margin: 0; } @media screen and (min-width: 992px) { .header { padding: 0; } .nav-tabs .nav-link { width: auto; border-bottom: 1px solid transparent; font-size: 13px; white-space: nowrap; } .mobile-menu { position: static; display: flex; padding: 0; width: auto; height: auto; box-shadow: none; overflow: initial; } .mobile-menu--active { transform: none; box-shadow: none; } .nav-icon { display: none; } .nav-icon--gray { color: #9aa0ac; } .nav-icon--white { color: #fff; } .header-brand-img { height: 32px; } .header__logout { width: 35px; height: 35px; padding: 5px; } .header__row { justify-content: space-between; } .header__column:last-child { margin-left: 0; } .nav-tabs { margin: 0 -0.75rem; } } @media screen and (min-width: 1280px) { .nav-tabs .nav-link { font-size: 14px; } .nav-icon { display: block; } } .dns-status { padding: 0.35em 0.5em; line-height: 10px; } ```
/content/code_sandbox/client/src/components/Header/Header.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,019
```css .select.select--theme { height: 45px; padding: 0 32px 2px 11px; outline: 0; border-color: var(--ctrl-select-bgcolor); background-image: url("data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIjYgOSAxMiAxNSAxOCA5Ij48L3BvbHlsaW5lPgo8L3N2Zz4K"); background-repeat: no-repeat; background-position: right 9px center; background-size: 17px 20px; appearance: none; cursor: pointer; } .select--theme::-ms-expand { opacity: 0; } .select.select--language { height: 45px; padding: 0 32px 2px 33px; outline: 0; border-color: var(--ctrl-select-bgcolor); background-image: url("data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashMTAgMTUuMyAxNS4zIDAgMCAxIDQtMTB6Ii8+Cjwvc3ZnPgo="), url("data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIjYgOSAxMiAxNSAxOCA5Ij48L3BvbHlsaW5lPgo8L3N2Zz4K"); background-repeat: no-repeat, no-repeat; background-position: left 11px center, right 9px center; background-size: 14px, 17px 20px; appearance: none; cursor: pointer; } .select--language::-ms-expand { opacity: 0; } .basic-multi-select .select__control { border: 1px solid var(--card-border-color); border-radius: 3px; background-color: var(--ctrl-bgcolor); } .basic-multi-select .select__control:hover { border: 1px solid rgba(0, 40, 100, 0.12); } .basic-multi-select .select__control--is-focused, .basic-multi-select .select__control--is-focused:hover { border-color: #1991eb; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .basic-multi-select .select__placeholder { color: #adb5bd; } .basic-multi-select .select__menu { z-index: 3; background-color: var(--ctrl-bgcolor); } [data-theme='dark'] .basic-multi-select .select__option:hover, [data-theme='dark'] .basic-multi-select .select__option--is-focused, [data-theme='dark'] .basic-multi-select .select__option--is-focused:hover { background-color: var(--ctrl-select-bgcolor); color: var(--ctrl-dropdown-color); } [data-theme='dark'] .select__multi-value__remove svg { filter: invert(1); } ```
/content/code_sandbox/client/src/components/ui/Select.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
691
```css .page-header { flex-direction: column; align-items: flex-start; } .page-header--logs { flex-direction: row; align-items: flex-end; margin: 0.5rem 0 2.8rem; } .page-header--logs .page-title { display: inline-flex; align-items: center; } @media (max-width: 991px) { .page-header--logs { flex-direction: column; align-items: center; margin-bottom: 0 0 1.1rem; } .page-header--logs .page-title { margin-bottom: 1.1rem; font-size: 1.8rem; } } .page-subtitle { margin-left: 0; font-size: 0.9rem; } .page-title--large { font-size: 36px; line-height: 46px; } ```
/content/code_sandbox/client/src/components/ui/PageTitle.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
196
```css .line__tooltip { padding: 2px 10px 7px; line-height: 1.1; color: var(--white); background-color: var(--gray-3); border-radius: 4px; opacity: 90%; } .line__tooltip-text { font-size: 0.7rem; } .card-chart-bg { color: var(--black); } .card-chart-bg path[d^='M0,32'] { transform: translateY(32px); } ```
/content/code_sandbox/client/src/components/ui/Line.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
109
```css .icons { display: inline-block; vertical-align: middle; } .icon--24 { --size: 1.5rem; width: var(--size); height: var(--size); } .icon--20 { --size: 1.25rem; width: var(--size); height: var(--size); } .icon--18 { --size: 1.125rem; width: var(--size); height: var(--size); } .icon--15 { --size: 0.95rem; width: var(--size); height: var(--size); } .icon--gray { color: var(--gray-a5); } .icon--green { color: var(--green-74); } .icon--disabled { color: var(--gray-d8); } .icon--lightgray { color: var(--gray-8); } ```
/content/code_sandbox/client/src/components/ui/Icons.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
189
```css .text-edit-container { position: relative; min-height: 240px; overflow: hidden; } .text-input, .text-output { position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 16px; background: transparent; white-space: pre-wrap; line-height: 24px; word-wrap: break-word; font-size: var(--font-size-disable-autozoom); margin: 0; overscroll-behavior: none; } .text-input { position: relative; opacity: 1; min-height: 240px; } .text-output { pointer-events: none; z-index: 3; overflow-y: auto; background: transparent; border: 1px solid transparent; } .text-transparent { color: transparent; } ```
/content/code_sandbox/client/src/components/ui/texareaCommentsHighlight.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
190
```css .card-header { align-items: center; justify-content: space-between; padding: 0.6rem 1.5rem; flex-shrink: 0; } .card-subtitle { margin: 4px 0; line-height: 1.4; } .card-table-overflow { overflow-y: auto; max-height: 100%; } .card-table-overflow--limited { overflow-y: auto; max-height: 17.5rem; } .dashboard .card-table { overflow: hidden; } .dashboard .card-table-overflow--limited { max-height: 292px; } .dashboard .ReactTable .rt-tr-group { min-height: 52px; } .card-actions { margin-top: 20px; } .card-actions-top { margin-bottom: 20px; } .card-graph { display: flex; align-items: center; justify-content: center; } .card-body--status { padding: 2.5rem 1.5rem; text-align: center; } .card-body--loading { position: relative; } .card-body--loading:before { content: ''; position: absolute; top: 0; left: 0; z-index: 100; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.6); } .card-body--loading:after { content: ''; position: absolute; z-index: 101; left: 50%; top: 50%; width: 40px; height: 40px; margin-top: -20px; margin-left: -20px; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2047.6%2047.6%22%20height%3D%22100%25%22%20width%3D%22100%25%22%3E%3Cpath%20opacity%3D%22.235%22%20fill%3D%22%23979797%22%20d%3D%22M44.4%2011.9l-5.2%203c1.5%202.6%202.4%205.6%202.4%208.9%200%209.8-8%2017.8-17.8%2017.8-6.6%200-12.3-3.6-15.4-8.9l-5.2%203C7.3%2042.8%2015%2047.6%2023.8%2047.6c13.1%200%2023.8-10.7%2023.8-23.8%200-4.3-1.2-8.4-3.2-11.9z%22%2F%3E%3Cpath%20fill%3D%22%2366b574%22%20d%3D%22M3.2%2035.7C0%2030.2-.8%2023.8.8%2017.6%202.5%2011.5%206.4%206.4%2011.9%203.2%2017.4%200%2023.8-.8%2030%20.8c6.1%201.6%2011.3%205.6%2014.4%2011.1l-5.2%203c-2.4-4.1-6.2-7.1-10.8-8.3C23.8%205.4%2019%206%2014.9%208.4s-7.1%206.2-8.3%2010.8c-1.2%204.6-.6%209.4%201.8%2013.5l-5.2%203z%22%2F%3E%3C%2Fsvg%3E'); will-change: transform; animation: clockwise 2s linear infinite; } .card-title-stats { font-size: 13px; color: #9aa0ac; } .card-body-stats { position: relative; flex: 1 1 auto; margin: 0; padding: 1rem 1.5rem; } .card-value-stats { display: block; font-size: 2.1rem; line-height: 2.7rem; height: 2.7rem; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } .card-value-percent { position: absolute; top: 15px; right: 15px; font-size: 0.9rem; line-height: 1; height: auto; } .card-value-percent:after { content: '%'; } .card--full { height: calc(100% - 1.5rem); } .card-wrap { display: flex; flex-direction: column; height: 100%; } @media screen and (min-width: 1280px) { .card-title-stats { font-size: 14px; } } @media (min-width: 992px) { .dashboard .card:not(.card--full) { height: 360px; } } .card .logs__cell--red { background-color: #fff4f2; } .card .logs__cell--green { background-color: #f1faf3; } .card .logs__row--blue { background-color: #ecf7ff; } [data-theme='dark'] .card .logs__row--blue { background-color: var(--logs__row--blue-bgcolor); } ```
/content/code_sandbox/client/src/components/ui/Card.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,315
```css .ReactTable .rt-th, .ReactTable .rt-td { padding: 10px 15px; overflow: hidden; text-overflow: ellipsis; } .card-table .ReactTable .rt-td { overflow: visible; } .ReactTable .rt-noData { color: var(--rt-nodata-color); background-color: var(--rt-nodata-bgcolor); } .ReactTable .-loading { color: var(--rt-nodata-color); background-color: var(--rt-nodata-bgcolor); } .ReactTable .-loading .-loading-inner { color: var(--gray300); } .ReactTable .-pagination input, .ReactTable .-pagination select { color: var(--rt-nodata-color); background-color: var(--rt-nodata-bgcolor); } [data-theme='dark'] .ReactTable .rt-table::-webkit-scrollbar-track { background-color: var(--card-bgcolor); } [data-theme='dark'] .ReactTable .rt-table::-webkit-scrollbar-thumb { background-color: #888888; } [data-theme='dark'] .ReactTable .-pagination .-btn { filter: invert(1); } [data-theme='dark'] .ReactTable .-pagination .-btn:disabled { opacity: 1; } .rt-tr-group.logs__row--red { background-color: rgba(223, 56, 18, 0.05); } .rt-tr-group.logs__row--green { background-color: rgba(103, 178, 121, 0.1); } .rt-tr-group.logs__row--blue { background-color: #e5effd; } .rt-tr-group.logs__row--yellow { background-color: var(--yellow-pale); } ```
/content/code_sandbox/client/src/components/ui/ReactTable.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
366
```css .ReactModal__Overlay { -webkit-perspective: 600; perspective: 600; opacity: 0; overflow-x: hidden; overflow-y: auto; background-color: rgba(0, 0, 0, 0.5); z-index: 104; } .ReactModal__Overlay--after-open { opacity: 1; transition: opacity 150ms ease-out; background-color: var(--modal-overlay-bgcolor) !important; } .ReactModal__Content { -webkit-transform: scale(0.5) rotateX(-30deg); transform: scale(0.5) rotateX(-30deg); } .ReactModal__Content--after-open { -webkit-transform: scale(1) rotateX(0deg); transform: scale(1) rotateX(0deg); transition: all 150ms ease-in; } .ReactModal__Overlay--before-close { opacity: 0; } .ReactModal__Content--before-close { -webkit-transform: scale(0.5) rotateX(30deg); transform: scale(0.5) rotateX(30deg); transition: all 150ms ease-in; } .ReactModal__Content.modal-dialog { border: none; background-color: transparent; } @media (min-width: 576px) { .modal-dialog--clients, .modal-dialog--schedule { max-width: 650px; } } ```
/content/code_sandbox/client/src/components/ui/Modal.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
310
```css .overlay { display: none; position: fixed; top: 0; left: 0; z-index: 110; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 20px; font-size: 28px; font-weight: 600; text-align: center; background-color: var(--rt-nodata-bgcolor); } .overlay--visible { display: flex; } .overlay__loading { width: 40px; height: 40px; margin-bottom: 20px; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2047.6%2047.6%22%20height%3D%22100%25%22%20width%3D%22100%25%22%3E%3Cpath%20opacity%3D%22.235%22%20fill%3D%22%23979797%22%20d%3D%22M44.4%2011.9l-5.2%203c1.5%202.6%202.4%205.6%202.4%208.9%200%209.8-8%2017.8-17.8%2017.8-6.6%200-12.3-3.6-15.4-8.9l-5.2%203C7.3%2042.8%2015%2047.6%2023.8%2047.6c13.1%200%2023.8-10.7%2023.8-23.8%200-4.3-1.2-8.4-3.2-11.9z%22%2F%3E%3Cpath%20fill%3D%22%2366b574%22%20d%3D%22M3.2%2035.7C0%2030.2-.8%2023.8.8%2017.6%202.5%2011.5%206.4%206.4%2011.9%203.2%2017.4%200%2023.8-.8%2030%20.8c6.1%201.6%2011.3%205.6%2014.4%2011.1l-5.2%203c-2.4-4.1-6.2-7.1-10.8-8.3C23.8%205.4%2019%206%2014.9%208.4s-7.1%206.2-8.3%2010.8c-1.2%204.6-.6%209.4%201.8%2013.5l-5.2%203z%22%2F%3E%3C%2Fsvg%3E'); will-change: transform; animation: clockwise 2s linear infinite; } @keyframes clockwise { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } ```
/content/code_sandbox/client/src/components/ui/Overlay.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
760
```css .loading { position: relative; z-index: 101; opacity: 0; animation: opacity 0.2s linear 0.2s forwards; } .loading:before { content: ''; position: fixed; top: 0; left: 0; z-index: 100; width: 100%; min-height: 100vh; background-color: var(--loading-bg); } .loading:after { content: ''; position: fixed; z-index: 101; left: 50%; top: 50%; width: 40px; height: 40px; margin-top: -20px; margin-left: -20px; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2047.6%2047.6%22%20height%3D%22100%25%22%20width%3D%22100%25%22%3E%3Cpath%20opacity%3D%22.235%22%20fill%3D%22%23979797%22%20d%3D%22M44.4%2011.9l-5.2%203c1.5%202.6%202.4%205.6%202.4%208.9%200%209.8-8%2017.8-17.8%2017.8-6.6%200-12.3-3.6-15.4-8.9l-5.2%203C7.3%2042.8%2015%2047.6%2023.8%2047.6c13.1%200%2023.8-10.7%2023.8-23.8%200-4.3-1.2-8.4-3.2-11.9z%22%2F%3E%3Cpath%20fill%3D%22%2366b574%22%20d%3D%22M3.2%2035.7C0%2030.2-.8%2023.8.8%2017.6%202.5%2011.5%206.4%206.4%2011.9%203.2%2017.4%200%2023.8-.8%2030%20.8c6.1%201.6%2011.3%205.6%2014.4%2011.1l-5.2%203c-2.4-4.1-6.2-7.1-10.8-8.3C23.8%205.4%2019%206%2014.9%208.4s-7.1%206.2-8.3%2010.8c-1.2%204.6-.6%209.4%201.8%2013.5l-5.2%203z%22%2F%3E%3C%2Fsvg%3E'); will-change: transform; animation: clockwise 2s linear infinite; } @keyframes opacity { 0% { opacity: 0; } 100% { opacity: 0.8; } } @keyframes clockwise { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } ```
/content/code_sandbox/client/src/components/ui/Loading.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
811
```css .footer { padding: 1rem 0; } .footer__row { display: flex; align-items: center; flex-direction: column; } .footer__column { margin-bottom: 15px; } .footer__column--links { display: flex; flex-direction: column; align-items: center; } .footer__column--theme { min-width: 220px; margin-bottom: 0; } .footer__column--language { min-width: 220px; margin-bottom: 0; } .footer__link { display: inline-block; vertical-align: middle; margin-bottom: 8px; } .footer__link--report { position: relative; top: 1px; margin-right: 0; } @media screen and (min-width: 768px) { .footer__copyright { margin-right: 25px; } .footer__row { flex-direction: row; } .footer__column { margin-bottom: 0; } .footer__column--language { min-width: initial; margin-left: 20px; } .footer__column--theme { min-width: initial; margin-left: auto; } .footer__column--links { display: block; } .footer__link { margin: 0 20px 0 0; } } .btn-secondary.footer__theme-button, [data-theme='dark'] .btn-secondary.footer__theme-button { height: 38px; border-color: var(--ctrl-select-bgcolor); } .footer__theme-icon { display: inline-block; vertical-align: middle; width: 24px; height: 24px; color: var(--gray-ac); } [data-theme='dark'] .footer__theme-icon { color: var(--mcolor); } .footer__theme-icon--active, [data-theme='dark'] .footer__theme-icon--active { color: var(--btn-success-bgcolor); } .footer__themes { margin: 0 auto 24px; text-align: center; } @media screen and (min-width: 768px) { .footer__themes { margin: 0; text-align: left; } } ```
/content/code_sandbox/client/src/components/ui/Footer.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
491
```css .tabs__controls { display: flex; justify-content: space-between; margin-bottom: 15px; padding: 10px 0; border-bottom: 1px solid var(--card-border-color); overflow: auto; } @media screen and (min-width: 768px) { .tabs__controls { padding: 15px 0; overflow: initial; } } .tabs__controls--form { justify-content: flex-start; } .tabs__controls--form .tab__control { min-width: initial; margin-right: 25px; font-size: 14px; } .tabs__controls--form .tab__icon { display: none; } .tab__control { display: flex; flex-direction: column; align-items: center; min-width: 70px; font-size: 13px; white-space: nowrap; color: #555555; cursor: pointer; opacity: 0.6; } [data-theme='dark'] .tab__control { filter: invert(1); } @media screen and (min-width: 768px) { .tab__control { white-space: normal; } } .tab__control:hover, .tab__control:focus { opacity: 1; } .tab__control--active { color: #4a4a4a; opacity: 1; } .tab__title { margin-bottom: 10px; font-size: 16px; font-weight: 700; } .tab__icon { width: 24px; height: 24px; margin-bottom: 6px; fill: #4a4a4a; touch-action: initial; } .tab__text { line-height: 1.7; } .tab__text li, .tab__text p { margin-bottom: 5px; } .tab__text ul, .tab__text ol { padding-left: 25px; } .tab__paragraph { margin-bottom: 10px; } ```
/content/code_sandbox/client/src/components/ui/Tabs.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
439
```css .dropdown-item { cursor: pointer; } .dropdown-item.active, .dropdown-item:active { background-color: var(--btn-success-bgcolor); } .dropdown-menu { cursor: default; } .dropdown-menu.dropdown-menu--protection { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); } .dropdown-menu.dropdown-menu-arrow.dropdown-menu--protection::before, .dropdown-menu.dropdown-menu-arrow.dropdown-menu--protection::after { left: 50%; transform: translateX(-50%); } .dropdown-protection { align-self: stretch; width: 26px; display: flex; position: relative; border: 1px solid #868e96; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-left: none; cursor: pointer; } .dropdown-protection__toggle { width: 100%; display: block; position: relative; background-color: #868e96; transition: background-color 0.15s ease-in-out; } .dropdown-protection__toggle:hover { background-color: #727b84; } .dropdown-protection__toggle .nav-icon { width: 100%; height: 100%; display: block; position: absolute; top: 0; left: 0; color: var(--white); transition: 0.15s ease-in-out transform; transform-origin: center; } .dropdown-protection.show .nav-icon { transform: rotate(180deg); } ```
/content/code_sandbox/client/src/components/ui/Dropdown.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
337
```css .tooltip-container { border: 0; padding: 0.7rem; box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.2); } [data-theme='dark'] .tooltip-container { background-color: var(--ctrl-select-bgcolor); color: var(--mcolor); } .tooltip-custom--narrow { max-width: 14rem; } .tooltip-custom--wide { max-width: 18rem; } .tooltip-custom__trigger { cursor: pointer; } .tooltip-custom__content-title { margin-bottom: 0.1875rem; } .tooltip-custom__content-item { margin-bottom: 0.125rem; } .tooltip-custom__content-item:last-child { margin-bottom: 0; } .tooltip-custom__content-link { color: var(--green-86); } ```
/content/code_sandbox/client/src/components/ui/Tooltip.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
184
```css :root { --blue: #e5effd; --green-pale: rgba(103, 178, 121, 0.1); --red: rgba(223, 56, 18, 0.05); --white: #fff; --yellow: rgba(247, 181, 0, 0.1); --size-date: 70; --size-domain: 180; --size-response: 150; --size-client: 123; --gray-216: rgba(216, 216, 216, 0.23); --gray-4d: #4d4d4d; --gray-f3: #f3f3f3; --gray-8: #888; --gray-3: #333; --danger: #df3812; --white80: rgba(255, 255, 255, 0.8); --btn-block: #c23814; --btn-block-disabled: #e3b3a6; --btn-block-active: #a62200; --btn-unblock: #888888; --btn-unblock-disabled: #d8d8d8; --btn-unblock-active: #4d4d4d; --option-border-radius: 4px; } [data-theme='dark'] { --red: rgba(223, 56, 18, 0.25); --green-pale: rgba(103, 178, 121, 0.25); --yellow: rgba(247, 181, 0, 0.2); } .logs__text { padding: 0 1px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; font-size: 1rem; font-family: var(--font-family-sans-serif); color: var(--logs__text-color); letter-spacing: 0; line-height: 1.5rem; } [data-theme='dark'] .logs__text a { color: var(--gray-f3); } [data-theme='dark'] .logs__text a:hover { color: var(--gray-f3); } .logs__text--bold { font-weight: 600; } .logs__time { font-size: 1rem; line-height: 1.5; } .detailed-info { font-size: 0.8rem; line-height: 1.4; color: var(--detailed-info-color); } .logs__text--link { color: #467fcf; } .logs__text--link:hover, .logs__text--link:focus { color: #295a9f; } [data-theme='dark'] .logs__text--link, [data-theme='dark'] .logs__text--link:hover, [data-theme='dark'] .logs__text--link:focus { color: var(--gray-f3); } .logs__table .logs__text--client { padding-right: 32px; } .icon--selected { background-color: var(--gray-f3); border: solid 1px var(--gray-d8); border-radius: 4px; } [data-theme='dark'] .icon--selected { opacity: 0.75; } .text-pre { white-space: pre-wrap !important; overflow-wrap: break-word; overflow: visible; } .link--green { color: var(--green79); } .w-90 { max-width: 90% !important; } .pb-45 { padding-bottom: 1.25rem !important; } .mh-100 { max-height: 100% !important; } .icon24 { width: 24px; height: 24px; } .icon12 { width: 12px; height: 12px; } .cursor--pointer { cursor: pointer; } .custom-select__arrow--left { background: var(--white) url("data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIjYgOSAxMiAxNSAxOCA5Ij48L3BvbHlsaW5lPgo8L3N2Zz4K") no-repeat; background-position: 5px 9px; background-size: 22px; } .custom-select--logs { padding: 0.5rem 0.75rem 0.5rem 2rem !important; } .form-control--search { padding: 0 2.5rem; height: 2.25rem; flex-grow: 1; } .form-control--transparent { background-color: transparent !important; } [data-theme='dark'] .form-control--transparent option { background-color: var(--card-bgcolor); } .input-group-search { background-color: transparent; position: relative; width: 1.5rem; height: 1.5rem; top: 0.4rem; } .input-group-search__icon--magnifier { left: 2rem; } .input-group-search__icon--cross { left: -4.5rem; cursor: pointer; } .input-group-search__icon--tooltip { left: -4rem; } .form-control--container { flex: auto; } .field__search { display: flex; flex-grow: 1; } @media (max-width: 767.98px) { .form-control--container { width: 100%; flex-direction: column; } .form-control--search { width: 100%; } .field__select { margin-top: 1.5rem; padding-left: 24px; padding-right: 24px; } } @media screen and (max-width: 767.98px) { .logs__table .logs__cell--response, .logs__table .logs__cell--client { display: none !important; } } .logs__refresh { position: relative; top: 3px; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; padding: 0; margin-left: 0.9375rem; background-color: transparent; } .logs__cell { padding: 1rem 1rem 0.5rem 0; } .logs__cell--date { width: 4.375rem; flex: var(--size-date) 0 auto; } .logs__cell--domain { width: 11.25rem; flex: var(--size-domain) 0 auto; } .logs__cell--response { width: 9.375rem; flex: var(--size-response) 0 auto; } .logs__cell--client { width: 7.6875rem; flex: var(--size-client) 0 auto; padding-right: 0; position: relative; } @media screen and (min-width: 1025px) { .logs__cell--client { width: 13rem; } } .logs__cell--header__container > .logs__cell--header__item { border-right: 0; font-size: 1rem; } .logs__cell--header__container > .logs__cell--header__item:last-child { padding-right: 0; } .button-action__container { display: flex; position: absolute; right: 2px; bottom: 0.5rem; } @media screen and (max-width: 1024px) { .button-action__container { display: none; } } .button-action__container--detailed { bottom: 1.3rem; } .button-action { outline: 0 !important; background: var(--btn-block); border-radius: var(--option-border-radius); font-size: 0.8rem; color: var(--white); letter-spacing: 0; text-align: center; line-height: 28px; border: 0; } .button-action--small { width: fit-content; } .button-action--unblock { background: var(--btn-unblock); } .button-action--main { padding: 0 1rem; display: flex; align-items: center; } .button-action--with-options { border-top-right-radius: 0; border-bottom-right-radius: 0; } .button-action:hover { cursor: pointer; } .button-action--arrow-option { background: transparent; border: 0; display: block; width: 100%; padding-top: 0.2rem; padding-bottom: 0.2rem; text-align: center; font-weight: 700; color: inherit; cursor: pointer; } .button-action--arrow-option:hover, .button-action--arrow-option:focus { outline: none; } .button-action--arrow-option:focus-visible { outline: 2px solid #295a9f; } .button-action--arrow-option:disabled { display: none; } .tooltip-custom__container .button-action--arrow-option { padding-bottom: 0; text-align: left; font-weight: 400; } .tooltip-custom__container .button-action--arrow-option:not(:disabled):hover { background: var(--gray-f3); overflow: hidden; } [data-theme='dark'] .tooltip-custom__container .button-action--arrow-option:not(:disabled):hover { background: var(--ctrl-dropdown-bgcolor-focus); } .button-action--arrow-option-container { overflow: visible; transform-origin: left; padding: 1rem 0; } .logs__row { position: relative; display: flex; min-height: 26px; overflow: hidden; text-overflow: ellipsis; } .logs__row--icons { flex-wrap: wrap; } .logs__table .logs__row { border-bottom: 2px solid var(--gray-216); } .logs__tag { text-overflow: ellipsis; overflow: hidden; } /* QUERY_STATUS_COLORS */ .logs__row--blue { background-color: var(--logs__row--blue-bgcolor); } [data-theme='dark'] .logs__row--blue .logs__text--link { color: var(--white); } .logs__row--green { background-color: var(--green-pale); } .logs__row--red { background-color: var(--red) !important; } .logs__row--white { background-color: var(--logs__row--white-bgcolor); } .logs__row--yellow { background-color: var(--yellow); } .logs__no-data { color: var(--mcolor); background-color: var(--logs__table-bgcolor); pointer-events: none; font-weight: 600; text-align: center; padding-top: 21rem; display: block; } .logs__loading { padding: 1rem 0; } .logs__table { background-color: var(--logs__table-bgcolor); border: 0; border-radius: 8px; min-height: 43rem; max-width: 100%; align-items: stretch; width: 100%; border-collapse: collapse; contain: layout; overflow-x: hidden; overflow-y: auto; will-change: scroll-position; } .logs__table .logs__cell--response, .logs__table .logs__cell--client { display: flex; } .logs__cell--header__container { display: flex; } .logs__table > .logs__cell--header__container > .logs__cell--client { display: flex; justify-content: space-between; } .logs__table .loading:after { top: 10%; } .logs__table .loading:before { min-height: 100%; } .logs__whois { display: inline; font-size: 12px; white-space: nowrap; } .logs__whois::after { content: '|'; padding: 0 5px; opacity: 0.3; } .logs__whois:last-child::after { content: ''; } .logs__whois-icon.icons { position: relative; top: -2px; width: 12px; height: 12px; margin-right: 1px; opacity: 0.5; } .filteringRules__rule { margin-bottom: 0; } .filteringRules__filter { font-style: italic; font-weight: 400; margin-bottom: 1rem; } .bg--danger { color: var(--danger); } .bg--green { color: var(--green79); } [data-theme='dark'] .logs__question.icon--lightgray { color: var(--gray-f3); } @media (max-width: 1024px) { .logs__question { display: none; } } .logs__modal { max-width: 720px; } .logs__modal-wrap { padding: 1rem 1.5rem; background-color: var(--card-bgcolor); } .button-action__hidden-trigger { position: absolute; top: 0; right: 0; width: 1px; height: 33px; margin: -1px; padding: 0; overflow: hidden; border: 0; clip: rect(0 0 0 0); } [data-theme='dark'] .button-action__icon { color: var(--gray-f3); } ```
/content/code_sandbox/client/src/components/Logs/Logs.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,965
```css .tooltip-custom__container { min-width: 150px; padding: 1rem 1.5rem 1.25rem 1.5rem; font-size: 16px !important; box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2); border-radius: 4px !important; pointer-events: auto !important; background-color: var(--ctrl-bgcolor); color: var(--mcolor); z-index: 102; overflow-y: auto; max-height: 100%; } .white-space--nowrap { white-space: nowrap !important; } .overflow-break { white-space: normal !important; overflow-wrap: break-word; } @media (max-width: 991.98px) { .overflow-break-mobile { white-space: normal !important; overflow-wrap: break-word; } } .grid { display: grid; grid-template-columns: repeat(2, min-content); grid-row-gap: 0.5rem; grid-column-gap: 1rem; } .grid--limited { grid-template-columns: repeat(2, minmax(0, min-content)); } .grid--gap-bg { grid-column-gap: 1.5rem; } .grid--title { font-weight: 600; } .grid--title:not(:first-child) { padding-top: 1rem; } @media (max-width: 1024px) { .grid .title--border { margin-bottom: 4px; font-weight: 600; } .grid .key-colon { margin-right: 4px; color: var(--gray-8); } .grid__row { display: flex; align-items: flex-start; flex-wrap: wrap; margin-bottom: 2px; font-size: 14px; word-break: break-all; overflow: hidden; } .grid__row .filteringRules__filter, .grid__row .filteringRules { margin-bottom: 0; } } @media (max-width: 767.98px) { .grid { grid-template-columns: 35% 55%; } .grid * { grid-column: 1 / -1; } .grid > :nth-child(even) { margin: -0.5rem 0 0; } .grid > .key__time_table_header, .grid > .key__data, .grid > .key__encryption_status, .grid > .key__elapsed { grid-column: 1 / span 1; } .grid > .value__time_table_header, .grid > .value__data, .grid > .value__encryption_status, .grid > .value__elapsed { grid-column: 2 / span 1; margin: 0 !important; } } .grid .key-colon:nth-child(odd)::after { content: ':'; } .grid__one-row { grid-template-columns: 15rem; } .grid__flow-column { grid-auto-flow: column; } .grid-content > * { justify-content: space-between !important; width: 100% !important; overflow: hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; } .title--border { padding-top: 1rem; } .title--border:before { content: ''; position: absolute; left: 0; border-top: 0.5px solid var(--gray-d8) !important; width: 100%; margin-top: -0.5rem; } .icon-cross { position: absolute; right: 0.5rem; top: 0.5rem; } ```
/content/code_sandbox/client/src/components/Logs/Cells/IconTooltip.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
838
```css .dashboard-protection-button.btn-gray { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-color: #a4a4a4; } .stats__table .popover__body { left: -10px; min-width: 270px; transform: none; } .stats__table .popover__body:after { left: 23px; } .stats__table .rt-tr-group:first-child .popover__body, .stats__table .rt-tr-group:nth-child(2) .popover__body { top: calc(100% + 5px); bottom: initial; z-index: 1; } .stats__table .rt-tr-group:first-child .popover__body:after, .stats__table .rt-tr-group:nth-child(2) .popover__body:after { top: -11px; border-top: 6px solid transparent; border-bottom: 6px solid #585965; } .table__action { position: relative; margin-left: auto; } .table__action .btn-icon { outline: 0; box-shadow: none; } .page-title--dashboard { display: flex; align-items: center; } @media (max-width: 767.98px) { .page-title--dashboard { flex-direction: column; align-items: flex-start; } } .counters__row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--card-border-color); padding: 0.75rem 1.5rem; } .counters__column--value { flex-shrink: 0; margin-left: 1.5rem; text-align: right; white-space: nowrap; } @media screen and (min-width: 768px) { .counters__column { display: flex; align-items: center; overflow: hidden; } .counters__title { display: block; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .counters__tooltip { display: block; flex-shrink: 0; } } ```
/content/code_sandbox/client/src/components/Dashboard/Dashboard.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
486
```css .guide { max-width: 768px; margin: 0 auto; } .guide__title { margin-bottom: 10px; font-size: 17px; font-weight: 700; } .guide__desc { margin-bottom: 20px; font-size: 15px; } .guide__address { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; } @media screen and (min-width: 768px) { .guide__address { display: list-item; font-size: 15px; } } ```
/content/code_sandbox/client/src/components/SetupGuide/Guide.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
140
```css @charset "UTF-8"; /** Dashboard UI */ /*! * Bootstrap v4.0.0 (path_to_url */ /* stylelint-disable */ :root { --blue: #467fcf; --indigo: #6574cd; --purple: #a55eea; --pink: #f66d9b; --red: #cd201f; --orange: #fd9644; --yellow: #f1c40f; --green: #5eba00; --green-74: #66b574; --green-86: #66b586; --teal: #2bcbba; --cyan: #17a2b8; --white: #fff; --gray: #868e96; --gray-ac: #9aa0ac; --gray-dark: #343a40; --azure: #45aaf2; --lime: #7bd235; --primary: #467fcf; --secondary: #868e96; --success: #5eba00; --info: #45aaf2; --warning: #f1c40f; --danger: #cd201f; --light: #f8f9fa; --dark: #343a40; --breakpoint-xs: 0; --breakpoint-sm: 576px; --breakpoint-md: 768px; --breakpoint-lg: 992px; --breakpoint-xl: 1280px; --font-family-sans-serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; --font-family-monospace: Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; } *, *::before, *::after { box-sizing: border-box; } html { font-family: sans-serif; line-height: 1.15; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; -ms-overflow-style: scrollbar; -webkit-tap-highlight-color: transparent; } @-ms-viewport { width: device-width; } article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { display: block; } body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; font-size: 0.9375rem; font-weight: 400; line-height: 1.5; color: var(--mcolor); text-align: left; background-color: var(--bgcolor); } [tabindex='-1']:focus { outline: 0 !important; } hr { box-sizing: content-box; height: 0; overflow: visible; } h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 0.66em; } p { margin-top: 0; margin-bottom: 1rem; } abbr[title], abbr[data-original-title] { text-decoration: underline; -webkit-text-decoration: underline dotted; text-decoration: underline dotted; cursor: help; border-bottom: 0; } address { margin-bottom: 1rem; font-style: normal; line-height: inherit; } ol, ul, dl { margin-top: 0; margin-bottom: 1rem; } ol ol, ul ul, ol ul, ul ol { margin-bottom: 0; } dt { font-weight: 700; } dd { margin-bottom: 0.5rem; margin-left: 0; } blockquote { margin: 0 0 1rem; } dfn { font-style: italic; } b, strong { font-weight: bolder; } small { font-size: 80%; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sub { bottom: -0.25em; } sup { top: -0.5em; } a { color: #467fcf; text-decoration: none; background-color: transparent; -webkittext-decoration-skip-ink: objects; } a:hover { color: #295a9f; text-decoration: underline; } a:not([href]):not([tabindex]) { color: inherit; text-decoration: none; } a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus { color: inherit; text-decoration: none; } a:not([href]):not([tabindex]):focus { outline: 0; } pre, code, kbd, samp { font-family: monospace, monospace; font-size: 1em; } pre { margin-top: 0; margin-bottom: 1rem; overflow: auto; -ms-overflow-style: scrollbar; } figure { margin: 0 0 1rem; } img { vertical-align: middle; border-style: none; } svg:not(:root) { overflow: hidden; } table { border-collapse: collapse; } caption { padding-top: 0.75rem; padding-bottom: 0.75rem; color: #9aa0ac; text-align: left; caption-side: bottom; } th { text-align: inherit; } label { display: inline-block; margin-bottom: 0.5rem; } button { border-radius: 0; } button:focus { outline: 1px dotted; outline: 5px auto -webkit-focus-ring-color; } input, button, select, optgroup, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; } button, input { overflow: visible; } button, select { text-transform: none; } button, html [type='button'], [type='reset'], [type='submit'] { -webkit-appearance: button; } button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-moz-focus-inner, [type='submit']::-moz-focus-inner { padding: 0; border-style: none; } input[type='radio'], input[type='checkbox'] { box-sizing: border-box; padding: 0; } input[type='date'], input[type='time'], input[type='datetime-local'], input[type='month'] { -webkit-appearance: listbox; } textarea { overflow: auto; resize: vertical; } fieldset { min-width: 0; padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; max-width: 100%; padding: 0; margin-bottom: 0.5rem; font-size: 1.5rem; line-height: inherit; color: inherit; white-space: normal; } progress { vertical-align: baseline; } [type='number']::-webkit-inner-spin-button, [type='number']::-webkit-outer-spin-button { height: auto; } [type='search'] { outline-offset: -2px; -webkit-appearance: none; } [type='search']::-webkit-search-cancel-button, [type='search']::-webkit-search-decoration { -webkit-appearance: none; } ::-webkit-file-upload-button { font: inherit; -webkit-appearance: button; } output { display: inline-block; } summary { display: list-item; cursor: pointer; } template { display: none; } [hidden] { display: none !important; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { margin-bottom: 0.66em; font-family: inherit; font-weight: 600; line-height: 1.1; color: inherit; } h1, .h1 { font-size: 2rem; } h2, .h2 { font-size: 1.75rem; } h3, .h3 { font-size: 1.5rem; } h4, .h4 { font-size: 1.125rem; } h5, .h5 { font-size: 1rem; } h6, .h6 { font-size: 0.875rem; } .lead { font-size: 1.171875rem; font-weight: 300; } .display-1 { font-size: 4.5rem; font-weight: 300; line-height: 1.1; } .display-2 { font-size: 4rem; font-weight: 300; line-height: 1.1; } .display-3 { font-size: 3.5rem; font-weight: 300; line-height: 1.1; } .display-4 { font-size: 3rem; font-weight: 300; line-height: 1.1; } hr { margin-top: 1rem; margin-bottom: 1rem; border: 0; border-top: 1px solid rgba(0, 40, 100, 0.12); } [data-theme='dark'] hr { border-color: var(--card-border-color); } small, .small { font-size: 87.5%; font-weight: 400; } mark, .mark { padding: 0.2em; background-color: #fcf8e3; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; } .list-inline-item { display: inline-block; } .list-inline-item:not(:last-child) { margin-right: 0.5rem; } .initialism { font-size: 90%; text-transform: uppercase; } .blockquote { margin-bottom: 1rem; font-size: 1.171875rem; } .blockquote-footer { display: block; font-size: 80%; color: #868e96; } .blockquote-footer::before { content: '\2014 \00A0'; } .img-fluid { max-width: 100%; height: auto; } .img-thumbnail { padding: 0.25rem; background-color: #fff; border: 1px solid #dee2e6; border-radius: 3px; max-width: 100%; height: auto; } .figure { display: inline-block; } .figure-img { margin-bottom: 0.5rem; line-height: 1; } .figure-caption { font-size: 90%; color: #868e96; } code, kbd, pre, samp { font-family: Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; } code { font-size: 85%; color: inherit; word-break: break-word; } a > code { color: inherit; } kbd { padding: 0.2rem 0.4rem; font-size: 85%; color: #fff; background-color: #343a40; border-radius: 3px; } kbd kbd { padding: 0; font-size: 100%; font-weight: 700; } pre { display: block; font-size: 85%; color: #212529; } pre code { font-size: inherit; color: inherit; word-break: normal; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { width: 100%; padding-right: 0.75rem; padding-left: 0.75rem; margin-right: auto; margin-left: auto; } @media (min-width: 576px) { .container { max-width: 540px; } } @media (min-width: 768px) { .container { max-width: 720px; } } @media (min-width: 992px) { .container { max-width: 960px; } } @media (min-width: 1280px) { .container { max-width: 1200px; } } .container-fluid { width: 100%; padding-right: 0.75rem; padding-left: 0.75rem; margin-right: auto; margin-left: auto; } .row { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-right: -0.75rem; margin-left: -0.75rem; } .no-gutters { margin-right: 0; margin-left: 0; } .no-gutters > .col, .no-gutters > [class*='col-'] { padding-right: 0; padding-left: 0; } .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col, .col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm, .col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md, .col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg, .col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl, .col-xl-auto { position: relative; width: 100%; min-height: 1px; padding-right: 0.75rem; padding-left: 0.75rem; } .col { -ms-flex-preferred-size: 0; flex-basis: 0; -ms-flex-positive: 1; flex-grow: 1; max-width: 100%; } .col-auto { -ms-flex: 0 0 auto; flex: 0 0 auto; width: auto; max-width: none; } .col-1 { -ms-flex: 0 0 8.33333333%; flex: 0 0 8.33333333%; max-width: 8.33333333%; } .col-2 { -ms-flex: 0 0 16.66666667%; flex: 0 0 16.66666667%; max-width: 16.66666667%; } .col-3 { -ms-flex: 0 0 25%; flex: 0 0 25%; max-width: 25%; } .col-4 { -ms-flex: 0 0 33.33333333%; flex: 0 0 33.33333333%; max-width: 33.33333333%; } .col-5 { -ms-flex: 0 0 41.66666667%; flex: 0 0 41.66666667%; max-width: 41.66666667%; } .col-6 { -ms-flex: 0 0 50%; flex: 0 0 50%; max-width: 50%; } .col-7 { -ms-flex: 0 0 58.33333333%; flex: 0 0 58.33333333%; max-width: 58.33333333%; } .col-8 { -ms-flex: 0 0 66.66666667%; flex: 0 0 66.66666667%; max-width: 66.66666667%; } .col-9 { -ms-flex: 0 0 75%; flex: 0 0 75%; max-width: 75%; } .col-10 { -ms-flex: 0 0 83.33333333%; flex: 0 0 83.33333333%; max-width: 83.33333333%; } .col-11 { -ms-flex: 0 0 91.66666667%; flex: 0 0 91.66666667%; max-width: 91.66666667%; } .col-12 { -ms-flex: 0 0 100%; flex: 0 0 100%; max-width: 100%; } .order-first { -ms-flex-order: -1; order: -1; } .order-last { -ms-flex-order: 13; order: 13; } .order-0 { -ms-flex-order: 0; order: 0; } .order-1 { -ms-flex-order: 1; order: 1; } .order-2 { -ms-flex-order: 2; order: 2; } .order-3 { -ms-flex-order: 3; order: 3; } .order-4 { -ms-flex-order: 4; order: 4; } .order-5 { -ms-flex-order: 5; order: 5; } .order-6 { -ms-flex-order: 6; order: 6; } .order-7 { -ms-flex-order: 7; order: 7; } .order-8 { -ms-flex-order: 8; order: 8; } .order-9 { -ms-flex-order: 9; order: 9; } .order-10 { -ms-flex-order: 10; order: 10; } .order-11 { -ms-flex-order: 11; order: 11; } .order-12 { -ms-flex-order: 12; order: 12; } .offset-1 { margin-left: 8.33333333%; } .offset-2 { margin-left: 16.66666667%; } .offset-3 { margin-left: 25%; } .offset-4 { margin-left: 33.33333333%; } .offset-5 { margin-left: 41.66666667%; } .offset-6 { margin-left: 50%; } .offset-7 { margin-left: 58.33333333%; } .offset-8 { margin-left: 66.66666667%; } .offset-9 { margin-left: 75%; } .offset-10 { margin-left: 83.33333333%; } .offset-11 { margin-left: 91.66666667%; } @media (min-width: 576px) { .col-sm { -ms-flex-preferred-size: 0; flex-basis: 0; -ms-flex-positive: 1; flex-grow: 1; max-width: 100%; } .col-sm-auto { -ms-flex: 0 0 auto; flex: 0 0 auto; width: auto; max-width: none; } .col-sm-1 { -ms-flex: 0 0 8.33333333%; flex: 0 0 8.33333333%; max-width: 8.33333333%; } .col-sm-2 { -ms-flex: 0 0 16.66666667%; flex: 0 0 16.66666667%; max-width: 16.66666667%; } .col-sm-3 { -ms-flex: 0 0 25%; flex: 0 0 25%; max-width: 25%; } .col-sm-4 { -ms-flex: 0 0 33.33333333%; flex: 0 0 33.33333333%; max-width: 33.33333333%; } .col-sm-5 { -ms-flex: 0 0 41.66666667%; flex: 0 0 41.66666667%; max-width: 41.66666667%; } .col-sm-6 { -ms-flex: 0 0 50%; flex: 0 0 50%; max-width: 50%; } .col-sm-7 { -ms-flex: 0 0 58.33333333%; flex: 0 0 58.33333333%; max-width: 58.33333333%; } .col-sm-8 { -ms-flex: 0 0 66.66666667%; flex: 0 0 66.66666667%; max-width: 66.66666667%; } .col-sm-9 { -ms-flex: 0 0 75%; flex: 0 0 75%; max-width: 75%; } .col-sm-10 { -ms-flex: 0 0 83.33333333%; flex: 0 0 83.33333333%; max-width: 83.33333333%; } .col-sm-11 { -ms-flex: 0 0 91.66666667%; flex: 0 0 91.66666667%; max-width: 91.66666667%; } .col-sm-12 { -ms-flex: 0 0 100%; flex: 0 0 100%; max-width: 100%; } .order-sm-first { -ms-flex-order: -1; order: -1; } .order-sm-last { -ms-flex-order: 13; order: 13; } .order-sm-0 { -ms-flex-order: 0; order: 0; } .order-sm-1 { -ms-flex-order: 1; order: 1; } .order-sm-2 { -ms-flex-order: 2; order: 2; } .order-sm-3 { -ms-flex-order: 3; order: 3; } .order-sm-4 { -ms-flex-order: 4; order: 4; } .order-sm-5 { -ms-flex-order: 5; order: 5; } .order-sm-6 { -ms-flex-order: 6; order: 6; } .order-sm-7 { -ms-flex-order: 7; order: 7; } .order-sm-8 { -ms-flex-order: 8; order: 8; } .order-sm-9 { -ms-flex-order: 9; order: 9; } .order-sm-10 { -ms-flex-order: 10; order: 10; } .order-sm-11 { -ms-flex-order: 11; order: 11; } .order-sm-12 { -ms-flex-order: 12; order: 12; } .offset-sm-0 { margin-left: 0; } .offset-sm-1 { margin-left: 8.33333333%; } .offset-sm-2 { margin-left: 16.66666667%; } .offset-sm-3 { margin-left: 25%; } .offset-sm-4 { margin-left: 33.33333333%; } .offset-sm-5 { margin-left: 41.66666667%; } .offset-sm-6 { margin-left: 50%; } .offset-sm-7 { margin-left: 58.33333333%; } .offset-sm-8 { margin-left: 66.66666667%; } .offset-sm-9 { margin-left: 75%; } .offset-sm-10 { margin-left: 83.33333333%; } .offset-sm-11 { margin-left: 91.66666667%; } } @media (min-width: 768px) { .col-md { -ms-flex-preferred-size: 0; flex-basis: 0; -ms-flex-positive: 1; flex-grow: 1; max-width: 100%; } .col-md-auto { -ms-flex: 0 0 auto; flex: 0 0 auto; width: auto; max-width: none; } .col-md-1 { -ms-flex: 0 0 8.33333333%; flex: 0 0 8.33333333%; max-width: 8.33333333%; } .col-md-2 { -ms-flex: 0 0 16.66666667%; flex: 0 0 16.66666667%; max-width: 16.66666667%; } .col-md-3 { -ms-flex: 0 0 25%; flex: 0 0 25%; max-width: 25%; } .col-md-4 { -ms-flex: 0 0 33.33333333%; flex: 0 0 33.33333333%; max-width: 33.33333333%; } .col-md-5 { -ms-flex: 0 0 41.66666667%; flex: 0 0 41.66666667%; max-width: 41.66666667%; } .col-md-6 { -ms-flex: 0 0 50%; flex: 0 0 50%; max-width: 50%; } .col-md-7 { -ms-flex: 0 0 58.33333333%; flex: 0 0 58.33333333%; max-width: 58.33333333%; } .col-md-8 { -ms-flex: 0 0 66.66666667%; flex: 0 0 66.66666667%; max-width: 66.66666667%; } .col-md-9 { -ms-flex: 0 0 75%; flex: 0 0 75%; max-width: 75%; } .col-md-10 { -ms-flex: 0 0 83.33333333%; flex: 0 0 83.33333333%; max-width: 83.33333333%; } .col-md-11 { -ms-flex: 0 0 91.66666667%; flex: 0 0 91.66666667%; max-width: 91.66666667%; } .col-md-12 { -ms-flex: 0 0 100%; flex: 0 0 100%; max-width: 100%; } .order-md-first { -ms-flex-order: -1; order: -1; } .order-md-last { -ms-flex-order: 13; order: 13; } .order-md-0 { -ms-flex-order: 0; order: 0; } .order-md-1 { -ms-flex-order: 1; order: 1; } .order-md-2 { -ms-flex-order: 2; order: 2; } .order-md-3 { -ms-flex-order: 3; order: 3; } .order-md-4 { -ms-flex-order: 4; order: 4; } .order-md-5 { -ms-flex-order: 5; order: 5; } .order-md-6 { -ms-flex-order: 6; order: 6; } .order-md-7 { -ms-flex-order: 7; order: 7; } .order-md-8 { -ms-flex-order: 8; order: 8; } .order-md-9 { -ms-flex-order: 9; order: 9; } .order-md-10 { -ms-flex-order: 10; order: 10; } .order-md-11 { -ms-flex-order: 11; order: 11; } .order-md-12 { -ms-flex-order: 12; order: 12; } .offset-md-0 { margin-left: 0; } .offset-md-1 { margin-left: 8.33333333%; } .offset-md-2 { margin-left: 16.66666667%; } .offset-md-3 { margin-left: 25%; } .offset-md-4 { margin-left: 33.33333333%; } .offset-md-5 { margin-left: 41.66666667%; } .offset-md-6 { margin-left: 50%; } .offset-md-7 { margin-left: 58.33333333%; } .offset-md-8 { margin-left: 66.66666667%; } .offset-md-9 { margin-left: 75%; } .offset-md-10 { margin-left: 83.33333333%; } .offset-md-11 { margin-left: 91.66666667%; } } @media (min-width: 992px) { .col-lg { -ms-flex-preferred-size: 0; flex-basis: 0; -ms-flex-positive: 1; flex-grow: 1; max-width: 100%; } .col-lg-auto { -ms-flex: 0 0 auto; flex: 0 0 auto; width: auto; max-width: none; } .col-lg-1 { -ms-flex: 0 0 8.33333333%; flex: 0 0 8.33333333%; max-width: 8.33333333%; } .col-lg-2 { -ms-flex: 0 0 16.66666667%; flex: 0 0 16.66666667%; max-width: 16.66666667%; } .col-lg-3 { -ms-flex: 0 0 25%; flex: 0 0 25%; max-width: 25%; } .col-lg-4 { -ms-flex: 0 0 33.33333333%; flex: 0 0 33.33333333%; max-width: 33.33333333%; } .col-lg-5 { -ms-flex: 0 0 41.66666667%; flex: 0 0 41.66666667%; max-width: 41.66666667%; } .col-lg-6 { -ms-flex: 0 0 50%; flex: 0 0 50%; max-width: 50%; } .col-lg-7 { -ms-flex: 0 0 58.33333333%; flex: 0 0 58.33333333%; max-width: 58.33333333%; } .col-lg-8 { -ms-flex: 0 0 66.66666667%; flex: 0 0 66.66666667%; max-width: 66.66666667%; } .col-lg-9 { -ms-flex: 0 0 75%; flex: 0 0 75%; max-width: 75%; } .col-lg-10 { -ms-flex: 0 0 83.33333333%; flex: 0 0 83.33333333%; max-width: 83.33333333%; } .col-lg-11 { -ms-flex: 0 0 91.66666667%; flex: 0 0 91.66666667%; max-width: 91.66666667%; } .col-lg-12 { -ms-flex: 0 0 100%; flex: 0 0 100%; max-width: 100%; } .order-lg-first { -ms-flex-order: -1; order: -1; } .order-lg-last { -ms-flex-order: 13; order: 13; } .order-lg-0 { -ms-flex-order: 0; order: 0; } .order-lg-1 { -ms-flex-order: 1; order: 1; } .order-lg-2 { -ms-flex-order: 2; order: 2; } .order-lg-3 { -ms-flex-order: 3; order: 3; } .order-lg-4 { -ms-flex-order: 4; order: 4; } .order-lg-5 { -ms-flex-order: 5; order: 5; } .order-lg-6 { -ms-flex-order: 6; order: 6; } .order-lg-7 { -ms-flex-order: 7; order: 7; } .order-lg-8 { -ms-flex-order: 8; order: 8; } .order-lg-9 { -ms-flex-order: 9; order: 9; } .order-lg-10 { -ms-flex-order: 10; order: 10; } .order-lg-11 { -ms-flex-order: 11; order: 11; } .order-lg-12 { -ms-flex-order: 12; order: 12; } .offset-lg-0 { margin-left: 0; } .offset-lg-1 { margin-left: 8.33333333%; } .offset-lg-2 { margin-left: 16.66666667%; } .offset-lg-3 { margin-left: 25%; } .offset-lg-4 { margin-left: 33.33333333%; } .offset-lg-5 { margin-left: 41.66666667%; } .offset-lg-6 { margin-left: 50%; } .offset-lg-7 { margin-left: 58.33333333%; } .offset-lg-8 { margin-left: 66.66666667%; } .offset-lg-9 { margin-left: 75%; } .offset-lg-10 { margin-left: 83.33333333%; } .offset-lg-11 { margin-left: 91.66666667%; } } @media (min-width: 1280px) { .col-xl { -ms-flex-preferred-size: 0; flex-basis: 0; -ms-flex-positive: 1; flex-grow: 1; max-width: 100%; } .col-xl-auto { -ms-flex: 0 0 auto; flex: 0 0 auto; width: auto; max-width: none; } .col-xl-1 { -ms-flex: 0 0 8.33333333%; flex: 0 0 8.33333333%; max-width: 8.33333333%; } .col-xl-2 { -ms-flex: 0 0 16.66666667%; flex: 0 0 16.66666667%; max-width: 16.66666667%; } .col-xl-3 { -ms-flex: 0 0 25%; flex: 0 0 25%; max-width: 25%; } .col-xl-4 { -ms-flex: 0 0 33.33333333%; flex: 0 0 33.33333333%; max-width: 33.33333333%; } .col-xl-5 { -ms-flex: 0 0 41.66666667%; flex: 0 0 41.66666667%; max-width: 41.66666667%; } .col-xl-6 { -ms-flex: 0 0 50%; flex: 0 0 50%; max-width: 50%; } .col-xl-7 { -ms-flex: 0 0 58.33333333%; flex: 0 0 58.33333333%; max-width: 58.33333333%; } .col-xl-8 { -ms-flex: 0 0 66.66666667%; flex: 0 0 66.66666667%; max-width: 66.66666667%; } .col-xl-9 { -ms-flex: 0 0 75%; flex: 0 0 75%; max-width: 75%; } .col-xl-10 { -ms-flex: 0 0 83.33333333%; flex: 0 0 83.33333333%; max-width: 83.33333333%; } .col-xl-11 { -ms-flex: 0 0 91.66666667%; flex: 0 0 91.66666667%; max-width: 91.66666667%; } .col-xl-12 { -ms-flex: 0 0 100%; flex: 0 0 100%; max-width: 100%; } .order-xl-first { -ms-flex-order: -1; order: -1; } .order-xl-last { -ms-flex-order: 13; order: 13; } .order-xl-0 { -ms-flex-order: 0; order: 0; } .order-xl-1 { -ms-flex-order: 1; order: 1; } .order-xl-2 { -ms-flex-order: 2; order: 2; } .order-xl-3 { -ms-flex-order: 3; order: 3; } .order-xl-4 { -ms-flex-order: 4; order: 4; } .order-xl-5 { -ms-flex-order: 5; order: 5; } .order-xl-6 { -ms-flex-order: 6; order: 6; } .order-xl-7 { -ms-flex-order: 7; order: 7; } .order-xl-8 { -ms-flex-order: 8; order: 8; } .order-xl-9 { -ms-flex-order: 9; order: 9; } .order-xl-10 { -ms-flex-order: 10; order: 10; } .order-xl-11 { -ms-flex-order: 11; order: 11; } .order-xl-12 { -ms-flex-order: 12; order: 12; } .offset-xl-0 { margin-left: 0; } .offset-xl-1 { margin-left: 8.33333333%; } .offset-xl-2 { margin-left: 16.66666667%; } .offset-xl-3 { margin-left: 25%; } .offset-xl-4 { margin-left: 33.33333333%; } .offset-xl-5 { margin-left: 41.66666667%; } .offset-xl-6 { margin-left: 50%; } .offset-xl-7 { margin-left: 58.33333333%; } .offset-xl-8 { margin-left: 66.66666667%; } .offset-xl-9 { margin-left: 75%; } .offset-xl-10 { margin-left: 83.33333333%; } .offset-xl-11 { margin-left: 91.66666667%; } } .table, .text-wrap table { width: 100%; max-width: 100%; margin-bottom: 1rem; background-color: transparent; } .table th, .text-wrap table th, .table td, .text-wrap table td { padding: 0.75rem; vertical-align: top; border-top: 1px solid #dee2e6; } .table thead th, .text-wrap table thead th { vertical-align: bottom; border-bottom: 2px solid #dee2e6; } .table tbody + tbody, .text-wrap table tbody + tbody { border-top: 2px solid #dee2e6; } .table .table, .text-wrap table .table, .table .text-wrap table, .text-wrap .table table, .text-wrap table table { background-color: #f5f7fb; } .table-sm th, .table-sm td { padding: 0.3rem; } .table-bordered, .text-wrap table { border: 1px solid #dee2e6; } .table-bordered th, .text-wrap table th, .table-bordered td, .text-wrap table td { border: 1px solid #dee2e6; } .table-bordered thead th, .text-wrap table thead th, .table-bordered thead td, .text-wrap table thead td { border-bottom-width: 2px; } .table-striped tbody tr:nth-of-type(odd) { background-color: rgba(0, 0, 0, 0.02); } .table-hover tbody tr:hover { background-color: rgba(0, 0, 0, 0.04); } .table-primary, .table-primary > th, .table-primary > td { background-color: #cbdbf2; } .table-hover .table-primary:hover { background-color: #b7cded; } .table-hover .table-primary:hover > td, .table-hover .table-primary:hover > th { background-color: #b7cded; } .table-secondary, .table-secondary > th, .table-secondary > td { background-color: #dddfe2; } .table-hover .table-secondary:hover { background-color: #cfd2d6; } .table-hover .table-secondary:hover > td, .table-hover .table-secondary:hover > th { background-color: #cfd2d6; } .table-success, .table-success > th, .table-success > td { background-color: #d2ecb8; } .table-hover .table-success:hover { background-color: #c5e7a4; } .table-hover .table-success:hover > td, .table-hover .table-success:hover > th { background-color: #c5e7a4; } .table-info, .table-info > th, .table-info > td { background-color: #cbe7fb; } .table-hover .table-info:hover { background-color: #b3dcf9; } .table-hover .table-info:hover > td, .table-hover .table-info:hover > th { background-color: #b3dcf9; } .table-warning, .table-warning > th, .table-warning > td { background-color: #fbeebc; } .table-hover .table-warning:hover { background-color: #fae8a4; } .table-hover .table-warning:hover > td, .table-hover .table-warning:hover > th { background-color: #fae8a4; } .table-danger, .table-danger > th, .table-danger > td { background-color: #f1c1c0; } .table-hover .table-danger:hover { background-color: #ecacab; } .table-hover .table-danger:hover > td, .table-hover .table-danger:hover > th { background-color: #ecacab; } .table-light, .table-light > th, .table-light > td { background-color: #fdfdfe; } .table-hover .table-light:hover { background-color: #ececf6; } .table-hover .table-light:hover > td, .table-hover .table-light:hover > th { background-color: #ececf6; } .table-dark, .table-dark > th, .table-dark > td { background-color: #c6c8ca; } .table-hover .table-dark:hover { background-color: #b9bbbe; } .table-hover .table-dark:hover > td, .table-hover .table-dark:hover > th { background-color: #b9bbbe; } .table-active, .table-active > th, .table-active > td { background-color: rgba(0, 0, 0, 0.04); } .table-hover .table-active:hover { background-color: rgba(0, 0, 0, 0.04); } .table-hover .table-active:hover > td, .table-hover .table-active:hover > th { background-color: rgba(0, 0, 0, 0.04); } .table .thead-dark th, .text-wrap table .thead-dark th { color: #f5f7fb; background-color: #212529; border-color: #32383e; } .table .thead-light th, .text-wrap table .thead-light th { color: #495057; background-color: #e9ecef; border-color: #dee2e6; } .table-dark { color: #f5f7fb; background-color: #212529; } .table-dark th, .table-dark td, .table-dark thead th { border-color: #32383e; } .table-dark.table-bordered, .text-wrap table.table-dark { border: 0; } .table-dark.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, 0.05); } .table-dark.table-hover tbody tr:hover { background-color: rgba(255, 255, 255, 0.075); } @media (max-width: 575.98px) { .table-responsive-sm { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-sm > .table-bordered, .text-wrap .table-responsive-sm > table { border: 0; } } @media (max-width: 767.98px) { .table-responsive-md { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-md > .table-bordered, .text-wrap .table-responsive-md > table { border: 0; } } @media (max-width: 991.98px) { .table-responsive-lg { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-lg > .table-bordered, .text-wrap .table-responsive-lg > table { border: 0; } } @media (max-width: 1279.98px) { .table-responsive-xl { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-xl > .table-bordered, .text-wrap .table-responsive-xl > table { border: 0; } } .table-responsive { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive > .table-bordered, .text-wrap .table-responsive > table { border: 0; } .form-control { display: block; width: 100%; padding: 0.375rem 0.75rem; font-size: 0.9375rem; line-height: 1.6; color: var(--mcolor); background-color: var(--card-bgcolor); background-clip: padding-box; border: 1px solid var(--card-border-color); border-radius: 3px; transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } .form-control::-ms-expand { background-color: transparent; border: 0; } .form-control:focus { color: var(--mcolor); background-color: var(--ctrl-bgcolor); border-color: #1991eb; outline: 0; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .form-control::-webkit-input-placeholder { color: #adb5bd; opacity: 1; } .form-control::-moz-placeholder { color: #adb5bd; opacity: 1; } .form-control:-ms-input-placeholder { color: #adb5bd; opacity: 1; } .form-control::-ms-input-placeholder { color: #adb5bd; opacity: 1; } .form-control::placeholder { color: #adb5bd; opacity: 1; } .form-control:disabled, .form-control[readonly] { background-color: var(--form-disabled-bgcolor); color: var(--form-disabled-color); opacity: 1; } select.form-control:not([size]):not([multiple]) { height: 2.375rem; } select.form-control:focus::-ms-value { color: #495057; background-color: #fff; } .form-control-file, .form-control-range { display: block; width: 100%; } .col-form-label { padding-top: calc(0.375rem + 1px); padding-bottom: calc(0.375rem + 1px); margin-bottom: 0; font-size: inherit; line-height: 1.6; } .col-form-label-lg { padding-top: calc(0.5rem + 1px); padding-bottom: calc(0.5rem + 1px); font-size: 1.125rem; line-height: 1.44444444; } .col-form-label-sm { padding-top: calc(0.25rem + 1px); padding-bottom: calc(0.25rem + 1px); font-size: 0.875rem; line-height: 1.14285714; } .form-control-plaintext { display: block; width: 100%; padding-top: 0.375rem; padding-bottom: 0.375rem; margin-bottom: 0; line-height: 1.6; background-color: transparent; border: solid transparent; border-width: 1px 0; } .form-control-plaintext.form-control-sm, .input-group-sm > .form-control-plaintext.form-control, .input-group-sm > .input-group-prepend > .form-control-plaintext.input-group-text, .input-group-sm > .input-group-append > .form-control-plaintext.input-group-text, .input-group-sm > .input-group-prepend > .form-control-plaintext.btn, .input-group-sm > .input-group-append > .form-control-plaintext.btn, .form-control-plaintext.form-control-lg, .input-group-lg > .form-control-plaintext.form-control, .input-group-lg > .input-group-prepend > .form-control-plaintext.input-group-text, .input-group-lg > .input-group-append > .form-control-plaintext.input-group-text, .input-group-lg > .input-group-prepend > .form-control-plaintext.btn, .input-group-lg > .input-group-append > .form-control-plaintext.btn { padding-right: 0; padding-left: 0; } .form-control-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-prepend > .input-group-text, .input-group-sm > .input-group-append > .input-group-text, .input-group-sm > .input-group-prepend > .btn, .input-group-sm > .input-group-append > .btn { padding: 0.25rem 0.5rem; font-size: 0.875rem; line-height: 1.14285714; border-radius: 3px; } select.form-control-sm:not([size]):not([multiple]), .input-group-sm > select.form-control:not([size]):not([multiple]), .input-group-sm > .input-group-prepend > select.input-group-text:not([size]):not([multiple]), .input-group-sm > .input-group-append > select.input-group-text:not([size]):not([multiple]), .input-group-sm > .input-group-prepend > select.btn:not([size]):not([multiple]), .input-group-sm > .input-group-append > select.btn:not([size]):not([multiple]) { height: calc(1.8125rem + 2px); } .form-control-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-prepend > .input-group-text, .input-group-lg > .input-group-append > .input-group-text, .input-group-lg > .input-group-prepend > .btn, .input-group-lg > .input-group-append > .btn { padding: 0.5rem 1rem; font-size: 1.125rem; line-height: 1.44444444; border-radius: 3px; } select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.form-control:not([size]):not([multiple]), .input-group-lg > .input-group-prepend > select.input-group-text:not([size]):not([multiple]), .input-group-lg > .input-group-append > select.input-group-text:not([size]):not([multiple]), .input-group-lg > .input-group-prepend > select.btn:not([size]):not([multiple]), .input-group-lg > .input-group-append > select.btn:not([size]):not([multiple]) { height: calc(2.6875rem + 2px); } .form-group { margin-bottom: 1rem; } .form-text { display: block; margin-top: 0.25rem; } .form-row { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-right: -5px; margin-left: -5px; } .form-row > .col, .form-row > [class*='col-'] { padding-right: 5px; padding-left: 5px; } .form-check { position: relative; display: block; padding-left: 1.25rem; } .form-check-input { position: absolute; margin-top: 0.3rem; margin-left: -1.25rem; } .form-check-input:disabled ~ .form-check-label { color: #9aa0ac; } .form-check-label { margin-bottom: 0; } .form-check-inline { display: -ms-inline-flexbox; display: inline-flex; -ms-flex-align: center; align-items: center; padding-left: 0; margin-right: 0.75rem; } .form-check-inline .form-check-input { position: static; margin-top: 0; margin-right: 0.3125rem; margin-left: 0; } .valid-feedback { display: none; width: 100%; margin-top: 0.25rem; font-size: 87.5%; color: #5eba00; } .valid-tooltip { position: absolute; top: 100%; z-index: 5; display: none; max-width: 100%; padding: 0.5rem; margin-top: 0.1rem; font-size: 0.875rem; line-height: 1; color: #fff; background-color: rgba(94, 186, 0, 0.8); border-radius: 0.2rem; } .was-validated .form-control:valid, .form-control.is-valid, .was-validated .custom-select:valid, .custom-select.is-valid { border-color: #5eba00; } .was-validated .form-control:valid:focus, .form-control.is-valid:focus, .was-validated .custom-select:valid:focus, .custom-select.is-valid:focus { border-color: #5eba00; box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.25); } .was-validated .form-control:valid ~ .valid-feedback, .was-validated .form-control:valid ~ .valid-tooltip, .form-control.is-valid ~ .valid-feedback, .form-control.is-valid ~ .valid-tooltip, .was-validated .custom-select:valid ~ .valid-feedback, .was-validated .custom-select:valid ~ .valid-tooltip, .custom-select.is-valid ~ .valid-feedback, .custom-select.is-valid ~ .valid-tooltip { display: block; } .was-validated .form-check-input:valid ~ .form-check-label, .form-check-input.is-valid ~ .form-check-label { color: #5eba00; } .was-validated .form-check-input:valid ~ .valid-feedback, .was-validated .form-check-input:valid ~ .valid-tooltip, .form-check-input.is-valid ~ .valid-feedback, .form-check-input.is-valid ~ .valid-tooltip { display: block; } .was-validated .custom-control-input:valid ~ .custom-control-label, .custom-control-input.is-valid ~ .custom-control-label { color: #5eba00; } .was-validated .custom-control-input:valid ~ .custom-control-label::before, .custom-control-input.is-valid ~ .custom-control-label::before { background-color: #9eff3b; } .was-validated .custom-control-input:valid ~ .valid-feedback, .was-validated .custom-control-input:valid ~ .valid-tooltip, .custom-control-input.is-valid ~ .valid-feedback, .custom-control-input.is-valid ~ .valid-tooltip { display: block; } .was-validated .custom-control-input:valid:checked ~ .custom-control-label::before, .custom-control-input.is-valid:checked ~ .custom-control-label::before { background-color: #78ed00; } .was-validated .custom-control-input:valid:focus ~ .custom-control-label::before, .custom-control-input.is-valid:focus ~ .custom-control-label::before { box-shadow: 0 0 0 1px #f5f7fb, 0 0 0 2px rgba(94, 186, 0, 0.25); } .was-validated .custom-file-input:valid ~ .custom-file-label, .custom-file-input.is-valid ~ .custom-file-label { border-color: #5eba00; } .was-validated .custom-file-input:valid ~ .custom-file-label::before, .custom-file-input.is-valid ~ .custom-file-label::before { border-color: inherit; } .was-validated .custom-file-input:valid ~ .valid-feedback, .was-validated .custom-file-input:valid ~ .valid-tooltip, .custom-file-input.is-valid ~ .valid-feedback, .custom-file-input.is-valid ~ .valid-tooltip { display: block; } .was-validated .custom-file-input:valid:focus ~ .custom-file-label, .custom-file-input.is-valid:focus ~ .custom-file-label { box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.25); } .invalid-feedback { display: none; width: 100%; margin-top: 0.25rem; font-size: 87.5%; color: #cd201f; } .invalid-tooltip { position: absolute; top: 100%; z-index: 5; display: none; max-width: 100%; padding: 0.5rem; margin-top: 0.1rem; font-size: 0.875rem; line-height: 1; color: #fff; background-color: rgba(205, 32, 31, 0.8); border-radius: 0.2rem; } .was-validated .form-control:invalid, .form-control.is-invalid, .was-validated .custom-select:invalid, .custom-select.is-invalid { border-color: #cd201f; } .was-validated .form-control:invalid:focus, .form-control.is-invalid:focus, .was-validated .custom-select:invalid:focus, .custom-select.is-invalid:focus { border-color: #cd201f; box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.25); } .was-validated .form-control:invalid ~ .invalid-feedback, .was-validated .form-control:invalid ~ .invalid-tooltip, .form-control.is-invalid ~ .invalid-feedback, .form-control.is-invalid ~ .invalid-tooltip, .was-validated .custom-select:invalid ~ .invalid-feedback, .was-validated .custom-select:invalid ~ .invalid-tooltip, .custom-select.is-invalid ~ .invalid-feedback, .custom-select.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .form-check-input:invalid ~ .form-check-label, .form-check-input.is-invalid ~ .form-check-label { color: #cd201f; } .was-validated .form-check-input:invalid ~ .invalid-feedback, .was-validated .form-check-input:invalid ~ .invalid-tooltip, .form-check-input.is-invalid ~ .invalid-feedback, .form-check-input.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .custom-control-input:invalid ~ .custom-control-label, .custom-control-input.is-invalid ~ .custom-control-label { color: #cd201f; } .was-validated .custom-control-input:invalid ~ .custom-control-label::before, .custom-control-input.is-invalid ~ .custom-control-label::before { background-color: #ec8080; } .was-validated .custom-control-input:invalid ~ .invalid-feedback, .was-validated .custom-control-input:invalid ~ .invalid-tooltip, .custom-control-input.is-invalid ~ .invalid-feedback, .custom-control-input.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before, .custom-control-input.is-invalid:checked ~ .custom-control-label::before { background-color: #e23e3d; } .was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before, .custom-control-input.is-invalid:focus ~ .custom-control-label::before { box-shadow: 0 0 0 1px #f5f7fb, 0 0 0 2px rgba(205, 32, 31, 0.25); } .was-validated .custom-file-input:invalid ~ .custom-file-label, .custom-file-input.is-invalid ~ .custom-file-label { border-color: #cd201f; } .was-validated .custom-file-input:invalid ~ .custom-file-label::before, .custom-file-input.is-invalid ~ .custom-file-label::before { border-color: inherit; } .was-validated .custom-file-input:invalid ~ .invalid-feedback, .was-validated .custom-file-input:invalid ~ .invalid-tooltip, .custom-file-input.is-invalid ~ .invalid-feedback, .custom-file-input.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .custom-file-input:invalid:focus ~ .custom-file-label, .custom-file-input.is-invalid:focus ~ .custom-file-label { box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.25); } .form-inline { display: -ms-flexbox; display: flex; -ms-flex-flow: row wrap; flex-flow: row wrap; -ms-flex-align: center; align-items: center; } .form-inline .form-check { width: 100%; } @media (min-width: 576px) { .form-inline label { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; margin-bottom: 0; } .form-inline .form-group { display: -ms-flexbox; display: flex; -ms-flex: 0 0 auto; flex: 0 0 auto; -ms-flex-flow: row wrap; flex-flow: row wrap; -ms-flex-align: center; align-items: center; margin-bottom: 0; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .form-control-plaintext { display: inline-block; } .form-inline .input-group { width: auto; } .form-inline .form-check { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; width: auto; padding-left: 0; } .form-inline .form-check-input { position: relative; margin-top: 0; margin-right: 0.25rem; margin-left: 0; } .form-inline .custom-control { -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; } .form-inline .custom-control-label { margin-bottom: 0; } } .btn { display: inline-block; font-weight: 400; text-align: center; white-space: nowrap; vertical-align: middle; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; border: 1px solid transparent; padding: 0.375rem 0.75rem; font-size: 0.9375rem; line-height: 1.84615385; border-radius: 3px; transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } .btn:hover, .btn:focus { text-decoration: none; } .btn:focus, .btn.focus { outline: 0; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .btn.disabled, .btn:disabled { opacity: 0.65; } .btn:not(:disabled):not(.disabled) { cursor: pointer; } .btn:not(:disabled):not(.disabled):active, .btn:not(:disabled):not(.disabled).active { background-image: none; } a.btn.disabled, fieldset:disabled a.btn { pointer-events: none; } .btn-primary { color: #fff; background-color: #467fcf; border-color: #467fcf; } .btn-primary:hover { color: #fff; background-color: #316cbe; border-color: #2f66b3; } .btn-primary:focus, .btn-primary.focus { box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.5); } .btn-primary.disabled, .btn-primary:disabled { color: #fff; background-color: #467fcf; border-color: #467fcf; } .btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle { color: #fff; background-color: #2f66b3; border-color: #2c60a9; } .btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.5); } .btn-secondary { color: #fff; background-color: #868e96; border-color: #868e96; } .btn-secondary:hover { color: #fff; background-color: #727b84; border-color: #6c757d; } .btn-secondary:focus, .btn-secondary.focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } .btn-secondary.disabled, .btn-secondary:disabled { color: #fff; background-color: #868e96; border-color: #868e96; } .btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle { color: #fff; background-color: #6c757d; border-color: #666e76; } .btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } [data-theme='dark'] .btn-secondary { color: #868e96; background-color: transparent; background-image: none; border-color: #868e96; } [data-theme='dark'] .btn-secondary:hover { color: #fff; background-color: #868e96; border-color: #868e96; } [data-theme='dark'] .btn-secondary:focus, [data-theme='dark'] .btn-secondary.focus { box-shadow: none; } [data-theme='dark'] .btn-secondary:focus-visible, [data-theme='dark'] .btn-secondary.focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } [data-theme='dark'] .btn-secondary.disabled, [data-theme='dark'] .btn-secondary:disabled { color: #868e96; background-color: transparent; border: none; } [data-theme='dark'] .btn-secondary:not(:disabled):not(.disabled):active, [data-theme='dark'] .btn-secondary:not(:disabled):not(.disabled).active { color: #fff; background-color: #868e96; border-color: #868e96; } [data-theme='dark'] .btn-secondary:not(:disabled):not(.disabled):active:focus, [data-theme='dark'] .btn-secondary:not(:disabled):not(.disabled).active:focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } .btn-success { color: #fff; background-color: var(--btn-success-bgcolor); border-color: var(--btn-success-bgcolor); } .btn-success:hover { color: #fff; background-color: #4b9400; border-color: #4b9400; } .btn-success:focus, .btn-success.focus { box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.5); } .btn-success.disabled, .btn-success:disabled { color: #fff; background-color: #5eba00; border-color: #5eba00; } .btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active, .show > .btn-success.dropdown-toggle { color: #fff; background-color: #448700; border-color: #448700; } .btn-success:not(:disabled):not(.disabled):active:focus, .btn-success:not(:disabled):not(.disabled).active:focus, .show > .btn-success.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.5); } .btn-info { color: #fff; background-color: #45aaf2; border-color: #45aaf2; } .btn-info:hover { color: #fff; background-color: #219af0; border-color: #1594ef; } .btn-info:focus, .btn-info.focus { box-shadow: 0 0 0 2px rgba(69, 170, 242, 0.5); } .btn-info.disabled, .btn-info:disabled { color: #fff; background-color: #45aaf2; border-color: #45aaf2; } .btn-info:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled).active, .show > .btn-info.dropdown-toggle { color: #fff; background-color: #1594ef; border-color: #108ee7; } .btn-info:not(:disabled):not(.disabled):active:focus, .btn-info:not(:disabled):not(.disabled).active:focus, .show > .btn-info.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(69, 170, 242, 0.5); } .btn-warning { color: #fff; background-color: #f1c40f; border-color: #f1c40f; } .btn-warning:hover { color: #fff; background-color: #cea70c; border-color: #c29d0b; } .btn-warning:focus, .btn-warning.focus { box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5); } .btn-warning.disabled, .btn-warning:disabled { color: #fff; background-color: #f1c40f; border-color: #f1c40f; } .btn-warning:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled).active, .show > .btn-warning.dropdown-toggle { color: #fff; background-color: #c29d0b; border-color: #b6940b; } .btn-warning:not(:disabled):not(.disabled):active:focus, .btn-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-warning.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5); } .btn-danger { color: #fff; background-color: #cd201f; border-color: #cd201f; } .btn-danger:hover { color: #fff; background-color: #ac1b1a; border-color: #a11918; } .btn-danger:focus, .btn-danger.focus { box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.5); } .btn-danger.disabled, .btn-danger:disabled { color: #fff; background-color: #cd201f; border-color: #cd201f; } .btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active, .show > .btn-danger.dropdown-toggle { color: #fff; background-color: #a11918; border-color: #961717; } .btn-danger:not(:disabled):not(.disabled):active:focus, .btn-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-danger.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.5); } .btn-light { color: #495057; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-light:hover { color: #495057; background-color: #e2e6ea; border-color: #dae0e5; } .btn-light:focus, .btn-light.focus { box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.5); } .btn-light.disabled, .btn-light:disabled { color: #495057; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-light:not(:disabled):not(.disabled):active, .btn-light:not(:disabled):not(.disabled).active, .show > .btn-light.dropdown-toggle { color: #495057; background-color: #dae0e5; border-color: #d3d9df; } .btn-light:not(:disabled):not(.disabled):active:focus, .btn-light:not(:disabled):not(.disabled).active:focus, .show > .btn-light.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.5); } .btn-dark { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-dark:hover { color: #fff; background-color: #23272b; border-color: #1d2124; } .btn-dark:focus, .btn-dark.focus { box-shadow: 0 0 0 2px rgba(52, 58, 64, 0.5); } .btn-dark.disabled, .btn-dark:disabled { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-dark:not(:disabled):not(.disabled):active, .btn-dark:not(:disabled):not(.disabled).active, .show > .btn-dark.dropdown-toggle { color: #fff; background-color: #1d2124; border-color: #171a1d; } .btn-dark:not(:disabled):not(.disabled):active:focus, .btn-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-dark.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(52, 58, 64, 0.5); } .btn-outline-primary { color: #467fcf; background-color: transparent; background-image: none; border-color: #467fcf; } .btn-outline-primary:hover { color: #fff; background-color: #467fcf; border-color: #467fcf; } .btn-outline-primary:focus, .btn-outline-primary.focus { box-shadow: none; } .btn-outline-primary:focus-visible, .btn-outline-primary.focus { box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.5); } .btn-outline-primary.disabled, .btn-outline-primary:disabled { color: #467fcf; background-color: transparent; } .btn-outline-primary:not(:disabled):not(.disabled):active, .btn-outline-primary:not(:disabled):not(.disabled).active, .show > .btn-outline-primary.dropdown-toggle { color: #fff; background-color: #467fcf; border-color: #467fcf; } .btn-outline-primary:not(:disabled):not(.disabled):active:focus, .btn-outline-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-primary.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.5); } .btn-outline-secondary { color: #868e96; background-color: transparent; background-image: none; border-color: #868e96; } .btn-outline-secondary:hover { color: #fff; background-color: #868e96; border-color: #868e96; } .btn-outline-secondary:focus, .btn-outline-secondary.focus { box-shadow: none; } .btn-outline-secondary:focus-visible, .btn-outline-secondary.focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } .btn-outline-secondary.disabled, .btn-outline-secondary:disabled { color: #868e96; background-color: transparent; } .btn-outline-secondary:not(:disabled):not(.disabled):active, .btn-outline-secondary:not(:disabled):not(.disabled).active, .show > .btn-outline-secondary.dropdown-toggle { color: #fff; background-color: #868e96; border-color: #868e96; } .btn-outline-secondary:not(:disabled):not(.disabled):active:focus, .btn-outline-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-secondary.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } .btn-outline-success { color: #5eba00; background-color: transparent; background-image: none; border-color: #5eba00; } .btn-outline-success:hover { color: #fff; background-color: #5eba00; border-color: #5eba00; } .btn-outline-success:focus, .btn-outline-success.focus { box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.5); } .btn-outline-success.disabled, .btn-outline-success:disabled { color: #5eba00; background-color: transparent; } .btn-outline-success:not(:disabled):not(.disabled):active, .btn-outline-success:not(:disabled):not(.disabled).active, .show > .btn-outline-success.dropdown-toggle { color: #fff; background-color: #5eba00; border-color: #5eba00; } .btn-outline-success:not(:disabled):not(.disabled):active:focus, .btn-outline-success:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-success.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.5); } .btn-outline-info { color: #45aaf2; background-color: transparent; background-image: none; border-color: #45aaf2; } .btn-outline-info:hover { color: #fff; background-color: #45aaf2; border-color: #45aaf2; } .btn-outline-info:focus, .btn-outline-info.focus { box-shadow: 0 0 0 2px rgba(69, 170, 242, 0.5); } .btn-outline-info.disabled, .btn-outline-info:disabled { color: #45aaf2; background-color: transparent; } .btn-outline-info:not(:disabled):not(.disabled):active, .btn-outline-info:not(:disabled):not(.disabled).active, .show > .btn-outline-info.dropdown-toggle { color: #fff; background-color: #45aaf2; border-color: #45aaf2; } .btn-outline-info:not(:disabled):not(.disabled):active:focus, .btn-outline-info:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-info.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(69, 170, 242, 0.5); } .btn-outline-warning { color: #f1c40f; background-color: transparent; background-image: none; border-color: #f1c40f; } .btn-outline-warning:hover { color: #fff; background-color: #f1c40f; border-color: #f1c40f; } .btn-outline-warning:focus, .btn-outline-warning.focus { box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5); } .btn-outline-warning.disabled, .btn-outline-warning:disabled { color: #f1c40f; background-color: transparent; } .btn-outline-warning:not(:disabled):not(.disabled):active, .btn-outline-warning:not(:disabled):not(.disabled).active, .show > .btn-outline-warning.dropdown-toggle { color: #fff; background-color: #f1c40f; border-color: #f1c40f; } .btn-outline-warning:not(:disabled):not(.disabled):active:focus, .btn-outline-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-warning.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5); } .btn-outline-danger { color: #cd201f; background-color: transparent; background-image: none; border-color: #cd201f; } .btn-outline-danger:hover { color: #fff; background-color: #cd201f; border-color: #cd201f; } .btn-outline-danger:focus, .btn-outline-danger.focus { box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.5); } .btn-outline-danger.disabled, .btn-outline-danger:disabled { color: #cd201f; background-color: transparent; } .btn-outline-danger:not(:disabled):not(.disabled):active, .btn-outline-danger:not(:disabled):not(.disabled).active, .show > .btn-outline-danger.dropdown-toggle { color: #fff; background-color: #cd201f; border-color: #cd201f; } .btn-outline-danger:not(:disabled):not(.disabled):active:focus, .btn-outline-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-danger.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.5); } .btn-outline-light { color: #f8f9fa; background-color: transparent; background-image: none; border-color: #f8f9fa; } .btn-outline-light:hover { color: #495057; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-outline-light:focus, .btn-outline-light.focus { box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.5); } .btn-outline-light.disabled, .btn-outline-light:disabled { color: #f8f9fa; background-color: transparent; } .btn-outline-light:not(:disabled):not(.disabled):active, .btn-outline-light:not(:disabled):not(.disabled).active, .show > .btn-outline-light.dropdown-toggle { color: #495057; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-outline-light:not(:disabled):not(.disabled):active:focus, .btn-outline-light:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-light.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.5); } .btn-outline-dark { color: #343a40; background-color: transparent; background-image: none; border-color: #343a40; } .btn-outline-dark:hover { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-outline-dark:focus, .btn-outline-dark.focus { box-shadow: 0 0 0 2px rgba(52, 58, 64, 0.5); } .btn-outline-dark.disabled, .btn-outline-dark:disabled { color: #343a40; background-color: transparent; } .btn-outline-dark:not(:disabled):not(.disabled):active, .btn-outline-dark:not(:disabled):not(.disabled).active, .show > .btn-outline-dark.dropdown-toggle { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-outline-dark:not(:disabled):not(.disabled):active:focus, .btn-outline-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-dark.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(52, 58, 64, 0.5); } .btn-link { font-weight: 400; color: #467fcf; background-color: transparent; } .btn-link:hover { color: #295a9f; text-decoration: underline; background-color: transparent; border-color: transparent; } .btn-link:focus, .btn-link.focus { text-decoration: underline; border-color: transparent; box-shadow: none; } .btn-link:disabled, .btn-link.disabled { color: #868e96; } .btn-lg, .btn-group-lg > .btn { padding: 0.5rem 1rem; font-size: 1.125rem; line-height: 1.625; border-radius: 3px; } .btn-sm, .btn-group-sm > .btn { padding: 0.25rem 0.5rem; font-size: 0.875rem; line-height: 1.33333333; border-radius: 3px; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 0.5rem; } input[type='submit'].btn-block, input[type='reset'].btn-block, input[type='button'].btn-block { width: 100%; } .fade { opacity: 0; transition: opacity 0.15s linear; } .fade.show { opacity: 1; } .collapse { display: none; } .collapse.show { display: block; } tr.collapse.show { display: table-row; } tbody.collapse.show { display: table-row-group; } .collapsing { position: relative; height: 0; overflow: hidden; transition: height 0.35s ease; } .dropup, .dropdown { position: relative; } .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ''; border-top: 0.3em solid; border-right: 0.3em solid transparent; border-bottom: 0; border-left: 0.3em solid transparent; } .dropdown-toggle:empty::after { margin-left: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 10rem; padding: 0.5rem 0; margin: 0.125rem 0 0; font-size: 0.9375rem; color: #495057; text-align: left; list-style: none; background-color: var(--ctrl-bgcolor); background-clip: padding-box; border: 1px solid rgba(0, 40, 100, 0.12); border-radius: 3px; } [data-theme='dark'] .dropdown-menu { border: 1px solid var(--card-border-color); } .dropup .dropdown-menu { margin-top: 0; margin-bottom: 0.125rem; } .dropup .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ''; border-top: 0; border-right: 0.3em solid transparent; border-bottom: 0.3em solid; border-left: 0.3em solid transparent; } .dropup .dropdown-toggle:empty::after { margin-left: 0; } .dropright .dropdown-menu { margin-top: 0; margin-left: 0.125rem; } .dropright .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ''; border-top: 0.3em solid transparent; border-bottom: 0.3em solid transparent; border-left: 0.3em solid; } .dropright .dropdown-toggle:empty::after { margin-left: 0; } .dropright .dropdown-toggle::after { vertical-align: 0; } .dropleft .dropdown-menu { margin-top: 0; margin-right: 0.125rem; } .dropleft .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ''; } .dropleft .dropdown-toggle::after { display: none; } .dropleft .dropdown-toggle::before { display: inline-block; width: 0; height: 0; margin-right: 0.255em; vertical-align: 0.255em; content: ''; border-top: 0.3em solid transparent; border-right: 0.3em solid; border-bottom: 0.3em solid transparent; } .dropleft .dropdown-toggle:empty::after { margin-left: 0; } .dropleft .dropdown-toggle::before { vertical-align: 0; } .dropdown-divider { height: 0; margin: 0.5rem 0; overflow: hidden; border-top: 1px solid #e9ecef; } .dropdown-item { display: block; width: 100%; padding: 0.25rem 1.5rem; clear: both; font-weight: 400; color: var(--ctrl-dropdown-color); text-align: inherit; white-space: nowrap; background-color: transparent; border: 0; } .dropdown-item:hover, .dropdown-item:focus { color: var(--ctrl-dropdown-color-focus); text-decoration: none; background-color: var(--ctrl-dropdown-bgcolor-focus); } .dropdown-item.active, .dropdown-item:active { color: #fff; text-decoration: none; background-color: #467fcf; } .dropdown-item.disabled, .dropdown-item:disabled { color: #868e96; background-color: transparent; } .dropdown-menu.show { display: block; } .dropdown-header { display: block; padding: 0.5rem 1.5rem; margin-bottom: 0; font-size: 0.875rem; color: #868e96; white-space: nowrap; } .btn-group, .btn-group-vertical { position: relative; display: -ms-inline-flexbox; display: inline-flex; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; -ms-flex: 0 1 auto; flex: 0 1 auto; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover { z-index: 1; } .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn:focus, .btn-group-vertical > .btn:active, .btn-group-vertical > .btn.active { z-index: 1; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group, .btn-group-vertical .btn + .btn, .btn-group-vertical .btn + .btn-group, .btn-group-vertical .btn-group + .btn, .btn-group-vertical .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-pack: start; justify-content: flex-start; } .btn-toolbar .input-group { width: auto; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:not(:last-child):not(.dropdown-toggle), .btn-group > .btn-group:not(:last-child) > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; } .btn-group > .btn:not(:first-child), .btn-group > .btn-group:not(:first-child) > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; } .dropdown-toggle-split { padding-right: 0.5625rem; padding-left: 0.5625rem; } .dropdown-toggle-split::after { margin-left: 0; } .btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split { padding-right: 0.375rem; padding-left: 0.375rem; } .btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split { padding-right: 0.75rem; padding-left: 0.75rem; } .btn-group-vertical { -ms-flex-direction: column; flex-direction: column; -ms-flex-align: start; align-items: flex-start; -ms-flex-pack: center; justify-content: center; } .btn-group-vertical .btn, .btn-group-vertical .btn-group { width: 100%; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle), .btn-group-vertical > .btn-group:not(:last-child) > .btn { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:not(:first-child), .btn-group-vertical > .btn-group:not(:first-child) > .btn { border-top-left-radius: 0; border-top-right-radius: 0; } .btn-group-toggle > .btn, .btn-group-toggle > .btn-group > .btn { margin-bottom: 0; } .btn-group-toggle > .btn input[type='radio'], .btn-group-toggle > .btn input[type='checkbox'], .btn-group-toggle > .btn-group > .btn input[type='radio'], .btn-group-toggle > .btn-group > .btn input[type='checkbox'] { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; } .input-group { position: relative; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-align: stretch; align-items: stretch; width: 100%; } .input-group > .form-control, .input-group > .custom-select, .input-group > .custom-file { position: relative; -ms-flex: 1 1 auto; flex: 1 1 auto; width: 1%; margin-bottom: 0; } .input-group > .form-control:focus, .input-group > .custom-select:focus, .input-group > .custom-file:focus { z-index: 3; } .input-group > .form-control + .form-control, .input-group > .form-control + .custom-select, .input-group > .form-control + .custom-file, .input-group > .custom-select + .form-control, .input-group > .custom-select + .custom-select, .input-group > .custom-select + .custom-file, .input-group > .custom-file + .form-control, .input-group > .custom-file + .custom-select, .input-group > .custom-file + .custom-file { margin-left: -1px; } .input-group > .form-control:not(:last-child), .input-group > .custom-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group > .form-control:not(:first-child), .input-group > .custom-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; } .input-group > .custom-file { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; } .input-group > .custom-file:not(:last-child) .custom-file-label, .input-group > .custom-file:not(:last-child) .custom-file-label::before { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group > .custom-file:not(:first-child) .custom-file-label, .input-group > .custom-file:not(:first-child) .custom-file-label::before { border-top-left-radius: 0; border-bottom-left-radius: 0; } .input-group-prepend, .input-group-append { display: -ms-flexbox; display: flex; } .input-group-prepend .btn, .input-group-append .btn { position: relative; z-index: 2; } .input-group-prepend .btn + .btn, .input-group-prepend .btn + .input-group-text, .input-group-prepend .input-group-text + .input-group-text, .input-group-prepend .input-group-text + .btn, .input-group-append .btn + .btn, .input-group-append .btn + .input-group-text, .input-group-append .input-group-text + .input-group-text, .input-group-append .input-group-text + .btn { margin-left: -1px; } .input-group-prepend { margin-right: -1px; } .input-group-append { margin-left: -1px; } .input-group-text { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; padding: 0.375rem 0.75rem; margin-bottom: 0; font-size: 0.9375rem; font-weight: 400; line-height: 1.6; color: #495057; text-align: center; white-space: nowrap; background-color: #fbfbfc; border: 1px solid rgba(0, 40, 100, 0.12); border-radius: 3px; } .input-group-text input[type='radio'], .input-group-text input[type='checkbox'] { margin-top: 0; } .input-group > .input-group-prepend > .btn, .input-group > .input-group-prepend > .input-group-text, .input-group > .input-group-append:not(:last-child) > .btn, .input-group > .input-group-append:not(:last-child) > .input-group-text, .input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group > .input-group-append:last-child > .input-group-text:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group > .input-group-append > .btn, .input-group > .input-group-append > .input-group-text, .input-group > .input-group-prepend:not(:first-child) > .btn, .input-group > .input-group-prepend:not(:first-child) > .input-group-text, .input-group > .input-group-prepend:first-child > .btn:not(:first-child), .input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; } .custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.5rem; } .custom-control-inline { display: -ms-inline-flexbox; display: inline-flex; margin-right: 1rem; } .custom-control-input { position: absolute; z-index: -1; opacity: 0; } .custom-control-input:checked ~ .custom-control-label::before { color: #fff; background-color: #467fcf; } .custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 1px #f5f7fb, 0 0 0 2px rgba(70, 127, 207, 0.25); } .custom-control-input:active ~ .custom-control-label::before { color: #fff; background-color: #d4e1f4; } .custom-control-input:disabled ~ .custom-control-label { color: #868e96; } .custom-control-input:disabled ~ .custom-control-label::before { background-color: #e9ecef; } .custom-control-label { margin-bottom: 0; } .custom-control-label::before { position: absolute; top: 0.25rem; left: 0; display: block; width: 1rem; height: 1rem; pointer-events: none; content: ''; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-color: #dee2e6; } .custom-control-label::after { position: absolute; top: 0.25rem; left: 0; display: block; width: 1rem; height: 1rem; content: ''; background-repeat: no-repeat; background-position: center center; background-size: 50% 50%; } .custom-checkbox .custom-control-label::before { border-radius: 3px; } .custom-checkbox .custom-control-input:checked ~ .custom-control-label::before { background-color: #467fcf; } .custom-checkbox .custom-control-input:checked ~ .custom-control-label::after { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"); } .custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before { background-color: #467fcf; } .custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E"); } .custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before { background-color: rgba(70, 127, 207, 0.5); } .custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before { background-color: rgba(70, 127, 207, 0.5); } .custom-radio .custom-control-label::before { border-radius: 50%; } .custom-radio .custom-control-input:checked ~ .custom-control-label::before { background-color: #467fcf; } .custom-radio .custom-control-input:checked ~ .custom-control-label::after { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E"); } .custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before { background-color: rgba(70, 127, 207, 0.5); } .custom-select { display: inline-block; width: 100%; height: 2.375rem; padding: 0.5rem 1.75rem 0.5rem 0.75rem; line-height: 1.5; color: var(--mcolor); vertical-align: middle; background: var(--card-bgcolor) url('data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashMCcvPjwvc3ZnPg==') no-repeat right 0.75rem center; background-size: 8px 10px; border: 1px solid var(--card-border-color); border-radius: 3px; -webkit-appearance: none; -moz-appearance: none; appearance: none; } .custom-select:focus { border-color: #1991eb; outline: 0; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 5px rgba(25, 145, 235, 0.5); } .custom-select:focus::-ms-value { color: #495057; background-color: #fff; } .custom-select[multiple], .custom-select[size]:not([size='1']) { height: auto; padding-right: 0.75rem; background-image: none; } .custom-select:disabled { color: #868e96; background-color: #e9ecef; } .custom-select::-ms-expand { opacity: 0; } .custom-select-sm { height: calc(1.8125rem + 2px); padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 75%; } .custom-select-lg { height: calc(2.6875rem + 2px); padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 125%; } .custom-file { position: relative; display: inline-block; width: 100%; height: 2.375rem; margin-bottom: 0; } .custom-file-input { position: relative; z-index: 2; width: 100%; height: 2.375rem; margin: 0; opacity: 0; } .custom-file-input:focus ~ .custom-file-control { border-color: #1991eb; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .custom-file-input:focus ~ .custom-file-control::before { border-color: #1991eb; } .custom-file-input:lang(en) ~ .custom-file-label::after { content: 'Browse'; } .custom-file-label { position: absolute; top: 0; right: 0; left: 0; z-index: 1; height: 2.375rem; padding: 0.375rem 0.75rem; line-height: 1.5; color: #495057; background-color: #fff; border: 1px solid rgba(0, 40, 100, 0.12); border-radius: 3px; } .custom-file-label::after { position: absolute; top: 0; right: 0; bottom: 0; z-index: 3; display: block; height: calc(2.375rem - 1px * 2); padding: 0.375rem 0.75rem; line-height: 1.5; color: #495057; content: 'Browse'; background-color: #fbfbfc; border-left: 1px solid rgba(0, 40, 100, 0.12); border-radius: 0 3px 3px 0; } .nav { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; padding-left: 0; margin-bottom: 0; list-style: none; } .nav-link { display: block; padding: 0.5rem 1rem; } .nav-link:hover, .nav-link:focus { text-decoration: none; } .nav-link.disabled { color: #868e96; } .nav-tabs { border-bottom: 1px solid #dee2e6; } .nav-tabs .nav-item { margin-bottom: -1px; } .nav-tabs .nav-link { border: 1px solid transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; } .nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus { border-color: #e9ecef #e9ecef #dee2e6; } .nav-tabs .nav-link.disabled { color: #868e96; background-color: transparent; border-color: transparent; } .nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: #495057; background-color: #f5f7fb; border-color: #dee2e6 #dee2e6 #f5f7fb; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; } .nav-pills .nav-link { border-radius: 3px; } .nav-pills .nav-link.active, .nav-pills .show > .nav-link { color: #fff; background-color: #467fcf; } .nav-fill .nav-item { -ms-flex: 1 1 auto; flex: 1 1 auto; text-align: center; } .nav-justified .nav-item { -ms-flex-preferred-size: 0; flex-basis: 0; -ms-flex-positive: 1; flex-grow: 1; text-align: center; } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .navbar { position: relative; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-align: center; align-items: center; -ms-flex-pack: justify; justify-content: space-between; padding: 0.5rem 1rem; } .navbar > .container, .navbar > .container-fluid { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-align: center; align-items: center; -ms-flex-pack: justify; justify-content: space-between; } .navbar-brand { display: inline-block; padding-top: 0.359375rem; padding-bottom: 0.359375rem; margin-right: 1rem; font-size: 1.125rem; line-height: inherit; white-space: nowrap; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-nav { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; padding-left: 0; margin-bottom: 0; list-style: none; } .navbar-nav .nav-link { padding-right: 0; padding-left: 0; } .navbar-nav .dropdown-menu { position: static; float: none; } .navbar-text { display: inline-block; padding-top: 0.5rem; padding-bottom: 0.5rem; } .navbar-collapse { -ms-flex-preferred-size: 100%; flex-basis: 100%; -ms-flex-positive: 1; flex-grow: 1; -ms-flex-align: center; align-items: center; } .navbar-toggler { padding: 0.25rem 0.75rem; font-size: 1.125rem; line-height: 1; background-color: transparent; border: 1px solid transparent; border-radius: 3px; } .navbar-toggler:hover, .navbar-toggler:focus { text-decoration: none; } .navbar-toggler:not(:disabled):not(.disabled) { cursor: pointer; } .navbar-toggler-icon { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: middle; content: ''; background: no-repeat center center; background-size: 100% 100%; } @media (max-width: 575.98px) { .navbar-expand-sm > .container, .navbar-expand-sm > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 576px) { .navbar-expand-sm { -ms-flex-flow: row nowrap; flex-flow: row nowrap; -ms-flex-pack: start; justify-content: flex-start; } .navbar-expand-sm .navbar-nav { -ms-flex-direction: row; flex-direction: row; } .navbar-expand-sm .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-sm .navbar-nav .dropdown-menu-right { right: 0; left: auto; } .navbar-expand-sm .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-sm > .container, .navbar-expand-sm > .container-fluid { -ms-flex-wrap: nowrap; flex-wrap: nowrap; } .navbar-expand-sm .navbar-collapse { display: -ms-flexbox !important; display: flex !important; -ms-flex-preferred-size: auto; flex-basis: auto; } .navbar-expand-sm .navbar-toggler { display: none; } .navbar-expand-sm .dropup .dropdown-menu { top: auto; bottom: 100%; } } @media (max-width: 767.98px) { .navbar-expand-md > .container, .navbar-expand-md > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 768px) { .navbar-expand-md { -ms-flex-flow: row nowrap; flex-flow: row nowrap; -ms-flex-pack: start; justify-content: flex-start; } .navbar-expand-md .navbar-nav { -ms-flex-direction: row; flex-direction: row; } .navbar-expand-md .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-md .navbar-nav .dropdown-menu-right { right: 0; left: auto; } .navbar-expand-md .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-md > .container, .navbar-expand-md > .container-fluid { -ms-flex-wrap: nowrap; flex-wrap: nowrap; } .navbar-expand-md .navbar-collapse { display: -ms-flexbox !important; display: flex !important; -ms-flex-preferred-size: auto; flex-basis: auto; } .navbar-expand-md .navbar-toggler { display: none; } .navbar-expand-md .dropup .dropdown-menu { top: auto; bottom: 100%; } } @media (max-width: 991.98px) { .navbar-expand-lg > .container, .navbar-expand-lg > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 992px) { .navbar-expand-lg { -ms-flex-flow: row nowrap; flex-flow: row nowrap; -ms-flex-pack: start; justify-content: flex-start; } .navbar-expand-lg .navbar-nav { -ms-flex-direction: row; flex-direction: row; } .navbar-expand-lg .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-lg .navbar-nav .dropdown-menu-right { right: 0; left: auto; } .navbar-expand-lg .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-lg > .container, .navbar-expand-lg > .container-fluid { -ms-flex-wrap: nowrap; flex-wrap: nowrap; } .navbar-expand-lg .navbar-collapse { display: -ms-flexbox !important; display: flex !important; -ms-flex-preferred-size: auto; flex-basis: auto; } .navbar-expand-lg .navbar-toggler { display: none; } .navbar-expand-lg .dropup .dropdown-menu { top: auto; bottom: 100%; } } @media (max-width: 1279.98px) { .navbar-expand-xl > .container, .navbar-expand-xl > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 1280px) { .navbar-expand-xl { -ms-flex-flow: row nowrap; flex-flow: row nowrap; -ms-flex-pack: start; justify-content: flex-start; } .navbar-expand-xl .navbar-nav { -ms-flex-direction: row; flex-direction: row; } .navbar-expand-xl .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-xl .navbar-nav .dropdown-menu-right { right: 0; left: auto; } .navbar-expand-xl .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-xl > .container, .navbar-expand-xl > .container-fluid { -ms-flex-wrap: nowrap; flex-wrap: nowrap; } .navbar-expand-xl .navbar-collapse { display: -ms-flexbox !important; display: flex !important; -ms-flex-preferred-size: auto; flex-basis: auto; } .navbar-expand-xl .navbar-toggler { display: none; } .navbar-expand-xl .dropup .dropdown-menu { top: auto; bottom: 100%; } } .navbar-expand { -ms-flex-flow: row nowrap; flex-flow: row nowrap; -ms-flex-pack: start; justify-content: flex-start; } .navbar-expand > .container, .navbar-expand > .container-fluid { padding-right: 0; padding-left: 0; } .navbar-expand .navbar-nav { -ms-flex-direction: row; flex-direction: row; } .navbar-expand .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand .navbar-nav .dropdown-menu-right { right: 0; left: auto; } .navbar-expand .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand > .container, .navbar-expand > .container-fluid { -ms-flex-wrap: nowrap; flex-wrap: nowrap; } .navbar-expand .navbar-collapse { display: -ms-flexbox !important; display: flex !important; -ms-flex-preferred-size: auto; flex-basis: auto; } .navbar-expand .navbar-toggler { display: none; } .navbar-expand .dropup .dropdown-menu { top: auto; bottom: 100%; } .navbar-light .navbar-brand { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-brand:hover, .navbar-light .navbar-brand:focus { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-nav .nav-link { color: rgba(0, 0, 0, 0.5); } .navbar-light .navbar-nav .nav-link:hover, .navbar-light .navbar-nav .nav-link:focus { color: rgba(0, 0, 0, 0.7); } .navbar-light .navbar-nav .nav-link.disabled { color: rgba(0, 0, 0, 0.3); } .navbar-light .navbar-nav .show > .nav-link, .navbar-light .navbar-nav .active > .nav-link, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .nav-link.active { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-toggler { color: rgba(0, 0, 0, 0.5); border-color: rgba(0, 0, 0, 0.1); } .navbar-light .navbar-toggler-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='path_to_url stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); } .navbar-light .navbar-text { color: rgba(0, 0, 0, 0.5); } .navbar-light .navbar-text a { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-text a:hover, .navbar-light .navbar-text a:focus { color: rgba(0, 0, 0, 0.9); } .navbar-dark .navbar-brand { color: #fff; } .navbar-dark .navbar-brand:hover, .navbar-dark .navbar-brand:focus { color: #fff; } .navbar-dark .navbar-nav .nav-link { color: rgba(255, 255, 255, 0.5); } .navbar-dark .navbar-nav .nav-link:hover, .navbar-dark .navbar-nav .nav-link:focus { color: rgba(255, 255, 255, 0.75); } .navbar-dark .navbar-nav .nav-link.disabled { color: rgba(255, 255, 255, 0.25); } .navbar-dark .navbar-nav .show > .nav-link, .navbar-dark .navbar-nav .active > .nav-link, .navbar-dark .navbar-nav .nav-link.show, .navbar-dark .navbar-nav .nav-link.active { color: #fff; } .navbar-dark .navbar-toggler { color: rgba(255, 255, 255, 0.5); border-color: rgba(255, 255, 255, 0.1); } .navbar-dark .navbar-toggler-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='path_to_url stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); } .navbar-dark .navbar-text { color: rgba(255, 255, 255, 0.5); } .navbar-dark .navbar-text a { color: #fff; } .navbar-dark .navbar-text a:hover, .navbar-dark .navbar-text a:focus { color: #fff; } .card { position: relative; display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; min-width: 0; word-wrap: break-word; background-color: var(--card-bgcolor); background-clip: border-box; border: 1px solid var(--card-border-color); border-radius: 3px; } .card > hr { margin-right: 0; margin-left: 0; } .card > .list-group:first-child .list-group-item:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .card > .list-group:last-child .list-group-item:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .card-body { -ms-flex: 1 1 auto; flex: 1 1 auto; padding: 1.5rem; } .card-title { margin-bottom: 1.5rem; } .card-subtitle { margin-top: -0.75rem; margin-bottom: 0; } .card-text:last-child { margin-bottom: 0; } .card-link:hover { text-decoration: none; } .card-link + .card-link { margin-left: 1.5rem; } .card-header { padding: 1.5rem 1.5rem; margin-bottom: 0; background-color: rgba(0, 0, 0, 0.03); border-bottom: 1px solid rgba(0, 40, 100, 0.12); } .card-header:first-child { border-radius: calc(3px - 1px) calc(3px - 1px) 0 0; } .card-header + .list-group .list-group-item:first-child { border-top: 0; } .card-footer { padding: 1.5rem 1.5rem; background-color: rgba(0, 0, 0, 0.03); border-top: 1px solid rgba(0, 40, 100, 0.12); } .card-footer:last-child { border-radius: 0 0 calc(3px - 1px) calc(3px - 1px); } .card-header-tabs { margin-right: -0.75rem; margin-bottom: -1.5rem; margin-left: -0.75rem; border-bottom: 0; } .card-header-pills { margin-right: -0.75rem; margin-left: -0.75rem; } .card-img-overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; padding: 1.25rem; } .card-img { width: 100%; border-radius: calc(3px - 1px); } .card-img-top { width: 100%; border-top-left-radius: calc(3px - 1px); border-top-right-radius: calc(3px - 1px); } .card-img-bottom { width: 100%; border-bottom-right-radius: calc(3px - 1px); border-bottom-left-radius: calc(3px - 1px); } .card-deck { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; } .card-deck .card { margin-bottom: 0.75rem; } @media (min-width: 576px) { .card-deck { -ms-flex-flow: row wrap; flex-flow: row wrap; margin-right: -0.75rem; margin-left: -0.75rem; } .card-deck .card { display: -ms-flexbox; display: flex; -ms-flex: 1 0 0%; flex: 1 0 0%; -ms-flex-direction: column; flex-direction: column; margin-right: 0.75rem; margin-bottom: 0; margin-left: 0.75rem; } } .card-group { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; } .card-group > .card { margin-bottom: 0.75rem; } @media (min-width: 576px) { .card-group { -ms-flex-flow: row wrap; flex-flow: row wrap; } .card-group > .card { -ms-flex: 1 0 0%; flex: 1 0 0%; margin-bottom: 0; } .card-group > .card + .card { margin-left: 0; border-left: 0; } .card-group > .card:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; } .card-group > .card:first-child .card-img-top, .card-group > .card:first-child .card-header { border-top-right-radius: 0; } .card-group > .card:first-child .card-img-bottom, .card-group > .card:first-child .card-footer { border-bottom-right-radius: 0; } .card-group > .card:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; } .card-group > .card:last-child .card-img-top, .card-group > .card:last-child .card-header { border-top-left-radius: 0; } .card-group > .card:last-child .card-img-bottom, .card-group > .card:last-child .card-footer { border-bottom-left-radius: 0; } .card-group > .card:only-child { border-radius: 3px; } .card-group > .card:only-child .card-img-top, .card-group > .card:only-child .card-header { border-top-left-radius: 3px; border-top-right-radius: 3px; } .card-group > .card:only-child .card-img-bottom, .card-group > .card:only-child .card-footer { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .card-group > .card:not(:first-child):not(:last-child):not(:only-child) { border-radius: 0; } .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-top, .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom, .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-header, .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-footer { border-radius: 0; } } .card-columns .card { margin-bottom: 1.5rem; } @media (min-width: 576px) { .card-columns { -webkit-column-count: 3; -moz-column-count: 3; column-count: 3; -webkit-column-gap: 1.25rem; -moz-column-gap: 1.25rem; column-gap: 1.25rem; } .card-columns .card { display: inline-block; width: 100%; } } .breadcrumb { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; padding: 0.75rem 1rem; margin-bottom: 1rem; list-style: none; background-color: #e9ecef; border-radius: 3px; } .breadcrumb-item + .breadcrumb-item::before { display: inline-block; padding-right: 0.5rem; padding-left: 0.5rem; color: #868e96; content: '/'; } .breadcrumb-item + .breadcrumb-item:hover::before { text-decoration: underline; } .breadcrumb-item + .breadcrumb-item:hover::before { text-decoration: none; } .breadcrumb-item.active { color: #868e96; } .pagination { display: -ms-flexbox; display: flex; padding-left: 0; list-style: none; border-radius: 3px; } .page-link { position: relative; display: block; padding: 0.5rem 0.75rem; margin-left: -1px; line-height: 1.25; color: #495057; background-color: #fff; border: 1px solid #dee2e6; } .page-link:hover { color: #295a9f; text-decoration: none; background-color: #e9ecef; border-color: #dee2e6; } .page-link:focus { z-index: 2; outline: 0; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .page-link:not(:disabled):not(.disabled) { cursor: pointer; } .page-item:first-child .page-link { margin-left: 0; border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .page-item:last-child .page-link { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .page-item.active .page-link { z-index: 1; color: #fff; background-color: #467fcf; border-color: #467fcf; } .page-item.disabled .page-link { color: #ced4da; pointer-events: none; cursor: auto; background-color: #fff; border-color: #dee2e6; } .pagination-lg .page-link { padding: 0.75rem 1.5rem; font-size: 1.125rem; line-height: 1.5; } .pagination-lg .page-item:first-child .page-link { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .pagination-lg .page-item:last-child .page-link { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .pagination-sm .page-link { padding: 0.25rem 0.5rem; font-size: 0.875rem; line-height: 1.5; } .pagination-sm .page-item:first-child .page-link { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .pagination-sm .page-item:last-child .page-link { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .badge { display: inline-block; padding: 0.25em 0.4em; font-size: 75%; font-weight: 600; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 3px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .badge-pill { padding-right: 0.6em; padding-left: 0.6em; border-radius: 10rem; } .badge-primary { color: #fff; background-color: #467fcf; } .badge-primary[href]:hover, .badge-primary[href]:focus { color: #fff; text-decoration: none; background-color: #2f66b3; } .badge-secondary { color: #fff; background-color: #868e96; } .badge-secondary[href]:hover, .badge-secondary[href]:focus { color: #fff; text-decoration: none; background-color: #6c757d; } .badge-success { color: #fff; background-color: #5eba00; } .badge-success[href]:hover, .badge-success[href]:focus { color: #fff; text-decoration: none; background-color: #448700; } .badge-info { color: #fff; background-color: #45aaf2; } .badge-info[href]:hover, .badge-info[href]:focus { color: #fff; text-decoration: none; background-color: #1594ef; } .badge-warning { color: #fff; background-color: #f1c40f; } .badge-warning[href]:hover, .badge-warning[href]:focus { color: #fff; text-decoration: none; background-color: #c29d0b; } .badge-danger { color: #fff; background-color: #cd201f; } .badge-danger[href]:hover, .badge-danger[href]:focus { color: #fff; text-decoration: none; background-color: #a11918; } .badge-light { color: #495057; background-color: #f8f9fa; } .badge-light[href]:hover, .badge-light[href]:focus { color: #495057; text-decoration: none; background-color: #dae0e5; } .badge-dark { color: #fff; background-color: #343a40; } .badge-dark[href]:hover, .badge-dark[href]:focus { color: #fff; text-decoration: none; background-color: #1d2124; } .jumbotron { padding: 2rem 1rem; margin-bottom: 2rem; background-color: #e9ecef; border-radius: 3px; } @media (min-width: 576px) { .jumbotron { padding: 4rem 2rem; } } .jumbotron-fluid { padding-right: 0; padding-left: 0; border-radius: 0; } .alert { position: relative; padding: 0.75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 3px; } .alert-heading { color: inherit; } .alert-link { font-weight: 600; } .alert-dismissible { padding-right: 3.90625rem; } .alert-dismissible .close { position: absolute; top: 0; right: 0; padding: 0.75rem 1.25rem; color: inherit; } .alert-primary { color: var(--alert-message-color); background-color: var(--alert-message-bg); border-color: var(--alert-message-border); } .alert-primary hr { border-top-color: #b7cded; } .alert-primary .alert-link { color: #172b46; } .alert-secondary { color: #464a4e; background-color: #e7e8ea; border-color: #dddfe2; } .alert-secondary hr { border-top-color: #cfd2d6; } .alert-secondary .alert-link { color: #2e3133; } .alert-success { color: #316100; background-color: #dff1cc; border-color: #d2ecb8; } .alert-success hr { border-top-color: #c5e7a4; } .alert-success .alert-link { color: #172e00; } .alert-info { color: var(--alert-message-color); background-color: var(--alert-message-bg); border-color: var(--alert-message-border); } .alert-info hr { border-top-color: #b3dcf9; } .alert-info .alert-link { color: #193c56; } .alert-warning { color: #7d6608; background-color: #fcf3cf; border-color: #fbeebc; } .alert-warning hr { border-top-color: #fae8a4; } .alert-warning .alert-link { color: #4d3f05; } .alert-danger { color: #6b1110; background-color: #f5d2d2; border-color: #f1c1c0; } .alert-danger hr { border-top-color: #ecacab; } .alert-danger .alert-link { color: #3f0a09; } .alert-light { color: #818182; background-color: #fefefe; border-color: #fdfdfe; } .alert-light hr { border-top-color: #ececf6; } .alert-light .alert-link { color: #686868; } .alert-dark { color: #1b1e21; background-color: #d6d8d9; border-color: #c6c8ca; } .alert-dark hr { border-top-color: #b9bbbe; } .alert-dark .alert-link { color: #040505; } @-webkit-keyframes progress-bar-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } } .progress { display: -ms-flexbox; display: flex; height: 1rem; overflow: hidden; font-size: 0.703125rem; background-color: #e9ecef; border-radius: 3px; } .progress-bar { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; -ms-flex-pack: center; justify-content: center; color: #fff; text-align: center; background-color: #467fcf; transition: width 0.6s ease; } .progress-bar-striped { background-image: linear-gradient( 45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent ); background-size: 1rem 1rem; } .progress-bar-animated { -webkit-animation: progress-bar-stripes 1s linear infinite; animation: progress-bar-stripes 1s linear infinite; } .media { display: -ms-flexbox; display: flex; -ms-flex-align: start; align-items: flex-start; } .media-body { -ms-flex: 1; flex: 1; } .list-group { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; padding-left: 0; margin-bottom: 0; } .list-group-item-action { width: 100%; color: #495057; text-align: inherit; } .list-group-item-action:hover, .list-group-item-action:focus { color: #495057; text-decoration: none; background-color: #f8f9fa; } .list-group-item-action:active { color: #495057; background-color: #e9ecef; } .list-group-item { position: relative; display: block; padding: 0.75rem 1.25rem; margin-bottom: -1px; background-color: #fff; border: 1px solid rgba(0, 40, 100, 0.12); } .list-group-item:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .list-group-item:hover, .list-group-item:focus { z-index: 1; text-decoration: none; } .list-group-item.disabled, .list-group-item:disabled { color: #868e96; background-color: #fff; } .list-group-item.active { z-index: 2; color: #467fcf; background-color: #f8fafd; border-color: rgba(0, 40, 100, 0.12); } .list-group-flush .list-group-item { border-right: 0; border-left: 0; border-radius: 0; } .list-group-flush:first-child .list-group-item:first-child { border-top: 0; } .list-group-flush:last-child .list-group-item:last-child { border-bottom: 0; } .list-group-item-primary { color: #24426c; background-color: #cbdbf2; } .list-group-item-primary.list-group-item-action:hover, .list-group-item-primary.list-group-item-action:focus { color: #24426c; background-color: #b7cded; } .list-group-item-primary.list-group-item-action.active { color: #fff; background-color: #24426c; border-color: #24426c; } .list-group-item-secondary { color: #464a4e; background-color: #dddfe2; } .list-group-item-secondary.list-group-item-action:hover, .list-group-item-secondary.list-group-item-action:focus { color: #464a4e; background-color: #cfd2d6; } .list-group-item-secondary.list-group-item-action.active { color: #fff; background-color: #464a4e; border-color: #464a4e; } .list-group-item-success { color: #316100; background-color: #d2ecb8; } .list-group-item-success.list-group-item-action:hover, .list-group-item-success.list-group-item-action:focus { color: #316100; background-color: #c5e7a4; } .list-group-item-success.list-group-item-action.active { color: #fff; background-color: #316100; border-color: #316100; } .list-group-item-info { color: #24587e; background-color: #cbe7fb; } .list-group-item-info.list-group-item-action:hover, .list-group-item-info.list-group-item-action:focus { color: #24587e; background-color: #b3dcf9; } .list-group-item-info.list-group-item-action.active { color: #fff; background-color: #24587e; border-color: #24587e; } .list-group-item-warning { color: #7d6608; background-color: #fbeebc; } .list-group-item-warning.list-group-item-action:hover, .list-group-item-warning.list-group-item-action:focus { color: #7d6608; background-color: #fae8a4; } .list-group-item-warning.list-group-item-action.active { color: #fff; background-color: #7d6608; border-color: #7d6608; } .list-group-item-danger { color: #6b1110; background-color: #f1c1c0; } .list-group-item-danger.list-group-item-action:hover, .list-group-item-danger.list-group-item-action:focus { color: #6b1110; background-color: #ecacab; } .list-group-item-danger.list-group-item-action.active { color: #fff; background-color: #6b1110; border-color: #6b1110; } .list-group-item-light { color: #818182; background-color: #fdfdfe; } .list-group-item-light.list-group-item-action:hover, .list-group-item-light.list-group-item-action:focus { color: #818182; background-color: #ececf6; } .list-group-item-light.list-group-item-action.active { color: #fff; background-color: #818182; border-color: #818182; } .list-group-item-dark { color: #1b1e21; background-color: #c6c8ca; } .list-group-item-dark.list-group-item-action:hover, .list-group-item-dark.list-group-item-action:focus { color: #1b1e21; background-color: #b9bbbe; } .list-group-item-dark.list-group-item-action.active { color: #fff; background-color: #1b1e21; border-color: #1b1e21; } .close { float: right; font-size: 1.40625rem; font-weight: 700; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; opacity: 0.5; } .close:hover, .close:focus { color: #000; text-decoration: none; opacity: 0.75; } .close:not(:disabled):not(.disabled) { cursor: pointer; } button.close { padding: 0; background-color: transparent; border: 0; -webkit-appearance: none; } .modal-open { overflow: hidden; } .modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; display: none; overflow: hidden; outline: 0; } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 0.5rem; pointer-events: none; } .modal.fade .modal-dialog { transition: -webkit-transform 0.3s ease-out; transition: transform 0.3s ease-out; transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out; -webkit-transform: translate(0, -25%); transform: translate(0, -25%); } .modal.show .modal-dialog { -webkit-transform: translate(0, 0); transform: translate(0, 0); } .modal-dialog-centered { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; min-height: calc(100% - (0.5rem * 2)); } .modal-content { position: relative; display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; width: 100%; pointer-events: auto; background-color: var(--card-bgcolor); background-clip: padding-box; border: 1px solid var(--card-border-color); border-radius: 3px; outline: 0; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { opacity: 0; } .modal-backdrop.show { opacity: 0.5; } .modal-header { display: -ms-flexbox; display: flex; -ms-flex-align: start; align-items: flex-start; -ms-flex-pack: justify; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--card-border-color); border-top-left-radius: 3px; border-top-right-radius: 3px; } .modal-header .close { padding: 1rem; margin: -1rem -1rem -1rem auto; } .modal-title { margin-bottom: 0; line-height: 1.5; } .modal-body { position: relative; -ms-flex: 1 1 auto; flex: 1 1 auto; padding: 1rem; } .modal-footer { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: end; justify-content: flex-end; padding: 1rem; border-top: 1px solid var(--card-border-color); } .modal-footer > :not(:first-child) { margin-left: 0.25rem; } .modal-footer > :not(:last-child) { margin-right: 0.25rem; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 576px) { .modal-dialog { max-width: 500px; margin: 1.75rem auto; } .modal-dialog-centered { min-height: calc(100% - (1.75rem * 2)); } .modal-sm { max-width: 300px; } } @media (min-width: 992px) { .modal-lg { max-width: 800px; } } .tooltip { position: absolute; z-index: 1070; display: block; margin: 0; font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; font-style: normal; font-weight: 400; line-height: 1.5; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; white-space: normal; line-break: auto; font-size: 0.875rem; word-wrap: break-word; opacity: 0; } .tooltip.show { opacity: 0.9; } .tooltip .arrow { position: absolute; display: block; width: 0.8rem; height: 0.4rem; } .tooltip .arrow::before { position: absolute; content: ''; border-color: transparent; border-style: solid; } .bs-tooltip-top, .bs-tooltip-auto[x-placement^='top'] { padding: 0.4rem 0; } .bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^='top'] .arrow { bottom: 0; } .bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^='top'] .arrow::before { top: 0; border-width: 0.4rem 0.4rem 0; border-top-color: #000; } .bs-tooltip-right, .bs-tooltip-auto[x-placement^='right'] { padding: 0 0.4rem; } .bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^='right'] .arrow { left: 0; width: 0.4rem; height: 0.8rem; } .bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^='right'] .arrow::before { right: 0; border-width: 0.4rem 0.4rem 0.4rem 0; border-right-color: #000; } .bs-tooltip-bottom, .bs-tooltip-auto[x-placement^='bottom'] { padding: 0.4rem 0; } .bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^='bottom'] .arrow { top: 0; } .bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^='bottom'] .arrow::before { bottom: 0; border-width: 0 0.4rem 0.4rem; border-bottom-color: #000; } .bs-tooltip-left, .bs-tooltip-auto[x-placement^='left'] { padding: 0 0.4rem; } .bs-tooltip-left .arrow, .bs-tooltip-auto[x-placement^='left'] .arrow { right: 0; width: 0.4rem; height: 0.8rem; } .bs-tooltip-left .arrow::before, .bs-tooltip-auto[x-placement^='left'] .arrow::before { left: 0; border-width: 0.4rem 0 0.4rem 0.4rem; border-left-color: #000; } .tooltip-inner { max-width: 200px; padding: 0.25rem 0.5rem; color: #fff; text-align: center; background-color: #000; border-radius: 3px; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: block; max-width: 276px; font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; font-style: normal; font-weight: 400; line-height: 1.5; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; white-space: normal; line-break: auto; font-size: 0.875rem; word-wrap: break-word; background-color: #fff; background-clip: padding-box; border: 1px solid #dee3eb; border-radius: 3px; } .popover .arrow { position: absolute; display: block; width: 0.5rem; height: 0.5rem; margin: 0 3px; } .popover .arrow::before, .popover .arrow::after { position: absolute; display: block; content: ''; border-color: transparent; border-style: solid; } .bs-popover-top, .bs-popover-auto[x-placement^='top'] { margin-bottom: 0.5rem; } .bs-popover-top .arrow, .bs-popover-auto[x-placement^='top'] .arrow { bottom: calc((0.5rem + 1px) * -1); } .bs-popover-top .arrow::before, .bs-popover-auto[x-placement^='top'] .arrow::before, .bs-popover-top .arrow::after, .bs-popover-auto[x-placement^='top'] .arrow::after { border-width: 0.5rem 0.25rem 0; } .bs-popover-top .arrow::before, .bs-popover-auto[x-placement^='top'] .arrow::before { bottom: 0; border-top-color: #dee3eb; } .bs-popover-top .arrow::after, .bs-popover-auto[x-placement^='top'] .arrow::after { bottom: 1px; border-top-color: #fff; } .bs-popover-right, .bs-popover-auto[x-placement^='right'] { margin-left: 0.5rem; } .bs-popover-right .arrow, .bs-popover-auto[x-placement^='right'] .arrow { left: calc((0.5rem + 1px) * -1); width: 0.5rem; height: 0.5rem; margin: 3px 0; } .bs-popover-right .arrow::before, .bs-popover-auto[x-placement^='right'] .arrow::before, .bs-popover-right .arrow::after, .bs-popover-auto[x-placement^='right'] .arrow::after { border-width: 0.25rem 0.5rem 0.25rem 0; } .bs-popover-right .arrow::before, .bs-popover-auto[x-placement^='right'] .arrow::before { left: 0; border-right-color: #dee3eb; } .bs-popover-right .arrow::after, .bs-popover-auto[x-placement^='right'] .arrow::after { left: 1px; border-right-color: #fff; } .bs-popover-bottom, .bs-popover-auto[x-placement^='bottom'] { margin-top: 0.5rem; } .bs-popover-bottom .arrow, .bs-popover-auto[x-placement^='bottom'] .arrow { top: calc((0.5rem + 1px) * -1); } .bs-popover-bottom .arrow::before, .bs-popover-auto[x-placement^='bottom'] .arrow::before, .bs-popover-bottom .arrow::after, .bs-popover-auto[x-placement^='bottom'] .arrow::after { border-width: 0 0.25rem 0.5rem 0.25rem; } .bs-popover-bottom .arrow::before, .bs-popover-auto[x-placement^='bottom'] .arrow::before { top: 0; border-bottom-color: #dee3eb; } .bs-popover-bottom .arrow::after, .bs-popover-auto[x-placement^='bottom'] .arrow::after { top: 1px; border-bottom-color: #fff; } .bs-popover-bottom .popover-header::before, .bs-popover-auto[x-placement^='bottom'] .popover-header::before { position: absolute; top: 0; left: 50%; display: block; width: 0.5rem; margin-left: -0.25rem; content: ''; border-bottom: 1px solid #f7f7f7; } .bs-popover-left, .bs-popover-auto[x-placement^='left'] { margin-right: 0.5rem; } .bs-popover-left .arrow, .bs-popover-auto[x-placement^='left'] .arrow { right: calc((0.5rem + 1px) * -1); width: 0.5rem; height: 0.5rem; margin: 3px 0; } .bs-popover-left .arrow::before, .bs-popover-auto[x-placement^='left'] .arrow::before, .bs-popover-left .arrow::after, .bs-popover-auto[x-placement^='left'] .arrow::after { border-width: 0.25rem 0 0.25rem 0.5rem; } .bs-popover-left .arrow::before, .bs-popover-auto[x-placement^='left'] .arrow::before { right: 0; border-left-color: #dee3eb; } .bs-popover-left .arrow::after, .bs-popover-auto[x-placement^='left'] .arrow::after { right: 1px; border-left-color: #fff; } .popover-header { padding: 0.5rem 0.75rem; margin-bottom: 0; font-size: 0.9375rem; color: inherit; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-top-left-radius: calc(3px - 1px); border-top-right-radius: calc(3px - 1px); } .popover-header:empty { display: none; } .popover-body { padding: 0.75rem 1rem; color: #6e7687; } .carousel { position: relative; } .carousel-inner { position: relative; width: 100%; overflow: hidden; } .carousel-item { position: relative; display: none; -ms-flex-align: center; align-items: center; width: 100%; transition: -webkit-transform 0.6s ease; transition: transform 0.6s ease; transition: transform 0.6s ease, -webkit-transform 0.6s ease; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000px; perspective: 1000px; } .carousel-item.active, .carousel-item-next, .carousel-item-prev { display: block; } .carousel-item-next, .carousel-item-prev { position: absolute; top: 0; } .carousel-item-next.carousel-item-left, .carousel-item-prev.carousel-item-right { -webkit-transform: translateX(0); transform: translateX(0); } @supports ((-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d)) { .carousel-item-next.carousel-item-left, .carousel-item-prev.carousel-item-right { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } } .carousel-item-next, .active.carousel-item-right { -webkit-transform: translateX(100%); transform: translateX(100%); } @supports ((-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d)) { .carousel-item-next, .active.carousel-item-right { -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); } } .carousel-item-prev, .active.carousel-item-left { -webkit-transform: translateX(-100%); transform: translateX(-100%); } @supports ((-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d)) { .carousel-item-prev, .active.carousel-item-left { -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); } } .carousel-control-prev, .carousel-control-next { position: absolute; top: 0; bottom: 0; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; width: 15%; color: #fff; text-align: center; opacity: 0.5; } .carousel-control-prev:hover, .carousel-control-prev:focus, .carousel-control-next:hover, .carousel-control-next:focus { color: #fff; text-decoration: none; outline: 0; opacity: 0.9; } .carousel-control-prev { left: 0; } .carousel-control-next { right: 0; } .carousel-control-prev-icon, .carousel-control-next-icon { display: inline-block; width: 20px; height: 20px; background: transparent no-repeat center center; background-size: 100% 100%; } .carousel-control-prev-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E"); } .carousel-control-next-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E"); } .carousel-indicators { position: absolute; right: 0; bottom: 10px; left: 0; z-index: 15; display: -ms-flexbox; display: flex; -ms-flex-pack: center; justify-content: center; padding-left: 0; margin-right: 15%; margin-left: 15%; list-style: none; } .carousel-indicators li { position: relative; -ms-flex: 0 1 auto; flex: 0 1 auto; width: 30px; height: 3px; margin-right: 3px; margin-left: 3px; text-indent: -999px; background-color: rgba(255, 255, 255, 0.5); } .carousel-indicators li::before { position: absolute; top: -10px; left: 0; display: inline-block; width: 100%; height: 10px; content: ''; } .carousel-indicators li::after { position: absolute; bottom: -10px; left: 0; display: inline-block; width: 100%; height: 10px; content: ''; } .carousel-indicators .active { background-color: #fff; } .carousel-caption { position: absolute; right: 15%; bottom: 20px; left: 15%; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #fff; text-align: center; } .align-baseline { vertical-align: baseline !important; } .align-top { vertical-align: top !important; } .align-middle { vertical-align: middle !important; } .align-bottom { vertical-align: bottom !important; } .align-text-bottom { vertical-align: text-bottom !important; } .align-text-top { vertical-align: text-top !important; } .bg-primary { background-color: #467fcf !important; } a.bg-primary:hover, a.bg-primary:focus, button.bg-primary:hover, button.bg-primary:focus { background-color: #2f66b3 !important; } .bg-secondary { background-color: #868e96 !important; } a.bg-secondary:hover, a.bg-secondary:focus, button.bg-secondary:hover, button.bg-secondary:focus { background-color: #6c757d !important; } .bg-success { background-color: #5eba00 !important; } a.bg-success:hover, a.bg-success:focus, button.bg-success:hover, button.bg-success:focus { background-color: #448700 !important; } .bg-info { background-color: #45aaf2 !important; } a.bg-info:hover, a.bg-info:focus, button.bg-info:hover, button.bg-info:focus { background-color: #1594ef !important; } .bg-warning { background-color: #f1c40f !important; } a.bg-warning:hover, a.bg-warning:focus, button.bg-warning:hover, button.bg-warning:focus { background-color: #c29d0b !important; } .bg-danger { background-color: #cd201f !important; } a.bg-danger:hover, a.bg-danger:focus, button.bg-danger:hover, button.bg-danger:focus { background-color: #a11918 !important; } .bg-light { background-color: #f8f9fa !important; } a.bg-light:hover, a.bg-light:focus, button.bg-light:hover, button.bg-light:focus { background-color: #dae0e5 !important; } .bg-dark { background-color: #343a40 !important; } a.bg-dark:hover, a.bg-dark:focus, button.bg-dark:hover, button.bg-dark:focus { background-color: #1d2124 !important; } .bg-white { background-color: #fff !important; } .bg-transparent { background-color: transparent !important; } .border { border: 1px solid rgba(0, 40, 100, 0.12) !important; } .border-top { border-top: 1px solid rgba(0, 40, 100, 0.12) !important; } .border-right { border-right: 1px solid rgba(0, 40, 100, 0.12) !important; } .border-bottom { border-bottom: 1px solid rgba(0, 40, 100, 0.12) !important; } .border-left { border-left: 1px solid rgba(0, 40, 100, 0.12) !important; } .border-0 { border: 0 !important; } .border-top-0 { border-top: 0 !important; } .border-right-0 { border-right: 0 !important; } .border-bottom-0 { border-bottom: 0 !important; } .border-left-0 { border-left: 0 !important; } .border-primary { border-color: #467fcf !important; } .border-secondary { border-color: #868e96 !important; } .border-success { border-color: #5eba00 !important; } .border-info { border-color: #45aaf2 !important; } .border-warning { border-color: #f1c40f !important; } .border-danger { border-color: #cd201f !important; } .border-light { border-color: #f8f9fa !important; } .border-dark { border-color: #343a40 !important; } .border-white { border-color: #fff !important; } .rounded { border-radius: 3px !important; } .rounded-top { border-top-left-radius: 3px !important; border-top-right-radius: 3px !important; } .rounded-right { border-top-right-radius: 3px !important; border-bottom-right-radius: 3px !important; } .rounded-bottom { border-bottom-right-radius: 3px !important; border-bottom-left-radius: 3px !important; } .rounded-left { border-top-left-radius: 3px !important; border-bottom-left-radius: 3px !important; } .rounded-circle { border-radius: 50% !important; } .rounded-0 { border-radius: 0 !important; } .clearfix::after { display: block; clear: both; content: ''; } .d-none { display: none !important; } .d-inline { display: inline !important; } .d-inline-block { display: inline-block !important; } .d-block { display: block !important; } .d-table { display: table !important; } .d-table-row { display: table-row !important; } .d-table-cell { display: table-cell !important; } .d-flex { display: -ms-flexbox !important; display: flex !important; } .d-inline-flex { display: -ms-inline-flexbox !important; display: inline-flex !important; } @media (min-width: 576px) { .d-sm-none { display: none !important; } .d-sm-inline { display: inline !important; } .d-sm-inline-block { display: inline-block !important; } .d-sm-block { display: block !important; } .d-sm-table { display: table !important; } .d-sm-table-row { display: table-row !important; } .d-sm-table-cell { display: table-cell !important; } .d-sm-flex { display: -ms-flexbox !important; display: flex !important; } .d-sm-inline-flex { display: -ms-inline-flexbox !important; display: inline-flex !important; } } @media (min-width: 768px) { .d-md-none { display: none !important; } .d-md-inline { display: inline !important; } .d-md-inline-block { display: inline-block !important; } .d-md-block { display: block !important; } .d-md-table { display: table !important; } .d-md-table-row { display: table-row !important; } .d-md-table-cell { display: table-cell !important; } .d-md-flex { display: -ms-flexbox !important; display: flex !important; } .d-md-inline-flex { display: -ms-inline-flexbox !important; display: inline-flex !important; } } @media (min-width: 992px) { .d-lg-none { display: none !important; } .d-lg-inline { display: inline !important; } .d-lg-inline-block { display: inline-block !important; } .d-lg-block { display: block !important; } .d-lg-table { display: table !important; } .d-lg-table-row { display: table-row !important; } .d-lg-table-cell { display: table-cell !important; } .d-lg-flex { display: -ms-flexbox !important; display: flex !important; } .d-lg-inline-flex { display: -ms-inline-flexbox !important; display: inline-flex !important; } } @media (min-width: 1280px) { .d-xl-none { display: none !important; } .d-xl-inline { display: inline !important; } .d-xl-inline-block { display: inline-block !important; } .d-xl-block { display: block !important; } .d-xl-table { display: table !important; } .d-xl-table-row { display: table-row !important; } .d-xl-table-cell { display: table-cell !important; } .d-xl-flex { display: -ms-flexbox !important; display: flex !important; } .d-xl-inline-flex { display: -ms-inline-flexbox !important; display: inline-flex !important; } } @media print { .d-print-none { display: none !important; } .d-print-inline { display: inline !important; } .d-print-inline-block { display: inline-block !important; } .d-print-block { display: block !important; } .d-print-table { display: table !important; } .d-print-table-row { display: table-row !important; } .d-print-table-cell { display: table-cell !important; } .d-print-flex { display: -ms-flexbox !important; display: flex !important; } .d-print-inline-flex { display: -ms-inline-flexbox !important; display: inline-flex !important; } } .embed-responsive { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; } .embed-responsive::before { display: block; content: ''; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; } .embed-responsive-21by9::before { padding-top: 42.85714286%; } .embed-responsive-16by9::before { padding-top: 56.25%; } .embed-responsive-4by3::before { padding-top: 75%; } .embed-responsive-1by1::before { padding-top: 100%; } .flex-row { -ms-flex-direction: row !important; flex-direction: row !important; } .flex-column { -ms-flex-direction: column !important; flex-direction: column !important; } .flex-row-reverse { -ms-flex-direction: row-reverse !important; flex-direction: row-reverse !important; } .flex-column-reverse { -ms-flex-direction: column-reverse !important; flex-direction: column-reverse !important; } .flex-wrap { -ms-flex-wrap: wrap !important; flex-wrap: wrap !important; } .flex-nowrap { -ms-flex-wrap: nowrap !important; flex-wrap: nowrap !important; } .flex-wrap-reverse { -ms-flex-wrap: wrap-reverse !important; flex-wrap: wrap-reverse !important; } .justify-content-start { -ms-flex-pack: start !important; justify-content: flex-start !important; } .justify-content-end { -ms-flex-pack: end !important; justify-content: flex-end !important; } .justify-content-center { -ms-flex-pack: center !important; justify-content: center !important; } .justify-content-between { -ms-flex-pack: justify !important; justify-content: space-between !important; } .justify-content-around { -ms-flex-pack: distribute !important; justify-content: space-around !important; } .align-items-start { -ms-flex-align: start !important; align-items: flex-start !important; } .align-items-end { -ms-flex-align: end !important; align-items: flex-end !important; } .align-items-center { -ms-flex-align: center !important; align-items: center !important; } .align-items-baseline { -ms-flex-align: baseline !important; align-items: baseline !important; } .align-items-stretch { -ms-flex-align: stretch !important; align-items: stretch !important; } .align-content-start { -ms-flex-line-pack: start !important; align-content: flex-start !important; } .align-content-end { -ms-flex-line-pack: end !important; align-content: flex-end !important; } .align-content-center { -ms-flex-line-pack: center !important; align-content: center !important; } .align-content-between { -ms-flex-line-pack: justify !important; align-content: space-between !important; } .align-content-around { -ms-flex-line-pack: distribute !important; align-content: space-around !important; } .align-content-stretch { -ms-flex-line-pack: stretch !important; align-content: stretch !important; } .align-self-auto { -ms-flex-item-align: auto !important; align-self: auto !important; } .align-self-start { -ms-flex-item-align: start !important; align-self: flex-start !important; } .align-self-end { -ms-flex-item-align: end !important; align-self: flex-end !important; } .align-self-center { -ms-flex-item-align: center !important; align-self: center !important; } .align-self-baseline { -ms-flex-item-align: baseline !important; align-self: baseline !important; } .align-self-stretch { -ms-flex-item-align: stretch !important; align-self: stretch !important; } @media (min-width: 576px) { .flex-sm-row { -ms-flex-direction: row !important; flex-direction: row !important; } .flex-sm-column { -ms-flex-direction: column !important; flex-direction: column !important; } .flex-sm-row-reverse { -ms-flex-direction: row-reverse !important; flex-direction: row-reverse !important; } .flex-sm-column-reverse { -ms-flex-direction: column-reverse !important; flex-direction: column-reverse !important; } .flex-sm-wrap { -ms-flex-wrap: wrap !important; flex-wrap: wrap !important; } .flex-sm-nowrap { -ms-flex-wrap: nowrap !important; flex-wrap: nowrap !important; } .flex-sm-wrap-reverse { -ms-flex-wrap: wrap-reverse !important; flex-wrap: wrap-reverse !important; } .justify-content-sm-start { -ms-flex-pack: start !important; justify-content: flex-start !important; } .justify-content-sm-end { -ms-flex-pack: end !important; justify-content: flex-end !important; } .justify-content-sm-center { -ms-flex-pack: center !important; justify-content: center !important; } .justify-content-sm-between { -ms-flex-pack: justify !important; justify-content: space-between !important; } .justify-content-sm-around { -ms-flex-pack: distribute !important; justify-content: space-around !important; } .align-items-sm-start { -ms-flex-align: start !important; align-items: flex-start !important; } .align-items-sm-end { -ms-flex-align: end !important; align-items: flex-end !important; } .align-items-sm-center { -ms-flex-align: center !important; align-items: center !important; } .align-items-sm-baseline { -ms-flex-align: baseline !important; align-items: baseline !important; } .align-items-sm-stretch { -ms-flex-align: stretch !important; align-items: stretch !important; } .align-content-sm-start { -ms-flex-line-pack: start !important; align-content: flex-start !important; } .align-content-sm-end { -ms-flex-line-pack: end !important; align-content: flex-end !important; } .align-content-sm-center { -ms-flex-line-pack: center !important; align-content: center !important; } .align-content-sm-between { -ms-flex-line-pack: justify !important; align-content: space-between !important; } .align-content-sm-around { -ms-flex-line-pack: distribute !important; align-content: space-around !important; } .align-content-sm-stretch { -ms-flex-line-pack: stretch !important; align-content: stretch !important; } .align-self-sm-auto { -ms-flex-item-align: auto !important; align-self: auto !important; } .align-self-sm-start { -ms-flex-item-align: start !important; align-self: flex-start !important; } .align-self-sm-end { -ms-flex-item-align: end !important; align-self: flex-end !important; } .align-self-sm-center { -ms-flex-item-align: center !important; align-self: center !important; } .align-self-sm-baseline { -ms-flex-item-align: baseline !important; align-self: baseline !important; } .align-self-sm-stretch { -ms-flex-item-align: stretch !important; align-self: stretch !important; } } @media (min-width: 768px) { .flex-md-row { -ms-flex-direction: row !important; flex-direction: row !important; } .flex-md-column { -ms-flex-direction: column !important; flex-direction: column !important; } .flex-md-row-reverse { -ms-flex-direction: row-reverse !important; flex-direction: row-reverse !important; } .flex-md-column-reverse { -ms-flex-direction: column-reverse !important; flex-direction: column-reverse !important; } .flex-md-wrap { -ms-flex-wrap: wrap !important; flex-wrap: wrap !important; } .flex-md-nowrap { -ms-flex-wrap: nowrap !important; flex-wrap: nowrap !important; } .flex-md-wrap-reverse { -ms-flex-wrap: wrap-reverse !important; flex-wrap: wrap-reverse !important; } .justify-content-md-start { -ms-flex-pack: start !important; justify-content: flex-start !important; } .justify-content-md-end { -ms-flex-pack: end !important; justify-content: flex-end !important; } .justify-content-md-center { -ms-flex-pack: center !important; justify-content: center !important; } .justify-content-md-between { -ms-flex-pack: justify !important; justify-content: space-between !important; } .justify-content-md-around { -ms-flex-pack: distribute !important; justify-content: space-around !important; } .align-items-md-start { -ms-flex-align: start !important; align-items: flex-start !important; } .align-items-md-end { -ms-flex-align: end !important; align-items: flex-end !important; } .align-items-md-center { -ms-flex-align: center !important; align-items: center !important; } .align-items-md-baseline { -ms-flex-align: baseline !important; align-items: baseline !important; } .align-items-md-stretch { -ms-flex-align: stretch !important; align-items: stretch !important; } .align-content-md-start { -ms-flex-line-pack: start !important; align-content: flex-start !important; } .align-content-md-end { -ms-flex-line-pack: end !important; align-content: flex-end !important; } .align-content-md-center { -ms-flex-line-pack: center !important; align-content: center !important; } .align-content-md-between { -ms-flex-line-pack: justify !important; align-content: space-between !important; } .align-content-md-around { -ms-flex-line-pack: distribute !important; align-content: space-around !important; } .align-content-md-stretch { -ms-flex-line-pack: stretch !important; align-content: stretch !important; } .align-self-md-auto { -ms-flex-item-align: auto !important; align-self: auto !important; } .align-self-md-start { -ms-flex-item-align: start !important; align-self: flex-start !important; } .align-self-md-end { -ms-flex-item-align: end !important; align-self: flex-end !important; } .align-self-md-center { -ms-flex-item-align: center !important; align-self: center !important; } .align-self-md-baseline { -ms-flex-item-align: baseline !important; align-self: baseline !important; } .align-self-md-stretch { -ms-flex-item-align: stretch !important; align-self: stretch !important; } } @media (min-width: 992px) { .flex-lg-row { -ms-flex-direction: row !important; flex-direction: row !important; } .flex-lg-column { -ms-flex-direction: column !important; flex-direction: column !important; } .flex-lg-row-reverse { -ms-flex-direction: row-reverse !important; flex-direction: row-reverse !important; } .flex-lg-column-reverse { -ms-flex-direction: column-reverse !important; flex-direction: column-reverse !important; } .flex-lg-wrap { -ms-flex-wrap: wrap !important; flex-wrap: wrap !important; } .flex-lg-nowrap { -ms-flex-wrap: nowrap !important; flex-wrap: nowrap !important; } .flex-lg-wrap-reverse { -ms-flex-wrap: wrap-reverse !important; flex-wrap: wrap-reverse !important; } .justify-content-lg-start { -ms-flex-pack: start !important; justify-content: flex-start !important; } .justify-content-lg-end { -ms-flex-pack: end !important; justify-content: flex-end !important; } .justify-content-lg-center { -ms-flex-pack: center !important; justify-content: center !important; } .justify-content-lg-between { -ms-flex-pack: justify !important; justify-content: space-between !important; } .justify-content-lg-around { -ms-flex-pack: distribute !important; justify-content: space-around !important; } .align-items-lg-start { -ms-flex-align: start !important; align-items: flex-start !important; } .align-items-lg-end { -ms-flex-align: end !important; align-items: flex-end !important; } .align-items-lg-center { -ms-flex-align: center !important; align-items: center !important; } .align-items-lg-baseline { -ms-flex-align: baseline !important; align-items: baseline !important; } .align-items-lg-stretch { -ms-flex-align: stretch !important; align-items: stretch !important; } .align-content-lg-start { -ms-flex-line-pack: start !important; align-content: flex-start !important; } .align-content-lg-end { -ms-flex-line-pack: end !important; align-content: flex-end !important; } .align-content-lg-center { -ms-flex-line-pack: center !important; align-content: center !important; } .align-content-lg-between { -ms-flex-line-pack: justify !important; align-content: space-between !important; } .align-content-lg-around { -ms-flex-line-pack: distribute !important; align-content: space-around !important; } .align-content-lg-stretch { -ms-flex-line-pack: stretch !important; align-content: stretch !important; } .align-self-lg-auto { -ms-flex-item-align: auto !important; align-self: auto !important; } .align-self-lg-start { -ms-flex-item-align: start !important; align-self: flex-start !important; } .align-self-lg-end { -ms-flex-item-align: end !important; align-self: flex-end !important; } .align-self-lg-center { -ms-flex-item-align: center !important; align-self: center !important; } .align-self-lg-baseline { -ms-flex-item-align: baseline !important; align-self: baseline !important; } .align-self-lg-stretch { -ms-flex-item-align: stretch !important; align-self: stretch !important; } } @media (min-width: 1280px) { .flex-xl-row { -ms-flex-direction: row !important; flex-direction: row !important; } .flex-xl-column { -ms-flex-direction: column !important; flex-direction: column !important; } .flex-xl-row-reverse { -ms-flex-direction: row-reverse !important; flex-direction: row-reverse !important; } .flex-xl-column-reverse { -ms-flex-direction: column-reverse !important; flex-direction: column-reverse !important; } .flex-xl-wrap { -ms-flex-wrap: wrap !important; flex-wrap: wrap !important; } .flex-xl-nowrap { -ms-flex-wrap: nowrap !important; flex-wrap: nowrap !important; } .flex-xl-wrap-reverse { -ms-flex-wrap: wrap-reverse !important; flex-wrap: wrap-reverse !important; } .justify-content-xl-start { -ms-flex-pack: start !important; justify-content: flex-start !important; } .justify-content-xl-end { -ms-flex-pack: end !important; justify-content: flex-end !important; } .justify-content-xl-center { -ms-flex-pack: center !important; justify-content: center !important; } .justify-content-xl-between { -ms-flex-pack: justify !important; justify-content: space-between !important; } .justify-content-xl-around { -ms-flex-pack: distribute !important; justify-content: space-around !important; } .align-items-xl-start { -ms-flex-align: start !important; align-items: flex-start !important; } .align-items-xl-end { -ms-flex-align: end !important; align-items: flex-end !important; } .align-items-xl-center { -ms-flex-align: center !important; align-items: center !important; } .align-items-xl-baseline { -ms-flex-align: baseline !important; align-items: baseline !important; } .align-items-xl-stretch { -ms-flex-align: stretch !important; align-items: stretch !important; } .align-content-xl-start { -ms-flex-line-pack: start !important; align-content: flex-start !important; } .align-content-xl-end { -ms-flex-line-pack: end !important; align-content: flex-end !important; } .align-content-xl-center { -ms-flex-line-pack: center !important; align-content: center !important; } .align-content-xl-between { -ms-flex-line-pack: justify !important; align-content: space-between !important; } .align-content-xl-around { -ms-flex-line-pack: distribute !important; align-content: space-around !important; } .align-content-xl-stretch { -ms-flex-line-pack: stretch !important; align-content: stretch !important; } .align-self-xl-auto { -ms-flex-item-align: auto !important; align-self: auto !important; } .align-self-xl-start { -ms-flex-item-align: start !important; align-self: flex-start !important; } .align-self-xl-end { -ms-flex-item-align: end !important; align-self: flex-end !important; } .align-self-xl-center { -ms-flex-item-align: center !important; align-self: center !important; } .align-self-xl-baseline { -ms-flex-item-align: baseline !important; align-self: baseline !important; } .align-self-xl-stretch { -ms-flex-item-align: stretch !important; align-self: stretch !important; } } .float-left { float: left !important; } .float-right { float: right !important; } .float-none { float: none !important; } @media (min-width: 576px) { .float-sm-left { float: left !important; } .float-sm-right { float: right !important; } .float-sm-none { float: none !important; } } @media (min-width: 768px) { .float-md-left { float: left !important; } .float-md-right { float: right !important; } .float-md-none { float: none !important; } } @media (min-width: 992px) { .float-lg-left { float: left !important; } .float-lg-right { float: right !important; } .float-lg-none { float: none !important; } } @media (min-width: 1280px) { .float-xl-left { float: left !important; } .float-xl-right { float: right !important; } .float-xl-none { float: none !important; } } .position-static { position: static !important; } .position-relative { position: relative !important; } .position-absolute { position: absolute !important; } .position-fixed { position: fixed !important; } .position-sticky { position: -webkit-sticky !important; position: sticky !important; } .fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } .fixed-bottom { position: fixed; right: 0; bottom: 0; left: 0; z-index: 1030; } @supports ((position: -webkit-sticky) or (position: sticky)) { .sticky-top { position: -webkit-sticky; position: sticky; top: 0; z-index: 1020; } } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; -webkit-clip-path: inset(50%); clip-path: inset(50%); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; -webkit-clip-path: none; clip-path: none; } .w-25 { width: 25% !important; } .w-50 { width: 50% !important; } .w-75 { width: 75% !important; } .w-100 { width: 100% !important; } .w-0 { width: 0 !important; } .w-1 { width: 0.25rem !important; } .w-2 { width: 0.5rem !important; } .w-3 { width: 0.75rem !important; } .w-4 { width: 1rem !important; } .w-5 { width: 1.5rem !important; } .w-6 { width: 2rem !important; } .w-7 { width: 3rem !important; } .w-8 { width: 4rem !important; } .w-9 { width: 6rem !important; } .w-auto { width: auto !important; } .h-25 { height: 25% !important; } .h-50 { height: 50% !important; } .h-75 { height: 75% !important; } .h-100 { height: 100% !important; } .h-0 { height: 0 !important; } .h-1 { height: 0.25rem !important; } .h-2 { height: 0.5rem !important; } .h-3 { height: 0.75rem !important; } .h-4 { height: 1rem !important; } .h-5 { height: 1.5rem !important; } .h-6 { height: 2rem !important; } .h-7 { height: 3rem !important; } .h-8 { height: 4rem !important; } .h-9 { height: 6rem !important; } .h-auto { height: auto !important; } .mw-100 { max-width: 100% !important; } .mh-100 { max-height: 100% !important; } .m-0 { margin: 0 !important; } .mt-0, .my-0 { margin-top: 0 !important; } .mr-0, .mx-0 { margin-right: 0 !important; } .mb-0, .my-0 { margin-bottom: 0 !important; } .ml-0, .mx-0 { margin-left: 0 !important; } .m-1 { margin: 0.25rem !important; } .mt-1, .my-1 { margin-top: 0.25rem !important; } .mr-1, .mx-1 { margin-right: 0.25rem !important; } .mb-1, .my-1 { margin-bottom: 0.25rem !important; } .ml-1, .mx-1 { margin-left: 0.25rem !important; } .m-2 { margin: 0.5rem !important; } .mt-2, .my-2 { margin-top: 0.5rem !important; } .mr-2, .mx-2 { margin-right: 0.5rem !important; } .mb-2, .my-2 { margin-bottom: 0.5rem !important; } .ml-2, .mx-2 { margin-left: 0.5rem !important; } .m-3 { margin: 0.75rem !important; } .mt-3, .my-3 { margin-top: 0.75rem !important; } .mr-3, .mx-3 { margin-right: 0.75rem !important; } .mb-3, .my-3 { margin-bottom: 0.75rem !important; } .ml-3, .mx-3 { margin-left: 0.75rem !important; } .m-4 { margin: 1rem !important; } .mt-4, .my-4 { margin-top: 1rem !important; } .mr-4, .mx-4 { margin-right: 1rem !important; } .mb-4, .my-4 { margin-bottom: 1rem !important; } .ml-4, .mx-4 { margin-left: 1rem !important; } .m-5 { margin: 1.5rem !important; } .mt-5, .my-5 { margin-top: 1.5rem !important; } .mr-5, .mx-5 { margin-right: 1.5rem !important; } .mb-5, .my-5 { margin-bottom: 1.5rem !important; } .ml-5, .mx-5 { margin-left: 1.5rem !important; } .m-6 { margin: 2rem !important; } .mt-6, .my-6 { margin-top: 2rem !important; } .mr-6, .mx-6 { margin-right: 2rem !important; } .mb-6, .my-6 { margin-bottom: 2rem !important; } .ml-6, .mx-6 { margin-left: 2rem !important; } .m-7 { margin: 3rem !important; } .mt-7, .my-7 { margin-top: 3rem !important; } .mr-7, .mx-7 { margin-right: 3rem !important; } .mb-7, .my-7 { margin-bottom: 3rem !important; } .ml-7, .mx-7 { margin-left: 3rem !important; } .m-8 { margin: 4rem !important; } .mt-8, .my-8 { margin-top: 4rem !important; } .mr-8, .mx-8 { margin-right: 4rem !important; } .mb-8, .my-8 { margin-bottom: 4rem !important; } .ml-8, .mx-8 { margin-left: 4rem !important; } .m-9 { margin: 6rem !important; } .mt-9, .my-9 { margin-top: 6rem !important; } .mr-9, .mx-9 { margin-right: 6rem !important; } .mb-9, .my-9 { margin-bottom: 6rem !important; } .ml-9, .mx-9 { margin-left: 6rem !important; } .p-0 { padding: 0 !important; } .pt-0, .py-0 { padding-top: 0 !important; } .pr-0, .px-0 { padding-right: 0 !important; } .pb-0, .py-0 { padding-bottom: 0 !important; } .pl-0, .px-0 { padding-left: 0 !important; } .p-1 { padding: 0.25rem !important; } .pt-1, .py-1 { padding-top: 0.25rem !important; } .pr-1, .px-1 { padding-right: 0.25rem !important; } .pb-1, .py-1 { padding-bottom: 0.25rem !important; } .pl-1, .px-1 { padding-left: 0.25rem !important; } .p-2 { padding: 0.5rem !important; } .pt-2, .py-2 { padding-top: 0.5rem !important; } .pr-2, .px-2 { padding-right: 0.5rem !important; } .pb-2, .py-2 { padding-bottom: 0.5rem !important; } .pl-2, .px-2 { padding-left: 0.5rem !important; } .p-3 { padding: 0.75rem !important; } .pt-3, .py-3 { padding-top: 0.75rem !important; } .pr-3, .px-3 { padding-right: 0.75rem !important; } .pb-3, .py-3 { padding-bottom: 0.75rem !important; } .pl-3, .px-3 { padding-left: 0.75rem !important; } .p-4 { padding: 1rem !important; } .pt-4, .py-4 { padding-top: 1rem !important; } .pr-4, .px-4 { padding-right: 1rem !important; } .pb-4, .py-4 { padding-bottom: 1rem !important; } .pl-4, .px-4 { padding-left: 1rem !important; } .p-5 { padding: 1.5rem !important; } .pt-5, .py-5 { padding-top: 1.5rem !important; } .pr-5, .px-5 { padding-right: 1.5rem !important; } .pb-5, .py-5 { padding-bottom: 1.5rem !important; } .pl-5, .px-5 { padding-left: 1.5rem !important; } .p-6 { padding: 2rem !important; } .pt-6, .py-6 { padding-top: 2rem !important; } .pr-6, .px-6 { padding-right: 2rem !important; } .pb-6, .py-6 { padding-bottom: 2rem !important; } .pl-6, .px-6 { padding-left: 2rem !important; } .p-7 { padding: 3rem !important; } .pt-7, .py-7 { padding-top: 3rem !important; } .pr-7, .px-7 { padding-right: 3rem !important; } .pb-7, .py-7 { padding-bottom: 3rem !important; } .pl-7, .px-7 { padding-left: 3rem !important; } .p-8 { padding: 4rem !important; } .pt-8, .py-8 { padding-top: 4rem !important; } .pr-8, .px-8 { padding-right: 4rem !important; } .pb-8, .py-8 { padding-bottom: 4rem !important; } .pl-8, .px-8 { padding-left: 4rem !important; } .p-9 { padding: 6rem !important; } .pt-9, .py-9 { padding-top: 6rem !important; } .pr-9, .px-9 { padding-right: 6rem !important; } .pb-9, .py-9 { padding-bottom: 6rem !important; } .pl-9, .px-9 { padding-left: 6rem !important; } .m-auto { margin: auto !important; } .mt-auto, .my-auto { margin-top: auto !important; } .mr-auto, .mx-auto { margin-right: auto !important; } .mb-auto, .my-auto { margin-bottom: auto !important; } .ml-auto, .mx-auto { margin-left: auto !important; } @media (min-width: 576px) { .m-sm-0 { margin: 0 !important; } .mt-sm-0, .my-sm-0 { margin-top: 0 !important; } .mr-sm-0, .mx-sm-0 { margin-right: 0 !important; } .mb-sm-0, .my-sm-0 { margin-bottom: 0 !important; } .ml-sm-0, .mx-sm-0 { margin-left: 0 !important; } .m-sm-1 { margin: 0.25rem !important; } .mt-sm-1, .my-sm-1 { margin-top: 0.25rem !important; } .mr-sm-1, .mx-sm-1 { margin-right: 0.25rem !important; } .mb-sm-1, .my-sm-1 { margin-bottom: 0.25rem !important; } .ml-sm-1, .mx-sm-1 { margin-left: 0.25rem !important; } .m-sm-2 { margin: 0.5rem !important; } .mt-sm-2, .my-sm-2 { margin-top: 0.5rem !important; } .mr-sm-2, .mx-sm-2 { margin-right: 0.5rem !important; } .mb-sm-2, .my-sm-2 { margin-bottom: 0.5rem !important; } .ml-sm-2, .mx-sm-2 { margin-left: 0.5rem !important; } .m-sm-3 { margin: 0.75rem !important; } .mt-sm-3, .my-sm-3 { margin-top: 0.75rem !important; } .mr-sm-3, .mx-sm-3 { margin-right: 0.75rem !important; } .mb-sm-3, .my-sm-3 { margin-bottom: 0.75rem !important; } .ml-sm-3, .mx-sm-3 { margin-left: 0.75rem !important; } .m-sm-4 { margin: 1rem !important; } .mt-sm-4, .my-sm-4 { margin-top: 1rem !important; } .mr-sm-4, .mx-sm-4 { margin-right: 1rem !important; } .mb-sm-4, .my-sm-4 { margin-bottom: 1rem !important; } .ml-sm-4, .mx-sm-4 { margin-left: 1rem !important; } .m-sm-5 { margin: 1.5rem !important; } .mt-sm-5, .my-sm-5 { margin-top: 1.5rem !important; } .mr-sm-5, .mx-sm-5 { margin-right: 1.5rem !important; } .mb-sm-5, .my-sm-5 { margin-bottom: 1.5rem !important; } .ml-sm-5, .mx-sm-5 { margin-left: 1.5rem !important; } .m-sm-6 { margin: 2rem !important; } .mt-sm-6, .my-sm-6 { margin-top: 2rem !important; } .mr-sm-6, .mx-sm-6 { margin-right: 2rem !important; } .mb-sm-6, .my-sm-6 { margin-bottom: 2rem !important; } .ml-sm-6, .mx-sm-6 { margin-left: 2rem !important; } .m-sm-7 { margin: 3rem !important; } .mt-sm-7, .my-sm-7 { margin-top: 3rem !important; } .mr-sm-7, .mx-sm-7 { margin-right: 3rem !important; } .mb-sm-7, .my-sm-7 { margin-bottom: 3rem !important; } .ml-sm-7, .mx-sm-7 { margin-left: 3rem !important; } .m-sm-8 { margin: 4rem !important; } .mt-sm-8, .my-sm-8 { margin-top: 4rem !important; } .mr-sm-8, .mx-sm-8 { margin-right: 4rem !important; } .mb-sm-8, .my-sm-8 { margin-bottom: 4rem !important; } .ml-sm-8, .mx-sm-8 { margin-left: 4rem !important; } .m-sm-9 { margin: 6rem !important; } .mt-sm-9, .my-sm-9 { margin-top: 6rem !important; } .mr-sm-9, .mx-sm-9 { margin-right: 6rem !important; } .mb-sm-9, .my-sm-9 { margin-bottom: 6rem !important; } .ml-sm-9, .mx-sm-9 { margin-left: 6rem !important; } .p-sm-0 { padding: 0 !important; } .pt-sm-0, .py-sm-0 { padding-top: 0 !important; } .pr-sm-0, .px-sm-0 { padding-right: 0 !important; } .pb-sm-0, .py-sm-0 { padding-bottom: 0 !important; } .pl-sm-0, .px-sm-0 { padding-left: 0 !important; } .p-sm-1 { padding: 0.25rem !important; } .pt-sm-1, .py-sm-1 { padding-top: 0.25rem !important; } .pr-sm-1, .px-sm-1 { padding-right: 0.25rem !important; } .pb-sm-1, .py-sm-1 { padding-bottom: 0.25rem !important; } .pl-sm-1, .px-sm-1 { padding-left: 0.25rem !important; } .p-sm-2 { padding: 0.5rem !important; } .pt-sm-2, .py-sm-2 { padding-top: 0.5rem !important; } .pr-sm-2, .px-sm-2 { padding-right: 0.5rem !important; } .pb-sm-2, .py-sm-2 { padding-bottom: 0.5rem !important; } .pl-sm-2, .px-sm-2 { padding-left: 0.5rem !important; } .p-sm-3 { padding: 0.75rem !important; } .pt-sm-3, .py-sm-3 { padding-top: 0.75rem !important; } .pr-sm-3, .px-sm-3 { padding-right: 0.75rem !important; } .pb-sm-3, .py-sm-3 { padding-bottom: 0.75rem !important; } .pl-sm-3, .px-sm-3 { padding-left: 0.75rem !important; } .p-sm-4 { padding: 1rem !important; } .pt-sm-4, .py-sm-4 { padding-top: 1rem !important; } .pr-sm-4, .px-sm-4 { padding-right: 1rem !important; } .pb-sm-4, .py-sm-4 { padding-bottom: 1rem !important; } .pl-sm-4, .px-sm-4 { padding-left: 1rem !important; } .p-sm-5 { padding: 1.5rem !important; } .pt-sm-5, .py-sm-5 { padding-top: 1.5rem !important; } .pr-sm-5, .px-sm-5 { padding-right: 1.5rem !important; } .pb-sm-5, .py-sm-5 { padding-bottom: 1.5rem !important; } .pl-sm-5, .px-sm-5 { padding-left: 1.5rem !important; } .p-sm-6 { padding: 2rem !important; } .pt-sm-6, .py-sm-6 { padding-top: 2rem !important; } .pr-sm-6, .px-sm-6 { padding-right: 2rem !important; } .pb-sm-6, .py-sm-6 { padding-bottom: 2rem !important; } .pl-sm-6, .px-sm-6 { padding-left: 2rem !important; } .p-sm-7 { padding: 3rem !important; } .pt-sm-7, .py-sm-7 { padding-top: 3rem !important; } .pr-sm-7, .px-sm-7 { padding-right: 3rem !important; } .pb-sm-7, .py-sm-7 { padding-bottom: 3rem !important; } .pl-sm-7, .px-sm-7 { padding-left: 3rem !important; } .p-sm-8 { padding: 4rem !important; } .pt-sm-8, .py-sm-8 { padding-top: 4rem !important; } .pr-sm-8, .px-sm-8 { padding-right: 4rem !important; } .pb-sm-8, .py-sm-8 { padding-bottom: 4rem !important; } .pl-sm-8, .px-sm-8 { padding-left: 4rem !important; } .p-sm-9 { padding: 6rem !important; } .pt-sm-9, .py-sm-9 { padding-top: 6rem !important; } .pr-sm-9, .px-sm-9 { padding-right: 6rem !important; } .pb-sm-9, .py-sm-9 { padding-bottom: 6rem !important; } .pl-sm-9, .px-sm-9 { padding-left: 6rem !important; } .m-sm-auto { margin: auto !important; } .mt-sm-auto, .my-sm-auto { margin-top: auto !important; } .mr-sm-auto, .mx-sm-auto { margin-right: auto !important; } .mb-sm-auto, .my-sm-auto { margin-bottom: auto !important; } .ml-sm-auto, .mx-sm-auto { margin-left: auto !important; } } @media (min-width: 768px) { .m-md-0 { margin: 0 !important; } .mt-md-0, .my-md-0 { margin-top: 0 !important; } .mr-md-0, .mx-md-0 { margin-right: 0 !important; } .mb-md-0, .my-md-0 { margin-bottom: 0 !important; } .ml-md-0, .mx-md-0 { margin-left: 0 !important; } .m-md-1 { margin: 0.25rem !important; } .mt-md-1, .my-md-1 { margin-top: 0.25rem !important; } .mr-md-1, .mx-md-1 { margin-right: 0.25rem !important; } .mb-md-1, .my-md-1 { margin-bottom: 0.25rem !important; } .ml-md-1, .mx-md-1 { margin-left: 0.25rem !important; } .m-md-2 { margin: 0.5rem !important; } .mt-md-2, .my-md-2 { margin-top: 0.5rem !important; } .mr-md-2, .mx-md-2 { margin-right: 0.5rem !important; } .mb-md-2, .my-md-2 { margin-bottom: 0.5rem !important; } .ml-md-2, .mx-md-2 { margin-left: 0.5rem !important; } .m-md-3 { margin: 0.75rem !important; } .mt-md-3, .my-md-3 { margin-top: 0.75rem !important; } .mr-md-3, .mx-md-3 { margin-right: 0.75rem !important; } .mb-md-3, .my-md-3 { margin-bottom: 0.75rem !important; } .ml-md-3, .mx-md-3 { margin-left: 0.75rem !important; } .m-md-4 { margin: 1rem !important; } .mt-md-4, .my-md-4 { margin-top: 1rem !important; } .mr-md-4, .mx-md-4 { margin-right: 1rem !important; } .mb-md-4, .my-md-4 { margin-bottom: 1rem !important; } .ml-md-4, .mx-md-4 { margin-left: 1rem !important; } .m-md-5 { margin: 1.5rem !important; } .mt-md-5, .my-md-5 { margin-top: 1.5rem !important; } .mr-md-5, .mx-md-5 { margin-right: 1.5rem !important; } .mb-md-5, .my-md-5 { margin-bottom: 1.5rem !important; } .ml-md-5, .mx-md-5 { margin-left: 1.5rem !important; } .m-md-6 { margin: 2rem !important; } .mt-md-6, .my-md-6 { margin-top: 2rem !important; } .mr-md-6, .mx-md-6 { margin-right: 2rem !important; } .mb-md-6, .my-md-6 { margin-bottom: 2rem !important; } .ml-md-6, .mx-md-6 { margin-left: 2rem !important; } .m-md-7 { margin: 3rem !important; } .mt-md-7, .my-md-7 { margin-top: 3rem !important; } .mr-md-7, .mx-md-7 { margin-right: 3rem !important; } .mb-md-7, .my-md-7 { margin-bottom: 3rem !important; } .ml-md-7, .mx-md-7 { margin-left: 3rem !important; } .m-md-8 { margin: 4rem !important; } .mt-md-8, .my-md-8 { margin-top: 4rem !important; } .mr-md-8, .mx-md-8 { margin-right: 4rem !important; } .mb-md-8, .my-md-8 { margin-bottom: 4rem !important; } .ml-md-8, .mx-md-8 { margin-left: 4rem !important; } .m-md-9 { margin: 6rem !important; } .mt-md-9, .my-md-9 { margin-top: 6rem !important; } .mr-md-9, .mx-md-9 { margin-right: 6rem !important; } .mb-md-9, .my-md-9 { margin-bottom: 6rem !important; } .ml-md-9, .mx-md-9 { margin-left: 6rem !important; } .p-md-0 { padding: 0 !important; } .pt-md-0, .py-md-0 { padding-top: 0 !important; } .pr-md-0, .px-md-0 { padding-right: 0 !important; } .pb-md-0, .py-md-0 { padding-bottom: 0 !important; } .pl-md-0, .px-md-0 { padding-left: 0 !important; } .p-md-1 { padding: 0.25rem !important; } .pt-md-1, .py-md-1 { padding-top: 0.25rem !important; } .pr-md-1, .px-md-1 { padding-right: 0.25rem !important; } .pb-md-1, .py-md-1 { padding-bottom: 0.25rem !important; } .pl-md-1, .px-md-1 { padding-left: 0.25rem !important; } .p-md-2 { padding: 0.5rem !important; } .pt-md-2, .py-md-2 { padding-top: 0.5rem !important; } .pr-md-2, .px-md-2 { padding-right: 0.5rem !important; } .pb-md-2, .py-md-2 { padding-bottom: 0.5rem !important; } .pl-md-2, .px-md-2 { padding-left: 0.5rem !important; } .p-md-3 { padding: 0.75rem !important; } .pt-md-3, .py-md-3 { padding-top: 0.75rem !important; } .pr-md-3, .px-md-3 { padding-right: 0.75rem !important; } .pb-md-3, .py-md-3 { padding-bottom: 0.75rem !important; } .pl-md-3, .px-md-3 { padding-left: 0.75rem !important; } .p-md-4 { padding: 1rem !important; } .pt-md-4, .py-md-4 { padding-top: 1rem !important; } .pr-md-4, .px-md-4 { padding-right: 1rem !important; } .pb-md-4, .py-md-4 { padding-bottom: 1rem !important; } .pl-md-4, .px-md-4 { padding-left: 1rem !important; } .p-md-5 { padding: 1.5rem !important; } .pt-md-5, .py-md-5 { padding-top: 1.5rem !important; } .pr-md-5, .px-md-5 { padding-right: 1.5rem !important; } .pb-md-5, .py-md-5 { padding-bottom: 1.5rem !important; } .pl-md-5, .px-md-5 { padding-left: 1.5rem !important; } .p-md-6 { padding: 2rem !important; } .pt-md-6, .py-md-6 { padding-top: 2rem !important; } .pr-md-6, .px-md-6 { padding-right: 2rem !important; } .pb-md-6, .py-md-6 { padding-bottom: 2rem !important; } .pl-md-6, .px-md-6 { padding-left: 2rem !important; } .p-md-7 { padding: 3rem !important; } .pt-md-7, .py-md-7 { padding-top: 3rem !important; } .pr-md-7, .px-md-7 { padding-right: 3rem !important; } .pb-md-7, .py-md-7 { padding-bottom: 3rem !important; } .pl-md-7, .px-md-7 { padding-left: 3rem !important; } .p-md-8 { padding: 4rem !important; } .pt-md-8, .py-md-8 { padding-top: 4rem !important; } .pr-md-8, .px-md-8 { padding-right: 4rem !important; } .pb-md-8, .py-md-8 { padding-bottom: 4rem !important; } .pl-md-8, .px-md-8 { padding-left: 4rem !important; } .p-md-9 { padding: 6rem !important; } .pt-md-9, .py-md-9 { padding-top: 6rem !important; } .pr-md-9, .px-md-9 { padding-right: 6rem !important; } .pb-md-9, .py-md-9 { padding-bottom: 6rem !important; } .pl-md-9, .px-md-9 { padding-left: 6rem !important; } .m-md-auto { margin: auto !important; } .mt-md-auto, .my-md-auto { margin-top: auto !important; } .mr-md-auto, .mx-md-auto { margin-right: auto !important; } .mb-md-auto, .my-md-auto { margin-bottom: auto !important; } .ml-md-auto, .mx-md-auto { margin-left: auto !important; } } @media (min-width: 992px) { .m-lg-0 { margin: 0 !important; } .mt-lg-0, .my-lg-0 { margin-top: 0 !important; } .mr-lg-0, .mx-lg-0 { margin-right: 0 !important; } .mb-lg-0, .my-lg-0 { margin-bottom: 0 !important; } .ml-lg-0, .mx-lg-0 { margin-left: 0 !important; } .m-lg-1 { margin: 0.25rem !important; } .mt-lg-1, .my-lg-1 { margin-top: 0.25rem !important; } .mr-lg-1, .mx-lg-1 { margin-right: 0.25rem !important; } .mb-lg-1, .my-lg-1 { margin-bottom: 0.25rem !important; } .ml-lg-1, .mx-lg-1 { margin-left: 0.25rem !important; } .m-lg-2 { margin: 0.5rem !important; } .mt-lg-2, .my-lg-2 { margin-top: 0.5rem !important; } .mr-lg-2, .mx-lg-2 { margin-right: 0.5rem !important; } .mb-lg-2, .my-lg-2 { margin-bottom: 0.5rem !important; } .ml-lg-2, .mx-lg-2 { margin-left: 0.5rem !important; } .m-lg-3 { margin: 0.75rem !important; } .mt-lg-3, .my-lg-3 { margin-top: 0.75rem !important; } .mr-lg-3, .mx-lg-3 { margin-right: 0.75rem !important; } .mb-lg-3, .my-lg-3 { margin-bottom: 0.75rem !important; } .ml-lg-3, .mx-lg-3 { margin-left: 0.75rem !important; } .m-lg-4 { margin: 1rem !important; } .mt-lg-4, .my-lg-4 { margin-top: 1rem !important; } .mr-lg-4, .mx-lg-4 { margin-right: 1rem !important; } .mb-lg-4, .my-lg-4 { margin-bottom: 1rem !important; } .ml-lg-4, .mx-lg-4 { margin-left: 1rem !important; } .m-lg-5 { margin: 1.5rem !important; } .mt-lg-5, .my-lg-5 { margin-top: 1.5rem !important; } .mr-lg-5, .mx-lg-5 { margin-right: 1.5rem !important; } .mb-lg-5, .my-lg-5 { margin-bottom: 1.5rem !important; } .ml-lg-5, .mx-lg-5 { margin-left: 1.5rem !important; } .m-lg-6 { margin: 2rem !important; } .mt-lg-6, .my-lg-6 { margin-top: 2rem !important; } .mr-lg-6, .mx-lg-6 { margin-right: 2rem !important; } .mb-lg-6, .my-lg-6 { margin-bottom: 2rem !important; } .ml-lg-6, .mx-lg-6 { margin-left: 2rem !important; } .m-lg-7 { margin: 3rem !important; } .mt-lg-7, .my-lg-7 { margin-top: 3rem !important; } .mr-lg-7, .mx-lg-7 { margin-right: 3rem !important; } .mb-lg-7, .my-lg-7 { margin-bottom: 3rem !important; } .ml-lg-7, .mx-lg-7 { margin-left: 3rem !important; } .m-lg-8 { margin: 4rem !important; } .mt-lg-8, .my-lg-8 { margin-top: 4rem !important; } .mr-lg-8, .mx-lg-8 { margin-right: 4rem !important; } .mb-lg-8, .my-lg-8 { margin-bottom: 4rem !important; } .ml-lg-8, .mx-lg-8 { margin-left: 4rem !important; } .m-lg-9 { margin: 6rem !important; } .mt-lg-9, .my-lg-9 { margin-top: 6rem !important; } .mr-lg-9, .mx-lg-9 { margin-right: 6rem !important; } .mb-lg-9, .my-lg-9 { margin-bottom: 6rem !important; } .ml-lg-9, .mx-lg-9 { margin-left: 6rem !important; } .p-lg-0 { padding: 0 !important; } .pt-lg-0, .py-lg-0 { padding-top: 0 !important; } .pr-lg-0, .px-lg-0 { padding-right: 0 !important; } .pb-lg-0, .py-lg-0 { padding-bottom: 0 !important; } .pl-lg-0, .px-lg-0 { padding-left: 0 !important; } .p-lg-1 { padding: 0.25rem !important; } .pt-lg-1, .py-lg-1 { padding-top: 0.25rem !important; } .pr-lg-1, .px-lg-1 { padding-right: 0.25rem !important; } .pb-lg-1, .py-lg-1 { padding-bottom: 0.25rem !important; } .pl-lg-1, .px-lg-1 { padding-left: 0.25rem !important; } .p-lg-2 { padding: 0.5rem !important; } .pt-lg-2, .py-lg-2 { padding-top: 0.5rem !important; } .pr-lg-2, .px-lg-2 { padding-right: 0.5rem !important; } .pb-lg-2, .py-lg-2 { padding-bottom: 0.5rem !important; } .pl-lg-2, .px-lg-2 { padding-left: 0.5rem !important; } .p-lg-3 { padding: 0.75rem !important; } .pt-lg-3, .py-lg-3 { padding-top: 0.75rem !important; } .pr-lg-3, .px-lg-3 { padding-right: 0.75rem !important; } .pb-lg-3, .py-lg-3 { padding-bottom: 0.75rem !important; } .pl-lg-3, .px-lg-3 { padding-left: 0.75rem !important; } .p-lg-4 { padding: 1rem !important; } .pt-lg-4, .py-lg-4 { padding-top: 1rem !important; } .pr-lg-4, .px-lg-4 { padding-right: 1rem !important; } .pb-lg-4, .py-lg-4 { padding-bottom: 1rem !important; } .pl-lg-4, .px-lg-4 { padding-left: 1rem !important; } .p-lg-5 { padding: 1.5rem !important; } .pt-lg-5, .py-lg-5 { padding-top: 1.5rem !important; } .pr-lg-5, .px-lg-5 { padding-right: 1.5rem !important; } .pb-lg-5, .py-lg-5 { padding-bottom: 1.5rem !important; } .pl-lg-5, .px-lg-5 { padding-left: 1.5rem !important; } .p-lg-6 { padding: 2rem !important; } .pt-lg-6, .py-lg-6 { padding-top: 2rem !important; } .pr-lg-6, .px-lg-6 { padding-right: 2rem !important; } .pb-lg-6, .py-lg-6 { padding-bottom: 2rem !important; } .pl-lg-6, .px-lg-6 { padding-left: 2rem !important; } .p-lg-7 { padding: 3rem !important; } .pt-lg-7, .py-lg-7 { padding-top: 3rem !important; } .pr-lg-7, .px-lg-7 { padding-right: 3rem !important; } .pb-lg-7, .py-lg-7 { padding-bottom: 3rem !important; } .pl-lg-7, .px-lg-7 { padding-left: 3rem !important; } .p-lg-8 { padding: 4rem !important; } .pt-lg-8, .py-lg-8 { padding-top: 4rem !important; } .pr-lg-8, .px-lg-8 { padding-right: 4rem !important; } .pb-lg-8, .py-lg-8 { padding-bottom: 4rem !important; } .pl-lg-8, .px-lg-8 { padding-left: 4rem !important; } .p-lg-9 { padding: 6rem !important; } .pt-lg-9, .py-lg-9 { padding-top: 6rem !important; } .pr-lg-9, .px-lg-9 { padding-right: 6rem !important; } .pb-lg-9, .py-lg-9 { padding-bottom: 6rem !important; } .pl-lg-9, .px-lg-9 { padding-left: 6rem !important; } .m-lg-auto { margin: auto !important; } .mt-lg-auto, .my-lg-auto { margin-top: auto !important; } .mr-lg-auto, .mx-lg-auto { margin-right: auto !important; } .mb-lg-auto, .my-lg-auto { margin-bottom: auto !important; } .ml-lg-auto, .mx-lg-auto { margin-left: auto !important; } } @media (min-width: 1280px) { .m-xl-0 { margin: 0 !important; } .mt-xl-0, .my-xl-0 { margin-top: 0 !important; } .mr-xl-0, .mx-xl-0 { margin-right: 0 !important; } .mb-xl-0, .my-xl-0 { margin-bottom: 0 !important; } .ml-xl-0, .mx-xl-0 { margin-left: 0 !important; } .m-xl-1 { margin: 0.25rem !important; } .mt-xl-1, .my-xl-1 { margin-top: 0.25rem !important; } .mr-xl-1, .mx-xl-1 { margin-right: 0.25rem !important; } .mb-xl-1, .my-xl-1 { margin-bottom: 0.25rem !important; } .ml-xl-1, .mx-xl-1 { margin-left: 0.25rem !important; } .m-xl-2 { margin: 0.5rem !important; } .mt-xl-2, .my-xl-2 { margin-top: 0.5rem !important; } .mr-xl-2, .mx-xl-2 { margin-right: 0.5rem !important; } .mb-xl-2, .my-xl-2 { margin-bottom: 0.5rem !important; } .ml-xl-2, .mx-xl-2 { margin-left: 0.5rem !important; } .m-xl-3 { margin: 0.75rem !important; } .mt-xl-3, .my-xl-3 { margin-top: 0.75rem !important; } .mr-xl-3, .mx-xl-3 { margin-right: 0.75rem !important; } .mb-xl-3, .my-xl-3 { margin-bottom: 0.75rem !important; } .ml-xl-3, .mx-xl-3 { margin-left: 0.75rem !important; } .m-xl-4 { margin: 1rem !important; } .mt-xl-4, .my-xl-4 { margin-top: 1rem !important; } .mr-xl-4, .mx-xl-4 { margin-right: 1rem !important; } .mb-xl-4, .my-xl-4 { margin-bottom: 1rem !important; } .ml-xl-4, .mx-xl-4 { margin-left: 1rem !important; } .m-xl-5 { margin: 1.5rem !important; } .mt-xl-5, .my-xl-5 { margin-top: 1.5rem !important; } .mr-xl-5, .mx-xl-5 { margin-right: 1.5rem !important; } .mb-xl-5, .my-xl-5 { margin-bottom: 1.5rem !important; } .ml-xl-5, .mx-xl-5 { margin-left: 1.5rem !important; } .m-xl-6 { margin: 2rem !important; } .mt-xl-6, .my-xl-6 { margin-top: 2rem !important; } .mr-xl-6, .mx-xl-6 { margin-right: 2rem !important; } .mb-xl-6, .my-xl-6 { margin-bottom: 2rem !important; } .ml-xl-6, .mx-xl-6 { margin-left: 2rem !important; } .m-xl-7 { margin: 3rem !important; } .mt-xl-7, .my-xl-7 { margin-top: 3rem !important; } .mr-xl-7, .mx-xl-7 { margin-right: 3rem !important; } .mb-xl-7, .my-xl-7 { margin-bottom: 3rem !important; } .ml-xl-7, .mx-xl-7 { margin-left: 3rem !important; } .m-xl-8 { margin: 4rem !important; } .mt-xl-8, .my-xl-8 { margin-top: 4rem !important; } .mr-xl-8, .mx-xl-8 { margin-right: 4rem !important; } .mb-xl-8, .my-xl-8 { margin-bottom: 4rem !important; } .ml-xl-8, .mx-xl-8 { margin-left: 4rem !important; } .m-xl-9 { margin: 6rem !important; } .mt-xl-9, .my-xl-9 { margin-top: 6rem !important; } .mr-xl-9, .mx-xl-9 { margin-right: 6rem !important; } .mb-xl-9, .my-xl-9 { margin-bottom: 6rem !important; } .ml-xl-9, .mx-xl-9 { margin-left: 6rem !important; } .p-xl-0 { padding: 0 !important; } .pt-xl-0, .py-xl-0 { padding-top: 0 !important; } .pr-xl-0, .px-xl-0 { padding-right: 0 !important; } .pb-xl-0, .py-xl-0 { padding-bottom: 0 !important; } .pl-xl-0, .px-xl-0 { padding-left: 0 !important; } .p-xl-1 { padding: 0.25rem !important; } .pt-xl-1, .py-xl-1 { padding-top: 0.25rem !important; } .pr-xl-1, .px-xl-1 { padding-right: 0.25rem !important; } .pb-xl-1, .py-xl-1 { padding-bottom: 0.25rem !important; } .pl-xl-1, .px-xl-1 { padding-left: 0.25rem !important; } .p-xl-2 { padding: 0.5rem !important; } .pt-xl-2, .py-xl-2 { padding-top: 0.5rem !important; } .pr-xl-2, .px-xl-2 { padding-right: 0.5rem !important; } .pb-xl-2, .py-xl-2 { padding-bottom: 0.5rem !important; } .pl-xl-2, .px-xl-2 { padding-left: 0.5rem !important; } .p-xl-3 { padding: 0.75rem !important; } .pt-xl-3, .py-xl-3 { padding-top: 0.75rem !important; } .pr-xl-3, .px-xl-3 { padding-right: 0.75rem !important; } .pb-xl-3, .py-xl-3 { padding-bottom: 0.75rem !important; } .pl-xl-3, .px-xl-3 { padding-left: 0.75rem !important; } .p-xl-4 { padding: 1rem !important; } .pt-xl-4, .py-xl-4 { padding-top: 1rem !important; } .pr-xl-4, .px-xl-4 { padding-right: 1rem !important; } .pb-xl-4, .py-xl-4 { padding-bottom: 1rem !important; } .pl-xl-4, .px-xl-4 { padding-left: 1rem !important; } .p-xl-5 { padding: 1.5rem !important; } .pt-xl-5, .py-xl-5 { padding-top: 1.5rem !important; } .pr-xl-5, .px-xl-5 { padding-right: 1.5rem !important; } .pb-xl-5, .py-xl-5 { padding-bottom: 1.5rem !important; } .pl-xl-5, .px-xl-5 { padding-left: 1.5rem !important; } .p-xl-6 { padding: 2rem !important; } .pt-xl-6, .py-xl-6 { padding-top: 2rem !important; } .pr-xl-6, .px-xl-6 { padding-right: 2rem !important; } .pb-xl-6, .py-xl-6 { padding-bottom: 2rem !important; } .pl-xl-6, .px-xl-6 { padding-left: 2rem !important; } .p-xl-7 { padding: 3rem !important; } .pt-xl-7, .py-xl-7 { padding-top: 3rem !important; } .pr-xl-7, .px-xl-7 { padding-right: 3rem !important; } .pb-xl-7, .py-xl-7 { padding-bottom: 3rem !important; } .pl-xl-7, .px-xl-7 { padding-left: 3rem !important; } .p-xl-8 { padding: 4rem !important; } .pt-xl-8, .py-xl-8 { padding-top: 4rem !important; } .pr-xl-8, .px-xl-8 { padding-right: 4rem !important; } .pb-xl-8, .py-xl-8 { padding-bottom: 4rem !important; } .pl-xl-8, .px-xl-8 { padding-left: 4rem !important; } .p-xl-9 { padding: 6rem !important; } .pt-xl-9, .py-xl-9 { padding-top: 6rem !important; } .pr-xl-9, .px-xl-9 { padding-right: 6rem !important; } .pb-xl-9, .py-xl-9 { padding-bottom: 6rem !important; } .pl-xl-9, .px-xl-9 { padding-left: 6rem !important; } .m-xl-auto { margin: auto !important; } .mt-xl-auto, .my-xl-auto { margin-top: auto !important; } .mr-xl-auto, .mx-xl-auto { margin-right: auto !important; } .mb-xl-auto, .my-xl-auto { margin-bottom: auto !important; } .ml-xl-auto, .mx-xl-auto { margin-left: auto !important; } } .text-justify { text-align: justify !important; } .text-nowrap { white-space: nowrap !important; } .text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .text-left { text-align: left !important; } .text-right { text-align: right !important; } .text-center { text-align: center !important; } @media (min-width: 576px) { .text-sm-left { text-align: left !important; } .text-sm-right { text-align: right !important; } .text-sm-center { text-align: center !important; } } @media (min-width: 768px) { .text-md-left { text-align: left !important; } .text-md-right { text-align: right !important; } .text-md-center { text-align: center !important; } } @media (min-width: 992px) { .text-lg-left { text-align: left !important; } .text-lg-right { text-align: right !important; } .text-lg-center { text-align: center !important; } } @media (min-width: 1280px) { .text-xl-left { text-align: left !important; } .text-xl-right { text-align: right !important; } .text-xl-center { text-align: center !important; } } .text-lowercase { text-transform: lowercase !important; } .text-uppercase { text-transform: uppercase !important; } .text-capitalize { text-transform: capitalize !important; } .font-weight-light { font-weight: 300 !important; } .font-weight-normal { font-weight: 400 !important; } .font-weight-bold { font-weight: 700 !important; } .font-italic { font-style: italic !important; } .text-white { color: #fff !important; } .text-primary { color: #467fcf !important; } a.text-primary:hover, a.text-primary:focus { color: #2f66b3 !important; } .text-secondary { color: #868e96 !important; } a.text-secondary:hover, a.text-secondary:focus { color: #6c757d !important; } .text-success { color: #5eba00 !important; } a.text-success:hover, a.text-success:focus { color: #448700 !important; } .text-info { color: #45aaf2 !important; } a.text-info:hover, a.text-info:focus { color: #1594ef !important; } .text-warning { color: #f1c40f !important; } a.text-warning:hover, a.text-warning:focus { color: #c29d0b !important; } .text-danger { color: #cd201f !important; } a.text-danger:hover, a.text-danger:focus { color: #a11918 !important; } .text-light { color: #f8f9fa !important; } a.text-light:hover, a.text-light:focus { color: #dae0e5 !important; } .text-dark { color: #343a40 !important; } a.text-dark:hover, a.text-dark:focus { color: #1d2124 !important; } .text-muted { color: #9aa0ac !important; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .visible { visibility: visible !important; } .invisible { visibility: hidden !important; } @media print { *, *::before, *::after { text-shadow: none !important; box-shadow: none !important; } a:not(.btn) { text-decoration: underline; } abbr[title]::after { content: ' (' attr(title) ')'; } pre { white-space: pre-wrap !important; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } @page { size: a3; } body { min-width: 992px !important; } .container { min-width: 992px !important; } .navbar { display: none; } .badge { border: 1px solid #000; } .table, .text-wrap table { border-collapse: collapse !important; } .table td, .text-wrap table td, .table th, .text-wrap table th { background-color: #fff !important; } .table-bordered th, .text-wrap table th, .table-bordered td, .text-wrap table td { border: 1px solid #ddd !important; } } html { font-size: 16px; height: 100%; direction: ltr; } body { direction: ltr; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: none; -ms-touch-action: manipulation; touch-action: manipulation; -webkit-font-feature-settings: 'liga' 0; font-feature-settings: 'liga' 0; height: 100%; overflow-y: scroll; position: relative; } @media print { body { background: none; } } body *::-webkit-scrollbar { width: 6px; height: 6px; transition: 0.3s background; } body *::-webkit-scrollbar-thumb { background: #ced4da; } body *:hover::-webkit-scrollbar-thumb { background: #adb5bd; } .lead { line-height: 1.4; } a { -webkit-text-decoration-skip: auto; text-decoration-skip-ink: auto; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, .h1 a, .h2 a, .h3 a, .h4 a, .h5 a, .h6 a { color: inherit; } strong, b { font-weight: 600; } p, ul, ol, blockquote { margin-bottom: 1em; } blockquote { font-style: italic; color: #6e7687; padding-left: 2rem; border-left: 2px solid rgba(0, 40, 100, 0.12); } blockquote p { margin-bottom: 1rem; } blockquote cite { display: block; text-align: right; } blockquote cite:before { content: ' '; } code { background: rgba(0, 0, 0, 0.025); border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 3px; padding: 3px; } pre code { padding: 0; border-radius: 0; border: none; background: none; } hr { margin-top: 2rem; margin-bottom: 2rem; } pre { color: #343a40; padding: 1rem; overflow: auto; font-size: 85%; line-height: 1.45; background-color: #f8fafc; border-radius: 3px; -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; text-shadow: 0 1px white; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; } img { max-width: 100%; } .text-wrap { font-size: 1rem; line-height: 1.66; } .text-wrap > :first-child { margin-top: 0; } .text-wrap > :last-child { margin-bottom: 0; } .text-wrap > h1, .text-wrap > h2, .text-wrap > h3, .text-wrap > h4, .text-wrap > h5, .text-wrap > h6 { margin-top: 1em; } .section-nav { background-color: #f8f9fa; margin: 1rem 0; padding: 0.5rem 1rem; border: 1px solid rgba(0, 40, 100, 0.12); border-radius: 3px; list-style: none; } .section-nav:before { content: 'Table of contents:'; display: block; font-weight: 600; } @media print { .container { max-width: none; } } .row-cards > .col, .row-cards > [class*='col-'] { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; } .row-deck > .col, .row-deck > [class*='col-'] { display: -ms-flexbox; display: flex; -ms-flex-align: stretch; align-items: stretch; } .row-deck > .col .card, .row-deck > [class*='col-'] .card { -ms-flex: 1 1 auto; flex: 1 1 auto; } .col-text { max-width: 48rem; } .col-login { max-width: 24rem; } .gutters-0 { margin-right: 0; margin-left: 0; } .gutters-0 > .col, .gutters-0 > [class*='col-'] { padding-right: 0; padding-left: 0; } .gutters-0 .card { margin-bottom: 0; } .gutters-xs { margin-right: -0.25rem; margin-left: -0.25rem; } .gutters-xs > .col, .gutters-xs > [class*='col-'] { padding-right: 0.25rem; padding-left: 0.25rem; } .gutters-xs .card { margin-bottom: 0.5rem; } .gutters-sm { margin-right: -0.5rem; margin-left: -0.5rem; } .gutters-sm > .col, .gutters-sm > [class*='col-'] { padding-right: 0.5rem; padding-left: 0.5rem; } .gutters-sm .card { margin-bottom: 1rem; } .gutters-lg { margin-right: -1rem; margin-left: -1rem; } .gutters-lg > .col, .gutters-lg > [class*='col-'] { padding-right: 1rem; padding-left: 1rem; } .gutters-lg .card { margin-bottom: 2rem; } .gutters-xl { margin-right: -1.5rem; margin-left: -1.5rem; } .gutters-xl > .col, .gutters-xl > [class*='col-'] { padding-right: 1.5rem; padding-left: 1.5rem; } .gutters-xl .card { margin-bottom: 3rem; } .page { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; -ms-flex-pack: center; justify-content: center; min-height: 100%; } body.fixed-header .page { padding-top: 4.5rem; } @media (min-width: 1600px) { body.aside-opened .page { margin-right: 22rem; } } .page-main { -ms-flex: 1 1 auto; flex: 1 1 auto; } .page-content { margin: 0.75rem 0; } @media (min-width: 768px) { .page-content { margin: 1.5rem 0; } } .page-header { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; flex-direction: column; margin: 0 0 1.5rem; -ms-flex-wrap: wrap; flex-wrap: wrap; } .page-title { margin: 0; font-size: 1.5rem; font-weight: 400; line-height: 2.5rem; } .page-title__protection { display: flex; align-items: stretch; margin: 0 0.5rem; } @media (max-width: 767.98px) { .page-title__protection { margin: 0.5rem 0; } } .page-title-icon { color: #9aa0ac; font-size: 1.25rem; } .page-subtitle { font-size: 0.8125rem; color: #6e7687; margin-left: 2rem; } .page-subtitle a { color: inherit; } .page-options { margin-left: auto; } .page-breadcrumb { -ms-flex-preferred-size: 100%; flex-basis: 100%; } .page-description { margin: 0.25rem 0 0; color: #6e7687; } .page-description a { color: inherit; } .page-single { -ms-flex: 1 1 auto; flex: 1 1 auto; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; padding: 1rem 0; } .content-heading { font-weight: 400; margin: 2rem 0 1.5rem; font-size: 1.25rem; line-height: 1.25; } .content-heading:first-child { margin-top: 0; } .aside { position: fixed; top: 0; right: 0; bottom: 0; width: 22rem; background: #ffffff; border-left: 1px solid rgba(0, 40, 100, 0.12); display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; z-index: 100; visibility: hidden; box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.05); } @media (min-width: 1600px) { body.aside-opened .aside { visibility: visible; } } .aside-body { padding: 1.5rem; -ms-flex: 1 1 auto; flex: 1 1 auto; overflow: auto; } .aside-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(0, 40, 100, 0.12); } .aside-header { padding: 1rem 1.5rem; border-bottom: 1px solid rgba(0, 40, 100, 0.12); } .header { padding-top: 0.75rem; padding-bottom: 0.75rem; background: var(--header-bgcolor); border-bottom: 1px solid var(--border-color); } body.fixed-header .header { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; } @media print { .header { display: none; } } .header .dropdown-menu { margin-top: 0.75rem; } .nav-unread { position: absolute; top: 0.25rem; right: 0.25rem; background: #cd201f; width: 0.5rem; height: 0.5rem; border-radius: 50%; } .header-brand { color: inherit; margin-right: 1rem; font-size: 1.25rem; white-space: nowrap; font-weight: 600; padding: 0; transition: 0.3s opacity; line-height: 2rem; } .header-brand:hover { opacity: 0.8; color: inherit; text-decoration: none; } .header-brand-img { height: 2rem; line-height: 2rem; vertical-align: bottom; margin-right: 0.5rem; width: auto; } [data-theme='dark'] .header-brand-img { filter: invert(1); } .header-avatar { width: 2rem; height: 2rem; display: inline-block; vertical-align: bottom; border-radius: 50%; } .header-btn { display: inline-block; width: 2rem; height: 2rem; line-height: 2rem; text-align: center; font-size: 1rem; } .header-btn.has-new { position: relative; } .header-btn.has-new:before { content: ''; width: 6px; height: 6px; background: #cd201f; position: absolute; top: 4px; right: 4px; border-radius: 50%; } .header-toggler { width: 2rem; height: 2rem; position: relative; color: #9aa0ac; } .header-toggler:hover { color: #6e7687; } .header-toggler-icon { position: absolute; width: 1rem; height: 2px; color: inherit; background: currentColor; border-radius: 3px; top: 50%; left: 50%; margin: -2px 0 0 -0.5rem; box-shadow: 0 5px currentColor, 0 -5px currentColor; } .footer { background: var(--card-bgcolor); border-top: 1px solid var(--card-border-color); font-size: 0.875rem; padding: 1.25rem 0; color: #9aa0ac; position: relative; z-index: 102; } .footer a:not(.btn) { color: #6e7687; } @media print { .footer { display: none; } } .bg-blue-lightest { background-color: #edf2fa !important; } a.bg-blue-lightest:hover, a.bg-blue-lightest:focus, button.bg-blue-lightest:hover, button.bg-blue-lightest:focus { background-color: #c5d5ef !important; } .bg-blue-lighter { background-color: #c8d9f1 !important; } a.bg-blue-lighter:hover, a.bg-blue-lighter:focus, button.bg-blue-lighter:hover, button.bg-blue-lighter:focus { background-color: #9fbde7 !important; } .bg-blue-light { background-color: #7ea5dd !important; } a.bg-blue-light:hover, a.bg-blue-light:focus, button.bg-blue-light:hover, button.bg-blue-light:focus { background-color: #5689d2 !important; } .bg-blue-dark { background-color: #3866a6 !important; } a.bg-blue-dark:hover, a.bg-blue-dark:focus, button.bg-blue-dark:hover, button.bg-blue-dark:focus { background-color: #2b4f80 !important; } .bg-blue-darker { background-color: #1c3353 !important; } a.bg-blue-darker:hover, a.bg-blue-darker:focus, button.bg-blue-darker:hover, button.bg-blue-darker:focus { background-color: #0f1c2d !important; } .bg-blue-darkest { background-color: #0e1929 !important; } a.bg-blue-darkest:hover, a.bg-blue-darkest:focus, button.bg-blue-darkest:hover, button.bg-blue-darkest:focus { background-color: #010203 !important; } .bg-indigo-lightest { background-color: #f0f1fa !important; } a.bg-indigo-lightest:hover, a.bg-indigo-lightest:focus, button.bg-indigo-lightest:hover, button.bg-indigo-lightest:focus { background-color: #cacded !important; } .bg-indigo-lighter { background-color: #d1d5f0 !important; } a.bg-indigo-lighter:hover, a.bg-indigo-lighter:focus, button.bg-indigo-lighter:hover, button.bg-indigo-lighter:focus { background-color: #abb2e3 !important; } .bg-indigo-light { background-color: #939edc !important; } a.bg-indigo-light:hover, a.bg-indigo-light:focus, button.bg-indigo-light:hover, button.bg-indigo-light:focus { background-color: #6c7bd0 !important; } .bg-indigo-dark { background-color: #515da4 !important; } a.bg-indigo-dark:hover, a.bg-indigo-dark:focus, button.bg-indigo-dark:hover, button.bg-indigo-dark:focus { background-color: #404a82 !important; } .bg-indigo-darker { background-color: #282e52 !important; } a.bg-indigo-darker:hover, a.bg-indigo-darker:focus, button.bg-indigo-darker:hover, button.bg-indigo-darker:focus { background-color: #171b30 !important; } .bg-indigo-darkest { background-color: #141729 !important; } a.bg-indigo-darkest:hover, a.bg-indigo-darkest:focus, button.bg-indigo-darkest:hover, button.bg-indigo-darkest:focus { background-color: #030407 !important; } .bg-purple-lightest { background-color: #f6effd !important; } a.bg-purple-lightest:hover, a.bg-purple-lightest:focus, button.bg-purple-lightest:hover, button.bg-purple-lightest:focus { background-color: #ddc2f7 !important; } .bg-purple-lighter { background-color: #e4cff9 !important; } a.bg-purple-lighter:hover, a.bg-purple-lighter:focus, button.bg-purple-lighter:hover, button.bg-purple-lighter:focus { background-color: #cba2f3 !important; } .bg-purple-light { background-color: #c08ef0 !important; } a.bg-purple-light:hover, a.bg-purple-light:focus, button.bg-purple-light:hover, button.bg-purple-light:focus { background-color: #a761ea !important; } .bg-purple-dark { background-color: #844bbb !important; } a.bg-purple-dark:hover, a.bg-purple-dark:focus, button.bg-purple-dark:hover, button.bg-purple-dark:focus { background-color: #6a3a99 !important; } .bg-purple-darker { background-color: #42265e !important; } a.bg-purple-darker:hover, a.bg-purple-darker:focus, button.bg-purple-darker:hover, button.bg-purple-darker:focus { background-color: #29173a !important; } .bg-purple-darkest { background-color: #21132f !important; } a.bg-purple-darkest:hover, a.bg-purple-darkest:focus, button.bg-purple-darkest:hover, button.bg-purple-darkest:focus { background-color: #08040b !important; } .bg-pink-lightest { background-color: #fef0f5 !important; } a.bg-pink-lightest:hover, a.bg-pink-lightest:focus, button.bg-pink-lightest:hover, button.bg-pink-lightest:focus { background-color: #fbc0d5 !important; } .bg-pink-lighter { background-color: #fcd3e1 !important; } a.bg-pink-lighter:hover, a.bg-pink-lighter:focus, button.bg-pink-lighter:hover, button.bg-pink-lighter:focus { background-color: #f9a3c0 !important; } .bg-pink-light { background-color: #f999b9 !important; } a.bg-pink-light:hover, a.bg-pink-light:focus, button.bg-pink-light:hover, button.bg-pink-light:focus { background-color: #f66998 !important; } .bg-pink-dark { background-color: #c5577c !important; } a.bg-pink-dark:hover, a.bg-pink-dark:focus, button.bg-pink-dark:hover, button.bg-pink-dark:focus { background-color: #ad3c62 !important; } .bg-pink-darker { background-color: #622c3e !important; } a.bg-pink-darker:hover, a.bg-pink-darker:focus, button.bg-pink-darker:hover, button.bg-pink-darker:focus { background-color: #3f1c28 !important; } .bg-pink-darkest { background-color: #31161f !important; } a.bg-pink-darkest:hover, a.bg-pink-darkest:focus, button.bg-pink-darkest:hover, button.bg-pink-darkest:focus { background-color: #0e0609 !important; } .bg-red-lightest { background-color: #fae9e9 !important; } a.bg-red-lightest:hover, a.bg-red-lightest:focus, button.bg-red-lightest:hover, button.bg-red-lightest:focus { background-color: #f1bfbf !important; } .bg-red-lighter { background-color: #f0bcbc !important; } a.bg-red-lighter:hover, a.bg-red-lighter:focus, button.bg-red-lighter:hover, button.bg-red-lighter:focus { background-color: #e79292 !important; } .bg-red-light { background-color: #dc6362 !important; } a.bg-red-light:hover, a.bg-red-light:focus, button.bg-red-light:hover, button.bg-red-light:focus { background-color: #d33a38 !important; } .bg-red-dark { background-color: #a41a19 !important; } a.bg-red-dark:hover, a.bg-red-dark:focus, button.bg-red-dark:hover, button.bg-red-dark:focus { background-color: #781312 !important; } .bg-red-darker { background-color: #520d0c !important; } a.bg-red-darker:hover, a.bg-red-darker:focus, button.bg-red-darker:hover, button.bg-red-darker:focus { background-color: #260605 !important; } .bg-red-darkest { background-color: #290606 !important; } a.bg-red-darkest:hover, a.bg-red-darkest:focus, button.bg-red-darkest:hover, button.bg-red-darkest:focus { background-color: black !important; } .bg-orange-lightest { background-color: #fff5ec !important; } a.bg-orange-lightest:hover, a.bg-orange-lightest:focus, button.bg-orange-lightest:hover, button.bg-orange-lightest:focus { background-color: peachpuff !important; } .bg-orange-lighter { background-color: #fee0c7 !important; } a.bg-orange-lighter:hover, a.bg-orange-lighter:focus, button.bg-orange-lighter:hover, button.bg-orange-lighter:focus { background-color: #fdc495 !important; } .bg-orange-light { background-color: #feb67c !important; } a.bg-orange-light:hover, a.bg-orange-light:focus, button.bg-orange-light:hover, button.bg-orange-light:focus { background-color: #fe9a49 !important; } .bg-orange-dark { background-color: #ca7836 !important; } a.bg-orange-dark:hover, a.bg-orange-dark:focus, button.bg-orange-dark:hover, button.bg-orange-dark:focus { background-color: #a2602b !important; } .bg-orange-darker { background-color: #653c1b !important; } a.bg-orange-darker:hover, a.bg-orange-darker:focus, button.bg-orange-darker:hover, button.bg-orange-darker:focus { background-color: #3d2410 !important; } .bg-orange-darkest { background-color: #331e0e !important; } a.bg-orange-darkest:hover, a.bg-orange-darkest:focus, button.bg-orange-darkest:hover, button.bg-orange-darkest:focus { background-color: #0b0603 !important; } .bg-yellow-lightest { background-color: #fef9e7 !important; } a.bg-yellow-lightest:hover, a.bg-yellow-lightest:focus, button.bg-yellow-lightest:hover, button.bg-yellow-lightest:focus { background-color: #fcedb6 !important; } .bg-yellow-lighter { background-color: #fbedb7 !important; } a.bg-yellow-lighter:hover, a.bg-yellow-lighter:focus, button.bg-yellow-lighter:hover, button.bg-yellow-lighter:focus { background-color: #f8e187 !important; } .bg-yellow-light { background-color: #f5d657 !important; } a.bg-yellow-light:hover, a.bg-yellow-light:focus, button.bg-yellow-light:hover, button.bg-yellow-light:focus { background-color: #f2ca27 !important; } .bg-yellow-dark { background-color: #c19d0c !important; } a.bg-yellow-dark:hover, a.bg-yellow-dark:focus, button.bg-yellow-dark:hover, button.bg-yellow-dark:focus { background-color: #917609 !important; } .bg-yellow-darker { background-color: #604e06 !important; } a.bg-yellow-darker:hover, a.bg-yellow-darker:focus, button.bg-yellow-darker:hover, button.bg-yellow-darker:focus { background-color: #302703 !important; } .bg-yellow-darkest { background-color: #302703 !important; } a.bg-yellow-darkest:hover, a.bg-yellow-darkest:focus, button.bg-yellow-darkest:hover, button.bg-yellow-darkest:focus { background-color: black !important; } .bg-green-lightest { background-color: #eff8e6 !important; } a.bg-green-lightest:hover, a.bg-green-lightest:focus, button.bg-green-lightest:hover, button.bg-green-lightest:focus { background-color: #d6edbe !important; } .bg-green-lighter { background-color: #cfeab3 !important; } a.bg-green-lighter:hover, a.bg-green-lighter:focus, button.bg-green-lighter:hover, button.bg-green-lighter:focus { background-color: #b6df8b !important; } .bg-green-light { background-color: #8ecf4d !important; } a.bg-green-light:hover, a.bg-green-light:focus, button.bg-green-light:hover, button.bg-green-light:focus { background-color: #75b831 !important; } .bg-green-dark { background-color: #4b9500 !important; } a.bg-green-dark:hover, a.bg-green-dark:focus, button.bg-green-dark:hover, button.bg-green-dark:focus { background-color: #316200 !important; } .bg-green-darker { background-color: #264a00 !important; } a.bg-green-darker:hover, a.bg-green-darker:focus, button.bg-green-darker:hover, button.bg-green-darker:focus { background-color: #0c1700 !important; } .bg-green-darkest { background-color: #132500 !important; } a.bg-green-darkest:hover, a.bg-green-darkest:focus, button.bg-green-darkest:hover, button.bg-green-darkest:focus { background-color: black !important; } .bg-teal-lightest { background-color: #eafaf8 !important; } a.bg-teal-lightest:hover, a.bg-teal-lightest:focus, button.bg-teal-lightest:hover, button.bg-teal-lightest:focus { background-color: #c1f0ea !important; } .bg-teal-lighter { background-color: #bfefea !important; } a.bg-teal-lighter:hover, a.bg-teal-lighter:focus, button.bg-teal-lighter:hover, button.bg-teal-lighter:focus { background-color: #96e5dd !important; } .bg-teal-light { background-color: #6bdbcf !important; } a.bg-teal-light:hover, a.bg-teal-light:focus, button.bg-teal-light:hover, button.bg-teal-light:focus { background-color: #42d1c2 !important; } .bg-teal-dark { background-color: #22a295 !important; } a.bg-teal-dark:hover, a.bg-teal-dark:focus, button.bg-teal-dark:hover, button.bg-teal-dark:focus { background-color: #19786e !important; } .bg-teal-darker { background-color: #11514a !important; } a.bg-teal-darker:hover, a.bg-teal-darker:focus, button.bg-teal-darker:hover, button.bg-teal-darker:focus { background-color: #082723 !important; } .bg-teal-darkest { background-color: #092925 !important; } a.bg-teal-darkest:hover, a.bg-teal-darkest:focus, button.bg-teal-darkest:hover, button.bg-teal-darkest:focus { background-color: black !important; } .bg-cyan-lightest { background-color: #e8f6f8 !important; } a.bg-cyan-lightest:hover, a.bg-cyan-lightest:focus, button.bg-cyan-lightest:hover, button.bg-cyan-lightest:focus { background-color: #c1e7ec !important; } .bg-cyan-lighter { background-color: #b9e3ea !important; } a.bg-cyan-lighter:hover, a.bg-cyan-lighter:focus, button.bg-cyan-lighter:hover, button.bg-cyan-lighter:focus { background-color: #92d3de !important; } .bg-cyan-light { background-color: #5dbecd !important; } a.bg-cyan-light:hover, a.bg-cyan-light:focus, button.bg-cyan-light:hover, button.bg-cyan-light:focus { background-color: #3aabbd !important; } .bg-cyan-dark { background-color: #128293 !important; } a.bg-cyan-dark:hover, a.bg-cyan-dark:focus, button.bg-cyan-dark:hover, button.bg-cyan-dark:focus { background-color: #0c5a66 !important; } .bg-cyan-darker { background-color: #09414a !important; } a.bg-cyan-darker:hover, a.bg-cyan-darker:focus, button.bg-cyan-darker:hover, button.bg-cyan-darker:focus { background-color: #03191d !important; } .bg-cyan-darkest { background-color: #052025 !important; } a.bg-cyan-darkest:hover, a.bg-cyan-darkest:focus, button.bg-cyan-darkest:hover, button.bg-cyan-darkest:focus { background-color: black !important; } .bg-white-lightest { background-color: white !important; } a.bg-white-lightest:hover, a.bg-white-lightest:focus, button.bg-white-lightest:hover, button.bg-white-lightest:focus { background-color: #e6e5e5 !important; } .bg-white-lighter { background-color: white !important; } a.bg-white-lighter:hover, a.bg-white-lighter:focus, button.bg-white-lighter:hover, button.bg-white-lighter:focus { background-color: #e6e5e5 !important; } .bg-white-light { background-color: white !important; } a.bg-white-light:hover, a.bg-white-light:focus, button.bg-white-light:hover, button.bg-white-light:focus { background-color: #e6e5e5 !important; } .bg-white-dark { background-color: #cccccc !important; } a.bg-white-dark:hover, a.bg-white-dark:focus, button.bg-white-dark:hover, button.bg-white-dark:focus { background-color: #b3b2b2 !important; } .bg-white-darker { background-color: #666666 !important; } a.bg-white-darker:hover, a.bg-white-darker:focus, button.bg-white-darker:hover, button.bg-white-darker:focus { background-color: #4d4c4c !important; } .bg-white-darkest { background-color: #333333 !important; } a.bg-white-darkest:hover, a.bg-white-darkest:focus, button.bg-white-darkest:hover, button.bg-white-darkest:focus { background-color: #1a1919 !important; } .bg-gray-lightest { background-color: #f3f4f5 !important; } a.bg-gray-lightest:hover, a.bg-gray-lightest:focus, button.bg-gray-lightest:hover, button.bg-gray-lightest:focus { background-color: #d7dbde !important; } .bg-gray-lighter { background-color: #dbdde0 !important; } a.bg-gray-lighter:hover, a.bg-gray-lighter:focus, button.bg-gray-lighter:hover, button.bg-gray-lighter:focus { background-color: #c0c3c8 !important; } .bg-gray-light { background-color: #aab0b6 !important; } a.bg-gray-light:hover, a.bg-gray-light:focus, button.bg-gray-light:hover, button.bg-gray-light:focus { background-color: #8f979e !important; } .bg-gray-dark { background-color: #6b7278 !important; } a.bg-gray-dark:hover, a.bg-gray-dark:focus, button.bg-gray-dark:hover, button.bg-gray-dark:focus { background-color: #53585d !important; } .bg-gray-darker { background-color: #36393c !important; } a.bg-gray-darker:hover, a.bg-gray-darker:focus, button.bg-gray-darker:hover, button.bg-gray-darker:focus { background-color: #1e2021 !important; } .bg-gray-darkest { background-color: #1b1c1e !important; } a.bg-gray-darkest:hover, a.bg-gray-darkest:focus, button.bg-gray-darkest:hover, button.bg-gray-darkest:focus { background-color: #030303 !important; } .bg-gray-dark-lightest { background-color: #ebebec !important; } a.bg-gray-dark-lightest:hover, a.bg-gray-dark-lightest:focus, button.bg-gray-dark-lightest:hover, button.bg-gray-dark-lightest:focus { background-color: #d1d1d3 !important; } .bg-gray-dark-lighter { background-color: #c2c4c6 !important; } a.bg-gray-dark-lighter:hover, a.bg-gray-dark-lighter:focus, button.bg-gray-dark-lighter:hover, button.bg-gray-dark-lighter:focus { background-color: #a8abad !important; } .bg-gray-dark-light { background-color: #717579 !important; } a.bg-gray-dark-light:hover, a.bg-gray-dark-light:focus, button.bg-gray-dark-light:hover, button.bg-gray-dark-light:focus { background-color: #585c5f !important; } .bg-gray-dark-dark { background-color: #2a2e33 !important; } a.bg-gray-dark-dark:hover, a.bg-gray-dark-dark:focus, button.bg-gray-dark-dark:hover, button.bg-gray-dark-dark:focus { background-color: #131517 !important; } .bg-gray-dark-darker { background-color: #15171a !important; } a.bg-gray-dark-darker:hover, a.bg-gray-dark-darker:focus, button.bg-gray-dark-darker:hover, button.bg-gray-dark-darker:focus { background-color: black !important; } .bg-gray-dark-darkest { background-color: #0a0c0d !important; } a.bg-gray-dark-darkest:hover, a.bg-gray-dark-darkest:focus, button.bg-gray-dark-darkest:hover, button.bg-gray-dark-darkest:focus { background-color: black !important; } .bg-azure-lightest { background-color: #ecf7fe !important; } a.bg-azure-lightest:hover, a.bg-azure-lightest:focus, button.bg-azure-lightest:hover, button.bg-azure-lightest:focus { background-color: #bce3fb !important; } .bg-azure-lighter { background-color: #c7e6fb !important; } a.bg-azure-lighter:hover, a.bg-azure-lighter:focus, button.bg-azure-lighter:hover, button.bg-azure-lighter:focus { background-color: #97d1f8 !important; } .bg-azure-light { background-color: #7dc4f6 !important; } a.bg-azure-light:hover, a.bg-azure-light:focus, button.bg-azure-light:hover, button.bg-azure-light:focus { background-color: #4daef3 !important; } .bg-azure-dark { background-color: #3788c2 !important; } a.bg-azure-dark:hover, a.bg-azure-dark:focus, button.bg-azure-dark:hover, button.bg-azure-dark:focus { background-color: #2c6c9a !important; } .bg-azure-darker { background-color: #1c4461 !important; } a.bg-azure-darker:hover, a.bg-azure-darker:focus, button.bg-azure-darker:hover, button.bg-azure-darker:focus { background-color: #112839 !important; } .bg-azure-darkest { background-color: #0e2230 !important; } a.bg-azure-darkest:hover, a.bg-azure-darkest:focus, button.bg-azure-darkest:hover, button.bg-azure-darkest:focus { background-color: #020609 !important; } .bg-lime-lightest { background-color: #f2fbeb !important; } a.bg-lime-lightest:hover, a.bg-lime-lightest:focus, button.bg-lime-lightest:hover, button.bg-lime-lightest:focus { background-color: #d6f3c1 !important; } .bg-lime-lighter { background-color: #d7f2c2 !important; } a.bg-lime-lighter:hover, a.bg-lime-lighter:focus, button.bg-lime-lighter:hover, button.bg-lime-lighter:focus { background-color: #bbe998 !important; } .bg-lime-light { background-color: #a3e072 !important; } a.bg-lime-light:hover, a.bg-lime-light:focus, button.bg-lime-light:hover, button.bg-lime-light:focus { background-color: #88d748 !important; } .bg-lime-dark { background-color: #62a82a !important; } a.bg-lime-dark:hover, a.bg-lime-dark:focus, button.bg-lime-dark:hover, button.bg-lime-dark:focus { background-color: #4a7f20 !important; } .bg-lime-darker { background-color: #315415 !important; } a.bg-lime-darker:hover, a.bg-lime-darker:focus, button.bg-lime-darker:hover, button.bg-lime-darker:focus { background-color: #192b0b !important; } .bg-lime-darkest { background-color: #192a0b !important; } a.bg-lime-darkest:hover, a.bg-lime-darkest:focus, button.bg-lime-darkest:hover, button.bg-lime-darkest:focus { background-color: #010200 !important; } .display-1 i, .display-2 i, .display-3 i, .display-4 i { vertical-align: baseline; font-size: 0.815em; } .text-inherit { color: inherit !important; } .text-default { color: #495057 !important; } .text-muted-dark { color: #6e7687 !important; } .tracking-tight { letter-spacing: -0.05em !important; } .tracking-normal { letter-spacing: 0 !important; } .tracking-wide { letter-spacing: 0.05em !important; } .leading-none { line-height: 1 !important; } .leading-tight { line-height: 1.25 !important; } .leading-normal { line-height: 1.5 !important; } .leading-loose { line-height: 2 !important; } .bg-blue { background-color: #467fcf !important; } a.bg-blue:hover, a.bg-blue:focus, button.bg-blue:hover, button.bg-blue:focus { background-color: #2f66b3 !important; } .text-blue { color: #467fcf !important; } .bg-indigo { background-color: #6574cd !important; } a.bg-indigo:hover, a.bg-indigo:focus, button.bg-indigo:hover, button.bg-indigo:focus { background-color: #3f51c1 !important; } .text-indigo { color: #6574cd !important; } .bg-purple { background-color: #a55eea !important; } a.bg-purple:hover, a.bg-purple:focus, button.bg-purple:hover, button.bg-purple:focus { background-color: #8c31e4 !important; } .text-purple { color: #a55eea !important; } .bg-pink { background-color: #f66d9b !important; } a.bg-pink:hover, a.bg-pink:focus, button.bg-pink:hover, button.bg-pink:focus { background-color: #f33d7a !important; } .text-pink { color: #f66d9b !important; } .bg-red { background-color: #cd201f !important; } a.bg-red:hover, a.bg-red:focus, button.bg-red:hover, button.bg-red:focus { background-color: #a11918 !important; } .text-red { color: #cd201f !important; } .bg-orange { background-color: #fd9644 !important; } a.bg-orange:hover, a.bg-orange:focus, button.bg-orange:hover, button.bg-orange:focus { background-color: #fc7a12 !important; } .text-orange { color: #fd9644 !important; } .bg-yellow { background-color: #f1c40f !important; } a.bg-yellow:hover, a.bg-yellow:focus, button.bg-yellow:hover, button.bg-yellow:focus { background-color: #c29d0b !important; } .text-yellow { color: #f1c40f !important; } .bg-green { background-color: #5eba00 !important; } a.bg-green:hover, a.bg-green:focus, button.bg-green:hover, button.bg-green:focus { background-color: #448700 !important; } .text-green { color: #5eba00 !important; } .bg-teal { background-color: #2bcbba !important; } a.bg-teal:hover, a.bg-teal:focus, button.bg-teal:hover, button.bg-teal:focus { background-color: #22a193 !important; } .text-teal { color: #2bcbba !important; } .bg-cyan { background-color: #17a2b8 !important; } a.bg-cyan:hover, a.bg-cyan:focus, button.bg-cyan:hover, button.bg-cyan:focus { background-color: #117a8b !important; } .text-cyan { color: #17a2b8 !important; } .bg-white { background-color: #fff !important; } a.bg-white:hover, a.bg-white:focus, button.bg-white:hover, button.bg-white:focus { background-color: #e6e5e5 !important; } .text-white { color: #fff !important; } .bg-gray { background-color: #868e96 !important; } a.bg-gray:hover, a.bg-gray:focus, button.bg-gray:hover, button.bg-gray:focus { background-color: #6c757d !important; } .text-gray { color: #868e96 !important; } .bg-gray-dark { background-color: #343a40 !important; } a.bg-gray-dark:hover, a.bg-gray-dark:focus, button.bg-gray-dark:hover, button.bg-gray-dark:focus { background-color: #1d2124 !important; } .text-gray-dark { color: #343a40 !important; } .bg-azure { background-color: #45aaf2 !important; } a.bg-azure:hover, a.bg-azure:focus, button.bg-azure:hover, button.bg-azure:focus { background-color: #1594ef !important; } .text-azure { color: #45aaf2 !important; } .bg-lime { background-color: #7bd235 !important; } a.bg-lime:hover, a.bg-lime:focus, button.bg-lime:hover, button.bg-lime:focus { background-color: #63ad27 !important; } .text-lime { color: #7bd235 !important; } .icon { color: #9aa0ac !important; } .icon i { vertical-align: -1px; } a.icon { text-decoration: none; cursor: pointer; } a.icon:hover { color: #495057 !important; } .o-auto { overflow: auto !important; } .o-hidden { overflow: hidden !important; } .shadow { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; } .shadow-none { box-shadow: none !important; } .nav-link, .nav-item { padding: 0 0.75rem; min-width: 2rem; transition: 0.3s color; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; } .nav-link .badge, .nav-item .badge { position: absolute; top: 0; right: 0; padding: 0.2rem 0.25rem; min-width: 1rem; } .nav-tabs { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; color: #9aa0ac; margin: 0 -0.75rem; } .nav-tabs .nav-link { border: 0; color: inherit; border-bottom: 1px solid transparent; margin-bottom: -1px; transition: 0.3s border-color; font-weight: 400; padding: 1rem 0; } .nav-tabs .nav-link:hover:not(.disabled) { border-color: #6e7687; color: #6e7687; } .nav-tabs .nav-link.active { border-color: #467fcf; color: #467fcf; background: transparent; } .nav-tabs .nav-link.disabled { opacity: 0.4; cursor: default; pointer-events: none; } .nav-tabs .nav-item { margin-bottom: 0; position: relative; } .nav-tabs .nav-item i { margin-right: 0.25rem; line-height: 1; font-size: 0.875rem; width: 0.875rem; vertical-align: baseline; display: inline-block; } .nav-tabs .nav-item:hover .nav-submenu { display: block; } .nav-tabs .nav-submenu { display: none; position: absolute; background: #fff; border: 1px solid rgba(0, 40, 100, 0.12); border-top: none; z-index: 10; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); min-width: 10rem; border-radius: 0 0 3px 3px; } .nav-tabs .nav-submenu .nav-item { display: block; padding: 0.5rem 1rem; color: #9aa0ac; margin: 0 !important; cursor: pointer; transition: 0.3s background; } .nav-tabs .nav-submenu .nav-item.active { color: #467fcf; } .nav-tabs .nav-submenu .nav-item:hover { color: #6e7687; text-decoration: none; background: rgba(0, 0, 0, 0.024); } .btn { cursor: pointer; font-weight: 600; letter-spacing: 0.03em; font-size: 0.8125rem; min-width: 2.375rem; } .btn i { font-size: 1rem; vertical-align: -2px; } .btn-icon { padding-left: 0.5rem; padding-right: 0.5rem; text-align: center; } .btn-secondary { color: #495057; background-color: #fff; border-color: rgba(0, 40, 100, 0.12); box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.05); } .btn-secondary:hover { color: #495057; background-color: #f6f6f6; border-color: rgba(0, 20, 49, 0.12); } .btn-secondary:focus, .btn-secondary.focus { box-shadow: 0 0 0 2px rgba(0, 40, 100, 0.5); } .btn-secondary.disabled, .btn-secondary:disabled { color: #495057; background-color: #fff; border-color: rgba(0, 40, 100, 0.12); } .btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle { color: #495057; background-color: #e6e5e5; border-color: rgba(0, 15, 36, 0.12); } .btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(0, 40, 100, 0.5); } .btn-pill { border-radius: 10rem; padding-left: 1.5em; padding-right: 1.5em; } .btn-square { border-radius: 0; } .btn-facebook { color: #fff; background-color: #3b5998; border-color: #3b5998; } .btn-facebook:hover { color: #fff; background-color: #30497c; border-color: #2d4373; } .btn-facebook:focus, .btn-facebook.focus { box-shadow: 0 0 0 2px rgba(59, 89, 152, 0.5); } .btn-facebook.disabled, .btn-facebook:disabled { color: #fff; background-color: #3b5998; border-color: #3b5998; } .btn-facebook:not(:disabled):not(.disabled):active, .btn-facebook:not(:disabled):not(.disabled).active, .show > .btn-facebook.dropdown-toggle { color: #fff; background-color: #2d4373; border-color: #293e6a; } .btn-facebook:not(:disabled):not(.disabled):active:focus, .btn-facebook:not(:disabled):not(.disabled).active:focus, .show > .btn-facebook.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(59, 89, 152, 0.5); } .btn-twitter { color: #fff; background-color: #1da1f2; border-color: #1da1f2; } .btn-twitter:hover { color: #fff; background-color: #0d8ddc; border-color: #0c85d0; } .btn-twitter:focus, .btn-twitter.focus { box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.5); } .btn-twitter.disabled, .btn-twitter:disabled { color: #fff; background-color: #1da1f2; border-color: #1da1f2; } .btn-twitter:not(:disabled):not(.disabled):active, .btn-twitter:not(:disabled):not(.disabled).active, .show > .btn-twitter.dropdown-toggle { color: #fff; background-color: #0c85d0; border-color: #0b7ec4; } .btn-twitter:not(:disabled):not(.disabled):active:focus, .btn-twitter:not(:disabled):not(.disabled).active:focus, .show > .btn-twitter.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.5); } .btn-google { color: #fff; background-color: #dc4e41; border-color: #dc4e41; } .btn-google:hover { color: #fff; background-color: #d03526; border-color: #c63224; } .btn-google:focus, .btn-google.focus { box-shadow: 0 0 0 2px rgba(220, 78, 65, 0.5); } .btn-google.disabled, .btn-google:disabled { color: #fff; background-color: #dc4e41; border-color: #dc4e41; } .btn-google:not(:disabled):not(.disabled):active, .btn-google:not(:disabled):not(.disabled).active, .show > .btn-google.dropdown-toggle { color: #fff; background-color: #c63224; border-color: #bb2f22; } .btn-google:not(:disabled):not(.disabled):active:focus, .btn-google:not(:disabled):not(.disabled).active:focus, .show > .btn-google.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(220, 78, 65, 0.5); } .btn-youtube { color: #fff; background-color: #f00; border-color: #f00; } .btn-youtube:hover { color: #fff; background-color: #d90000; border-color: #cc0000; } .btn-youtube:focus, .btn-youtube.focus { box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5); } .btn-youtube.disabled, .btn-youtube:disabled { color: #fff; background-color: #f00; border-color: #f00; } .btn-youtube:not(:disabled):not(.disabled):active, .btn-youtube:not(:disabled):not(.disabled).active, .show > .btn-youtube.dropdown-toggle { color: #fff; background-color: #cc0000; border-color: #bf0000; } .btn-youtube:not(:disabled):not(.disabled):active:focus, .btn-youtube:not(:disabled):not(.disabled).active:focus, .show > .btn-youtube.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5); } .btn-vimeo { color: #fff; background-color: #1ab7ea; border-color: #1ab7ea; } .btn-vimeo:hover { color: #fff; background-color: #139ecb; border-color: #1295bf; } .btn-vimeo:focus, .btn-vimeo.focus { box-shadow: 0 0 0 2px rgba(26, 183, 234, 0.5); } .btn-vimeo.disabled, .btn-vimeo:disabled { color: #fff; background-color: #1ab7ea; border-color: #1ab7ea; } .btn-vimeo:not(:disabled):not(.disabled):active, .btn-vimeo:not(:disabled):not(.disabled).active, .show > .btn-vimeo.dropdown-toggle { color: #fff; background-color: #1295bf; border-color: #108cb4; } .btn-vimeo:not(:disabled):not(.disabled):active:focus, .btn-vimeo:not(:disabled):not(.disabled).active:focus, .show > .btn-vimeo.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(26, 183, 234, 0.5); } .btn-dribbble { color: #fff; background-color: #ea4c89; border-color: #ea4c89; } .btn-dribbble:hover { color: #fff; background-color: #e62a72; border-color: #e51e6b; } .btn-dribbble:focus, .btn-dribbble.focus { box-shadow: 0 0 0 2px rgba(234, 76, 137, 0.5); } .btn-dribbble.disabled, .btn-dribbble:disabled { color: #fff; background-color: #ea4c89; border-color: #ea4c89; } .btn-dribbble:not(:disabled):not(.disabled):active, .btn-dribbble:not(:disabled):not(.disabled).active, .show > .btn-dribbble.dropdown-toggle { color: #fff; background-color: #e51e6b; border-color: #dc1a65; } .btn-dribbble:not(:disabled):not(.disabled):active:focus, .btn-dribbble:not(:disabled):not(.disabled).active:focus, .show > .btn-dribbble.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(234, 76, 137, 0.5); } .btn-github { color: #fff; background-color: #181717; border-color: #181717; } .btn-github:hover { color: #fff; background-color: #040404; border-color: black; } .btn-github:focus, .btn-github.focus { box-shadow: 0 0 0 2px rgba(24, 23, 23, 0.5); } .btn-github.disabled, .btn-github:disabled { color: #fff; background-color: #181717; border-color: #181717; } .btn-github:not(:disabled):not(.disabled):active, .btn-github:not(:disabled):not(.disabled).active, .show > .btn-github.dropdown-toggle { color: #fff; background-color: black; border-color: black; } .btn-github:not(:disabled):not(.disabled):active:focus, .btn-github:not(:disabled):not(.disabled).active:focus, .show > .btn-github.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(24, 23, 23, 0.5); } .btn-instagram { color: #fff; background-color: #e4405f; border-color: #e4405f; } .btn-instagram:hover { color: #fff; background-color: #de1f44; border-color: #d31e40; } .btn-instagram:focus, .btn-instagram.focus { box-shadow: 0 0 0 2px rgba(228, 64, 95, 0.5); } .btn-instagram.disabled, .btn-instagram:disabled { color: #fff; background-color: #e4405f; border-color: #e4405f; } .btn-instagram:not(:disabled):not(.disabled):active, .btn-instagram:not(:disabled):not(.disabled).active, .show > .btn-instagram.dropdown-toggle { color: #fff; background-color: #d31e40; border-color: #c81c3d; } .btn-instagram:not(:disabled):not(.disabled):active:focus, .btn-instagram:not(:disabled):not(.disabled).active:focus, .show > .btn-instagram.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(228, 64, 95, 0.5); } .btn-pinterest { color: #fff; background-color: #bd081c; border-color: #bd081c; } .btn-pinterest:hover { color: #fff; background-color: #980617; border-color: #8c0615; } .btn-pinterest:focus, .btn-pinterest.focus { box-shadow: 0 0 0 2px rgba(189, 8, 28, 0.5); } .btn-pinterest.disabled, .btn-pinterest:disabled { color: #fff; background-color: #bd081c; border-color: #bd081c; } .btn-pinterest:not(:disabled):not(.disabled):active, .btn-pinterest:not(:disabled):not(.disabled).active, .show > .btn-pinterest.dropdown-toggle { color: #fff; background-color: #8c0615; border-color: #800513; } .btn-pinterest:not(:disabled):not(.disabled):active:focus, .btn-pinterest:not(:disabled):not(.disabled).active:focus, .show > .btn-pinterest.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(189, 8, 28, 0.5); } .btn-vk { color: #fff; background-color: #6383a8; border-color: #6383a8; } .btn-vk:hover { color: #fff; background-color: #527093; border-color: #4d6a8b; } .btn-vk:focus, .btn-vk.focus { box-shadow: 0 0 0 2px rgba(99, 131, 168, 0.5); } .btn-vk.disabled, .btn-vk:disabled { color: #fff; background-color: #6383a8; border-color: #6383a8; } .btn-vk:not(:disabled):not(.disabled):active, .btn-vk:not(:disabled):not(.disabled).active, .show > .btn-vk.dropdown-toggle { color: #fff; background-color: #4d6a8b; border-color: #496482; } .btn-vk:not(:disabled):not(.disabled):active:focus, .btn-vk:not(:disabled):not(.disabled).active:focus, .show > .btn-vk.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(99, 131, 168, 0.5); } .btn-rss { color: #fff; background-color: #ffa500; border-color: #ffa500; } .btn-rss:hover { color: #fff; background-color: #d98c00; border-color: #cc8400; } .btn-rss:focus, .btn-rss.focus { box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.5); } .btn-rss.disabled, .btn-rss:disabled { color: #fff; background-color: #ffa500; border-color: #ffa500; } .btn-rss:not(:disabled):not(.disabled):active, .btn-rss:not(:disabled):not(.disabled).active, .show > .btn-rss.dropdown-toggle { color: #fff; background-color: #cc8400; border-color: #bf7c00; } .btn-rss:not(:disabled):not(.disabled):active:focus, .btn-rss:not(:disabled):not(.disabled).active:focus, .show > .btn-rss.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.5); } .btn-flickr { color: #fff; background-color: #0063dc; border-color: #0063dc; } .btn-flickr:hover { color: #fff; background-color: #0052b6; border-color: #004ca9; } .btn-flickr:focus, .btn-flickr.focus { box-shadow: 0 0 0 2px rgba(0, 99, 220, 0.5); } .btn-flickr.disabled, .btn-flickr:disabled { color: #fff; background-color: #0063dc; border-color: #0063dc; } .btn-flickr:not(:disabled):not(.disabled):active, .btn-flickr:not(:disabled):not(.disabled).active, .show > .btn-flickr.dropdown-toggle { color: #fff; background-color: #004ca9; border-color: #00469c; } .btn-flickr:not(:disabled):not(.disabled):active:focus, .btn-flickr:not(:disabled):not(.disabled).active:focus, .show > .btn-flickr.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(0, 99, 220, 0.5); } .btn-bitbucket { color: #fff; background-color: #0052cc; border-color: #0052cc; } .btn-bitbucket:hover { color: #fff; background-color: #0043a6; border-color: #003e99; } .btn-bitbucket:focus, .btn-bitbucket.focus { box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.5); } .btn-bitbucket.disabled, .btn-bitbucket:disabled { color: #fff; background-color: #0052cc; border-color: #0052cc; } .btn-bitbucket:not(:disabled):not(.disabled):active, .btn-bitbucket:not(:disabled):not(.disabled).active, .show > .btn-bitbucket.dropdown-toggle { color: #fff; background-color: #003e99; border-color: #00388c; } .btn-bitbucket:not(:disabled):not(.disabled):active:focus, .btn-bitbucket:not(:disabled):not(.disabled).active:focus, .show > .btn-bitbucket.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.5); } .btn-blue { color: #fff; background-color: #467fcf; border-color: #467fcf; } .btn-blue:hover { color: #fff; background-color: #316cbe; border-color: #2f66b3; } .btn-blue:focus, .btn-blue.focus { box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.5); } .btn-blue.disabled, .btn-blue:disabled { color: #fff; background-color: #467fcf; border-color: #467fcf; } .btn-blue:not(:disabled):not(.disabled):active, .btn-blue:not(:disabled):not(.disabled).active, .show > .btn-blue.dropdown-toggle { color: #fff; background-color: #2f66b3; border-color: #2c60a9; } .btn-blue:not(:disabled):not(.disabled):active:focus, .btn-blue:not(:disabled):not(.disabled).active:focus, .show > .btn-blue.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.5); } .btn-indigo { color: #fff; background-color: #6574cd; border-color: #6574cd; } .btn-indigo:hover { color: #fff; background-color: #485ac4; border-color: #3f51c1; } .btn-indigo:focus, .btn-indigo.focus { box-shadow: 0 0 0 2px rgba(101, 116, 205, 0.5); } .btn-indigo.disabled, .btn-indigo:disabled { color: #fff; background-color: #6574cd; border-color: #6574cd; } .btn-indigo:not(:disabled):not(.disabled):active, .btn-indigo:not(:disabled):not(.disabled).active, .show > .btn-indigo.dropdown-toggle { color: #fff; background-color: #3f51c1; border-color: #3b4db7; } .btn-indigo:not(:disabled):not(.disabled):active:focus, .btn-indigo:not(:disabled):not(.disabled).active:focus, .show > .btn-indigo.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(101, 116, 205, 0.5); } .btn-purple { color: #fff; background-color: #a55eea; border-color: #a55eea; } .btn-purple:hover { color: #fff; background-color: #923ce6; border-color: #8c31e4; } .btn-purple:focus, .btn-purple.focus { box-shadow: 0 0 0 2px rgba(165, 94, 234, 0.5); } .btn-purple.disabled, .btn-purple:disabled { color: #fff; background-color: #a55eea; border-color: #a55eea; } .btn-purple:not(:disabled):not(.disabled):active, .btn-purple:not(:disabled):not(.disabled).active, .show > .btn-purple.dropdown-toggle { color: #fff; background-color: #8c31e4; border-color: #8526e3; } .btn-purple:not(:disabled):not(.disabled):active:focus, .btn-purple:not(:disabled):not(.disabled).active:focus, .show > .btn-purple.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(165, 94, 234, 0.5); } .btn-pink { color: #fff; background-color: #f66d9b; border-color: #f66d9b; } .btn-pink:hover { color: #fff; background-color: #f44982; border-color: #f33d7a; } .btn-pink:focus, .btn-pink.focus { box-shadow: 0 0 0 2px rgba(246, 109, 155, 0.5); } .btn-pink.disabled, .btn-pink:disabled { color: #fff; background-color: #f66d9b; border-color: #f66d9b; } .btn-pink:not(:disabled):not(.disabled):active, .btn-pink:not(:disabled):not(.disabled).active, .show > .btn-pink.dropdown-toggle { color: #fff; background-color: #f33d7a; border-color: #f23172; } .btn-pink:not(:disabled):not(.disabled):active:focus, .btn-pink:not(:disabled):not(.disabled).active:focus, .show > .btn-pink.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(246, 109, 155, 0.5); } .btn-red { color: #fff; background-color: #cd201f; border-color: #cd201f; } .btn-red:hover { color: #fff; background-color: #ac1b1a; border-color: #a11918; } .btn-red:focus, .btn-red.focus { box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.5); } .btn-red.disabled, .btn-red:disabled { color: #fff; background-color: #cd201f; border-color: #cd201f; } .btn-red:not(:disabled):not(.disabled):active, .btn-red:not(:disabled):not(.disabled).active, .show > .btn-red.dropdown-toggle { color: #fff; background-color: #a11918; border-color: #961717; } .btn-red:not(:disabled):not(.disabled):active:focus, .btn-red:not(:disabled):not(.disabled).active:focus, .show > .btn-red.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(205, 32, 31, 0.5); } .btn-orange { color: #fff; background-color: #fd9644; border-color: #fd9644; } .btn-orange:hover { color: #fff; background-color: #fd811e; border-color: #fc7a12; } .btn-orange:focus, .btn-orange.focus { box-shadow: 0 0 0 2px rgba(253, 150, 68, 0.5); } .btn-orange.disabled, .btn-orange:disabled { color: #fff; background-color: #fd9644; border-color: #fd9644; } .btn-orange:not(:disabled):not(.disabled):active, .btn-orange:not(:disabled):not(.disabled).active, .show > .btn-orange.dropdown-toggle { color: #fff; background-color: #fc7a12; border-color: #fc7305; } .btn-orange:not(:disabled):not(.disabled):active:focus, .btn-orange:not(:disabled):not(.disabled).active:focus, .show > .btn-orange.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(253, 150, 68, 0.5); } .btn-yellow { color: #fff; background-color: #f1c40f; border-color: #f1c40f; } .btn-yellow:hover { color: #fff; background-color: #cea70c; border-color: #c29d0b; } .btn-yellow:focus, .btn-yellow.focus { box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5); } .btn-yellow.disabled, .btn-yellow:disabled { color: #fff; background-color: #f1c40f; border-color: #f1c40f; } .btn-yellow:not(:disabled):not(.disabled):active, .btn-yellow:not(:disabled):not(.disabled).active, .show > .btn-yellow.dropdown-toggle { color: #fff; background-color: #c29d0b; border-color: #b6940b; } .btn-yellow:not(:disabled):not(.disabled):active:focus, .btn-yellow:not(:disabled):not(.disabled).active:focus, .show > .btn-yellow.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.5); } .btn-green { color: #fff; background-color: #5eba00; border-color: #5eba00; } .btn-green:hover { color: #fff; background-color: #4b9400; border-color: #448700; } .btn-green:focus, .btn-green.focus { box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.5); } .btn-green.disabled, .btn-green:disabled { color: #fff; background-color: #5eba00; border-color: #5eba00; } .btn-green:not(:disabled):not(.disabled):active, .btn-green:not(:disabled):not(.disabled).active, .show > .btn-green.dropdown-toggle { color: #fff; background-color: #448700; border-color: #3e7a00; } .btn-green:not(:disabled):not(.disabled):active:focus, .btn-green:not(:disabled):not(.disabled).active:focus, .show > .btn-green.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(94, 186, 0, 0.5); } .btn-teal { color: #fff; background-color: #2bcbba; border-color: #2bcbba; } .btn-teal:hover { color: #fff; background-color: #24ab9d; border-color: #22a193; } .btn-teal:focus, .btn-teal.focus { box-shadow: 0 0 0 2px rgba(43, 203, 186, 0.5); } .btn-teal.disabled, .btn-teal:disabled { color: #fff; background-color: #2bcbba; border-color: #2bcbba; } .btn-teal:not(:disabled):not(.disabled):active, .btn-teal:not(:disabled):not(.disabled).active, .show > .btn-teal.dropdown-toggle { color: #fff; background-color: #22a193; border-color: #20968a; } .btn-teal:not(:disabled):not(.disabled):active:focus, .btn-teal:not(:disabled):not(.disabled).active:focus, .show > .btn-teal.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(43, 203, 186, 0.5); } .btn-cyan { color: #fff; background-color: #17a2b8; border-color: #17a2b8; } .btn-cyan:hover { color: #fff; background-color: #138496; border-color: #117a8b; } .btn-cyan:focus, .btn-cyan.focus { box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.5); } .btn-cyan.disabled, .btn-cyan:disabled { color: #fff; background-color: #17a2b8; border-color: #17a2b8; } .btn-cyan:not(:disabled):not(.disabled):active, .btn-cyan:not(:disabled):not(.disabled).active, .show > .btn-cyan.dropdown-toggle { color: #fff; background-color: #117a8b; border-color: #10707f; } .btn-cyan:not(:disabled):not(.disabled):active:focus, .btn-cyan:not(:disabled):not(.disabled).active:focus, .show > .btn-cyan.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.5); } .btn-white { color: #495057; background-color: #fff; border-color: #fff; } .btn-white:hover { color: #495057; background-color: #ececec; border-color: #e6e5e5; } .btn-white:focus, .btn-white.focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); } .btn-white.disabled, .btn-white:disabled { color: #495057; background-color: #fff; border-color: #fff; } .btn-white:not(:disabled):not(.disabled):active, .btn-white:not(:disabled):not(.disabled).active, .show > .btn-white.dropdown-toggle { color: #495057; background-color: #e6e5e5; border-color: #dfdfdf; } .btn-white:not(:disabled):not(.disabled):active:focus, .btn-white:not(:disabled):not(.disabled).active:focus, .show > .btn-white.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); } .btn-gray { color: #fff; background-color: #868e96; border-color: #868e96; } .btn-gray:hover { color: #fff; background-color: #727b84; border-color: #6c757d; } .btn-gray:focus, .btn-gray.focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } .btn-gray.disabled, .btn-gray:disabled { color: #fff; background-color: #868e96; border-color: #868e96; } .btn-gray:not(:disabled):not(.disabled):active, .btn-gray:not(:disabled):not(.disabled).active, .show > .btn-gray.dropdown-toggle { color: #fff; background-color: #6c757d; border-color: #666e76; } .btn-gray:not(:disabled):not(.disabled):active:focus, .btn-gray:not(:disabled):not(.disabled).active:focus, .show > .btn-gray.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(134, 142, 150, 0.5); } .btn-gray-dark { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-gray-dark:hover { color: #fff; background-color: #23272b; border-color: #1d2124; } .btn-gray-dark:focus, .btn-gray-dark.focus { box-shadow: 0 0 0 2px rgba(52, 58, 64, 0.5); } .btn-gray-dark.disabled, .btn-gray-dark:disabled { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-gray-dark:not(:disabled):not(.disabled):active, .btn-gray-dark:not(:disabled):not(.disabled).active, .show > .btn-gray-dark.dropdown-toggle { color: #fff; background-color: #1d2124; border-color: #171a1d; } .btn-gray-dark:not(:disabled):not(.disabled):active:focus, .btn-gray-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-gray-dark.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(52, 58, 64, 0.5); } .btn-azure { color: #fff; background-color: #45aaf2; border-color: #45aaf2; } .btn-azure:hover { color: #fff; background-color: #219af0; border-color: #1594ef; } .btn-azure:focus, .btn-azure.focus { box-shadow: 0 0 0 2px rgba(69, 170, 242, 0.5); } .btn-azure.disabled, .btn-azure:disabled { color: #fff; background-color: #45aaf2; border-color: #45aaf2; } .btn-azure:not(:disabled):not(.disabled):active, .btn-azure:not(:disabled):not(.disabled).active, .show > .btn-azure.dropdown-toggle { color: #fff; background-color: #1594ef; border-color: #108ee7; } .btn-azure:not(:disabled):not(.disabled):active:focus, .btn-azure:not(:disabled):not(.disabled).active:focus, .show > .btn-azure.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(69, 170, 242, 0.5); } .btn-lime { color: #fff; background-color: #7bd235; border-color: #7bd235; } .btn-lime:hover { color: #fff; background-color: #69b829; border-color: #63ad27; } .btn-lime:focus, .btn-lime.focus { box-shadow: 0 0 0 2px rgba(123, 210, 53, 0.5); } .btn-lime.disabled, .btn-lime:disabled { color: #fff; background-color: #7bd235; border-color: #7bd235; } .btn-lime:not(:disabled):not(.disabled):active, .btn-lime:not(:disabled):not(.disabled).active, .show > .btn-lime.dropdown-toggle { color: #fff; background-color: #63ad27; border-color: #5da324; } .btn-lime:not(:disabled):not(.disabled):active:focus, .btn-lime:not(:disabled):not(.disabled).active:focus, .show > .btn-lime.dropdown-toggle:focus { box-shadow: 0 0 0 2px rgba(123, 210, 53, 0.5); } .btn-option { background: transparent; color: #9aa0ac; } .btn-option:hover { color: #6e7687; } .btn-option:focus { box-shadow: none; color: #6e7687; } .btn-sm, .btn-group-sm > .btn { font-size: 0.75rem; min-width: 1.625rem; } .btn-lg, .btn-group-lg > .btn { font-size: 1rem; min-width: 2.75rem; font-weight: 400; } .btn-list { margin-bottom: -0.5rem; font-size: 0; } .btn-list > .btn, .btn-list > .dropdown { margin-bottom: 0.5rem; } .btn-list > .btn:not(:last-child), .btn-list > .dropdown:not(:last-child) { margin-right: 0.5rem; } .btn-loading { color: transparent !important; pointer-events: none; position: relative; } .btn-loading:after { content: ''; -webkit-animation: loader 500ms infinite linear; animation: loader 500ms infinite linear; border: 2px solid #fff; border-radius: 50%; border-right-color: transparent !important; border-top-color: transparent !important; display: block; height: 1.4em; width: 1.4em; position: absolute; left: calc(50% - (1.4em / 2)); top: calc(50% - (1.4em / 2)); -webkit-transform-origin: center; transform-origin: center; position: absolute !important; } .btn-loading.btn-sm:after, .btn-group-sm > .btn-loading.btn:after { height: 1em; width: 1em; left: calc(50% - (1em / 2)); top: calc(50% - (1em / 2)); } .btn-loading.btn-secondary:after { border-color: #495057; } .alert { font-size: 0.9375rem; } .alert-icon { padding-left: 3rem; } .alert-icon > i { color: inherit !important; font-size: 1rem; position: absolute; top: 1rem; left: 1rem; } .alert-avatar { padding-left: 3.75rem; } .alert-avatar .avatar { position: absolute; top: 0.5rem; left: 0.75rem; } .close { font-size: 1rem; line-height: 1.5; transition: 0.3s color; } .close:before { content: ''; position: relative; top: 4px; display: inline-block; width: 20px; height: 20px; background-size: 100%; background-repeat: no-repeat; background-image: url("data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashdmc+Cg=="); } .badge { color: #fff; } .badge-default { background: #e9ecef; color: #868e96; } .table thead th, .text-wrap table thead th { border-top: 0; border-bottom-width: 1px; padding-top: 0.5rem; padding-bottom: 0.5rem; } .table th, .text-wrap table th { color: #9aa0ac; text-transform: uppercase; font-size: 0.875rem; font-weight: 400; } .table-md th, .table-md td { padding: 0.5rem; } .table-vcenter td, .table-vcenter th { vertical-align: middle; } .table-center td, .table-center th { text-align: center; } .table-striped tbody tr:nth-of-type(odd) { background: transparent; } .table-striped tbody tr:nth-of-type(even) { background-color: rgba(0, 0, 0, 0.02); } .table-calendar { margin: 0 0 0.75rem; } .table-calendar td, .table-calendar th { border: 0; text-align: center; padding: 0 !important; width: 14.28571429%; line-height: 2.5rem; } .table-calendar td { border-top: 0; } .table-calendar-link { line-height: 2rem; min-width: calc(2rem + 2px); display: inline-block; border-radius: 3px; background: #f8f9fa; color: #495057; font-weight: 600; transition: 0.3s background, 0.3s color; position: relative; } .table-calendar-link:before { content: ''; width: 4px; height: 4px; position: absolute; left: 0.25rem; top: 0.25rem; border-radius: 50px; background: #467fcf; } .table-calendar-link:hover { color: #fff; text-decoration: none; background: #467fcf; transition: 0.3s background; } .table-calendar-link:hover:before { background: #fff; } .table-header { cursor: pointer; transition: 0.3s color; } .table-header:hover { color: #495057 !important; } .table-header:after { content: '\f0dc'; font-family: FontAwesome; display: inline-block; margin-left: 0.5rem; font-size: 0.75rem; } .table-header-asc { color: #495057 !important; } .table-header-asc:after { content: '\f0de'; } .table-header-desc { color: #495057 !important; } .table-header-desc:after { content: '\f0dd'; } .page-breadcrumb { background: none; padding: 0; margin: 1rem 0 0; font-size: 0.875rem; } @media (min-width: 768px) { .page-breadcrumb { margin: -0.5rem 0 0; } } .page-breadcrumb .breadcrumb-item { color: #9aa0ac; } .page-breadcrumb .breadcrumb-item.active { color: #6e7687; } .pagination-simple .page-item .page-link { background: none; border: none; } .pagination-simple .page-item.active .page-link { color: #495057; font-weight: 700; } .pagination-pager .page-prev { margin-right: auto; } .pagination-pager .page-next { margin-left: auto; } .page-total-text { margin-right: 1rem; -ms-flex-item-align: center; align-self: center; color: #6e7687; } .card { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); position: relative; margin-bottom: 1.5rem; width: 100%; } .card .card { box-shadow: none; } @media print { .card { box-shadow: none; border: none; } } .card-body { -ms-flex: 1 1 auto; flex: 1 1 auto; margin: 0; padding: 1.5rem 1.5rem; position: relative; } .card-body + .card-body { border-top: 1px solid rgba(0, 40, 100, 0.12); } .card-body > :last-child { margin-bottom: 0; } @media print { .card-body { padding: 0; } } .card-body-scrollable { overflow: auto; } .card-footer, .card-bottom { padding: 1rem 1.5rem; background: none; } .card-footer { border-top: 1px solid rgba(0, 40, 100, 0.12); color: #6e7687; } .card-header { background: none; padding: 0.5rem 1.5rem; display: -ms-flexbox; display: flex; min-height: 3.5rem; -ms-flex-align: center; align-items: center; } .card-header .card-title { margin-bottom: 0; } .card-header.border-0 + .card-body { padding-top: 0; } @media print { .card-header { display: none; } } .card-img-top { border-top-left-radius: 3px; border-top-right-radius: 3px; } .card-img-overlay { background-color: rgba(0, 0, 0, 0.4); display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; } .card-title { font-size: 1.125rem; line-height: 1.2; font-weight: 400; margin-bottom: 1.5rem; } .card-title a { color: inherit; } .card-title:only-child { margin-bottom: 0; } .card-title small, .card-subtitle { color: #9aa0ac; font-size: 0.875rem; display: block; margin: -0.75rem 0 1rem; line-height: 1.1; font-weight: 400; } .card-table { margin-bottom: 0; } .card-table tr:first-child td, .card-table tr:first-child th { border-top: 0; } .card-table tr td:first-child, .card-table tr th:first-child { padding-left: 1.5rem; } .card-table tr td:last-child, .card-table tr th:last-child { padding-right: 1.5rem; } .card-body + .card-table { border-top: 1px solid rgba(0, 40, 100, 0.12); } .card-profile .card-header { height: 9rem; background-size: cover; } .card-profile-img { max-width: 6rem; margin-top: -5rem; margin-bottom: 1rem; border: 3px solid #fff; border-radius: 100%; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); } .card-link + .card-link { margin-left: 1rem; } .card-body + .card-list-group { border-top: 1px solid rgba(0, 40, 100, 0.12); } .card-list-group .list-group-item { border-right: 0; border-left: 0; border-radius: 0; padding-left: 1.5rem; padding-right: 1.5rem; } .card-list-group .list-group-item:last-child { border-bottom: 0; } .card-list-group .list-group-item:first-child { border-top: 0; } .card-header-tabs { margin: -1.25rem 0; border-bottom: 0; line-height: 2rem; } .card-header-tabs .nav-item { margin-bottom: 1px; } .card-header-pills { margin: -0.75rem 0; } .card-aside { -ms-flex-direction: row; flex-direction: row; } .card-aside-column { min-width: 5rem; width: 30%; border-top-left-radius: 3px; border-bottom-left-radius: 3px; background: no-repeat center/cover; } .card-value { font-size: 2.5rem; line-height: 3.4rem; height: 3.4rem; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; font-weight: 400; } .card-value i { vertical-align: middle; } .card-chart-bg { height: 4rem; position: relative; z-index: 1; } .card-options { margin-left: auto; display: -ms-flexbox; display: flex; -ms-flex-order: 100; order: 100; margin-right: -0.5rem; color: #9aa0ac; -ms-flex-item-align: center; align-self: center; } .card-options a { margin-left: 0.5rem; color: #9aa0ac; display: inline-block; min-width: 1rem; } .card-options a:hover { text-decoration: none; color: #6e7687; } .card-options a i { font-size: 1rem; vertical-align: middle; } .card-options .dropdown-toggle:after { display: none; } /* Card options */ .card-collapsed > :not(.card-header):not(.card-status) { display: none; } .card-collapsed .card-options-collapse i:before { content: '\e92d'; } .card-fullscreen .card-options-fullscreen i:before { content: '\e992'; } .card-fullscreen .card-options-remove { display: none; } /* Card maps */ .card-map { height: 15rem; background: #e9ecef; } .card-map-placeholder { background: no-repeat center; } /** Card tabs */ .card-tabs { display: -ms-flexbox; display: flex; } .card-tabs-bottom .card-tabs-item { border: 0; border-top: 1px solid rgba(0, 40, 100, 0.12); } .card-tabs-bottom .card-tabs-item.active { border-top-color: #fff; } .card-tabs-item { -ms-flex: 1 1 auto; flex: 1 1 auto; display: block; padding: 1rem 1.5rem; border-bottom: 1px solid rgba(0, 40, 100, 0.12); color: inherit; overflow: hidden; } a.card-tabs-item { background: #fafbfc; } a.card-tabs-item:hover { text-decoration: none; color: inherit; } a.card-tabs-item:focus { z-index: 1; } a.card-tabs-item.active { background: #fff; border-bottom-color: #fff; } .card-tabs-item + .card-tabs-item { border-left: 1px solid rgba(0, 40, 100, 0.12); } /** Card status */ .card-status { position: absolute; top: -1px; left: -1px; right: -1px; height: 3px; border-radius: 3px 3px 0 0; background: rgba(0, 40, 100, 0.12); } .card-status-left { right: auto; bottom: 0; height: auto; width: 3px; border-radius: 3px 0 0 3px; } /** Card icon */ .card-icon { width: 3rem; font-size: 2.5rem; line-height: 3rem; text-align: center; } /** Card fullscreen */ .card-fullscreen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; margin: 0; } /** Card alert */ .card-alert { border-radius: 0; margin: -1px -1px 0; } .card-category { font-size: 0.875rem; text-transform: uppercase; text-align: center; font-weight: 600; letter-spacing: 0.05em; margin: 0 0 0.5rem; } .popover { -webkit-filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1)); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1)); } .popover.bs-popover-top, .popover.bs-popover-auto[x-placement^='top'] { margin-bottom: 0.625rem; } .popover .arrow { margin-left: calc(0.25rem + 2px); } .dropdown { display: inline-block; } .dropdown-menu { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); min-width: 12rem; } .dropdown-item { color: #6e7687; } [data-theme='dark'] .dropdown-item { color: #ffffff; } .dropdown-menu-arrow:before { position: absolute; top: -6px; left: 12px; display: inline-block; border-right: 5px solid transparent; border-bottom: 5px solid rgba(0, 40, 100, 0.12); border-left: 5px solid transparent; border-bottom-color: rgba(0, 0, 0, 0.2); content: ''; } [data-theme='dark'] .dropdown-menu-arrow:before { border-bottom-color: var(--ctrl-bgcolor); } .dropdown-menu-arrow:after { position: absolute; top: -5px; left: 12px; display: inline-block; border-right: 5px solid transparent; border-bottom: 5px solid var(--ctrl-bgcolor); border-left: 5px solid transparent; content: ''; } [data-theme='dark'] .dropdown-menu-arrow:after { border-bottom: 5px solid var(--card-border-color); } .dropdown-menu-arrow.dropdown-menu-right:before, .dropdown-menu-arrow.dropdown-menu-right:after { left: auto; right: 12px; } .dropdown-toggle { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; } .dropdown-toggle:after { vertical-align: 0.155em; } .dropdown-toggle:empty:after { margin-left: 0; } .dropdown-icon { color: #9aa0ac; margin-right: 0.5rem; margin-left: -0.5rem; width: 1em; display: inline-block; text-align: center; vertical-align: -1px; } .list-inline-dots .list-inline-item + .list-inline-item:before { content: ' '; margin-left: -2px; margin-right: 3px; } .list-separated-item { padding: 1rem 0; } .list-separated-item:first-child { padding-top: 0; } .list-separated-item:last-child { padding-bottom: 0; } .list-separated-item + .list-separated-item { border-top: 1px solid rgba(0, 40, 100, 0.12); } .list-group-item.active .icon { color: inherit !important; } .list-group-transparent .list-group-item { background: none; border: 0; padding: 0.5rem 1rem; border-radius: 3px; } .list-group-transparent .list-group-item.active { background: rgba(70, 127, 207, 0.06); font-weight: 600; } .avatar { width: 2rem; height: 2rem; line-height: 2rem; border-radius: 50%; display: inline-block; background: #ced4da no-repeat center/cover; position: relative; text-align: center; color: #868e96; font-weight: 600; vertical-align: bottom; font-size: 0.875rem; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .avatar i { font-size: 125%; vertical-align: sub; } .avatar-status { position: absolute; right: -2px; bottom: -2px; width: 0.75rem; height: 0.75rem; border: 2px solid #fff; background: #868e96; border-radius: 50%; } .avatar-sm { width: 1.5rem; height: 1.5rem; line-height: 1.5rem; font-size: 0.75rem; } .avatar-md { width: 2.5rem; height: 2.5rem; line-height: 2.5rem; font-size: 1rem; } .avatar-lg { width: 3rem; height: 3rem; line-height: 3rem; font-size: 1.25rem; } .avatar-xl { width: 4rem; height: 4rem; line-height: 4rem; font-size: 1.75rem; } .avatar-xxl { width: 5rem; height: 5rem; line-height: 5rem; font-size: 2rem; } .avatar-placeholder { background: #ced4da url('data:image/svg+xml;charset=utf8,<svg xmlns="path_to_url" width="134" height="134" viewBox="0 0 134 134"><path fill="#868e96" d="M65.92 66.34h2.16c14.802.42 30.928 6.062 29.283 20.35l-1.618 13.32c-.844 6.815-5.208 7.828-13.972 7.866H52.23c-8.764-.038-13.13-1.05-13.973-7.865l-1.62-13.32C34.994 72.4 51.12 66.76 65.92 66.34zM49.432 43.934c0-9.82 7.99-17.81 17.807-17.81 9.82 0 17.81 7.99 17.81 17.81 0 9.82-7.99 17.807-17.81 17.807-9.82 0-17.808-7.987-17.808-17.806z"/></svg>') no-repeat center/80%; } .avatar-list { margin: 0 0 -0.5rem; padding: 0; font-size: 0; } .avatar-list .avatar { margin-bottom: 0.5rem; } .avatar-list .avatar:not(:last-child) { margin-right: 0.5rem; } .avatar-list-stacked .avatar { margin-right: -0.8em !important; } .avatar-list-stacked .avatar { box-shadow: 0 0 0 2px #fff; } .avatar-blue { background-color: #c8d9f1; color: #467fcf; } .avatar-indigo { background-color: #d1d5f0; color: #6574cd; } .avatar-purple { background-color: #e4cff9; color: #a55eea; } .avatar-pink { background-color: #fcd3e1; color: #f66d9b; } .avatar-red { background-color: #f0bcbc; color: #cd201f; } .avatar-orange { background-color: #fee0c7; color: #fd9644; } .avatar-yellow { background-color: #fbedb7; color: #f1c40f; } .avatar-green { background-color: #cfeab3; color: #5eba00; } .avatar-teal { background-color: #bfefea; color: #2bcbba; } .avatar-cyan { background-color: #b9e3ea; color: #17a2b8; } .avatar-white { background-color: white; color: #fff; } .avatar-gray { background-color: #dbdde0; color: #868e96; } .avatar-gray-dark { background-color: #c2c4c6; color: #343a40; } .avatar-azure { background-color: #c7e6fb; color: #45aaf2; } .avatar-lime { background-color: #d7f2c2; color: #7bd235; } .product-price { font-size: 1rem; } .product-price strong { font-size: 1.5rem; } @-webkit-keyframes indeterminate { 0% { left: -35%; right: 100%; } 100%, 60% { left: 100%; right: -90%; } } @keyframes indeterminate { 0% { left: -35%; right: 100%; } 100%, 60% { left: 100%; right: -90%; } } @-webkit-keyframes indeterminate-short { 0% { left: -200%; right: 100%; } 100%, 60% { left: 107%; right: -8%; } } @keyframes indeterminate-short { 0% { left: -200%; right: 100%; } 100%, 60% { left: 107%; right: -8%; } } .progress { position: relative; } .progress-xs, .progress-xs .progress-bar { height: 0.25rem; } .progress-sm, .progress-sm .progress-bar { height: 0.5rem; } .progress-bar-indeterminate:after, .progress-bar-indeterminate:before { content: ''; position: absolute; background-color: inherit; left: 0; will-change: left, right; top: 0; bottom: 0; } .progress-bar-indeterminate:before { -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; } .progress-bar-indeterminate:after { -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; -webkit-animation-delay: 1.15s; animation-delay: 1.15s; } @-webkit-keyframes loader { from { -webkit-transform: rotate(0deg); transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loader { from { -webkit-transform: rotate(0deg); transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } /** Dimmer */ .dimmer { position: relative; } .dimmer .loader { display: none; margin: 0 auto; position: absolute; top: 50%; left: 0; right: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%); } .dimmer.active .loader { display: block; } .dimmer.active .dimmer-content { opacity: 0.04; pointer-events: none; } /** Loader */ .loader { display: block; position: relative; height: 2.5rem; width: 2.5rem; color: #467fcf; } .loader:before, .loader:after { width: 2.5rem; height: 2.5rem; margin: -1.25rem 0 0 -1.25rem; position: absolute; content: ''; top: 50%; left: 50%; } .loader:before { border-radius: 50%; border: 3px solid currentColor; opacity: 0.15; } .loader:after { -webkit-animation: loader 0.6s linear; animation: loader 0.6s linear; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; border-radius: 50%; border: 3px solid; border-color: transparent; border-top-color: currentColor; box-shadow: 0 0 0 1px transparent; } .icons-list { list-style: none; margin: 0 -1px -1px 0; padding: 0; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; } .icons-list > li { -ms-flex: 1 0 4rem; flex: 1 0 4rem; } .icons-list-wrap { overflow: hidden; } .icons-list-item { text-align: center; height: 4rem; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; border-right: 1px solid rgba(0, 40, 100, 0.12); border-bottom: 1px solid rgba(0, 40, 100, 0.12); } .icons-list-item i { font-size: 1.25rem; } .img-gallery { margin-right: -0.25rem; margin-left: -0.25rem; margin-bottom: -0.5rem; } .img-gallery > .col, .img-gallery > [class*='col-'] { padding-left: 0.25rem; padding-right: 0.25rem; padding-bottom: 0.5rem; } .link-overlay { position: relative; } .link-overlay:hover .link-overlay-bg { opacity: 1; } .link-overlay-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(70, 127, 207, 0.8); display: -ms-flexbox; display: flex; color: #fff; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; font-size: 1.25rem; opacity: 0; transition: 0.3s opacity; } .media-icon { width: 2rem; height: 2rem; line-height: 2rem; text-align: center; border-radius: 100%; } .media-list { margin: 0; padding: 0; list-style: none; } textarea[cols] { height: auto; } .form-group { display: block; } .form-label { display: block; margin-bottom: 0.375rem; font-weight: 600; font-size: 0.875rem; } .form-label-small { float: right; font-weight: 400; font-size: 87.5%; } .form-footer { margin-top: 2rem; } .custom-control { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .custom-controls-stacked .custom-control { margin-bottom: 0.25rem; } .custom-control-label { vertical-align: middle; } .custom-control-label:before { border: 1px solid rgba(0, 40, 100, 0.12); background-color: var(--radio-bg); background-size: 0.5rem; } .custom-control-description { line-height: 1.5rem; } .input-group-prepend, .input-group-append, .input-group-btn { font-size: 0.9375rem; } .input-group-prepend > .btn, .input-group-append > .btn, .input-group-btn > .btn { height: 100%; border-color: rgba(0, 40, 100, 0.12); } .input-group-prepend > .input-group-text { border-right: 0; } .input-group-append > .input-group-text { border-left: 0; } /** Icon input */ .input-icon { position: relative; } .input-icon .form-control:not(:last-child) { padding-right: 2.5rem; } .input-icon .form-control:not(:first-child) { padding-left: 2.5rem; } .input-icon-addon { position: absolute; top: 0; bottom: 0; left: 0; color: #9aa0ac; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; min-width: 2.5rem; pointer-events: none; } .input-icon-addon:last-child { left: auto; right: 0; } .form-fieldset { background: #f8f9fa; border: 1px solid #e9ecef; padding: 1rem; border-radius: 3px; margin-bottom: 1rem; } .form-required { color: #cd201f; } .form-required:before { content: ' '; } .state-valid { padding-right: 2rem; background: url("data:image/svg+xml;charset=utf8,<svg xmlns='path_to_url width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235eba00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-check'><polyline points='20 6 9 17 4 12'></polyline></svg>") no-repeat center right 0.5rem/1rem; } .state-invalid { padding-right: 2rem; background: url("data:image/svg+xml;charset=utf8,<svg xmlns='path_to_url width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23cd201f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-x'><line x1='18' y1='6' x2='6' y2='18'></line><line x1='6' y1='6' x2='18' y2='18'></line></svg>") no-repeat center right 0.5rem/1rem; } .form-help { display: inline-block; width: 1rem; height: 1rem; text-align: center; line-height: 1rem; color: #9aa0ac; background: #f8f9fa; border-radius: 50%; font-size: 0.75rem; transition: 0.3s background-color, 0.3s color; text-decoration: none; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .form-help:hover, .form-help[aria-describedby] { background: #467fcf; color: #fff; } .sparkline { display: inline-block; height: 2rem; } .jqstooltip { box-sizing: content-box; font-family: inherit !important; background: #333 !important; border: none !important; border-radius: 3px; font-size: 11px !important; font-weight: 700 !important; line-height: 1 !important; padding: 6px !important; } .jqstooltip .jqsfield { font: inherit !important; } .social-links li a { background: #f8f8f8; border-radius: 50%; color: #9aa0ac; display: inline-block; height: 1.75rem; width: 1.75rem; line-height: 1.75rem; text-align: center; } .map, .chart { position: relative; padding-top: 56.25%; } .map-square, .chart-square { padding-top: 100%; } .map-content, .chart-content { position: absolute; top: 0; left: 0; right: 0; bottom: 0; } .map-header { margin-top: -1.5rem; margin-bottom: 1.5rem; height: 15rem; position: relative; margin-bottom: -1.5rem; } .map-header:before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 10rem; background: linear-gradient(to bottom, rgba(245, 247, 251, 0) 5%, #f5f7fb 95%); pointer-events: none; } .map-header-layer { height: 100%; } .map-static { height: 120px; width: 100%; max-width: 640px; background-position: center center; background-size: 640px 120px; } @-webkit-keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.32; } } @keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.32; } } .status-icon { content: ''; width: 0.5rem; height: 0.5rem; display: inline-block; background: currentColor; border-radius: 50%; -webkit-transform: translateY(-1px); transform: translateY(-1px); margin-right: 0.375rem; vertical-align: middle; } .status-animated { -webkit-animation: 1s status-pulse infinite ease; animation: 1s status-pulse infinite ease; } .chart-circle { display: block; height: 8rem; width: 8rem; position: relative; } .chart-circle canvas { margin: 0 auto; display: block; max-width: 100%; max-height: 100%; } .chart-circle-xs { height: 2.5rem; width: 2.5rem; font-size: 0.8rem; } .chart-circle-sm { height: 4rem; width: 4rem; font-size: 0.8rem; } .chart-circle-lg { height: 10rem; width: 10rem; font-size: 0.8rem; } .chart-circle-value { position: absolute; top: 0; left: 0; right: 0; margin-left: auto; margin-right: auto; bottom: 0; display: -ms-flexbox; display: flex; -ms-flex-pack: center; justify-content: center; -ms-flex-align: center; align-items: center; -ms-flex-direction: column; flex-direction: column; line-height: 1; } .chart-circle-value small { display: block; color: #9aa0ac; font-size: 0.9375rem; } .chips { margin: 0 0 -0.5rem; } .chips .chip { margin: 0 0.5rem 0.5rem 0; } .chip { display: inline-block; height: 2rem; line-height: 2rem; font-size: 0.875rem; font-weight: 500; color: #6e7687; padding: 0 0.75rem; border-radius: 1rem; background-color: #f8f9fa; transition: 0.3s background; } .chip .avatar { float: left; margin: 0 0.5rem 0 -0.75rem; height: 2rem; width: 2rem; border-radius: 50%; } a.chip:hover { color: inherit; text-decoration: none; background-color: #e9ecef; } .stamp { color: #fff; background: #868e96; display: inline-block; min-width: 2rem; height: 2rem; padding: 0 0.25rem; line-height: 2rem; text-align: center; border-radius: 3px; font-weight: 600; } .stamp-md { min-width: 2.5rem; height: 2.5rem; line-height: 2.5rem; } .chat { outline: 0; margin: 0; padding: 0; list-style-type: none; display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; -ms-flex-pack: end; justify-content: flex-end; min-height: 100%; } .chat-line { padding: 0; text-align: right; position: relative; display: -ms-flexbox; display: flex; -ms-flex-direction: row-reverse; flex-direction: row-reverse; } .chat-line + .chat-line { padding-top: 1rem; } .chat-message { position: relative; display: inline-block; background-color: #467fcf; color: #fff; font-size: 0.875rem; padding: 0.375rem 0.5rem; border-radius: 3px; white-space: normal; text-align: left; margin: 0 0.5rem 0 2.5rem; line-height: 1.4; } .chat-message > :last-child { margin-bottom: 0 !important; } .chat-message:after { content: ''; position: absolute; right: -5px; top: 7px; border-bottom: 6px solid transparent; border-left: 6px solid #467fcf; border-top: 6px solid transparent; } .chat-message img { max-width: 100%; } .chat-message p { margin-bottom: 1em; } .chat-line-friend { -ms-flex-direction: row; flex-direction: row; } .chat-line-friend + .chat-line-friend { margin-top: -0.5rem; } .chat-line-friend + .chat-line-friend .chat-author { visibility: hidden; } .chat-line-friend + .chat-line-friend .chat-message:after { display: none; } .chat-line-friend .chat-message { background-color: #f3f3f3; color: #495057; margin-left: 0.5rem; margin-right: 2.5rem; } .chat-line-friend .chat-message:after { right: auto; left: -5px; border-left-width: 0; border-right: 5px solid #f3f3f3; } .example { padding: 1.5rem; border: 1px solid rgba(0, 40, 100, 0.12); border-radius: 3px 3px 0 0; font-size: 0.9375rem; } .example-bg { background: #f5f7fb; } .example + .highlight { border-top: none; margin-top: 0; border-radius: 0 0 3px 3px; } .highlight { margin: 1rem 0 2rem; border: 1px solid rgba(0, 40, 100, 0.12); border-radius: 3px; font-size: 0.9375rem; max-height: 40rem; overflow: auto; background: #fcfcfc; } .highlight pre { margin-bottom: 0; background-color: transparent; } .example-column { margin: 0 auto; } .example-column > .card:last-of-type { margin-bottom: 0; } .example-column-1 { max-width: 20rem; } .example-column-2 { max-width: 40rem; } .tag { font-size: 0.75rem; color: #6e7687; background-color: #e9ecef; border-radius: 3px; padding: 0 0.5rem; line-height: 2em; display: -ms-inline-flexbox; display: inline-flex; cursor: default; font-weight: 400; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } a.tag { text-decoration: none; cursor: pointer; transition: 0.3s color, 0.3s background; } a.tag:hover { background-color: rgba(110, 118, 135, 0.2); color: inherit; } .tag-addon { display: inline-block; padding: 0 0.5rem; color: inherit; text-decoration: none; background: rgba(0, 0, 0, 0.06); margin: 0 -0.5rem 0 0.5rem; text-align: center; min-width: 1.5rem; } .tag-addon:last-child { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .tag-addon i { vertical-align: middle; margin: 0 -0.25rem; } a.tag-addon { text-decoration: none; cursor: pointer; transition: 0.3s color, 0.3s background; } a.tag-addon:hover { background: rgba(0, 0, 0, 0.16); color: inherit; } .tag-avatar { width: 1.5rem; height: 1.5rem; border-radius: 3px 0 0 3px; margin: 0 0.5rem 0 -0.5rem; } .tag-blue { background-color: #467fcf; color: #fff; } .tag-indigo { background-color: #6574cd; color: #fff; } .tag-purple { background-color: #a55eea; color: #fff; } .tag-pink { background-color: #f66d9b; color: #fff; } .tag-red { background-color: #cd201f; color: #fff; } .tag-orange { background-color: #fd9644; color: #fff; } .tag-yellow { background-color: #f1c40f; color: #fff; } .tag-green { background-color: #5eba00; color: #fff; } .tag-teal { background-color: #2bcbba; color: #fff; } .tag-cyan { background-color: #17a2b8; color: #fff; } .tag-white { background-color: #fff; color: #fff; } .tag-gray { background-color: #868e96; color: #fff; } .tag-gray-dark { background-color: #343a40; color: #fff; } .tag-azure { background-color: #45aaf2; color: #fff; } .tag-lime { background-color: #7bd235; color: #fff; } .tag-primary { background-color: #467fcf; color: #fff; } .tag-secondary { background-color: #868e96; color: #fff; } .tag-success { background-color: #5eba00; color: #fff; } .tag-info { background-color: #45aaf2; color: #fff; } .tag-warning { background-color: #f1c40f; color: #fff; } .tag-danger { background-color: #cd201f; color: #fff; } .tag-light { background-color: #f8f9fa; color: #fff; } .tag-dark { background-color: #343a40; color: #fff; } .tag-rounded { border-radius: 50px; } .tag-rounded .tag-avatar { border-radius: 50px; } .tags { margin-bottom: -0.5rem; font-size: 0; } .tags > .tag { margin-bottom: 0.5rem; } .tags > .tag:not(:last-child) { margin-right: 0.5rem; } .highlight .hll { background-color: #ffc; } .highlight .c { color: #999; } .highlight .k { color: #069; } .highlight .o { color: #555; } .highlight .cm { color: #999; } .highlight .cp { color: #099; } .highlight .c1 { color: #999; } .highlight .cs { color: #999; } .highlight .gd { background-color: #fcc; border: 1px solid #c00; } .highlight .ge { font-style: italic; } .highlight .gr { color: #f00; } .highlight .gh { color: #030; } .highlight .gi { background-color: #cfc; border: 1px solid #0c0; } .highlight .go { color: #aaa; } .highlight .gp { color: #009; } .highlight .gu { color: #030; } .highlight .gt { color: #9c6; } .highlight .kc { color: #069; } .highlight .kd { color: #069; } .highlight .kn { color: #069; } .highlight .kp { color: #069; } .highlight .kr { color: #069; } .highlight .kt { color: #078; } .highlight .m { color: #f60; } .highlight .s { color: #d44950; } .highlight .na { color: #4f9fcf; } .highlight .nb { color: #366; } .highlight .nc { color: #0a8; } .highlight .no { color: #360; } .highlight .nd { color: #99f; } .highlight .ni { color: #999; } .highlight .ne { color: #c00; } .highlight .nf { color: #c0f; } .highlight .nl { color: #99f; } .highlight .nn { color: #0cf; } .highlight .nt { color: #2f6f9f; } .highlight .nv { color: #033; } .highlight .ow { color: #000; } .highlight .w { color: #bbb; } .highlight .mf { color: #f60; } .highlight .mh { color: #f60; } .highlight .mi { color: #f60; } .highlight .mo { color: #f60; } .highlight .sb { color: #c30; } .highlight .sc { color: #c30; } .highlight .sd { font-style: italic; color: #c30; } .highlight .s2 { color: #c30; } .highlight .se { color: #c30; } .highlight .sh { color: #c30; } .highlight .si { color: #a00; } .highlight .sx { color: #c30; } .highlight .sr { color: #3aa; } .highlight .s1 { color: #c30; } .highlight .ss { color: #fc3; } .highlight .bp { color: #366; } .highlight .vc { color: #033; } .highlight .vg { color: #033; } .highlight .vi { color: #033; } .highlight .il { color: #f60; } .highlight .css .o, .highlight .css .o + .nt, .highlight .css .nt + .nt { color: #999; } .highlight .language-bash::before, .highlight .language-sh::before { color: #009; content: '$ '; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .highlight .language-powershell::before { color: #009; content: 'PM> '; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .custom-range { -ms-flex-align: center; align-items: center; -webkit-appearance: none; -moz-appearance: none; appearance: none; background: none; cursor: pointer; display: -ms-flexbox; display: flex; height: 100%; min-height: 2.375rem; overflow: hidden; padding: 0; border: 0; } .custom-range:focus { box-shadow: none; outline: none; } .custom-range:focus::-webkit-slider-thumb { border-color: #467fcf; background-color: #467fcf; } .custom-range:focus::-moz-range-thumb { border-color: #467fcf; background-color: #467fcf; } .custom-range:focus::-ms-thumb { border-color: #467fcf; background-color: #467fcf; } .custom-range::-moz-focus-outer { border: 0; } .custom-range::-webkit-slider-runnable-track { background: #467fcf; content: ''; height: 2px; pointer-events: none; } .custom-range::-webkit-slider-thumb { width: 14px; height: 14px; -webkit-appearance: none; appearance: none; background: #fff; border-radius: 50px; box-shadow: 1px 0 0 -6px rgba(0, 50, 126, 0.12), 6px 0 0 -6px rgba(0, 50, 126, 0.12), 7px 0 0 -6px rgba(0, 50, 126, 0.12), 8px 0 0 -6px rgba(0, 50, 126, 0.12), 9px 0 0 -6px rgba(0, 50, 126, 0.12), 10px 0 0 -6px rgba(0, 50, 126, 0.12), 11px 0 0 -6px rgba(0, 50, 126, 0.12), 12px 0 0 -6px rgba(0, 50, 126, 0.12), 13px 0 0 -6px rgba(0, 50, 126, 0.12), 14px 0 0 -6px rgba(0, 50, 126, 0.12), 15px 0 0 -6px rgba(0, 50, 126, 0.12), 16px 0 0 -6px rgba(0, 50, 126, 0.12), 17px 0 0 -6px rgba(0, 50, 126, 0.12), 18px 0 0 -6px rgba(0, 50, 126, 0.12), 19px 0 0 -6px rgba(0, 50, 126, 0.12), 20px 0 0 -6px rgba(0, 50, 126, 0.12), 21px 0 0 -6px rgba(0, 50, 126, 0.12), 22px 0 0 -6px rgba(0, 50, 126, 0.12), 23px 0 0 -6px rgba(0, 50, 126, 0.12), 24px 0 0 -6px rgba(0, 50, 126, 0.12), 25px 0 0 -6px rgba(0, 50, 126, 0.12), 26px 0 0 -6px rgba(0, 50, 126, 0.12), 27px 0 0 -6px rgba(0, 50, 126, 0.12), 28px 0 0 -6px rgba(0, 50, 126, 0.12), 29px 0 0 -6px rgba(0, 50, 126, 0.12), 30px 0 0 -6px rgba(0, 50, 126, 0.12), 31px 0 0 -6px rgba(0, 50, 126, 0.12), 32px 0 0 -6px rgba(0, 50, 126, 0.12), 33px 0 0 -6px rgba(0, 50, 126, 0.12), 34px 0 0 -6px rgba(0, 50, 126, 0.12), 35px 0 0 -6px rgba(0, 50, 126, 0.12), 36px 0 0 -6px rgba(0, 50, 126, 0.12), 37px 0 0 -6px rgba(0, 50, 126, 0.12), 38px 0 0 -6px rgba(0, 50, 126, 0.12), 39px 0 0 -6px rgba(0, 50, 126, 0.12), 40px 0 0 -6px rgba(0, 50, 126, 0.12), 41px 0 0 -6px rgba(0, 50, 126, 0.12), 42px 0 0 -6px rgba(0, 50, 126, 0.12), 43px 0 0 -6px rgba(0, 50, 126, 0.12), 44px 0 0 -6px rgba(0, 50, 126, 0.12), 45px 0 0 -6px rgba(0, 50, 126, 0.12), 46px 0 0 -6px rgba(0, 50, 126, 0.12), 47px 0 0 -6px rgba(0, 50, 126, 0.12), 48px 0 0 -6px rgba(0, 50, 126, 0.12), 49px 0 0 -6px rgba(0, 50, 126, 0.12), 50px 0 0 -6px rgba(0, 50, 126, 0.12), 51px 0 0 -6px rgba(0, 50, 126, 0.12), 52px 0 0 -6px rgba(0, 50, 126, 0.12), 53px 0 0 -6px rgba(0, 50, 126, 0.12), 54px 0 0 -6px rgba(0, 50, 126, 0.12), 55px 0 0 -6px rgba(0, 50, 126, 0.12), 56px 0 0 -6px rgba(0, 50, 126, 0.12), 57px 0 0 -6px rgba(0, 50, 126, 0.12), 58px 0 0 -6px rgba(0, 50, 126, 0.12), 59px 0 0 -6px rgba(0, 50, 126, 0.12), 60px 0 0 -6px rgba(0, 50, 126, 0.12), 61px 0 0 -6px rgba(0, 50, 126, 0.12), 62px 0 0 -6px rgba(0, 50, 126, 0.12), 63px 0 0 -6px rgba(0, 50, 126, 0.12), 64px 0 0 -6px rgba(0, 50, 126, 0.12), 65px 0 0 -6px rgba(0, 50, 126, 0.12), 66px 0 0 -6px rgba(0, 50, 126, 0.12), 67px 0 0 -6px rgba(0, 50, 126, 0.12), 68px 0 0 -6px rgba(0, 50, 126, 0.12), 69px 0 0 -6px rgba(0, 50, 126, 0.12), 70px 0 0 -6px rgba(0, 50, 126, 0.12), 71px 0 0 -6px rgba(0, 50, 126, 0.12), 72px 0 0 -6px rgba(0, 50, 126, 0.12), 73px 0 0 -6px rgba(0, 50, 126, 0.12), 74px 0 0 -6px rgba(0, 50, 126, 0.12), 75px 0 0 -6px rgba(0, 50, 126, 0.12), 76px 0 0 -6px rgba(0, 50, 126, 0.12), 77px 0 0 -6px rgba(0, 50, 126, 0.12), 78px 0 0 -6px rgba(0, 50, 126, 0.12), 79px 0 0 -6px rgba(0, 50, 126, 0.12), 80px 0 0 -6px rgba(0, 50, 126, 0.12), 81px 0 0 -6px rgba(0, 50, 126, 0.12), 82px 0 0 -6px rgba(0, 50, 126, 0.12), 83px 0 0 -6px rgba(0, 50, 126, 0.12), 84px 0 0 -6px rgba(0, 50, 126, 0.12), 85px 0 0 -6px rgba(0, 50, 126, 0.12), 86px 0 0 -6px rgba(0, 50, 126, 0.12), 87px 0 0 -6px rgba(0, 50, 126, 0.12), 88px 0 0 -6px rgba(0, 50, 126, 0.12), 89px 0 0 -6px rgba(0, 50, 126, 0.12), 90px 0 0 -6px rgba(0, 50, 126, 0.12), 91px 0 0 -6px rgba(0, 50, 126, 0.12), 92px 0 0 -6px rgba(0, 50, 126, 0.12), 93px 0 0 -6px rgba(0, 50, 126, 0.12), 94px 0 0 -6px rgba(0, 50, 126, 0.12), 95px 0 0 -6px rgba(0, 50, 126, 0.12), 96px 0 0 -6px rgba(0, 50, 126, 0.12), 97px 0 0 -6px rgba(0, 50, 126, 0.12), 98px 0 0 -6px rgba(0, 50, 126, 0.12), 99px 0 0 -6px rgba(0, 50, 126, 0.12), 100px 0 0 -6px rgba(0, 50, 126, 0.12), 101px 0 0 -6px rgba(0, 50, 126, 0.12), 102px 0 0 -6px rgba(0, 50, 126, 0.12), 103px 0 0 -6px rgba(0, 50, 126, 0.12), 104px 0 0 -6px rgba(0, 50, 126, 0.12), 105px 0 0 -6px rgba(0, 50, 126, 0.12), 106px 0 0 -6px rgba(0, 50, 126, 0.12), 107px 0 0 -6px rgba(0, 50, 126, 0.12), 108px 0 0 -6px rgba(0, 50, 126, 0.12), 109px 0 0 -6px rgba(0, 50, 126, 0.12), 110px 0 0 -6px rgba(0, 50, 126, 0.12), 111px 0 0 -6px rgba(0, 50, 126, 0.12), 112px 0 0 -6px rgba(0, 50, 126, 0.12), 113px 0 0 -6px rgba(0, 50, 126, 0.12), 114px 0 0 -6px rgba(0, 50, 126, 0.12), 115px 0 0 -6px rgba(0, 50, 126, 0.12), 116px 0 0 -6px rgba(0, 50, 126, 0.12), 117px 0 0 -6px rgba(0, 50, 126, 0.12), 118px 0 0 -6px rgba(0, 50, 126, 0.12), 119px 0 0 -6px rgba(0, 50, 126, 0.12), 120px 0 0 -6px rgba(0, 50, 126, 0.12), 121px 0 0 -6px rgba(0, 50, 126, 0.12), 122px 0 0 -6px rgba(0, 50, 126, 0.12), 123px 0 0 -6px rgba(0, 50, 126, 0.12), 124px 0 0 -6px rgba(0, 50, 126, 0.12), 125px 0 0 -6px rgba(0, 50, 126, 0.12), 126px 0 0 -6px rgba(0, 50, 126, 0.12), 127px 0 0 -6px rgba(0, 50, 126, 0.12), 128px 0 0 -6px rgba(0, 50, 126, 0.12), 129px 0 0 -6px rgba(0, 50, 126, 0.12), 130px 0 0 -6px rgba(0, 50, 126, 0.12), 131px 0 0 -6px rgba(0, 50, 126, 0.12), 132px 0 0 -6px rgba(0, 50, 126, 0.12), 133px 0 0 -6px rgba(0, 50, 126, 0.12), 134px 0 0 -6px rgba(0, 50, 126, 0.12), 135px 0 0 -6px rgba(0, 50, 126, 0.12), 136px 0 0 -6px rgba(0, 50, 126, 0.12), 137px 0 0 -6px rgba(0, 50, 126, 0.12), 138px 0 0 -6px rgba(0, 50, 126, 0.12), 139px 0 0 -6px rgba(0, 50, 126, 0.12), 140px 0 0 -6px rgba(0, 50, 126, 0.12), 141px 0 0 -6px rgba(0, 50, 126, 0.12), 142px 0 0 -6px rgba(0, 50, 126, 0.12), 143px 0 0 -6px rgba(0, 50, 126, 0.12), 144px 0 0 -6px rgba(0, 50, 126, 0.12), 145px 0 0 -6px rgba(0, 50, 126, 0.12), 146px 0 0 -6px rgba(0, 50, 126, 0.12), 147px 0 0 -6px rgba(0, 50, 126, 0.12), 148px 0 0 -6px rgba(0, 50, 126, 0.12), 149px 0 0 -6px rgba(0, 50, 126, 0.12), 150px 0 0 -6px rgba(0, 50, 126, 0.12), 151px 0 0 -6px rgba(0, 50, 126, 0.12), 152px 0 0 -6px rgba(0, 50, 126, 0.12), 153px 0 0 -6px rgba(0, 50, 126, 0.12), 154px 0 0 -6px rgba(0, 50, 126, 0.12), 155px 0 0 -6px rgba(0, 50, 126, 0.12), 156px 0 0 -6px rgba(0, 50, 126, 0.12), 157px 0 0 -6px rgba(0, 50, 126, 0.12), 158px 0 0 -6px rgba(0, 50, 126, 0.12), 159px 0 0 -6px rgba(0, 50, 126, 0.12), 160px 0 0 -6px rgba(0, 50, 126, 0.12), 161px 0 0 -6px rgba(0, 50, 126, 0.12), 162px 0 0 -6px rgba(0, 50, 126, 0.12), 163px 0 0 -6px rgba(0, 50, 126, 0.12), 164px 0 0 -6px rgba(0, 50, 126, 0.12), 165px 0 0 -6px rgba(0, 50, 126, 0.12), 166px 0 0 -6px rgba(0, 50, 126, 0.12), 167px 0 0 -6px rgba(0, 50, 126, 0.12), 168px 0 0 -6px rgba(0, 50, 126, 0.12), 169px 0 0 -6px rgba(0, 50, 126, 0.12), 170px 0 0 -6px rgba(0, 50, 126, 0.12), 171px 0 0 -6px rgba(0, 50, 126, 0.12), 172px 0 0 -6px rgba(0, 50, 126, 0.12), 173px 0 0 -6px rgba(0, 50, 126, 0.12), 174px 0 0 -6px rgba(0, 50, 126, 0.12), 175px 0 0 -6px rgba(0, 50, 126, 0.12), 176px 0 0 -6px rgba(0, 50, 126, 0.12), 177px 0 0 -6px rgba(0, 50, 126, 0.12), 178px 0 0 -6px rgba(0, 50, 126, 0.12), 179px 0 0 -6px rgba(0, 50, 126, 0.12), 180px 0 0 -6px rgba(0, 50, 126, 0.12), 181px 0 0 -6px rgba(0, 50, 126, 0.12), 182px 0 0 -6px rgba(0, 50, 126, 0.12), 183px 0 0 -6px rgba(0, 50, 126, 0.12), 184px 0 0 -6px rgba(0, 50, 126, 0.12), 185px 0 0 -6px rgba(0, 50, 126, 0.12), 186px 0 0 -6px rgba(0, 50, 126, 0.12), 187px 0 0 -6px rgba(0, 50, 126, 0.12), 188px 0 0 -6px rgba(0, 50, 126, 0.12), 189px 0 0 -6px rgba(0, 50, 126, 0.12), 190px 0 0 -6px rgba(0, 50, 126, 0.12), 191px 0 0 -6px rgba(0, 50, 126, 0.12), 192px 0 0 -6px rgba(0, 50, 126, 0.12), 193px 0 0 -6px rgba(0, 50, 126, 0.12), 194px 0 0 -6px rgba(0, 50, 126, 0.12), 195px 0 0 -6px rgba(0, 50, 126, 0.12), 196px 0 0 -6px rgba(0, 50, 126, 0.12), 197px 0 0 -6px rgba(0, 50, 126, 0.12), 198px 0 0 -6px rgba(0, 50, 126, 0.12), 199px 0 0 -6px rgba(0, 50, 126, 0.12), 200px 0 0 -6px rgba(0, 50, 126, 0.12), 201px 0 0 -6px rgba(0, 50, 126, 0.12), 202px 0 0 -6px rgba(0, 50, 126, 0.12), 203px 0 0 -6px rgba(0, 50, 126, 0.12), 204px 0 0 -6px rgba(0, 50, 126, 0.12), 205px 0 0 -6px rgba(0, 50, 126, 0.12), 206px 0 0 -6px rgba(0, 50, 126, 0.12), 207px 0 0 -6px rgba(0, 50, 126, 0.12), 208px 0 0 -6px rgba(0, 50, 126, 0.12), 209px 0 0 -6px rgba(0, 50, 126, 0.12), 210px 0 0 -6px rgba(0, 50, 126, 0.12), 211px 0 0 -6px rgba(0, 50, 126, 0.12), 212px 0 0 -6px rgba(0, 50, 126, 0.12), 213px 0 0 -6px rgba(0, 50, 126, 0.12), 214px 0 0 -6px rgba(0, 50, 126, 0.12), 215px 0 0 -6px rgba(0, 50, 126, 0.12), 216px 0 0 -6px rgba(0, 50, 126, 0.12), 217px 0 0 -6px rgba(0, 50, 126, 0.12), 218px 0 0 -6px rgba(0, 50, 126, 0.12), 219px 0 0 -6px rgba(0, 50, 126, 0.12), 220px 0 0 -6px rgba(0, 50, 126, 0.12), 221px 0 0 -6px rgba(0, 50, 126, 0.12), 222px 0 0 -6px rgba(0, 50, 126, 0.12), 223px 0 0 -6px rgba(0, 50, 126, 0.12), 224px 0 0 -6px rgba(0, 50, 126, 0.12), 225px 0 0 -6px rgba(0, 50, 126, 0.12), 226px 0 0 -6px rgba(0, 50, 126, 0.12), 227px 0 0 -6px rgba(0, 50, 126, 0.12), 228px 0 0 -6px rgba(0, 50, 126, 0.12), 229px 0 0 -6px rgba(0, 50, 126, 0.12), 230px 0 0 -6px rgba(0, 50, 126, 0.12), 231px 0 0 -6px rgba(0, 50, 126, 0.12), 232px 0 0 -6px rgba(0, 50, 126, 0.12), 233px 0 0 -6px rgba(0, 50, 126, 0.12), 234px 0 0 -6px rgba(0, 50, 126, 0.12), 235px 0 0 -6px rgba(0, 50, 126, 0.12), 236px 0 0 -6px rgba(0, 50, 126, 0.12), 237px 0 0 -6px rgba(0, 50, 126, 0.12), 238px 0 0 -6px rgba(0, 50, 126, 0.12), 239px 0 0 -6px rgba(0, 50, 126, 0.12), 240px 0 0 -6px rgba(0, 50, 126, 0.12); margin-top: -6px; border: 1px solid rgba(0, 30, 75, 0.12); transition: 0.3s border-color, 0.3s background-color; } .custom-range::-moz-range-track { width: 240px; height: 2px; background: rgba(0, 50, 126, 0.12); } .custom-range::-moz-range-thumb { width: 14px; height: 14px; background: #fff; border-radius: 50px; border: 1px solid rgba(0, 30, 75, 0.12); position: relative; transition: 0.3s border-color, 0.3s background-color; } .custom-range::-moz-range-progress { height: 2px; background: #467fcf; border: 0; margin-top: 0; } .custom-range::-ms-track { background: transparent; border: 0; border-color: transparent; border-radius: 0; border-width: 0; color: transparent; height: 2px; margin-top: 10px; width: 240px; } .custom-range::-ms-thumb { width: 240px; height: 2px; background: #fff; border-radius: 50px; border: 1px solid rgba(0, 30, 75, 0.12); transition: 0.3s border-color, 0.3s background-color; } .custom-range::-ms-fill-lower { background: #467fcf; border-radius: 0; } .custom-range::-ms-fill-upper { background: rgba(0, 50, 126, 0.12); border-radius: 0; } .custom-range::-ms-tooltip { display: none; } .selectgroup { display: -ms-inline-flexbox; display: inline-flex; } .selectgroup-item { -ms-flex-positive: 1; flex-grow: 1; position: relative; } .selectgroup-item + .selectgroup-item { margin-left: -1px; } .selectgroup-item:not(:first-child) .selectgroup-button { border-top-left-radius: 0; border-bottom-left-radius: 0; } .selectgroup-item:not(:last-child) .selectgroup-button { border-top-right-radius: 0; border-bottom-right-radius: 0; } .selectgroup-input { opacity: 0; position: absolute; z-index: -1; top: 0; left: 0; } .selectgroup-button { display: block; border: 1px solid rgba(0, 40, 100, 0.12); text-align: center; padding: 0.375rem 1rem; position: relative; cursor: pointer; border-radius: 3px; color: #9aa0ac; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; font-size: 0.9375rem; line-height: 1.5; min-width: 2.375rem; } .selectgroup-button-icon { padding-left: 0.5rem; padding-right: 0.5rem; font-size: 1.125rem; line-height: 1.125rem; } .selectgroup-input:checked + .selectgroup-button { border-color: #467fcf; z-index: 1; color: #467fcf; background: #edf2fa; } .selectgroup-input:focus + .selectgroup-button { border-color: #467fcf; z-index: 2; color: #467fcf; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .selectgroup-pills { -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-align: start; align-items: flex-start; } .selectgroup-pills .selectgroup-item { margin-right: 0.5rem; -ms-flex-positive: 0; flex-grow: 0; } .selectgroup-pills .selectgroup-button { border-radius: 50px !important; } .custom-switch { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: default; display: -ms-inline-flexbox; display: inline-flex; -ms-flex-align: center; align-items: center; margin: 0; } .custom-switch-input { position: absolute; z-index: -1; opacity: 0; } .custom-switches-stacked { display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; } .custom-switches-stacked .custom-switch { margin-bottom: 0.5rem; } .custom-switch-indicator { flex-shrink: 0; display: inline-block; height: 1.25rem; width: 2.25rem; background: #e9ecef; border-radius: 50px; position: relative; vertical-align: bottom; border: 1px solid rgba(0, 40, 100, 0.12); transition: 0.3s border-color, 0.3s background-color; } [data-theme='dark'] .custom-switch-indicator { opacity: 0.75; } .custom-switch-indicator:before { content: ''; position: absolute; height: calc(1.25rem - 4px); width: calc(1.25rem - 4px); top: 1px; left: 1px; background: #fff; border-radius: 50%; transition: 0.3s left; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); } .custom-switch-input:checked ~ .custom-switch-indicator { background: #467fcf; } .custom-switch-input:checked ~ .custom-switch-indicator:before { left: calc(1rem + 1px); } .custom-switch-input:focus ~ .custom-switch-indicator { box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); border-color: #467fcf; } .custom-switch-description { margin-left: 0.5rem; color: #6e7687; transition: 0.3s color; } .custom-switch-input:checked ~ .custom-switch-description { color: #495057; } .imagecheck { margin: 0; position: relative; cursor: pointer; } .imagecheck-input { position: absolute; z-index: -1; opacity: 0; } .imagecheck-figure { border: 1px solid rgba(0, 40, 100, 0.12); border-radius: 3px; margin: 0; position: relative; } .imagecheck-input:focus ~ .imagecheck-figure { border-color: #467fcf; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .imagecheck-input:checked ~ .imagecheck-figure { border-color: rgba(0, 40, 100, 0.24); } .imagecheck-figure:before { content: ''; position: absolute; top: 0.25rem; left: 0.25rem; display: block; width: 1rem; height: 1rem; pointer-events: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background: #467fcf url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E") no-repeat center center/50% 50%; color: #fff; z-index: 1; border-radius: 3px; opacity: 0; transition: 0.3s opacity; } .imagecheck-input:checked ~ .imagecheck-figure:before { opacity: 1; } .imagecheck-image { max-width: 100%; opacity: 0.64; transition: 0.3s opacity; } .imagecheck-image:first-child { border-top-left-radius: 2px; border-top-right-radius: 2px; } .imagecheck-image:last-child { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } .imagecheck:hover .imagecheck-image, .imagecheck-input:focus ~ .imagecheck-figure .imagecheck-image, .imagecheck-input:checked ~ .imagecheck-figure .imagecheck-image { opacity: 1; } .imagecheck-caption { text-align: center; padding: 0.25rem 0.25rem; color: #9aa0ac; font-size: 0.875rem; transition: 0.3s color; } .imagecheck:hover .imagecheck-caption, .imagecheck-input:focus ~ .imagecheck-figure .imagecheck-caption, .imagecheck-input:checked ~ .imagecheck-figure .imagecheck-caption { color: #495057; } .colorinput { margin: 0; position: relative; cursor: pointer; } .colorinput-input { position: absolute; z-index: -1; opacity: 0; } .colorinput-color { display: inline-block; width: 1.75rem; height: 1.75rem; border-radius: 3px; border: 1px solid rgba(0, 40, 100, 0.12); color: #fff; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); } .colorinput-color:before { content: ''; opacity: 0; position: absolute; top: 0.25rem; left: 0.25rem; height: 1.25rem; width: 1.25rem; transition: 0.3s opacity; background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E") no-repeat center center/50% 50%; } .colorinput-input:checked ~ .colorinput-color:before { opacity: 1; } .colorinput-input:focus ~ .colorinput-color { border-color: #467fcf; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .timeline { position: relative; margin: 0 0 2rem; padding: 0; list-style: none; } .timeline:before { background-color: #e9ecef; position: absolute; display: block; content: ''; width: 1px; height: 100%; top: 0; bottom: 0; left: 4px; } .timeline-item { position: relative; display: -ms-flexbox; display: flex; padding-left: 2rem; margin: 0.5rem 0; } .timeline-item:first-child:before, .timeline-item:last-child:before { content: ''; position: absolute; background: #fff; width: 1px; left: 0.25rem; } .timeline-item:first-child { margin-top: 0; } .timeline-item:first-child:before { top: 0; height: 0.5rem; } .timeline-item:last-child { margin-bottom: 0; } .timeline-item:last-child:before { top: 0.5rem; bottom: 0; } .timeline-badge { position: absolute; display: block; width: 0.4375rem; height: 0.4375rem; left: 1px; top: 0.5rem; border-radius: 100%; border: 1px solid #fff; background: #adb5bd; } .timeline-time { white-space: nowrap; margin-left: auto; color: #9aa0ac; font-size: 87.5%; } .payment { width: 2.5rem; height: 1.5rem; display: inline-block; background: no-repeat center/100% 100%; vertical-align: bottom; font-style: normal; box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.1); border-radius: 2px; } svg { -ms-touch-action: none; touch-action: none; } .jvectormap-container { width: 100%; height: 100%; position: relative; overflow: hidden; -ms-touch-action: none; touch-action: none; } .jvectormap-tip { position: absolute; display: none; border-radius: 3px; background: #212529; color: white; padding: 6px; font-size: 11px; line-height: 1; font-weight: 700; } .jvectormap-tip small { font-size: inherit; font-weight: 400; } .jvectormap-zoomin, .jvectormap-zoomout, .jvectormap-goback { position: absolute; left: 10px; border-radius: 3px; background: #292929; padding: 3px; color: white; cursor: pointer; line-height: 10px; text-align: center; box-sizing: content-box; } .jvectormap-zoomin, .jvectormap-zoomout { width: 10px; height: 10px; } .jvectormap-zoomin { top: 10px; } .jvectormap-zoomout { top: 30px; } .jvectormap-goback { bottom: 10px; z-index: 1000; padding: 6px; } .jvectormap-spinner { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: url(data:image/gif;base64,R0lGODlhIAAgAPMAAP///wAAAMbGxoSEhLa2tpqamjY2NlZWVtjY2OTk5Ly8vB4eHgQEBAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ/V/nmOM82XiHRLYKhKP1oZmADdEAAAh+your_sha256_hash8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY/CZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB+A4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6+your_sha256_hashSR92E4lbFoq+B6QDtuetcaBPnW6+O7wDHpIiK9SaVK5GgV543tzjgGcghAgAh+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK++G+w48edZPK+your_sha256_hashpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE+G+your_sha256_hashyour_sha256_hashjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm+FNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk+aV+your_sha256_hashyour_sha256_hashHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashTg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/your_sha256_hashJ0uIiRMDjI0Fd30/your_sha256_hashyour_sha256_hashBNqITT3xEgfLpBtzE/jiuL04RGEBgwWhShRgQExHBAAh+your_sha256_hashyour_sha256_hashqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR+your_sha256_hashyour_sha256_hashyour_sha256_hashEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashq+E71SRQeyqUToLA7VxF0JDyIQh/your_sha256_hashJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY+your_sha256_hashyour_sha256_hashvFPJd+MFCN6HAAIKgNggY0KtEBAAh+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hash1+vsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d+your_sha256_hashyour_sha256_hashQLKF0tYGKYSg+ygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0+bm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h+Kr0SJ8MFihpNbx+4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX+your_sha256_hashAAAA==); } .jvectormap-legend-title { font-weight: bold; font-size: 14px; text-align: center; } .jvectormap-legend-cnt { position: absolute; } .jvectormap-legend-cnt-h { bottom: 0; right: 0; } .jvectormap-legend-cnt-v { top: 0; right: 0; } .jvectormap-legend { background: black; color: white; border-radius: 3px; } .jvectormap-legend-cnt-h .jvectormap-legend { float: left; margin: 0 10px 10px 0; padding: 3px 3px 1px 3px; } .jvectormap-legend-cnt-h .jvectormap-legend .jvectormap-legend-tick { float: left; } .jvectormap-legend-cnt-v .jvectormap-legend { margin: 10px 10px 0 0; padding: 3px; } .jvectormap-legend-cnt-h .jvectormap-legend-tick { width: 40px; } .jvectormap-legend-cnt-h .jvectormap-legend-tick-sample { height: 15px; } .jvectormap-legend-cnt-v .jvectormap-legend-tick-sample { height: 20px; width: 20px; display: inline-block; vertical-align: middle; } .jvectormap-legend-tick-text { font-size: 12px; } .jvectormap-legend-cnt-h .jvectormap-legend-tick-text { text-align: center; } .jvectormap-legend-cnt-v .jvectormap-legend-tick-text { display: inline-block; vertical-align: middle; line-height: 20px; padding-left: 3px; } /** * selectize.css (v0.12.4) * * path_to_url * * Unless required by applicable law or agreed to in writing, software distributed under * * @author Brian Reavis <brian@thirdroute.com> */ .selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder { visibility: visible !important; background: #f2f2f2 !important; background: rgba(0, 0, 0, 0.06) !important; border: 0 none !important; box-shadow: inset 0 0 12px 4px #fff; } .selectize-control.plugin-drag_drop .ui-sortable-placeholder::after { content: '!'; visibility: hidden; } .selectize-control.plugin-drag_drop .ui-sortable-helper { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); } .selectize-dropdown-header { position: relative; padding: 5px 8px; border-bottom: 1px solid #d0d0d0; background: #f8f8f8; border-radius: 3px 3px 0 0; } .selectize-dropdown-header-close { position: absolute; right: 8px; top: 50%; color: #495057; opacity: 0.4; margin-top: -12px; line-height: 20px; font-size: 20px !important; } .selectize-dropdown-header-close:hover { color: #000; } .selectize-dropdown.plugin-optgroup_columns .optgroup { border-right: 1px solid #f2f2f2; border-top: 0 none; float: left; box-sizing: border-box; } .selectize-dropdown.plugin-optgroup_columns .optgroup:last-child { border-right: 0 none; } .selectize-dropdown.plugin-optgroup_columns .optgroup:before { display: none; } .selectize-dropdown.plugin-optgroup_columns .optgroup-header { border-top: 0 none; } .selectize-control.plugin-remove_button [data-value] { position: relative; padding-right: 24px !important; } .selectize-control.plugin-remove_button [data-value] .remove { z-index: 1; /* fixes ie bug (see #392) */ position: absolute; top: 0; right: 0; bottom: 0; width: 17px; text-align: center; font-weight: bold; font-size: 12px; color: inherit; text-decoration: none; vertical-align: middle; display: inline-block; padding: 2px 0 0 0; border-left: 1px solid #d0d0d0; border-radius: 0 2px 2px 0; box-sizing: border-box; } .selectize-control.plugin-remove_button [data-value] .remove:hover { background: rgba(0, 0, 0, 0.05); } .selectize-control.plugin-remove_button [data-value].active .remove { border-left-color: #cacaca; } .selectize-control.plugin-remove_button .disabled [data-value] .remove:hover { background: none; } .selectize-control.plugin-remove_button .disabled [data-value] .remove { border-left-color: #fff; } .selectize-control.plugin-remove_button .remove-single { position: absolute; right: 28px; top: 6px; font-size: 23px; } .selectize-control { position: relative; padding: 0; border: 0; } .selectize-dropdown, .selectize-input, .selectize-input input { color: #495057; font-family: inherit; font-size: 15px; line-height: 18px; -webkit-font-smoothing: inherit; } .selectize-input, .selectize-control.single .selectize-input.input-active { background: #fff; cursor: text; display: inline-block; } .selectize-input { border: 1px solid rgba(0, 40, 100, 0.12); padding: 0.5625rem 0.75rem; display: inline-block; display: block; width: 100%; overflow: hidden; position: relative; z-index: 1; box-sizing: border-box; border-radius: 3px; transition: 0.3s border-color, 0.3s box-shadow; } .selectize-control.multi .selectize-input.has-items { padding: 7px 0.75rem 4px 7px; } .selectize-input.full { background-color: #fff; } .selectize-input.disabled, .selectize-input.disabled * { cursor: default !important; } .selectize-input.focus { border-color: #467fcf; box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25); } .selectize-input.dropdown-active { border-radius: 3px 3px 0 0; } .selectize-input > * { vertical-align: baseline; display: -moz-inline-stack; display: inline-block; zoom: 1; *display: inline; } .selectize-control.multi .selectize-input > div { cursor: pointer; margin: 0 3px 3px 0; padding: 2px 6px; background: #e9ecef; color: #495057; font-size: 13px; border: 0 solid rgba(0, 40, 100, 0.12); border-radius: 3px; font-weight: 400; } .selectize-control.multi .selectize-input > div.active { background: #e8e8e8; color: #303030; border: 0 solid #cacaca; } .selectize-control.multi .selectize-input.disabled > div, .selectize-control.multi .selectize-input.disabled > div.active { color: #7d7d7d; background: #fff; border: 0 solid #fff; } .selectize-input > input { display: inline-block !important; padding: 0 !important; min-height: 0 !important; max-height: none !important; max-width: 100% !important; margin: 0 2px 0 0 !important; text-indent: 0 !important; border: 0 none !important; background: none !important; line-height: inherit !important; box-shadow: none !important; } .selectize-input > input::-ms-clear { display: none; } .selectize-input > input:focus { outline: none !important; } .selectize-input::after { content: ' '; display: block; clear: left; } .selectize-input.dropdown-active::before { content: ' '; display: block; position: absolute; background: #f0f0f0; height: 1px; bottom: 0; left: 0; right: 0; } .selectize-dropdown { position: absolute; z-index: 10; border: 1px solid rgba(0, 40, 100, 0.12); background: #fff; margin: -1px 0 0 0; border-top: 0 none; box-sizing: border-box; border-radius: 0 0 3px 3px; height: auto; padding: 0; } .selectize-dropdown [data-selectable] { cursor: pointer; overflow: hidden; } .selectize-dropdown [data-selectable] .highlight { background: rgba(125, 168, 208, 0.2); border-radius: 1px; } .selectize-dropdown [data-selectable], .selectize-dropdown .optgroup-header { padding: 6px 0.75rem; } .selectize-dropdown .optgroup:first-child .optgroup-header { border-top: 0 none; } .selectize-dropdown .optgroup-header { color: #495057; background: #fff; cursor: default; } .selectize-dropdown .active { background-color: #f1f4f8; color: #467fcf; } .selectize-dropdown .active.create { color: #495057; } .selectize-dropdown .create { color: rgba(48, 48, 48, 0.5); } .selectize-dropdown-content { overflow-y: auto; overflow-x: hidden; max-height: 200px; -webkit-overflow-scrolling: touch; } .selectize-control.single .selectize-input, .selectize-control.single .selectize-input input { cursor: pointer; } .selectize-control.single .selectize-input.input-active, .selectize-control.single .selectize-input.input-active input { cursor: text; } .selectize-control.single .selectize-input:after { content: ''; display: block; position: absolute; top: 13px; right: 12px; width: 8px; height: 10px; background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='path_to_url viewBox='0 0 10 5'%3E%3Cpath fill='#999' d='M0 0L10 0L5 5L0 0'/%3E%3C/svg%3E") no-repeat center; background-size: 8px 10px; transition: 0.3s transform; } .selectize-control.single .selectize-input.dropdown-active:after { -webkit-transform: rotate(180deg); transform: rotate(180deg); } .selectize-control .selectize-input.disabled { opacity: 0.5; background-color: #fafafa; } .selectize-dropdown .image, .selectize-input .image { width: 1.25rem; height: 1.25rem; background-size: contain; margin: -1px 0.5rem -1px -4px; line-height: 1.25rem; float: left; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; } .selectize-dropdown .image img, .selectize-input .image img { max-width: 100%; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4); border-radius: 2px; } .selectize-input .image { width: 1.5rem; height: 1.5rem; margin: -3px 0.75rem -3px -5px; } .fe { speak: none; text-transform: none; line-height: 1; } .fe:before { content: ''; display: inline-block; width: 15px; height: 15px; background-size: 100%; background-repeat: no-repeat; } /* stylelint-enable */ ```
/content/code_sandbox/client/src/components/ui/Tabler.css
css
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
102,432
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <meta name="google" content="notranslate"> <meta http-equiv="x-dns-prefetch-control" content="off"> <meta name="mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-180x180.png" /> <link rel="mask-icon" href="assets/safari-pinned-tab.svg" color="#67B279"> <link rel="icon" type="image/png" href="assets/favicon.png" sizes="48x48"> <title>AdGuard Home</title> <style> .wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; } [data-theme="DARK"] .wrapper { background-color: #f5f7fb; } </style> </head> <body> <noscript> You need to enable JavaScript to run this app. </noscript> <div id="root"> <div class="wrapper"></div> </div> <script> (function() { var LOCAL_STORAGE_THEME_KEY = 'account_theme'; var theme = 'light'; try { theme = window.localStorage.getItem(LOCAL_STORAGE_THEME_KEY); } catch(e) { console.error(e); } document.body.dataset.theme = theme; })(); </script> </body> </html> ```
/content/code_sandbox/client/public/index.html
html
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
409
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <meta name="google" content="notranslate"> <meta name="mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-180x180.png" /> <link rel="mask-icon" href="assets/safari-pinned-tab.svg" color="#67B279"> <link rel="icon" type="image/png" href="assets/favicon.png" sizes="48x48"> <title>Setup AdGuard Home</title> </head> <body> <noscript> You need to enable JavaScript to run this app. </noscript> <div id="root"></div> </body> </html> ```
/content/code_sandbox/client/public/install.html
html
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
243
```html <!DOCTYPE html> <html> <head> <title>AdGuard Home API</title> <!-- needed for adaptive design --> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="path_to_url|Roboto:300,400,700" rel="stylesheet"> <!-- ReDoc doesn't change outer page styles --> <style> body { margin: 0; padding: 0; } </style> </head> <body> <redoc spec-url='path_to_url <script src="path_to_url"> </script> </body> </html> ```
/content/code_sandbox/openapi/index.html
html
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
155
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> <meta name="google" content="notranslate"> <link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-180x180.png" /> <meta name="mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <link rel="mask-icon" href="assets/safari-pinned-tab.svg" color="#67B279"> <link rel="icon" type="image/png" href="assets/favicon.png" sizes="48x48"> <title>Login</title> </head> <body> <noscript> You need to enable JavaScript to run this app. </noscript> <div id="root"></div> <script> (function() { var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; var currentTheme = prefersDark ? 'dark' : 'light'; document.body.dataset.theme = currentTheme; })(); </script> </body> </html> ```
/content/code_sandbox/client/public/login.html
html
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
301
```yaml 'openapi': '3.0.3' 'info': 'title': 'AdGuard Home' 'description': > AdGuard Home REST-ish API. Our admin web interface is built on top of this REST-ish API. 'version': '0.107' 'contact': 'name': 'AdGuard Home' 'url': 'path_to_url 'servers': - 'url': '/control' 'security': - 'basicAuth': [] 'tags': - 'name': 'clients' 'description': 'Clients list operations' - 'name': 'dhcp' 'description': 'Built-in DHCP server controls' - 'name': 'filtering' 'description': 'Rule-based filtering' - 'name': 'global' 'description': 'AdGuard Home server general settings and controls' - 'name': 'i18n' 'description': 'Application localization' - 'name': 'install' 'description': 'First-time install configuration handlers' - 'name': 'log' 'description': 'AdGuard Home query log' - 'name': 'mobileconfig' 'description': 'Apple .mobileconfig' - 'name': 'parental' 'description': 'Blocking adult and explicit materials' - 'name': 'safebrowsing' 'description': 'Blocking malware/phishing sites' - 'name': 'safesearch' 'description': 'Enforce family-friendly results in search engines' - 'name': 'stats' 'description': 'AdGuard Home statistics' - 'name': 'tls' 'description': 'AdGuard Home HTTPS/DoH/DoQ/DoT settings' 'paths': '/status': 'get': 'tags': - 'global' 'operationId': 'status' 'summary': 'Get DNS server current status and general settings' 'responses': '200': 'description': 'OK' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/ServerStatus' '/dns_info': 'get': 'tags': - 'global' 'operationId': 'dnsInfo' 'summary': 'Get general DNS parameters' 'responses': '200': 'description': 'OK' 'content': 'application/json': 'schema': 'allOf': - '$ref': '#/components/schemas/DNSConfig' - 'type': 'object' 'properties': 'default_local_ptr_upstreams': 'type': 'array' 'items': 'type': 'string' 'example': - '192.168.168.192' - '10.0.0.10' '/dns_config': 'post': 'tags': - 'global' 'operationId': 'dnsConfig' 'summary': 'Set general DNS parameters' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/DNSConfig' 'responses': '200': 'description': 'OK' '/protection': 'post': 'tags': - 'global' 'operationId': 'setProtection' 'summary': 'Set protection state and duration' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/SetProtectionRequest' 'responses': '200': 'description': 'OK' '/cache_clear': 'post': 'tags': - 'global' 'operationId': 'cacheClear' 'summary': 'Clear DNS cache' 'responses': '200': 'description': 'OK' '/test_upstream_dns': 'post': 'tags': - 'global' 'operationId': 'testUpstreamDNS' 'summary': 'Test upstream configuration' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/UpstreamsConfig' 'description': 'Upstream configuration to be tested' 'responses': '200': 'description': > Status of testing each requested server, with "OK" meaning that server works, any other text means an error. 'content': 'application/json': 'schema': '$ref': '#/components/schemas/UpstreamsConfigResponse' 'examples': 'response': 'value': '1.1.1.1': 'OK' '1.0.0.1': 'OK' '8.8.8.8': 'OK' '8.8.4.4': 'OK' '192.168.1.104:53535': > upstream "192.168.1.104:1234" fails to exchange: couldn't communicate with upstream: read udp 192.168.1.100:60675->8.8.8.8:1234: i/o timeout '/version.json': 'post': 'tags': - 'global' 'operationId': 'getVersionJson' 'summary': > Gets information about the latest available version of AdGuard 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetVersionRequest' 'required': true 'responses': '200': 'description': > Version info. If response message is empty, UI does not show a version update message. 'content': 'application/json': 'schema': '$ref': '#/components/schemas/VersionInfo' '500': 'description': 'Cannot write answer' '502': 'description': 'Cannot retrieve the version.json file contents' '/update': 'post': 'tags': - 'global' 'operationId': 'beginUpdate' 'summary': 'Begin auto-upgrade procedure' 'responses': '200': 'description': 'OK.' '500': 'description': 'Failed' '/querylog': 'get': 'tags': - 'log' 'operationId': 'queryLog' 'summary': 'Get DNS server query log.' 'parameters': - 'name': 'older_than' 'in': 'query' 'description': 'Filter by older than' 'schema': 'type': 'string' - 'name': 'offset' 'in': 'query' 'description': > Specify the ranking number of the first item on the page. Even though it is possible to use "offset" and "older_than", we recommend choosing one of them and sticking to it. 'schema': 'type': 'integer' - 'name': 'limit' 'in': 'query' 'description': 'Limit the number of records to be returned' 'schema': 'type': 'integer' - 'name': 'search' 'in': 'query' 'description': 'Filter by domain name or client IP' 'schema': 'type': 'string' - 'name': 'response_status' 'in': 'query' 'description': 'Filter by response status' 'schema': 'type': 'string' 'enum': - 'all' - 'filtered' - 'blocked' - 'blocked_safebrowsing' - 'blocked_parental' - 'whitelisted' - 'rewritten' - 'safe_search' - 'processed' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/QueryLog' '/querylog_info': 'get': 'deprecated': true 'description': | Deprecated: Use `GET /querylog/config` instead. NOTE: If `interval` was configured by editing configuration file or new HTTP API call `PUT /querylog/config/update` and it's not equal to previous allowed enum values then it will be equal to `90` days for compatibility reasons. 'tags': - 'log' 'operationId': 'queryLogInfo' 'summary': 'Get query log parameters' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/QueryLogConfig' '/querylog_config': 'post': 'deprecated': true 'description': > Deprecated: Use `PUT /querylog/config/update` instead. 'tags': - 'log' 'operationId': 'queryLogConfig' 'summary': 'Set query log parameters' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/QueryLogConfig' 'responses': '200': 'description': 'OK.' '/querylog_clear': 'post': 'tags': - 'log' 'operationId': 'querylogClear' 'summary': 'Clear query log' 'responses': '200': 'description': 'OK.' '/querylog/config': 'get': 'tags': - 'log' 'operationId': 'getQueryLogConfig' 'summary': 'Get query log parameters' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetQueryLogConfigResponse' '/querylog/config/update': 'put': 'tags': - 'log' 'operationId': 'putQueryLogConfig' 'summary': 'Set query log parameters' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PutQueryLogConfigUpdateRequest' 'required': true 'responses': '200': 'description': 'OK.' '/stats': 'get': 'tags': - 'stats' 'operationId': 'stats' 'summary': 'Get DNS server statistics' 'responses': '200': 'description': 'Returns statistics data' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Stats' '/stats_reset': 'post': 'tags': - 'stats' 'operationId': 'statsReset' 'summary': 'Reset all statistics to zeroes' 'responses': '200': 'description': 'OK.' '/stats_info': 'get': 'deprecated': true 'description': | Deprecated: Use `GET /stats/config` instead. NOTE: If `interval` was configured by editing configuration file or new HTTP API call `PUT /stats/config/update` and it's not equal to previous allowed enum values then it will be equal to `90` days for compatibility reasons. 'tags': - 'stats' 'operationId': 'statsInfo' 'summary': 'Get statistics parameters' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/StatsConfig' '/stats_config': 'post': 'deprecated': true 'description': > Deprecated: Use `PUT /stats/config/update` instead. 'tags': - 'stats' 'operationId': 'statsConfig' 'summary': 'Set statistics parameters' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/StatsConfig' 'responses': '200': 'description': 'OK.' '/stats/config': 'get': 'tags': - 'stats' 'operationId': 'getStatsConfig' 'summary': 'Get statistics parameters' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetStatsConfigResponse' '/stats/config/update': 'put': 'tags': - 'stats' 'operationId': 'putStatsConfig' 'summary': 'Set statistics parameters' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PutStatsConfigUpdateRequest' 'required': true 'responses': '200': 'description': 'OK.' '/tls/status': 'get': 'tags': - 'tls' 'operationId': 'tlsStatus' 'summary': 'Returns TLS configuration and its status' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/TlsConfig' '/tls/configure': 'post': 'tags': - 'tls' 'operationId': 'tlsConfigure' 'summary': 'Updates current TLS configuration' 'requestBody': '$ref': '#/components/requestBodies/TlsConfig' 'responses': '200': 'description': 'TLS configuration and its status' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/TlsConfig' '400': 'description': 'Invalid configuration or unavailable port' '500': 'description': 'Error occurred while applying configuration' '/tls/validate': 'post': 'tags': - 'tls' 'operationId': 'tlsValidate' 'summary': 'Checks if the current TLS configuration is valid' 'requestBody': '$ref': '#/components/requestBodies/TlsConfig' 'responses': '200': 'description': 'TLS configuration and its status' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/TlsConfig' '400': 'description': 'Invalid configuration or unavailable port' '/dhcp/status': 'get': 'tags': - 'dhcp' 'operationId': 'dhcpStatus' 'summary': 'Gets the current DHCP settings and status' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/DhcpStatus' '500': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/interfaces': 'get': 'tags': - 'dhcp' 'operationId': 'dhcpInterfaces' 'summary': 'Gets the available interfaces' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/NetInterfaces' '500': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/set_config': 'post': 'tags': - 'dhcp' 'operationId': 'dhcpSetConfig' 'summary': 'Updates the current DHCP server configuration' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/DhcpConfig' 'responses': '200': 'description': 'OK.' '501': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/find_active_dhcp': 'post': 'tags': - 'dhcp' 'operationId': 'checkActiveDhcp' 'summary': 'Searches for an active DHCP server on the network' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/DhcpFindActiveReq' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/DhcpSearchResult' '501': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/add_static_lease': 'post': 'tags': - 'dhcp' 'operationId': 'dhcpAddStaticLease' 'summary': 'Adds a static lease' 'requestBody': '$ref': '#/components/requestBodies/DhcpStaticLease' 'responses': '200': 'description': 'OK.' '501': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/remove_static_lease': 'post': 'tags': - 'dhcp' 'operationId': 'dhcpRemoveStaticLease' 'summary': 'Removes a static lease' 'requestBody': '$ref': '#/components/requestBodies/DhcpStaticLease' 'responses': '200': 'description': 'OK.' '501': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/update_static_lease': 'post': 'tags': - 'dhcp' 'operationId': 'dhcpUpdateStaticLease' 'description': > Updates IP address, hostname of the static lease. IP version must be the same as previous. 'summary': 'Updates a static lease' 'requestBody': '$ref': '#/components/requestBodies/DhcpStaticLease' 'responses': '200': 'description': 'OK.' '501': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/reset': 'post': 'tags': - 'dhcp' 'operationId': 'dhcpReset' 'summary': 'Reset DHCP configuration' 'responses': '200': 'description': 'OK.' '501': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/dhcp/reset_leases': 'post': 'tags': - 'dhcp' 'operationId': 'dhcpResetLeases' 'summary': 'Reset DHCP leases' 'responses': '200': 'description': 'OK.' '501': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Not implemented (for example, on Windows).' '/filtering/status': 'get': 'tags': - 'filtering' 'operationId': 'filteringStatus' 'summary': 'Get filtering parameters' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/FilterStatus' '/filtering/config': 'post': 'tags': - 'filtering' 'operationId': 'filteringConfig' 'summary': 'Set filtering parameters' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/FilterConfig' 'required': true 'responses': '200': 'description': 'OK.' '/filtering/add_url': 'post': 'tags': - 'filtering' 'operationId': 'filteringAddURL' 'summary': 'Add filter URL or an absolute file path' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/AddUrlRequest' 'required': true 'responses': '200': 'description': 'OK.' '/filtering/remove_url': 'post': 'tags': - 'filtering' 'operationId': 'filteringRemoveURL' 'summary': 'Remove filter URL' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/RemoveUrlRequest' 'required': true 'responses': '200': 'description': 'OK.' '/filtering/set_url': 'post': 'tags': - 'filtering' 'operationId': 'filteringSetURL' 'summary': 'Set URL parameters' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/FilterSetUrl' 'responses': '200': 'description': 'OK.' '/filtering/refresh': 'post': 'tags': - 'filtering' 'operationId': 'filteringRefresh' 'summary': > Reload filtering rules from URLs. This might be needed if new URL was just added and you don't want to wait for automatic refresh to kick in. This API request is ratelimited, so you can call it freely as often as you like, it wont create unnecessary burden on servers that host the URL. This should work as intended, a `force` parameter is offered as last-resort attempt to make filter lists fresh. If you ever find yourself using `force` to make something work that otherwise wont, this is a bug and report it accordingly. 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/FilterRefreshRequest' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/FilterRefreshResponse' '/filtering/set_rules': 'post': 'tags': - 'filtering' 'operationId': 'filteringSetRules' 'summary': 'Set user-defined filter rules' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/SetRulesRequest' 'description': 'Custom filtering rules.' 'responses': '200': 'description': 'OK.' '/filtering/check_host': 'get': 'tags': - 'filtering' 'operationId': 'filteringCheckHost' 'summary': 'Check if host name is filtered' 'parameters': - 'name': 'name' 'in': 'query' 'description': 'Filter by host name' 'schema': 'type': 'string' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/FilterCheckHostResponse' '/safebrowsing/enable': 'post': 'tags': - 'safebrowsing' 'operationId': 'safebrowsingEnable' 'summary': 'Enable safebrowsing' 'responses': '200': 'description': 'OK.' '/safebrowsing/disable': 'post': 'tags': - 'safebrowsing' 'operationId': 'safebrowsingDisable' 'summary': 'Disable safebrowsing' 'responses': '200': 'description': 'OK.' '/safebrowsing/status': 'get': 'tags': - 'safebrowsing' 'operationId': 'safebrowsingStatus' 'summary': 'Get safebrowsing status' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': 'type': 'object' 'properties': 'enabled': 'type': 'boolean' 'examples': 'response': 'value': 'enabled': false '/parental/enable': 'post': 'tags': - 'parental' 'operationId': 'parentalEnable' 'summary': 'Enable parental filtering' 'responses': '200': 'description': 'OK.' '/parental/disable': 'post': 'tags': - 'parental' 'operationId': 'parentalDisable' 'summary': 'Disable parental filtering' 'responses': '200': 'description': 'OK.' '/parental/status': 'get': 'tags': - 'parental' 'operationId': 'parentalStatus' 'summary': 'Get parental filtering status' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': 'type': 'object' 'properties': 'enable': 'type': 'boolean' 'sensitivity': 'type': 'integer' 'examples': 'response': 'value': 'enabled': true 'sensitivity': 13 '/safesearch/enable': 'post': 'deprecated': true 'tags': - 'safesearch' 'operationId': 'safesearchEnable' 'summary': 'Enable safesearch' 'responses': '200': 'description': 'OK.' '/safesearch/disable': 'post': 'deprecated': true 'tags': - 'safesearch' 'operationId': 'safesearchDisable' 'summary': 'Disable safesearch' 'responses': '200': 'description': 'OK.' '/safesearch/settings': 'put': 'tags': - 'safesearch' 'operationId': 'safesearchSettings' 'summary': 'Update safesearch settings' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/SafeSearchConfig' 'responses': '200': 'description': 'OK.' '/safesearch/status': 'get': 'tags': - 'safesearch' 'operationId': 'safesearchStatus' 'summary': 'Get safesearch status' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/SafeSearchConfig' '/clients': 'get': 'tags': - 'clients' 'operationId': 'clientsStatus' 'summary': 'Get information about configured clients' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Clients' '/clients/add': 'post': 'tags': - 'clients' 'operationId': 'clientsAdd' 'summary': 'Add a new client' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Client' 'required': true 'responses': '200': 'description': 'OK.' '/clients/delete': 'post': 'tags': - 'clients' 'operationId': 'clientsDelete' 'summary': 'Remove a client' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/ClientDelete' 'required': true 'responses': '200': 'description': 'OK.' '/clients/update': 'post': 'tags': - 'clients' 'operationId': 'clientsUpdate' 'summary': 'Update client information' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/ClientUpdate' 'required': true 'responses': '200': 'description': 'OK.' '/clients/find': 'get': 'tags': - 'clients' 'operationId': 'clientsFind' 'summary': > Get information about clients by their IP addresses or ClientIDs. 'parameters': - 'name': 'ip0' 'in': 'query' 'description': > Filter by IP address or ClientIDs. Parameters with names `ip1`, `ip2`, and so on are also accepted and interpreted as "ip0 OR ip1 OR ip2". TODO(a.garipov): Replace with a better query API. 'schema': 'type': 'string' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/ClientsFindResponse' '/access/list': 'get': 'operationId': 'accessList' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/AccessListResponse' 'summary': 'List (dis)allowed clients, blocked hosts, etc.' 'tags': - 'clients' '/access/set': 'post': 'operationId': 'accessSet' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/AccessSetRequest' 'required': true 'responses': '200': 'description': 'OK.' '400': 'description': > Failed to parse JSON or cannot save the list. '500': 'description': 'Internal error.' 'summary': 'Set (dis)allowed clients, blocked hosts, etc.' 'tags': - 'clients' '/blocked_services/services': 'get': 'deprecated': true 'description': > Deprecated: Use `GET /blocked_services/all` instead. 'tags': - 'blocked_services' 'operationId': 'blockedServicesAvailableServices' 'summary': 'Get available services to use for blocking' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/BlockedServicesArray' '/blocked_services/all': 'get': 'tags': - 'blocked_services' 'operationId': 'blockedServicesAll' 'summary': 'Get available services to use for blocking' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/BlockedServicesAll' '/blocked_services/list': 'get': 'deprecated': true 'description': > Deprecated: Use `GET /blocked_services/get` instead. 'tags': - 'blocked_services' 'operationId': 'blockedServicesList' 'summary': 'Get blocked services list' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/BlockedServicesArray' '/blocked_services/set': 'post': 'deprecated': true 'description': > Deprecated: Use `PUT /blocked_services/update` instead. 'tags': - 'blocked_services' 'operationId': 'blockedServicesSet' 'summary': 'Set blocked services list' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/BlockedServicesArray' 'responses': '200': 'description': 'OK.' '/blocked_services/get': 'get': 'tags': - 'blocked_services' 'operationId': 'blockedServicesSchedule' 'summary': 'Get blocked services' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/BlockedServicesSchedule' '/blocked_services/update': 'put': 'tags': - 'blocked_services' 'operationId': 'blockedServicesScheduleUpdate' 'summary': 'Update blocked services' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/BlockedServicesSchedule' 'required': true 'responses': '200': 'description': 'OK.' '/rewrite/list': 'get': 'tags': - 'rewrite' 'operationId': 'rewriteList' 'summary': 'Get list of Rewrite rules' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/RewriteList' '/rewrite/add': 'post': 'tags': - 'rewrite' 'operationId': 'rewriteAdd' 'summary': 'Add a new Rewrite rule' 'requestBody': '$ref': '#/components/requestBodies/RewriteEntry' 'responses': '200': 'description': 'OK.' '/rewrite/delete': 'post': 'tags': - 'rewrite' 'operationId': 'rewriteDelete' 'summary': 'Remove a Rewrite rule' 'requestBody': '$ref': '#/components/requestBodies/RewriteEntry' 'responses': '200': 'description': 'OK.' '/rewrite/update': 'put': 'tags': - 'rewrite' 'operationId': 'rewriteUpdate' 'summary': 'Update a Rewrite rule' 'requestBody': '$ref': '#/components/requestBodies/RewriteUpdate' 'responses': '200': 'description': 'OK.' '/i18n/change_language': 'post': 'deprecated': true 'description': > Deprecated: Use `PUT /control/profile` instead. 'tags': - 'i18n' 'operationId': 'changeLanguage' 'summary': > Change current language. Argument must be an ISO 639-1 two-letter code. 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/LanguageSettings' 'description': > New language. It must be known to the server and must be an ISO 639-1 two-letter code. 'responses': '200': 'description': 'OK.' '/i18n/current_language': 'get': 'deprecated': true 'description': > Deprecated: Use `GET /control/profile` instead. 'tags': - 'i18n' 'operationId': 'currentLanguage' 'summary': > Get currently set language. Result is ISO 639-1 two-letter code. Empty result means default language. 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/LanguageSettings' '/install/get_addresses': 'get': 'tags': - 'install' 'operationId': 'installGetAddresses' 'summary': 'Gets the network interfaces information.' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/AddressesInfo' '/install/check_config': 'post': 'tags': - 'install' 'operationId': 'installCheckConfig' 'summary': 'Checks configuration' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/CheckConfigRequest' 'description': 'Configuration to be checked' 'required': true 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/CheckConfigResponse' '400': 'description': > Failed to parse JSON or cannot listen on the specified address. '/install/configure': 'post': 'tags': - 'install' 'operationId': 'installConfigure' 'summary': 'Applies the initial configuration.' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/InitialConfiguration' 'description': 'Initial configuration JSON' 'required': true 'responses': '200': 'description': 'OK.' '400': 'description': > Failed to parse initial configuration or cannot listen to the specified addresses. '422': 'description': > The specified password does not meet the strength requirements. '500': 'description': 'Cannot start the DNS server' '/login': 'post': 'tags': - 'global' 'operationId': 'login' 'summary': 'Perform administrator log-in' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Login' 'required': true 'responses': '200': 'description': 'OK.' '400': 'description': > Invalid username or password. '429': 'description': > Out of login attempts. '/logout': 'get': 'tags': - 'global' 'operationId': 'logout' 'summary': 'Perform administrator log-out' 'responses': '302': 'description': 'OK.' '/profile/update': 'put': 'tags': - 'global' 'operationId': 'updateProfile' 'summary': 'Updates current user info' 'requestBody': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/ProfileInfo' 'responses': '200': 'description': 'OK' '/profile': 'get': 'tags': - 'global' 'operationId': 'getProfile' 'summary': '' 'responses': '200': 'description': 'OK.' 'content': 'application/json': 'schema': '$ref': '#/components/schemas/ProfileInfo' '/apple/doh.mobileconfig': 'get': 'operationId': 'mobileConfigDoH' 'parameters': - 'description': > Host for which the config is generated. If no host is provided, `tls.server_name` from the configuration file is used. If `tls.server_name` is not set, the API returns an error with a 500 status. 'example': 'example.org' 'in': 'query' 'name': 'host' 'required': true 'schema': 'type': 'string' - 'description': > ClientID. 'example': 'client-1' 'in': 'query' 'name': 'client_id' 'schema': 'type': 'string' 'responses': '200': 'description': 'DNS over HTTPS plist file.' '500': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Server configuration error.' 'summary': 'Get DNS over HTTPS .mobileconfig.' 'tags': - 'mobileconfig' - 'global' '/apple/dot.mobileconfig': 'get': 'operationId': 'mobileConfigDoT' 'parameters': - 'description': > Host for which the config is generated. If no host is provided, `tls.server_name` from the configuration file is used. If `tls.server_name` is not set, the API returns an error with a 500 status. 'example': 'example.org' 'in': 'query' 'name': 'host' 'required': true 'schema': 'type': 'string' - 'description': > ClientID. 'example': 'client-1' 'in': 'query' 'name': 'client_id' 'schema': 'type': 'string' 'responses': '200': 'description': 'DNS over TLS plist file' '500': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/Error' 'description': 'Server configuration error.' 'summary': 'Get DNS over TLS .mobileconfig.' 'tags': - 'mobileconfig' - 'global' 'components': 'requestBodies': 'TlsConfig': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/TlsConfig' 'description': 'TLS configuration JSON' 'required': true 'DhcpStaticLease': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/DhcpStaticLease' 'required': true 'RewriteEntry': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/RewriteEntry' 'required': true 'RewriteUpdate': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/RewriteUpdate' 'required': true 'schemas': 'ServerStatus': 'type': 'object' 'description': 'AdGuard Home server status and configuration' 'required': - 'dns_addresses' - 'dns_port' - 'http_port' - 'protection_enabled' - 'protection_disabled_until' - 'running' - 'version' - 'language' 'properties': 'dns_addresses': 'example': ['127.0.0.1'] 'items': 'type': 'string' 'type': 'array' 'dns_port': 'type': 'integer' 'format': 'uint16' 'example': 53 'minimum': 1 'maximum': 65535 'http_port': 'type': 'integer' 'format': 'uint16' 'example': 80 'minimum': 1 'maximum': 65535 'protection_enabled': 'type': 'boolean' 'protection_disabled_duration': 'type': 'integer' 'format': 'int64' 'dhcp_available': 'type': 'boolean' 'running': 'type': 'boolean' 'version': 'type': 'string' 'example': 'v0.123.4' 'language': 'type': 'string' 'example': 'en' 'DNSConfig': 'type': 'object' 'description': 'DNS server configuration' 'properties': 'bootstrap_dns': 'type': 'array' 'description': > Bootstrap servers, port is optional after colon. Empty value will reset it to default values. 'items': 'type': 'string' 'example': - '8.8.8.8:53' - '1.1.1.1:53' 'upstream_dns': 'type': 'array' 'description': > Upstream servers, port is optional after colon. Empty value will reset it to default values. 'items': 'type': 'string' 'example': - 'tls://1.1.1.1' - 'tls://1.0.0.1' 'fallback_dns': 'type': 'array' 'description': > List of fallback DNS servers used when upstream DNS servers are not responding. Empty value will clear the list. 'items': 'type': 'string' 'example': - '8.8.8.8' - '1.1.1.1:53' 'upstream_dns_file': 'type': 'string' 'protection_enabled': 'type': 'boolean' 'ratelimit': 'type': 'integer' 'ratelimit_subnet_subnet_len_ipv4': 'description': 'Length of the subnet mask for IPv4 addresses.' 'type': 'integer' 'default': 24 'minimum': 0 'maximum': 32 'ratelimit_subnet_subnet_len_ipv6': 'description': 'Length of the subnet mask for IPv6 addresses.' 'type': 'integer' 'default': 56 'minimum': 0 'maximum': 128 'ratelimit_whitelist': 'type': 'array' 'description': 'List of IP addresses excluded from rate limiting.' 'items': 'type': 'string' 'blocking_mode': 'type': 'string' 'enum': - 'default' - 'refused' - 'nxdomain' - 'null_ip' - 'custom_ip' 'blocking_ipv4': 'type': 'string' 'blocking_ipv6': 'type': 'string' 'blocked_response_ttl': 'type': 'integer' 'minimum': 0 'description': 'TTL for blocked responses.' 'protection_disabled_until': 'type': 'string' 'description': 'Protection is pause until this time. Nullable.' 'example': '2018-11-26T00:02:41+03:00' 'edns_cs_enabled': 'type': 'boolean' 'edns_cs_use_custom': 'type': 'boolean' 'edns_cs_custom_ip': 'type': 'string' 'disable_ipv6': 'type': 'boolean' 'dnssec_enabled': 'type': 'boolean' 'cache_size': 'type': 'integer' 'cache_ttl_min': 'type': 'integer' 'cache_ttl_max': 'type': 'integer' 'cache_optimistic': 'type': 'boolean' 'upstream_mode': 'type': 'string' 'enum': - const: '' deprecated: true description: Use `load_balance` instead. - const: 'fastest_addr' - const: 'load_balance' - const: 'parallel' 'description': Upstream modes enumeration. 'use_private_ptr_resolvers': 'type': 'boolean' 'resolve_clients': 'type': 'boolean' 'local_ptr_upstreams': 'type': 'array' 'description': > Upstream servers, port is optional after colon. Empty value will reset it to default values. 'items': 'type': 'string' 'example': - 'tls://1.1.1.1' - 'tls://1.0.0.1' 'UpstreamsConfig': 'type': 'object' 'description': 'Upstream configuration to be tested' 'required': - 'bootstrap_dns' - 'upstream_dns' 'properties': 'bootstrap_dns': 'type': 'array' 'description': > Bootstrap DNS servers, port is optional after colon. 'items': 'type': 'string' 'example': - '8.8.8.8:53' - '1.1.1.1:53' 'upstream_dns': 'type': 'array' 'description': > Upstream DNS servers, port is optional after colon. 'items': 'type': 'string' 'example': - 'tls://1.1.1.1' - 'tls://1.0.0.1' 'fallback_dns': 'type': 'array' 'description': > Fallback DNS servers, port is optional after colon. 'items': 'type': 'string' 'example': - '8.8.8.8' - '1.1.1.1:53' 'private_upstream': 'type': 'array' 'description': > Local PTR resolvers, port is optional after colon. 'items': 'type': 'string' 'example': - 'tls://1.1.1.1' - 'tls://1.0.0.1' 'UpstreamsConfigResponse': 'type': 'object' 'description': 'Upstreams configuration response' 'additionalProperties': 'type': 'string' 'Filter': 'type': 'object' 'description': 'Filter subscription info' 'required': - 'enabled' - 'id' - 'name' - 'rules_count' - 'url' 'properties': 'enabled': 'type': 'boolean' 'id': 'example': 1234 'format': 'int64' 'type': 'integer' 'last_updated': 'example': '2018-10-30T12:18:57+03:00' 'format': 'date-time' 'type': 'string' 'name': 'example': 'AdGuard Simplified Domain Names filter' 'type': 'string' 'rules_count': 'example': 5912 'format': 'uint32' 'type': 'integer' 'url': 'type': 'string' 'example': > path_to_url 'FilterStatus': 'type': 'object' 'description': 'Filtering settings' 'properties': 'enabled': 'type': 'boolean' 'interval': 'type': 'integer' 'filters': 'type': 'array' 'items': '$ref': '#/components/schemas/Filter' 'whitelist_filters': 'type': 'array' 'items': '$ref': '#/components/schemas/Filter' 'user_rules': 'type': 'array' 'items': 'type': 'string' 'FilterConfig': 'type': 'object' 'description': 'Filtering settings' 'properties': 'enabled': 'type': 'boolean' 'interval': 'type': 'integer' 'FilterSetUrl': 'type': 'object' 'description': 'Filtering URL settings' 'properties': 'data': '$ref': '#/components/schemas/FilterSetUrlData' 'url': 'type': 'string' 'whitelist': 'type': 'boolean' 'FilterSetUrlData': 'type': 'object' 'description': 'Filter update data' 'required': - 'enabled' - 'name' - 'url' 'properties': 'enabled': 'type': 'boolean' 'name': 'example': 'AdGuard Simplified Domain Names filter' 'type': 'string' 'url': 'type': 'string' 'example': > path_to_url 'FilterRefreshRequest': 'type': 'object' 'description': 'Refresh Filters request data' 'properties': 'whitelist': 'type': 'boolean' 'FilterCheckHostResponse': 'type': 'object' 'description': 'Check Host Result' 'properties': 'reason': 'type': 'string' 'description': 'Request filtering status.' 'enum': - 'NotFilteredNotFound' - 'NotFilteredWhiteList' - 'NotFilteredError' - 'FilteredBlackList' - 'FilteredSafeBrowsing' - 'FilteredParental' - 'FilteredInvalid' - 'FilteredSafeSearch' - 'FilteredBlockedService' - 'Rewrite' - 'RewriteEtcHosts' - 'RewriteRule' 'filter_id': 'deprecated': true 'description': > In case if there's a rule applied to this DNS request, this is ID of the filter list that the rule belongs to. Deprecated: use `rules[*].filter_list_id` instead. 'type': 'integer' 'rule': 'deprecated': true 'type': 'string' 'example': '||example.org^' 'description': > Filtering rule applied to the request (if any). Deprecated: use `rules[*].text` instead. 'rules': 'description': 'Applied rules.' 'type': 'array' 'items': '$ref': '#/components/schemas/ResultRule' 'service_name': 'type': 'string' 'description': 'Set if reason=FilteredBlockedService' 'cname': 'type': 'string' 'description': 'Set if reason=Rewrite' 'ip_addrs': 'type': 'array' 'items': 'type': 'string' 'description': 'Set if reason=Rewrite' 'FilterRefreshResponse': 'type': 'object' 'description': '/filtering/refresh response data' 'properties': 'updated': 'type': 'integer' 'SetRulesRequest': 'description': 'Custom filtering rules setting request.' 'example': 'rules': - '||example.com^' - '# comment' - '@@||www.example.com^' 'properties': 'rules': 'items': 'type': 'string' 'type': 'array' 'type': 'object' 'GetVersionRequest': 'type': 'object' 'description': '/version.json request data' 'properties': 'recheck_now': 'description': > If false, server will check for a new version data only once in several hours. 'type': 'boolean' 'VersionInfo': 'type': 'object' 'description': > Information about the latest available version of AdGuard Home. 'required': - 'disabled' 'properties': 'disabled': 'type': 'boolean' 'description': > If true then other fields doesn't appear. 'new_version': 'type': 'string' 'example': 'v0.9' 'announcement': 'type': 'string' 'example': 'AdGuard Home v0.9 is now available!' 'announcement_url': 'type': 'string' 'example': > path_to_url 'can_autoupdate': 'type': 'boolean' 'Stats': 'type': 'object' 'description': 'Server statistics data' 'properties': 'time_units': 'type': 'string' 'enum': - 'hours' - 'days' 'description': 'Time units' 'example': 'hours' 'num_dns_queries': 'type': 'integer' 'description': 'Total number of DNS queries' 'example': 123 'num_blocked_filtering': 'type': 'integer' 'description': 'Number of requests blocked by filtering rules' 'example': 50 'num_replaced_safebrowsing': 'type': 'integer' 'description': 'Number of requests blocked by safebrowsing module' 'example': 5 'num_replaced_safesearch': 'type': 'integer' 'description': 'Number of requests blocked by safesearch module' 'example': 5 'num_replaced_parental': 'type': 'integer' 'description': 'Number of blocked adult websites' 'example': 15 'avg_processing_time': 'type': 'number' 'format': 'float' 'description': 'Average time in seconds on processing a DNS request' 'example': 0.34 'top_queried_domains': 'type': 'array' 'items': '$ref': '#/components/schemas/TopArrayEntry' 'top_clients': 'type': 'array' 'items': '$ref': '#/components/schemas/TopArrayEntry' 'top_blocked_domains': 'type': 'array' 'items': '$ref': '#/components/schemas/TopArrayEntry' 'top_upstreams_responses': 'type': 'array' 'description': 'Total number of responses from each upstream.' 'items': '$ref': '#/components/schemas/TopArrayEntry' 'maxItems': 100 'top_upstreams_avg_time': 'type': 'array' 'description': > Average processing time in seconds of requests from each upstream. 'items': '$ref': '#/components/schemas/TopArrayEntry' 'maxItems': 100 'dns_queries': 'type': 'array' 'items': 'type': 'integer' 'blocked_filtering': 'type': 'array' 'items': 'type': 'integer' 'replaced_safebrowsing': 'type': 'array' 'items': 'type': 'integer' 'replaced_parental': 'type': 'array' 'items': 'type': 'integer' 'TopArrayEntry': 'type': 'object' 'description': > Represent the number of hits or time duration per key (url, domain, or client IP). 'properties': 'domain_or_ip': 'type': 'number' 'additionalProperties': 'type': 'number' 'StatsConfig': 'type': 'object' 'description': 'Statistics configuration' 'properties': 'interval': 'description': > Time period to keep the data. `0` means that the statistics is disabled. 'enum': - 0 - 1 - 7 - 30 - 90 'type': 'integer' 'GetStatsConfigResponse': 'type': 'object' 'description': 'Statistics configuration' 'required': - 'enabled' - 'interval' - 'ignored' 'properties': 'enabled': 'description': 'Are statistics enabled' 'type': 'boolean' 'interval': 'description': 'Statistics rotation interval in milliseconds' 'type': 'number' 'ignored': 'description': 'List of host names, which should not be counted' 'type': 'array' 'items': 'type': 'string' 'PutStatsConfigUpdateRequest': '$ref': '#/components/schemas/GetStatsConfigResponse' 'DhcpConfig': 'type': 'object' 'properties': 'enabled': 'type': 'boolean' 'interface_name': 'type': 'string' 'v4': '$ref': '#/components/schemas/DhcpConfigV4' 'v6': '$ref': '#/components/schemas/DhcpConfigV6' 'DhcpConfigV4': 'type': 'object' 'properties': 'gateway_ip': 'type': 'string' 'example': '192.168.1.1' 'subnet_mask': 'type': 'string' 'example': '255.255.255.0' 'range_start': 'type': 'string' 'example': '192.168.1.2' 'range_end': 'type': 'string' 'example': '192.168.10.50' 'lease_duration': 'type': 'integer' 'DhcpConfigV6': 'type': 'object' 'properties': 'range_start': 'type': 'string' 'lease_duration': 'type': 'integer' 'DhcpLease': 'type': 'object' 'description': 'DHCP lease information' 'required': - 'mac' - 'ip' - 'hostname' - 'expires' 'properties': 'mac': 'type': 'string' 'example': '00:11:09:b3:b3:b8' 'ip': 'type': 'string' 'example': '192.168.1.22' 'hostname': 'type': 'string' 'example': 'dell' 'expires': 'type': 'string' 'example': '2017-07-21T17:32:28Z' 'DhcpStaticLease': 'type': 'object' 'description': 'DHCP static lease information' 'required': - 'mac' - 'ip' - 'hostname' 'properties': 'mac': 'type': 'string' 'example': '00:11:09:b3:b3:b8' 'ip': 'type': 'string' 'example': '192.168.1.22' 'hostname': 'type': 'string' 'example': 'dell' 'DhcpStatus': 'type': 'object' 'description': 'Built-in DHCP server configuration and status' 'required': - 'config' - 'leases' 'properties': 'enabled': 'type': 'boolean' 'interface_name': 'type': 'string' 'v4': '$ref': '#/components/schemas/DhcpConfigV4' 'v6': '$ref': '#/components/schemas/DhcpConfigV6' 'leases': 'type': 'array' 'items': '$ref': '#/components/schemas/DhcpLease' 'static_leases': 'type': 'array' 'items': '$ref': '#/components/schemas/DhcpStaticLease' 'NetInterfaces': 'type': 'object' 'description': > Network interfaces dictionary, keys are interface names. 'additionalProperties': '$ref': '#/components/schemas/NetInterface' 'DhcpFindActiveReq': 'description': > Request for checking for other DHCP servers in the network. 'properties': 'interface': 'description': 'The name of the network interface' 'example': 'eth0' 'type': 'string' 'type': 'object' 'DhcpSearchResult': 'type': 'object' 'description': > Information about a DHCP server discovered in the current network. 'properties': 'v4': '$ref': '#/components/schemas/DhcpSearchV4' 'v6': '$ref': '#/components/schemas/DhcpSearchV6' 'DhcpSearchV4': 'type': 'object' 'properties': 'other_server': '$ref': '#/components/schemas/DhcpSearchResultOtherServer' 'static_ip': '$ref': '#/components/schemas/DhcpSearchResultStaticIP' 'DhcpSearchV6': 'type': 'object' 'properties': 'other_server': '$ref': '#/components/schemas/DhcpSearchResultOtherServer' 'DhcpSearchResultOtherServer': 'type': 'object' 'properties': 'found': 'type': 'string' 'enum': - 'yes' - 'no' - 'error' 'description': > The result of searching the other DHCP server. 'example': 'no' 'error': 'type': 'string' 'description': 'Set if found=error' 'example': '' 'DhcpSearchResultStaticIP': 'type': 'object' 'properties': 'static': 'type': 'string' 'enum': - 'yes' - 'no' - 'error' 'description': > The result of determining static IP address. 'example': 'yes' 'ip': 'type': 'string' 'description': 'Set if static=no' 'example': '' 'DnsAnswer': 'type': 'object' 'description': 'DNS answer section' 'properties': 'ttl': 'example': 55 'format': 'uint32' 'type': 'integer' 'type': 'type': 'string' 'example': 'A' 'value': 'type': 'string' 'example': '217.69.139.201' 'DnsQuestion': 'type': 'object' 'description': 'DNS question section' 'properties': 'class': 'type': 'string' 'example': 'IN' 'name': 'type': 'string' 'example': 'xn--d1abbgf6aiiy.xn--p1ai' 'unicode_name': 'type': 'string' 'example': '.' 'type': 'type': 'string' 'example': 'A' 'AddUrlRequest': 'type': 'object' 'description': '/add_url request data' 'properties': 'name': 'type': 'string' 'url': 'description': > URL or an absolute path to the file containing filtering rules. 'type': 'string' 'example': 'path_to_url 'whitelist': 'type': 'boolean' 'RemoveUrlRequest': 'type': 'object' 'description': '/remove_url request data' 'properties': 'url': 'description': 'Previously added URL containing filtering rules' 'type': 'string' 'example': 'path_to_url 'whitelist': 'type': 'boolean' 'QueryLogItem': 'type': 'object' 'description': 'Query log item' 'properties': 'answer': 'type': 'array' 'items': '$ref': '#/components/schemas/DnsAnswer' 'original_answer': 'type': 'array' 'description': 'Answer from upstream server (optional)' 'items': '$ref': '#/components/schemas/DnsAnswer' 'cached': 'type': 'boolean' 'description': > Defines if the response has been served from cache. 'upstream': 'type': 'string' 'description': > Upstream URL starting with tcp://, tls://, path_to_url or with an IP address. 'answer_dnssec': 'description': > If true, the response had the Authenticated Data (AD) flag set. 'type': 'boolean' 'client': 'description': > The client's IP address. 'example': '192.168.0.1' 'type': 'string' 'client_id': 'description': > The ClientID, if provided in DoH, DoQ, or DoT. 'example': 'cli123' 'type': 'string' 'client_info': '$ref': '#/components/schemas/QueryLogItemClient' 'client_proto': 'enum': - 'dot' - 'doh' - 'doq' - 'dnscrypt' - '' 'ecs': 'type': 'string' 'example': '192.168.0.0/16' 'description': > The IP network defined by an EDNS Client-Subnet option in the request message if any. 'elapsedMs': 'type': 'string' 'example': '54.023928' 'question': '$ref': '#/components/schemas/DnsQuestion' 'filterId': 'deprecated': true 'type': 'integer' 'example': 123123 'description': > In case if there's a rule applied to this DNS request, this is ID of the filter list that the rule belongs to. Deprecated: use `rules[*].filter_list_id` instead. 'rule': 'deprecated': true 'type': 'string' 'example': '||example.org^' 'description': > Filtering rule applied to the request (if any). Deprecated: use `rules[*].text` instead. 'rules': 'description': 'Applied rules.' 'type': 'array' 'items': '$ref': '#/components/schemas/ResultRule' 'reason': 'type': 'string' 'description': 'Request filtering status.' 'enum': - 'NotFilteredNotFound' - 'NotFilteredWhiteList' - 'NotFilteredError' - 'FilteredBlackList' - 'FilteredSafeBrowsing' - 'FilteredParental' - 'FilteredInvalid' - 'FilteredSafeSearch' - 'FilteredBlockedService' - 'Rewrite' - 'RewriteEtcHosts' - 'RewriteRule' 'service_name': 'type': 'string' 'description': 'Set if reason=FilteredBlockedService' 'status': 'type': 'string' 'description': 'DNS response status' 'example': 'NOERROR' 'time': 'type': 'string' 'description': 'DNS request processing start time' 'example': '2018-11-26T00:02:41+03:00' 'QueryLogItemClient': 'description': > Client information for a query log item. 'properties': 'disallowed': 'type': 'boolean' 'description': > Whether the client's IP is blocked or not. 'disallowed_rule': 'type': 'string' 'description': > The rule due to which the client is allowed or blocked. 'name': 'description': > Persistent client's name or runtime client's hostname. May be empty. 'type': 'string' 'whois': '$ref': '#/components/schemas/QueryLogItemClientWhois' 'required': - 'disallowed' - 'disallowed_rule' - 'name' - 'whois' 'type': 'object' 'QueryLogItemClientWhois': 'description': > Client WHOIS information, if any. 'properties': 'city': 'description': > City, if any. 'type': 'string' 'country': 'description': > Country, if any. 'type': 'string' 'orgname': 'description': > Organization name, if any. 'type': 'string' 'type': 'object' 'QueryLog': 'type': 'object' 'description': 'Query log' 'properties': 'oldest': 'type': 'string' 'example': '2018-11-26T00:02:41+03:00' 'data': 'type': 'array' 'items': '$ref': '#/components/schemas/QueryLogItem' 'QueryLogConfig': 'type': 'object' 'description': 'Query log configuration' 'properties': 'enabled': 'type': 'boolean' 'description': 'Is query log enabled' 'interval': 'description': > Time period for query log rotation. 'type': 'number' 'enum': - 0.25 - 1 - 7 - 30 - 90 'anonymize_client_ip': 'type': 'boolean' 'description': "Anonymize clients' IP addresses" 'GetQueryLogConfigResponse': 'type': 'object' 'description': 'Query log configuration' 'required': - 'enabled' - 'interval' - 'anonymize_client_ip' - 'ignored' 'properties': 'enabled': 'type': 'boolean' 'description': 'Is query log enabled' 'interval': 'description': > Time period for query log rotation in milliseconds. 'type': 'number' 'anonymize_client_ip': 'type': 'boolean' 'description': "Anonymize clients' IP addresses" 'ignored': 'description': 'List of host names, which should not be written to log' 'type': 'array' 'items': 'type': 'string' 'PutQueryLogConfigUpdateRequest': '$ref': '#/components/schemas/GetQueryLogConfigResponse' 'ResultRule': 'description': 'Applied rule.' 'properties': 'filter_list_id': 'description': > In case if there's a rule applied to this DNS request, this is ID of the filter list that the rule belongs to. 'example': 123123 'format': 'int64' 'type': 'integer' 'text': 'description': > The text of the filtering rule applied to the request (if any). 'example': '||example.org^' 'type': 'string' 'type': 'object' 'TlsConfig': 'type': 'object' 'description': 'TLS configuration settings and status' 'properties': 'enabled': 'type': 'boolean' 'example': true 'description': 'enabled is the encryption (DoT/DoH/HTTPS) status' 'server_name': 'type': 'string' 'example': 'example.org' 'description': 'server_name is the hostname of your HTTPS/TLS server' 'force_https': 'type': 'boolean' 'example': true 'description': 'if true, forces HTTP->HTTPS redirect' 'port_https': 'type': 'integer' 'format': 'uint16' 'example': 443 'description': 'HTTPS port. If 0, HTTPS will be disabled.' 'port_dns_over_tls': 'type': 'integer' 'format': 'uint16' 'example': 853 'description': 'DNS-over-TLS port. If 0, DoT will be disabled.' 'port_dns_over_quic': 'type': 'integer' 'format': 'uint16' 'example': 784 'description': 'DNS-over-QUIC port. If 0, DoQ will be disabled.' 'certificate_chain': 'type': 'string' 'description': 'Base64 string with PEM-encoded certificates chain' 'private_key': 'type': 'string' 'description': 'Base64 string with PEM-encoded private key' 'private_key_saved': 'type': 'boolean' 'example': true 'description': > Set to true if the user has previously saved a private key as a string. This is used so that the server and the client don't have to send the private key between each other every time, which might lead to security issues. 'certificate_path': 'type': 'string' 'description': 'Path to certificate file' 'private_key_path': 'type': 'string' 'description': 'Path to private key file' 'valid_cert': 'type': 'boolean' 'example': true 'description': > Set to true if the specified certificates chain is a valid chain of X509 certificates. 'valid_chain': 'type': 'boolean' 'example': true 'description': > Set to true if the specified certificates chain is verified and issued by a known CA. 'subject': 'type': 'string' 'example': 'CN=example.org' 'description': 'The subject of the first certificate in the chain.' 'issuer': 'type': 'string' 'example': "CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US" 'description': 'The issuer of the first certificate in the chain.' 'not_before': 'type': 'string' 'example': '2019-01-31T10:47:32Z' 'description': > The NotBefore field of the first certificate in the chain. 'not_after': 'type': 'string' 'example': '2019-05-01T10:47:32Z' 'description': > The NotAfter field of the first certificate in the chain. 'dns_names': 'type': 'array' 'items': 'type': 'string' 'description': > The value of SubjectAltNames field of the first certificate in the chain. 'example': - '*.example.org' 'valid_key': 'type': 'boolean' 'example': true 'description': 'Set to true if the key is a valid private key.' 'key_type': 'type': 'string' 'example': 'RSA' 'enum': - 'RSA' - 'ECDSA' 'description': 'Key type.' 'warning_validation': 'type': 'string' 'example': 'You have specified an empty certificate' 'description': > A validation warning message with the issue description. 'valid_pair': 'type': 'boolean' 'example': true 'description': > Set to true if both certificate and private key are correct. 'serve_plain_dns': 'type': 'boolean' 'example': true 'description': > Set to true if plain DNS is allowed for incoming requests. 'NetInterface': 'type': 'object' 'description': 'Network interface info' 'required': - 'flags' - 'hardware_address' - 'name' - 'mtu' 'properties': 'flags': 'type': 'string' 'description': > Flags could be any combination of the following values, divided by the "|" character: "up", "broadcast", "loopback", "pointtopoint" and "multicast". 'example': 'up|broadcast|multicast' 'hardware_address': 'type': 'string' 'example': '52:54:00:11:09:ba' 'name': 'type': 'string' 'example': 'eth0' 'ip_addresses': 'type': 'array' 'items': 'type': 'string' 'mtu': 'type': 'integer' 'AddressInfo': 'type': 'object' 'description': 'Port information' 'required': - 'ip' - 'port' 'properties': 'ip': 'type': 'string' 'example': '127.0.0.1' 'port': 'type': 'integer' 'format': 'uint16' 'example': 53 'AddressesInfo': 'type': 'object' 'description': 'AdGuard Home addresses configuration' 'required': - 'dns_port' - 'interfaces' - 'version' - 'web_port' 'properties': 'dns_port': 'type': 'integer' 'format': 'uint16' 'example': 53 'interfaces': '$ref': '#/components/schemas/NetInterfaces' 'version': 'type': 'string' 'example': 'v0.123.4' 'web_port': 'type': 'integer' 'format': 'uint16' 'example': 80 'SetProtectionRequest': 'type': 'object' 'description': 'Protection state configuration' 'properties': 'enabled': 'type': 'boolean' 'duration': 'type': 'integer' 'format': 'uint64' 'description': 'Duration of a pause, in milliseconds. Enabled should be false.' 'required': - 'enabled' 'ProfileInfo': 'type': 'object' 'description': 'Information about the current user' 'properties': 'name': 'type': 'string' 'language': 'type': 'string' 'theme': 'type': 'string' 'description': 'Interface theme' 'enum': - 'auto' - 'dark' - 'light' 'required': - 'name' - 'language' - 'theme' 'SafeSearchConfig': 'type': 'object' 'description': 'Safe search settings.' 'properties': 'enabled': 'type': 'boolean' 'bing': 'type': 'boolean' 'duckduckgo': 'type': 'boolean' 'ecosia': 'type': 'boolean' 'google': 'type': 'boolean' 'pixabay': 'type': 'boolean' 'yandex': 'type': 'boolean' 'youtube': 'type': 'boolean' 'Schedule': 'type': 'object' 'description': > Sets periods of inactivity for filtering blocked services. The schedule contains 7 days (Sunday to Saturday) and a time zone. 'properties': 'time_zone': 'description': > Time zone name according to IANA time zone database. For example `Europe/Brussels`. `Local` represents the system's local time zone. 'type': 'string' 'sun': '$ref': '#/components/schemas/DayRange' 'mon': '$ref': '#/components/schemas/DayRange' 'tue': '$ref': '#/components/schemas/DayRange' 'wed': '$ref': '#/components/schemas/DayRange' 'thu': '$ref': '#/components/schemas/DayRange' 'fri': '$ref': '#/components/schemas/DayRange' 'sat': '$ref': '#/components/schemas/DayRange' 'DayRange': 'type': 'object' 'description': > The single interval within a day. It begins at the `start` and ends before the `end`. 'properties': 'start': 'type': 'number' 'description': > The number of milliseconds elapsed from the start of a day. It must be less than `end` and is expected to be rounded to minutes. So the maximum value is `86340000` (23 hours and 59 minutes). 'minimum': 0 'maximum': 86340000 'end': 'type': 'number' 'description': > The number of milliseconds elapsed from the start of a day. It is expected to be rounded to minutes. The maximum value is `86400000` (24 hours). 'minimum': 0 'maximum': 86400000 'Client': 'type': 'object' 'description': 'Client information.' 'properties': 'name': 'type': 'string' 'description': 'Name' 'example': 'localhost' 'ids': 'type': 'array' 'description': 'IP, CIDR, MAC, or ClientID.' 'items': 'type': 'string' 'use_global_settings': 'type': 'boolean' 'filtering_enabled': 'type': 'boolean' 'parental_enabled': 'type': 'boolean' 'safebrowsing_enabled': 'type': 'boolean' 'safesearch_enabled': 'deprecated': true 'type': 'boolean' 'safe_search': '$ref': '#/components/schemas/SafeSearchConfig' 'use_global_blocked_services': 'type': 'boolean' 'blocked_services_schedule': '$ref': '#/components/schemas/Schedule' 'blocked_services': 'type': 'array' 'items': 'type': 'string' 'upstreams': 'type': 'array' 'items': 'type': 'string' 'tags': 'items': 'type': 'string' 'type': 'array' 'ignore_querylog': 'description': | NOTE: If `ignore_querylog` is not set in HTTP API `GET /clients/add` request then default value (false) will be used. If `ignore_querylog` is not set in HTTP API `GET /clients/update` request then the existing value will not be changed. This behaviour can be changed in the future versions. 'type': 'boolean' 'ignore_statistics': 'description': | NOTE: If `ignore_statistics` is not set in HTTP API `GET /clients/add` request then default value (false) will be used. If `ignore_statistics` is not set in HTTP API `GET /clients/update` request then the existing value will not be changed. This behaviour can be changed in the future versions. 'type': 'boolean' 'upstreams_cache_enabled': 'description': | NOTE: If `upstreams_cache_enabled` is not set in HTTP API `GET /clients/add` request then default value (false) will be used. If `upstreams_cache_enabled` is not set in HTTP API `GET /clients/update` request then the existing value will not be changed. This behaviour can be changed in the future versions. 'type': 'boolean' 'upstreams_cache_size': 'description': | NOTE: If `upstreams_cache_enabled` is not set in HTTP API `GET /clients/update` request then the existing value will not be changed. This behaviour can be changed in the future versions. 'type': 'integer' 'ClientAuto': 'type': 'object' 'description': 'Auto-Client information' 'properties': 'ip': 'type': 'string' 'description': 'IP address' 'example': '127.0.0.1' 'name': 'type': 'string' 'description': 'Name' 'example': 'localhost' 'source': 'type': 'string' 'description': 'The source of this information' 'example': 'etc/hosts' 'whois_info': '$ref': '#/components/schemas/WhoisInfo' 'ClientUpdate': 'type': 'object' 'description': 'Client update request' 'properties': 'name': 'type': 'string' 'data': '$ref': '#/components/schemas/Client' 'ClientDelete': 'type': 'object' 'description': 'Client delete request' 'properties': 'name': 'type': 'string' 'ClientsFindResponse': 'type': 'array' 'description': 'Client search results.' 'items': '$ref': '#/components/schemas/ClientsFindEntry' 'example': - 'cli42': 'name': 'Client 42' 'ids': ['cli42'] 'use_global_settings': true 'filtering_enabled': true 'parental_enabled': true 'safebrowsing_enabled': true 'safesearch_enabled': true 'safe_search': {} 'use_global_blocked_services': true 'blocked_services': null 'upstreams': null 'whois_info': {} 'disallowed': false 'disallowed_rule': '' 'ignore_querylog': false 'ignore_statistics': false - '1.2.3.4': 'name': 'Client 1-2-3-4' 'ids': ['1.2.3.4'] 'use_global_settings': true 'filtering_enabled': true 'parental_enabled': true 'safebrowsing_enabled': true 'safesearch_enabled': true 'safe_search': {} 'use_global_blocked_services': true 'blocked_services': null 'upstreams': null 'whois_info': {} 'disallowed': false 'disallowed_rule': '' 'ignore_querylog': false 'ignore_statistics': false 'AccessListResponse': '$ref': '#/components/schemas/AccessList' 'AccessSetRequest': '$ref': '#/components/schemas/AccessList' 'AccessList': 'description': > Client and host access list. Each of the lists should contain only unique elements. In addition, allowed and disallowed lists cannot contain the same elements. 'properties': 'allowed_clients': 'description': > The allowlist of clients: IP addresses, CIDRs, or ClientIDs. 'items': 'type': 'string' 'type': 'array' 'disallowed_clients': 'description': > The blocklist of clients: IP addresses, CIDRs, or ClientIDs. 'items': 'type': 'string' 'type': 'array' 'blocked_hosts': 'description': 'The blocklist of hosts.' 'items': 'type': 'string' 'type': 'array' 'type': 'object' 'ClientsFindEntry': 'type': 'object' 'additionalProperties': '$ref': '#/components/schemas/ClientFindSubEntry' 'ClientFindSubEntry': 'type': 'object' 'description': 'Client information.' 'properties': 'name': 'type': 'string' 'description': 'Name' 'example': 'localhost' 'ids': 'type': 'array' 'description': 'IP, CIDR, MAC, or ClientID.' 'items': 'type': 'string' 'use_global_settings': 'type': 'boolean' 'filtering_enabled': 'type': 'boolean' 'parental_enabled': 'type': 'boolean' 'safebrowsing_enabled': 'type': 'boolean' 'safesearch_enabled': 'deprecated': true 'type': 'boolean' 'safe_search': '$ref': '#/components/schemas/SafeSearchConfig' 'use_global_blocked_services': 'type': 'boolean' 'blocked_services': 'type': 'array' 'items': 'type': 'string' 'upstreams': 'type': 'array' 'items': 'type': 'string' 'whois_info': '$ref': '#/components/schemas/WhoisInfo' 'disallowed': 'type': 'boolean' 'description': > Whether the client's IP is blocked or not. 'disallowed_rule': 'type': 'string' 'description': > The rule due to which the client is disallowed. If disallowed is set to true, and this string is empty, then the client IP is disallowed by the "allowed IP list", that is it is not included in the allowed list. 'ignore_querylog': 'type': 'boolean' 'ignore_statistics': 'type': 'boolean' 'WhoisInfo': 'type': 'object' 'additionalProperties': 'type': 'string' 'Clients': 'type': 'object' 'properties': 'clients': '$ref': '#/components/schemas/ClientsArray' 'auto_clients': '$ref': '#/components/schemas/ClientsAutoArray' 'supported_tags': 'items': 'type': 'string' 'type': 'array' 'ClientsArray': 'type': 'array' 'items': '$ref': '#/components/schemas/Client' 'description': 'Clients array' 'ClientsAutoArray': 'type': 'array' 'items': '$ref': '#/components/schemas/ClientAuto' 'description': 'Auto-Clients array' 'RewriteList': 'type': 'array' 'items': '$ref': '#/components/schemas/RewriteEntry' 'description': 'Rewrite rules array' 'RewriteUpdate': 'type': 'object' 'description': 'Rewrite rule update object' 'properties': 'target': '$ref': '#/components/schemas/RewriteEntry' 'update': '$ref': '#/components/schemas/RewriteEntry' 'RewriteEntry': 'type': 'object' 'description': 'Rewrite rule' 'properties': 'domain': 'type': 'string' 'description': 'Domain name' 'example': 'example.org' 'answer': 'type': 'string' 'description': 'value of A, AAAA or CNAME DNS record' 'example': '127.0.0.1' 'BlockedServicesArray': 'type': 'array' 'items': 'type': 'string' 'BlockedServicesAll': 'properties': 'blocked_services': 'items': '$ref': '#/components/schemas/BlockedService' 'type': 'array' 'required': - 'blocked_services' 'type': 'object' 'BlockedService': 'properties': 'icon_svg': 'description': > The SVG icon as a Base64-encoded string to make it easier to embed it into a data URL. 'type': 'string' 'id': 'description': > The ID of this service. 'type': 'string' 'name': 'description': > The human-readable name of this service. 'type': 'string' 'rules': 'description': > The array of the filtering rules. 'items': 'type': 'string' 'type': 'array' 'required': - 'icon_svg' - 'id' - 'name' - 'rules' 'type': 'object' 'BlockedServicesSchedule': 'type': 'object' 'properties': 'schedule': '$ref': '#/components/schemas/Schedule' 'ids': 'description': > The names of the blocked services. 'type': 'array' 'items': 'type': 'string' 'CheckConfigRequest': 'type': 'object' 'description': 'Configuration to be checked' 'properties': 'dns': '$ref': '#/components/schemas/CheckConfigRequestInfo' 'web': '$ref': '#/components/schemas/CheckConfigRequestInfo' 'set_static_ip': 'type': 'boolean' 'example': false 'CheckConfigRequestInfo': 'type': 'object' 'properties': 'ip': 'type': 'string' 'example': '127.0.0.1' 'port': 'type': 'integer' 'format': 'uint16' 'example': 53 'autofix': 'type': 'boolean' 'example': false 'CheckConfigResponse': 'type': 'object' 'required': - 'dns' - 'web' - 'static_ip' 'properties': 'dns': '$ref': '#/components/schemas/CheckConfigResponseInfo' 'web': '$ref': '#/components/schemas/CheckConfigResponseInfo' 'static_ip': '$ref': '#/components/schemas/CheckConfigStaticIpInfo' 'CheckConfigResponseInfo': 'type': 'object' 'required': - 'status' - 'can_autofix' 'properties': 'status': 'type': 'string' 'default': '' 'can_autofix': 'type': 'boolean' 'example': false 'CheckConfigStaticIpInfoStatic': 'type': 'string' 'example': 'no' 'enum': - 'yes' - 'no' - 'error' 'description': 'Can be: yes, no, error' 'CheckConfigStaticIpInfo': 'type': 'object' 'properties': 'static': '$ref': '#/components/schemas/CheckConfigStaticIpInfoStatic' 'ip': 'type': 'string' 'default': '' 'example': '192.168.1.1' 'description': 'Current dynamic IP address. Set if static=no' 'error': 'type': 'string' 'default': '' 'description': 'Error text. Set if static=error' 'InitialConfiguration': 'type': 'object' 'description': > AdGuard Home initial configuration for the first-install wizard. 'required': - 'dns' - 'web' - 'username' - 'password' 'properties': 'dns': '$ref': '#/components/schemas/AddressInfo' 'web': '$ref': '#/components/schemas/AddressInfo' 'username': 'type': 'string' 'description': 'Basic auth username' 'example': 'admin' 'password': 'type': 'string' 'description': 'Basic auth password' 'example': 'password' 'Login': 'type': 'object' 'description': 'Login request data' 'properties': 'name': 'type': 'string' 'description': 'User name' 'password': 'type': 'string' 'description': 'Password' 'Error': 'description': 'A generic JSON error response.' 'properties': 'message': 'description': 'The error message, an opaque string.' 'type': 'string' 'type': 'object' 'LanguageSettings': 'description': 'Language settings object.' 'properties': 'language': 'description': 'The current language or the language to set.' 'type': 'string' 'required': - 'language' 'type': 'object' 'securitySchemes': 'basicAuth': 'type': 'http' 'scheme': 'basic' ```
/content/code_sandbox/openapi/openapi.yaml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
21,665
```go package aghhttp_test import ( "encoding/json" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // testJSONTime is the JSON time for tests. var testJSONTime = aghhttp.JSONTime(time.Unix(1_234_567_890, 123_456_000).UTC()) // testJSONTimeStr is the string with the JSON encoding of testJSONTime. const testJSONTimeStr = "1234567890123.456" func TestJSONTime_MarshalJSON(t *testing.T) { testCases := []struct { name string wantErrMsg string in aghhttp.JSONTime want []byte }{{ name: "unix_zero", wantErrMsg: "", in: aghhttp.JSONTime(time.Unix(0, 0)), want: []byte("0"), }, { name: "empty", wantErrMsg: "", in: aghhttp.JSONTime{}, want: []byte("-6795364578871.345"), }, { name: "time", wantErrMsg: "", in: testJSONTime, want: []byte(testJSONTimeStr), }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { got, err := tc.in.MarshalJSON() testutil.AssertErrorMsg(t, tc.wantErrMsg, err) assert.Equal(t, tc.want, got) }) } t.Run("json", func(t *testing.T) { in := &struct { A aghhttp.JSONTime }{ A: testJSONTime, } got, err := json.Marshal(in) require.NoError(t, err) assert.Equal(t, []byte(`{"A":`+testJSONTimeStr+`}`), got) }) } func TestJSONTime_UnmarshalJSON(t *testing.T) { testCases := []struct { name string wantErrMsg string want aghhttp.JSONTime data []byte }{{ name: "time", wantErrMsg: "", want: testJSONTime, data: []byte(testJSONTimeStr), }, { name: "bad", wantErrMsg: `parsing json time: strconv.ParseFloat: parsing "{}": ` + `invalid syntax`, want: aghhttp.JSONTime{}, data: []byte(`{}`), }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { var got aghhttp.JSONTime err := got.UnmarshalJSON(tc.data) testutil.AssertErrorMsg(t, tc.wantErrMsg, err) assert.Equal(t, tc.want, got) }) } t.Run("nil", func(t *testing.T) { err := (*aghhttp.JSONTime)(nil).UnmarshalJSON([]byte("0")) require.Error(t, err) msg := err.Error() assert.Equal(t, "json time is nil", msg) }) t.Run("json", func(t *testing.T) { want := testJSONTime var got struct { A aghhttp.JSONTime } err := json.Unmarshal([]byte(`{"A":`+testJSONTimeStr+`}`), &got) require.NoError(t, err) assert.Equal(t, want, got.A) }) } ```
/content/code_sandbox/internal/aghhttp/json_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
780
```go package aghhttp import ( "encoding/json" "fmt" "net/http" "strconv" "time" "github.com/AdguardTeam/golibs/httphdr" "github.com/AdguardTeam/golibs/log" ) // JSON Utilities // nsecPerMsec is the number of nanoseconds in a millisecond. const nsecPerMsec = float64(time.Millisecond / time.Nanosecond) // JSONDuration is a time.Duration that can be decoded from JSON and encoded // into JSON according to our API conventions. type JSONDuration time.Duration // type check var _ json.Marshaler = JSONDuration(0) // MarshalJSON implements the json.Marshaler interface for JSONDuration. err is // always nil. func (d JSONDuration) MarshalJSON() (b []byte, err error) { msec := float64(time.Duration(d)) / nsecPerMsec b = strconv.AppendFloat(nil, msec, 'f', -1, 64) return b, nil } // type check var _ json.Unmarshaler = (*JSONDuration)(nil) // UnmarshalJSON implements the json.Marshaler interface for *JSONDuration. func (d *JSONDuration) UnmarshalJSON(b []byte) (err error) { if d == nil { return fmt.Errorf("json duration is nil") } msec, err := strconv.ParseFloat(string(b), 64) if err != nil { return fmt.Errorf("parsing json time: %w", err) } *d = JSONDuration(int64(msec * nsecPerMsec)) return nil } // JSONTime is a time.Time that can be decoded from JSON and encoded into JSON // according to our API conventions. type JSONTime time.Time // type check var _ json.Marshaler = JSONTime{} // MarshalJSON implements the json.Marshaler interface for JSONTime. err is // always nil. func (t JSONTime) MarshalJSON() (b []byte, err error) { msec := float64(time.Time(t).UnixNano()) / nsecPerMsec b = strconv.AppendFloat(nil, msec, 'f', -1, 64) return b, nil } // type check var _ json.Unmarshaler = (*JSONTime)(nil) // UnmarshalJSON implements the json.Marshaler interface for *JSONTime. func (t *JSONTime) UnmarshalJSON(b []byte) (err error) { if t == nil { return fmt.Errorf("json time is nil") } msec, err := strconv.ParseFloat(string(b), 64) if err != nil { return fmt.Errorf("parsing json time: %w", err) } *t = JSONTime(time.Unix(0, int64(msec*nsecPerMsec)).UTC()) return nil } // WriteJSONResponse writes headers with the code, encodes resp into w, and logs // any errors it encounters. r is used to get additional information from the // request. func WriteJSONResponse(w http.ResponseWriter, r *http.Request, code int, resp any) { h := w.Header() h.Set(httphdr.ContentType, HdrValApplicationJSON) h.Set(httphdr.Server, UserAgent()) w.WriteHeader(code) err := json.NewEncoder(w).Encode(resp) if err != nil { log.Error("aghhttp: writing json resp to %s %s: %s", r.Method, r.URL.Path, err) } } // WriteJSONResponseOK writes headers with the code 200 OK, encodes v into w, // and logs any errors it encounters. r is used to get additional information // from the request. func WriteJSONResponseOK(w http.ResponseWriter, r *http.Request, v any) { WriteJSONResponse(w, r, http.StatusOK, v) } // ErrorCode is the error code as used by the HTTP API. See the ErrorCode // definition in the OpenAPI specification. type ErrorCode string // ErrorCode constants. // // TODO(a.garipov): Expand and document codes. const ( // ErrorCodeTMP000 is the temporary error code used for all errors. ErrorCodeTMP000 = "" ) // HTTPAPIErrorResp is the error response as used by the HTTP API. See the // BadRequestResp, InternalServerErrorResp, and similar objects in the OpenAPI // specification. type HTTPAPIErrorResp struct { Code ErrorCode `json:"code"` Msg string `json:"msg"` } // WriteJSONResponseError encodes err as a JSON error into w, and logs any // errors it encounters. r is used to get additional information from the // request. func WriteJSONResponseError(w http.ResponseWriter, r *http.Request, err error) { log.Error("aghhttp: writing json error to %s %s: %s", r.Method, r.URL.Path, err) WriteJSONResponse(w, r, http.StatusUnprocessableEntity, &HTTPAPIErrorResp{ Code: ErrorCodeTMP000, Msg: err.Error(), }) } ```
/content/code_sandbox/internal/aghhttp/json.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,064
```go // Package aghhttp provides some common methods to work with HTTP. package aghhttp import ( "fmt" "io" "net/http" "github.com/AdguardTeam/AdGuardHome/internal/version" "github.com/AdguardTeam/golibs/httphdr" "github.com/AdguardTeam/golibs/log" ) // HTTP scheme constants. const ( SchemeHTTP = "http" SchemeHTTPS = "https" ) // RegisterFunc is the function that sets the handler to handle the URL for the // method. // // TODO(e.burkov, a.garipov): Get rid of it. type RegisterFunc func(method, url string, handler http.HandlerFunc) // OK responds with word OK. func OK(w http.ResponseWriter) { if _, err := io.WriteString(w, "OK\n"); err != nil { log.Error("couldn't write body: %s", err) } } // Error writes formatted message to w and also logs it. func Error(r *http.Request, w http.ResponseWriter, code int, format string, args ...any) { text := fmt.Sprintf(format, args...) log.Error("%s %s %s: %s", r.Method, r.Host, r.URL, text) http.Error(w, text, code) } // UserAgent returns the ID of the service as a User-Agent string. It can also // be used as the value of the Server HTTP header. func UserAgent() (ua string) { return fmt.Sprintf("AdGuardHome/%s", version.Version()) } // textPlainDeprMsg is the message returned to API users when they try to use // an API that used to accept "text/plain" but doesn't anymore. const textPlainDeprMsg = `using this api with the text/plain content-type is deprecated; ` + `use application/json` // WriteTextPlainDeprecated responds to the request with a message about // deprecation and removal of a plain-text API if the request is made with the // "text/plain" content-type. func WriteTextPlainDeprecated(w http.ResponseWriter, r *http.Request) (isPlainText bool) { if r.Header.Get(httphdr.ContentType) != HdrValTextPlain { return false } Error(r, w, http.StatusUnsupportedMediaType, textPlainDeprMsg) return true } ```
/content/code_sandbox/internal/aghhttp/aghhttp.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
492
```go package aghhttp // HTTP headers // HTTP header value constants. const ( HdrValApplicationJSON = "application/json" HdrValStrictTransportSecurity = "max-age=31536000; includeSubDomains" HdrValTextPlain = "text/plain" ) ```
/content/code_sandbox/internal/aghhttp/header.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
60
```go package aghtls_test import ( "crypto/tls" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghtls" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" ) func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } func TestParseCiphers(t *testing.T) { testCases := []struct { name string wantErrMsg string want []uint16 in []string }{{ name: "nil", wantErrMsg: "", want: nil, in: nil, }, { name: "empty", wantErrMsg: "", want: []uint16{}, in: []string{}, }, {}, { name: "one", wantErrMsg: "", want: []uint16{tls.TLS_AES_128_GCM_SHA256}, in: []string{"TLS_AES_128_GCM_SHA256"}, }, { name: "several", wantErrMsg: "", want: []uint16{tls.TLS_AES_128_GCM_SHA256, tls.TLS_AES_256_GCM_SHA384}, in: []string{"TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384"}, }, { name: "bad", wantErrMsg: `unknown cipher "bad_cipher"`, want: nil, in: []string{"bad_cipher"}, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { got, err := aghtls.ParseCiphers(tc.in) testutil.AssertErrorMsg(t, tc.wantErrMsg, err) assert.Equal(t, tc.want, got) }) } } ```
/content/code_sandbox/internal/aghtls/aghtls_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
397
```go //go:build !linux package aghtls import "crypto/x509" func rootCAs() (roots *x509.CertPool) { return nil } ```
/content/code_sandbox/internal/aghtls/root_others.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
38
```go //go:build linux package aghtls import ( "crypto/x509" "os" "path/filepath" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ) func rootCAs() (roots *x509.CertPool) { // Directories with the system root certificates, which aren't supported by // Go's crypto/x509. dirs := []string{ // Entware. "/opt/etc/ssl/certs", } roots = x509.NewCertPool() for _, dir := range dirs { dirEnts, err := os.ReadDir(dir) if err != nil { if errors.Is(err, os.ErrNotExist) { continue } // TODO(a.garipov): Improve error handling here and in other places. log.Error("aghtls: opening directory %q: %s", dir, err) } var rootsAdded bool for _, de := range dirEnts { var certData []byte rootFile := filepath.Join(dir, de.Name()) certData, err = os.ReadFile(rootFile) if err != nil { log.Error("aghtls: reading root cert: %s", err) } else { if roots.AppendCertsFromPEM(certData) { rootsAdded = true } else { log.Error("aghtls: could not add root from %q", rootFile) } } } if rootsAdded { return roots } } return nil } ```
/content/code_sandbox/internal/aghtls/root_linux.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
352
```go // Package aghtls contains utilities for work with TLS. package aghtls import ( "crypto/tls" "crypto/x509" "fmt" "slices" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" ) // init makes sure that the cipher name map is filled. // // TODO(a.garipov): Propose a similar API to crypto/tls. func init() { suites := tls.CipherSuites() cipherSuites = make(map[string]uint16, len(suites)) for _, s := range suites { cipherSuites[s.Name] = s.ID } log.Debug("tls: known ciphers: %q", cipherSuites) } // cipherSuites are a name-to-ID mapping of cipher suites from crypto/tls. It // is filled by init. It must not be modified. var cipherSuites map[string]uint16 // ParseCiphers parses a slice of cipher suites from cipher names. func ParseCiphers(cipherNames []string) (cipherIDs []uint16, err error) { if cipherNames == nil { return nil, nil } cipherIDs = make([]uint16, 0, len(cipherNames)) for _, name := range cipherNames { id, ok := cipherSuites[name] if !ok { return nil, fmt.Errorf("unknown cipher %q", name) } cipherIDs = append(cipherIDs, id) } return cipherIDs, nil } // SaferCipherSuites returns a set of default cipher suites with vulnerable and // weak cipher suites removed. func SaferCipherSuites() (safe []uint16) { for _, s := range tls.CipherSuites() { switch s.ID { case tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, tls.TLS_RSA_WITH_AES_128_CBC_SHA, tls.TLS_RSA_WITH_AES_256_CBC_SHA, tls.TLS_RSA_WITH_AES_128_CBC_SHA256, tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: // Less safe 3DES and CBC suites, go on. default: safe = append(safe, s.ID) } } return safe } // CertificateHasIP returns true if cert has at least a single IP address among // its subjectAltNames. func CertificateHasIP(cert *x509.Certificate) (ok bool) { return len(cert.IPAddresses) > 0 || slices.ContainsFunc(cert.DNSNames, netutil.IsValidIPString) } ```
/content/code_sandbox/internal/aghtls/aghtls.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
667
```go package aghtls import ( "crypto/x509" ) // SystemRootCAs tries to load root certificates from the operating system. It // returns nil in case nothing is found so that Go' crypto/x509 can use its // default algorithm to find system root CA list. // // See path_to_url func SystemRootCAs() (roots *x509.CertPool) { return rootCAs() } ```
/content/code_sandbox/internal/aghtls/root.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
90
```go package client import ( "encoding" "fmt" "net" "net/netip" "slices" "strings" "time" "github.com/AdguardTeam/AdGuardHome/internal/filtering" "github.com/AdguardTeam/AdGuardHome/internal/filtering/safesearch" "github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/dnsproxy/upstream" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/google/uuid" ) // UID is the type for the unique IDs of persistent clients. type UID uuid.UUID // NewUID returns a new persistent client UID. Any error returned is an error // from the cryptographic randomness reader. func NewUID() (uid UID, err error) { uuidv7, err := uuid.NewV7() return UID(uuidv7), err } // MustNewUID is a wrapper around [NewUID] that panics if there is an error. func MustNewUID() (uid UID) { uid, err := NewUID() if err != nil { panic(fmt.Errorf("unexpected uuidv7 error: %w", err)) } return uid } // type check var _ encoding.TextMarshaler = UID{} // MarshalText implements the [encoding.TextMarshaler] for UID. func (uid UID) MarshalText() ([]byte, error) { return uuid.UUID(uid).MarshalText() } // type check var _ encoding.TextUnmarshaler = (*UID)(nil) // UnmarshalText implements the [encoding.TextUnmarshaler] interface for UID. func (uid *UID) UnmarshalText(data []byte) error { return (*uuid.UUID)(uid).UnmarshalText(data) } // Persistent contains information about persistent clients. type Persistent struct { // UpstreamConfig is the custom upstream configuration for this client. If // it's nil, it has not been initialized yet. If it's non-nil and empty, // there are no valid upstreams. If it's non-nil and non-empty, these // upstream must be used. UpstreamConfig *proxy.CustomUpstreamConfig // SafeSearch handles search engine hosts rewrites. SafeSearch filtering.SafeSearch // BlockedServices is the configuration of blocked services of a client. It // must not be nil after initialization. BlockedServices *filtering.BlockedServices // Name of the persistent client. Must not be empty. Name string // Tags is a list of client tags that categorize the client. Tags []string // Upstreams is a list of custom upstream DNS servers for the client. Upstreams []string // IPs is a list of IP addresses that identify the client. The client must // have at least one ID (IP, subnet, MAC, or ClientID). IPs []netip.Addr // Subnets identifying the client. The client must have at least one ID // (IP, subnet, MAC, or ClientID). // // TODO(s.chzhen): Use netutil.Prefix. Subnets []netip.Prefix // MACs identifying the client. The client must have at least one ID (IP, // subnet, MAC, or ClientID). MACs []net.HardwareAddr // ClientIDs identifying the client. The client must have at least one ID // (IP, subnet, MAC, or ClientID). ClientIDs []string // UID is the unique identifier of the persistent client. UID UID // UpstreamsCacheSize is the cache size for custom upstreams. UpstreamsCacheSize uint32 // UpstreamsCacheEnabled specifies whether custom upstreams are used. UpstreamsCacheEnabled bool // UseOwnSettings specifies whether custom filtering settings are used. UseOwnSettings bool // FilteringEnabled specifies whether filtering is enabled. FilteringEnabled bool // SafeBrowsingEnabled specifies whether safe browsing is enabled. SafeBrowsingEnabled bool // ParentalEnabled specifies whether parental control is enabled. ParentalEnabled bool // UseOwnBlockedServices specifies whether custom services are blocked. UseOwnBlockedServices bool // IgnoreQueryLog specifies whether the client requests are logged. IgnoreQueryLog bool // IgnoreStatistics specifies whether the client requests are counted. IgnoreStatistics bool // SafeSearchConf is the safe search filtering configuration. // // TODO(d.kolyshev): Make SafeSearchConf a pointer. SafeSearchConf filtering.SafeSearchConfig } // validate returns an error if persistent client information contains errors. func (c *Persistent) validate(allTags *container.MapSet[string]) (err error) { switch { case c.Name == "": return errors.Error("empty name") case c.IDsLen() == 0: return errors.Error("id required") case c.UID == UID{}: return errors.Error("uid required") } conf, err := proxy.ParseUpstreamsConfig(c.Upstreams, &upstream.Options{}) if err != nil { return fmt.Errorf("invalid upstream servers: %w", err) } err = conf.Close() if err != nil { log.Error("client: closing upstream config: %s", err) } for _, t := range c.Tags { if !allTags.Has(t) { return fmt.Errorf("invalid tag: %q", t) } } // TODO(s.chzhen): Move to the constructor. slices.Sort(c.Tags) return nil } // SetIDs parses a list of strings into typed fields and returns an error if // there is one. func (c *Persistent) SetIDs(ids []string) (err error) { for _, id := range ids { err = c.setID(id) if err != nil { return err } } slices.SortFunc(c.IPs, netip.Addr.Compare) // TODO(s.chzhen): Use netip.PrefixCompare in Go 1.23. slices.SortFunc(c.Subnets, subnetCompare) slices.SortFunc(c.MACs, slices.Compare[net.HardwareAddr]) slices.Sort(c.ClientIDs) return nil } // subnetCompare is a comparison function for the two subnets. It returns -1 if // x sorts before y, 1 if x sorts after y, and 0 if their relative sorting // position is the same. func subnetCompare(x, y netip.Prefix) (cmp int) { if x == y { return 0 } xAddr, xBits := x.Addr(), x.Bits() yAddr, yBits := y.Addr(), y.Bits() if xBits == yBits { return xAddr.Compare(yAddr) } if xBits > yBits { return -1 } else { return 1 } } // setID parses id into typed field if there is no error. func (c *Persistent) setID(id string) (err error) { if id == "" { return errors.Error("clientid is empty") } var ip netip.Addr if ip, err = netip.ParseAddr(id); err == nil { c.IPs = append(c.IPs, ip) return nil } var subnet netip.Prefix if subnet, err = netip.ParsePrefix(id); err == nil { c.Subnets = append(c.Subnets, subnet) return nil } var mac net.HardwareAddr if mac, err = net.ParseMAC(id); err == nil { c.MACs = append(c.MACs, mac) return nil } err = ValidateClientID(id) if err != nil { // Don't wrap the error, because it's informative enough as is. return err } c.ClientIDs = append(c.ClientIDs, strings.ToLower(id)) return nil } // ValidateClientID returns an error if id is not a valid ClientID. // // TODO(s.chzhen): It's an exact copy of the [dnsforward.ValidateClientID] to // avoid the import cycle. Remove it. func ValidateClientID(id string) (err error) { err = netutil.ValidateHostnameLabel(id) if err != nil { // Replace the domain name label wrapper with our own. return fmt.Errorf("invalid clientid %q: %w", id, errors.Unwrap(err)) } return nil } // IDs returns a list of client IDs containing at least one element. func (c *Persistent) IDs() (ids []string) { ids = make([]string, 0, c.IDsLen()) for _, ip := range c.IPs { ids = append(ids, ip.String()) } for _, subnet := range c.Subnets { ids = append(ids, subnet.String()) } for _, mac := range c.MACs { ids = append(ids, mac.String()) } return append(ids, c.ClientIDs...) } // IDsLen returns a length of client ids. func (c *Persistent) IDsLen() (n int) { return len(c.IPs) + len(c.Subnets) + len(c.MACs) + len(c.ClientIDs) } // EqualIDs returns true if the ids of the current and previous clients are the // same. func (c *Persistent) EqualIDs(prev *Persistent) (equal bool) { return slices.Equal(c.IPs, prev.IPs) && slices.Equal(c.Subnets, prev.Subnets) && slices.EqualFunc(c.MACs, prev.MACs, slices.Equal[net.HardwareAddr]) && slices.Equal(c.ClientIDs, prev.ClientIDs) } // ShallowClone returns a deep copy of the client, except upstreamConfig, // safeSearchConf, SafeSearch fields, because it's difficult to copy them. func (c *Persistent) ShallowClone() (clone *Persistent) { clone = &Persistent{} *clone = *c clone.BlockedServices = c.BlockedServices.Clone() clone.Tags = slices.Clone(c.Tags) clone.Upstreams = slices.Clone(c.Upstreams) clone.IPs = slices.Clone(c.IPs) clone.Subnets = slices.Clone(c.Subnets) clone.MACs = slices.Clone(c.MACs) clone.ClientIDs = slices.Clone(c.ClientIDs) return clone } // CloseUpstreams closes the client-specific upstream config of c if any. func (c *Persistent) CloseUpstreams() (err error) { if c.UpstreamConfig != nil { if err = c.UpstreamConfig.Close(); err != nil { return fmt.Errorf("closing upstreams of client %q: %w", c.Name, err) } } return nil } // SetSafeSearch initializes and sets the safe search filter for this client. func (c *Persistent) SetSafeSearch( conf filtering.SafeSearchConfig, cacheSize uint, cacheTTL time.Duration, ) (err error) { ss, err := safesearch.NewDefault(conf, fmt.Sprintf("client %q", c.Name), cacheSize, cacheTTL) if err != nil { // Don't wrap the error, because it's informative enough as is. return err } c.SafeSearch = ss return nil } ```
/content/code_sandbox/internal/client/persistent.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,443
```go package client import ( "context" "net/netip" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/rdns" "github.com/AdguardTeam/AdGuardHome/internal/whois" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" ) // ErrClosed is returned from [AddressProcessor.Close] if it's closed more than // once. const ErrClosed errors.Error = "use of closed address processor" // AddressProcessor is the interface for types that can process clients. type AddressProcessor interface { Process(ip netip.Addr) Close() (err error) } // EmptyAddrProc is an [AddressProcessor] that does nothing. type EmptyAddrProc struct{} // type check var _ AddressProcessor = EmptyAddrProc{} // Process implements the [AddressProcessor] interface for EmptyAddrProc. func (EmptyAddrProc) Process(_ netip.Addr) {} // Close implements the [AddressProcessor] interface for EmptyAddrProc. func (EmptyAddrProc) Close() (_ error) { return nil } // DefaultAddrProcConfig is the configuration structure for address processors. type DefaultAddrProcConfig struct { // DialContext is used to create TCP connections to WHOIS servers. // DialContext must not be nil if [DefaultAddrProcConfig.UseWHOIS] is true. DialContext aghnet.DialContextFunc // Exchanger is used to perform rDNS queries. Exchanger must not be nil if // [DefaultAddrProcConfig.UseRDNS] is true. Exchanger rdns.Exchanger // PrivateSubnets are used to determine if an incoming IP address is // private. It must not be nil. PrivateSubnets netutil.SubnetSet // AddressUpdater is used to update the information about a client's IP // address. It must not be nil. AddressUpdater AddressUpdater // InitialAddresses are the addresses that are queued for processing // immediately by [NewDefaultAddrProc]. InitialAddresses []netip.Addr // CatchPanics, if true, makes the address processor catch and log panics. // // TODO(a.garipov): Consider better ways to do this or apply this method to // other parts of the codebase. CatchPanics bool // UseRDNS, if true, enables resolving of client IP addresses using reverse // DNS. UseRDNS bool // UsePrivateRDNS, if true, enables resolving of private client IP addresses // using reverse DNS. See [DefaultAddrProcConfig.PrivateSubnets]. UsePrivateRDNS bool // UseWHOIS, if true, enables resolving of client IP addresses using WHOIS. UseWHOIS bool } // AddressUpdater is the interface for storages of DNS clients that can update // information about them. // // TODO(a.garipov): Consider using the actual client storage once it is moved // into this package. type AddressUpdater interface { // UpdateAddress updates information about an IP address, setting host (if // not empty) and WHOIS information (if not nil). UpdateAddress(ip netip.Addr, host string, info *whois.Info) } // DefaultAddrProc processes incoming client addresses with rDNS and WHOIS, if // configured, and updates that information in a client storage. type DefaultAddrProc struct { // clientIPsMu serializes closure of clientIPs and access to isClosed. clientIPsMu *sync.Mutex // clientIPs is the channel queueing client processing tasks. clientIPs chan netip.Addr // rdns is used to perform rDNS lookups of clients' IP addresses. rdns rdns.Interface // whois is used to perform WHOIS lookups of clients' IP addresses. whois whois.Interface // addrUpdater is used to update the information about a client's IP // address. addrUpdater AddressUpdater // privateSubnets are used to determine if an incoming IP address is // private. privateSubnets netutil.SubnetSet // isClosed is set to true once the address processor is closed. isClosed bool // usePrivateRDNS, if true, enables resolving of private client IP addresses // using reverse DNS. usePrivateRDNS bool } const ( // defaultQueueSize is the size of queue of IPs for rDNS and WHOIS // processing. defaultQueueSize = 255 // defaultCacheSize is the maximum size of the cache for rDNS and WHOIS // processing. It must be greater than zero. defaultCacheSize = 10_000 // defaultIPTTL is the Time to Live duration for IP addresses cached by // rDNS and WHOIS. defaultIPTTL = 1 * time.Hour ) // NewDefaultAddrProc returns a new running client address processor. c must // not be nil. func NewDefaultAddrProc(c *DefaultAddrProcConfig) (p *DefaultAddrProc) { p = &DefaultAddrProc{ clientIPsMu: &sync.Mutex{}, clientIPs: make(chan netip.Addr, defaultQueueSize), rdns: &rdns.Empty{}, addrUpdater: c.AddressUpdater, whois: &whois.Empty{}, privateSubnets: c.PrivateSubnets, usePrivateRDNS: c.UsePrivateRDNS, } if c.UseRDNS { p.rdns = rdns.New(&rdns.Config{ Exchanger: c.Exchanger, CacheSize: defaultCacheSize, CacheTTL: defaultIPTTL, }) } if c.UseWHOIS { p.whois = newWHOIS(c.DialContext) } go p.process(c.CatchPanics) for _, ip := range c.InitialAddresses { p.Process(ip) } return p } // newWHOIS returns a whois.Interface instance using the given function for // dialing. func newWHOIS(dialFunc aghnet.DialContextFunc) (w whois.Interface) { // TODO(s.chzhen): Consider making configurable. const ( // defaultTimeout is the timeout for WHOIS requests. defaultTimeout = 5 * time.Second // defaultMaxConnReadSize is an upper limit in bytes for reading from a // net.Conn. defaultMaxConnReadSize = 64 * 1024 // defaultMaxRedirects is the maximum redirects count. defaultMaxRedirects = 5 // defaultMaxInfoLen is the maximum length of whois.Info fields. defaultMaxInfoLen = 250 ) return whois.New(&whois.Config{ DialContext: dialFunc, ServerAddr: whois.DefaultServer, Port: whois.DefaultPort, Timeout: defaultTimeout, CacheSize: defaultCacheSize, MaxConnReadSize: defaultMaxConnReadSize, MaxRedirects: defaultMaxRedirects, MaxInfoLen: defaultMaxInfoLen, CacheTTL: defaultIPTTL, }) } // type check var _ AddressProcessor = (*DefaultAddrProc)(nil) // Process implements the [AddressProcessor] interface for *DefaultAddrProc. func (p *DefaultAddrProc) Process(ip netip.Addr) { p.clientIPsMu.Lock() defer p.clientIPsMu.Unlock() if p.isClosed { return } select { case p.clientIPs <- ip: // Go on. default: log.Debug("clients: ip channel is full; len: %d", len(p.clientIPs)) } } // process processes the incoming client IP-address information. It is intended // to be used as a goroutine. Once clientIPs is closed, process exits. func (p *DefaultAddrProc) process(catchPanics bool) { if catchPanics { defer log.OnPanic("addrProcessor.process") } log.Info("clients: processing addresses") for ip := range p.clientIPs { host := p.processRDNS(ip) info := p.processWHOIS(ip) p.addrUpdater.UpdateAddress(ip, host, info) } log.Info("clients: finished processing addresses") } // processRDNS resolves the clients' IP addresses using reverse DNS. host is // empty if there were errors or if the information hasn't changed. func (p *DefaultAddrProc) processRDNS(ip netip.Addr) (host string) { start := time.Now() log.Debug("clients: processing %s with rdns", ip) defer func() { log.Debug("clients: finished processing %s with rdns in %s", ip, time.Since(start)) }() ok := p.shouldResolve(ip) if !ok { return } host, changed := p.rdns.Process(ip) if !changed { host = "" } return host } // shouldResolve returns false if ip is a loopback address, or ip is private and // resolving of private addresses is disabled. func (p *DefaultAddrProc) shouldResolve(ip netip.Addr) (ok bool) { return !ip.IsLoopback() && (p.usePrivateRDNS || !p.privateSubnets.Contains(ip)) } // processWHOIS looks up the information about clients' IP addresses in the // WHOIS databases. info is nil if there were errors or if the information // hasn't changed. func (p *DefaultAddrProc) processWHOIS(ip netip.Addr) (info *whois.Info) { start := time.Now() log.Debug("clients: processing %s with whois", ip) defer func() { log.Debug("clients: finished processing %s with whois in %s", ip, time.Since(start)) }() // TODO(s.chzhen): Move the timeout logic from WHOIS configuration to the // context. info, changed := p.whois.Process(context.Background(), ip) if !changed { info = nil } return info } // Close implements the [AddressProcessor] interface for *DefaultAddrProc. func (p *DefaultAddrProc) Close() (err error) { p.clientIPsMu.Lock() defer p.clientIPsMu.Unlock() if p.isClosed { return ErrClosed } close(p.clientIPs) p.isClosed = true return nil } ```
/content/code_sandbox/internal/client/addrproc.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,265
```yaml 'openapi': '3.0.3' 'info': 'contact': 'email': 'devteam@adguard.com' 'name': 'AdGuard Home' 'url': 'path_to_url 'description': | **!! WARNING! API IS AT THE DRAFT STAGE! THINGS WILL BREAK! !!** AdGuard Home REST API, V1 **DRAFT**. Our administration web interface is built on top of this REST API. This API is currently a **DRAFT** and is not covered by any stability guarantees. Once this API reaches maturity, the old `/control/` API will mostly be removed. ## Information For API Users * Empty arrays are always sent by the backend, unless documented otherwise. If the backend doesn't, it's a backend error. * `PATCH` requests with JSON bodies use RFC 7396 JSON Merge Patch unless documented otherwise. * The property `x-error-class` on plain text error responses suggests, which class of error should be used if the API user wants to wrap it into an object. The property `x-error-code` suggest the error code for the error object. The code usually goes into the `code` property, and the content, into `msg`. * The property `x-skip-web-api` on operations suggests API clients for web, like our frontend, to skip this operation in their generated code. * The header `Server` will be set to `AdGuardHome/<<full-version>>`. For example: `AdGuardHome/v0.107.0-a.42+abcd1234`. ## Conventions For API Authors ### Naming * `CapitalCamelCase` for entities. * Initialisms are spelled like `DhcpSettings` and not `DHCPSettings`. * `lower_snake_case` for path and query parameters. * No unit suffices. * Path parameters's names start with `Path`; query, with `Query`. * Requests end with `Req`; responses, with `Resp`. ### Structure * Add `400` and `422` responses to requests that accept data. * Add `401` responses, unless the method can work without authorization. * Add `500` responses. * Descriptions are always on their own lines. * Don't add a description if there is already one a level above. * Five levels of indentation max, except for descriptions and array items. * Keep things in alphabetical order. * Mark required things as such. Document possibly-absent fields **both** in `required` **and** in `description`, if there is one. * Prefer flat objects. Example: `resp.top_user`, not `resp.top.user.val`. * Prefer to make it easier for the frontend where possible. * Provide examples for requests and responses. If examples are provided elsewhere, document that. * Summaries and descriptions with dots. * Top-level value in a JSON request or response must be an object. ### Types * Add `'maximum': 65535` for 16-bit unsigned integers (for example, port numbers). * Add `'minimum': 0` for unsigned integers. * Duration in milliseconds. Time in milliseconds in the Unix epoch. Both of type `double`, because that is easier for the JS frontend. * Integers are always `int64`, numbers are always `double. 'license': 'url': 'path_to_url 'title': 'AdGuard Home V1 DRAFT API' 'version': '0.108' 'servers': - 'description': > The V1 HTTP API namespace. 'url': '/api/v1' 'security': - 'basicAuth': [] 'tags': - 'description': > Authorization and account management. 'name': 'accounts' - 'description': > Configuration and settings for Apple products. 'name': 'apple' - 'description': > Runtime and persistent client information. 'name': 'clients' - 'description': > DHCP server methods. 'name': 'dhcp' - 'description': > First-time install configuration handlers. Will not be available once the installation is done. 'name': 'install' - 'description': > Query logs. 'name': 'log' - 'description': > Filter lists, blocked services, and custom filtering rules. 'name': 'protection' - 'description': > Settings management. 'name': 'settings' - 'description': > Query, filtering, system, and other statistics. 'name': 'stats' - 'description': > Information about the AdGuard Home server and the host system. 'name': 'system' 'paths': '/health-check': 'get': 'operationId': 'HealthCheck' 'responses': '200': 'description': > An OK response. 'content': 'text/plain': 'example': 'OK' 'servers': - 'url': '/' 'summary': 'Check if the server is up.' 'tags': - 'system' '/accounts/profile': 'get': 'operationId': 'GetV1AccountsProfile' 'responses': '200': '$ref': '#/components/responses/GetV1AccountsProfileResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get the profile of the current user.' 'tags': - 'accounts' 'patch': 'operationId': 'PatchV1AccountsProfile' 'requestBody': '$ref': '#/components/requestBodies/PatchV1AccountsProfileReq' 'responses': '200': '$ref': '#/components/responses/PatchV1AccountsProfileResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update the profile of the current user.' 'tags': - 'accounts' '/accounts/session': 'delete': 'operationId': 'DeleteV1AccountsSession' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Log out of the system.' 'tags': - 'accounts' 'post': 'operationId': 'PostV1AccountsSession' 'requestBody': '$ref': '#/components/requestBodies/PostV1AccountsSessionReq' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '400': '$ref': '#/components/responses/BadRequestResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Log into the system.' 'tags': - 'accounts' '/apple/doh.mobileconfig': 'get': 'operationId': 'GetV1AppleDohMobileconfig' 'parameters': - '$ref': '#/components/parameters/QueryClientId' - '$ref': '#/components/parameters/QueryHost' 'responses': '200': '$ref': '#/components/responses/GetV1AppleDohMobileconfigResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get a DNS-over-HTTPS .mobileconfig.' 'tags': - 'apple' 'x-skip-web-api': true '/apple/dot.mobileconfig': 'get': 'operationId': 'GetV1AppleDotMobileconfig' 'parameters': - '$ref': '#/components/parameters/QueryHost' - '$ref': '#/components/parameters/QueryClientId' 'responses': '200': '$ref': '#/components/responses/GetV1AppleDotMobileconfigResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get a DNS-over-HTTPS .mobileconfig.' 'tags': - 'apple' 'x-skip-web-api': true '/clients/persistent': 'get': 'operationId': 'GetV1ClientsPersistent' 'responses': '200': '$ref': '#/components/responses/GetV1ClientsPersistentResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get all persistent clients.' 'tags': - 'clients' 'post': 'operationId': 'PostV1ClientsPersistent' 'requestBody': '$ref': '#/components/requestBodies/PostV1ClientsPersistentReq' 'responses': '201': '$ref': '#/components/responses/PostV1ClientsPersistentResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Create a new persistent client.' 'tags': - 'clients' '/clients/persistent/{client_uid}': 'delete': 'operationId': 'DeleteV1ClientPersistent' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '404': '$ref': '#/components/responses/NotFoundResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Delete a persistent client.' 'tags': - 'clients' 'parameters': - '$ref': '#/components/parameters/PathClientUid' 'patch': 'operationId': 'PatchV1ClientPersistent' 'requestBody': '$ref': '#/components/requestBodies/PatchV1ClientPersistentReq' 'responses': '200': '$ref': '#/components/responses/PatchV1ClientPersistentResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '404': '$ref': '#/components/responses/NotFoundResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update a persistent client.' 'tags': - 'clients' '/clients/runtime': 'get': 'operationId': 'GetV1ClientsRuntime' 'responses': '200': '$ref': '#/components/responses/GetV1ClientsRuntimeResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get all runtime clients.' 'tags': - 'clients' '/dhcp/leases': 'get': 'operationId': 'GetV1DhcpLeases' 'responses': '200': '$ref': '#/components/responses/GetV1DhcpLeasesResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get all dynamic and static DHCP leases.' 'tags': - 'dhcp' 'post': 'operationId': 'PostV1DhcpLeases' 'requestBody': '$ref': '#/components/requestBodies/PostV1DhcpLeasesReq' 'responses': '200': '$ref': '#/components/responses/PostV1DhcpLeasesResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Create a new static DHCP lease.' 'tags': - 'dhcp' '/dhcp/leases/{lease_uid}': 'delete': 'operationId': 'DeleteV1DhcpLease' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '404': '$ref': '#/components/responses/NotFoundResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Delete a static DHCP lease.' 'tags': - 'dhcp' 'parameters': - '$ref': '#/components/parameters/PathLeaseUid' 'patch': 'operationId': 'PatchV1DhcpLease' 'requestBody': '$ref': '#/components/requestBodies/PatchV1DhcpLeaseReq' 'responses': '200': '$ref': '#/components/responses/PatchV1DhcpLeaseResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '404': '$ref': '#/components/responses/NotFoundResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update a static DHCP lease.' 'tags': - 'dhcp' '/dhcp/status': 'get': 'operationId': 'GetV1DhcpStatus' 'responses': '200': '$ref': '#/components/responses/GetV1DhcpStatusResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get DHCP server status.' 'tags': - 'dhcp' '/install/check': 'post': 'operationId': 'PostV1InstallCheck' 'requestBody': '$ref': '#/components/requestBodies/PostV1InstallCheckReq' 'responses': '200': '$ref': '#/components/responses/PostV1InstallCheckResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Check initial configuration.' 'tags': - 'install' '/install/configure': 'post': 'operationId': 'PostV1InstallConfigure' 'requestBody': '$ref': '#/components/requestBodies/PostV1InstallConfigureReq' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Apply initial configuration.' 'tags': - 'install' '/install/info': 'get': 'operationId': 'GetV1InstallInfo' 'responses': '200': '$ref': '#/components/responses/GetV1InstallInfoResp' '404': '$ref': '#/components/responses/NotFoundResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get initial configuration information.' 'tags': - 'install' '/log/clear': 'post': 'operationId': 'PostV1LogClear' 'requestBody': '$ref': '#/components/requestBodies/PostV1LogClearReq' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Clear the whole query log.' 'tags': - 'log' '/log/search': 'get': 'operationId': 'GetV1LogSearch' 'parameters': - '$ref': '#/components/parameters/QueryBefore' - '$ref': '#/components/parameters/QueryLimit' - '$ref': '#/components/parameters/QueryReason' - '$ref': '#/components/parameters/QueryTerm' 'responses': '200': '$ref': '#/components/responses/GetV1LogSearchResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Search query logs.' 'tags': - 'log' '/protection/blocked_services': 'get': 'operationId': 'GetV1ProtectionBlockedServices' 'responses': '200': '$ref': '#/components/responses/GetV1ProtectionBlockedServicesResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get blocked services.' 'tags': - 'protection' 'put': 'operationId': 'PutV1ProtectionBlockedServices' 'requestBody': '$ref': '#/components/requestBodies/PutV1ProtectionBlockedServicesReq' 'responses': '200': '$ref': '#/components/responses/GetV1ProtectionBlockedServicesResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Replace blocked services.' 'tags': - 'protection' '/protection/check_custom_rules': 'post': 'operationId': 'PostV1ProtectionCheckCustomRules' 'requestBody': '$ref': '#/components/requestBodies/PostV1ProtectionCheckCustomRulesReq' 'responses': '201': '$ref': '#/components/responses/PostV1ProtectionCheckCustomRulesResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Check custom filtering rules.' 'tags': - 'protection' '/protection/custom_rules': 'get': 'operationId': 'GetV1ProtectionCustomRules' 'responses': '200': '$ref': '#/components/responses/GetV1ProtectionCustomRulesResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get custom rules.' 'tags': - 'protection' 'put': 'operationId': 'PutV1ProtectionCustomRules' 'requestBody': '$ref': '#/components/requestBodies/PutV1ProtectionCustomRulesReq' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Replace custom rules.' 'tags': - 'protection' '/protection/dns_rewrites': 'get': 'operationId': 'GetV1ProtectionDnsRewrites' 'responses': '200': '$ref': '#/components/responses/GetV1ProtectionDnsRewritesResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get all classic DNS rewrites.' 'tags': - 'protection' 'post': 'operationId': 'PostV1ProtectionDnsRewrites' 'requestBody': '$ref': '#/components/requestBodies/PostV1ProtectionDnsRewritesReq' 'responses': '201': '$ref': '#/components/responses/PostV1ProtectionDnsRewritesResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Add a new classic DNS rewrite.' 'tags': - 'protection' '/protection/dns_rewrites/{dns_rewrite_uid}': 'delete': 'operationId': 'DeleteV1ProtectionDnsRewrite' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '404': '$ref': '#/components/responses/NotFoundResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Delete a classic DNS rewrite.' 'tags': - 'protection' 'parameters': - '$ref': '#/components/parameters/PathDnsRewriteUid' '/protection/filters': 'get': 'operationId': 'GetV1ProtectionFilters' 'responses': '200': '$ref': '#/components/responses/GetV1ProtectionFiltersResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get all filters.' 'tags': - 'protection' 'post': 'operationId': 'PostV1ProtectionFilters' 'requestBody': '$ref': '#/components/requestBodies/PostV1ProtectionFiltersReq' 'responses': '201': '$ref': '#/components/responses/PostV1ProtectionFiltersResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Add a new filter.' 'tags': - 'protection' '/protection/filters/{filter_uid}': 'delete': 'operationId': 'DeleteV1ProtectionFilter' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '404': '$ref': '#/components/responses/NotFoundResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Delete a filter.' 'tags': - 'protection' 'parameters': - '$ref': '#/components/parameters/PathFilterUid' 'patch': 'operationId': 'PatchV1ProtectionFilter' 'requestBody': '$ref': '#/components/requestBodies/PatchV1ProtectionFilterReq' 'responses': '200': '$ref': '#/components/responses/PatchV1ProtectionFilterResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '404': '$ref': '#/components/responses/NotFoundResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': > Update a filter's settings. 'tags': - 'protection' '/protection/refresh_filters': 'post': 'operationId': 'PostV1ProtectionRefreshFilters' 'requestBody': '$ref': '#/components/requestBodies/PostV1ProtectionRefreshFiltersReq' 'responses': '200': '$ref': '#/components/responses/PostV1ProtectionRefreshFiltersResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': > Refresh all filters. 'tags': - 'protection' '/protection/refresh_filters/{filter_uid}': 'parameters': - '$ref': '#/components/parameters/PathFilterUid' 'post': 'operationId': 'PostV1ProtectionRefreshFilter' 'requestBody': '$ref': '#/components/requestBodies/PostV1ProtectionRefreshFilterReq' 'responses': '200': '$ref': '#/components/responses/PostV1ProtectionRefreshFilterResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': > Refresh a filter. 'tags': - 'protection' '/settings/all': 'get': 'operationId': 'GetV1SettingsAll' 'responses': '200': '$ref': '#/components/responses/GetV1SettingsAllResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get all settings.' 'tags': - 'settings' '/settings/dhcp': 'patch': 'operationId': 'PatchV1SettingsDhcp' 'requestBody': '$ref': '#/components/requestBodies/PatchV1SettingsDhcpReq' 'responses': '200': '$ref': '#/components/responses/PatchV1SettingsDhcpResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update DHCP server settings.' 'tags': - 'settings' '/settings/dns': 'patch': 'operationId': 'PatchV1SettingsDns' 'requestBody': '$ref': '#/components/requestBodies/PatchV1SettingsDnsReq' 'responses': '200': '$ref': '#/components/responses/PatchV1SettingsDnsResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update DNS server settings.' 'tags': - 'settings' '/settings/dns/access': 'get': 'description': > Get DNS access settings. This is a separate API, because these lists can become quite big. 'operationId': 'GetV1SettingsDnsAccess' 'responses': '200': '$ref': '#/components/responses/GetV1SettingsDnsAccessResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get DNS access settings.' 'tags': - 'settings' 'put': 'description': > Update DNS access settings. This is a separate API, because these lists can become quite big. 'operationId': 'PutV1SettingsDnsAccess' 'requestBody': '$ref': '#/components/requestBodies/PutV1SettingsDnsAccessReq' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update DNS access settings.' 'tags': - 'settings' '/settings/dns/check': 'post': 'operationId': 'PostV1SettingsDnsCheck' 'requestBody': '$ref': '#/components/requestBodies/PostV1SettingsDnsCheckReq' 'responses': '200': '$ref': '#/components/responses/PostV1SettingsDnsCheckResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Check DNS upstream settings.' 'tags': - 'settings' '/settings/http': 'patch': 'operationId': 'PatchV1SettingsHttp' 'requestBody': '$ref': '#/components/requestBodies/PatchV1SettingsHttpReq' 'responses': '200': '$ref': '#/components/responses/PatchV1SettingsHttpResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update web interface settings.' 'tags': - 'settings' '/settings/log': 'patch': 'operationId': 'PatchV1SettingsLog' 'requestBody': '$ref': '#/components/requestBodies/PatchV1SettingsLogReq' 'responses': '200': '$ref': '#/components/responses/PatchV1SettingsLogResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update query logging settings.' 'tags': - 'settings' '/settings/protection': 'patch': 'operationId': 'PatchV1SettingsProtection' 'requestBody': '$ref': '#/components/requestBodies/PatchV1SettingsProtectionReq' 'responses': '200': '$ref': '#/components/responses/PatchV1SettingsProtectionResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update protection settings.' 'tags': - 'settings' '/settings/stats': 'patch': 'operationId': 'PatchV1SettingsStats' 'requestBody': '$ref': '#/components/requestBodies/PatchV1SettingsStatsReq' 'responses': '200': '$ref': '#/components/responses/PatchV1SettingsStatsResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update statistics settings.' 'tags': - 'settings' '/settings/tls': 'patch': 'operationId': 'PatchV1SettingsTls' 'requestBody': '$ref': '#/components/requestBodies/PatchV1SettingsTlsReq' 'responses': '200': '$ref': '#/components/responses/PatchV1SettingsTlsResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update TLS and encryption settings.' 'tags': - 'settings' '/settings/tls/check': 'post': 'operationId': 'PostV1SettingsTlsCheck' 'requestBody': '$ref': '#/components/requestBodies/PostV1SettingsTlsCheckReq' 'responses': '200': '$ref': '#/components/responses/PostV1SettingsTlsCheckResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Check TLS and encryption settings.' 'tags': - 'settings' '/stats/all': 'get': 'operationId': 'GetV1StatsAll' 'responses': '200': '$ref': '#/components/responses/GetV1StatsAllResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get all statistics.' 'tags': - 'stats' '/stats/clear': 'post': 'operationId': 'PostV1StatsClear' 'requestBody': '$ref': '#/components/requestBodies/PostV1StatsClearReq' 'responses': '204': '$ref': '#/components/responses/NoContentResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Clear all statistics.' 'tags': - 'stats' '/system/info': 'get': 'operationId': 'GetV1SystemInfo' 'responses': '200': '$ref': '#/components/responses/GetV1SystemInfoResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Get server information.' 'tags': - 'system' '/system/reset': 'post': 'operationId': 'PostV1SystemReset' 'requestBody': '$ref': '#/components/requestBodies/PostV1SystemResetReq' 'responses': '200': '$ref': '#/components/responses/PostV1SystemResetResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Reset all settings to defaults.' 'tags': - 'system' '/system/update': 'post': 'operationId': 'PostV1SystemUpdate' 'requestBody': '$ref': '#/components/requestBodies/PostV1SystemUpdateReq' 'responses': '200': '$ref': '#/components/responses/PostV1SystemUpdateResp' '400': '$ref': '#/components/responses/BadRequestResp' '401': '$ref': '#/components/responses/UnauthorizedResp' '422': '$ref': '#/components/responses/UnprocessableEntityResp' '500': '$ref': '#/components/responses/InternalServerErrorResp' 'summary': 'Update AdGuard Home.' 'tags': - 'system' 'components': 'parameters': 'PathDnsRewriteUid': 'description': > DNS rewrite ID. 'example': 'abcd1234' 'in': 'path' 'name': 'dns_rewrite_uid' 'required': true 'schema': '$ref': '#/components/schemas/Uid' 'PathClientUid': 'description': > The unique ID of a client. 'example': 'abcd1234' 'in': 'path' 'name': 'client_uid' 'required': true 'schema': '$ref': '#/components/schemas/Uid' 'PathFilterUid': 'description': > The ID of a filter. 'example': 'abcd1234' 'in': 'path' 'name': 'filter_uid' 'required': true 'schema': '$ref': '#/components/schemas/Uid' 'PathLeaseUid': 'description': > The ID of a static lease. 'example': 'abcd1234' 'in': 'path' 'name': 'lease_uid' 'required': true 'schema': '$ref': '#/components/schemas/Uid' 'QueryBefore': 'description': > Unix time, before which to show the search results, in milliseconds. 'example': 1614345496000 'in': 'query' 'name': 'before' 'required': false 'schema': 'format': 'double' 'type': 'number' 'QueryClientId': 'description': > ClientID, **not** its UID. 'example': 'client-1' 'in': 'query' 'name': 'client_id' 'required': false 'schema': '$ref': '#/components/schemas/ClientId' 'QueryHost': 'description': > The host for which the Configuration is generated. 'example': 'example.org' 'in': 'query' 'name': 'host' 'required': true 'schema': 'type': 'string' 'QueryLimit': 'description': > Maximum amount of records to return. 'example': 100 'in': 'query' 'name': 'limit' 'required': false 'schema': 'format': 'int64' 'type': 'integer' 'QueryReason': 'description': > Filter query log results by filtering reason. 'example': 'not_filtered_notfound' 'in': 'query' 'name': 'reason' 'required': false 'schema': '$ref': '#/components/schemas/FilteringReason' 'QueryTerm': 'description': > Search term. 'example': '127.0.0.1' 'in': 'query' 'name': 'term' 'required': false 'schema': 'type': 'string' 'requestBodies': 'PatchV1AccountsProfileReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1AccountsProfileReq' 'required': true 'PatchV1ClientPersistentReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1ClientPersistentReq' 'required': true 'PatchV1DhcpLeaseReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1DhcpLeaseReq' 'required': true 'PatchV1ProtectionFilterReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1ProtectionFilterReq' 'required': true 'PatchV1SettingsDhcpReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsDhcpReq' 'required': true 'PatchV1SettingsDnsReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsDnsReq' 'required': true 'PatchV1SettingsHttpReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpReq' 'required': true 'PatchV1SettingsLogReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsLogReq' 'required': true 'PatchV1SettingsProtectionReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsProtectionReq' 'required': true 'PatchV1SettingsStatsReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsStatsReq' 'required': true 'PatchV1SettingsTlsReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsTlsReq' 'required': true 'PostV1AccountsSessionReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1AccountsSessionReq' 'required': true 'PostV1ClientsPersistentReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ClientsPersistentReq' 'required': true 'PostV1DhcpLeasesReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1DhcpLeasesReq' 'required': true 'PostV1InstallCheckReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1InstallCheckReq' 'required': true 'PostV1InstallConfigureReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1InstallConfigureReq' 'required': true 'PostV1LogClearReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1LogClearReq' 'required': true 'PostV1ProtectionCheckCustomRulesReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionCheckCustomRulesReq' 'required': true 'PostV1ProtectionDnsRewritesReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionDnsRewritesReq' 'required': true 'PostV1ProtectionFiltersReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionFiltersReq' 'required': true 'PostV1ProtectionRefreshFilterReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionRefreshFilterReq' 'required': true 'PostV1ProtectionRefreshFiltersReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionRefreshFiltersReq' 'required': true 'PostV1SettingsDnsCheckReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SettingsDnsCheckReq' 'required': true 'PostV1SettingsTlsCheckReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SettingsTlsCheckReq' 'required': true 'PostV1StatsClearReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1StatsClearReq' 'required': true 'PostV1SystemResetReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SystemResetReq' 'required': true 'PostV1SystemUpdateReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SystemUpdateReq' 'required': true 'PutV1ProtectionBlockedServicesReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PutV1ProtectionBlockedServicesReq' 'required': true 'PutV1ProtectionCustomRulesReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PutV1ProtectionCustomRulesReq' 'required': true 'PutV1SettingsDnsAccessReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PutV1SettingsDnsAccessReq' 'required': true 'responses': 'BadRequestResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/BadRequestResp' 'text/plain': 'example': >- invalid character '{' looking for beginning of object key string 'x-error-class': '#/components/schemas/BadRequestResp' 'x-error-code': 'TXT400' 'description': > Generic bad request response. Sent when the request data is malformed (for example, invalid JSON). 'GetV1AccountsProfileResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1AccountsProfileResp' 'description': > A successful response to a `GET /api/v1/accounts/profile` request. 'GetV1AppleDohMobileconfigResp': 'content': 'application/xml': 'schema': '$ref': '#/components/schemas/GetV1AppleDohMobileconfigResp' 'description': > A successful response to a `GET /api/v1/apple/doh.mobileconfig` request. 'GetV1AppleDotMobileconfigResp': 'content': 'application/xml': 'schema': '$ref': '#/components/schemas/GetV1AppleDotMobileconfigResp' 'description': > A successful response to a `GET /api/v1/apple/dot.mobileconfig` request. 'GetV1ClientsPersistentResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1ClientsPersistentResp' 'description': > A successful response to a `GET /api/v1/clients/persistent` request. 'GetV1ClientsRuntimeResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1ClientsRuntimeResp' 'description': > A successful response to a `GET /api/v1/clients/runtime` request. 'GetV1DhcpLeasesResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1DhcpLeasesResp' 'description': > A successful response to a `GET /api/v1/dhcp/leases` request. 'GetV1DhcpStatusResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1DhcpStatusResp' 'description': > A successful response to a `GET /api/v1/dhcp/status` request. 'GetV1InstallInfoResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1InstallInfoResp' 'description': > A successful response to a `GET /api/v1/install/info` request. 'GetV1LogSearchResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1LogSearchResp' 'description': > A successful response to a `GET /api/v1/log/search` request. 'GetV1ProtectionBlockedServicesResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1ProtectionBlockedServicesResp' 'description': > A successful response to a `GET /api/v1/protection/blocked_services` or a `PUT /api/v1/protection/blocked_services` request. 'GetV1ProtectionCustomRulesResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1ProtectionCustomRulesResp' 'description': > A successful response to a `GET /api/v1/protection/custom_rules` request. 'GetV1ProtectionDnsRewritesResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1ProtectionDnsRewritesResp' 'description': > A successful response to a `GET /api/v1/protection/dns_rewrites` request. 'GetV1ProtectionFiltersResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1ProtectionFiltersResp' 'description': > A successful response to a `GET /api/v1/protection/filters` request. 'GetV1SettingsAllResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1SettingsAllResp' 'description': > A successful response to a `GET /api/v1/settings/all` request. 'GetV1SettingsDnsAccessResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1SettingsDnsAccessResp' 'description': > A successful response to a `GET /api/v1/settings/dns/access` request. 'GetV1StatsAllResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1StatsAllResp' 'description': > A successful response to a `GET /api/v1/stats/all` request. 'GetV1SystemInfoResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/GetV1SystemInfoResp' 'description': > A successful response to a `GET /api/v1/server/info` request. 'InternalServerErrorResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/InternalServerErrorResp' 'text/plain': 'example': >- runtime error: invalid memory address or nil pointer dereference 'x-error-class': '#/components/schemas/InternalServerErrorResp' 'x-error-code': 'TXT500' 'description': > Generic internal server error. 'NoContentResp': 'description': > Generic no-error no-content response. 'NotFoundResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/NotFoundResp' 'text/plain': 'example': >- Not found. 'x-error-class': '#/components/schemas/NotFoundResp' 'x-error-code': 'TXT404' 'description': > Generic not found response. 'PatchV1AccountsProfileResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1AccountsProfileResp' 'description': > A successful response to a `PATCH /api/v1/accounts/profile` request. 'PatchV1ClientPersistentResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1ClientPersistentResp' 'description': > A successful response to a `PATCH /api/v1/clients/persistent/{client_uid}` request. 'PatchV1DhcpLeaseResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1DhcpLeaseResp' 'description': > A successful response to a `PATCH /api/v1/dhcp/leases/{lease_uid}` request. 'PatchV1ProtectionFilterResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1ProtectionFilterResp' 'description': > A successful response to a `PATCH /api/v1/filters/{filter_uid}` request. 'PatchV1SettingsDhcpResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsDhcpResp' 'description': > A successful response to a `PATCH /api/v1/settings/dhcp` request. 'PatchV1SettingsDnsResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsDnsResp' 'description': > A successful response to a `PATCH /api/v1/settings/dns` request. 'PatchV1SettingsHttpResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpResp' 'description': > A successful response to a `PATCH /api/v1/settings/http` request. 'PatchV1SettingsLogResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsLogResp' 'description': > A successful response to a `PATCH /api/v1/settings/log` request. 'PatchV1SettingsProtectionResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsProtectionResp' 'description': > A successful response to a `PATCH /api/v1/settings/protection` request. 'PatchV1SettingsStatsResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsStatsResp' 'description': > A successful response to a `PATCH /api/v1/settings/stats` request. 'PatchV1SettingsTlsResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsTlsResp' 'description': > A successful response to a `PATCH /api/v1/settings/tls` request. 'PostV1ClientsPersistentResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ClientsPersistentResp' 'description': > A successful response to a `POST /api/v1/clients/persistent` request. 'PostV1DhcpLeasesResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1DhcpLeasesResp' 'description': > A successful response to a `POST /api/v1/dhcp/leases` request. 'PostV1InstallCheckResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1InstallCheckResp' 'description': > A successful response to a `POST /api/v1/install/check` request. 'PostV1ProtectionCheckCustomRulesResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionCheckCustomRulesResp' 'description': > A successful response to a `POST /api/v1/protection/check_custom_rules` request. 'PostV1ProtectionDnsRewritesResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionDnsRewritesResp' 'description': > A successful response to a `POST /api/v1/protection/dns_rewrites` request. 'PostV1ProtectionFiltersResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionFiltersResp' 'description': > A successful response to a `POST /api/v1/protection/filters` request. 'PostV1ProtectionRefreshFilterResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionRefreshFilterResp' 'description': > A successful response to a `POST /api/v1/protection/refresh_filters/{filter_uid}` request. 'PostV1ProtectionRefreshFiltersResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1ProtectionRefreshFiltersResp' 'description': > A successful response to a `POST /api/v1/protection/refresh_filters` request. 'PostV1SettingsDnsCheckResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SettingsDnsCheckResp' 'description': > A successful response to a `POST /api/v1/settings/dns/check` request. 'PostV1SettingsTlsCheckResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SettingsTlsCheckResp' 'description': > A successful response to a `POST /api/v1/settings/tls/check` request. 'PostV1SystemResetResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SystemResetResp' 'description': > A successful response to a `POST /api/v1/system/reset` request. 'PostV1SystemUpdateResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PostV1SystemUpdateResp' 'description': > A successful response to a `POST /api/v1/system/update` request. 'UnauthorizedResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/UnauthorizedResp' 'text/plain': 'example': 'no or bad authorization provided' 'x-error-class': '#/components/schemas/UnauthorizedResp' 'x-error-code': 'TXT401' 'description': > This API requires authorization. 'headers': 'WWW-Authenticate': 'description': > The required WWW-Authenticate header. 'example': 'Basic realm="AdGuard Home", charset="UTF-8"' 'required': true 'schema': 'type': 'string' 'UnprocessableEntityResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/UnprocessableEntityResp' 'description': > Generic bad request data response. Sent when the request data is well-formed but is invalid for this request. 'schemas': 'BadRequestResp': 'example': 'code': 'JSN000' 'msg': >- invalid character '{' looking for beginning of object key string 'properties': 'code': '$ref': '#/components/schemas/ErrorCode' 'msg': 'description': > Error message string. 'type': 'string' 'required': - 'code' - 'msg' 'type': 'object' 'BlockedServiceId': 'description': > ID of a blocked service. 'enum': - '9gag' - 'amazon' - 'cloudflare' - 'dailymotion' - 'discord' - 'disneyplus' - 'ebay' - 'epic_games' - 'facebook' - 'hulu' - 'imgur' - 'instagram' - 'mail_ru' - 'netflix' - 'ok' - 'origin' - 'pinterest' - 'qq' - 'reddit' - 'skype' - 'snapchat' - 'spotify' - 'steam' - 'telegram' - 'tiktok' - 'tinder' - 'twitch' - 'twitter' - 'viber' - 'vimeo' - 'vk' - 'wechat' - 'weibo' - 'whatsapp' - 'youtube' 'type': 'string' 'BlockedServices': 'description': > Blocked services. 'example': 'services': - '9gag' - 'dailymotion' 'properties': 'services': 'description': > All blocked services. 'items': '$ref': '#/components/schemas/BlockedServiceId' 'type': 'array' 'required': - 'services' 'type': 'object' 'Channel': 'description': > AdGuard Home release channel. 'enum': - 'beta' - 'development' - 'edge' - 'release' 'type': 'string' 'ClientId': 'pattern': '[0-9a-z-]{1,64}' 'type': 'string' 'ClientInfo': 'description': > A shorter information about a client. If the `uid` field is present, this is a persistent client. Otherwise, this is a runtime client. 'properties': 'blocked': 'description': > If `true`, client is blocked. 'type': 'boolean' 'ids': 'description': | Client identifiers. That includes ClientIDs set by users as well as IP addresses. There must be at least one identifier. Not to be confused with the `uid` field. 'example': - '1.2.3.4' - 'user-1' 'items': 'type': 'string' 'minItems': 1 'type': 'array' 'name': 'description': > The name of the client, if any. If there are none, this field is absent. 'example': 'User 1' 'type': 'string' 'num': 'description': > Total number of requests for this client. 'example': 1000 'format': 'int64' 'type': 'integer' 'num_blocked': 'description': > Total number of blocked requests for this client. 'example': 1000 'format': 'int64' 'type': 'integer' 'uid': '$ref': '#/components/schemas/Uid' 'whois': '$ref': '#/components/schemas/Whois' 'required': - 'blocked' - 'ids' - 'num' - 'num_blocked' 'type': 'object' 'CustomRules': 'description': > Custom filtering rules. 'example': 'rules': - '||example.com' - '# Some comment' 'properties': 'rules': 'description': > All custom filtering rules 'items': 'type': 'string' 'type': 'array' 'required': - 'rules' 'type': 'object' 'DhcpLease': 'allOf': - '$ref': '#/components/schemas/DhcpLeasePost' - 'description': > A dynamic or static DHCP lease. If the `uid` field is present, this is a static lease. Otherwise, this is a dynamic lease. 'example': 'expires': 1614345496000 'hostname': 'my-mobile' 'ip': '192.168.1.2' 'mac': '01:23:45:67:89:ab' 'uid': 'abcd1234' 'properties': 'uid': '$ref': '#/components/schemas/Uid' 'DhcpLeasePatch': 'description': > A static DHCP lease update object. 'example': 'expires': 1614345496000 'properties': 'expires': 'description': > The Unix time of the lease's expiry time, in milliseconds. 'format': 'double' 'type': 'number' 'hostname': 'description': > Client's hostname. 'type': 'string' 'ip': 'description': > IP address leased to the client. 'type': 'string' 'mac': 'description': > Hardware address of the lease client. 'type': 'string' 'type': 'object' 'DhcpLeasePost': 'allOf': - '$ref': '#/components/schemas/DhcpLeasePatch' - 'description': > A static DHCP lease create object. 'example': 'expires': 1614345496000 'hostname': 'my-mobile' 'ip': '192.168.1.2' 'mac': '01:23:45:67:89:ab' 'required': - 'expires' - 'hostname' - 'ip' - 'mac' 'DhcpSettings': 'allOf': - '$ref': '#/components/schemas/DhcpSettingsPatch' - 'description': > DHCP server settings. 'example': 'enabled': true 'interface_name': 'wlan0' 'ipv4_gateway_ip': '192.168.1.1' 'ipv4_lease_duration': 86400000 'ipv4_range_end': '192.168.1.101' 'ipv4_range_start': '192.168.1.2' 'ipv4_subnet_mask': '255.255.255.0' 'ipv6_range_start': '2001:db8::1' 'ipv6_lease_duration': 86400000 'required': - 'enabled' 'DhcpSettingsPatch': 'description': > DHCP server settings update object. 'example': 'enabled': true 'interface_name': 'wlan0' 'ipv4_gateway_ip': '192.168.1.1' 'ipv4_lease_duration': 86400000 'ipv4_range_end': '192.168.1.101' 'ipv4_range_start': '192.168.1.2' 'ipv4_subnet_mask': '255.255.255.0' 'properties': 'enabled': 'description': > If `true`, the DHCP server is enabled. 'type': 'boolean' 'interface_name': 'description': > The name of network interface to serve on. 'type': 'string' 'ipv4_gateway_ip': 'description': > The IP address of the gateway. 'type': 'string' 'ipv4_lease_duration': 'description': > The duration of the IPv4 lease, in milliseconds. 'type': 'number' 'ipv4_range_end': 'description': > The end of the IPv4 addresses to serve to clients. 'type': 'string' 'ipv4_range_start': 'description': > The start of the IPv4 addresses to serve to clients. 'type': 'string' 'ipv4_subnet_mask': 'description': > The IP subnet mask. 'type': 'string' 'ipv6_lease_duration': 'description': > The duration of the IPv6 lease, in milliseconds. 'type': 'number' 'ipv6_range_start': 'description': > The start of the IPv6 addresses to serve to clients. 'type': 'string' 'type': 'object' 'DnsAccessSettings': 'description': > DNS server access settings. 'example': 'allowed_clients': [] 'blocked_clients': - '1.2.3.4' - '5.6.7.8/16' 'blocked_domain_rules': - 'id.server' - '*.example.org' - '||example.com^' 'properties': 'allowed_clients': 'description': > CIDR or IP addresses of clients in the allowlist. If non-empty, AdGuard Home will accept requests from these IP addresses only. 'items': 'type': 'string' 'type': 'array' 'blocked_clients': 'description': > CIDR or IP addresses of clients in the blocklist. If non-empty, AdGuard Home will drop requests from these IP addresses. 'items': 'type': 'string' 'type': 'array' 'blocked_domain_rules': 'description': > AdGuard Home will drop DNS queries, if the domains in their queries match these rules. Here you can specify the exact domain names, wildcards, and `urlfilter` rules. Examples: * `example.org` * `*.example.org` * `||example.org^` 'items': 'type': 'string' 'type': 'array' 'required': - 'allowed_clients' - 'blocked_clients' - 'blocked_domain_rules' 'type': 'object' 'DnsBlockingMode': 'description': | DNS blocking mode. * `custom_ip`: Respond with a custom IP address. If this mode is selected, both `blocking_ipv4` and `blocking_ipv6` parameters must be set. * `default`: Same as `null_ip` for Adblock-style rules, but respond with the IP address specified in the rule when blocked by an `/etc/hosts`-style rule. * `null_ip`: Respond with a zero IP address: `0.0.0.0` for `A` requests and `::` for `AAAA` ones. * `nxdomain`: Respond with the `NXDOMAIN` code. * `refused`: Respond with the `REFUSET` code. 'enum': - 'custom_ip' - 'default' - 'null_ip' - 'nxdomain' - 'refused' 'type': 'string' 'DnsClass': 'description': > DNS resource record class, aka `CLASS`. 'enum': - 'any' - 'ch' - 'cs' - 'hs' - 'in' 'type': 'string' 'DnsProto': 'description': > DNS protocol. 'enum': - 'dot' - 'doh' - 'doq' - 'dnscrypt' - 'udp' 'type': 'string' 'DnsResponseCode': 'description': > DNS response code, aka `RCODE`. 'enum': - 'badalg' - 'badcookie' - 'badkey' - 'badmode' - 'badname' - 'badsig' - 'badtime' - 'badtrunc' - 'badvers' - 'formerr' - 'noerror' - 'notauth' - 'notimp' - 'notzone' - 'nxdomain' - 'nxrrset' - 'refused' - 'servfail' - 'yxdomain' - 'yxrrset' 'type': 'string' 'DnsRewrite': 'allOf': - '$ref': '#/components/schemas/DnsRewritePost' - 'description': > A classic DNS rewrite. 'example': 'answer': 'A' 'domain': 'example.com' 'id': 'abcd1234' 'properties': 'id': '$ref': '#/components/schemas/Uid' 'required': - 'answer' - 'domain' - 'id' 'type': 'object' 'DnsRewritePost': 'description': > A classic DNS rewrite create object. 'example': 'answer': 'A' 'domain': 'example.com' 'properties': 'answer': 'description': > The value of an `A`, `AAAA`, or `CNAME` DNS record in the response. Acceptable formats: * Domain name: add a `CNAME` record with this domain name. * IPv4 address: use this IP in an `A` response. * IPv6 address: use this IP in an `AAAA` response. * The literal `A`: keep only `A` records from the upstream response. * The literal `AAAA`: keep only `AAAA` records from the upstream response. 'type': 'string' 'domain': 'description': > Domain name or wildcard. 'type': 'string' 'required': - 'answer' - 'domain' 'type': 'object' 'DnsSettings': 'allOf': - '$ref': '#/components/schemas/DnsSettingsPatch' - 'description': > DNS server settings. 'example': 'addresses': - '127.0.0.1:53' - '192.168.1.1:53' 'blocking_mode': 'default' 'bootstrap_servers': - '9.9.9.10' - '149.112.112.10' 'cache_size': 4194304 'cache_ttl_max': 0 'cache_ttl_min': 0 'dnssec': false 'edns_client_subnet': false 'ipv6': true 'rate_limit': 20 'upstream_mode': 'load_balancing' 'upstream_servers': - '1.1.1.1' - '8.8.8.8' 'upstream_timeout': 1000 'required': - 'addresses' - 'blocking_mode' - 'bootstrap_servers' - 'cache_size' - 'cache_ttl_max' - 'cache_ttl_min' - 'dnssec' - 'edns_client_subnet' - 'ipv6' - 'rate_limit' - 'upstream_mode' - 'upstream_servers' - 'upstream_timeout' 'DnsSettingsPatch': 'description': > DNS server settings update object. 'example': 'cache_size': 4194304 'upstream_servers': - '1.1.1.1' 'properties': 'addresses': 'description': > Addresses on which to serve plain DNS, in ip:port format. Empty array disables plain DNS. 'items': 'type': 'string' 'type': 'array' 'blocking_ipv4': 'description': > IPv4 address to respond with when `blocking_mode` is `custom_ip`. See the documentation for the `DnsBlockingMode` schema. If `blocking_mode` is different from `custom_ip`, this property is not included. 'type': 'string' 'blocking_ipv6': 'description': > IPv6 address to respond with when `blocking_mode` is `custom_ip`. See the documentation for the `DnsBlockingMode` schema. If `blocking_mode` is different from `custom_ip`, this property is not included. 'type': 'string' 'blocking_mode': '$ref': '#/components/schemas/DnsBlockingMode' 'bootstrap_servers': 'description': | Bootstrap DNS servers' IP addresses to resolve the hostnames of the encrypted DNS server providers. 'items': 'type': 'string' 'type': 'array' 'cache_size': 'description': > DNS cache size in bytes. 'format': 'int64' 'minimum': 0 'type': 'integer' 'cache_ttl_max': 'description': > Set a maximum time-to-live value for entries in the DNS cache. `0` means no override. The value is in **seconds**, like in DNS record headers. 'format': 'int64' 'minimum': 0 'type': 'integer' 'cache_ttl_min': 'description': > Extend short time-to-live values received from the upstream server when caching DNS responses. `0` means no override. TThe value is in **seconds**, like in DNS record headers. 'format': 'int64' 'minimum': 0 'type': 'integer' 'dnssec': 'description': > If `true`, set DNSSEC flag in outcoming DNS queries and check the result. A DNSSEC-enabled resolver is required. 'type': 'boolean' 'edns_client_subnet': 'description': > If `true`, enable EDNS Client Subnet support and send clients' subnets to DNS servers. 'type': 'boolean' 'ipv6': 'description': > If `true`, accept `AAAA` DNS queries. If `false`, respond to them with an empty answer. 'type': 'boolean' 'rate_limit': 'description': > The number of requests per second that a single client is allowed to make. `0` means no limit. 'format': 'int64' 'minimum': 0 'type': 'integer' 'upstream_mode': '$ref': '#/components/schemas/DnsUpstreamMode' 'upstream_servers': 'description': > Upstream DNS servers. 'items': '$ref': '#/components/schemas/UpstreamServerAddr' 'type': 'array' 'upstream_timeout': 'description': > Upstream request timeout, in milliseconds. 'format': 'double' 'type': 'number' 'type': 'object' 'DnsType': 'description': > DNS resource record type, aka `TYPE`. 'enum': - 'a' - 'aaaa' - 'afsdb' - 'any' - 'apl' - 'atma' - 'avc' - 'axfr' - 'caa' - 'cdnskey' - 'cds' - 'cert' - 'cname' - 'csync' - 'dhcid' - 'dlv' - 'dname' - 'dnskey' - 'ds' - 'eid' - 'eui48' - 'eui64' - 'gid' - 'gpos' - 'hinfo' - 'hip' - 'https' - 'isdn' - 'ixfr' - 'key' - 'kx' - 'l32' - 'l64' - 'loc' - 'lp' - 'maila' - 'mailb' - 'mb' - 'md' - 'mf' - 'mg' - 'minfo' - 'mr' - 'mx' - 'naptr' - 'nid' - 'nimloc' - 'ninfo' - 'ns' - 'nsap-ptr' - 'nsec' - 'nsec3' - 'nsec3param' - 'null' - 'nxt' - 'openpgpkey' - 'opt' - 'ptr' - 'px' - 'rkey' - 'rp' - 'rrsig' - 'rt' - 'sig' - 'smimea' - 'soa' - 'spf' - 'srv' - 'sshfp' - 'svcb' - 'ta' - 'talink' - 'tkey' - 'tlsa' - 'tsig' - 'txt' - 'uid' - 'uinfo' - 'unspec' - 'uri' - 'x25' 'type': 'string' 'DnsUpstreamMode': 'description': | Upstream request mode. * `fastest`: Query all DNS servers and return the IP address that was returned by the fastest response. Slows down DNS responses, since it waits for responses from all upstreams, but improves the overall connectivity. * `load_balancing`: Query one server at a time using a weighted random algorithm picking the server so that the fastest server is used more often. * `parallel`: Use parallel requests to speed up resolving by simultaneously querying all upstream servers. 'enum': - 'fastest' - 'load_balancing' - 'parallel' 'type': 'string' 'ErrorCode': 'description': | An error code. * `AUT000`: No or bad authorization credentials provided. * `ENT404`: Entity not found; as opposed to path not found. * `JSN000`: A JSON syntax error. * `JSN001`: A JSON type error. * `OSS000`: The server's operating system doesn't support the requested functionality. * `PTH404`: Path not found; as opposed to entity not found. * `RNT000`: A server runtime error. * `TXT400`: A plaintext bad request error. Used when a plaintext error is wrapped. * `TXT401`: A plaintext unauthorized error. Used when a plaintext error is wrapped. * `TXT404`: A plaintext not found error. Used when a plaintext error is wrapped. * `TXT500`: A plaintext internal server error. Used when a plaintext error is wrapped. TODO(a.garipov): Expand with TLS validation errors, DHCP errors, filter URL reaching errors, OS and I/O errors, and so on. 'enum': - 'AUT000' - 'ENT404' - 'JSN000' - 'JSN001' - 'OSS000' - 'PTH404' - 'RNT000' - 'TXT400' - 'TXT401' - 'TXT404' - 'TXT500' 'type': 'string' 'Filter': 'allOf': - '$ref': '#/components/schemas/FilterPatch' - 'description': > A single filter list of rules. 'example': 'allowlist': false 'enabled': true 'name': 'AdMaster 5000 Super List v2.0 Final' 'num_rules': 36766 'refreshed': 1614345496000 'uid': 'abcd1234' 'url': 'path_to_url 'properties': 'num_rules': 'description': > Number of rules in this filter. 'format': 'int64' 'minimum': 0 'type': 'integer' 'refreshed': 'description': > Unix time of last refresh for this filter, in milliseconds. 'format': 'double' 'type': 'number' 'uid': '$ref': '#/components/schemas/Uid' 'required': - 'allowlist' - 'enabled' - 'name' - 'num_rules' - 'refreshed' - 'uid' - 'url' 'FilterPatch': 'description': > A filter update object. 'example': 'enabled': true 'properties': 'allowlist': 'description': > If `true`, this filter works as an allowlist filters. 'type': 'boolean' 'enabled': 'description': > If `true`, this filter is applied. 'type': 'boolean' 'name': 'description': > The name of this filter. 'type': 'string' 'url': 'description': | A URL of the file containing filtering rules. Examples of allowed schemes: * `file:///home/user/ads/rules.txt`: A local file. * `path_to_url`: Remote list, fetched over plain HTTP. * `path_to_url`: Remote list, fetched over HTTPS. 'type': 'string' 'type': 'object' 'FilterPost': 'allOf': - '$ref': '#/components/schemas/FilterPatch' - 'description': > A filter create object. 'example': 'allowlist': false 'enabled': true 'name': 'AdMaster 5000 Super List v2.0 Final' 'url': 'path_to_url 'required': - 'allowlist' - 'enabled' - 'name' - 'url' 'FilteringReason': 'description': > Request filtering status. 'enum': - 'filtered_blocked_service' - 'filtered_blocklist' - 'filtered_invalid' - 'filtered_parental' - 'filtered_safe_browsing' - 'filtered_safe_search' - 'not_filtered_allowlist' - 'not_filtered_error' - 'not_filtered_notfound' - 'rewrite' - 'rewrite_etc_hosts' - 'rewrite_rule' 'type': 'string' 'FilteringResultRule': 'description': > Applied filtering rule. 'properties': 'filter_list_uid': '$ref': '#/components/schemas/Uid' 'text': 'description': > The text of the filtering rule applied to the request, if any. 'type': 'string' 'required': - 'filter_list_uid' - 'text' 'type': 'object' 'GetV1AccountsProfileResp': '$ref': '#/components/schemas/Profile' # TODO(a.garipov): Find a way to describe such XML documents using OpenAPI. # If that is even possible. 'GetV1AppleDohMobileconfigResp': 'example': | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>PayloadContent</key> <array> <dict> <key>DNSSettings</key> <dict> <key>DNSProtocol</key> <string>HTTPS</string> <key>ServerName</key> <string>example.com</string> <key>ServerURL</key> <string>path_to_url </dict> <key>Name</key> <string>myexample.local DoH</string> <key>PayloadDescription</key> <string>Configures device to use AdGuard Home</string> <key>PayloadDisplayName</key> <string>myexample.local DoH</string> <key>PayloadIdentifier</key> <string>com.apple.dnsSettings.managed.b6928468-ae3a-4368-a70d-cb7122275013</string> <key>PayloadType</key> <string>com.apple.dnsSettings.managed</string> <key>PayloadUUID</key> <string>18526b8c-6065-4b96-b635-9cde769ac0f2</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </array> <key>PayloadDescription</key> <string>Adds AdGuard Home to Big Sur and iOS 14 or newer systems</string> <key>PayloadDisplayName</key> <string>myexample.local DoH</string> <key>PayloadIdentifier</key> <string>9a37b659-7541-4f9e-8b4d-6e2a59a123c8</string> <key>PayloadRemovalDisallowed</key> <false/> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string>255dbaf7-0c52-4855-9b22-ad8209690197</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </plist> 'type': 'object' # TODO(a.garipov): See the comment on GetV1AppleDohMobileconfigResp. 'GetV1AppleDotMobileconfigResp': 'example': | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url"> <plist version="1.0"> <dict> <key>PayloadContent</key> <array> <dict> <key>DNSSettings</key> <dict> <key>DNSProtocol</key> <string>TLS</string> <key>ServerName</key> <string>123.example.com</string> </dict> <key>Name</key> <string>example.com DoT</string> <key>PayloadDescription</key> <string>Configures device to use AdGuard Home</string> <key>PayloadDisplayName</key> <string>example.com DoT</string> <key>PayloadIdentifier</key> <string>com.apple.dnsSettings.managed.7807cb66-c6ec-4c78-be29-d8ffcb3321ee</string> <key>PayloadType</key> <string>com.apple.dnsSettings.managed</string> <key>PayloadUUID</key> <string>b0fb9137-e27a-4f95-abc3-556103ad9ac1</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </array> <key>PayloadDescription</key> <string>Adds AdGuard Home to Big Sur and iOS 14 or newer systems</string> <key>PayloadDisplayName</key> <string>myexample.local DoT</string> <key>PayloadIdentifier</key> <string>f1095036-406e-4243-8210-cf0ffa52b3f6</string> <key>PayloadRemovalDisallowed</key> <false/> <key>PayloadType</key> <string>Configuration</string> <key>PayloadUUID</key> <string>21cd3597-0769-486a-86d0-7b5e32d24305</string> <key>PayloadVersion</key> <integer>1</integer> </dict> </plist> 'type': 'object' 'GetV1ClientsPersistentResp': 'description': > Persistent clients. 'example': 'clients': - 'blocked': false 'blocked_services': [] 'filtering': false 'ids': ['client-1'] 'name': 'Client 1' 'parental': false 'safe_browsing': false 'safe_search': false 'tags': ['user_admin'] 'use_global_blocked_services': true 'use_global_settings': true 'uid': 'abcd1234' 'upstream_servers': [] - 'blocked': false 'blocked_services': [] 'filtering': true 'ids': ['client-2'] 'name': 'Client 2' 'parental': true 'safe_browsing': true 'safe_search': true 'tags': ['user_child'] 'use_global_blocked_services': false 'use_global_settings': false 'uid': 'efgh5678' 'upstream_servers': [] 'properties': 'clients': 'description': > All persistent clients. 'items': '$ref': '#/components/schemas/PersistentClient' 'type': 'array' 'required': - 'clients' 'type': 'object' 'GetV1ClientsRuntimeResp': 'description': > Runtime clients. 'example': 'clients': - 'host': 'my-box' 'ip': '1.2.3.4' 'num_blocked_requests': 0 'num_requests': 100 'sources': - 'arp' - 'ip': '5.6.7.8' 'num_blocked_requests': 100 'num_requests': 100 'sources': - 'whois' 'whois': 'city': 'Minsk' 'country': 'BY' 'properties': 'clients': 'description': > All runtime clients. 'items': '$ref': '#/components/schemas/RuntimeClient' 'type': 'array' 'required': - 'clients' 'type': 'object' 'GetV1DhcpLeasesResp': 'description': > All dynamic and static DHCP leases. 'example': 'leases': - 'expires': 1614345496000 'hostname': 'my-mobile' 'ip': '192.168.1.2' 'mac': '01:23:45:67:89:ab' 'uid': 'abcd1234' - 'expires': 1614345497000 'hostname': '' 'ip': '192.168.1.3' 'mac': '01:23:45:67:89:cd' 'properties': 'leases': 'description': > Dynamic and static DHCP leases. 'items': '$ref': '#/components/schemas/DhcpLease' 'type': 'array' 'required': - 'leases' 'type': 'object' 'GetV1DhcpStatusResp': 'description': > Current DHCP server status and data for enabling it. 'example': 'interfaces': - 'ips': - '192.168.1.1' 'mac': '01:23:45:67:89:ab' 'mtu': 1500 'name': 'lan0' 'up': true 'ipv4_other_servers': 'ips': - '192.169.1.1' 'ipv4_static_ip': 'ip': '192.168.1.1' 'static': true 'supported': true 'ipv6_other_servers': 'ips': [] 'error': 'permission denied' 'ipv6_static_ip': 'ip': '200f::1' 'static': true 'supported': true 'properties': 'interfaces': 'description': > Available network interfaces. 'items': '$ref': '#/components/schemas/NetworkInterface' 'type': 'array' 'ipv4_other_servers': '$ref': '#/components/schemas/GetV1DhcpStatusRespOtherServer' 'ipv4_static_ip': '$ref': '#/components/schemas/StaticIpCheckResult' 'ipv6_other_servers': '$ref': '#/components/schemas/GetV1DhcpStatusRespOtherServer' 'ipv6_static_ip': '$ref': '#/components/schemas/StaticIpCheckResult' 'required': - 'interfaces' - 'ipv4_other_servers' - 'ipv4_static_ip' - 'ipv6_other_servers' - 'ipv6_static_ip' 'type': 'object' 'GetV1DhcpStatusRespOtherServer': 'properties': 'error': 'description': > Error, if any. If there is no error, this field is absent. 'type': 'string' 'ips': 'description': > IP addresses of other DHCP servers, if found. 'required': - 'ips' 'type': 'object' 'GetV1InstallInfoResp': 'description': > AdGuard Home addresses configuration. 'example': 'dns_port': 53 'interfaces': - 'ips': - '192.168.1.1' 'mac': '01:23:45:67:89:ab' 'mtu': 1500 'name': 'lan0' 'up': true 'web_port': 80 'properties': 'dns_port': 'description': > Recommended DNS port. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'interfaces': 'description': > Available network interfaces. 'items': '$ref': '#/components/schemas/NetworkInterface' 'type': 'array' 'web_port': 'description': > Recommended web interface port. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'required': - 'dns_port' - 'interfaces' - 'web_port' 'type': 'object' 'GetV1LogSearchResp': 'description': > Query log search results. 'example': 'results': - 'answer': - 'ttl': 60 'type': 'a' 'value': '5.6.7.8' 'answer_dnssec': false 'client': 'blocked': false 'ids': - '1.2.3.4' - 'user-1' 'name': 'User 1' 'num': 100 'num_blocked': 50 'uid': 'abcd1234' 'whois': 'city': 'Minsk' 'country': 'BY' 'elapsed': 3.2 'proto': 'udp' 'question': 'class': 'in' 'host': 'example.com' 'type': 'a' 'rcode': 'noerror' 'reason': 'not_filtered_notfound' 'rules': [] 'start': 1614345496000 'upstream': '8.8.8.8' 'properties': 'results': 'description': > The query log. 'items': '$ref': '#/components/schemas/LogRecord' 'type': 'array' 'required': - 'results' 'type': 'object' 'GetV1ProtectionBlockedServicesResp': '$ref': '#/components/schemas/BlockedServices' 'GetV1ProtectionCustomRulesResp': '$ref': '#/components/schemas/CustomRules' 'GetV1ProtectionDnsRewritesResp': 'description': > Classic DNS rewrites. 'example': 'rules': - 'answer': 'A' 'domain': 'example.com' 'id': 'abcd1234' - 'answer': '0.0.0.0' 'domain': '*.example.org' 'id': 'efgh5678' - 'answer': 'my.example.net' 'domain': 'example.net' 'id': 'ijkl9012' 'properties': 'rules': 'description': > All classic DNS rewrites. 'items': '$ref': '#/components/schemas/DnsRewrite' 'type': 'array' 'required': - 'rules' 'type': 'object' 'GetV1ProtectionFiltersResp': 'description': > Filters. 'example': 'filters': - 'allowlist': false 'enabled': true 'name': 'AdMaster 5000 Super List v2.0 Final' 'num_rules': 36766 'refreshed': 1614345496000 'uid': 'abcd1234' 'url': 'path_to_url - 'allowlist': false 'enabled': true 'name': 'My personal list' 'num_rules': 0 'refreshed': 1614345497000 'uid': 'efgh5678' 'url': 'file:///home/user/Documents/ad_list.txt' 'properties': 'filters': 'description': > All current filters. 'items': '$ref': '#/components/schemas/Filter' 'type': 'array' 'required': - 'filters' 'type': 'object' # Perhaps a lot of these belong in separate APIs, but our colleagues asked # to pack as much data into every request as reasonably possible. 'GetV1SettingsAllResp': 'description': > Most settings. # Don't add examples, as are provided by the subclasses. 'properties': 'dhcp': '$ref': '#/components/schemas/DhcpSettings' 'dns': '$ref': '#/components/schemas/DnsSettings' 'http': '$ref': '#/components/schemas/HttpSettings' 'log': '$ref': '#/components/schemas/LogSettings' 'protection': '$ref': '#/components/schemas/ProtectionSettings' 'stats': '$ref': '#/components/schemas/StatsSettings' 'tls': '$ref': '#/components/schemas/TlsSettings' 'required': - 'dhcp' - 'dns' - 'http' - 'log' - 'protection' - 'stats' - 'tls' 'type': 'object' 'GetV1SettingsDnsAccessResp': '$ref': '#/components/schemas/DnsAccessSettings' # See the comment on the GetV1SettingsAllResp schema. 'GetV1StatsAllResp': 'description': > All statistics. 'example': 'dns_cache_hit_rate': 56.7 'dns_cache_records': 123 'graph_avg_processing': - 3.0 - 0.4 'graph_blocked_ad_queries': - 10 - 20 'graph_blocked_custom_rule_queries': - 10 - 20 'graph_blocked_domains': - 10 - 20 'graph_blocked_parental_control_queries': - 10 - 20 'graph_blocked_safe_browsing_queries': - 10 - 20 'graph_blocked_safe_search_queries': - 10 - 20 'graph_blocked_service_queries': - 10 - 20 'graph_blocked_tracker_queries': - 10 - 20 'graph_cpu_percent': - 50 - 75 'graph_domains': - 20 - 30 'graph_queries': - 1000 - 2002 'graph_ram_resident': - 1048576 - 2097152 'time_unit': 'hour' 'top_blocked_domains': - 'name': 'example.net' 'num': 100 'top_clients': - 'blocked': false 'ids': - '1.2.3.4' - 'user-1' 'name': 'User 1' 'num': 100 'num_blocked': 50 'uid': 'abcd1234' 'whois': 'city': 'Minsk' 'country': 'BY' - 'blocked': true 'ids': - '5.6.7.8' 'num': 100 'num_blocked': 100 'top_domains': - 'name': 'example.com' 'num': 1000 - 'name': 'example.net' 'num': 100 'total_blocked_ad_queries': 100 'total_blocked_custom_rule_queries': 10 'total_blocked_domains': 500 'total_blocked_parental_control_queries': 10 'total_blocked_safe_browsing_queries': 10 'total_blocked_safe_search_queries': 10 'total_blocked_service_queries': 10 'total_blocked_tracker_queries': 10 'total_domains': 1000 'total_queries': 10000 'properties': 'dns_cache_hit_rate': 'description': > DNS cache hit rate, in percent. 'maximum': 100.0 'minimum': 0.0 'format': 'double' 'type': 'number' 'dns_cache_records': 'description': > Number of DNS responses currently in cache. 'minimum': 0 'format': 'int64' 'type': 'integer' 'graph_avg_processing': 'description': > Average DNS query processing duration graph information. Each item is one `time_unit` long. The duration is in milliseconds. Sorted by time in descending order. 'items': 'format': 'double' 'type': 'number' 'type': 'array' 'graph_blocked_ad_queries': 'description': > Number of queries blocked by advertising filters graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_blocked_custom_rule_queries': 'description': > Number of queries blocked by custom filtering rules graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_blocked_domains': 'description': > Blocked queried domains graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_blocked_parental_control_queries': 'description': > Number of queries blocked by parental control services graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_blocked_safe_browsing_queries': 'description': > Number of queries blocked by safe browsing services graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_blocked_safe_search_queries': 'description': > Number of queries blocked by safe search services graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_blocked_service_queries': 'description': > Number of queries blocked by blocked service settings graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_blocked_tracker_queries': 'description': > Number of queries blocked by tracker filters graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_cpu_percent': 'description': > CPU usage percentage graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'double' 'type': 'number' 'type': 'array' 'graph_domains': 'description': > Queried domains graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_queries': 'description': > Number of served DNS queries graph information. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'graph_ram_resident': 'description': > AdGuard Home's resident memory usage graph information. The size is in bytes. Each item is one `time_unit` long. Sorted by time in descending order. 'items': 'format': 'int64' 'type': 'integer' 'type': 'array' 'time_unit': '$ref': '#/components/schemas/TimeUnit' 'top_blocked_domains': 'description': > Top blocked queried domains. Sorted by number in descending order. 'items': '$ref': '#/components/schemas/GetV1StatsAllRespTopsItem' 'type': 'array' 'top_clients': 'description': > Top clients. Sorted by number in descending order. 'items': '$ref': '#/components/schemas/ClientInfo' 'type': 'array' 'top_domains': 'description': > Top queried domains. Sorted by number in descending order. 'items': '$ref': '#/components/schemas/GetV1StatsAllRespTopsItem' 'type': 'array' 'total_blocked_ad_queries': 'description': > Total number of queries blocked by advertising filters. 'format': 'int64' 'type': 'integer' 'total_blocked_custom_rule_queries': 'description': > Total number of queries blocked by custom filtering rules. 'format': 'int64' 'type': 'integer' 'total_blocked_domains': 'description': > Total number of blocked queried domains. 'format': 'int64' 'type': 'integer' 'total_blocked_parental_control_queries': 'description': > Total number of queries blocked by parental control services. 'format': 'int64' 'type': 'integer' 'total_blocked_safe_browsing_queries': 'description': > Total number of queries blocked by safe browsing services. 'format': 'int64' 'type': 'integer' 'total_blocked_safe_search_queries': 'description': > Total number of queries blocked by safe search services. 'format': 'int64' 'type': 'integer' 'total_blocked_service_queries': 'description': > Total number of queries blocked by blocked service settings. 'format': 'int64' 'type': 'integer' 'total_blocked_tracker_queries': 'description': > Total number of queries blocked by tracker filters. 'format': 'int64' 'type': 'integer' 'total_domains': 'description': > Total number of queried domains. 'format': 'int64' 'type': 'integer' 'total_queries': 'description': > Total number of served DNS queries. 'format': 'int64' 'type': 'integer' 'required': - 'dns_cache_hit_rate' - 'dns_cache_records' - 'graph_avg_processing' - 'graph_blocked_ad_queries' - 'graph_blocked_custom_rule_queries' - 'graph_blocked_domains' - 'graph_blocked_parental_control_queries' - 'graph_blocked_safe_browsing_queries' - 'graph_blocked_safe_search_queries' - 'graph_blocked_service_queries' - 'graph_blocked_tracker_queries' - 'graph_cpu_percent' - 'graph_domains' - 'graph_queries' - 'graph_ram_resident' - 'time_unit' - 'top_blocked_domains' - 'top_clients' - 'top_domains' - 'total_blocked_ad_queries' - 'total_blocked_custom_rule_queries' - 'total_blocked_domains' - 'total_blocked_parental_control_queries' - 'total_blocked_safe_browsing_queries' - 'total_blocked_safe_search_queries' - 'total_blocked_service_queries' - 'total_blocked_tracker_queries' - 'total_domains' - 'total_queries' 'type': 'object' 'GetV1StatsAllRespTopsItem': 'description': > A top array item. 'properties': 'name': 'description': > The name of the entity. Mostly domain names. 'example': 'example.com' 'type': 'string' 'num': 'description': > The value of the statistic. 'example': 1000 'format': 'int64' 'type': 'integer' 'required': - 'name' - 'num' 'type': 'object' 'GetV1SystemInfoResp': 'description': > Information about the AdGuard Home server. 'example': 'arch': 'amd64' 'channel': 'release' 'new_version': 'v0.108.1' 'os': 'linux' 'start': 1614345496000 'version': 'v0.108.0' 'properties': 'arch': 'description': > CPU architecture. 'type': 'string' 'channel': '$ref': '#/components/schemas/Channel' 'new_version': 'description': > New available version of AdGuard Home to which the server can be updated, if any. If there are none, this field is absent. 'type': 'string' 'os': 'description': > Operating system type. 'type': 'string' 'start': 'description': > Unix time at which AdGuard Home started working, in milliseconds. 'format': 'double' 'type': 'number' 'version': 'description': > Current AdGuard Home version. 'type': 'string' 'required': - 'arch' - 'channel' - 'os' - 'start' - 'version' 'type': 'object' 'HttpSettings': 'allOf': - '$ref': '#/components/schemas/HttpSettingsPatch' - 'description': > HTTP interface server settings. **TODO(a.garipov): Finish, split from TLS settings.** 'example': 'addresses': - '127.0.0.1:80' - '192.168.1.1:80' 'force_https': true 'secure_addresses': - '127.0.0.1:443' - '192.168.1.1:443' 'timeout': 10000 'required': - 'addresses' - 'force_https' - 'secure_addresses' - 'timeout' 'HttpSettingsPatch': 'description': > HTTP server settings update object. 'example': 'force_https': false 'properties': 'addresses': 'description': > Addresses on which to serve the plain-HTTP web interface and API, in ip:port format. Empty array disables the web interface over plain HTTP. 'items': 'type': 'string' 'type': 'array' 'force_https': 'description': > If `true`, enabled the HTTP-to-HTTPS redirect. 'type': 'boolean' 'secure_addresses': 'description': > Addresses on which to serve the HTTPS web interface and API, in ip:port format. Empty array disables the web interface over HTTPS. 'items': 'type': 'string' 'type': 'array' 'timeout': 'description': > HTTP request timeout, in milliseconds. 'format': 'double' 'type': 'number' 'type': 'object' 'InternalServerErrorResp': 'example': 'code': 'RNT000' 'msg': >- runtime error: invalid memory address or nil pointer dereference 'properties': 'code': '$ref': '#/components/schemas/ErrorCode' 'msg': 'description': > Error message string. 'type': 'string' 'required': - 'code' - 'msg' 'type': 'object' 'Lang': 'description': > Language code. # Hold the enum in sync with .twosky.json. 'enum': - 'be' - 'bg' - 'cs' - 'da' - 'de' - 'en' - 'es' - 'fa' - 'fr' - 'hr' - 'hu' - 'id' - 'it' - 'ja' - 'ko' - 'nl' - 'no' - 'pl' - 'pt-br' - 'pt-pt' - 'ro' - 'ru' - 'si-lk' - 'sk' - 'sl' - 'sr-cs' - 'sv' - 'th' - 'tr' - 'vi' - 'zh-cn' - 'zh-hk' - 'zh-tw' 'type': 'string' 'LogRecord': 'description': > Query log record. 'properties': 'answer': 'description': > The answer given to the user. 'items': '$ref': '#/components/schemas/LogRecordDnsAnswer' 'type': 'array' 'answer_dnssec': 'description': > If `true`, DNSSEC was used. 'type': 'boolean' 'blocked_service': 'description': > Set if `reason` is `filtered_blocked_service`. Otherwise, this field is absent. 'type': 'string' 'client': '$ref': '#/components/schemas/ClientInfo' 'elapsed': 'description': > Time it took to process the request, in milliseconds. 'format': 'double' 'type': 'number' 'original_answer': 'description': > Original answer from the upstream server, if the answer was rewritten. 'items': '$ref': '#/components/schemas/LogRecordDnsAnswer' 'type': 'array' 'proto': '$ref': '#/components/schemas/DnsProto' 'question': '$ref': '#/components/schemas/LogRecordDnsQuestion' 'rcode': '$ref': '#/components/schemas/DnsResponseCode' 'reason': '$ref': '#/components/schemas/FilteringReason' 'rules': 'description': > Applied rules. 'items': '$ref': '#/components/schemas/FilteringResultRule' 'type': 'array' 'start': 'description': > Request processing start Unix time, in milliseconds. 'format': 'double' 'type': 'number' 'upstream': '$ref': '#/components/schemas/UpstreamServerAddr' 'required': - 'answer' - 'answer_dnssec' - 'client' - 'elapsed' - 'proto' - 'question' - 'rcode' - 'reason' - 'rules' - 'start' - 'upstream' 'type': 'object' 'LogRecordDnsAnswer': 'description': > DNS answer section. 'properties': 'ttl': 'description': > TTL of a record. This value is in **seconds**, like in DNS record headers. 'format': 'int64' 'minimum': 0 'type': 'integer' 'type': '$ref': '#/components/schemas/DnsType' 'value': 'description': > An opaque string describing the result value. 'type': 'string' 'required': - 'ttl' - 'type' - 'value' 'type': 'object' 'LogRecordDnsQuestion': 'description': > DNS question section. 'properties': 'class': '$ref': '#/components/schemas/DnsClass' 'host': 'description': > Host from the query. 'type': 'string' 'type': '$ref': '#/components/schemas/DnsType' 'required': - 'class' - 'host' - 'type' 'type': 'object' 'LogSettings': 'allOf': - '$ref': '#/components/schemas/LogSettingsPatch' - 'description': > Query logging settings. 'example': 'anonymize': true 'enabled': true 'rotation': 604800000 'required': - 'anonymize' - 'enabled' - 'rotation' 'LogSettingsPatch': 'description': > Query logging settings update object. 'properties': 'anonymize': 'description': > If `true`, client IP address anonymization is enabled. 'type': 'boolean' 'enabled': 'description': > If `true`, query logging is enabled. 'type': 'boolean' 'rotation': 'description': > Log rotation interval, in milliseconds. After that time, the log file will be replaced by a new one, while the old one gets renamed. 'format': 'double' 'minimum': 86400000 'maximum': 7776000000 'type': 'number' 'type': 'object' 'NetworkInterface': 'properties': 'ips': 'description': > The IP addresses of the interface, if any. 'items': 'type': 'string' 'type': 'array' 'mac': 'description': > The MAC address of the interface. 'type': 'string' 'mtu': 'description': > The interface's MTU, the maximum transmission unit. 'format': 'int64' 'type': 'integer' 'name': 'description': > The name of the interface. 'type': 'string' 'up': 'description': > If `true`, the interface is up. 'type': 'boolean' 'required': - 'ips' - 'mac' - 'mtu' - 'name' - 'up' 'type': 'object' 'NotFoundResp': 'example': 'code': 'ENT404' 'msg': >- entity not found 'properties': 'code': '$ref': '#/components/schemas/ErrorCode' 'msg': 'description': > Error message string. 'type': 'string' 'required': - 'code' - 'msg' 'type': 'object' 'PatchV1AccountsProfileReq': 'example': 'lang': 'ru' 'properties': 'lang': '$ref': '#/components/schemas/Lang' 'type': 'object' 'PatchV1AccountsProfileResp': '$ref': '#/components/schemas/Profile' 'PatchV1ClientPersistentReq': '$ref': '#/components/schemas/PersistentClientPatch' 'PatchV1ClientPersistentResp': '$ref': '#/components/schemas/PersistentClient' 'PatchV1DhcpLeaseReq': '$ref': '#/components/schemas/DhcpLeasePatch' 'PatchV1DhcpLeaseResp': '$ref': '#/components/schemas/DhcpLease' 'PatchV1ProtectionFilterReq': '$ref': '#/components/schemas/FilterPatch' 'PatchV1ProtectionFilterResp': '$ref': '#/components/schemas/Filter' 'PatchV1SettingsDhcpReq': '$ref': '#/components/schemas/DhcpSettingsPatch' 'PatchV1SettingsDhcpResp': '$ref': '#/components/schemas/DhcpSettings' 'PatchV1SettingsDnsReq': '$ref': '#/components/schemas/DnsSettingsPatch' 'PatchV1SettingsDnsResp': '$ref': '#/components/schemas/DnsSettings' 'PatchV1SettingsHttpReq': '$ref': '#/components/schemas/HttpSettingsPatch' 'PatchV1SettingsHttpResp': '$ref': '#/components/schemas/HttpSettings' 'PatchV1SettingsLogReq': '$ref': '#/components/schemas/LogSettingsPatch' 'PatchV1SettingsLogResp': '$ref': '#/components/schemas/LogSettings' 'PatchV1SettingsProtectionReq': '$ref': '#/components/schemas/ProtectionSettingsPatch' 'PatchV1SettingsProtectionResp': '$ref': '#/components/schemas/ProtectionSettings' 'PatchV1SettingsStatsReq': '$ref': '#/components/schemas/StatsSettingsPatch' 'PatchV1SettingsStatsResp': '$ref': '#/components/schemas/StatsSettings' 'PatchV1SettingsTlsReq': '$ref': '#/components/schemas/TlsSettingsPatch' 'PatchV1SettingsTlsResp': '$ref': '#/components/schemas/TlsSettings' 'PersistentClient': 'allOf': - '$ref': '#/components/schemas/PersistentClientPatch' - 'description': > Persistent client. 'example': 'blocked': false 'blocked_services': [] 'filtering': false 'ids': ['client-1'] 'name': 'Client 1' 'num_blocked_requests': 50 'num_requests': 100 'parental': false 'safe_browsing': false 'safe_search': false 'tags': ['user_admin'] 'use_global_blocked_services': true 'use_global_settings': true 'uid': 'abcd1234' 'upstream_servers': [] 'properties': 'num_blocked_requests': 'description': > Total number of blocked requests for this runtime client. 'format': 'int64' 'minimum': 0 'type': 'integer' 'num_requests': 'description': > Total number of requests for this runtime client. 'format': 'int64' 'minimum': 0 'type': 'integer' 'uid': '$ref': '#/components/schemas/Uid' 'required': - 'blocked' - 'blocked_services' - 'filtering' - 'ids' - 'name' - 'parental' - 'safe_browsing' - 'safe_search' - 'tags' - 'uid' - 'upstream_servers' - 'use_global_blocked_services' - 'use_global_settings' 'PersistentClientPatch': 'description': > Persistent client update object. 'example': 'filtering': false 'parental': false 'safe_browsing': false 'safe_search': false 'tags': ['user_admin'] 'properties': 'blocked': 'description': > If `true`, the client is blocked. 'type': 'boolean' 'blocked_services': 'description': > Custom blocked services for this client. 'items': '$ref': '#/components/schemas/BlockedServiceId' 'type': 'array' 'filtering': 'description': > If `true`, filtering based on filter rule lists is enabled for this client. 'type': 'boolean' 'ids': 'description': > IP, CIDR, MAC, or ClientID (not to be confused with the `uid` field) for client identification. 'items': 'type': 'string' 'type': 'array' 'name': 'description': > The name of this client. 'type': 'string' 'parental': 'description': > If `true`, parental protection is enabled for this client. 'type': 'boolean' 'safe_browsing': 'description': > If `true`, safe browsing protection is enabled for this client. 'type': 'boolean' 'safe_search': 'description': > If `true`, safe search protection is enabled for this client. 'type': 'boolean' 'tags': 'description': > Client tags. 'items': '$ref': '#/components/schemas/PersistentClientTag' 'type': 'array' 'use_global_blocked_services': 'description': > If `true`, use global blocked services for this client instead of the custom ones. 'type': 'boolean' 'use_global_settings': 'description': > If `true`, use global protection settings for this client instead of the custom ones. 'type': 'boolean' 'upstream_servers': 'description': > Custom upstream DNS servers for this client. 'items': '$ref': '#/components/schemas/UpstreamServerAddr' 'type': 'array' 'type': 'object' 'PersistentClientPost': 'allOf': - '$ref': '#/components/schemas/PersistentClientPatch' - 'description': > Persistent client create object. 'example': 'blocked': false 'blocked_services': [] 'filtering': false 'ids': ['client-1'] 'name': 'Client 1' 'parental': false 'safe_browsing': false 'safe_search': false 'tags': ['user_admin'] 'use_global_blocked_services': true 'use_global_settings': true 'upstream_servers': [] 'required': - 'blocked' - 'blocked_services' - 'filtering' - 'ids' - 'name' - 'parental' - 'safe_browsing' - 'safe_search' - 'tags' - 'upstream_servers' - 'use_global_blocked_services' - 'use_global_settings' 'PersistentClientTag': 'description': > Tags can be included in filtering rules to allow you to apply them more accurately. 'enum': - 'device_audio' - 'device_camera' - 'device_gameconsole' - 'device_laptop' - 'device_nas' - 'device_other' - 'device_pc' - 'device_phone' - 'device_printer' - 'device_securityalarm' - 'device_tablet' - 'device_tv' - 'os_android' - 'os_ios' - 'os_linux' - 'os_macos' - 'os_other' - 'os_windows' - 'user_admin' - 'user_child' - 'user_regular' 'type': 'string' 'PostV1AccountsSessionReq': 'example': 'password': 'G00dp455word!' 'username': 'admin' 'properties': 'password': 'description': > Password. 'format': 'password' 'type': 'string' 'username': 'description': > Username. 'type': 'string' 'required': - 'password' - 'username' 'type': 'object' 'PostV1ClientsPersistentReq': '$ref': '#/components/schemas/PersistentClientPost' 'PostV1ClientsPersistentResp': '$ref': '#/components/schemas/PersistentClient' 'PostV1DhcpLeasesReq': '$ref': '#/components/schemas/DhcpLeasePost' 'PostV1DhcpLeasesResp': '$ref': '#/components/schemas/DhcpLease' 'PostV1InstallCheckReq': 'description': > Configuration for checking. 'example': 'dns': 'ip': - '0.0.0.0' 'port': 53 'static_ip': false 'web': 'ip': - '0.0.0.0' 'port': 80 'properties': 'dns': '$ref': '#/components/schemas/PostV1InstallCheckReqServer' 'static_ip': 'description': > If `true`, check if a static IP is set or can be set. 'type': 'boolean' 'web': '$ref': '#/components/schemas/PostV1InstallCheckReqServer' 'required': - 'dns' - 'static_ip' - 'web' 'type': 'object' 'PostV1InstallCheckReqServer': 'description': > A configuration for a server check. 'properties': 'ip': 'description': > IP addresses to check for availability. 'items': 'type': 'string' 'minItems': 1 'type': 'array' 'port': 'description': > Port to check for availability. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'required': - 'ip' - 'port' 'type': 'object' 'PostV1InstallCheckResp': 'description': > Configuration checking response. 'example': 'dns': 'error': 'permission denied' 'static_ip': 'ip': '192.168.1.1' 'static': true 'supported': true 'web': {} 'properties': 'dns': '$ref': '#/components/schemas/PostV1InstallCheckRespNetwork' 'static_ip': '$ref': '#/components/schemas/StaticIpCheckResult' 'web': '$ref': '#/components/schemas/PostV1InstallCheckRespNetwork' 'required': - 'dns' - 'static_ip' - 'web' 'type': 'object' 'PostV1InstallCheckRespNetwork': 'properties': 'error': 'description': > Error, if any. If there is no error, this field is absent. 'type': 'string' 'type': 'object' 'PostV1InstallConfigureReq': 'description': > AdGuard Home initial configuration. 'example': 'dns_ip': '0.0.0.0' 'dns_port': 53 'password': 'G00dp455word!' 'username': 'admin' 'set_static_ip': true 'web_ip': '0.0.0.0' 'web_port': 80 'properties': 'dns_ip': 'description': > The IP address to serve DNS queries on. 'type': 'string' 'dns_port': 'description': > The port to serve DNS queries on. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'password': 'description': > Password. 'type': 'string' 'username': 'description': > Username. 'type': 'string' 'set_static_ip': 'description': > If `true`, set the server's IP address to static. 'type': 'boolean' 'web_ip': 'description': > The IP address to serve the web interface on. 'type': 'string' 'web_port': 'description': > The port to serve the web interface on. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'required': - 'dns_ip' - 'dns_port' - 'password' - 'username' - 'set_static_ip' - 'web_ip' - 'web_port' 'type': 'object' 'PostV1LogClearReq': 'description': > Currently empty, may get more fields in the future. 'type': 'object' 'PostV1ProtectionCheckCustomRulesReq': 'description': > Data to check using custom filtering rules. 'example': 'host': 'example.com' 'properties': 'host': 'description': > The hostname to check. 'type': 'string' 'required': - 'host' 'type': 'object' 'PostV1ProtectionCheckCustomRulesResp': 'description': > Custom filtering rules check results. 'example': 'reason': 'filtered_blocklist' 'rules': - 'filter_list_uid': 'abcd1234' 'text': '||example.com^' 'properties': 'cname': 'description': > Set if `reason` is `Rewrite`. Otherwise, this field is absent. 'type': 'string' 'ip_addrs': 'description': > Set if `reason` is `Rewrite`. Otherwise, this field is absent. 'items': 'type': 'string' 'type': 'array' 'reason': '$ref': '#/components/schemas/FilteringReason' 'rules': 'description': > Applied rules. 'items': '$ref': '#/components/schemas/FilteringResultRule' 'type': 'array' 'service_name': 'description': > Set if `reason` is `FilteredBlockedService`. Otherwise, this field is absent. 'type': 'string' 'required': - 'reason' - 'rules' 'type': 'object' 'PostV1ProtectionDnsRewritesReq': '$ref': '#/components/schemas/DnsRewritePost' 'PostV1ProtectionDnsRewritesResp': '$ref': '#/components/schemas/DnsRewrite' 'PostV1ProtectionFiltersReq': '$ref': '#/components/schemas/FilterPost' 'PostV1ProtectionFiltersResp': '$ref': '#/components/schemas/Filter' 'PostV1ProtectionRefreshFilterReq': 'description': > Currently empty, may get more fields in the future. 'type': 'object' 'PostV1ProtectionRefreshFilterResp': '$ref': '#/components/schemas/Filter' 'PostV1ProtectionRefreshFiltersReq': 'description': > Filters refresh parameters. 'example': 'allowlist': false 'blocklist': true 'properties': 'allowlist': 'description': > If `true`, refresh all allowlist filters. 'type': 'boolean' 'blocklist': 'description': > If `true`, refresh all blocklist filters. 'type': 'boolean' 'required': - 'allowlist' - 'blocklist' 'type': 'object' 'PostV1ProtectionRefreshFiltersResp': 'description': > Refresh results. 'example': 'errors': - 'msg': 'context deadline exceeded' 'uid': 'efgh5678' 'refreshed': - 'allowlist': false 'enabled': true 'name': 'AdMaster 5000 Super List v2.0 Final' 'num_rules': 36766 'refreshed': 1614345496000 'uid': 'abcd1234' 'url': 'path_to_url 'properties': 'errors': 'description': > All encountered errors. 'items': '$ref': '#/components/schemas/RefreshFilterError' 'type': 'array' 'refreshed': 'description': > Refreshed filters. 'items': '$ref': '#/components/schemas/Filter' 'type': 'array' 'required': - 'errors' - 'refreshed' 'type': 'object' 'PostV1SettingsDnsCheckReq': 'description': > Validatable DNS settings. 'example': 'bootstrap_servers': - '9.9.9.10' - '149.112.112.10' 'upstream_servers': - '1.1.1.1' - '8.8.8.8' 'properties': 'bootstrap_servers': 'description': | Bootstrap DNS servers' IP addresses to check. 'items': 'type': 'string' 'type': 'array' 'upstream_servers': 'description': > Upstream DNS servers to check. 'items': '$ref': '#/components/schemas/UpstreamServerAddr' 'type': 'array' 'required': - 'bootstrap_servers' - 'upstream_servers' 'type': 'object' 'PostV1SettingsDnsCheckResp': 'description': > DNS settings validation results. 'example': 'bootstrap_servers': '9.9.9.10': 'network is unreachable' 'upstream_servers': '8.8.8.8': 'network is unreachable' 'properties': 'bootstrap_servers': 'additionalProperties': 'minLength': 1 'type': 'string' 'description': > An IP-address-to-error mapping. If an address is not in this object, the check for that address is successful. If there were no errors, this field is absent. 'upstream_servers': 'additionalProperties': 'type': 'string' 'description': > An upstream-address-to-error mapping. If an address is not in this object, the check for that address is successful. If there were no errors, this field is absent. 'type': 'object' 'PostV1SettingsTlsCheckReq': 'description': > Validatable TLS settings. 'example': 'certificate_path': '/etc/ssl/example.com.cert' 'port_dns_over_quic': 853 'port_dns_over_tls': 853 'port_https': 443 'private_key_path': '/etc/ssl/example.com.key' 'server_name': 'dns.example.com' 'properties': 'certificate': 'description': | Base64-encoded string with PEM-encoded certificate chain. Should not be sent if `certificate_path` is sent. Otherwise, must be sent. 'format': 'byte' 'type': 'string' 'certificate_path': 'description': | Path to the certificate file. Should not be sent if `certificate` is sent. Otherwise, must be sent. 'type': 'string' 'port_dns_over_quic': 'default': 853 'description': > The DNS-over-QUIC port. If `0`, DNS-over-QUIC is disabled. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'port_dns_over_tls': 'default': 853 'description': > The DNS-over-TLS port. If `0`, DNS-over-TLS is disabled. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'port_https': 'default': 443 'description': > The HTTPS port. If `0`, HTTPS is disabled. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'private_key': 'description': | Base64-encoded string with PEM-encoded private key. Should not be sent if `private_key_path` is sent. Otherwise, must be sent. 'format': 'byte' 'type': 'string' 'private_key_path': 'description': | Path to the private key file. Should not be sent if `private_key` is sent. Otherwise, must be sent. 'type': 'string' 'server_name': 'description': > The name of the server. Used to validate the certificates as well as to check ClientIDs in DNS-over-HTTP and DNS-over-TLS. 'type': 'string' 'required': - 'port_dns_over_quic' - 'port_dns_over_tls' - 'port_https' - 'server_name' 'type': 'object' 'PostV1SettingsTlsCheckResp': 'description': > TLS settings validation results. 'example': 'dns_names': - '*.example.com' - 'example.com' 'issuer': 'CN=Example CA,OU=Development,O=Example CA,L=Canberra,ST=Canberra,C=AU' 'key_type': 'RSA' 'not_after': 1614345497000 'not_before': 1614345496000 'port_https_error': 'address already in use' 'subject': 'CN=Example CA,OU=Development,O=Example CA,L=Canberra,ST=Canberra,C=AU' 'warnings': [] 'properties': 'cert_error': 'description': > Certificate validation error, if any. If the certificate is valid, this field is absent. 'type': 'string' 'chain_error': 'description': > Certificate chain validation error, if any. If the certificate chain is valid, this field is absent. 'type': 'string' 'dns_names': 'description': > The value of the `SubjectAltNames` field of the first certificate in the chain. 'items': 'type': 'string' 'type': 'array' 'issuer': 'description': > The issuer of the first certificate in the chain. 'type': 'string' 'key_error': 'description': > Private key pair error, if any. If the key is valid, this field is absent. 'type': 'string' 'key_type': '$ref': '#/components/schemas/TlsKeyType' 'not_after': 'description': > The value of the `NotAfter` field of the first certificate in the chain, as a Unix time, in milliseconds. 'format': 'double' 'type': 'number' 'not_before': 'description': > The value of the `NotBefore` field of the first certificate in the chain, as a Unix time, in milliseconds. 'format': 'double' 'type': 'number' 'port_dns_over_quic_error': 'description': > DNS-over-QUIC port checking error, if any. If the port is available, this field is absent. 'type': 'string' 'port_dns_over_tls_error': 'description': > DNS-over-TLS port checking error, if any. If the port is available, this field is absent. 'type': 'string' 'port_https_error': 'description': > DNS-over-HTTPS port checking error, if any. If the port is available, this field is absent. 'type': 'string' 'pair_error': 'description': > Certificate and key pair error, if any. If the pair is valid, this field is absent. 'type': 'string' 'subject': 'description': > The subject of the first certificate in the chain. 'type': 'string' 'warnings': 'description': > Validation warnings, if any. 'items': 'type': 'string' 'type': 'array' 'required': - 'dns_names' - 'issuer' - 'key_type' - 'not_after' - 'not_before' - 'subject' - 'warnings' 'type': 'object' 'PostV1StatsClearReq': 'description': > Currently empty, may get more fields in the future. 'type': 'object' 'PostV1SystemResetReq': 'description': > Currently empty, may get more fields in the future. 'type': 'object' 'PostV1SystemResetResp': 'description': > Currently empty, may get more fields in the future. 'type': 'object' 'PostV1SystemUpdateReq': 'description': > Currently empty, may get more fields in the future. 'type': 'object' 'PostV1SystemUpdateResp': 'example': 'reload': 10000 'properties': 'reload': 'description': > Time, after which the frontend must reload the page, in milliseconds. 'format': 'double' 'type': 'number' 'type': 'object' 'Profile': 'description': > Current user's profile. 'example': 'lang': 'en' 'username': 'admin' 'properties': 'lang': '$ref': '#/components/schemas/Lang' 'username': 'description': > Current user's name. 'type': 'string' 'required': - 'lang' - 'username' 'type': 'object' 'ProtectionSettings': 'allOf': - '$ref': '#/components/schemas/ProtectionSettingsPatch' - 'description': > Protection settings. 'example': 'autoupdate': 86400000 'filtering': true 'parental': true 'safe_browsing': false 'safe_search': false 'required': - 'autoupdate' - 'filtering' - 'parental' - 'safe_browsing' - 'safe_search' 'ProtectionSettingsPatch': 'description': > Protection settings update object. 'example': 'autoupdate': 0 'properties': 'autoupdate': 'description': > Filter automatic update interval, in milliseconds. Set to `0` to disable automatic updates. 'format': 'double' 'minimum': 0 'maximum': 604800000 'type': 'number' 'filtering': 'description': > If `true`, filtering based on filter rule lists is enabled. 'type': 'boolean' 'parental': 'description': > If `true`, parental protection is enabled. 'type': 'boolean' 'pause_end': 'description': | If `state` is `paused`, `pause_end` will show the Unix time until which the protection is disabled in milliseconds. Otherwise, the property won't be set. When updating, if `state` is set to `paused`, `pause_end` must be set to a timestamp in the future. 'format': 'double' 'type': 'number' 'safe_browsing': 'description': > If `true`, safe browsing protection is enabled. 'type': 'boolean' 'safe_search': 'description': > If `true`, safe search protection is enabled. 'type': 'boolean' 'state': '$ref': '#/components/schemas/ProtectionSettingsState' 'type': 'object' 'ProtectionSettingsState': 'description': | State of protection. * `off`: Protection is disabled. * `on`: Protection is enabled. * `paused`: Protection is paused. See the `pause_end` property to get or set the end of the pause. 'enum': - 'off' - 'on' - 'paused' 'type': 'string' 'PutV1ProtectionBlockedServicesReq': '$ref': '#/components/schemas/BlockedServices' 'PutV1ProtectionCustomRulesReq': '$ref': '#/components/schemas/CustomRules' 'PutV1SettingsDnsAccessReq': '$ref': '#/components/schemas/DnsAccessSettings' 'RefreshFilterError': 'description': > Filter refresh error. 'properties': 'msg': 'description': > Error message. 'type': 'string' 'uid': '$ref': '#/components/schemas/Uid' 'required': - 'msg' - 'uid' 'type': 'object' 'RuntimeClient': 'description': > A runtime client's information. 'properties': 'host': 'description': > The RDNS host of the runtime, if any. If there is none, this field is absent. 'type': 'string' 'ip': 'description': > The IP-address of the runtime client. 'type': 'string' 'sources': 'description': > The sources from which the information about this runtime client was collected. 'items': '$ref': '#/components/schemas/RuntimeClientSource' 'minItems': 1 'type': 'array' 'num_blocked_requests': 'description': > Total number of blocked requests for this runtime client. 'format': 'int64' 'minimum': 0 'type': 'integer' 'num_requests': 'description': > Total number of requests for this runtime client. 'format': 'int64' 'minimum': 0 'type': 'integer' 'whois': '$ref': '#/components/schemas/Whois' 'required': - 'ip' - 'num_blocked_requests' - 'num_requests' - 'sources' 'type': 'object' 'RuntimeClientSource': 'description': > The source from which the information about this runtime client was collected. * `arp`: The information was collected from the `arp -a` output. * `dhcp`: The information was collected from our DHCP server. * `hosts_file`: The information was collected from the `/etc/hosts` file. * `rdns`: The information was collected by performing a reverse DNS lookup. * `whois`: The information was collected by performing a WHOIS lookup. 'enum': - 'arp' - 'dhcp' - 'hosts_file' - 'rdns' - 'whois' 'type': 'string' 'StaticIpCheckResult': 'properties': 'error': 'description': > Error, if any. If there is no error, this field is absent. 'type': 'string' 'ip': 'description': > The IP address. 'type': 'string' 'static': 'description': > If `true`, the interface has a static IP address. 'type': 'boolean' 'supported': 'description': > If `true`, setting a static IP on this system is supported. 'type': 'boolean' 'required': - 'ip' - 'static' - 'supported' 'type': 'object' 'StatsSettings': 'allOf': - '$ref': '#/components/schemas/StatsSettingsPatch' - 'description': > Statistics settings. 'required': - 'autorefresh' - 'retention' 'StatsSettingsPatch': 'description': > Statistics settings update object. 'properties': 'autorefresh': 'description': > Statistics UI autorefresh time in milliseconds. `0` means autorefresh is disabled. 'format': 'double' 'type': 'number' 'retention': 'description': > Statistics retention interval, in milliseconds. 'format': 'double' 'type': 'number' 'type': 'object' 'TimeUnit': 'description': > Time units used for statistics. See the documentation for the `GET /api/v1/stats/all` request. 'enum': - 'hour' - 'day' 'type': 'string' 'TlsKeyType': 'description': > TLS key type. 'enum': - 'ECDSA' - 'RSA' 'type': 'string' 'TlsSettings': 'allOf': - '$ref': '#/components/schemas/TlsSettingsPatch' - 'description': > TLS and encryption settings. 'example': 'certificate_path': '/etc/ssl/example.com.cert' 'enabled': true 'port_dns_over_quic': 853 'port_dns_over_tls': 853 'port_https': 443 'private_key_path': '/etc/ssl/example.com.key' 'server_name': 'dns.example.com' 'required': - 'enabled' - 'port_dns_over_quic' - 'port_dns_over_tls' - 'port_https' - 'server_name' 'TlsSettingsPatch': 'description': > TLS and encryption settings update object. 'example': 'certificate': 'Base64KeyDatAA==' 'enabled': true 'private_key': 'Base64CertDatA==' 'properties': 'certificate': 'description': | Base64-encoded string with PEM-encoded certificate chain. Should not be sent if `certificate_path` is sent. Otherwise, must be sent. 'format': 'byte' 'type': 'string' 'certificate_path': 'description': | Path to the certificate file. Should not be sent if `certificate` is sent. Otherwise, must be sent. 'type': 'string' 'enabled': 'description': > If `true`, AdGuard Home the administration interface will be served over HTTPS, and the DNS server will listen requests over DNS-over-TLS and other protocols. 'type': 'boolean' 'port_dns_over_quic': 'default': 853 'description': > The DNS-over-QUIC port. If `0`, DNS-over-QUIC is disabled. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'port_dns_over_tls': 'default': 853 'description': > The DNS-over-TLS port. If `0`, DNS-over-TLS is disabled. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'port_https': 'default': 443 'description': > The HTTPS port. If `0`, HTTPS is disabled. 'format': 'int64' 'maximum': 65535 'minimum': 0 'type': 'integer' 'private_key': 'description': | Base64-encoded string with PEM-encoded private key. Should not be sent if `private_key_path` is sent. Otherwise, must be sent. 'format': 'byte' 'type': 'string' 'private_key_path': 'description': | Path to the private key file. Should not be sent if `private_key` is sent. Otherwise, must be sent. 'type': 'string' 'server_name': 'description': > The name of the server. Used to validate the certificates as well as to check ClientIDs in DNS-over-HTTP and DNS-over-TLS. 'type': 'string' 'type': 'object' 'Uid': 'description': > A unique ID of an entity, an opaque string. 'pattern': '[0-9a-zA-Z_-]{1,64}' 'type': 'string' 'UnauthorizedResp': 'example': 'code': 'AUT000' 'msg': 'no or bad authorization provided' 'properties': 'code': '$ref': '#/components/schemas/ErrorCode' 'msg': 'description': > Error message string. 'type': 'string' 'required': - 'code' - 'msg' 'type': 'object' 'UnprocessableEntityResp': 'example': 'code': 'JSN001' 'msg': >- json: cannot unmarshal string into Go struct field T.A of type int 'properties': 'code': '$ref': '#/components/schemas/ErrorCode' 'msg': 'description': > Error message string. 'type': 'string' 'required': - 'code' - 'msg' 'type': 'object' 'UpstreamServerAddr': 'description': | Upstream DNS server address. Supported item formats: * `94.140.14.140`: plain DNS-over-UDP. * `tls://unfiltered.adguard-dns.com`: encrypted DNS-over-TLS. * `path_to_url`: encrypted DNS-over-HTTPS. * `quic://unfiltered.adguard-dns.com`: encrypted DNS-over-QUIC. * `tcp://94.140.14.140`: plain DNS-over-TCP. * `sdns://...`: DNS Stamps for DNSCrypt or DNS-over-HTTPS resolvers. * `[/example.local/]94.140.14.140`: DNS upstream for specific domain(s). * `# comment`: A comment. 'type': 'string' 'Whois': 'additionalProperties': 'type': 'string' 'description': > WHOIS information, if any. If there are none, this field is usually absent. 'minProperties': 1 'type': 'object' # TODO(a.garipov): Find a way to specify a cookie authorization. 'securitySchemes': 'basicAuth': 'description': > Basic HTTP authorization. 'scheme': 'basic' 'type': 'http' ```
/content/code_sandbox/openapi/v1.yaml
yaml
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
36,712
```go package client_test import ( "net/netip" "testing" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/stretchr/testify/assert" ) func TestRuntimeIndex(t *testing.T) { const cliSrc = client.SourceARP var ( ip1 = netip.MustParseAddr("1.1.1.1") ip2 = netip.MustParseAddr("2.2.2.2") ip3 = netip.MustParseAddr("3.3.3.3") ) ri := client.NewRuntimeIndex() currentSize := 0 testCases := []struct { ip netip.Addr name string hosts []string src client.Source }{{ src: cliSrc, ip: ip1, name: "1", hosts: []string{"host1"}, }, { src: cliSrc, ip: ip2, name: "2", hosts: []string{"host2"}, }, { src: cliSrc, ip: ip3, name: "3", hosts: []string{"host3"}, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { rc := client.NewRuntime(tc.ip) rc.SetInfo(tc.src, tc.hosts) ri.Add(rc) currentSize++ got := ri.Client(tc.ip) assert.Equal(t, rc, got) }) } t.Run("size", func(t *testing.T) { assert.Equal(t, currentSize, ri.Size()) }) t.Run("range", func(t *testing.T) { s := 0 ri.Range(func(rc *client.Runtime) (cont bool) { s++ return true }) assert.Equal(t, currentSize, s) }) t.Run("delete", func(t *testing.T) { ri.Delete(ip1) currentSize-- assert.Equal(t, currentSize, ri.Size()) }) t.Run("delete_by_src", func(t *testing.T) { assert.Equal(t, currentSize, ri.DeleteBySource(cliSrc)) assert.Equal(t, 0, ri.Size()) }) } ```
/content/code_sandbox/internal/client/runtimeindex_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
494
```go package client import "net/netip" // RuntimeIndex stores information about runtime clients. type RuntimeIndex struct { // index maps IP address to runtime client. index map[netip.Addr]*Runtime } // NewRuntimeIndex returns initialized runtime index. func NewRuntimeIndex() (ri *RuntimeIndex) { return &RuntimeIndex{ index: map[netip.Addr]*Runtime{}, } } // Client returns the saved runtime client by ip. If no such client exists, // returns nil. func (ri *RuntimeIndex) Client(ip netip.Addr) (rc *Runtime) { return ri.index[ip] } // Add saves the runtime client in the index. IP address of a client must be // unique. See [Runtime.Client]. rc must not be nil. func (ri *RuntimeIndex) Add(rc *Runtime) { ip := rc.Addr() ri.index[ip] = rc } // Size returns the number of the runtime clients. func (ri *RuntimeIndex) Size() (n int) { return len(ri.index) } // Range calls f for each runtime client in an undefined order. func (ri *RuntimeIndex) Range(f func(rc *Runtime) (cont bool)) { for _, rc := range ri.index { if !f(rc) { return } } } // Delete removes the runtime client by ip. func (ri *RuntimeIndex) Delete(ip netip.Addr) { delete(ri.index, ip) } // DeleteBySource removes all runtime clients that have information only from // the specified source and returns the number of removed clients. func (ri *RuntimeIndex) DeleteBySource(src Source) (n int) { for ip, rc := range ri.index { rc.unset(src) if rc.isEmpty() { delete(ri.index, ip) n++ } } return n } ```
/content/code_sandbox/internal/client/runtimeindex.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
395
```go package client import ( "net" "net/netip" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // newIDIndex is a helper function that returns a client index filled with // persistent clients from the m. It also generates a UID for each client. func newIDIndex(m []*Persistent) (ci *index) { ci = newIndex() for _, c := range m { c.UID = MustNewUID() ci.add(c) } return ci } // TODO(s.chzhen): Remove. func TestClientIndex_Find(t *testing.T) { const ( cliIPNone = "1.2.3.4" cliIP1 = "1.1.1.1" cliIP2 = "2.2.2.2" cliIPv6 = "1:2:3::4" cliSubnet = "2.2.2.0/24" cliSubnetIP = "2.2.2.222" cliID = "client-id" cliMAC = "11:11:11:11:11:11" linkLocalIP = "fe80::abcd:abcd:abcd:ab%eth0" linkLocalSubnet = "fe80::/16" ) var ( clientWithBothFams = &Persistent{ Name: "client1", IPs: []netip.Addr{ netip.MustParseAddr(cliIP1), netip.MustParseAddr(cliIPv6), }, } clientWithSubnet = &Persistent{ Name: "client2", IPs: []netip.Addr{netip.MustParseAddr(cliIP2)}, Subnets: []netip.Prefix{netip.MustParsePrefix(cliSubnet)}, } clientWithMAC = &Persistent{ Name: "client_with_mac", MACs: []net.HardwareAddr{mustParseMAC(cliMAC)}, } clientWithID = &Persistent{ Name: "client_with_id", ClientIDs: []string{cliID}, } clientLinkLocal = &Persistent{ Name: "client_link_local", Subnets: []netip.Prefix{netip.MustParsePrefix(linkLocalSubnet)}, } ) clients := []*Persistent{ clientWithBothFams, clientWithSubnet, clientWithMAC, clientWithID, clientLinkLocal, } ci := newIDIndex(clients) testCases := []struct { want *Persistent name string ids []string }{{ name: "ipv4_ipv6", ids: []string{cliIP1, cliIPv6}, want: clientWithBothFams, }, { name: "ipv4_subnet", ids: []string{cliIP2, cliSubnetIP}, want: clientWithSubnet, }, { name: "mac", ids: []string{cliMAC}, want: clientWithMAC, }, { name: "client_id", ids: []string{cliID}, want: clientWithID, }, { name: "client_link_local_subnet", ids: []string{linkLocalIP}, want: clientLinkLocal, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { for _, id := range tc.ids { c, ok := ci.find(id) require.True(t, ok) assert.Equal(t, tc.want, c) } }) } t.Run("not_found", func(t *testing.T) { _, ok := ci.find(cliIPNone) assert.False(t, ok) }) } func TestClientIndex_Clashes(t *testing.T) { const ( cliIP1 = "1.1.1.1" cliSubnet = "2.2.2.0/24" cliSubnetIP = "2.2.2.222" cliID = "client-id" cliMAC = "11:11:11:11:11:11" ) clients := []*Persistent{{ Name: "client_with_ip", IPs: []netip.Addr{netip.MustParseAddr(cliIP1)}, }, { Name: "client_with_subnet", Subnets: []netip.Prefix{netip.MustParsePrefix(cliSubnet)}, }, { Name: "client_with_mac", MACs: []net.HardwareAddr{mustParseMAC(cliMAC)}, }, { Name: "client_with_id", ClientIDs: []string{cliID}, }} ci := newIDIndex(clients) testCases := []struct { client *Persistent name string }{{ name: "ipv4", client: clients[0], }, { name: "subnet", client: clients[1], }, { name: "mac", client: clients[2], }, { name: "client_id", client: clients[3], }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { clone := tc.client.ShallowClone() clone.UID = MustNewUID() err := ci.clashes(clone) require.Error(t, err) ci.remove(tc.client) err = ci.clashes(clone) require.NoError(t, err) }) } } // mustParseMAC is wrapper around [net.ParseMAC] that panics if there is an // error. func mustParseMAC(s string) (mac net.HardwareAddr) { mac, err := net.ParseMAC(s) if err != nil { panic(err) } return mac } func TestMACToKey(t *testing.T) { testCases := []struct { want any name string in string }{{ name: "column6", in: "00:00:5e:00:53:01", want: [6]byte(mustParseMAC("00:00:5e:00:53:01")), }, { name: "column8", in: "02:00:5e:10:00:00:00:01", want: [8]byte(mustParseMAC("02:00:5e:10:00:00:00:01")), }, { name: "column20", in: "00:00:00:00:fe:80:00:00:00:00:00:00:02:00:5e:10:00:00:00:01", want: [20]byte(mustParseMAC("00:00:00:00:fe:80:00:00:00:00:00:00:02:00:5e:10:00:00:00:01")), }, { name: "hyphen6", in: "00-00-5e-00-53-01", want: [6]byte(mustParseMAC("00-00-5e-00-53-01")), }, { name: "hyphen8", in: "02-00-5e-10-00-00-00-01", want: [8]byte(mustParseMAC("02-00-5e-10-00-00-00-01")), }, { name: "hyphen20", in: "00-00-00-00-fe-80-00-00-00-00-00-00-02-00-5e-10-00-00-00-01", want: [20]byte(mustParseMAC("00-00-00-00-fe-80-00-00-00-00-00-00-02-00-5e-10-00-00-00-01")), }, { name: "dot6", in: "0000.5e00.5301", want: [6]byte(mustParseMAC("0000.5e00.5301")), }, { name: "dot8", in: "0200.5e10.0000.0001", want: [8]byte(mustParseMAC("0200.5e10.0000.0001")), }, { name: "dot20", in: "0000.0000.fe80.0000.0000.0000.0200.5e10.0000.0001", want: [20]byte(mustParseMAC("0000.0000.fe80.0000.0000.0000.0200.5e10.0000.0001")), }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { mac := mustParseMAC(tc.in) key := macToKey(mac) assert.Equal(t, tc.want, key) }) } assert.Panics(t, func() { mac := net.HardwareAddr([]byte{1, 2, 3}) _ = macToKey(mac) }) } func TestIndex_FindByIPWithoutZone(t *testing.T) { var ( ip = netip.MustParseAddr("fe80::a098:7654:32ef:ff1") ipWithZone = netip.MustParseAddr("fe80::1ff:fe23:4567:890a%eth2") ) var ( clientNoZone = &Persistent{ Name: "client", IPs: []netip.Addr{ip}, } clientWithZone = &Persistent{ Name: "client_with_zone", IPs: []netip.Addr{ipWithZone}, } ) ci := newIDIndex([]*Persistent{ clientNoZone, clientWithZone, }) testCases := []struct { ip netip.Addr want *Persistent name string }{{ name: "without_zone", ip: ip, want: clientNoZone, }, { name: "with_zone", ip: ipWithZone, want: clientWithZone, }, { name: "zero_address", ip: netip.Addr{}, want: nil, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { c := ci.findByIPWithoutZone(tc.ip.WithZone("")) require.Equal(t, tc.want, c) }) } } func TestClientIndex_RangeByName(t *testing.T) { sortedClients := []*Persistent{{ Name: "clientA", ClientIDs: []string{"A"}, }, { Name: "clientB", ClientIDs: []string{"B"}, }, { Name: "clientC", ClientIDs: []string{"C"}, }, { Name: "clientD", ClientIDs: []string{"D"}, }, { Name: "clientE", ClientIDs: []string{"E"}, }} testCases := []struct { name string want []*Persistent }{{ name: "basic", want: sortedClients, }, { name: "nil", want: nil, }, { name: "one_element", want: sortedClients[:1], }, { name: "two_elements", want: sortedClients[:2], }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { ci := newIDIndex(tc.want) var got []*Persistent ci.rangeByName(func(c *Persistent) (cont bool) { got = append(got, c) return true }) assert.Equal(t, tc.want, got) }) } } ```
/content/code_sandbox/internal/client/index_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,635
```go // Package client contains types and logic dealing with AdGuard Home's DNS // clients. // // TODO(a.garipov): Expand. package client import ( "encoding" "fmt" "net/netip" "slices" "github.com/AdguardTeam/AdGuardHome/internal/whois" ) // Source represents the source from which the information about the client has // been obtained. type Source uint8 // Clients information sources. The order determines the priority. const ( SourceWHOIS Source = iota + 1 SourceARP SourceRDNS SourceDHCP SourceHostsFile SourcePersistent ) // type check var _ fmt.Stringer = Source(0) // String returns a human-readable name of cs. func (cs Source) String() (s string) { switch cs { case SourceWHOIS: return "WHOIS" case SourceARP: return "ARP" case SourceRDNS: return "rDNS" case SourceDHCP: return "DHCP" case SourceHostsFile: return "etc/hosts" default: return "" } } // type check var _ encoding.TextMarshaler = Source(0) // MarshalText implements encoding.TextMarshaler for the Source. func (cs Source) MarshalText() (text []byte, err error) { return []byte(cs.String()), nil } // Runtime is a client information from different sources. type Runtime struct { // ip is an IP address of a client. ip netip.Addr // whois is the filtered WHOIS information of a client. whois *whois.Info // arp is the ARP information of a client. nil indicates that there is no // information from the source. Empty non-nil slice indicates that the data // from the source is present, but empty. arp []string // rdns is the RDNS information of a client. nil indicates that there is no // information from the source. Empty non-nil slice indicates that the data // from the source is present, but empty. rdns []string // dhcp is the DHCP information of a client. nil indicates that there is no // information from the source. Empty non-nil slice indicates that the data // from the source is present, but empty. dhcp []string // hostsFile is the information from the hosts file. nil indicates that // there is no information from the source. Empty non-nil slice indicates // that the data from the source is present, but empty. hostsFile []string } // NewRuntime constructs a new runtime client. ip must be valid IP address. // // TODO(s.chzhen): Validate IP address. func NewRuntime(ip netip.Addr) (r *Runtime) { return &Runtime{ ip: ip, } } // Info returns a client information from the highest-priority source. func (r *Runtime) Info() (cs Source, host string) { info := []string{} switch { case r.hostsFile != nil: cs, info = SourceHostsFile, r.hostsFile case r.dhcp != nil: cs, info = SourceDHCP, r.dhcp case r.rdns != nil: cs, info = SourceRDNS, r.rdns case r.arp != nil: cs, info = SourceARP, r.arp case r.whois != nil: cs = SourceWHOIS } if len(info) == 0 { return cs, "" } // TODO(s.chzhen): Return the full information. return cs, info[0] } // SetInfo sets a host as a client information from the cs. func (r *Runtime) SetInfo(cs Source, hosts []string) { // TODO(s.chzhen): Use contract where hosts must contain non-empty host. if len(hosts) == 1 && hosts[0] == "" { hosts = []string{} } switch cs { case SourceARP: r.arp = hosts case SourceRDNS: r.rdns = hosts case SourceDHCP: r.dhcp = hosts case SourceHostsFile: r.hostsFile = hosts } } // WHOIS returns a WHOIS client information. func (r *Runtime) WHOIS() (info *whois.Info) { return r.whois } // SetWHOIS sets a WHOIS client information. info must be non-nil. func (r *Runtime) SetWHOIS(info *whois.Info) { r.whois = info } // unset clears a cs information. func (r *Runtime) unset(cs Source) { switch cs { case SourceWHOIS: r.whois = nil case SourceARP: r.arp = nil case SourceRDNS: r.rdns = nil case SourceDHCP: r.dhcp = nil case SourceHostsFile: r.hostsFile = nil } } // isEmpty returns true if there is no information from any source. func (r *Runtime) isEmpty() (ok bool) { return r.whois == nil && r.arp == nil && r.rdns == nil && r.dhcp == nil && r.hostsFile == nil } // Addr returns an IP address of the client. func (r *Runtime) Addr() (ip netip.Addr) { return r.ip } // Clone returns a deep copy of the runtime client. func (r *Runtime) Clone() (c *Runtime) { return &Runtime{ ip: r.ip, whois: r.whois.Clone(), arp: slices.Clone(r.arp), rdns: slices.Clone(r.rdns), dhcp: slices.Clone(r.dhcp), hostsFile: slices.Clone(r.hostsFile), } } ```
/content/code_sandbox/internal/client/client.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,269
```go package client_test import ( "net" "net/netip" "testing" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/AdguardTeam/AdGuardHome/internal/whois" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // newStorage is a helper function that returns a client storage filled with // persistent clients from the m. It also generates a UID for each client. func newStorage(tb testing.TB, m []*client.Persistent) (s *client.Storage) { tb.Helper() s = client.NewStorage(&client.Config{ AllowedTags: nil, }) for _, c := range m { c.UID = client.MustNewUID() require.NoError(tb, s.Add(c)) } require.Equal(tb, len(m), s.Size()) return s } // newRuntimeClient is a helper function that returns a new runtime client. func newRuntimeClient(ip netip.Addr, source client.Source, host string) (rc *client.Runtime) { rc = client.NewRuntime(ip) rc.SetInfo(source, []string{host}) return rc } // mustParseMAC is wrapper around [net.ParseMAC] that panics if there is an // error. func mustParseMAC(s string) (mac net.HardwareAddr) { mac, err := net.ParseMAC(s) if err != nil { panic(err) } return mac } func TestStorage_Add(t *testing.T) { const ( existingName = "existing_name" existingClientID = "existing_client_id" allowedTag = "tag" notAllowedTag = "not_allowed_tag" ) var ( existingClientUID = client.MustNewUID() existingIP = netip.MustParseAddr("1.2.3.4") existingSubnet = netip.MustParsePrefix("1.2.3.0/24") ) existingClient := &client.Persistent{ Name: existingName, IPs: []netip.Addr{existingIP}, Subnets: []netip.Prefix{existingSubnet}, ClientIDs: []string{existingClientID}, UID: existingClientUID, } s := client.NewStorage(&client.Config{ AllowedTags: []string{allowedTag}, }) err := s.Add(existingClient) require.NoError(t, err) testCases := []struct { name string cli *client.Persistent wantErrMsg string }{{ name: "basic", cli: &client.Persistent{ Name: "basic", IPs: []netip.Addr{netip.MustParseAddr("1.1.1.1")}, UID: client.MustNewUID(), }, wantErrMsg: "", }, { name: "duplicate_uid", cli: &client.Persistent{ Name: "no_uid", IPs: []netip.Addr{netip.MustParseAddr("2.2.2.2")}, UID: existingClientUID, }, wantErrMsg: `adding client: another client "existing_name" uses the same uid`, }, { name: "duplicate_name", cli: &client.Persistent{ Name: existingName, IPs: []netip.Addr{netip.MustParseAddr("3.3.3.3")}, UID: client.MustNewUID(), }, wantErrMsg: `adding client: another client uses the same name "existing_name"`, }, { name: "duplicate_ip", cli: &client.Persistent{ Name: "duplicate_ip", IPs: []netip.Addr{existingIP}, UID: client.MustNewUID(), }, wantErrMsg: `adding client: another client "existing_name" uses the same IP "1.2.3.4"`, }, { name: "duplicate_subnet", cli: &client.Persistent{ Name: "duplicate_subnet", Subnets: []netip.Prefix{existingSubnet}, UID: client.MustNewUID(), }, wantErrMsg: `adding client: another client "existing_name" ` + `uses the same subnet "1.2.3.0/24"`, }, { name: "duplicate_client_id", cli: &client.Persistent{ Name: "duplicate_client_id", ClientIDs: []string{existingClientID}, UID: client.MustNewUID(), }, wantErrMsg: `adding client: another client "existing_name" ` + `uses the same ClientID "existing_client_id"`, }, { name: "not_allowed_tag", cli: &client.Persistent{ Name: "nont_allowed_tag", Tags: []string{notAllowedTag}, IPs: []netip.Addr{netip.MustParseAddr("4.4.4.4")}, UID: client.MustNewUID(), }, wantErrMsg: `adding client: invalid tag: "not_allowed_tag"`, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { err = s.Add(tc.cli) testutil.AssertErrorMsg(t, tc.wantErrMsg, err) }) } } func TestStorage_RemoveByName(t *testing.T) { const ( existingName = "existing_name" ) existingClient := &client.Persistent{ Name: existingName, IPs: []netip.Addr{netip.MustParseAddr("1.2.3.4")}, UID: client.MustNewUID(), } s := client.NewStorage(&client.Config{ AllowedTags: nil, }) err := s.Add(existingClient) require.NoError(t, err) testCases := []struct { want assert.BoolAssertionFunc name string cliName string }{{ name: "existing_client", cliName: existingName, want: assert.True, }, { name: "non_existing_client", cliName: "non_existing_client", want: assert.False, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { tc.want(t, s.RemoveByName(tc.cliName)) }) } t.Run("duplicate_remove", func(t *testing.T) { s = client.NewStorage(&client.Config{ AllowedTags: nil, }) err = s.Add(existingClient) require.NoError(t, err) assert.True(t, s.RemoveByName(existingName)) assert.False(t, s.RemoveByName(existingName)) }) } func TestStorage_Find(t *testing.T) { const ( cliIPNone = "1.2.3.4" cliIP1 = "1.1.1.1" cliIP2 = "2.2.2.2" cliIPv6 = "1:2:3::4" cliSubnet = "2.2.2.0/24" cliSubnetIP = "2.2.2.222" cliID = "client-id" cliMAC = "11:11:11:11:11:11" linkLocalIP = "fe80::abcd:abcd:abcd:ab%eth0" linkLocalSubnet = "fe80::/16" ) var ( clientWithBothFams = &client.Persistent{ Name: "client1", IPs: []netip.Addr{ netip.MustParseAddr(cliIP1), netip.MustParseAddr(cliIPv6), }, } clientWithSubnet = &client.Persistent{ Name: "client2", IPs: []netip.Addr{netip.MustParseAddr(cliIP2)}, Subnets: []netip.Prefix{netip.MustParsePrefix(cliSubnet)}, } clientWithMAC = &client.Persistent{ Name: "client_with_mac", MACs: []net.HardwareAddr{mustParseMAC(cliMAC)}, } clientWithID = &client.Persistent{ Name: "client_with_id", ClientIDs: []string{cliID}, } clientLinkLocal = &client.Persistent{ Name: "client_link_local", Subnets: []netip.Prefix{netip.MustParsePrefix(linkLocalSubnet)}, } ) clients := []*client.Persistent{ clientWithBothFams, clientWithSubnet, clientWithMAC, clientWithID, clientLinkLocal, } s := newStorage(t, clients) testCases := []struct { want *client.Persistent name string ids []string }{{ name: "ipv4_ipv6", ids: []string{cliIP1, cliIPv6}, want: clientWithBothFams, }, { name: "ipv4_subnet", ids: []string{cliIP2, cliSubnetIP}, want: clientWithSubnet, }, { name: "mac", ids: []string{cliMAC}, want: clientWithMAC, }, { name: "client_id", ids: []string{cliID}, want: clientWithID, }, { name: "client_link_local_subnet", ids: []string{linkLocalIP}, want: clientLinkLocal, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { for _, id := range tc.ids { c, ok := s.Find(id) require.True(t, ok) assert.Equal(t, tc.want, c) } }) } t.Run("not_found", func(t *testing.T) { _, ok := s.Find(cliIPNone) assert.False(t, ok) }) } func TestStorage_FindLoose(t *testing.T) { const ( nonExistingClientID = "client_id" ) var ( ip = netip.MustParseAddr("fe80::a098:7654:32ef:ff1") ipWithZone = netip.MustParseAddr("fe80::1ff:fe23:4567:890a%eth2") ) var ( clientNoZone = &client.Persistent{ Name: "client", IPs: []netip.Addr{ip}, } clientWithZone = &client.Persistent{ Name: "client_with_zone", IPs: []netip.Addr{ipWithZone}, } ) s := newStorage( t, []*client.Persistent{ clientNoZone, clientWithZone, }, ) testCases := []struct { ip netip.Addr want assert.BoolAssertionFunc wantCli *client.Persistent name string }{{ name: "without_zone", ip: ip, wantCli: clientNoZone, want: assert.True, }, { name: "with_zone", ip: ipWithZone, wantCli: clientWithZone, want: assert.True, }, { name: "zero_address", ip: netip.Addr{}, wantCli: nil, want: assert.False, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { c, ok := s.FindLoose(tc.ip.WithZone(""), nonExistingClientID) assert.Equal(t, tc.wantCli, c) tc.want(t, ok) }) } } func TestStorage_FindByName(t *testing.T) { const ( cliIP1 = "1.1.1.1" cliIP2 = "2.2.2.2" ) const ( clientExistingName = "client_existing" clientAnotherExistingName = "client_another_existing" nonExistingClientName = "client_non_existing" ) var ( clientExisting = &client.Persistent{ Name: clientExistingName, IPs: []netip.Addr{netip.MustParseAddr(cliIP1)}, } clientAnotherExisting = &client.Persistent{ Name: clientAnotherExistingName, IPs: []netip.Addr{netip.MustParseAddr(cliIP2)}, } ) clients := []*client.Persistent{ clientExisting, clientAnotherExisting, } s := newStorage(t, clients) testCases := []struct { want *client.Persistent name string clientName string }{{ name: "existing", clientName: clientExistingName, want: clientExisting, }, { name: "another_existing", clientName: clientAnotherExistingName, want: clientAnotherExisting, }, { name: "non_existing", clientName: nonExistingClientName, want: nil, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { c, ok := s.FindByName(tc.clientName) if tc.want == nil { assert.False(t, ok) return } assert.True(t, ok) assert.Equal(t, tc.want, c) }) } } func TestStorage_FindByMAC(t *testing.T) { var ( cliMAC = mustParseMAC("11:11:11:11:11:11") cliAnotherMAC = mustParseMAC("22:22:22:22:22:22") nonExistingClientMAC = mustParseMAC("33:33:33:33:33:33") ) var ( clientExisting = &client.Persistent{ Name: "client", MACs: []net.HardwareAddr{cliMAC}, } clientAnotherExisting = &client.Persistent{ Name: "another_client", MACs: []net.HardwareAddr{cliAnotherMAC}, } ) clients := []*client.Persistent{ clientExisting, clientAnotherExisting, } s := newStorage(t, clients) testCases := []struct { want *client.Persistent name string clientMAC net.HardwareAddr }{{ name: "existing", clientMAC: cliMAC, want: clientExisting, }, { name: "another_existing", clientMAC: cliAnotherMAC, want: clientAnotherExisting, }, { name: "non_existing", clientMAC: nonExistingClientMAC, want: nil, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { c, ok := s.FindByMAC(tc.clientMAC) if tc.want == nil { assert.False(t, ok) return } assert.True(t, ok) assert.Equal(t, tc.want, c) }) } } func TestStorage_Update(t *testing.T) { const ( clientName = "client_name" obstructingName = "obstructing_name" obstructingClientID = "obstructing_client_id" ) var ( obstructingIP = netip.MustParseAddr("1.2.3.4") obstructingSubnet = netip.MustParsePrefix("1.2.3.0/24") ) obstructingClient := &client.Persistent{ Name: obstructingName, IPs: []netip.Addr{obstructingIP}, Subnets: []netip.Prefix{obstructingSubnet}, ClientIDs: []string{obstructingClientID}, } clientToUpdate := &client.Persistent{ Name: clientName, IPs: []netip.Addr{netip.MustParseAddr("1.1.1.1")}, } testCases := []struct { name string cli *client.Persistent wantErrMsg string }{{ name: "basic", cli: &client.Persistent{ Name: "basic", IPs: []netip.Addr{netip.MustParseAddr("1.1.1.1")}, UID: client.MustNewUID(), }, wantErrMsg: "", }, { name: "duplicate_name", cli: &client.Persistent{ Name: obstructingName, IPs: []netip.Addr{netip.MustParseAddr("3.3.3.3")}, UID: client.MustNewUID(), }, wantErrMsg: `updating client: another client uses the same name "obstructing_name"`, }, { name: "duplicate_ip", cli: &client.Persistent{ Name: "duplicate_ip", IPs: []netip.Addr{obstructingIP}, UID: client.MustNewUID(), }, wantErrMsg: `updating client: another client "obstructing_name" uses the same IP "1.2.3.4"`, }, { name: "duplicate_subnet", cli: &client.Persistent{ Name: "duplicate_subnet", Subnets: []netip.Prefix{obstructingSubnet}, UID: client.MustNewUID(), }, wantErrMsg: `updating client: another client "obstructing_name" ` + `uses the same subnet "1.2.3.0/24"`, }, { name: "duplicate_client_id", cli: &client.Persistent{ Name: "duplicate_client_id", ClientIDs: []string{obstructingClientID}, UID: client.MustNewUID(), }, wantErrMsg: `updating client: another client "obstructing_name" ` + `uses the same ClientID "obstructing_client_id"`, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { s := newStorage( t, []*client.Persistent{ clientToUpdate, obstructingClient, }, ) err := s.Update(clientName, tc.cli) testutil.AssertErrorMsg(t, tc.wantErrMsg, err) }) } } func TestStorage_RangeByName(t *testing.T) { sortedClients := []*client.Persistent{{ Name: "clientA", ClientIDs: []string{"A"}, }, { Name: "clientB", ClientIDs: []string{"B"}, }, { Name: "clientC", ClientIDs: []string{"C"}, }, { Name: "clientD", ClientIDs: []string{"D"}, }, { Name: "clientE", ClientIDs: []string{"E"}, }} testCases := []struct { name string want []*client.Persistent }{{ name: "basic", want: sortedClients, }, { name: "nil", want: nil, }, { name: "one_element", want: sortedClients[:1], }, { name: "two_elements", want: sortedClients[:2], }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { s := newStorage(t, tc.want) var got []*client.Persistent s.RangeByName(func(c *client.Persistent) (cont bool) { got = append(got, c) return true }) assert.Equal(t, tc.want, got) }) } } func TestStorage_UpdateRuntime(t *testing.T) { const ( addedARP = "added_arp" addedSecondARP = "added_arp" updatedARP = "updated_arp" cliCity = "City" cliCountry = "Country" cliOrgname = "Orgname" ) var ( ip = netip.MustParseAddr("1.1.1.1") ip2 = netip.MustParseAddr("2.2.2.2") ) updated := client.NewRuntime(ip) updated.SetInfo(client.SourceARP, []string{updatedARP}) info := &whois.Info{ City: cliCity, Country: cliCountry, Orgname: cliOrgname, } updated.SetWHOIS(info) s := client.NewStorage(&client.Config{ AllowedTags: nil, }) t.Run("add_arp_client", func(t *testing.T) { added := client.NewRuntime(ip) added.SetInfo(client.SourceARP, []string{addedARP}) require.True(t, s.UpdateRuntime(added)) require.Equal(t, 1, s.SizeRuntime()) got := s.ClientRuntime(ip) source, host := got.Info() assert.Equal(t, client.SourceARP, source) assert.Equal(t, addedARP, host) }) t.Run("add_second_arp_client", func(t *testing.T) { added := client.NewRuntime(ip2) added.SetInfo(client.SourceARP, []string{addedSecondARP}) require.True(t, s.UpdateRuntime(added)) require.Equal(t, 2, s.SizeRuntime()) got := s.ClientRuntime(ip2) source, host := got.Info() assert.Equal(t, client.SourceARP, source) assert.Equal(t, addedSecondARP, host) }) t.Run("update_first_client", func(t *testing.T) { require.False(t, s.UpdateRuntime(updated)) got := s.ClientRuntime(ip) require.Equal(t, 2, s.SizeRuntime()) source, host := got.Info() assert.Equal(t, client.SourceARP, source) assert.Equal(t, updatedARP, host) }) t.Run("remove_arp_info", func(t *testing.T) { n := s.DeleteBySource(client.SourceARP) require.Equal(t, 1, n) require.Equal(t, 1, s.SizeRuntime()) got := s.ClientRuntime(ip) source, _ := got.Info() assert.Equal(t, client.SourceWHOIS, source) assert.Equal(t, info, got.WHOIS()) }) t.Run("remove_whois_info", func(t *testing.T) { n := s.DeleteBySource(client.SourceWHOIS) require.Equal(t, 1, n) require.Equal(t, 0, s.SizeRuntime()) }) } func TestStorage_BatchUpdateBySource(t *testing.T) { const ( defSrc = client.SourceARP cliFirstHost1 = "host1" cliFirstHost2 = "host2" cliUpdatedHost3 = "host3" cliUpdatedHost4 = "host4" cliUpdatedHost5 = "host5" ) var ( cliFirstIP1 = netip.MustParseAddr("1.1.1.1") cliFirstIP2 = netip.MustParseAddr("2.2.2.2") cliUpdatedIP3 = netip.MustParseAddr("3.3.3.3") cliUpdatedIP4 = netip.MustParseAddr("4.4.4.4") cliUpdatedIP5 = netip.MustParseAddr("5.5.5.5") ) firstClients := []*client.Runtime{ newRuntimeClient(cliFirstIP1, defSrc, cliFirstHost1), newRuntimeClient(cliFirstIP2, defSrc, cliFirstHost2), } updatedClients := []*client.Runtime{ newRuntimeClient(cliUpdatedIP3, defSrc, cliUpdatedHost3), newRuntimeClient(cliUpdatedIP4, defSrc, cliUpdatedHost4), newRuntimeClient(cliUpdatedIP5, defSrc, cliUpdatedHost5), } s := client.NewStorage(&client.Config{ AllowedTags: nil, }) t.Run("populate_storage_with_first_clients", func(t *testing.T) { added, removed := s.BatchUpdateBySource(defSrc, firstClients) require.Equal(t, len(firstClients), added) require.Equal(t, 0, removed) require.Equal(t, len(firstClients), s.SizeRuntime()) rc := s.ClientRuntime(cliFirstIP1) src, host := rc.Info() assert.Equal(t, defSrc, src) assert.Equal(t, cliFirstHost1, host) }) t.Run("update_storage", func(t *testing.T) { added, removed := s.BatchUpdateBySource(defSrc, updatedClients) require.Equal(t, len(updatedClients), added) require.Equal(t, len(firstClients), removed) require.Equal(t, len(updatedClients), s.SizeRuntime()) rc := s.ClientRuntime(cliUpdatedIP3) src, host := rc.Info() assert.Equal(t, defSrc, src) assert.Equal(t, cliUpdatedHost3, host) rc = s.ClientRuntime(cliFirstIP1) assert.Nil(t, rc) }) t.Run("remove_all", func(t *testing.T) { added, removed := s.BatchUpdateBySource(defSrc, []*client.Runtime{}) require.Equal(t, 0, added) require.Equal(t, len(updatedClients), removed) require.Equal(t, 0, s.SizeRuntime()) }) } ```
/content/code_sandbox/internal/client/storage_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
5,533
```go package client_test import ( "net/netip" "testing" "time" "github.com/AdguardTeam/golibs/testutil" ) func TestMain(m *testing.M) { testutil.DiscardLogOutput(m) } // testHost is the common hostname for tests. const testHost = "client.example" // testTimeout is the common timeout for tests. const testTimeout = 1 * time.Second // testWHOISCity is the common city for tests. const testWHOISCity = "Brussels" // testIP is the common IP address for tests. var testIP = netip.MustParseAddr("1.2.3.4") ```
/content/code_sandbox/internal/client/client_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
139
```go package client_test import ( "context" "fmt" "io" "net" "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/client" "github.com/AdguardTeam/AdGuardHome/internal/whois" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/testutil" "github.com/AdguardTeam/golibs/testutil/fakenet" "github.com/stretchr/testify/assert" ) func TestEmptyAddrProc(t *testing.T) { t.Parallel() p := client.EmptyAddrProc{} assert.NotPanics(t, func() { p.Process(testIP) }) assert.NotPanics(t, func() { err := p.Close() assert.NoError(t, err) }) } func TestDefaultAddrProc_Process_rDNS(t *testing.T) { t.Parallel() privateIP := netip.MustParseAddr("192.168.0.1") testCases := []struct { rdnsErr error ip netip.Addr name string host string usePrivate bool wantUpd bool }{{ rdnsErr: nil, ip: testIP, name: "success", host: testHost, usePrivate: false, wantUpd: true, }, { rdnsErr: nil, ip: testIP, name: "no_host", host: "", usePrivate: false, wantUpd: false, }, { rdnsErr: nil, ip: netip.MustParseAddr("127.0.0.1"), name: "localhost", host: "", usePrivate: false, wantUpd: false, }, { rdnsErr: nil, ip: privateIP, name: "private_ignored", host: "", usePrivate: false, wantUpd: false, }, { rdnsErr: nil, ip: privateIP, name: "private_processed", host: "private.example", usePrivate: true, wantUpd: true, }, { rdnsErr: errors.Error("rdns error"), ip: testIP, name: "rdns_error", host: "", usePrivate: false, wantUpd: false, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { t.Parallel() updIPCh := make(chan netip.Addr, 1) updHostCh := make(chan string, 1) updInfoCh := make(chan *whois.Info, 1) p := client.NewDefaultAddrProc(&client.DefaultAddrProcConfig{ DialContext: func(_ context.Context, _, _ string) (conn net.Conn, err error) { panic("not implemented") }, Exchanger: &aghtest.Exchanger{ OnExchange: func(ip netip.Addr) (host string, ttl time.Duration, err error) { return tc.host, 0, tc.rdnsErr }, }, PrivateSubnets: netutil.SubnetSetFunc(netutil.IsLocallyServed), AddressUpdater: &aghtest.AddressUpdater{ OnUpdateAddress: newOnUpdateAddress(tc.wantUpd, updIPCh, updHostCh, updInfoCh), }, CatchPanics: false, UseRDNS: true, UsePrivateRDNS: tc.usePrivate, UseWHOIS: false, }) testutil.CleanupAndRequireSuccess(t, p.Close) p.Process(tc.ip) if !tc.wantUpd { return } gotIP, _ := testutil.RequireReceive(t, updIPCh, testTimeout) assert.Equal(t, tc.ip, gotIP) gotHost, _ := testutil.RequireReceive(t, updHostCh, testTimeout) assert.Equal(t, tc.host, gotHost) gotInfo, _ := testutil.RequireReceive(t, updInfoCh, testTimeout) assert.Nil(t, gotInfo) }) } } // newOnUpdateAddress is a test helper that returns a new OnUpdateAddress // callback using the provided channels if an update is expected and panicking // otherwise. func newOnUpdateAddress( want bool, ips chan<- netip.Addr, hosts chan<- string, infos chan<- *whois.Info, ) (f func(ip netip.Addr, host string, info *whois.Info)) { return func(ip netip.Addr, host string, info *whois.Info) { if !want && (host != "" || info != nil) { panic(fmt.Errorf("got unexpected update for %v with %q and %v", ip, host, info)) } ips <- ip hosts <- host infos <- info } } func TestDefaultAddrProc_Process_WHOIS(t *testing.T) { t.Parallel() testCases := []struct { wantInfo *whois.Info exchErr error name string wantUpd bool }{{ wantInfo: &whois.Info{ City: testWHOISCity, }, exchErr: nil, name: "success", wantUpd: true, }, { wantInfo: nil, exchErr: nil, name: "no_info", wantUpd: false, }, { wantInfo: nil, exchErr: errors.Error("whois error"), name: "whois_error", wantUpd: false, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { t.Parallel() whoisConn := &fakenet.Conn{ OnClose: func() (err error) { return nil }, OnRead: func(b []byte) (n int, err error) { if tc.wantInfo == nil { return 0, tc.exchErr } data := "city: " + tc.wantInfo.City + "\n" copy(b, data) return len(data), io.EOF }, OnSetDeadline: func(_ time.Time) (err error) { return nil }, OnWrite: func(b []byte) (n int, err error) { return len(b), nil }, } updIPCh := make(chan netip.Addr, 1) updHostCh := make(chan string, 1) updInfoCh := make(chan *whois.Info, 1) p := client.NewDefaultAddrProc(&client.DefaultAddrProcConfig{ DialContext: func(_ context.Context, _, _ string) (conn net.Conn, err error) { return whoisConn, nil }, Exchanger: &aghtest.Exchanger{ OnExchange: func(_ netip.Addr) (_ string, _ time.Duration, _ error) { panic("not implemented") }, }, PrivateSubnets: netutil.SubnetSetFunc(netutil.IsLocallyServed), AddressUpdater: &aghtest.AddressUpdater{ OnUpdateAddress: newOnUpdateAddress(tc.wantUpd, updIPCh, updHostCh, updInfoCh), }, CatchPanics: false, UseRDNS: false, UsePrivateRDNS: false, UseWHOIS: true, }) testutil.CleanupAndRequireSuccess(t, p.Close) p.Process(testIP) if !tc.wantUpd { return } gotIP, _ := testutil.RequireReceive(t, updIPCh, testTimeout) assert.Equal(t, testIP, gotIP) gotHost, _ := testutil.RequireReceive(t, updHostCh, testTimeout) assert.Empty(t, gotHost) gotInfo, _ := testutil.RequireReceive(t, updInfoCh, testTimeout) assert.Equal(t, tc.wantInfo, gotInfo) }) } } func TestDefaultAddrProc_Close(t *testing.T) { t.Parallel() p := client.NewDefaultAddrProc(&client.DefaultAddrProcConfig{}) err := p.Close() assert.NoError(t, err) err = p.Close() assert.ErrorIs(t, err, client.ErrClosed) } ```
/content/code_sandbox/internal/client/addrproc_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,897
```go package client import ( "net/netip" "testing" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestPersistent_EqualIDs(t *testing.T) { const ( ip = "0.0.0.0" ip1 = "1.1.1.1" ip2 = "2.2.2.2" cidr = "0.0.0.0/0" cidr1 = "1.1.1.1/11" cidr2 = "2.2.2.2/22" mac = "00-00-00-00-00-00" mac1 = "11-11-11-11-11-11" mac2 = "22-22-22-22-22-22" cli = "client0" cli1 = "client1" cli2 = "client2" ) testCases := []struct { want assert.BoolAssertionFunc name string ids []string prevIDs []string }{{ name: "single_ip", ids: []string{ip1}, prevIDs: []string{ip1}, want: assert.True, }, { name: "single_ip_not_equal", ids: []string{ip1}, prevIDs: []string{ip2}, want: assert.False, }, { name: "ips_not_equal", ids: []string{ip1, ip2}, prevIDs: []string{ip1, ip}, want: assert.False, }, { name: "ips_mixed_equal", ids: []string{ip1, ip2}, prevIDs: []string{ip2, ip1}, want: assert.True, }, { name: "single_subnet", ids: []string{cidr1}, prevIDs: []string{cidr1}, want: assert.True, }, { name: "subnets_not_equal", ids: []string{ip1, ip2, cidr1, cidr2}, prevIDs: []string{ip1, ip2, cidr1, cidr}, want: assert.False, }, { name: "subnets_mixed_equal", ids: []string{ip1, ip2, cidr1, cidr2}, prevIDs: []string{cidr2, cidr1, ip2, ip1}, want: assert.True, }, { name: "single_mac", ids: []string{mac1}, prevIDs: []string{mac1}, want: assert.True, }, { name: "single_mac_not_equal", ids: []string{mac1}, prevIDs: []string{mac2}, want: assert.False, }, { name: "macs_not_equal", ids: []string{ip1, ip2, cidr1, cidr2, mac1, mac2}, prevIDs: []string{ip1, ip2, cidr1, cidr2, mac1, mac}, want: assert.False, }, { name: "macs_mixed_equal", ids: []string{ip1, ip2, cidr1, cidr2, mac1, mac2}, prevIDs: []string{mac2, mac1, cidr2, cidr1, ip2, ip1}, want: assert.True, }, { name: "single_client_id", ids: []string{cli1}, prevIDs: []string{cli1}, want: assert.True, }, { name: "single_client_id_not_equal", ids: []string{cli1}, prevIDs: []string{cli2}, want: assert.False, }, { name: "client_ids_not_equal", ids: []string{ip1, ip2, cidr1, cidr2, mac1, mac2, cli1, cli2}, prevIDs: []string{ip1, ip2, cidr1, cidr2, mac1, mac2, cli1, cli}, want: assert.False, }, { name: "client_ids_mixed_equal", ids: []string{ip1, ip2, cidr1, cidr2, mac1, mac2, cli1, cli2}, prevIDs: []string{cli2, cli1, mac2, mac1, cidr2, cidr1, ip2, ip1}, want: assert.True, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { c := &Persistent{} err := c.SetIDs(tc.ids) require.NoError(t, err) prev := &Persistent{} err = prev.SetIDs(tc.prevIDs) require.NoError(t, err) tc.want(t, c.EqualIDs(prev)) }) } } func TestPersistent_Validate(t *testing.T) { const ( allowedTag = "allowed_tag" notAllowedTag = "not_allowed_tag" ) allowedTags := container.NewMapSet(allowedTag) testCases := []struct { name string cli *Persistent wantErrMsg string }{{ name: "success", cli: &Persistent{ Name: "basic", IPs: []netip.Addr{ netip.MustParseAddr("1.2.3.4"), }, UID: MustNewUID(), }, wantErrMsg: "", }, { name: "empty_name", cli: &Persistent{ Name: "", }, wantErrMsg: "empty name", }, { name: "no_id", cli: &Persistent{ Name: "no_id", }, wantErrMsg: "id required", }, { name: "no_uid", cli: &Persistent{ Name: "no_uid", IPs: []netip.Addr{ netip.MustParseAddr("1.2.3.4"), }, }, wantErrMsg: "uid required", }, { name: "not_allowed_tag", cli: &Persistent{ Name: "basic", IPs: []netip.Addr{ netip.MustParseAddr("1.2.3.4"), }, UID: MustNewUID(), Tags: []string{ notAllowedTag, }, }, wantErrMsg: `invalid tag: "` + notAllowedTag + `"`, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { err := tc.cli.validate(allowedTags) testutil.AssertErrorMsg(t, tc.wantErrMsg, err) }) } } ```
/content/code_sandbox/internal/client/persistent_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,586
```go package client import ( "fmt" "net" "net/netip" "slices" "strings" "github.com/AdguardTeam/AdGuardHome/internal/aghalg" "github.com/AdguardTeam/golibs/errors" "golang.org/x/exp/maps" ) // macKey contains MAC as byte array of 6, 8, or 20 bytes. type macKey any // macToKey converts mac into key of type macKey, which is used as the key of // the [clientIndex.macToUID]. mac must be valid MAC address. func macToKey(mac net.HardwareAddr) (key macKey) { switch len(mac) { case 6: return [6]byte(mac) case 8: return [8]byte(mac) case 20: return [20]byte(mac) default: panic(fmt.Errorf("invalid mac address %#v", mac)) } } // index stores all information about persistent clients. type index struct { // nameToUID maps client name to UID. nameToUID map[string]UID // clientIDToUID maps client ID to UID. clientIDToUID map[string]UID // ipToUID maps IP address to UID. ipToUID map[netip.Addr]UID // macToUID maps MAC address to UID. macToUID map[macKey]UID // uidToClient maps UID to the persistent client. uidToClient map[UID]*Persistent // subnetToUID maps subnet to UID. subnetToUID aghalg.SortedMap[netip.Prefix, UID] } // newIndex initializes the new instance of client index. func newIndex() (ci *index) { return &index{ nameToUID: map[string]UID{}, clientIDToUID: map[string]UID{}, ipToUID: map[netip.Addr]UID{}, subnetToUID: aghalg.NewSortedMap[netip.Prefix, UID](subnetCompare), macToUID: map[macKey]UID{}, uidToClient: map[UID]*Persistent{}, } } // add stores information about a persistent client in the index. c must be // non-nil, have a UID, and contain at least one identifier. func (ci *index) add(c *Persistent) { if (c.UID == UID{}) { panic("client must contain uid") } ci.nameToUID[c.Name] = c.UID for _, id := range c.ClientIDs { ci.clientIDToUID[id] = c.UID } for _, ip := range c.IPs { ci.ipToUID[ip] = c.UID } for _, pref := range c.Subnets { ci.subnetToUID.Set(pref, c.UID) } for _, mac := range c.MACs { k := macToKey(mac) ci.macToUID[k] = c.UID } ci.uidToClient[c.UID] = c } // clashesUID returns existing persistent client with the same UID as c. Note // that this is only possible when configuration contains duplicate fields. func (ci *index) clashesUID(c *Persistent) (err error) { p, ok := ci.uidToClient[c.UID] if ok { return fmt.Errorf("another client %q uses the same uid", p.Name) } return nil } // clashes returns an error if the index contains a different persistent client // with at least a single identifier contained by c. c must be non-nil. func (ci *index) clashes(c *Persistent) (err error) { if p := ci.clashesName(c); p != nil { return fmt.Errorf("another client uses the same name %q", p.Name) } for _, id := range c.ClientIDs { existing, ok := ci.clientIDToUID[id] if ok && existing != c.UID { p := ci.uidToClient[existing] return fmt.Errorf("another client %q uses the same ClientID %q", p.Name, id) } } p, ip := ci.clashesIP(c) if p != nil { return fmt.Errorf("another client %q uses the same IP %q", p.Name, ip) } p, s := ci.clashesSubnet(c) if p != nil { return fmt.Errorf("another client %q uses the same subnet %q", p.Name, s) } p, mac := ci.clashesMAC(c) if p != nil { return fmt.Errorf("another client %q uses the same MAC %q", p.Name, mac) } return nil } // clashesName returns existing persistent client with the same name as c or // nil. c must be non-nil. func (ci *index) clashesName(c *Persistent) (existing *Persistent) { existing, ok := ci.findByName(c.Name) if !ok { return nil } if existing.UID != c.UID { return existing } return nil } // clashesIP returns a previous client with the same IP address as c. c must be // non-nil. func (ci *index) clashesIP(c *Persistent) (p *Persistent, ip netip.Addr) { for _, ip := range c.IPs { existing, ok := ci.ipToUID[ip] if ok && existing != c.UID { return ci.uidToClient[existing], ip } } return nil, netip.Addr{} } // clashesSubnet returns a previous client with the same subnet as c. c must be // non-nil. func (ci *index) clashesSubnet(c *Persistent) (p *Persistent, s netip.Prefix) { for _, s = range c.Subnets { var existing UID var ok bool ci.subnetToUID.Range(func(p netip.Prefix, uid UID) (cont bool) { if s == p { existing = uid ok = true return false } return true }) if ok && existing != c.UID { return ci.uidToClient[existing], s } } return nil, netip.Prefix{} } // clashesMAC returns a previous client with the same MAC address as c. c must // be non-nil. func (ci *index) clashesMAC(c *Persistent) (p *Persistent, mac net.HardwareAddr) { for _, mac = range c.MACs { k := macToKey(mac) existing, ok := ci.macToUID[k] if ok && existing != c.UID { return ci.uidToClient[existing], mac } } return nil, nil } // find finds persistent client by string representation of the client ID, IP // address, or MAC. func (ci *index) find(id string) (c *Persistent, ok bool) { uid, found := ci.clientIDToUID[id] if found { return ci.uidToClient[uid], true } ip, err := netip.ParseAddr(id) if err == nil { // MAC addresses can be successfully parsed as IP addresses. c, found = ci.findByIP(ip) if found { return c, true } } mac, err := net.ParseMAC(id) if err == nil { return ci.findByMAC(mac) } return nil, false } // findByName finds persistent client by name. func (ci *index) findByName(name string) (c *Persistent, found bool) { uid, found := ci.nameToUID[name] if found { return ci.uidToClient[uid], true } return nil, false } // findByIP finds persistent client by IP address. func (ci *index) findByIP(ip netip.Addr) (c *Persistent, found bool) { uid, found := ci.ipToUID[ip] if found { return ci.uidToClient[uid], true } ipWithoutZone := ip.WithZone("") ci.subnetToUID.Range(func(pref netip.Prefix, id UID) (cont bool) { // Remove zone before checking because prefixes strip zones. if pref.Contains(ipWithoutZone) { uid, found = id, true return false } return true }) if found { return ci.uidToClient[uid], true } return nil, false } // findByMAC finds persistent client by MAC. func (ci *index) findByMAC(mac net.HardwareAddr) (c *Persistent, found bool) { k := macToKey(mac) uid, found := ci.macToUID[k] if found { return ci.uidToClient[uid], true } return nil, false } // findByIPWithoutZone finds a persistent client by IP address without zone. It // strips the IPv6 zone index from the stored IP addresses before comparing, // because querylog entries don't have it. See TODO on [querylog.logEntry.IP]. // // Note that multiple clients can have the same IP address with different zones. // Therefore, the result of this method is indeterminate. func (ci *index) findByIPWithoutZone(ip netip.Addr) (c *Persistent) { if (ip == netip.Addr{}) { return nil } for addr, uid := range ci.ipToUID { if addr.WithZone("") == ip { return ci.uidToClient[uid] } } return nil } // remove removes information about persistent client from the index. c must be // non-nil. func (ci *index) remove(c *Persistent) { delete(ci.nameToUID, c.Name) for _, id := range c.ClientIDs { delete(ci.clientIDToUID, id) } for _, ip := range c.IPs { delete(ci.ipToUID, ip) } for _, pref := range c.Subnets { ci.subnetToUID.Del(pref) } for _, mac := range c.MACs { k := macToKey(mac) delete(ci.macToUID, k) } delete(ci.uidToClient, c.UID) } // size returns the number of persistent clients. func (ci *index) size() (n int) { return len(ci.uidToClient) } // rangeByName is like [Index.Range] but sorts the persistent clients by name // before iterating ensuring a predictable order. func (ci *index) rangeByName(f func(c *Persistent) (cont bool)) { cs := maps.Values(ci.uidToClient) slices.SortFunc(cs, func(a, b *Persistent) (n int) { return strings.Compare(a.Name, b.Name) }) for _, c := range cs { if !f(c) { break } } } // closeUpstreams closes upstream configurations of persistent clients. func (ci *index) closeUpstreams() (err error) { var errs []error ci.rangeByName(func(c *Persistent) (cont bool) { err = c.CloseUpstreams() if err != nil { errs = append(errs, err) } return true }) return errors.Join(errs...) } ```
/content/code_sandbox/internal/client/index.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,418
```go package client import ( "fmt" "net" "net/netip" "slices" "sync" "github.com/AdguardTeam/golibs/container" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ) // Config is the client storage configuration structure. // // TODO(s.chzhen): Expand. type Config struct { // AllowedTags is a list of all allowed client tags. AllowedTags []string } // Storage contains information about persistent and runtime clients. type Storage struct { // allowedTags is a set of all allowed tags. allowedTags *container.MapSet[string] // mu protects indexes of persistent and runtime clients. mu *sync.Mutex // index contains information about persistent clients. index *index // runtimeIndex contains information about runtime clients. runtimeIndex *RuntimeIndex } // NewStorage returns initialized client storage. conf must not be nil. func NewStorage(conf *Config) (s *Storage) { allowedTags := container.NewMapSet(conf.AllowedTags...) return &Storage{ allowedTags: allowedTags, mu: &sync.Mutex{}, index: newIndex(), runtimeIndex: NewRuntimeIndex(), } } // Add stores persistent client information or returns an error. func (s *Storage) Add(p *Persistent) (err error) { defer func() { err = errors.Annotate(err, "adding client: %w") }() err = p.validate(s.allowedTags) if err != nil { // Don't wrap the error since there is already an annotation deferred. return err } s.mu.Lock() defer s.mu.Unlock() err = s.index.clashesUID(p) if err != nil { // Don't wrap the error since there is already an annotation deferred. return err } err = s.index.clashes(p) if err != nil { // Don't wrap the error since there is already an annotation deferred. return err } s.index.add(p) log.Debug("client storage: added %q: IDs: %q [%d]", p.Name, p.IDs(), s.index.size()) return nil } // FindByName finds persistent client by name. And returns its shallow copy. func (s *Storage) FindByName(name string) (p *Persistent, ok bool) { s.mu.Lock() defer s.mu.Unlock() p, ok = s.index.findByName(name) if ok { return p.ShallowClone(), ok } return nil, false } // Find finds persistent client by string representation of the client ID, IP // address, or MAC. And returns its shallow copy. func (s *Storage) Find(id string) (p *Persistent, ok bool) { s.mu.Lock() defer s.mu.Unlock() p, ok = s.index.find(id) if ok { return p.ShallowClone(), ok } return nil, false } // FindLoose is like [Storage.Find] but it also tries to find a persistent // client by IP address without zone. It strips the IPv6 zone index from the // stored IP addresses before comparing, because querylog entries don't have it. // See TODO on [querylog.logEntry.IP]. // // Note that multiple clients can have the same IP address with different zones. // Therefore, the result of this method is indeterminate. func (s *Storage) FindLoose(ip netip.Addr, id string) (p *Persistent, ok bool) { s.mu.Lock() defer s.mu.Unlock() p, ok = s.index.find(id) if ok { return p.ShallowClone(), ok } p = s.index.findByIPWithoutZone(ip) if p != nil { return p.ShallowClone(), true } return nil, false } // FindByMAC finds persistent client by MAC and returns its shallow copy. func (s *Storage) FindByMAC(mac net.HardwareAddr) (p *Persistent, ok bool) { s.mu.Lock() defer s.mu.Unlock() p, ok = s.index.findByMAC(mac) if ok { return p.ShallowClone(), ok } return nil, false } // RemoveByName removes persistent client information. ok is false if no such // client exists by that name. func (s *Storage) RemoveByName(name string) (ok bool) { s.mu.Lock() defer s.mu.Unlock() p, ok := s.index.findByName(name) if !ok { return false } if err := p.CloseUpstreams(); err != nil { log.Error("client storage: removing client %q: %s", p.Name, err) } s.index.remove(p) return true } // Update finds the stored persistent client by its name and updates its // information from p. func (s *Storage) Update(name string, p *Persistent) (err error) { defer func() { err = errors.Annotate(err, "updating client: %w") }() err = p.validate(s.allowedTags) if err != nil { // Don't wrap the error since there is already an annotation deferred. return err } s.mu.Lock() defer s.mu.Unlock() stored, ok := s.index.findByName(name) if !ok { return fmt.Errorf("client %q is not found", name) } // Client p has a newly generated UID, so replace it with the stored one. // // TODO(s.chzhen): Remove when frontend starts handling UIDs. p.UID = stored.UID err = s.index.clashes(p) if err != nil { // Don't wrap the error since there is already an annotation deferred. return err } s.index.remove(stored) s.index.add(p) return nil } // RangeByName calls f for each persistent client sorted by name, unless cont is // false. func (s *Storage) RangeByName(f func(c *Persistent) (cont bool)) { s.mu.Lock() defer s.mu.Unlock() s.index.rangeByName(f) } // Size returns the number of persistent clients. func (s *Storage) Size() (n int) { s.mu.Lock() defer s.mu.Unlock() return s.index.size() } // CloseUpstreams closes upstream configurations of persistent clients. func (s *Storage) CloseUpstreams() (err error) { s.mu.Lock() defer s.mu.Unlock() return s.index.closeUpstreams() } // ClientRuntime returns a copy of the saved runtime client by ip. If no such // client exists, returns nil. // // TODO(s.chzhen): Use it. func (s *Storage) ClientRuntime(ip netip.Addr) (rc *Runtime) { s.mu.Lock() defer s.mu.Unlock() return s.runtimeIndex.Client(ip) } // UpdateRuntime updates the stored runtime client with information from rc. If // no such client exists, saves the copy of rc in storage. rc must not be nil. func (s *Storage) UpdateRuntime(rc *Runtime) (added bool) { s.mu.Lock() defer s.mu.Unlock() return s.updateRuntimeLocked(rc) } // updateRuntimeLocked updates the stored runtime client with information from // rc. rc must not be nil. Storage.mu is expected to be locked. func (s *Storage) updateRuntimeLocked(rc *Runtime) (added bool) { stored := s.runtimeIndex.Client(rc.ip) if stored == nil { s.runtimeIndex.Add(rc.Clone()) return true } if rc.whois != nil { stored.whois = rc.whois.Clone() } if rc.arp != nil { stored.arp = slices.Clone(rc.arp) } if rc.rdns != nil { stored.rdns = slices.Clone(rc.rdns) } if rc.dhcp != nil { stored.dhcp = slices.Clone(rc.dhcp) } if rc.hostsFile != nil { stored.hostsFile = slices.Clone(rc.hostsFile) } return false } // BatchUpdateBySource updates the stored runtime clients information from the // specified source and returns the number of added and removed clients. func (s *Storage) BatchUpdateBySource(src Source, rcs []*Runtime) (added, removed int) { s.mu.Lock() defer s.mu.Unlock() for _, rc := range s.runtimeIndex.index { rc.unset(src) } for _, rc := range rcs { if s.updateRuntimeLocked(rc) { added++ } } for ip, rc := range s.runtimeIndex.index { if rc.isEmpty() { delete(s.runtimeIndex.index, ip) removed++ } } return added, removed } // SizeRuntime returns the number of the runtime clients. func (s *Storage) SizeRuntime() (n int) { s.mu.Lock() defer s.mu.Unlock() return s.runtimeIndex.Size() } // RangeRuntime calls f for each runtime client in an undefined order. func (s *Storage) RangeRuntime(f func(rc *Runtime) (cont bool)) { s.mu.Lock() defer s.mu.Unlock() s.runtimeIndex.Range(f) } // DeleteBySource removes all runtime clients that have information only from // the specified source and returns the number of removed clients. // // TODO(s.chzhen): Use it. func (s *Storage) DeleteBySource(src Source) (n int) { s.mu.Lock() defer s.mu.Unlock() return s.runtimeIndex.DeleteBySource(src) } ```
/content/code_sandbox/internal/client/storage.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,013
```go package rdns_test import ( "net/netip" "testing" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghtest" "github.com/AdguardTeam/AdGuardHome/internal/rdns" "github.com/AdguardTeam/golibs/netutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDefault_Process(t *testing.T) { ip1 := netip.MustParseAddr("1.2.3.4") revAddr1, err := netutil.IPToReversedAddr(ip1.AsSlice()) require.NoError(t, err) ip2 := netip.MustParseAddr("4.3.2.1") revAddr2, err := netutil.IPToReversedAddr(ip2.AsSlice()) require.NoError(t, err) localIP := netip.MustParseAddr("192.168.0.1") localRevAddr1, err := netutil.IPToReversedAddr(localIP.AsSlice()) require.NoError(t, err) testCases := []struct { name string addr netip.Addr want string }{{ name: "first", addr: ip1, want: revAddr1, }, { name: "second", addr: ip2, want: revAddr2, }, { name: "empty", addr: netip.MustParseAddr("0.0.0.0"), want: "", }, { name: "private", addr: localIP, want: localRevAddr1, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { hit := 0 onExchange := func(ip netip.Addr) (host string, ttl time.Duration, err error) { hit++ switch ip { case ip1: return revAddr1, time.Hour, nil case ip2: return revAddr2, time.Hour, nil case localIP: return localRevAddr1, time.Hour, nil default: return "", time.Hour, nil } } r := rdns.New(&rdns.Config{ CacheSize: 100, CacheTTL: time.Hour, Exchanger: &aghtest.Exchanger{OnExchange: onExchange}, }) got, changed := r.Process(tc.addr) require.True(t, changed) assert.Equal(t, tc.want, got) assert.Equal(t, 1, hit) // From cache. got, changed = r.Process(tc.addr) require.False(t, changed) assert.Equal(t, tc.want, got) assert.Equal(t, 1, hit) }) } t.Run("zero_ttl", func(t *testing.T) { const cacheTTL = time.Second / 2 zeroTTLExchanger := &aghtest.Exchanger{ OnExchange: func(ip netip.Addr) (host string, ttl time.Duration, err error) { return revAddr1, 0, nil }, } r := rdns.New(&rdns.Config{ CacheSize: 1, CacheTTL: cacheTTL, Exchanger: zeroTTLExchanger, }) got, changed := r.Process(ip1) require.True(t, changed) assert.Equal(t, revAddr1, got) zeroTTLExchanger.OnExchange = func(ip netip.Addr) (host string, ttl time.Duration, err error) { return revAddr2, time.Hour, nil } require.EventuallyWithT(t, func(t *assert.CollectT) { got, changed = r.Process(ip1) assert.True(t, changed) assert.Equal(t, revAddr2, got) }, 2*cacheTTL, time.Millisecond*100) assert.Never(t, func() (changed bool) { _, changed = r.Process(ip1) return changed }, 2*cacheTTL, time.Millisecond*100) }) } ```
/content/code_sandbox/internal/rdns/rdns_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
893
```go // Package rdns processes reverse DNS lookup queries. package rdns import ( "net/netip" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/bluele/gcache" ) // Interface processes rDNS queries. type Interface interface { // Process makes rDNS request and returns domain name. changed indicates // that domain name was updated since last request. Process(ip netip.Addr) (host string, changed bool) } // Empty is an empty [Interface] implementation which does nothing. type Empty struct{} // type check var _ Interface = (*Empty)(nil) // Process implements the [Interface] interface for Empty. func (Empty) Process(_ netip.Addr) (host string, changed bool) { return "", false } // Exchanger is a resolver for clients' addresses. type Exchanger interface { // Exchange tries to resolve the ip in a suitable way, i.e. either as local // or as external. Exchange(ip netip.Addr) (host string, ttl time.Duration, err error) } // Config is the configuration structure for Default. type Config struct { // Exchanger resolves IP addresses to domain names. Exchanger Exchanger // CacheSize is the maximum size of the cache. It must be greater than // zero. CacheSize int // CacheTTL is the Time to Live duration for cached IP addresses. CacheTTL time.Duration } // Default is the default rDNS query processor. type Default struct { // cache is the cache containing IP addresses of clients. An active IP // address is resolved once again after it expires. If IP address couldn't // be resolved, it stays here for some time to prevent further attempts to // resolve the same IP. cache gcache.Cache // exchanger resolves IP addresses to domain names. exchanger Exchanger // cacheTTL is the Time to Live duration for cached IP addresses. cacheTTL time.Duration } // New returns a new default rDNS query processor. conf must not be nil. func New(conf *Config) (r *Default) { return &Default{ cache: gcache.New(conf.CacheSize).LRU().Build(), exchanger: conf.Exchanger, cacheTTL: conf.CacheTTL, } } // type check var _ Interface = (*Default)(nil) // Process implements the [Interface] interface for Default. func (r *Default) Process(ip netip.Addr) (host string, changed bool) { fromCache, expired := r.findInCache(ip) if !expired { return fromCache, false } host, ttl, err := r.exchanger.Exchange(ip) if err != nil { log.Debug("rdns: resolving %q: %s", ip, err) } ttl = max(ttl, r.cacheTTL) item := &cacheItem{ expiry: time.Now().Add(ttl), host: host, } err = r.cache.Set(ip, item) if err != nil { log.Debug("rdns: cache: adding item %q: %s", ip, err) } // TODO(e.burkov): The name doesn't change if it's neither stored in cache // nor resolved successfully. Is it correct? return host, fromCache == "" || host != fromCache } // findInCache finds domain name in the cache. expired is true if host is not // valid anymore. func (r *Default) findInCache(ip netip.Addr) (host string, expired bool) { val, err := r.cache.Get(ip) if err != nil { if !errors.Is(err, gcache.KeyNotFoundError) { log.Debug("rdns: cache: retrieving %q: %s", ip, err) } return "", true } item, ok := val.(*cacheItem) if !ok { log.Debug("rdns: cache: %q bad type %T", ip, val) return "", true } return item.host, time.Now().After(item.expiry) } // cacheItem represents an item that we will store in the cache. type cacheItem struct { // expiry is the time when cacheItem will expire. expiry time.Time // host is the domain name of a runtime client. host string } ```
/content/code_sandbox/internal/rdns/rdns.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
941
```go //go:build freebsd || openbsd package dhcpd import ( "net" ) // broadcast sends resp to the broadcast address specific for network interface. func (c *dhcpConn) broadcast(respData []byte, peer *net.UDPAddr) (n int, err error) { // Despite the fact that server4.NewIPv4UDPConn explicitly sets socket // options to allow broadcasting, it also binds the connection to a specific // interface. On FreeBSD and OpenBSD net.UDPConn.WriteTo causes errors // while writing to the addresses that belong to another interface. So, use // the broadcast address specific for the interface bound. peer.IP = c.bcastIP return c.udpConn.WriteTo(respData, peer) } ```
/content/code_sandbox/internal/dhcpd/broadcast_bsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
165
```go //go:build freebsd || openbsd package dhcpd import ( "bytes" "net" "testing" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDHCPConn_Broadcast(t *testing.T) { b := &bytes.Buffer{} var peer *net.UDPAddr udpConn := &fakePacketConn{ writeTo: func(p []byte, addr net.Addr) (n int, err error) { udpPeer, ok := addr.(*net.UDPAddr) require.True(t, ok) peer = cloneUDPAddr(udpPeer) n, err = b.Write(p) require.NoError(t, err) return n, nil }, } conn := &dhcpConn{ udpConn: udpConn, bcastIP: net.IP{1, 2, 3, 255}, } defaultPeer := &net.UDPAddr{ IP: net.IP{1, 2, 3, 4}, // Use neither client nor server port. Port: 1234, } respData := (&dhcpv4.DHCPv4{}).ToBytes() _, _ = conn.broadcast(respData, cloneUDPAddr(defaultPeer)) assert.EqualValues(t, respData, b.Bytes()) assert.Equal(t, &net.UDPAddr{ IP: conn.bcastIP, Port: defaultPeer.Port, }, peer) } ```
/content/code_sandbox/internal/dhcpd/broadcast_bsd_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
331
```go package dhcpd const bitsPerWord = 64 // bitSet is a sparse bitSet. A nil *bitSet is an empty bitSet. type bitSet struct { words map[uint64]uint64 } // newBitSet returns a new bitset. func newBitSet() (s *bitSet) { return &bitSet{ words: map[uint64]uint64{}, } } // isSet returns true if the bit n is set. func (s *bitSet) isSet(n uint64) (ok bool) { if s == nil { return false } wordIdx := n / bitsPerWord bitIdx := n % bitsPerWord var word uint64 word, ok = s.words[wordIdx] return ok && word&(1<<bitIdx) != 0 } // set sets or unsets a bit. func (s *bitSet) set(n uint64, ok bool) { if s == nil { return } wordIdx := n / bitsPerWord bitIdx := n % bitsPerWord word := s.words[wordIdx] if ok { word |= 1 << bitIdx } else { word &^= 1 << bitIdx } s.words[wordIdx] = word } ```
/content/code_sandbox/internal/dhcpd/bitset.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
278
```go package dhcpd import ( "net" "testing" "github.com/AdguardTeam/golibs/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNewIPRange(t *testing.T) { start4 := net.IP{0, 0, 0, 1} end4 := net.IP{0, 0, 0, 3} start6 := net.IP{ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, } end6 := net.IP{ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, } end6Large := net.IP{ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, } testCases := []struct { name string wantErrMsg string start net.IP end net.IP }{{ name: "success_ipv4", wantErrMsg: "", start: start4, end: end4, }, { name: "success_ipv6", wantErrMsg: "", start: start6, end: end6, }, { name: "start_gt_end", wantErrMsg: "invalid ip range: start is greater than or equal to end", start: end4, end: start4, }, { name: "start_eq_end", wantErrMsg: "invalid ip range: start is greater than or equal to end", start: start4, end: start4, }, { name: "too_large", wantErrMsg: "invalid ip range: range is too large", start: start6, end: end6Large, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { _, err := newIPRange(tc.start, tc.end) testutil.AssertErrorMsg(t, tc.wantErrMsg, err) }) } } func TestIPRange_Contains(t *testing.T) { start, end := net.IP{0, 0, 0, 1}, net.IP{0, 0, 0, 3} r, err := newIPRange(start, end) require.NoError(t, err) assert.True(t, r.contains(start)) assert.True(t, r.contains(net.IP{0, 0, 0, 2})) assert.True(t, r.contains(end)) assert.False(t, r.contains(net.IP{0, 0, 0, 0})) assert.False(t, r.contains(net.IP{0, 0, 0, 4})) } func TestIPRange_Find(t *testing.T) { start, end := net.IP{0, 0, 0, 1}, net.IP{0, 0, 0, 5} r, err := newIPRange(start, end) require.NoError(t, err) want := net.IPv4(0, 0, 0, 2) got := r.find(func(ip net.IP) (ok bool) { return ip[len(ip)-1]%2 == 0 }) assert.Equal(t, want, got) got = r.find(func(ip net.IP) (ok bool) { return ip[len(ip)-1]%10 == 0 }) assert.Nil(t, got) } func TestIPRange_Offset(t *testing.T) { start, end := net.IP{0, 0, 0, 1}, net.IP{0, 0, 0, 5} r, err := newIPRange(start, end) require.NoError(t, err) testCases := []struct { name string in net.IP wantOffset uint64 wantOK bool }{{ name: "in", in: net.IP{0, 0, 0, 2}, wantOffset: 1, wantOK: true, }, { name: "in_start", in: start, wantOffset: 0, wantOK: true, }, { name: "in_end", in: end, wantOffset: 4, wantOK: true, }, { name: "out_after", in: net.IP{0, 0, 0, 6}, wantOffset: 0, wantOK: false, }, { name: "out_before", in: net.IP{0, 0, 0, 0}, wantOffset: 0, wantOK: false, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { offset, ok := r.offset(tc.in) assert.Equal(t, tc.wantOffset, offset) assert.Equal(t, tc.wantOK, ok) }) } } ```
/content/code_sandbox/internal/dhcpd/iprange_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,269
```go package dhcpd import ( "encoding/json" "fmt" "net" "net/netip" "os" "path/filepath" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" ) const ( // leaseExpireStatic is used to define the Expiry field for static // leases. // // Deprecated: Remove it when migration of DHCP leases will be not needed. leaseExpireStatic = 1 // dbFilename contains saved leases. // // Deprecated: Use dataFilename. dbFilename = "leases.db" ) // leaseJSON is the structure of stored lease in a legacy database. // // Deprecated: Use [dbLease]. type leaseJSON struct { HWAddr []byte `json:"mac"` IP []byte `json:"ip"` Hostname string `json:"host"` Expiry int64 `json:"exp"` } // readOldDB reads the old database from the given path. func readOldDB(path string) (leases []*leaseJSON, err error) { // #nosec G304 -- Trust this path, since it's taken from the old file name // relative to the working directory and should generally be considered // safe. file, err := os.Open(path) if errors.Is(err, os.ErrNotExist) { // Nothing to migrate. return nil, nil } else if err != nil { // Don't wrap the error since it's informative enough as is. return nil, err } defer func() { err = errors.WithDeferred(err, file.Close()) }() leases = []*leaseJSON{} err = json.NewDecoder(file).Decode(&leases) if err != nil { return nil, fmt.Errorf("decoding old db: %w", err) } return leases, nil } // migrateDB migrates stored leases if necessary. func migrateDB(conf *ServerConfig) (err error) { defer func() { err = errors.Annotate(err, "migrating db: %w") }() oldLeasesPath := filepath.Join(conf.WorkDir, dbFilename) dataDirPath := filepath.Join(conf.DataDir, dataFilename) oldLeases, err := readOldDB(oldLeasesPath) if err != nil { // Don't wrap the error since it's informative enough as is. return err } else if oldLeases == nil { // Nothing to migrate. return nil } leases := make([]*dbLease, 0, len(oldLeases)) for _, l := range oldLeases { l.IP = normalizeIP(l.IP) ip, ok := netip.AddrFromSlice(l.IP) if !ok { log.Info("dhcp: invalid IP: %s", l.IP) continue } leases = append(leases, &dbLease{ Expiry: time.Unix(l.Expiry, 0).Format(time.RFC3339), Hostname: l.Hostname, HWAddr: net.HardwareAddr(l.HWAddr).String(), IP: ip, IsStatic: l.Expiry == leaseExpireStatic, }) } err = writeDB(dataDirPath, leases) if err != nil { // Don't wrap the error since an annotation deferred already. return err } return os.Remove(oldLeasesPath) } // normalizeIP converts the given IP address to IPv4 if it's IPv4-mapped IPv6, // or leaves it as is otherwise. func normalizeIP(ip net.IP) (normalized net.IP) { normalized = ip.To4() if normalized != nil { return normalized } return ip } ```
/content/code_sandbox/internal/dhcpd/migrate.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
808
```go package dhcpd import ( "net" "testing" "github.com/stretchr/testify/assert" ) func TestCreateICMPv6RAPacket(t *testing.T) { wantData := []byte{ 0x86, 0x00, 0x00, 0x00, 0x40, 0x40, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x40, 0xc0, 0x00, 0x00, 0x0e, 0x10, 0x00, 0x00, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x01, 0x01, 0x0a, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x27, 0xff, 0xfe, 0x00, 0x00, 0x00, } gotData, err := createICMPv6RAPacket(icmpv6RA{ managedAddressConfiguration: false, otherConfiguration: true, mtu: 1500, prefix: net.ParseIP("1234::"), prefixLen: 64, recursiveDNSServer: net.ParseIP("fe80::800:27ff:fe00:0"), sourceLinkLayerAddress: []byte{0x0a, 0x00, 0x27, 0x00, 0x00, 0x00}, }) assert.NoError(t, err) assert.Equal(t, wantData, gotData) } ```
/content/code_sandbox/internal/dhcpd/routeradv_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
656
```go //go:build darwin || linux package dhcpd import ( "bytes" "net" "testing" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDHCPConn_Broadcast(t *testing.T) { b := &bytes.Buffer{} var peers []*net.UDPAddr udpConn := &fakePacketConn{ writeTo: func(p []byte, addr net.Addr) (n int, err error) { udpPeer, ok := addr.(*net.UDPAddr) require.True(t, ok) peers = append(peers, cloneUDPAddr(udpPeer)) n, err = b.Write(p) require.NoError(t, err) return n, nil }, } conn := &dhcpConn{ udpConn: udpConn, bcastIP: net.IP{1, 2, 3, 255}, } defaultPeer := &net.UDPAddr{ IP: net.IP{1, 2, 3, 4}, // Use neither client nor server port. Port: 1234, } respData := (&dhcpv4.DHCPv4{}).ToBytes() _, _ = conn.broadcast(respData, cloneUDPAddr(defaultPeer)) // The same response is written twice but for different peers. assert.EqualValues(t, append(respData, respData...), b.Bytes()) require.Len(t, peers, 2) assert.Equal(t, cloneUDPAddr(defaultPeer), peers[0]) assert.Equal(t, &net.UDPAddr{ IP: conn.bcastIP, Port: defaultPeer.Port, }, peers[1]) } ```
/content/code_sandbox/internal/dhcpd/broadcast_others_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
378
```go // On-disk database for lease table package dhcpd import ( "encoding/json" "fmt" "net" "net/netip" "os" "slices" "strings" "time" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/google/renameio/v2/maybe" ) const ( // dataFilename contains saved leases. dataFilename = "leases.json" // dataVersion is the current version of the stored DHCP leases structure. dataVersion = 1 ) // dataLeases is the structure of the stored DHCP leases. type dataLeases struct { // Version is the current version of the structure. Version int `json:"version"` // Leases is the list containing stored DHCP leases. Leases []*dbLease `json:"leases"` } // dbLease is the structure of stored lease. type dbLease struct { Expiry string `json:"expires"` IP netip.Addr `json:"ip"` Hostname string `json:"hostname"` HWAddr string `json:"mac"` IsStatic bool `json:"static"` } // fromLease converts *dhcpsvc.Lease to *dbLease. func fromLease(l *dhcpsvc.Lease) (dl *dbLease) { var expiryStr string if !l.IsStatic { // The front-end is waiting for RFC 3999 format of the time value. It // also shouldn't got an Expiry field for static leases. // // See path_to_url expiryStr = l.Expiry.Format(time.RFC3339) } return &dbLease{ Expiry: expiryStr, Hostname: l.Hostname, HWAddr: l.HWAddr.String(), IP: l.IP, IsStatic: l.IsStatic, } } // toLease converts *dbLease to *dhcpsvc.Lease. func (dl *dbLease) toLease() (l *dhcpsvc.Lease, err error) { mac, err := net.ParseMAC(dl.HWAddr) if err != nil { return nil, fmt.Errorf("parsing hardware address: %w", err) } expiry := time.Time{} if !dl.IsStatic { expiry, err = time.Parse(time.RFC3339, dl.Expiry) if err != nil { return nil, fmt.Errorf("parsing expiry time: %w", err) } } return &dhcpsvc.Lease{ Expiry: expiry, IP: dl.IP, Hostname: dl.Hostname, HWAddr: mac, IsStatic: dl.IsStatic, }, nil } // dbLoad loads stored leases. func (s *server) dbLoad() (err error) { data, err := os.ReadFile(s.conf.dbFilePath) if err != nil { if !errors.Is(err, os.ErrNotExist) { return fmt.Errorf("reading db: %w", err) } return nil } dl := &dataLeases{} err = json.Unmarshal(data, dl) if err != nil { return fmt.Errorf("decoding db: %w", err) } leases := dl.Leases leases4 := []*dhcpsvc.Lease{} leases6 := []*dhcpsvc.Lease{} for _, l := range leases { var lease *dhcpsvc.Lease lease, err = l.toLease() if err != nil { log.Info("dhcp: invalid lease: %s", err) continue } if lease.IP.Is4() { leases4 = append(leases4, lease) } else { leases6 = append(leases6, lease) } } err = s.srv4.ResetLeases(leases4) if err != nil { return fmt.Errorf("resetting dhcpv4 leases: %w", err) } if s.srv6 != nil { err = s.srv6.ResetLeases(leases6) if err != nil { return fmt.Errorf("resetting dhcpv6 leases: %w", err) } } log.Info( "dhcp: loaded leases v4:%d v6:%d total-read:%d from DB", len(leases4), len(leases6), len(leases), ) return nil } // dbStore stores DHCP leases. func (s *server) dbStore() (err error) { // Use an empty slice here as opposed to nil so that it doesn't write // "null" into the database file if leases are empty. leases := []*dbLease{} for _, l := range s.srv4.getLeasesRef() { leases = append(leases, fromLease(l)) } if s.srv6 != nil { for _, l := range s.srv6.getLeasesRef() { leases = append(leases, fromLease(l)) } } return writeDB(s.conf.dbFilePath, leases) } // writeDB writes leases to file at path. func writeDB(path string, leases []*dbLease) (err error) { defer func() { err = errors.Annotate(err, "writing db: %w") }() slices.SortFunc(leases, func(a, b *dbLease) (res int) { return strings.Compare(a.Hostname, b.Hostname) }) dl := &dataLeases{ Version: dataVersion, Leases: leases, } buf, err := json.Marshal(dl) if err != nil { // Don't wrap the error since it's informative enough as is. return err } err = maybe.WriteFile(path, buf, 0o644) if err != nil { // Don't wrap the error since it's informative enough as is. return err } log.Info("dhcp: stored %d leases in %q", len(leases), path) return nil } ```
/content/code_sandbox/internal/dhcpd/db.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,348
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "fmt" "github.com/AdguardTeam/golibs/errors" ) // wrapErrs is a helper to wrap the errors from two independent underlying // connections. func wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { switch { case udpConnErr != nil && rawConnErr != nil: return fmt.Errorf("%s both connections: %s", action, errors.Join(udpConnErr, rawConnErr)) case udpConnErr != nil: return fmt.Errorf("%s udp connection: %w", action, udpConnErr) case rawConnErr != nil: return fmt.Errorf("%s raw connection: %w", action, rawConnErr) default: return nil } } ```
/content/code_sandbox/internal/dhcpd/conn_unix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
177
```go //go:build darwin || linux package dhcpd import ( "net" ) // broadcast sends resp to the broadcast address specific for network interface. func (c *dhcpConn) broadcast(respData []byte, peer *net.UDPAddr) (n int, err error) { // This write to 0xffffffff reverts some behavior changes made in // path_to_url The DHCP // server should broadcast the message to 0xffffffff but it's // inconsistent with the actual mental model of DHCP implementation // which requires the network interface selection to bind to. // // See path_to_url and // path_to_url // // See also path_to_url if n, err = c.udpConn.WriteTo(respData, peer); err != nil { return n, err } // Broadcast the message one more time using the interface-specific // broadcast address. peer.IP = c.bcastIP return c.udpConn.WriteTo(respData, peer) } ```
/content/code_sandbox/internal/dhcpd/broadcast_others.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
219
```go //go:build darwin || freebsd || openbsd package dhcpd import ( "net" "testing" "github.com/AdguardTeam/golibs/testutil" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" //lint:ignore SA1019 See the TODO in go.mod. "github.com/mdlayher/raw" ) func TestDHCPConn_WriteTo_common(t *testing.T) { respData := (&dhcpv4.DHCPv4{}).ToBytes() udpAddr := &net.UDPAddr{ IP: net.IP{1, 2, 3, 4}, Port: dhcpv4.ClientPort, } t.Run("unicast_ip", func(t *testing.T) { writeTo := func(_ []byte, addr net.Addr) (_ int, _ error) { assert.Equal(t, udpAddr, addr) return 0, nil } conn := &dhcpConn{udpConn: &fakePacketConn{writeTo: writeTo}} _, err := conn.WriteTo(respData, udpAddr) assert.NoError(t, err) }) t.Run("unexpected_addr_type", func(t *testing.T) { type unexpectedAddrType struct { net.Addr } conn := &dhcpConn{} n, err := conn.WriteTo(nil, &unexpectedAddrType{}) require.Error(t, err) testutil.AssertErrorMsg(t, "addr has an unexpected type *dhcpd.unexpectedAddrType", err) assert.Zero(t, n) }) } func TestBuildEtherPkt(t *testing.T) { conn := &dhcpConn{ srcMAC: net.HardwareAddr{1, 2, 3, 4, 5, 6}, srcIP: net.IP{1, 2, 3, 4}, } peer := &dhcpUnicastAddr{ Addr: raw.Addr{HardwareAddr: net.HardwareAddr{6, 5, 4, 3, 2, 1}}, yiaddr: net.IP{4, 3, 2, 1}, } payload := (&dhcpv4.DHCPv4{}).ToBytes() t.Run("success", func(t *testing.T) { pkt, err := conn.buildEtherPkt(payload, peer) require.NoError(t, err) assert.NotEmpty(t, pkt) actualPkt := gopacket.NewPacket(pkt, layers.LayerTypeEthernet, gopacket.DecodeOptions{ NoCopy: true, }) require.NotNil(t, actualPkt) wantTypes := []gopacket.LayerType{ layers.LayerTypeEthernet, layers.LayerTypeIPv4, layers.LayerTypeUDP, layers.LayerTypeDHCPv4, } actualLayers := actualPkt.Layers() require.Len(t, actualLayers, len(wantTypes)) for i, wantType := range wantTypes { layer := actualLayers[i] require.NotNil(t, layer) assert.Equal(t, wantType, layer.LayerType()) } }) t.Run("bad_payload", func(t *testing.T) { // Create an invalid DHCP packet. invalidPayload := []byte{1, 2, 3, 4} pkt, err := conn.buildEtherPkt(invalidPayload, peer) require.NoError(t, err) assert.NotEmpty(t, pkt) }) t.Run("serializing_error", func(t *testing.T) { // Create a peer with invalid MAC. badPeer := &dhcpUnicastAddr{ Addr: raw.Addr{HardwareAddr: net.HardwareAddr{5, 4, 3, 2, 1}}, yiaddr: net.IP{4, 3, 2, 1}, } pkt, err := conn.buildEtherPkt(payload, badPeer) require.Error(t, err) assert.Empty(t, pkt) }) } func TestV4Server_Send(t *testing.T) { s := &v4Server{} var ( defaultIP = net.IP{99, 99, 99, 99} knownIP = net.IP{4, 2, 4, 2} knownMAC = net.HardwareAddr{6, 5, 4, 3, 2, 1} ) defaultPeer := &net.UDPAddr{ IP: defaultIP, // Use neither client nor server port to check it actually // changed. Port: dhcpv4.ClientPort + dhcpv4.ServerPort, } defaultResp := &dhcpv4.DHCPv4{} testCases := []struct { want net.Addr req *dhcpv4.DHCPv4 resp *dhcpv4.DHCPv4 name string }{{ name: "giaddr", req: &dhcpv4.DHCPv4{GatewayIPAddr: knownIP}, resp: defaultResp, want: &net.UDPAddr{ IP: knownIP, Port: dhcpv4.ServerPort, }, }, { name: "nak", req: &dhcpv4.DHCPv4{}, resp: &dhcpv4.DHCPv4{ Options: dhcpv4.OptionsFromList( dhcpv4.OptMessageType(dhcpv4.MessageTypeNak), ), }, want: defaultPeer, }, { name: "ciaddr", req: &dhcpv4.DHCPv4{ClientIPAddr: knownIP}, resp: &dhcpv4.DHCPv4{}, want: &net.UDPAddr{ IP: knownIP, Port: dhcpv4.ClientPort, }, }, { name: "chaddr", req: &dhcpv4.DHCPv4{ClientHWAddr: knownMAC}, resp: &dhcpv4.DHCPv4{YourIPAddr: knownIP}, want: &dhcpUnicastAddr{ Addr: raw.Addr{HardwareAddr: knownMAC}, yiaddr: knownIP, }, }, { name: "who_are_you", req: &dhcpv4.DHCPv4{}, resp: &dhcpv4.DHCPv4{}, want: defaultPeer, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { conn := &fakePacketConn{ writeTo: func(_ []byte, addr net.Addr) (_ int, _ error) { assert.Equal(t, tc.want, addr) return 0, nil }, } s.send(cloneUDPAddr(defaultPeer), conn, tc.req, tc.resp) }) } t.Run("giaddr_nak", func(t *testing.T) { req := &dhcpv4.DHCPv4{ GatewayIPAddr: knownIP, } // Ensure the request is for unicast. req.SetUnicast() resp := &dhcpv4.DHCPv4{ Options: dhcpv4.OptionsFromList( dhcpv4.OptMessageType(dhcpv4.MessageTypeNak), ), } want := &net.UDPAddr{ IP: req.GatewayIPAddr, Port: dhcpv4.ServerPort, } conn := &fakePacketConn{ writeTo: func(_ []byte, addr net.Addr) (n int, err error) { assert.Equal(t, want, addr) return 0, nil }, } s.send(cloneUDPAddr(defaultPeer), conn, req, resp) assert.True(t, resp.IsBroadcast()) }) } ```
/content/code_sandbox/internal/dhcpd/conn_bsd_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,753
```go package dhcpd import ( "fmt" "math" "math/big" "net" "github.com/AdguardTeam/golibs/errors" ) // ipRange is an inclusive range of IP addresses. A nil range is a range that // doesn't contain any IP addresses. // // It is safe for concurrent use. // // TODO(a.garipov): Perhaps create an optimized version with uint32 for IPv4 // ranges? Or use one of uint128 packages? // // TODO(e.burkov): Use netip.Addr. type ipRange struct { start *big.Int end *big.Int } // maxRangeLen is the maximum IP range length. The bitsets used in servers only // accept uints, which can have the size of 32 bit. const maxRangeLen = math.MaxUint32 // newIPRange creates a new IP address range. start must be less than end. The // resulting range must not be greater than maxRangeLen. func newIPRange(start, end net.IP) (r *ipRange, err error) { defer func() { err = errors.Annotate(err, "invalid ip range: %w") }() // Make sure that both are 16 bytes long to simplify handling in // methods. start, end = start.To16(), end.To16() startInt := (&big.Int{}).SetBytes(start) endInt := (&big.Int{}).SetBytes(end) diff := (&big.Int{}).Sub(endInt, startInt) if diff.Sign() <= 0 { return nil, fmt.Errorf("start is greater than or equal to end") } else if !diff.IsUint64() || diff.Uint64() > maxRangeLen { return nil, fmt.Errorf("range is too large") } r = &ipRange{ start: startInt, end: endInt, } return r, nil } // contains returns true if r contains ip. func (r *ipRange) contains(ip net.IP) (ok bool) { if r == nil { return false } ipInt := (&big.Int{}).SetBytes(ip.To16()) return r.containsInt(ipInt) } // containsInt returns true if r contains ipInt. For internal use only. func (r *ipRange) containsInt(ipInt *big.Int) (ok bool) { return ipInt.Cmp(r.start) >= 0 && ipInt.Cmp(r.end) <= 0 } // ipPredicate is a function that is called on every IP address in // (*ipRange).find. ip is given in the 16-byte form. type ipPredicate func(ip net.IP) (ok bool) // find finds the first IP address in r for which p returns true. ip is in the // 16-byte form. func (r *ipRange) find(p ipPredicate) (ip net.IP) { if r == nil { return nil } ip = make(net.IP, net.IPv6len) _1 := big.NewInt(1) for i := (&big.Int{}).Set(r.start); i.Cmp(r.end) <= 0; i.Add(i, _1) { i.FillBytes(ip) if p(ip) { return ip } } return nil } // offset returns the offset of ip from the beginning of r. It returns 0 and // false if ip is not in r. func (r *ipRange) offset(ip net.IP) (offset uint64, ok bool) { if r == nil { return 0, false } ip = ip.To16() ipInt := (&big.Int{}).SetBytes(ip) if !r.containsInt(ipInt) { return 0, false } offsetInt := (&big.Int{}).Sub(ipInt, r.start) // Assume that the range was checked against maxRangeLen during // construction. return offsetInt.Uint64(), true } // String implements the fmt.Stringer interface for *ipRange. func (r *ipRange) String() (s string) { return fmt.Sprintf("%s-%s", r.start, r.end) } ```
/content/code_sandbox/internal/dhcpd/iprange.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
892
```go //go:build windows package dhcpd import ( "fmt" "net/http" "net/http/httptest" "testing" "github.com/AdguardTeam/AdGuardHome/internal/aghos" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestServer_notImplemented(t *testing.T) { s := &server{} w := httptest.NewRecorder() r, err := http.NewRequest(http.MethodGet, "/unsupported", nil) require.NoError(t, err) s.notImplemented(w, r) assert.Equal(t, http.StatusNotImplemented, w.Code) wantStr := fmt.Sprintf("{%q:%q}", "message", aghos.Unsupported("dhcp")) assert.JSONEq(t, wantStr, w.Body.String()) } ```
/content/code_sandbox/internal/dhcpd/http_windows_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
159
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "bytes" "fmt" "net" "net/netip" "sync" "time" "github.com/AdguardTeam/AdGuardHome/internal/aghnet" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/timeutil" "github.com/insomniacslk/dhcp/dhcpv6" "github.com/insomniacslk/dhcp/dhcpv6/server6" "github.com/insomniacslk/dhcp/iana" ) const valueIAID = "ADGH" // value for IANA.ID // v6Server is a DHCPv6 server. // // TODO(a.garipov): Think about unifying this and v4Server. type v6Server struct { ra raCtx conf V6ServerConf sid dhcpv6.DUID srv *server6.Server leases []*dhcpsvc.Lease leasesLock sync.Mutex ipAddrs [256]byte } // WriteDiskConfig4 - write configuration func (s *v6Server) WriteDiskConfig4(c *V4ServerConf) { } // WriteDiskConfig6 - write configuration func (s *v6Server) WriteDiskConfig6(c *V6ServerConf) { *c = s.conf } // Return TRUE if IP address is within range [start..0xff] func ip6InRange(start, ip net.IP) bool { if len(start) != 16 { return false } //lint:ignore SA1021 TODO(e.burkov): Ignore this for now, think about // using masks. if !bytes.Equal(start[:15], ip[:15]) { return false } return start[15] <= ip[15] } // HostByIP implements the [Interface] interface for *v6Server. func (s *v6Server) HostByIP(ip netip.Addr) (host string) { s.leasesLock.Lock() defer s.leasesLock.Unlock() for _, l := range s.leases { if l.IP == ip { return l.Hostname } } return "" } // IPByHost implements the [Interface] interface for *v6Server. func (s *v6Server) IPByHost(host string) (ip netip.Addr) { s.leasesLock.Lock() defer s.leasesLock.Unlock() for _, l := range s.leases { if l.Hostname == host { return l.IP } } return netip.Addr{} } // ResetLeases resets leases. func (s *v6Server) ResetLeases(leases []*dhcpsvc.Lease) (err error) { defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() s.leasesLock.Lock() defer s.leasesLock.Unlock() s.leases = nil for _, l := range leases { ip := net.IP(l.IP.AsSlice()) if !l.IsStatic && !ip6InRange(s.conf.ipStart, ip) { log.Debug("dhcpv6: skipping a lease with IP %v: not within current IP range", l.IP) continue } s.addLease(l) } return nil } // GetLeases returns the list of current DHCP leases. It is safe for concurrent // use. func (s *v6Server) GetLeases(flags GetLeasesFlags) (leases []*dhcpsvc.Lease) { // The function shouldn't return nil value because zero-length slice // behaves differently in cases like marshalling. Our front-end also // requires non-nil value in the response. leases = []*dhcpsvc.Lease{} s.leasesLock.Lock() defer s.leasesLock.Unlock() for _, l := range s.leases { if l.IsStatic { if (flags & LeasesStatic) != 0 { leases = append(leases, l.Clone()) } } else { if (flags & LeasesDynamic) != 0 { leases = append(leases, l.Clone()) } } } return leases } // getLeasesRef returns the actual leases slice. For internal use only. func (s *v6Server) getLeasesRef() []*dhcpsvc.Lease { return s.leases } // FindMACbyIP implements the [Interface] for *v6Server. func (s *v6Server) FindMACbyIP(ip netip.Addr) (mac net.HardwareAddr) { now := time.Now() s.leasesLock.Lock() defer s.leasesLock.Unlock() if !ip.Is6() { return nil } for _, l := range s.leases { if l.IP == ip { if l.IsStatic || l.Expiry.After(now) { return l.HWAddr } } } return nil } // Remove (swap) lease by index func (s *v6Server) leaseRemoveSwapByIndex(i int) { leaseIP := s.leases[i].IP.As16() s.ipAddrs[leaseIP[15]] = 0 log.Debug("dhcpv6: removed lease %s", s.leases[i].HWAddr) n := len(s.leases) if i != n-1 { s.leases[i] = s.leases[n-1] // swap with the last element } s.leases = s.leases[:n-1] } // Remove a dynamic lease with the same properties // Return error if a static lease is found func (s *v6Server) rmDynamicLease(lease *dhcpsvc.Lease) (err error) { for i := 0; i < len(s.leases); i++ { l := s.leases[i] if bytes.Equal(l.HWAddr, lease.HWAddr) { if l.IsStatic { return fmt.Errorf("static lease already exists") } s.leaseRemoveSwapByIndex(i) if i == len(s.leases) { break } l = s.leases[i] } if l.IP == lease.IP { if l.IsStatic { return fmt.Errorf("static lease already exists") } s.leaseRemoveSwapByIndex(i) } } return nil } // AddStaticLease adds a static lease. It is safe for concurrent use. func (s *v6Server) AddStaticLease(l *dhcpsvc.Lease) (err error) { defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() if !l.IP.Is6() { return fmt.Errorf("invalid IP") } err = netutil.ValidateMAC(l.HWAddr) if err != nil { return fmt.Errorf("validating lease: %w", err) } l.IsStatic = true s.leasesLock.Lock() err = s.rmDynamicLease(l) if err != nil { s.leasesLock.Unlock() return err } s.addLease(l) s.conf.notify(LeaseChangedDBStore) s.leasesLock.Unlock() s.conf.notify(LeaseChangedAddedStatic) return nil } // UpdateStaticLease updates IP, hostname of the static lease. func (s *v6Server) UpdateStaticLease(l *dhcpsvc.Lease) (err error) { defer func() { if err != nil { err = errors.Annotate(err, "dhcpv6: updating static lease: %w") return } s.conf.notify(LeaseChangedDBStore) s.conf.notify(LeaseChangedRemovedStatic) }() s.leasesLock.Lock() defer s.leasesLock.Unlock() found := s.findLease(l.HWAddr) if found == nil { return fmt.Errorf("can't find lease %s", l.HWAddr) } err = s.rmLease(found) if err != nil { return fmt.Errorf("removing previous lease for %s (%s): %w", l.IP, l.HWAddr, err) } s.addLease(l) return nil } // RemoveStaticLease removes a static lease. It is safe for concurrent use. func (s *v6Server) RemoveStaticLease(l *dhcpsvc.Lease) (err error) { defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() if !l.IP.Is6() { return fmt.Errorf("invalid IP") } err = netutil.ValidateMAC(l.HWAddr) if err != nil { return fmt.Errorf("validating lease: %w", err) } s.leasesLock.Lock() err = s.rmLease(l) if err != nil { s.leasesLock.Unlock() return err } s.conf.notify(LeaseChangedDBStore) s.leasesLock.Unlock() s.conf.notify(LeaseChangedRemovedStatic) return nil } // Add a lease func (s *v6Server) addLease(l *dhcpsvc.Lease) { s.leases = append(s.leases, l) ip := l.IP.As16() s.ipAddrs[ip[15]] = 1 log.Debug("dhcpv6: added lease %s <-> %s", l.IP, l.HWAddr) } // Remove a lease with the same properties func (s *v6Server) rmLease(lease *dhcpsvc.Lease) (err error) { for i, l := range s.leases { if l.IP == lease.IP { if !bytes.Equal(l.HWAddr, lease.HWAddr) || l.Hostname != lease.Hostname { return fmt.Errorf("lease not found") } s.leaseRemoveSwapByIndex(i) return nil } } return fmt.Errorf("lease not found") } // Find lease by MAC. func (s *v6Server) findLease(mac net.HardwareAddr) (lease *dhcpsvc.Lease) { for i := range s.leases { if bytes.Equal(mac, s.leases[i].HWAddr) { return s.leases[i] } } return nil } // Find an expired lease and return its index or -1 func (s *v6Server) findExpiredLease() int { now := time.Now().Unix() for i, lease := range s.leases { if !lease.IsStatic && lease.Expiry.Unix() <= now { return i } } return -1 } // Get next free IP func (s *v6Server) findFreeIP() net.IP { for i := s.conf.ipStart[15]; ; i++ { if s.ipAddrs[i] == 0 { ip := make([]byte, 16) copy(ip, s.conf.ipStart) ip[15] = i return ip } if i == 0xff { break } } return nil } // Reserve lease for MAC func (s *v6Server) reserveLease(mac net.HardwareAddr) *dhcpsvc.Lease { l := dhcpsvc.Lease{ HWAddr: make([]byte, len(mac)), } copy(l.HWAddr, mac) s.leasesLock.Lock() defer s.leasesLock.Unlock() ip := s.findFreeIP() if ip == nil { i := s.findExpiredLease() if i < 0 { return nil } copy(s.leases[i].HWAddr, mac) return s.leases[i] } netIP, ok := netip.AddrFromSlice(ip) if !ok { return nil } l.IP = netIP s.addLease(&l) return &l } func (s *v6Server) commitDynamicLease(l *dhcpsvc.Lease) { l.Expiry = time.Now().Add(s.conf.leaseTime) s.leasesLock.Lock() s.conf.notify(LeaseChangedDBStore) s.leasesLock.Unlock() s.conf.notify(LeaseChangedAdded) } // Check Client ID func (s *v6Server) checkCID(msg *dhcpv6.Message) error { if msg.Options.ClientID() == nil { return fmt.Errorf("dhcpv6: no ClientID option in request") } return nil } // Check ServerID policy func (s *v6Server) checkSID(msg *dhcpv6.Message) error { sid := msg.Options.ServerID() switch msg.Type() { case dhcpv6.MessageTypeSolicit, dhcpv6.MessageTypeConfirm, dhcpv6.MessageTypeRebind: if sid != nil { return fmt.Errorf("dhcpv6: drop packet: ServerID option in message %s", msg.Type().String()) } case dhcpv6.MessageTypeRequest, dhcpv6.MessageTypeRenew, dhcpv6.MessageTypeRelease, dhcpv6.MessageTypeDecline: if sid == nil { return fmt.Errorf("dhcpv6: drop packet: no ServerID option in message %s", msg.Type().String()) } if !sid.Equal(s.sid) { return fmt.Errorf("dhcpv6: drop packet: mismatched ServerID option in message %s: %s", msg.Type().String(), sid.String()) } } return nil } // . IAAddress must be equal to the lease's IP func (s *v6Server) checkIA(msg *dhcpv6.Message, lease *dhcpsvc.Lease) error { switch msg.Type() { case dhcpv6.MessageTypeRequest, dhcpv6.MessageTypeConfirm, dhcpv6.MessageTypeRenew, dhcpv6.MessageTypeRebind: oia := msg.Options.OneIANA() if oia == nil { return fmt.Errorf("no IANA option in %s", msg.Type().String()) } oiaAddr := oia.Options.OneAddress() if oiaAddr == nil { return fmt.Errorf("no IANA.Addr option in %s", msg.Type().String()) } leaseIP := net.IP(lease.IP.AsSlice()) if !oiaAddr.IPv6Addr.Equal(leaseIP) { return fmt.Errorf("invalid IANA.Addr option in %s", msg.Type().String()) } } return nil } // Store lease in DB (if necessary) and return lease life time func (s *v6Server) commitLease(msg *dhcpv6.Message, lease *dhcpsvc.Lease) time.Duration { lifetime := s.conf.leaseTime switch msg.Type() { case dhcpv6.MessageTypeSolicit: // case dhcpv6.MessageTypeConfirm: lifetime = time.Until(lease.Expiry) case dhcpv6.MessageTypeRequest, dhcpv6.MessageTypeRenew, dhcpv6.MessageTypeRebind: if !lease.IsStatic { s.commitDynamicLease(lease) } } return lifetime } // Find a lease associated with MAC and prepare response func (s *v6Server) process(msg *dhcpv6.Message, req, resp dhcpv6.DHCPv6) bool { switch msg.Type() { case dhcpv6.MessageTypeSolicit, dhcpv6.MessageTypeRequest, dhcpv6.MessageTypeConfirm, dhcpv6.MessageTypeRenew, dhcpv6.MessageTypeRebind: // continue default: return false } mac, err := dhcpv6.ExtractMAC(req) if err != nil { log.Debug("dhcpv6: dhcpv6.ExtractMAC: %s", err) return false } var lease *dhcpsvc.Lease func() { s.leasesLock.Lock() defer s.leasesLock.Unlock() lease = s.findLease(mac) }() if lease == nil { log.Debug("dhcpv6: no lease for: %s", mac) switch msg.Type() { case dhcpv6.MessageTypeSolicit: lease = s.reserveLease(mac) if lease == nil { return false } default: return false } } err = s.checkIA(msg, lease) if err != nil { log.Debug("dhcpv6: %s", err) return false } lifetime := s.commitLease(msg, lease) oia := &dhcpv6.OptIANA{ T1: lifetime / 2, T2: time.Duration(float32(lifetime) / 1.5), } roia := msg.Options.OneIANA() if roia != nil { copy(oia.IaId[:], roia.IaId[:]) } else { copy(oia.IaId[:], []byte(valueIAID)) } oiaAddr := &dhcpv6.OptIAAddress{ IPv6Addr: net.IP(lease.IP.AsSlice()), PreferredLifetime: lifetime, ValidLifetime: lifetime, } oia.Options = dhcpv6.IdentityOptions{ Options: []dhcpv6.Option{oiaAddr}, } resp.AddOption(oia) if msg.IsOptionRequested(dhcpv6.OptionDNSRecursiveNameServer) { resp.UpdateOption(dhcpv6.OptDNS(s.conf.dnsIPAddrs...)) } fqdn := msg.GetOneOption(dhcpv6.OptionFQDN) if fqdn != nil { resp.AddOption(fqdn) } resp.AddOption(&dhcpv6.OptStatusCode{ StatusCode: iana.StatusSuccess, StatusMessage: "success", }) return true } // 1. // fe80::* (client) --(Solicit + ClientID+IANA())-> ff02::1:2 // server -(Advertise + ClientID+ServerID+IANA(IAAddress)> fe80::* // fe80::* --(Request + ClientID+ServerID+IANA(IAAddress))-> ff02::1:2 // server -(Reply + ClientID+ServerID+IANA(IAAddress)+DNS)> fe80::* // // 2. // fe80::* --(Confirm|Renew|Rebind + ClientID+IANA(IAAddress))-> ff02::1:2 // server -(Reply + ClientID+ServerID+IANA(IAAddress)+DNS)> fe80::* // // 3. // fe80::* --(Release + ClientID+ServerID+IANA(IAAddress))-> ff02::1:2 func (s *v6Server) packetHandler(conn net.PacketConn, peer net.Addr, req dhcpv6.DHCPv6) { msg, err := req.GetInnerMessage() if err != nil { log.Error("dhcpv6: %s", err) return } log.Debug("dhcpv6: received: %s", req.Summary()) err = s.checkCID(msg) if err != nil { log.Debug("%s", err) return } err = s.checkSID(msg) if err != nil { log.Debug("%s", err) return } var resp dhcpv6.DHCPv6 switch msg.Type() { case dhcpv6.MessageTypeSolicit: if msg.GetOneOption(dhcpv6.OptionRapidCommit) == nil { resp, err = dhcpv6.NewAdvertiseFromSolicit(msg) break } resp, err = dhcpv6.NewReplyFromMessage(msg) case dhcpv6.MessageTypeRequest, dhcpv6.MessageTypeConfirm, dhcpv6.MessageTypeRenew, dhcpv6.MessageTypeRebind, dhcpv6.MessageTypeRelease, dhcpv6.MessageTypeInformationRequest: resp, err = dhcpv6.NewReplyFromMessage(msg) default: log.Error("dhcpv6: message type %d not supported", msg.Type()) return } if err != nil { log.Error("dhcpv6: %s", err) return } resp.AddOption(dhcpv6.OptServerID(s.sid)) _ = s.process(msg, req, resp) log.Debug("dhcpv6: sending: %s", resp.Summary()) _, err = conn.WriteTo(resp.ToBytes(), peer) if err != nil { log.Error("dhcpv6: conn.Write to %s failed: %s", peer, err) return } } // configureDNSIPAddrs updates v6Server configuration with the slice of DNS IP // addresses of provided interface iface. Initializes RA module. func (s *v6Server) configureDNSIPAddrs(iface *net.Interface) (ok bool, err error) { dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion6, defaultMaxAttempts, defaultBackoff, ) if err != nil { return false, fmt.Errorf("interface %s: %w", iface.Name, err) } if len(dnsIPAddrs) == 0 { return false, nil } s.conf.dnsIPAddrs = dnsIPAddrs return true, s.initRA(iface) } // initRA initializes RA module. func (s *v6Server) initRA(iface *net.Interface) (err error) { // Choose the source IP address - should be link-local-unicast. s.ra.ipAddr = s.conf.dnsIPAddrs[0] for _, ip := range s.conf.dnsIPAddrs { if ip.IsLinkLocalUnicast() { s.ra.ipAddr = ip break } } s.ra.raAllowSLAAC = s.conf.RAAllowSLAAC s.ra.raSLAACOnly = s.conf.RASLAACOnly s.ra.dnsIPAddr = s.ra.ipAddr s.ra.prefixIPAddr = s.conf.ipStart s.ra.ifaceName = s.conf.InterfaceName s.ra.iface = iface s.ra.packetSendPeriod = 1 * time.Second return s.ra.Init() } // Start starts the IPv6 DHCP server. func (s *v6Server) Start() (err error) { defer func() { err = errors.Annotate(err, "dhcpv6: %w") }() if !s.conf.Enabled { return nil } ifaceName := s.conf.InterfaceName iface, err := net.InterfaceByName(ifaceName) if err != nil { return fmt.Errorf("finding interface %s by name: %w", ifaceName, err) } log.Debug("dhcpv6: starting...") ok, err := s.configureDNSIPAddrs(iface) if err != nil { // Don't wrap the error, because it's informative enough as is. return err } if !ok { // No available IP addresses which may appear later. return nil } // Don't initialize DHCPv6 server if we must force the clients to use SLAAC. if s.conf.RASLAACOnly { log.Debug("not starting dhcpv6 server due to ra_slaac_only=true") return nil } err = netutil.ValidateMAC(iface.HardwareAddr) if err != nil { return fmt.Errorf("validating interface %s: %w", iface.Name, err) } s.sid = &dhcpv6.DUIDLLT{ HWType: iana.HWTypeEthernet, LinkLayerAddr: iface.HardwareAddr, Time: dhcpv6.GetTime(), } s.srv, err = server6.NewServer(iface.Name, nil, s.packetHandler, server6.WithDebugLogger()) if err != nil { return err } log.Debug("dhcpv6: listening...") go func() { if sErr := s.srv.Serve(); errors.Is(sErr, net.ErrClosed) { log.Info("dhcpv6: server is closed") } else if sErr != nil { log.Error("dhcpv6: srv.Serve: %s", sErr) } }() return nil } // Stop - stop server func (s *v6Server) Stop() (err error) { err = s.ra.Close() if err != nil { return fmt.Errorf("closing ra ctx: %w", err) } // DHCPv6 server may not be initialized if ra_slaac_only=true if s.srv == nil { return } log.Debug("dhcpv6: stopping") err = s.srv.Close() if err != nil { return fmt.Errorf("closing dhcpv6 srv: %w", err) } // now server.Serve() will return s.srv = nil return nil } // Create DHCPv6 server func v6Create(conf V6ServerConf) (DHCPServer, error) { s := &v6Server{} s.conf = conf if !conf.Enabled { return s, nil } s.conf.ipStart = conf.RangeStart if s.conf.ipStart == nil || s.conf.ipStart.To16() == nil { return s, fmt.Errorf("dhcpv6: invalid range-start IP: %s", conf.RangeStart) } if conf.LeaseDuration == 0 { s.conf.leaseTime = timeutil.Day s.conf.LeaseDuration = uint32(s.conf.leaseTime.Seconds()) } else { s.conf.leaseTime = time.Second * time.Duration(conf.LeaseDuration) } return s, nil } ```
/content/code_sandbox/internal/dhcpd/v6_unix.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
5,599
```go //go:build darwin || freebsd || linux || openbsd package dhcpd import ( "fmt" "net" "testing" "time" "github.com/AdguardTeam/golibs/netutil" "github.com/AdguardTeam/golibs/testutil" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/stretchr/testify/assert" ) func TestParseOpt(t *testing.T) { testCases := []struct { name string in string wantCode dhcpv4.OptionCode wantVal dhcpv4.OptionValue wantErrMsg string }{{ name: "hex_success", in: "6 hex c0a80101c0a80102", wantCode: dhcpv4.GenericOptionCode(6), wantVal: dhcpv4.OptionGeneric{Data: []byte{ 0xC0, 0xA8, 0x01, 0x01, 0xC0, 0xA8, 0x01, 0x02, }}, wantErrMsg: "", }, { name: "ip_success", in: "6 ip 1.2.3.4", wantCode: dhcpv4.GenericOptionCode(6), wantVal: dhcpv4.IP(net.IP{0x01, 0x02, 0x03, 0x04}), wantErrMsg: "", }, { name: "ips_success", in: "6 ips 192.168.1.1,192.168.1.2", wantCode: dhcpv4.GenericOptionCode(6), wantVal: dhcpv4.IPs([]net.IP{ {0xC0, 0xA8, 0x01, 0x01}, {0xC0, 0xA8, 0x01, 0x02}, }), wantErrMsg: "", }, { name: "text_success", in: "252 text path_to_url", wantCode: dhcpv4.GenericOptionCode(252), wantVal: dhcpv4.String("path_to_url"), wantErrMsg: "", }, { name: "del_success", in: "61 del", wantCode: dhcpv4.GenericOptionCode(dhcpv4.OptionClientIdentifier), wantVal: dhcpv4.OptionGeneric{Data: nil}, wantErrMsg: "", }, { name: "bool_success", in: "19 bool true", wantCode: dhcpv4.GenericOptionCode(dhcpv4.OptionIPForwarding), wantVal: dhcpv4.OptionGeneric{Data: []byte{0x01}}, wantErrMsg: "", }, { name: "bool_success_false", in: "19 bool F", wantCode: dhcpv4.GenericOptionCode(dhcpv4.OptionIPForwarding), wantVal: dhcpv4.OptionGeneric{Data: []byte{0x00}}, wantErrMsg: "", }, { name: "dur_success", in: "24 dur 2h5s", wantCode: dhcpv4.GenericOptionCode(dhcpv4.OptionPathMTUAgingTimeout), wantVal: dhcpv4.Duration(2*time.Hour + 5*time.Second), wantErrMsg: "", }, { name: "u8_success", in: "23 u8 64", wantCode: dhcpv4.GenericOptionCode(dhcpv4.OptionDefaultIPTTL), wantVal: dhcpv4.OptionGeneric{Data: []byte{0x40}}, wantErrMsg: "", }, { name: "u16_success", in: "22 u16 1234", wantCode: dhcpv4.GenericOptionCode(dhcpv4.OptionMaximumDatagramAssemblySize), wantVal: dhcpv4.Uint16(1234), wantErrMsg: "", }, { name: "bad_parts", in: "6 ip", wantCode: nil, wantVal: nil, wantErrMsg: `invalid option string "6 ip": bad option format`, }, { name: "bad_code", in: "256 ip 1.1.1.1", wantCode: nil, wantVal: nil, wantErrMsg: `invalid option string "256 ip 1.1.1.1": parsing option code: ` + `strconv.ParseUint: parsing "256": value out of range`, }, { name: "bad_type", in: "6 bad 1.1.1.1", wantCode: nil, wantVal: nil, wantErrMsg: `invalid option string "6 bad 1.1.1.1": unknown option type "bad"`, }, { name: "hex_error", in: "6 hex ZZZ", wantCode: nil, wantVal: nil, wantErrMsg: `invalid option string "6 hex ZZZ": decoding hex: ` + `encoding/hex: invalid byte: U+005A 'Z'`, }, { name: "ip_error", in: "6 ip 1.2.3.x", wantCode: nil, wantVal: nil, wantErrMsg: "invalid option string \"6 ip 1.2.3.x\": bad ipv4 address \"1.2.3.x\"", }, { name: "ip_error_v6", in: "6 ip ::1234", wantCode: nil, wantVal: nil, wantErrMsg: "invalid option string \"6 ip ::1234\": bad ipv4 address \"::1234\"", }, { name: "ips_error", in: "6 ips 192.168.1.1,192.168.1.x", wantCode: nil, wantVal: nil, wantErrMsg: "invalid option string \"6 ips 192.168.1.1,192.168.1.x\": " + "parsing ip at index 1: bad ipv4 address \"192.168.1.x\"", }, { name: "bool_error", in: "19 bool yes", wantCode: nil, wantVal: nil, wantErrMsg: "invalid option string \"19 bool yes\": decoding bool: " + "strconv.ParseBool: parsing \"yes\": invalid syntax", }, { name: "dur_error", in: "24 dur 3y", wantCode: nil, wantVal: nil, wantErrMsg: "invalid option string \"24 dur 3y\": decoding dur: " + "unmarshaling duration: time: unknown unit \"y\" in duration \"3y\"", }, { name: "u8_error", in: "23 u8 256", wantCode: nil, wantVal: nil, wantErrMsg: "invalid option string \"23 u8 256\": decoding u8: " + "strconv.ParseUint: parsing \"256\": value out of range", }, { name: "u16_error", in: "23 u16 65536", wantCode: nil, wantVal: nil, wantErrMsg: "invalid option string \"23 u16 65536\": decoding u16: " + "strconv.ParseUint: parsing \"65536\": value out of range", }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { code, val, err := parseDHCPOption(tc.in) testutil.AssertErrorMsg(t, tc.wantErrMsg, err) assert.Equal(t, tc.wantCode, code) assert.Equal(t, tc.wantVal, val) }) } } func TestPrepareOptions(t *testing.T) { oneIP, otherIP := net.IP{1, 2, 3, 4}, net.IP{5, 6, 7, 8} testCases := []struct { name string wantExplicit dhcpv4.Options opts []string }{{ name: "all_default", wantExplicit: nil, opts: nil, }, { name: "configured_ip", wantExplicit: dhcpv4.OptionsFromList( dhcpv4.OptBroadcastAddress(oneIP), ), opts: []string{ fmt.Sprintf("%d ip %s", dhcpv4.OptionBroadcastAddress, oneIP), }, }, { name: "configured_ips", wantExplicit: dhcpv4.OptionsFromList( dhcpv4.Option{ Code: dhcpv4.OptionDomainNameServer, Value: dhcpv4.IPs{oneIP, otherIP}, }, ), opts: []string{ fmt.Sprintf("%d ips %s,%s", dhcpv4.OptionDomainNameServer, oneIP, otherIP), }, }, { name: "configured_bad", wantExplicit: nil, opts: []string{ "19 bool yes", "24 dur 3y", "23 u8 256", "23 u16 65536", "20 hex", "23 hex abc", "32 ips 1,2,3,4", "28 256.256.256.256", }, }, { name: "configured_del", wantExplicit: dhcpv4.OptionsFromList( dhcpv4.OptBroadcastAddress(nil), ), opts: []string{ "28 del", }, }, { name: "rewritten_del", wantExplicit: dhcpv4.OptionsFromList( dhcpv4.OptBroadcastAddress(netutil.IPv4bcast()), ), opts: []string{ "28 del", "28 ip 255.255.255.255", }, }, { name: "configured_and_del", wantExplicit: dhcpv4.OptionsFromList( dhcpv4.Option{ Code: dhcpv4.OptionGeoConf, Value: dhcpv4.String("cba"), }, ), opts: []string{ "123 text abc", "123 del", "123 text cba", }, }} for _, tc := range testCases { s := &v4Server{ conf: &V4ServerConf{ Options: tc.opts, }, } t.Run(tc.name, func(t *testing.T) { s.prepareOptions() assert.Equal(t, tc.wantExplicit, s.explicitOpts) for c := range s.explicitOpts { assert.NotContains(t, s.implicitOpts, c) } }) } } ```
/content/code_sandbox/internal/dhcpd/options_unix_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,413
```go // Package dhcpd provides a DHCP server. package dhcpd import ( "fmt" "net" "net/netip" "path/filepath" "time" "github.com/AdguardTeam/AdGuardHome/internal/dhcpsvc" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/timeutil" ) const ( // DefaultDHCPLeaseTTL is the default time-to-live for leases. DefaultDHCPLeaseTTL = uint32(timeutil.Day / time.Second) // DefaultDHCPTimeoutICMP is the default timeout for waiting ICMP responses. DefaultDHCPTimeoutICMP = 1000 ) // Currently used defaults for ifaceDNSAddrs. const ( defaultMaxAttempts int = 10 defaultBackoff time.Duration = 500 * time.Millisecond ) // OnLeaseChangedT is a callback for lease changes. type OnLeaseChangedT func(flags int) // flags for onLeaseChanged() const ( LeaseChangedAdded = iota LeaseChangedAddedStatic LeaseChangedRemovedStatic LeaseChangedRemovedAll LeaseChangedDBStore ) // GetLeasesFlags are the flags for GetLeases. type GetLeasesFlags uint8 // GetLeasesFlags values const ( LeasesDynamic GetLeasesFlags = 0b01 LeasesStatic GetLeasesFlags = 0b10 LeasesAll = LeasesDynamic | LeasesStatic ) // Interface is the DHCP server that deals with both IP address families. type Interface interface { Start() (err error) Stop() (err error) // Enabled returns true if the DHCP server is running. // // TODO(e.burkov): Currently, we need this method to determine whether the // local domain suffix should be considered while resolving A/AAAA requests. // This is because other parts of the code aren't aware of the DNS suffixes // in DHCP clients names and caller is responsible for trimming it. This // behavior should be changed in the future. Enabled() (ok bool) // Leases returns all the leases in the database. Leases() (leases []*dhcpsvc.Lease) // MacByIP returns the MAC address of a client with ip. It returns nil if // there is no such client, due to an assumption that a DHCP client must // always have a HardwareAddr. MACByIP(ip netip.Addr) (mac net.HardwareAddr) // HostByIP returns the hostname of the DHCP client with the given IP // address. The address will be netip.Addr{} if there is no such client, // due to an assumption that a DHCP client must always have an IP address. HostByIP(ip netip.Addr) (host string) // IPByHost returns the IP address of the DHCP client with the given // hostname. The address will be netip.Addr{} if there is no such client, // due to an assumption that a DHCP client must always have an IP address. IPByHost(host string) (ip netip.Addr) WriteDiskConfig(c *ServerConfig) } // server is the DHCP service that handles DHCPv4, DHCPv6, and HTTP API. type server struct { srv4 DHCPServer srv6 DHCPServer // TODO(a.garipov): Either create a separate type for the internal config or // just put the config values into Server. conf *ServerConfig // Called when the leases DB is modified onLeaseChanged []OnLeaseChangedT } // type check var _ Interface = (*server)(nil) // Create initializes and returns the DHCP server handling both address // families. It also registers the corresponding HTTP API endpoints. func Create(conf *ServerConfig) (s *server, err error) { s = &server{ conf: &ServerConfig{ ConfigModified: conf.ConfigModified, HTTPRegister: conf.HTTPRegister, Enabled: conf.Enabled, InterfaceName: conf.InterfaceName, LocalDomainName: conf.LocalDomainName, dbFilePath: filepath.Join(conf.DataDir, dataFilename), }, } // TODO(e.burkov): Don't register handlers, see TODO on // [aghhttp.RegisterFunc]. s.registerHandlers() v4Enabled, v6Enabled, err := s.setServers(conf) if err != nil { // Don't wrap the error, because it's informative enough as is. return nil, err } s.conf.Conf4 = conf.Conf4 s.conf.Conf6 = conf.Conf6 if s.conf.Enabled && !v4Enabled && !v6Enabled { return nil, fmt.Errorf("neither dhcpv4 nor dhcpv6 srv is configured") } // Migrate leases db if needed. err = migrateDB(conf) if err != nil { // Don't wrap the error since it's informative enough as is. return nil, err } // Don't delay database loading until the DHCP server is started, // because we need static leases functionality available beforehand. err = s.dbLoad() if err != nil { return nil, fmt.Errorf("loading db: %w", err) } return s, nil } // setServers updates DHCPv4 and DHCPv6 servers created from the provided // configuration conf. It returns the status of both the DHCPv4 and the DHCPv6 // servers, which is always false for corresponding server on any error. func (s *server) setServers(conf *ServerConfig) (v4Enabled, v6Enabled bool, err error) { v4conf := conf.Conf4 v4conf.InterfaceName = s.conf.InterfaceName v4conf.notify = s.onNotify v4conf.Enabled = s.conf.Enabled && v4conf.RangeStart.IsValid() s.srv4, err = v4Create(&v4conf) if err != nil { if v4conf.Enabled { return false, false, fmt.Errorf("creating dhcpv4 srv: %w", err) } log.Debug("dhcpd: warning: creating dhcpv4 srv: %s", err) } v6conf := conf.Conf6 v6conf.InterfaceName = s.conf.InterfaceName v6conf.notify = s.onNotify v6conf.Enabled = s.conf.Enabled && len(v6conf.RangeStart) != 0 s.srv6, err = v6Create(v6conf) if err != nil { return v4conf.Enabled, false, fmt.Errorf("creating dhcpv6 srv: %w", err) } return v4conf.Enabled, v6conf.Enabled, nil } // Enabled returns true when the server is enabled. func (s *server) Enabled() (ok bool) { return s.conf.Enabled } // resetLeases resets all leases in the lease database. func (s *server) resetLeases() (err error) { err = s.srv4.ResetLeases(nil) if err != nil { return err } if s.srv6 != nil { err = s.srv6.ResetLeases(nil) if err != nil { return err } } return s.dbStore() } // server calls this function after DB is updated func (s *server) onNotify(flags uint32) { if flags == LeaseChangedDBStore { err := s.dbStore() if err != nil { log.Error("updating db: %s", err) } return } s.notify(int(flags)) } func (s *server) notify(flags int) { for _, f := range s.onLeaseChanged { f(flags) } } // WriteDiskConfig - write configuration func (s *server) WriteDiskConfig(c *ServerConfig) { c.Enabled = s.conf.Enabled c.InterfaceName = s.conf.InterfaceName c.LocalDomainName = s.conf.LocalDomainName s.srv4.WriteDiskConfig4(&c.Conf4) s.srv6.WriteDiskConfig6(&c.Conf6) } // Start will listen on port 67 and serve DHCP requests. func (s *server) Start() (err error) { err = s.srv4.Start() if err != nil { return err } err = s.srv6.Start() if err != nil { return err } return nil } // Stop closes the listening UDP socket func (s *server) Stop() (err error) { err = s.srv4.Stop() if err != nil { return err } err = s.srv6.Stop() if err != nil { return err } return nil } // Leases returns the list of active DHCP leases. func (s *server) Leases() (leases []*dhcpsvc.Lease) { return append(s.srv4.GetLeases(LeasesAll), s.srv6.GetLeases(LeasesAll)...) } // MACByIP returns a MAC address by the IP address of its lease, if there is // one. func (s *server) MACByIP(ip netip.Addr) (mac net.HardwareAddr) { if ip.Is4() { return s.srv4.FindMACbyIP(ip) } return s.srv6.FindMACbyIP(ip) } // HostByIP implements the [Interface] interface for *server. // // TODO(e.burkov): Implement this method for DHCPv6. func (s *server) HostByIP(ip netip.Addr) (host string) { if ip.Is4() { return s.srv4.HostByIP(ip) } return "" } // IPByHost implements the [Interface] interface for *server. // // TODO(e.burkov): Implement this method for DHCPv6. func (s *server) IPByHost(host string) (ip netip.Addr) { return s.srv4.IPByHost(host) } // AddStaticLease - add static v4 lease func (s *server) AddStaticLease(l *dhcpsvc.Lease) error { return s.srv4.AddStaticLease(l) } ```
/content/code_sandbox/internal/dhcpd/dhcpd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,190
```go package dhcpd import ( "encoding/json" "net/netip" "os" "path/filepath" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const testData = `[ {"mac":"ESIzRFVm","ip":"AQIDBA==","host":"test1","exp":1}, {"mac":"ZlVEMyIR","ip":"BAMCAQ==","host":"test2","exp":1231231231} ]` func TestMigrateDB(t *testing.T) { dir := t.TempDir() oldLeasesPath := filepath.Join(dir, dbFilename) dataDirPath := filepath.Join(dir, dataFilename) err := os.WriteFile(oldLeasesPath, []byte(testData), 0o644) require.NoError(t, err) wantLeases := []*dbLease{{ Expiry: time.Unix(1, 0).Format(time.RFC3339), Hostname: "test1", HWAddr: "11:22:33:44:55:66", IP: netip.MustParseAddr("1.2.3.4"), IsStatic: true, }, { Expiry: time.Unix(1231231231, 0).Format(time.RFC3339), Hostname: "test2", HWAddr: "66:55:44:33:22:11", IP: netip.MustParseAddr("4.3.2.1"), IsStatic: false, }} conf := &ServerConfig{ WorkDir: dir, DataDir: dir, } err = migrateDB(conf) require.NoError(t, err) _, err = os.Stat(oldLeasesPath) require.ErrorIs(t, err, os.ErrNotExist) var data []byte data, err = os.ReadFile(dataDirPath) require.NoError(t, err) dl := &dataLeases{} err = json.Unmarshal(data, dl) require.NoError(t, err) leases := dl.Leases for i, wantLease := range wantLeases { assert.Equal(t, wantLease.Hostname, leases[i].Hostname) assert.Equal(t, wantLease.HWAddr, leases[i].HWAddr) assert.Equal(t, wantLease.IP, leases[i].IP) assert.Equal(t, wantLease.IsStatic, leases[i].IsStatic) require.Equal(t, wantLease.Expiry, leases[i].Expiry) } } ```
/content/code_sandbox/internal/dhcpd/migrate_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
544
```go //go:build linux package dhcpd import ( "net" "testing" "github.com/AdguardTeam/golibs/testutil" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/mdlayher/packet" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestDHCPConn_WriteTo_common(t *testing.T) { respData := (&dhcpv4.DHCPv4{}).ToBytes() udpAddr := &net.UDPAddr{ IP: net.IP{1, 2, 3, 4}, Port: dhcpv4.ClientPort, } t.Run("unicast_ip", func(t *testing.T) { writeTo := func(_ []byte, addr net.Addr) (_ int, _ error) { assert.Equal(t, udpAddr, addr) return 0, nil } conn := &dhcpConn{udpConn: &fakePacketConn{writeTo: writeTo}} _, err := conn.WriteTo(respData, udpAddr) assert.NoError(t, err) }) t.Run("unexpected_addr_type", func(t *testing.T) { type unexpectedAddrType struct { net.Addr } conn := &dhcpConn{} n, err := conn.WriteTo(nil, &unexpectedAddrType{}) require.Error(t, err) testutil.AssertErrorMsg(t, "addr has an unexpected type *dhcpd.unexpectedAddrType", err) assert.Zero(t, n) }) } func TestBuildEtherPkt(t *testing.T) { conn := &dhcpConn{ srcMAC: net.HardwareAddr{1, 2, 3, 4, 5, 6}, srcIP: net.IP{1, 2, 3, 4}, } peer := &dhcpUnicastAddr{ Addr: packet.Addr{HardwareAddr: net.HardwareAddr{6, 5, 4, 3, 2, 1}}, yiaddr: net.IP{4, 3, 2, 1}, } payload := (&dhcpv4.DHCPv4{}).ToBytes() t.Run("success", func(t *testing.T) { pkt, err := conn.buildEtherPkt(payload, peer) require.NoError(t, err) assert.NotEmpty(t, pkt) actualPkt := gopacket.NewPacket(pkt, layers.LayerTypeEthernet, gopacket.DecodeOptions{ NoCopy: true, }) require.NotNil(t, actualPkt) wantTypes := []gopacket.LayerType{ layers.LayerTypeEthernet, layers.LayerTypeIPv4, layers.LayerTypeUDP, layers.LayerTypeDHCPv4, } actualLayers := actualPkt.Layers() require.Len(t, actualLayers, len(wantTypes)) for i, wantType := range wantTypes { layer := actualLayers[i] require.NotNil(t, layer) assert.Equal(t, wantType, layer.LayerType()) } }) t.Run("bad_payload", func(t *testing.T) { // Create an invalid DHCP packet. invalidPayload := []byte{1, 2, 3, 4} pkt, err := conn.buildEtherPkt(invalidPayload, peer) require.NoError(t, err) assert.NotEmpty(t, pkt) }) t.Run("serializing_error", func(t *testing.T) { // Create a peer with invalid MAC. badPeer := &dhcpUnicastAddr{ Addr: packet.Addr{HardwareAddr: net.HardwareAddr{5, 4, 3, 2, 1}}, yiaddr: net.IP{4, 3, 2, 1}, } pkt, err := conn.buildEtherPkt(payload, badPeer) require.Error(t, err) assert.Empty(t, pkt) }) } func TestV4Server_Send(t *testing.T) { s := &v4Server{} var ( defaultIP = net.IP{99, 99, 99, 99} knownIP = net.IP{4, 2, 4, 2} knownMAC = net.HardwareAddr{6, 5, 4, 3, 2, 1} ) defaultPeer := &net.UDPAddr{ IP: defaultIP, // Use neither client nor server port to check it actually // changed. Port: dhcpv4.ClientPort + dhcpv4.ServerPort, } defaultResp := &dhcpv4.DHCPv4{} testCases := []struct { want net.Addr req *dhcpv4.DHCPv4 resp *dhcpv4.DHCPv4 name string }{{ name: "giaddr", req: &dhcpv4.DHCPv4{GatewayIPAddr: knownIP}, resp: defaultResp, want: &net.UDPAddr{ IP: knownIP, Port: dhcpv4.ServerPort, }, }, { name: "nak", req: &dhcpv4.DHCPv4{}, resp: &dhcpv4.DHCPv4{ Options: dhcpv4.OptionsFromList( dhcpv4.OptMessageType(dhcpv4.MessageTypeNak), ), }, want: defaultPeer, }, { name: "ciaddr", req: &dhcpv4.DHCPv4{ClientIPAddr: knownIP}, resp: &dhcpv4.DHCPv4{}, want: &net.UDPAddr{ IP: knownIP, Port: dhcpv4.ClientPort, }, }, { name: "chaddr", req: &dhcpv4.DHCPv4{ClientHWAddr: knownMAC}, resp: &dhcpv4.DHCPv4{YourIPAddr: knownIP}, want: &dhcpUnicastAddr{ Addr: packet.Addr{HardwareAddr: knownMAC}, yiaddr: knownIP, }, }, { name: "who_are_you", req: &dhcpv4.DHCPv4{}, resp: &dhcpv4.DHCPv4{}, want: defaultPeer, }} for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { conn := &fakePacketConn{ writeTo: func(_ []byte, addr net.Addr) (_ int, _ error) { assert.Equal(t, tc.want, addr) return 0, nil }, } s.send(cloneUDPAddr(defaultPeer), conn, tc.req, tc.resp) }) } t.Run("giaddr_nak", func(t *testing.T) { req := &dhcpv4.DHCPv4{ GatewayIPAddr: knownIP, } // Ensure the request is for unicast. req.SetUnicast() resp := &dhcpv4.DHCPv4{ Options: dhcpv4.OptionsFromList( dhcpv4.OptMessageType(dhcpv4.MessageTypeNak), ), } want := &net.UDPAddr{ IP: req.GatewayIPAddr, Port: dhcpv4.ServerPort, } conn := &fakePacketConn{ writeTo: func(_ []byte, addr net.Addr) (n int, err error) { assert.Equal(t, want, addr) return 0, nil }, } s.send(cloneUDPAddr(defaultPeer), conn, req, resp) assert.True(t, resp.IsBroadcast()) }) } ```
/content/code_sandbox/internal/dhcpd/conn_linux_internal_test.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
1,732
```go package dhcpd import ( "encoding/binary" "fmt" "net" "sync/atomic" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "golang.org/x/net/icmp" "golang.org/x/net/ipv6" ) type raCtx struct { raAllowSLAAC bool // send RA packets without MO flags raSLAACOnly bool // send RA packets with MO flags ipAddr net.IP // source IP address (link-local-unicast) dnsIPAddr net.IP // IP address for DNS Server option prefixIPAddr net.IP // IP address for Prefix option ifaceName string iface *net.Interface packetSendPeriod time.Duration // how often RA packets are sent conn *icmp.PacketConn // ICMPv6 socket stop atomic.Value // stop the packet sending loop } type icmpv6RA struct { managedAddressConfiguration bool otherConfiguration bool prefix net.IP prefixLen int sourceLinkLayerAddress net.HardwareAddr recursiveDNSServer net.IP mtu uint32 } // hwAddrToLinkLayerAddr converts a hardware address into a form required by // RFC4861. That is, a byte slice of length divisible by 8. // // See path_to_url#section-4.6.1. func hwAddrToLinkLayerAddr(hwa net.HardwareAddr) (lla []byte, err error) { err = netutil.ValidateMAC(hwa) if err != nil { // Don't wrap the error, because it already contains enough // context. return nil, err } if len(hwa) == 6 || len(hwa) == 8 { lla = make([]byte, 8) copy(lla, hwa) return lla, nil } // Assume that netutil.ValidateMAC prevents lengths other than 20 by // now. lla = make([]byte, 24) copy(lla, hwa) return lla, nil } // Create an ICMPv6.RouterAdvertisement packet with all necessary options. // Data scheme: // // ICMPv6: // - type[1] // - code[1] // - chksum[2] // - body (RouterAdvertisement): // - Cur Hop Limit[1] // - Flags[1]: MO...... // - Router Lifetime[2] // - Reachable Time[4] // - Retrans Timer[4] // - Option=Prefix Information(3): // - Type[1] // - Length * 8bytes[1] // - Prefix Length[1] // - Flags[1]: LA...... // - Valid Lifetime[4] // - Preferred Lifetime[4] // - Reserved[4] // - Prefix[16] // - Option=MTU(5): // - Type[1] // - Length * 8bytes[1] // - Reserved[2] // - MTU[4] // - Option=Source link-layer address(1): // - Link-Layer Address[8/24] // - Option=Recursive DNS Server(25): // - Type[1] // - Length * 8bytes[1] // - Reserved[2] // - Lifetime[4] // - Addresses of IPv6 Recursive DNS Servers[16] // // TODO(a.garipov): Replace with an existing implementation from a dependency. func createICMPv6RAPacket(params icmpv6RA) (data []byte, err error) { var lla []byte lla, err = hwAddrToLinkLayerAddr(params.sourceLinkLayerAddress) if err != nil { return nil, fmt.Errorf("converting source link layer address: %w", err) } // TODO(a.garipov): Don't use a magic constant here. Refactor the code // and make all constants named instead of all those comments.. data = make([]byte, 82+len(lla)) i := 0 // ICMPv6: data[i] = 134 // type data[i+1] = 0 // code data[i+2] = 0 // chksum data[i+3] = 0 i += 4 // RouterAdvertisement: data[i] = 64 // Cur Hop Limit[1] i++ data[i] = 0 // Flags[1]: MO...... if params.managedAddressConfiguration { data[i] |= 0x80 } if params.otherConfiguration { data[i] |= 0x40 } i++ binary.BigEndian.PutUint16(data[i:], 1800) // Router Lifetime[2] i += 2 binary.BigEndian.PutUint32(data[i:], 0) // Reachable Time[4] i += 4 binary.BigEndian.PutUint32(data[i:], 0) // Retrans Timer[4] i += 4 // Option=Prefix Information: data[i] = 3 // Type data[i+1] = 4 // Length i += 2 data[i] = byte(params.prefixLen) // Prefix Length[1] i++ data[i] = 0xc0 // Flags[1] i++ binary.BigEndian.PutUint32(data[i:], 3600) // Valid Lifetime[4] i += 4 binary.BigEndian.PutUint32(data[i:], 3600) // Preferred Lifetime[4] i += 4 binary.BigEndian.PutUint32(data[i:], 0) // Reserved[4] i += 4 copy(data[i:], params.prefix[:8]) // Prefix[16] binary.BigEndian.PutUint32(data[i+8:], 0) binary.BigEndian.PutUint32(data[i+12:], 0) i += 16 // Option=MTU: data[i] = 5 // Type data[i+1] = 1 // Length i += 2 binary.BigEndian.PutUint16(data[i:], 0) // Reserved[2] i += 2 binary.BigEndian.PutUint32(data[i:], params.mtu) // MTU[4] i += 4 // Option=Source link-layer address: data[i] = 1 // Type data[i+1] = 1 // Length i += 2 copy(data[i:], lla) // Link-Layer Address[8/24] i += len(lla) // Option=Recursive DNS Server: data[i] = 25 // Type data[i+1] = 3 // Length i += 2 binary.BigEndian.PutUint16(data[i:], 0) // Reserved[2] i += 2 binary.BigEndian.PutUint32(data[i:], 3600) // Lifetime[4] i += 4 copy(data[i:], params.recursiveDNSServer) // Addresses of IPv6 Recursive DNS Servers[16] return data, nil } // Init initializes RA module. func (ra *raCtx) Init() (err error) { ra.stop.Store(0) ra.conn = nil if !ra.raAllowSLAAC && !ra.raSLAACOnly { return nil } log.Debug("dhcpv6 ra: source IP address: %s DNS IP address: %s", ra.ipAddr, ra.dnsIPAddr) params := icmpv6RA{ managedAddressConfiguration: !ra.raSLAACOnly, otherConfiguration: !ra.raSLAACOnly, mtu: uint32(ra.iface.MTU), prefixLen: 64, recursiveDNSServer: ra.dnsIPAddr, sourceLinkLayerAddress: ra.iface.HardwareAddr, } params.prefix = make([]byte, 16) copy(params.prefix, ra.prefixIPAddr[:8]) // /64 var data []byte data, err = createICMPv6RAPacket(params) if err != nil { return fmt.Errorf("creating packet: %w", err) } ipAndScope := ra.ipAddr.String() + "%" + ra.ifaceName ra.conn, err = icmp.ListenPacket("ip6:ipv6-icmp", ipAndScope) if err != nil { return fmt.Errorf("dhcpv6 ra: icmp.ListenPacket: %w", err) } defer func() { if err != nil { err = errors.WithDeferred(err, ra.Close()) } }() con6 := ra.conn.IPv6PacketConn() if err = con6.SetHopLimit(255); err != nil { return fmt.Errorf("dhcpv6 ra: SetHopLimit: %w", err) } if err = con6.SetMulticastHopLimit(255); err != nil { return fmt.Errorf("dhcpv6 ra: SetMulticastHopLimit: %w", err) } msg := &ipv6.ControlMessage{ HopLimit: 255, Src: ra.ipAddr, IfIndex: ra.iface.Index, } addr := &net.UDPAddr{ IP: net.ParseIP("ff02::1"), } go func() { log.Debug("dhcpv6 ra: starting to send periodic RouterAdvertisement packets") for ra.stop.Load() == 0 { _, err = con6.WriteTo(data, msg, addr) if err != nil { log.Error("dhcpv6 ra: WriteTo: %s", err) } time.Sleep(ra.packetSendPeriod) } log.Debug("dhcpv6 ra: loop exit") }() return nil } // Close closes the module. func (ra *raCtx) Close() (err error) { log.Debug("dhcpv6 ra: closing") ra.stop.Store(1) if ra.conn != nil { return ra.conn.Close() } return nil } ```
/content/code_sandbox/internal/dhcpd/routeradv.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,180
```go //go:build darwin || freebsd || openbsd package dhcpd import ( "fmt" "net" "os" "time" "github.com/AdguardTeam/golibs/errors" "github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/netutil" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/insomniacslk/dhcp/dhcpv4" "github.com/insomniacslk/dhcp/dhcpv4/server4" "github.com/mdlayher/ethernet" //lint:ignore SA1019 See the TODO in go.mod. "github.com/mdlayher/raw" ) // dhcpUnicastAddr is the combination of MAC and IP addresses for responding to // the unconfigured host. type dhcpUnicastAddr struct { // raw.Addr is embedded here to make *dhcpUcastAddr a net.Addr without // actually implementing all methods. It also contains the client's // hardware address. raw.Addr // yiaddr is an IP address just allocated by server for the host. yiaddr net.IP } // dhcpConn is the net.PacketConn capable of handling both net.UDPAddr and // net.HardwareAddr. type dhcpConn struct { // udpConn is the connection for UDP addresses. udpConn net.PacketConn // bcastIP is the broadcast address specific for the configured // interface's subnet. bcastIP net.IP // rawConn is the connection for MAC addresses. rawConn net.PacketConn // srcMAC is the hardware address of the configured network interface. srcMAC net.HardwareAddr // srcIP is the IP address of the configured network interface. srcIP net.IP } // newDHCPConn creates the special connection for DHCP server. func (s *v4Server) newDHCPConn(iface *net.Interface) (c net.PacketConn, err error) { var ucast net.PacketConn if ucast, err = raw.ListenPacket(iface, uint16(ethernet.EtherTypeIPv4), nil); err != nil { return nil, fmt.Errorf("creating raw udp connection: %w", err) } // Create the UDP connection. var bcast net.PacketConn bcast, err = server4.NewIPv4UDPConn(iface.Name, &net.UDPAddr{ // TODO(e.burkov): Listening on zeroes makes the server handle // requests from all the interfaces. Inspect the ways to // specify the interface-specific listening addresses. // // See path_to_url IP: net.IP{0, 0, 0, 0}, Port: dhcpv4.ServerPort, }) if err != nil { return nil, fmt.Errorf("creating ipv4 udp connection: %w", err) } return &dhcpConn{ udpConn: bcast, bcastIP: s.conf.broadcastIP.AsSlice(), rawConn: ucast, srcMAC: iface.HardwareAddr, srcIP: s.conf.dnsIPAddrs[0].AsSlice(), }, nil } // WriteTo implements net.PacketConn for *dhcpConn. It selects the underlying // connection to write to based on the type of addr. func (c *dhcpConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { switch addr := addr.(type) { case *dhcpUnicastAddr: // Unicast the message to the client's MAC address. Use the raw // connection. // // Note: unicasting is performed on the only network interface // that is configured. For now it may be not what users expect // so additionally broadcast the message via UDP connection. // // See path_to_url var rerr error n, rerr = c.unicast(p, addr) _, uerr := c.broadcast(p, &net.UDPAddr{ IP: netutil.IPv4bcast(), Port: dhcpv4.ClientPort, }) return n, wrapErrs("writing to", uerr, rerr) case *net.UDPAddr: if addr.IP.Equal(net.IPv4bcast) { // Broadcast the message for the client which supports // it. Use the UDP connection. return c.broadcast(p, addr) } // Unicast the message to the client's IP address. Use the UDP // connection. return c.udpConn.WriteTo(p, addr) default: return 0, fmt.Errorf("addr has an unexpected type %T", addr) } } // ReadFrom implements net.PacketConn for *dhcpConn. func (c *dhcpConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { return c.udpConn.ReadFrom(p) } // unicast wraps respData with required frames and writes it to the peer. func (c *dhcpConn) unicast(respData []byte, peer *dhcpUnicastAddr) (n int, err error) { var data []byte data, err = c.buildEtherPkt(respData, peer) if err != nil { return 0, err } return c.rawConn.WriteTo(data, &peer.Addr) } // Close implements net.PacketConn for *dhcpConn. func (c *dhcpConn) Close() (err error) { rerr := c.rawConn.Close() if errors.Is(rerr, os.ErrClosed) { // Ignore the error since the actual file is closed already. rerr = nil } return wrapErrs("closing", c.udpConn.Close(), rerr) } // LocalAddr implements net.PacketConn for *dhcpConn. func (c *dhcpConn) LocalAddr() (a net.Addr) { return c.udpConn.LocalAddr() } // SetDeadline implements net.PacketConn for *dhcpConn. func (c *dhcpConn) SetDeadline(t time.Time) (err error) { return wrapErrs("setting deadline on", c.udpConn.SetDeadline(t), c.rawConn.SetDeadline(t)) } // SetReadDeadline implements net.PacketConn for *dhcpConn. func (c *dhcpConn) SetReadDeadline(t time.Time) error { return wrapErrs( "setting reading deadline on", c.udpConn.SetReadDeadline(t), c.rawConn.SetReadDeadline(t), ) } // SetWriteDeadline implements net.PacketConn for *dhcpConn. func (c *dhcpConn) SetWriteDeadline(t time.Time) error { return wrapErrs( "setting writing deadline on", c.udpConn.SetWriteDeadline(t), c.rawConn.SetWriteDeadline(t), ) } // ipv4DefaultTTL is the default Time to Live value in seconds as recommended by // RFC-1700. // // See path_to_url const ipv4DefaultTTL = 64 // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility. func (c *dhcpConn) buildEtherPkt(payload []byte, peer *dhcpUnicastAddr) (pkt []byte, err error) { udpLayer := &layers.UDP{ SrcPort: dhcpv4.ServerPort, DstPort: dhcpv4.ClientPort, } ipv4Layer := &layers.IPv4{ Version: uint8(layers.IPProtocolIPv4), Flags: layers.IPv4DontFragment, TTL: ipv4DefaultTTL, Protocol: layers.IPProtocolUDP, SrcIP: c.srcIP, DstIP: peer.yiaddr, } // Ignore the error since it's only returned for invalid network layer's // type. _ = udpLayer.SetNetworkLayerForChecksum(ipv4Layer) ethLayer := &layers.Ethernet{ SrcMAC: c.srcMAC, DstMAC: peer.HardwareAddr, EthernetType: layers.EthernetTypeIPv4, } buf := gopacket.NewSerializeBuffer() setts := gopacket.SerializeOptions{ FixLengths: true, ComputeChecksums: true, } err = gopacket.SerializeLayers( buf, setts, ethLayer, ipv4Layer, udpLayer, gopacket.Payload(payload), ) if err != nil { return nil, fmt.Errorf("serializing layers: %w", err) } return buf.Bytes(), nil } // send writes resp for peer to conn considering the req's parameters according // to RFC-2131. // // See path_to_url#section-4.1. func (s *v4Server) send(peer net.Addr, conn net.PacketConn, req, resp *dhcpv4.DHCPv4) { switch giaddr, ciaddr, mtype := req.GatewayIPAddr, req.ClientIPAddr, resp.MessageType(); { case giaddr != nil && !giaddr.IsUnspecified(): // Send any return messages to the server port on the BOOTP relay agent // whose address appears in giaddr. peer = &net.UDPAddr{ IP: giaddr, Port: dhcpv4.ServerPort, } if mtype == dhcpv4.MessageTypeNak { // Set the broadcast bit in the DHCPNAK, so that the relay agent // broadcasts it to the client, because the client may not have a // correct network address or subnet mask, and the client may not be // answering ARP requests. resp.SetBroadcast() } case mtype == dhcpv4.MessageTypeNak: // Broadcast any DHCPNAK messages to 0xffffffff. case ciaddr != nil && !ciaddr.IsUnspecified(): // Unicast DHCPOFFER and DHCPACK messages to the address in ciaddr. peer = &net.UDPAddr{ IP: ciaddr, Port: dhcpv4.ClientPort, } case !req.IsBroadcast() && req.ClientHWAddr != nil: // Unicast DHCPOFFER and DHCPACK messages to the client's hardware // address and yiaddr. peer = &dhcpUnicastAddr{ Addr: raw.Addr{HardwareAddr: req.ClientHWAddr}, yiaddr: resp.YourIPAddr, } default: // Go on since peer is already set to broadcast. } pktData := resp.ToBytes() log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary()) _, err := conn.WriteTo(pktData, peer) if err != nil { log.Error("dhcpv4: conn.Write to %s failed: %s", peer, err) } } ```
/content/code_sandbox/internal/dhcpd/conn_bsd.go
go
2016-07-06T10:31:47
2024-08-16T18:17:06
AdGuardHome
AdguardTeam/AdGuardHome
24,082
2,389