├── _includes ├── head.html ├── js │ └── custom.js ├── head_custom.html ├── css │ ├── custom.scss.liquid │ └── just-the-docs.scss.liquid ├── title.html ├── nav.html └── anchor_headings.html ├── _sass ├── color_schemes │ ├── light.scss │ ├── htbdark.scss │ └── dark.scss ├── support │ ├── mixins │ │ ├── mixins.scss │ │ ├── _buttons.scss │ │ ├── _layout.scss │ │ └── _typography.scss │ ├── support.scss │ ├── _functions.scss │ ├── _variables.scss │ └── _htbfonts.scss ├── utilities │ ├── utilities.scss │ ├── _lists.scss │ ├── _typography.scss │ ├── _layout.scss │ ├── _spacing.scss │ └── _colors.scss ├── modules.scss ├── labels.scss ├── print.scss ├── custom │ └── custom.scss ├── typography.scss ├── tables.scss ├── base.scss ├── buttons.scss ├── monokai.scss ├── content.scss ├── layout.scss ├── navigation.scss ├── code.scss └── search.scss ├── .gitattributes ├── _layouts ├── about.html ├── home.html ├── page.html ├── post.html ├── table_wrappers.html ├── anchor_headings.html └── default.html ├── .gitignore ├── assets ├── images │ ├── banner.png │ ├── header_mascot_undraw.png │ ├── search.svg │ └── header_mascot_undraw.svg ├── css │ ├── just-the-docs-dark.scss │ ├── just-the-docs-light.scss │ └── just-the-docs-default.scss └── js │ ├── zzzz-search-data.json │ └── just-the-docs.js ├── 404.html ├── api ├── home.md ├── self │ └── self.md ├── machine │ └── machine.md └── user │ └── user.md ├── Gemfile ├── README.md ├── _config.yml ├── Gemfile.lock └── _posts └── HTB Endpoint Map.md /_includes/head.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_includes/js/custom.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_includes/head_custom.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_sass/color_schemes/light.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_includes/css/custom.scss.liquid: -------------------------------------------------------------------------------- 1 | @import "./custom/custom"; 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-vendored 2 | *.md linguist-vendored=false 3 | -------------------------------------------------------------------------------- /_layouts/about.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /_layouts/home.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {{ content }} 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | .jekyll-cache 4 | .jekyll-metadata 5 | vendor 6 | -------------------------------------------------------------------------------- /assets/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Propolisa/htb-api-docs/HEAD/assets/images/banner.png -------------------------------------------------------------------------------- /_sass/support/mixins/mixins.scss: -------------------------------------------------------------------------------- 1 | @import "./layout"; 2 | @import "./buttons"; 3 | @import "./typography"; 4 | -------------------------------------------------------------------------------- /assets/css/just-the-docs-dark.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | {% include css/just-the-docs.scss.liquid color_scheme="dark" %} 4 | -------------------------------------------------------------------------------- /assets/css/just-the-docs-light.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | {% include css/just-the-docs.scss.liquid color_scheme="light" %} 4 | -------------------------------------------------------------------------------- /_sass/color_schemes/htbdark.scss: -------------------------------------------------------------------------------- 1 | @use 'dark'; 2 | 3 | .site-title { 4 | font-family: neue-haas-unica; 5 | font-weight: 600; 6 | } -------------------------------------------------------------------------------- /_includes/title.html: -------------------------------------------------------------------------------- 1 | {% if site.logo %} 2 | 3 | {% else %} 4 | {{ site.title }} 5 | {% endif %} 6 | -------------------------------------------------------------------------------- /_sass/support/support.scss: -------------------------------------------------------------------------------- 1 | @import "./htbfonts"; 2 | @import "./variables"; 3 | @import "./functions"; 4 | @import "./mixins/mixins"; 5 | -------------------------------------------------------------------------------- /assets/images/header_mascot_undraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Propolisa/htb-api-docs/HEAD/assets/images/header_mascot_undraw.png -------------------------------------------------------------------------------- /_sass/utilities/utilities.scss: -------------------------------------------------------------------------------- 1 | @import "./colors"; 2 | @import "./layout"; 3 | @import "./typography"; 4 | @import "./lists"; 5 | @import "./spacing"; 6 | -------------------------------------------------------------------------------- /_sass/support/_functions.scss: -------------------------------------------------------------------------------- 1 | @function rem($size, $unit: "") { 2 | $remSize: $size / $root-font-size; 3 | 4 | @if ($unit == false) { 5 | @return #{$remSize}; 6 | } @else { 7 | @return #{$remSize}rem; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /_layouts/table_wrappers.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: vendor/compress 3 | --- 4 | 5 | {% assign content_ = content | replace: '', '' %} 7 | {{ content_ }} 8 | -------------------------------------------------------------------------------- /_includes/css/just-the-docs.scss.liquid: -------------------------------------------------------------------------------- 1 | {% if site.logo %} 2 | $logo: "{{ site.logo | absolute_url }}"; 3 | {% endif %} 4 | @import "./support/support"; 5 | @import "./color_schemes/{{ include.color_scheme }}"; 6 | @import "./modules"; 7 | {% include css/custom.scss.liquid %} 8 | -------------------------------------------------------------------------------- /assets/css/just-the-docs-default.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | {% if site.color_scheme and site.color_scheme != "nil" %} 4 | {% assign color_scheme = site.color_scheme %} 5 | {% else %} 6 | {% assign color_scheme = "light" %} 7 | {% endif %} 8 | {% include css/just-the-docs.scss.liquid color_scheme=color_scheme %} 9 | -------------------------------------------------------------------------------- /_sass/utilities/_lists.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes for lists 3 | // 4 | 5 | // stylelint-disable primer/selector-no-utility, primer/no-override, selector-max-type 6 | 7 | .list-style-none { 8 | padding: 0 !important; 9 | margin: 0 !important; 10 | list-style: none !important; 11 | 12 | li { 13 | &::before { 14 | display: none !important; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /assets/images/search.svg: -------------------------------------------------------------------------------- 1 | Search 2 | -------------------------------------------------------------------------------- /_sass/modules.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Import external dependencies 3 | // 4 | @import "./vendor/normalize.scss/normalize.scss"; 5 | 6 | // 7 | // Modules 8 | // 9 | @import "./base"; 10 | @import "./layout"; 11 | @import "./content"; 12 | @import "./navigation"; 13 | @import "./typography"; 14 | @import "./labels"; 15 | @import "./buttons"; 16 | @import "./search"; 17 | @import "./tables"; 18 | @import "./code"; 19 | @import "./utilities/utilities"; 20 | @import "./print"; 21 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /404.html 3 | layout: default 4 | --- 5 | 6 | 19 | 20 |
21 |

404

22 | 23 |

Page not found :(

24 |

The requested page could not be found.

25 |
26 | -------------------------------------------------------------------------------- /_sass/color_schemes/dark.scss: -------------------------------------------------------------------------------- 1 | $body-background-color: $grey-dk-300; 2 | $sidebar-color: $grey-dk-300; 3 | $border-color: $grey-dk-200; 4 | 5 | $body-text-color: $grey-lt-300; 6 | $body-heading-color: $grey-lt-000; 7 | $nav-child-link-color: $grey-dk-000; 8 | $search-result-preview-color: $grey-dk-000; 9 | 10 | $link-color: $blue-000; 11 | $btn-primary-color: $blue-200; 12 | $base-button-color: $grey-dk-250; 13 | 14 | $code-background-color: $grey-dk-250; 15 | $search-background-color: $grey-dk-250; 16 | $table-background-color: $grey-dk-250; 17 | $feedback-color: darken($sidebar-color, 3%); 18 | -------------------------------------------------------------------------------- /_sass/labels.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Labels (not the form kind) 3 | // 4 | 5 | .label, 6 | .label-blue { 7 | display: inline-block; 8 | padding-top: 0.16em; 9 | padding-right: 0.56em; 10 | padding-bottom: 0.16em; 11 | padding-left: 0.56em; 12 | margin-right: $sp-2; 13 | margin-left: $sp-2; 14 | color: $white; 15 | text-transform: uppercase; 16 | vertical-align: middle; 17 | background-color: $blue-100; 18 | @include fs-2; 19 | border-radius: 12px; 20 | } 21 | 22 | .label-green { 23 | background-color: $green-200; 24 | } 25 | 26 | .label-purple { 27 | background-color: $purple-100; 28 | } 29 | 30 | .label-red { 31 | background-color: $red-200; 32 | } 33 | 34 | .label-yellow { 35 | color: $grey-dk-200; 36 | background-color: $yellow-200; 37 | } 38 | -------------------------------------------------------------------------------- /_sass/support/mixins/_buttons.scss: -------------------------------------------------------------------------------- 1 | // Colored button 2 | 3 | @mixin btn-color($fg, $bg) { 4 | color: $fg; 5 | background-color: darken($bg, 2%); 6 | background-image: linear-gradient(lighten($bg, 5%), darken($bg, 2%)); 7 | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.12); 8 | 9 | &:hover, 10 | &.zeroclipboard-is-hover { 11 | color: $fg; 12 | background-color: darken($bg, 4%); 13 | background-image: linear-gradient((lighten($bg, 2%), darken($bg, 4%))); 14 | } 15 | 16 | &:active, 17 | &.selected, 18 | &.zeroclipboard-is-active { 19 | background-color: darken($bg, 5%); 20 | background-image: none; 21 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); 22 | } 23 | 24 | &.selected:hover { 25 | background-color: darken($bg, 10%); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /_sass/print.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable selector-max-specificity, selector-max-id, selector-max-type, selector-no-qualifying-type, primer/no-override, 2 | 3 | @media print { 4 | .site-footer, 5 | .site-button, 6 | #edit-this-page, 7 | #back-to-top, 8 | .site-nav, 9 | .main-header { 10 | display: none !important; 11 | } 12 | 13 | .side-bar { 14 | width: 100%; 15 | height: auto; 16 | border-right: 0 !important; 17 | } 18 | 19 | .site-header { 20 | border-bottom: 1px solid $border-color; 21 | } 22 | 23 | .site-title { 24 | font-size: $root-font-size !important; 25 | font-weight: 700 !important; 26 | } 27 | 28 | .text-small { 29 | font-size: 8pt !important; 30 | } 31 | 32 | pre.highlight { 33 | border: 1px solid $border-color; 34 | } 35 | 36 | .main { 37 | max-width: none; 38 | margin-left: 0; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /_sass/custom/custom.scss: -------------------------------------------------------------------------------- 1 | .site-title { 2 | @include container; 3 | font-family: neue-haas-unica; 4 | font-weight: 600; 5 | font-size: 32px !important; 6 | padding:12px !important; 7 | padding-right:2em !important; 8 | } 9 | 10 | .site-header { 11 | border-bottom: 1px solid rgb(26, 35, 50); 12 | background: no-repeat; 13 | background-image: url('../../assets/images/header_mascot_undraw.svg'); 14 | background-size: 90px auto; 15 | background-position: right center; 16 | background-origin: content-box; 17 | padding-right: 5px; 18 | height: 100px; 19 | max-height: 100px; 20 | } 21 | 22 | .main-header{ 23 | border-bottom: 1px solid rgb(26, 35, 50); 24 | } 25 | 26 | .side-bar { 27 | border-right:1px solid rgb(26, 35, 50); 28 | } 29 | code { 30 | background-color: #1A2332 !important; 31 | } 32 | 33 | .search-result-doc .search-result-doc-title{ 34 | overflow:hidden; 35 | } -------------------------------------------------------------------------------- /_sass/support/mixins/_layout.scss: -------------------------------------------------------------------------------- 1 | // Media query 2 | 3 | // Media query mixin 4 | // Usage: 5 | // @include mq(md) { 6 | // ..medium and up styles 7 | // } 8 | @mixin mq($name) { 9 | // Retrieves the value from the key 10 | $value: map-get($media-queries, $name); 11 | 12 | // If the key exists in the map 13 | @if $value != null { 14 | // Prints a media query based on the value 15 | @media (min-width: rem($value)) { 16 | @content; 17 | } 18 | } @else { 19 | @warn "No value could be retrieved from `#{$media-query}`. " 20 | + "Please make sure it is defined in `$media-queries` map."; 21 | } 22 | } 23 | 24 | // Responsive container 25 | 26 | @mixin container { 27 | padding-right: $gutter-spacing-sm; 28 | padding-left: $gutter-spacing-sm; 29 | 30 | @include mq(md) { 31 | padding-right: $gutter-spacing; 32 | padding-left: $gutter-spacing; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /_sass/typography.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Typography 3 | // 4 | // stylelint-disable primer/selector-no-utility, primer/no-override, selector-no-type, selector-max-type 5 | 6 | h1, 7 | .text-alpha { 8 | @include fs-8; 9 | font-weight: 300; 10 | } 11 | 12 | h2, 13 | .text-beta { 14 | @include fs-6; 15 | } 16 | 17 | h3, 18 | .text-gamma { 19 | @include fs-5; 20 | } 21 | 22 | h4, 23 | .text-delta { 24 | @include fs-2; 25 | font-weight: 400; 26 | text-transform: uppercase; 27 | letter-spacing: 0.1em; 28 | } 29 | 30 | h5, 31 | .text-epsilon { 32 | @include fs-3; 33 | color: $grey-dk-200; 34 | } 35 | 36 | h6, 37 | .text-zeta { 38 | @include fs-2; 39 | color: $grey-dk-200; 40 | } 41 | 42 | .text-small { 43 | @include fs-2; 44 | } 45 | 46 | .text-mono { 47 | font-family: $mono-font-family !important; 48 | } 49 | 50 | .text-left { 51 | text-align: left !important; 52 | } 53 | 54 | .text-center { 55 | text-align: center !important; 56 | } 57 | 58 | .text-right { 59 | text-align: right !important; 60 | } 61 | -------------------------------------------------------------------------------- /api/home.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Home 4 | has_children: true 5 | nav_order: 1 6 | --- 7 | 8 | # Hack The Box v4 API Community Documentation 9 | 10 | 11 | ## Welcome to the community documentation for the Hack The Box v4 API! 12 | In celebration of the new API and site release, I am organizing available information about API endpoints and data types. I hope it will be helpful to the developers who want to create their own HTB-integrated tools (e.g. Discord bots, progress tracker, shortest-path-to-rank algorithm). Let me know what you make! 13 | Pages in this wiki are organized according to the API structure. You may use the find feature to search for a specific method or functionality. 14 | 15 | ### Contributions 16 | Contributions are very welcome! If you know about an endpoint that's not listed here, or have a correction for the existing documentation, please feel free to get in touch with me or contribute directly to the wiki. 17 | 18 | Happy Hacking 👋 -------------------------------------------------------------------------------- /_sass/tables.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Tables 3 | // 4 | // stylelint-disable max-nesting-depth, selector-no-type, selector-max-type 5 | 6 | .table-wrapper { 7 | display: block; 8 | width: 100%; 9 | max-width: 100%; 10 | margin-bottom: $sp-5; 11 | overflow-x: auto; 12 | border-radius: $border-radius; 13 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); 14 | } 15 | 16 | table { 17 | display: table; 18 | min-width: 100%; 19 | border-collapse: separate; 20 | } 21 | 22 | th, 23 | td { 24 | @include fs-3; 25 | min-width: 120px; 26 | padding-top: $sp-2; 27 | padding-right: $sp-3; 28 | padding-bottom: $sp-2; 29 | padding-left: $sp-3; 30 | background-color: $table-background-color; 31 | border-bottom: $border rgba($border-color, 0.5); 32 | border-left: $border $border-color; 33 | 34 | &:first-of-type { 35 | border-left: 0; 36 | } 37 | } 38 | 39 | tbody { 40 | tr { 41 | &:last-of-type { 42 | th, 43 | td { 44 | border-bottom: 0; 45 | } 46 | 47 | td { 48 | padding-bottom: $sp-3; 49 | } 50 | } 51 | } 52 | } 53 | 54 | thead { 55 | th { 56 | border-bottom: $border $border-color; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | # Hello! This is where you manage which Jekyll version is used to run. 3 | # When you want to use a different version, change it below, save the 4 | # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: 5 | # 6 | # bundle exec jekyll serve 7 | # 8 | # This will help ensure the proper Jekyll version is running. 9 | # Happy Jekylling! 10 | gem "jekyll", "~> 4.1.1" 11 | 12 | gem "just-the-docs" 13 | # This is the default theme for new Jekyll sites. You may change this to anything you like. 14 | gem "minima", "~> 2.5" 15 | # If you want to use GitHub Pages, remove the "gem "jekyll"" above and 16 | # uncomment the line below. To upgrade, run `bundle update github-pages`. 17 | # gem "github-pages", group: :jekyll_plugins 18 | # If you have any plugins, put them here! 19 | group :jekyll_plugins do 20 | gem 'jekyll-commonmark-ghpages' 21 | gem "jekyll-feed", "~> 0.12" 22 | end 23 | 24 | # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem 25 | # and associated library. 26 | platforms :mingw, :x64_mingw, :mswin, :jruby do 27 | gem "tzinfo", "~> 1.2" 28 | gem "tzinfo-data" 29 | end 30 | 31 | # Performance-booster for watching directories on Windows 32 | gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hack The Box v4 API Community Documentation 2 | 3 | 4 | #### ❗ **NOTICE**: 5 | > *I have started maintaining the API documentation via a Postman collection as it's simply more convenient, both to allow you to demo the API yourself, and for me to arrange everything in one place.* 6 | 7 | ## 👋 Welcome to the community documentation for the Hack The Box v4 API! 8 | In celebration of the new API and site release, I am organizing available information about API endpoints and data types via a public Postman collection (see below). I hope it will be helpful to the developers who want to create their own HTB-integrated tools (e.g. Discord bots, progress tracker, shortest-path-to-rank algorithm). Let me know what you make! 9 | 10 | ## 🔮 Start here: 11 | Please find the current, 111+ endpoint documentation here: 12 | [HTB v4 API Documentation (via Postman)](https://documenter.getpostman.com/view/13129365/TVeqbmeq) 13 | 14 | 15 | ## 💡 Contributions 16 | 17 | Contributions are very welcome! If you would like to be added as a contributor to the Postman project, please feel free to get in touch with me on [Twitter](https://twitter.com/Propolis709). 18 | 19 | Happy Hacking 👋 20 | -------------------------------------------------------------------------------- /_sass/utilities/_typography.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes for typography 3 | // 4 | 5 | // stylelint-disable primer/selector-no-utility, primer/no-override 6 | 7 | .fs-1 { 8 | @include fs-1; 9 | } 10 | 11 | .fs-2 { 12 | @include fs-2; 13 | } 14 | 15 | .fs-3 { 16 | @include fs-3; 17 | } 18 | 19 | .fs-4 { 20 | @include fs-4; 21 | } 22 | 23 | .fs-5 { 24 | @include fs-5; 25 | } 26 | 27 | .fs-6 { 28 | @include fs-6; 29 | } 30 | 31 | .fs-7 { 32 | @include fs-7; 33 | } 34 | 35 | .fs-8 { 36 | @include fs-8; 37 | } 38 | 39 | .fs-9 { 40 | @include fs-9; 41 | } 42 | 43 | .fs-10 { 44 | @include fs-10; 45 | } 46 | 47 | .fw-300 { 48 | font-weight: 300 !important; 49 | } 50 | 51 | .fw-400 { 52 | font-weight: 400 !important; 53 | } 54 | 55 | .fw-500 { 56 | font-weight: 500 !important; 57 | } 58 | 59 | .fw-700 { 60 | font-weight: 700 !important; 61 | } 62 | 63 | .lh-0 { 64 | line-height: 0 !important; 65 | } 66 | 67 | .lh-default { 68 | line-height: $body-line-height; 69 | } 70 | 71 | .lh-tight { 72 | line-height: $body-heading-line-height; 73 | } 74 | 75 | .ls-5 { 76 | letter-spacing: 0.05em !important; 77 | } 78 | 79 | .ls-10 { 80 | letter-spacing: 0.1em !important; 81 | } 82 | 83 | .ls-0 { 84 | letter-spacing: 0 !important; 85 | } 86 | 87 | .text-uppercase { 88 | text-transform: uppercase !important; 89 | } 90 | 91 | // stylelint-enable primer/selector-no-utility 92 | -------------------------------------------------------------------------------- /_sass/support/mixins/_typography.scss: -------------------------------------------------------------------------------- 1 | // Font size 2 | 3 | @mixin fs-1 { 4 | font-size: 9px !important; 5 | 6 | @include mq(sm) { 7 | font-size: 10px !important; 8 | } 9 | } 10 | 11 | @mixin fs-2 { 12 | font-size: 11px !important; 13 | 14 | @include mq(sm) { 15 | font-size: 12px !important; 16 | } 17 | } 18 | 19 | @mixin fs-3 { 20 | font-size: 12px !important; 21 | 22 | @include mq(sm) { 23 | font-size: 14px !important; 24 | } 25 | } 26 | 27 | @mixin fs-4 { 28 | font-size: 15px !important; 29 | 30 | @include mq(sm) { 31 | font-size: 16px !important; 32 | } 33 | } 34 | 35 | @mixin fs-5 { 36 | font-size: 16px !important; 37 | 38 | @include mq(sm) { 39 | font-size: 18px !important; 40 | } 41 | } 42 | 43 | @mixin fs-6 { 44 | font-size: 18px !important; 45 | 46 | @include mq(sm) { 47 | font-size: 24px !important; 48 | line-height: $body-heading-line-height; 49 | } 50 | } 51 | 52 | @mixin fs-7 { 53 | font-size: 24px !important; 54 | line-height: $body-heading-line-height; 55 | 56 | @include mq(sm) { 57 | font-size: 32px !important; 58 | } 59 | } 60 | 61 | @mixin fs-8 { 62 | font-size: 32px !important; 63 | line-height: $body-heading-line-height; 64 | 65 | @include mq(sm) { 66 | font-size: 36px !important; 67 | } 68 | } 69 | 70 | @mixin fs-9 { 71 | font-size: 36px !important; 72 | line-height: $body-heading-line-height; 73 | 74 | @include mq(sm) { 75 | font-size: 42px !important; 76 | } 77 | } 78 | 79 | @mixin fs-10 { 80 | font-size: 42px !important; 81 | line-height: $body-heading-line-height; 82 | 83 | @include mq(sm) { 84 | font-size: 48px !important; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /_sass/base.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Base element style overrides 3 | // 4 | // stylelint-disable selector-no-type, selector-max-type 5 | 6 | * { 7 | box-sizing: border-box; 8 | } 9 | 10 | ::selection { 11 | color: $white; 12 | background: $link-color; 13 | } 14 | 15 | html { 16 | @include fs-4; 17 | scroll-behavior: smooth; 18 | } 19 | 20 | body { 21 | font-family: $body-font-family; 22 | font-size: inherit; 23 | line-height: $body-line-height; 24 | color: $body-text-color; 25 | background-color: $body-background-color; 26 | } 27 | 28 | ol, 29 | ul, 30 | dl, 31 | pre, 32 | address, 33 | blockquote, 34 | table, 35 | div, 36 | hr, 37 | form, 38 | fieldset, 39 | noscript .table-wrapper { 40 | margin-top: 0; 41 | } 42 | 43 | h1, 44 | h2, 45 | h3, 46 | h4, 47 | h5, 48 | h6 { 49 | margin-top: 0; 50 | margin-bottom: 1em; 51 | font-weight: 500; 52 | line-height: $body-heading-line-height; 53 | color: $body-heading-color; 54 | } 55 | 56 | p { 57 | margin-top: 1em; 58 | margin-bottom: 1em; 59 | } 60 | 61 | a { 62 | color: $link-color; 63 | text-decoration: none; 64 | } 65 | 66 | a:not([class]) { 67 | text-decoration: none; 68 | background-image: linear-gradient($border-color 0%, $border-color 100%); 69 | background-repeat: repeat-x; 70 | background-position: 0 100%; 71 | background-size: 1px 1px; 72 | 73 | &:hover { 74 | background-image: linear-gradient( 75 | rgba($link-color, 0.45) 0%, 76 | rgba($link-color, 0.45) 100% 77 | ); 78 | background-size: 1px 1px; 79 | } 80 | } 81 | 82 | code { 83 | font-family: $mono-font-family; 84 | font-size: 0.75em; 85 | line-height: $body-line-height; 86 | } 87 | 88 | figure, 89 | pre { 90 | margin: 0; 91 | } 92 | 93 | li { 94 | margin: 0.25em 0; 95 | } 96 | 97 | img { 98 | max-width: 100%; 99 | height: auto; 100 | } 101 | 102 | hr { 103 | height: 1px; 104 | padding: 0; 105 | margin: $sp-6 0; 106 | background-color: $border-color; 107 | border: 0; 108 | } 109 | -------------------------------------------------------------------------------- /_sass/utilities/_layout.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable primer/selector-no-utility, primer/no-override 2 | // 3 | // Utility classes for layout 4 | // 5 | 6 | // Display 7 | 8 | .d-block { 9 | display: block !important; 10 | } 11 | .d-flex { 12 | display: flex !important; 13 | } 14 | .d-inline { 15 | display: inline !important; 16 | } 17 | .d-inline-block { 18 | display: inline-block !important; 19 | } 20 | .d-none { 21 | display: none !important; 22 | } 23 | 24 | @each $media-query in map-keys($media-queries) { 25 | @for $i from 1 through length($spacers) { 26 | @include mq($media-query) { 27 | $size: #{map-get($spacers, sp-#{$i - 1})}; 28 | $scale: #{$i - 1}; 29 | 30 | // .d-sm-block, .d-md-none, .d-lg-inline 31 | .d-#{$media-query}-block { 32 | display: block !important; 33 | } 34 | .d-#{$media-query}-flex { 35 | display: flex !important; 36 | } 37 | .d-#{$media-query}-inline { 38 | display: inline !important; 39 | } 40 | .d-#{$media-query}-inline-block { 41 | display: inline-block !important; 42 | } 43 | .d-#{$media-query}-none { 44 | display: none !important; 45 | } 46 | } 47 | } 48 | } 49 | 50 | // Horizontal alignment 51 | 52 | .float-left { 53 | float: left !important; 54 | } 55 | 56 | .float-right { 57 | float: right !important; 58 | } 59 | 60 | .flex-justify-start { 61 | justify-content: flex-start !important; 62 | } 63 | 64 | .flex-justify-end { 65 | justify-content: flex-end !important; 66 | } 67 | 68 | .flex-justify-between { 69 | justify-content: space-between !important; 70 | } 71 | 72 | .flex-justify-around { 73 | justify-content: space-around !important; 74 | } 75 | 76 | // Vertical alignment 77 | 78 | .v-align-baseline { 79 | vertical-align: baseline !important; 80 | } 81 | .v-align-bottom { 82 | vertical-align: bottom !important; 83 | } 84 | .v-align-middle { 85 | vertical-align: middle !important; 86 | } 87 | .v-align-text-bottom { 88 | vertical-align: text-bottom !important; 89 | } 90 | .v-align-text-top { 91 | vertical-align: text-top !important; 92 | } 93 | .v-align-top { 94 | vertical-align: top !important; 95 | } 96 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Welcome to Jekyll! 2 | # 3 | # This config file is meant for settings that affect your whole blog, values 4 | # which you are expected to set up once and rarely edit after that. If you find 5 | # yourself editing this file very often, consider using Jekyll's data files 6 | # feature for the data you need to update frequently. 7 | # 8 | # For technical reasons, this file is *NOT* reloaded automatically when you use 9 | # 'bundle exec jekyll serve'. If you change this file, please restart the server process. 10 | # 11 | # If you need help with YAML syntax, here are some quick references for you: 12 | # https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml 13 | # https://learnxinyminutes.com/docs/yaml/ 14 | # 15 | # Site settings 16 | # These are used to personalize your new site. If you look in the HTML files, 17 | # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. 18 | # You can create any custom variable you would like, and they will be accessible 19 | # in the templates via {{ site.myvariable }}. 20 | 21 | title: HTB API v4 Reference 22 | email: propolis@bugcrowdninja.com 23 | description: >- # this means to ignore newlines until "baseurl:" 24 | The Unofficial Hack The Box v4 API Reference. 25 | baseurl: "" # the subpath of your site, e.g. /blog 26 | url: "" # the base hostname & protocol for your site, e.g. http://example.com 27 | twitter_username: Propolis709 28 | github_username: Propolisa 29 | 30 | 31 | # Build settings 32 | remote_theme: pmarsceill/just-the-docs 33 | color_scheme: dark 34 | markdown: CommonMarkGhPages 35 | plugins: 36 | - jekyll-feed 37 | 38 | # Exclude from processing. 39 | # The following items will not be processed, by default. 40 | # Any item listed under the `exclude:` key here will be automatically added to 41 | # the internal "default list". 42 | # 43 | # Excluded items can be processed by explicitly listing the directories or 44 | # their entries' file path in the `include:` list. 45 | # 46 | # exclude: 47 | # - .sass-cache/ 48 | # - .jekyll-cache/ 49 | # - gemfiles/ 50 | # - Gemfile 51 | # - Gemfile.lock 52 | # - node_modules/ 53 | # - vendor/bundle/ 54 | # - vendor/cache/ 55 | # - vendor/gems/ 56 | # - vendor/ruby/ 57 | -------------------------------------------------------------------------------- /_sass/buttons.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Buttons and things that look like buttons 3 | // 4 | // stylelint-disable color-named 5 | 6 | .btn { 7 | display: inline-block; 8 | box-sizing: border-box; 9 | padding-top: 0.3em; 10 | padding-right: 1em; 11 | padding-bottom: 0.3em; 12 | padding-left: 1em; 13 | margin: 0; 14 | font-family: inherit; 15 | font-size: inherit; 16 | font-weight: 500; 17 | line-height: 1.5; 18 | color: $link-color; 19 | text-decoration: none; 20 | vertical-align: baseline; 21 | cursor: pointer; 22 | background-color: $base-button-color; 23 | border-width: 0; 24 | border-radius: $border-radius; 25 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); 26 | appearance: none; 27 | 28 | &:focus { 29 | text-decoration: none; 30 | outline: none; 31 | box-shadow: 0 0 0 3px rgba(blue, 0.25); 32 | } 33 | 34 | &:focus:hover, 35 | &.selected:focus { 36 | box-shadow: 0 0 0 3px rgba(blue, 0.25); 37 | } 38 | 39 | &:hover, 40 | &.zeroclipboard-is-hover { 41 | color: darken($link-color, 2%); 42 | } 43 | 44 | &:hover, 45 | &:active, 46 | &.zeroclipboard-is-hover, 47 | &.zeroclipboard-is-active { 48 | text-decoration: none; 49 | background-color: darken($base-button-color, 1%); 50 | } 51 | 52 | &:active, 53 | &.selected, 54 | &.zeroclipboard-is-active { 55 | background-color: darken($base-button-color, 3%); 56 | background-image: none; 57 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); 58 | } 59 | 60 | &.selected:hover { 61 | background-color: darken(#dcdcdc, 5%); 62 | } 63 | 64 | &:disabled, 65 | &.disabled { 66 | &, 67 | &:hover { 68 | color: rgba(102, 102, 102, 0.5); 69 | cursor: default; 70 | background-color: rgba(229, 229, 229, 0.5); 71 | background-image: none; 72 | box-shadow: none; 73 | } 74 | } 75 | } 76 | 77 | .btn-outline { 78 | color: $link-color; 79 | background: transparent; 80 | box-shadow: inset 0 0 0 2px $grey-lt-300; 81 | 82 | &:hover, 83 | &:active, 84 | &.zeroclipboard-is-hover, 85 | &.zeroclipboard-is-active { 86 | color: darken($link-color, 4%); 87 | text-decoration: none; 88 | background-color: transparent; 89 | box-shadow: inset 0 0 0 3px $grey-lt-300; 90 | } 91 | 92 | &:focus { 93 | text-decoration: none; 94 | outline: none; 95 | box-shadow: inset 0 0 0 2px $grey-dk-100, 0 0 0 3px rgba(blue, 0.25); 96 | } 97 | 98 | &:focus:hover, 99 | &.selected:focus { 100 | box-shadow: inset 0 0 0 2px $grey-dk-100; 101 | } 102 | } 103 | 104 | .btn-primary { 105 | @include btn-color($white, $btn-primary-color); 106 | } 107 | 108 | .btn-purple { 109 | @include btn-color($white, $purple-100); 110 | } 111 | 112 | .btn-blue { 113 | @include btn-color($white, $blue-000); 114 | } 115 | 116 | .btn-green { 117 | @include btn-color($white, $green-100); 118 | } 119 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | addressable (2.7.0) 5 | public_suffix (>= 2.0.2, < 5.0) 6 | colorator (1.1.0) 7 | commonmarker (0.17.13) 8 | ruby-enum (~> 0.5) 9 | concurrent-ruby (1.1.6) 10 | em-websocket (0.5.1) 11 | eventmachine (>= 0.12.9) 12 | http_parser.rb (~> 0.6.0) 13 | eventmachine (1.2.7-x64-mingw32) 14 | ffi (1.13.1-x64-mingw32) 15 | forwardable-extended (2.6.0) 16 | http_parser.rb (0.6.0) 17 | i18n (1.8.3) 18 | concurrent-ruby (~> 1.0) 19 | jekyll (4.1.1) 20 | addressable (~> 2.4) 21 | colorator (~> 1.0) 22 | em-websocket (~> 0.5) 23 | i18n (~> 1.0) 24 | jekyll-sass-converter (~> 2.0) 25 | jekyll-watch (~> 2.0) 26 | kramdown (~> 2.1) 27 | kramdown-parser-gfm (~> 1.0) 28 | liquid (~> 4.0) 29 | mercenary (~> 0.4.0) 30 | pathutil (~> 0.9) 31 | rouge (~> 3.0) 32 | safe_yaml (~> 1.0) 33 | terminal-table (~> 1.8) 34 | jekyll-commonmark (1.3.1) 35 | commonmarker (~> 0.14) 36 | jekyll (>= 3.7, < 5.0) 37 | jekyll-commonmark-ghpages (0.1.6) 38 | commonmarker (~> 0.17.6) 39 | jekyll-commonmark (~> 1.2) 40 | rouge (>= 2.0, < 4.0) 41 | jekyll-feed (0.14.0) 42 | jekyll (>= 3.7, < 5.0) 43 | jekyll-sass-converter (2.1.0) 44 | sassc (> 2.0.1, < 3.0) 45 | jekyll-seo-tag (2.6.1) 46 | jekyll (>= 3.3, < 5.0) 47 | jekyll-watch (2.2.1) 48 | listen (~> 3.0) 49 | just-the-docs (0.3.0) 50 | jekyll (>= 3.8.5) 51 | jekyll-seo-tag (~> 2.0) 52 | rake (>= 12.3.1, < 13.1.0) 53 | kramdown (2.3.0) 54 | rexml 55 | kramdown-parser-gfm (1.1.0) 56 | kramdown (~> 2.0) 57 | liquid (4.0.3) 58 | listen (3.2.1) 59 | rb-fsevent (~> 0.10, >= 0.10.3) 60 | rb-inotify (~> 0.9, >= 0.9.10) 61 | mercenary (0.4.0) 62 | minima (2.5.1) 63 | jekyll (>= 3.5, < 5.0) 64 | jekyll-feed (~> 0.9) 65 | jekyll-seo-tag (~> 2.1) 66 | pathutil (0.16.2) 67 | forwardable-extended (~> 2.6) 68 | public_suffix (4.0.5) 69 | rake (13.0.1) 70 | rb-fsevent (0.10.4) 71 | rb-inotify (0.10.1) 72 | ffi (~> 1.0) 73 | rexml (3.2.4) 74 | rouge (3.20.0) 75 | ruby-enum (0.8.0) 76 | i18n 77 | safe_yaml (1.0.5) 78 | sassc (2.4.0-x64-mingw32) 79 | ffi (~> 1.9) 80 | terminal-table (1.8.0) 81 | unicode-display_width (~> 1.1, >= 1.1.1) 82 | thread_safe (0.3.6) 83 | tzinfo (1.2.7) 84 | thread_safe (~> 0.1) 85 | tzinfo-data (1.2020.1) 86 | tzinfo (>= 1.0.0) 87 | unicode-display_width (1.7.0) 88 | wdm (0.1.1) 89 | 90 | PLATFORMS 91 | x64-mingw32 92 | 93 | DEPENDENCIES 94 | jekyll (~> 4.1.1) 95 | jekyll-commonmark-ghpages 96 | jekyll-feed (~> 0.12) 97 | just-the-docs 98 | minima (~> 2.5) 99 | tzinfo (~> 1.2) 100 | tzinfo-data 101 | wdm (~> 0.1.1) 102 | 103 | BUNDLED WITH 104 | 2.1.4 105 | -------------------------------------------------------------------------------- /assets/js/zzzz-search-data.json: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /assets/js/search-data.json 3 | --- 4 | { 5 | {%- assign i = 0 -%} 6 | {% for page in site.html_pages %} 7 | {%- if page.title and page.search_exclude != true -%} 8 | {%- assign page_content = page.content -%} 9 | {%- assign heading_level = site.search.heading_level | default: 2 -%} 10 | {%- for j in (2..heading_level) -%} 11 | {%- assign tag = '' -%} 19 | {%- assign title = titleAndContent[0] | replace_first: '>', '

' | split: '

' -%} 20 | {%- assign title = title[1] | strip_html -%} 21 | {%- assign content = titleAndContent[1] -%} 22 | {%- assign url = page.url -%} 23 | {%- if title == page.title and parts[0] == '' -%} 24 | {%- assign title_found = true -%} 25 | {%- else -%} 26 | {%- assign id = titleAndContent[0] -%} 27 | {%- assign id = id | split: 'id="' -%} 28 | {%- if id.size == 2 -%} 29 | {%- assign id = id[1] -%} 30 | {%- assign id = id | split: '"' -%} 31 | {%- assign id = id[0] -%} 32 | {%- capture url -%}{{ url | append: '#' | append: id }}{%- endcapture -%} 33 | {%- endif -%} 34 | {%- endif -%} 35 | {%- unless i == 0 -%},{%- endunless -%} 36 | "{{ i }}": { 37 | "doc": {{ page.title | jsonify }}, 38 | "title": {{ title | jsonify }}, 39 | "content": {{ content | replace: ' 2 | {%- assign ordered_pages_list = site.html_pages | where_exp:"item", "item.nav_order != nil" -%} 3 | {%- assign unordered_pages_list = site.html_pages | where_exp:"item", "item.nav_order == nil" -%} 4 | {%- if site.nav_sort == 'case_insensitive' -%} 5 | {%- assign sorted_ordered_pages_list = ordered_pages_list | sort_natural:"nav_order" -%} 6 | {%- assign sorted_unordered_pages_list = unordered_pages_list | sort_natural:"title" -%} 7 | {%- else -%} 8 | {%- assign sorted_ordered_pages_list = ordered_pages_list | sort:"nav_order" -%} 9 | {%- assign sorted_unordered_pages_list = unordered_pages_list | sort:"title" -%} 10 | {%- endif -%} 11 | {%- assign pages_list = sorted_ordered_pages_list | concat: sorted_unordered_pages_list -%} 12 | {%- for node in pages_list -%} 13 | {%- unless node.nav_exclude -%} 14 | {%- if node.parent == nil and node.title -%} 15 | 52 | {%- endif -%} 53 | {%- endunless -%} 54 | {%- endfor -%} 55 | 56 | -------------------------------------------------------------------------------- /_sass/monokai.scss: -------------------------------------------------------------------------------- 1 | .highlight pre { background-color: #272822; } 2 | .highlight .hll { background-color: #272822; } 3 | .highlight .c { color: #75715e } /* Comment */ 4 | .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ 5 | .highlight .k { color: #66d9ef } /* Keyword */ 6 | .highlight .l { color: #ae81ff } /* Literal */ 7 | .highlight .n { color: #f8f8f2 } /* Name */ 8 | .highlight .o { color: #f92672 } /* Operator */ 9 | .highlight .p { color: #f8f8f2 } /* Punctuation */ 10 | .highlight .cm { color: #75715e } /* Comment.Multiline */ 11 | .highlight .cp { color: #75715e } /* Comment.Preproc */ 12 | .highlight .c1 { color: #75715e } /* Comment.Single */ 13 | .highlight .cs { color: #75715e } /* Comment.Special */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 16 | .highlight .kc { color: #66d9ef } /* Keyword.Constant */ 17 | .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ 18 | .highlight .kn { color: #f92672 } /* Keyword.Namespace */ 19 | .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ 20 | .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ 21 | .highlight .kt { color: #66d9ef } /* Keyword.Type */ 22 | .highlight .ld { color: #e6db74 } /* Literal.Date */ 23 | .highlight .m { color: #ae81ff } /* Literal.Number */ 24 | .highlight .s { color: #e6db74 } /* Literal.String */ 25 | .highlight .na { color: #a6e22e } /* Name.Attribute */ 26 | .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ 27 | .highlight .nc { color: #a6e22e } /* Name.Class */ 28 | .highlight .no { color: #66d9ef } /* Name.Constant */ 29 | .highlight .nd { color: #a6e22e } /* Name.Decorator */ 30 | .highlight .ni { color: #f8f8f2 } /* Name.Entity */ 31 | .highlight .ne { color: #a6e22e } /* Name.Exception */ 32 | .highlight .nf { color: #a6e22e } /* Name.Function */ 33 | .highlight .nl { color: #f8f8f2 } /* Name.Label */ 34 | .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ 35 | .highlight .nx { color: #a6e22e } /* Name.Other */ 36 | .highlight .py { color: #f8f8f2 } /* Name.Property */ 37 | .highlight .nt { color: #f92672 } /* Name.Tag */ 38 | .highlight .nv { color: #f8f8f2 } /* Name.Variable */ 39 | .highlight .ow { color: #f92672 } /* Operator.Word */ 40 | .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ 41 | .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ 42 | .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #e6db74 } /* Literal.String.Char */ 47 | .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ 49 | .highlight .se { color: #ae81ff } /* Literal.String.Escape */ 50 | .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #e6db74 } /* Literal.String.Other */ 53 | .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ 55 | .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ 61 | 62 | .highlight .gh { } /* Generic Heading & Diff Header */ 63 | .highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ 64 | .highlight .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ 65 | .highlight .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ 66 | -------------------------------------------------------------------------------- /_sass/content.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | // 4 | // Styles for rendered markdown in the .main-content container 5 | // 6 | // stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type 7 | 8 | .main-content { 9 | line-height: $content-line-height; 10 | 11 | ol, 12 | ul, 13 | dl, 14 | pre, 15 | address, 16 | blockquote, 17 | .table-wrapper { 18 | margin-top: 0.5em; 19 | } 20 | 21 | a { 22 | overflow: hidden; 23 | text-overflow: ellipsis; 24 | white-space: nowrap; 25 | } 26 | 27 | ul, 28 | ol { 29 | padding-left: 1.5em; 30 | } 31 | 32 | li { 33 | .highlight { 34 | margin-top: $sp-1; 35 | } 36 | } 37 | 38 | ol { 39 | list-style-type: none; 40 | counter-reset: step-counter; 41 | 42 | > li { 43 | position: relative; 44 | 45 | &::before { 46 | position: absolute; 47 | top: 0.2em; 48 | left: -1.6em; 49 | color: $grey-dk-000; 50 | content: counter(step-counter); 51 | counter-increment: step-counter; 52 | @include fs-3; 53 | 54 | @include mq(sm) { 55 | top: 0.11em; 56 | } 57 | } 58 | 59 | ol { 60 | counter-reset: sub-counter; 61 | 62 | li { 63 | &::before { 64 | content: counter(sub-counter, lower-alpha); 65 | counter-increment: sub-counter; 66 | } 67 | } 68 | } 69 | } 70 | } 71 | 72 | ul { 73 | list-style: none; 74 | 75 | > li { 76 | &::before { 77 | position: absolute; 78 | margin-left: -1.4em; 79 | color: $grey-dk-000; 80 | content: "•"; 81 | } 82 | } 83 | } 84 | 85 | .task-list { 86 | padding-left: 0; 87 | } 88 | 89 | .task-list-item { 90 | display: flex; 91 | align-items: center; 92 | 93 | &::before { 94 | content: ""; 95 | } 96 | } 97 | 98 | .task-list-item-checkbox { 99 | margin-right: 0.6em; 100 | } 101 | 102 | hr + * { 103 | margin-top: 0; 104 | } 105 | 106 | h1:first-of-type { 107 | margin-top: 0.5em; 108 | } 109 | 110 | dl { 111 | display: grid; 112 | grid-template-columns: max-content 1fr; 113 | } 114 | 115 | dt, 116 | dd { 117 | margin: 0.25em 0; 118 | } 119 | 120 | dt { 121 | text-align: right; 122 | 123 | &::after { 124 | content: ":"; 125 | } 126 | } 127 | 128 | dd { 129 | margin-left: 1em; 130 | font-weight: 500; 131 | } 132 | 133 | .anchor-heading { 134 | position: absolute; 135 | right: -$sp-4; 136 | width: $sp-5; 137 | height: 100%; 138 | padding-right: $sp-1; 139 | padding-left: $sp-1; 140 | overflow: visible; 141 | 142 | @include mq(md) { 143 | right: auto; 144 | left: -$sp-5; 145 | } 146 | 147 | svg { 148 | display: inline-block; 149 | width: 100%; 150 | height: 100%; 151 | color: $link-color; 152 | visibility: hidden; 153 | } 154 | } 155 | 156 | .anchor-heading:hover, 157 | h1:hover > .anchor-heading, 158 | h2:hover > .anchor-heading, 159 | h3:hover > .anchor-heading, 160 | h4:hover > .anchor-heading, 161 | h5:hover > .anchor-heading, 162 | h6:hover > .anchor-heading { 163 | svg { 164 | visibility: visible; 165 | } 166 | } 167 | 168 | summary { 169 | cursor: pointer; 170 | } 171 | 172 | h1, 173 | h2, 174 | h3, 175 | h4, 176 | h5, 177 | h6 { 178 | position: relative; 179 | margin-top: 1.5em; 180 | margin-bottom: 1em; 181 | 182 | &:first-child { 183 | margin-top: $sp-2; 184 | } 185 | 186 | + table, 187 | + .table-wrapper, 188 | + .code-example, 189 | + .highlighter-rouge { 190 | margin-top: 1em; 191 | } 192 | 193 | + p { 194 | margin-top: 0; 195 | } 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /_sass/layout.scss: -------------------------------------------------------------------------------- 1 | // 2 | // The basic two column layout 3 | // 4 | 5 | .side-bar { 6 | z-index: 0; 7 | display: flex; 8 | flex-wrap: wrap; 9 | background-color: $sidebar-color; 10 | 11 | @include mq(md) { 12 | flex-wrap: nowrap; 13 | position: fixed; 14 | width: $nav-width-md; 15 | height: 100%; 16 | flex-direction: column; 17 | border-right: $border $border-color; 18 | align-items: flex-end; 19 | } 20 | 21 | @include mq(lg) { 22 | width: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width}); 23 | min-width: $nav-width; 24 | } 25 | } 26 | 27 | .main { 28 | @include mq(md) { 29 | position: relative; 30 | max-width: $content-width; 31 | margin-left: $nav-width-md; 32 | } 33 | 34 | @include mq(lg) { 35 | margin-left: calc( 36 | (100% - #{$nav-width + $content-width}) / 2 + #{$nav-width} 37 | ); 38 | } 39 | } 40 | 41 | .main-content-wrap { 42 | @include container; 43 | padding-top: $gutter-spacing-sm; 44 | padding-bottom: $gutter-spacing-sm; 45 | 46 | @include mq(md) { 47 | padding-top: $gutter-spacing; 48 | padding-bottom: $gutter-spacing; 49 | } 50 | } 51 | 52 | .main-header { 53 | z-index: 0; 54 | display: none; 55 | background-color: $sidebar-color; 56 | 57 | @include mq(md) { 58 | display: flex; 59 | justify-content: space-between; 60 | height: $header-height; 61 | background-color: $body-background-color; 62 | border-bottom: $border $border-color; 63 | } 64 | 65 | &.nav-open { 66 | display: block; 67 | 68 | @include mq(md) { 69 | display: flex; 70 | } 71 | } 72 | } 73 | 74 | .site-nav, 75 | .site-header, 76 | .site-footer { 77 | width: 100%; 78 | 79 | @include mq(lg) { 80 | width: $nav-width; 81 | } 82 | } 83 | 84 | .site-nav { 85 | display: none; 86 | 87 | &.nav-open { 88 | display: block; 89 | } 90 | 91 | @include mq(md) { 92 | display: block; 93 | padding-top: $sp-8; 94 | padding-bottom: $gutter-spacing-sm; 95 | overflow-y: auto; 96 | flex: 1 1 auto; 97 | } 98 | } 99 | 100 | .site-header { 101 | display: flex; 102 | min-height: $header-height; 103 | align-items: center; 104 | 105 | @include mq(md) { 106 | height: $header-height; 107 | max-height: $header-height; 108 | border-bottom: $border $border-color; 109 | } 110 | } 111 | 112 | .site-title { 113 | @include container; 114 | font-family: neue-haas-unica; 115 | font-weight: 600; 116 | flex-grow: 1; 117 | display: flex; 118 | height: 100%; 119 | align-items: center; 120 | padding-top: $sp-10; 121 | padding-bottom: $sp-10; 122 | color: $body-heading-color; 123 | @include fs-6; 124 | 125 | @include mq(md) { 126 | padding-top: $sp-8; 127 | padding-bottom: $sp-8; 128 | } 129 | } 130 | 131 | @if variable-exists(logo) { 132 | .site-logo { 133 | width: 100%; 134 | height: 100%; 135 | background-image: url($logo); 136 | background-repeat: no-repeat; 137 | background-position: left center; 138 | background-size: contain; 139 | } 140 | } 141 | 142 | .site-button { 143 | display: flex; 144 | height: 100%; 145 | padding: $gutter-spacing-sm; 146 | align-items: center; 147 | } 148 | 149 | @include mq(md) { 150 | .site-header .site-button { 151 | display: none; 152 | } 153 | } 154 | 155 | .site-title:hover { 156 | background-image: linear-gradient( 157 | -90deg, 158 | rgba($feedback-color, 1) 0%, 159 | rgba($feedback-color, 0.8) 80%, 160 | rgba($feedback-color, 0) 100% 161 | ); 162 | } 163 | 164 | .site-button:hover { 165 | background-image: linear-gradient( 166 | -90deg, 167 | rgba($feedback-color, 1) 0%, 168 | rgba($feedback-color, 0.8) 100% 169 | ); 170 | } 171 | 172 | // stylelint-disable selector-max-type 173 | 174 | body { 175 | position: relative; 176 | padding-bottom: $sp-10; 177 | overflow-y: scroll; 178 | 179 | @include mq(md) { 180 | position: static; 181 | padding-bottom: 0; 182 | } 183 | } 184 | 185 | // stylelint-enable selector-max-type 186 | 187 | .site-footer { 188 | @include container; 189 | position: absolute; 190 | bottom: 0; 191 | left: 0; 192 | padding-top: $sp-4; 193 | padding-bottom: $sp-4; 194 | color: $grey-dk-000; 195 | @include fs-2; 196 | 197 | @include mq(md) { 198 | position: static; 199 | justify-self: end; 200 | } 201 | } 202 | 203 | .icon { 204 | width: $sp-5; 205 | height: $sp-5; 206 | color: $link-color; 207 | } 208 | -------------------------------------------------------------------------------- /_sass/support/_variables.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Typography 3 | // 4 | 5 | @font-face { 6 | font-family: 'Titillium Web'; 7 | font-style: normal; 8 | font-weight: 300; 9 | src: 10 | url(fonts/titillium-web/titillium-web-light.woff) format('woff'), 11 | url(fonts/titillium-web/titillium-web-light.woff2) format('woff2'); 12 | } 13 | 14 | 15 | 16 | 17 | $body-font-family: -apple-system, BlinkMacSystemFont, "neue-haas-unica", 18 | helvetica, roboto, noto, "segoe ui", arial, sans-serif !default; 19 | $mono-font-family: "zeitung-mono", Menlo, Consolas, Monospace !default; 20 | $root-font-size: 16px !default; // Base font-size for rems 21 | $body-line-height: 1.4 !default; 22 | $content-line-height: 1.6 !default; 23 | $body-heading-line-height: 1.25 !default; 24 | 25 | // 26 | // Colors 27 | // 28 | 29 | $white: #f6f7fa !default; 30 | 31 | $grey-dk-000: #5b616b !default; 32 | $grey-dk-100: #434a55 !default; 33 | $grey-dk-200: #2c3440 !default; 34 | $grey-dk-250: #141d2b !default; 35 | $grey-dk-300: #121a27 !default; 36 | 37 | $grey-lt-000: #edeff5 !default; 38 | $grey-lt-100: #e4e8f0 !default; 39 | $grey-lt-200: #dbe0eb !default; 40 | $grey-lt-300: #d2d8e6 !default; 41 | 42 | $purple-000: #b233ff !default; 43 | $purple-100: #9f00ff !default; 44 | $purple-200: #7f00cc !default; 45 | $purple-300: #5f0099 !default; 46 | 47 | $blue-000: #339eff !default; 48 | $blue-100: #0086ff !default; 49 | $blue-200: #006bcc !default; 50 | $blue-300: #005eb3 !default; 51 | 52 | $green-000: #b2f233 !default; 53 | $green-100: #9fef00 !default; 54 | $green-200: #7fbf00 !default; 55 | $green-300: #6fa700 !default; 56 | 57 | $yellow-000: #ffbf33 !default; 58 | $yellow-100: #ffb71a !default; 59 | $yellow-200: #ffaf00 !default; 60 | $yellow-300: #e69e00 !default; 61 | 62 | $red-000: #ff6565 !default; 63 | $red-100: #ff5151 !default; 64 | $red-200: #ff3e3e !default; 65 | $red-300: #e63838 !default; 66 | 67 | $body-background-color: $white !default; 68 | $sidebar-color: $grey-lt-000 !default; 69 | $search-background-color: $white !default; 70 | $table-background-color: $white !default; 71 | $code-background-color: $grey-lt-000 !default; 72 | $feedback-color: darken($sidebar-color, 3%) !default; 73 | 74 | $body-text-color: $grey-dk-100 !default; 75 | $body-heading-color: $grey-dk-300 !default; 76 | $search-result-preview-color: $grey-dk-000 !default; 77 | $nav-child-link-color: $grey-dk-100 !default; 78 | $link-color: $purple-000 !default; 79 | $btn-primary-color: $purple-100 !default; 80 | $base-button-color: #f7f7f7 !default; 81 | 82 | // 83 | // Spacing 84 | // 85 | 86 | $spacing-unit: 1rem; // 1rem == 16px 87 | 88 | $spacers: ( 89 | sp-0: 0, 90 | sp-1: $spacing-unit * 0.25, 91 | sp-2: $spacing-unit * 0.5, 92 | sp-3: $spacing-unit * 0.75, 93 | sp-4: $spacing-unit, 94 | sp-5: $spacing-unit * 1.5, 95 | sp-6: $spacing-unit * 2, 96 | sp-7: $spacing-unit * 2.5, 97 | sp-8: $spacing-unit * 3, 98 | sp-9: $spacing-unit * 3.5, 99 | sp-10: $spacing-unit * 4, 100 | ) !default; 101 | 102 | $sp-1: map-get($spacers, sp-1) !default; // 0.25 rem == 4px 103 | $sp-2: map-get($spacers, sp-2) !default; // 0.5 rem == 8px 104 | $sp-3: map-get($spacers, sp-3) !default; // 0.75 rem == 12px 105 | $sp-4: map-get($spacers, sp-4) !default; // 1 rem == 16px 106 | $sp-5: map-get($spacers, sp-5) !default; // 1.5 rem == 24px 107 | $sp-6: map-get($spacers, sp-6) !default; // 2 rem == 32px 108 | $sp-7: map-get($spacers, sp-7) !default; // 2.5 rem == 40px 109 | $sp-8: map-get($spacers, sp-8) !default; // 3 rem == 48px 110 | $sp-9: map-get($spacers, sp-9) !default; // 3.5 rem == 56px 111 | $sp-10: map-get($spacers, sp-10) !default; // 4 rem == 64px 112 | 113 | // 114 | // Borders 115 | // 116 | 117 | $border: 1px solid !default; 118 | $border-radius: 4px !default; 119 | $border-color: $grey-lt-100 !default; 120 | 121 | // 122 | // Grid system 123 | // 124 | 125 | $gutter-spacing: $sp-6 !default; 126 | $gutter-spacing-sm: $sp-4 !default; 127 | $nav-width: 284px !default; 128 | $nav-width-md: 248px !default; 129 | $nav-list-item-height: $sp-6 !default; 130 | $nav-list-item-height-sm: $sp-8 !default; 131 | $nav-list-expander-right: true; 132 | $content-width: 800px !default; 133 | $header-height: 60px !default; 134 | $search-results-width: $content-width - $nav-width !default; 135 | $transition-duration: 400ms; 136 | 137 | // 138 | // Media queries in pixels 139 | // 140 | 141 | $media-queries: ( 142 | xs: 320px, 143 | sm: 500px, 144 | md: $content-width, 145 | lg: $content-width + $nav-width, 146 | xl: 1400px, 147 | ) !default; 148 | -------------------------------------------------------------------------------- /_sass/utilities/_spacing.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes for margins and padding 3 | // 4 | 5 | // scss-lint:disable SpaceAfterPropertyName 6 | // stylelint-disable block-opening-brace-space-after, block-opening-brace-space-before, primer/selector-no-utility, primer/no-override 7 | 8 | // Margin spacer utilities 9 | 10 | .mx-auto { 11 | margin-right: auto !important; 12 | margin-left: auto !important; 13 | } 14 | 15 | @for $i from 1 through length($spacers) { 16 | $size: #{map-get($spacers, sp-#{$i - 1})}; 17 | $scale: #{$i - 1}; 18 | 19 | // .m-0, .m-1, .m-2... 20 | .m-#{$scale} { 21 | margin: #{$size} !important; 22 | } 23 | .mt-#{$scale} { 24 | margin-top: #{$size} !important; 25 | } 26 | .mr-#{$scale} { 27 | margin-right: #{$size} !important; 28 | } 29 | .mb-#{$scale} { 30 | margin-bottom: #{$size} !important; 31 | } 32 | .ml-#{$scale} { 33 | margin-left: #{$size} !important; 34 | } 35 | 36 | .mx-#{$scale} { 37 | margin-right: #{$size} !important; 38 | margin-left: #{$size} !important; 39 | } 40 | 41 | .my-#{$scale} { 42 | margin-top: #{$size} !important; 43 | margin-bottom: #{$size} !important; 44 | } 45 | 46 | .mxn-#{$scale} { 47 | margin-right: -#{$size} !important; 48 | margin-left: -#{$size} !important; 49 | } 50 | .mx-#{$scale}-auto { 51 | margin-right: auto !important; 52 | margin-left: auto !important; 53 | } 54 | } 55 | 56 | @each $media-query in map-keys($media-queries) { 57 | @for $i from 1 through length($spacers) { 58 | @include mq($media-query) { 59 | $size: #{map-get($spacers, sp-#{$i - 1})}; 60 | $scale: #{$i - 1}; 61 | 62 | // .m-sm-0, .m-md-1, .m-lg-2... 63 | .m-#{$media-query}-#{$scale} { 64 | margin: #{$size} !important; 65 | } 66 | .mt-#{$media-query}-#{$scale} { 67 | margin-top: #{$size} !important; 68 | } 69 | .mr-#{$media-query}-#{$scale} { 70 | margin-right: #{$size} !important; 71 | } 72 | .mb-#{$media-query}-#{$scale} { 73 | margin-bottom: #{$size} !important; 74 | } 75 | .ml-#{$media-query}-#{$scale} { 76 | margin-left: #{$size} !important; 77 | } 78 | 79 | .mx-#{$media-query}-#{$scale} { 80 | margin-right: #{$size} !important; 81 | margin-left: #{$size} !important; 82 | } 83 | 84 | .my-#{$media-query}-#{$scale} { 85 | margin-top: #{$size} !important; 86 | margin-bottom: #{$size} !important; 87 | } 88 | 89 | .mxn-#{$media-query}-#{$scale} { 90 | margin-right: -#{$size} !important; 91 | margin-left: -#{$size} !important; 92 | } 93 | } 94 | } 95 | } 96 | 97 | // Padding spacer utilities 98 | 99 | @for $i from 1 through length($spacers) { 100 | $size: #{map-get($spacers, sp-#{$i - 1})}; 101 | $scale: #{$i - 1}; 102 | 103 | // .p-0, .p-1, .p-2... 104 | .p-#{$scale} { 105 | padding: #{$size} !important; 106 | } 107 | .pt-#{$scale} { 108 | padding-top: #{$size} !important; 109 | } 110 | .pr-#{$scale} { 111 | padding-right: #{$size} !important; 112 | } 113 | .pb-#{$scale} { 114 | padding-bottom: #{$size} !important; 115 | } 116 | .pl-#{$scale} { 117 | padding-left: #{$size} !important; 118 | } 119 | 120 | .px-#{$scale} { 121 | padding-right: #{$size} !important; 122 | padding-left: #{$size} !important; 123 | } 124 | 125 | .py-#{$scale} { 126 | padding-top: #{$size} !important; 127 | padding-bottom: #{$size} !important; 128 | } 129 | } 130 | 131 | @each $media-query in map-keys($media-queries) { 132 | @include mq($media-query) { 133 | @for $i from 1 through length($spacers) { 134 | $size: #{map-get($spacers, sp-#{$i - 1})}; 135 | $scale: #{$i - 1}; 136 | 137 | // .p-sm-0, .p-md-1, .p-lg-2... 138 | .p-#{$media-query}-#{$scale} { 139 | padding: #{$size} !important; 140 | } 141 | .pt-#{$media-query}-#{$scale} { 142 | padding-top: #{$size} !important; 143 | } 144 | .pr-#{$media-query}-#{$scale} { 145 | padding-right: #{$size} !important; 146 | } 147 | .pb-#{$media-query}-#{$scale} { 148 | padding-bottom: #{$size} !important; 149 | } 150 | .pl-#{$media-query}-#{$scale} { 151 | padding-left: #{$size} !important; 152 | } 153 | 154 | .px-#{$media-query}-#{$scale} { 155 | padding-right: #{$size} !important; 156 | padding-left: #{$size} !important; 157 | } 158 | 159 | .py-#{$media-query}-#{$scale} { 160 | padding-top: #{$size} !important; 161 | padding-bottom: #{$size} !important; 162 | } 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /_sass/utilities/_colors.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes for colors 3 | // 4 | 5 | // Text colors 6 | 7 | .text-grey-dk-000 { 8 | color: $grey-dk-000 !important; 9 | } 10 | 11 | .text-grey-dk-100 { 12 | color: $grey-dk-100 !important; 13 | } 14 | 15 | .text-grey-dk-200 { 16 | color: $grey-dk-200 !important; 17 | } 18 | 19 | .text-grey-dk-250 { 20 | color: $grey-dk-250 !important; 21 | } 22 | 23 | .text-grey-dk-300 { 24 | color: $grey-dk-300 !important; 25 | } 26 | 27 | .text-grey-lt-000 { 28 | color: $grey-lt-000 !important; 29 | } 30 | 31 | .text-grey-lt-100 { 32 | color: $grey-lt-100 !important; 33 | } 34 | 35 | .text-grey-lt-200 { 36 | color: $grey-lt-200 !important; 37 | } 38 | 39 | .text-grey-lt-300 { 40 | color: $grey-lt-300 !important; 41 | } 42 | 43 | .text-blue-000 { 44 | color: $blue-000 !important; 45 | } 46 | 47 | .text-blue-100 { 48 | color: $blue-100 !important; 49 | } 50 | 51 | .text-blue-200 { 52 | color: $blue-200 !important; 53 | } 54 | 55 | .text-blue-300 { 56 | color: $blue-300 !important; 57 | } 58 | 59 | .text-green-000 { 60 | color: $green-000 !important; 61 | } 62 | 63 | .text-green-100 { 64 | color: $green-100 !important; 65 | } 66 | 67 | .text-green-200 { 68 | color: $green-200 !important; 69 | } 70 | 71 | .text-green-300 { 72 | color: $green-300 !important; 73 | } 74 | 75 | .text-purple-000 { 76 | color: $purple-000 !important; 77 | } 78 | 79 | .text-purple-100 { 80 | color: $purple-100 !important; 81 | } 82 | 83 | .text-purple-200 { 84 | color: $purple-200 !important; 85 | } 86 | 87 | .text-purple-300 { 88 | color: $purple-300 !important; 89 | } 90 | 91 | .text-yellow-000 { 92 | color: $yellow-000 !important; 93 | } 94 | 95 | .text-yellow-100 { 96 | color: $yellow-100 !important; 97 | } 98 | 99 | .text-yellow-200 { 100 | color: $yellow-200 !important; 101 | } 102 | 103 | .text-yellow-300 { 104 | color: $yellow-300 !important; 105 | } 106 | 107 | .text-red-000 { 108 | color: $red-000 !important; 109 | } 110 | 111 | .text-red-100 { 112 | color: $red-100 !important; 113 | } 114 | 115 | .text-red-200 { 116 | color: $red-200 !important; 117 | } 118 | 119 | .text-red-300 { 120 | color: $red-300 !important; 121 | } 122 | 123 | // Background colors 124 | 125 | .bg-grey-dk-000 { 126 | background-color: $grey-dk-000 !important; 127 | } 128 | 129 | .bg-grey-dk-100 { 130 | background-color: $grey-dk-100 !important; 131 | } 132 | 133 | .bg-grey-dk-200 { 134 | background-color: $grey-dk-200 !important; 135 | } 136 | 137 | .bg-grey-dk-250 { 138 | background-color: $grey-dk-250 !important; 139 | } 140 | 141 | .bg-grey-dk-300 { 142 | background-color: $grey-dk-300 !important; 143 | } 144 | 145 | .bg-grey-lt-000 { 146 | background-color: $grey-lt-000 !important; 147 | } 148 | 149 | .bg-grey-lt-100 { 150 | background-color: $grey-lt-100 !important; 151 | } 152 | 153 | .bg-grey-lt-200 { 154 | background-color: $grey-lt-200 !important; 155 | } 156 | 157 | .bg-grey-lt-300 { 158 | background-color: $grey-lt-300 !important; 159 | } 160 | 161 | .bg-blue-000 { 162 | background-color: $blue-000 !important; 163 | } 164 | 165 | .bg-blue-100 { 166 | background-color: $blue-100 !important; 167 | } 168 | 169 | .bg-blue-200 { 170 | background-color: $blue-200 !important; 171 | } 172 | 173 | .bg-blue-300 { 174 | background-color: $blue-300 !important; 175 | } 176 | 177 | .bg-green-000 { 178 | background-color: $green-000 !important; 179 | } 180 | 181 | .bg-green-100 { 182 | background-color: $green-100 !important; 183 | } 184 | 185 | .bg-green-200 { 186 | background-color: $green-200 !important; 187 | } 188 | 189 | .bg-green-300 { 190 | background-color: $green-300 !important; 191 | } 192 | 193 | .bg-purple-000 { 194 | background-color: $purple-000 !important; 195 | } 196 | 197 | .bg-purple-100 { 198 | background-color: $purple-100 !important; 199 | } 200 | 201 | .bg-purple-200 { 202 | background-color: $purple-200 !important; 203 | } 204 | 205 | .bg-purple-300 { 206 | background-color: $purple-300 !important; 207 | } 208 | 209 | .bg-yellow-000 { 210 | background-color: $yellow-000 !important; 211 | } 212 | 213 | .bg-yellow-100 { 214 | background-color: $yellow-100 !important; 215 | } 216 | 217 | .bg-yellow-200 { 218 | background-color: $yellow-200 !important; 219 | } 220 | 221 | .bg-yellow-300 { 222 | background-color: $yellow-300 !important; 223 | } 224 | 225 | .bg-red-000 { 226 | background-color: $red-000 !important; 227 | } 228 | 229 | .bg-red-100 { 230 | background-color: $red-100 !important; 231 | } 232 | 233 | .bg-red-200 { 234 | background-color: $red-200 !important; 235 | } 236 | 237 | .bg-red-300 { 238 | background-color: $red-300 !important; 239 | } 240 | -------------------------------------------------------------------------------- /_sass/navigation.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Main nav, breadcrumb, etc... 3 | // 4 | // stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type, selector-max-specificity 5 | 6 | .nav-list { 7 | padding: 0; 8 | margin-top: 0; 9 | margin-bottom: 0; 10 | list-style: none; 11 | 12 | .nav-list-item { 13 | @include fs-4; 14 | position: relative; 15 | margin: 0; 16 | 17 | @include mq(md) { 18 | @include fs-3; 19 | } 20 | 21 | .nav-list-link { 22 | display: block; 23 | min-height: $nav-list-item-height-sm; 24 | padding-top: $sp-1; 25 | padding-bottom: $sp-1; 26 | line-height: #{$nav-list-item-height-sm - 2 * $sp-1}; 27 | @if $nav-list-expander-right { 28 | padding-right: $nav-list-item-height-sm; 29 | padding-left: $gutter-spacing-sm; 30 | } @else { 31 | padding-right: $gutter-spacing-sm; 32 | padding-left: $nav-list-item-height-sm; 33 | } 34 | 35 | @include mq(md) { 36 | min-height: $nav-list-item-height; 37 | line-height: #{$nav-list-item-height - 2 * $sp-1}; 38 | @if $nav-list-expander-right { 39 | padding-right: $nav-list-item-height; 40 | padding-left: $gutter-spacing; 41 | } @else { 42 | padding-right: $gutter-spacing; 43 | padding-left: $nav-list-item-height; 44 | } 45 | } 46 | 47 | &.active { 48 | font-weight: 600; 49 | text-decoration: none; 50 | } 51 | 52 | &:hover, 53 | &.active { 54 | background-image: linear-gradient( 55 | -90deg, 56 | rgba($feedback-color, 1) 0%, 57 | rgba($feedback-color, 0.8) 80%, 58 | rgba($feedback-color, 0) 100% 59 | ); 60 | } 61 | } 62 | 63 | .nav-list-expander { 64 | position: absolute; 65 | @if $nav-list-expander-right { 66 | right: 0; 67 | } 68 | width: $nav-list-item-height-sm; 69 | height: $nav-list-item-height-sm; 70 | padding-top: #{$nav-list-item-height-sm / 4}; 71 | padding-right: #{$nav-list-item-height-sm / 4}; 72 | padding-bottom: #{$nav-list-item-height-sm / 4}; 73 | padding-left: #{$nav-list-item-height-sm / 4}; 74 | color: $link-color; 75 | 76 | @include mq(md) { 77 | width: $nav-list-item-height; 78 | height: $nav-list-item-height; 79 | padding-top: #{$nav-list-item-height / 4}; 80 | padding-right: #{$nav-list-item-height / 4}; 81 | padding-bottom: #{$nav-list-item-height / 4}; 82 | padding-left: #{$nav-list-item-height / 4}; 83 | } 84 | 85 | &:hover { 86 | background-image: linear-gradient( 87 | -90deg, 88 | rgba($feedback-color, 1) 0%, 89 | rgba($feedback-color, 0.8) 100% 90 | ); 91 | } 92 | 93 | @if $nav-list-expander-right { 94 | svg { 95 | transform: rotate(90deg); 96 | } 97 | } 98 | } 99 | 100 | > .nav-list { 101 | display: none; 102 | padding-left: $sp-3; 103 | list-style: none; 104 | 105 | .nav-list-item { 106 | position: relative; 107 | 108 | .nav-list-link { 109 | color: $nav-child-link-color; 110 | } 111 | 112 | .nav-list-expander { 113 | color: $nav-child-link-color; 114 | } 115 | } 116 | } 117 | 118 | &.active { 119 | > .nav-list-expander svg { 120 | @if $nav-list-expander-right { 121 | transform: rotate(-90deg); 122 | } @else { 123 | transform: rotate(90deg); 124 | } 125 | } 126 | 127 | > .nav-list { 128 | display: block; 129 | } 130 | } 131 | } 132 | } 133 | 134 | // Aux nav 135 | 136 | .aux-nav { 137 | height: 100%; 138 | overflow-x: auto; 139 | @include fs-2; 140 | 141 | .aux-nav-list { 142 | display: flex; 143 | height: 100%; 144 | padding: 0; 145 | margin: 0; 146 | list-style: none; 147 | } 148 | 149 | .aux-nav-list-item { 150 | display: inline-block; 151 | height: 100%; 152 | padding: 0; 153 | margin: 0; 154 | } 155 | 156 | @include mq(md) { 157 | padding-right: $gutter-spacing-sm; 158 | } 159 | } 160 | 161 | // Breadcrumb nav 162 | 163 | .breadcrumb-nav { 164 | @include mq(md) { 165 | margin-top: -$sp-4; 166 | } 167 | } 168 | 169 | .breadcrumb-nav-list { 170 | padding-left: 0; 171 | margin-bottom: $sp-3; 172 | list-style: none; 173 | } 174 | 175 | .breadcrumb-nav-list-item { 176 | display: table-cell; 177 | @include fs-2; 178 | 179 | &::before { 180 | display: none; 181 | } 182 | 183 | &::after { 184 | display: inline-block; 185 | margin-right: $sp-2; 186 | margin-left: $sp-2; 187 | color: $grey-dk-000; 188 | content: "/"; 189 | } 190 | 191 | &:last-child { 192 | &::after { 193 | content: ""; 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /_sass/code.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Code and syntax highlighting 3 | // 4 | // stylelint-disable selector-no-qualifying-type, declaration-block-semicolon-newline-after,declaration-block-single-line-max-declarations, selector-no-type, selector-max-type 5 | 6 | code { 7 | padding: 0.2em 0.15em; 8 | font-weight: 400; 9 | background-color: #1A2332; 10 | border: $border $border-color; 11 | border-radius: $border-radius; 12 | } 13 | 14 | pre.highlight, 15 | figure.highlight { 16 | max-height: 400px; 17 | scrollbar-color: #6fa700 #1f1f1f; 18 | scrollbar-width: thin; 19 | padding: $sp-3; 20 | margin-top: 0; 21 | margin-bottom: 0; 22 | background-color: $code-background-color; 23 | border-radius: $border-radius; 24 | -webkit-overflow-scrolling: touch; 25 | 26 | code { 27 | padding: 0; 28 | border: 0; 29 | } 30 | } 31 | 32 | .highlighter-rouge { 33 | margin-bottom: $sp-3; 34 | } 35 | 36 | .highlight pre { background-color: #1A2332; } 37 | .highlight .hll { background-color: #272822; } 38 | .highlight .c { color: #75715e } /* Comment */ 39 | .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ 40 | .highlight .k { color: #66d9ef } /* Keyword */ 41 | .highlight .l { color: #ae81ff } /* Literal */ 42 | .highlight .n { color: #f8f8f2 } /* Name */ 43 | .highlight .o { color: #e69e00 } /* Operator */ 44 | .highlight .p { color: #f8f8f2 } /* Punctuation */ 45 | .highlight .cm { color: #75715e } /* Comment.Multiline */ 46 | .highlight .cp { color: #75715e } /* Comment.Preproc */ 47 | .highlight .c1 { color: #75715e } /* Comment.Single */ 48 | .highlight .cs { color: #75715e } /* Comment.Special */ 49 | .highlight .ge { font-style: italic } /* Generic.Emph */ 50 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 51 | .highlight .kc { color: #9fef00 } /* Keyword.Constant */ 52 | .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ 53 | .highlight .kn { color: #f92672 } /* Keyword.Namespace */ 54 | .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ 55 | .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ 56 | .highlight .kt { color: #66d9ef } /* Keyword.Type */ 57 | .highlight .ld { color: #e6db74 } /* Literal.Date */ 58 | .highlight .m { color: #ae81ff } /* Literal.Number */ 59 | .highlight .s { color: #e6db74 } /* Literal.String */ 60 | .highlight .na { color: #a6e22e } /* Name.Attribute */ 61 | .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ 62 | .highlight .nc { color: #a6e22e } /* Name.Class */ 63 | .highlight .no { color: #66d9ef } /* Name.Constant */ 64 | .highlight .nd { color: #a6e22e } /* Name.Decorator */ 65 | .highlight .ni { color: #f8f8f2 } /* Name.Entity */ 66 | .highlight .ne { color: #a6e22e } /* Name.Exception */ 67 | .highlight .nf { color: #a6e22e } /* Name.Function */ 68 | .highlight .nl { color: #f8f8f2 } /* Name.Label */ 69 | .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ 70 | .highlight .nx { color: #a6e22e } /* Name.Other */ 71 | .highlight .py { color: #f8f8f2 } /* Name.Property */ 72 | .highlight .nt { color: #f92672 } /* Name.Tag */ 73 | .highlight .nv { color: #f8f8f2 } /* Name.Variable */ 74 | .highlight .ow { color: #f92672 } /* Operator.Word */ 75 | .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ 76 | .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ 77 | .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ 78 | .highlight .mi { color: #bc4dff } /* Literal.Number.Integer */ 79 | .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ 80 | .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ 81 | .highlight .sc { color: #e6db74 } /* Literal.String.Char */ 82 | .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ 83 | .highlight .s2 { color: #ffc74d } /* Literal.String.Double */ 84 | .highlight .se { color: #ae81ff } /* Literal.String.Escape */ 85 | .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ 86 | .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ 87 | .highlight .sx { color: #e6db74 } /* Literal.String.Other */ 88 | .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ 89 | .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ 90 | .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ 91 | .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ 92 | .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ 93 | .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ 94 | .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ 95 | .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ 96 | 97 | .highlight .gh { } /* Generic Heading & Diff Header */ 98 | .highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ 99 | .highlight .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ 100 | .highlight .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ 101 | 102 | // 103 | // Code examples (rendered) 104 | // 105 | 106 | .code-example { 107 | padding: $sp-3; 108 | margin-bottom: $sp-3; 109 | overflow: auto; 110 | border: 1px solid $border-color; 111 | border-radius: $border-radius; 112 | 113 | + .highlighter-rouge, 114 | + figure.highlight { 115 | position: relative; 116 | margin-top: -$sp-4; 117 | border-right: 1px solid $border-color; 118 | border-bottom: 1px solid $border-color; 119 | border-left: 1px solid $border-color; 120 | border-top-left-radius: 0; 121 | border-top-right-radius: 0; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /assets/images/header_mascot_undraw.svg: -------------------------------------------------------------------------------- 1 | 2 | 21 | 23 | 24 | 26 | image/svg+xml 27 | 29 | reminder 30 | 31 | 32 | 33 | 35 | 59 | reminder 61 | 66 | 71 | 76 | 81 | 86 | 91 | 96 | 101 | 107 | 115 | 123 | 130 | 137 | 143 | 149 | 154 | 155 | -------------------------------------------------------------------------------- /_layouts/anchor_headings.html: -------------------------------------------------------------------------------- 1 | {% capture headingsWorkspace %} 2 | {% comment %} 3 | Copyright (c) 2018 Vladimir "allejo" Jimenez 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | {% endcomment %} 26 | {% comment %} 27 | Version 1.0.6 28 | https://github.com/allejo/jekyll-anchor-headings 29 | 30 | "Be the pull request you wish to see in the world." ~Ben Balter 31 | 32 | Usage: 33 | {% include anchor_headings.html html=content %} 34 | 35 | Parameters: 36 | * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll 37 | 38 | Optional Parameters: 39 | * beforeHeading (bool) : false - Set to true if the anchor should be placed _before_ the heading's content 40 | * anchorAttrs (string) : '' - Any custom HTML attributes that will be added to the `` tag; you may NOT use `href`, `class` or `title`; 41 | the `%heading%` placeholder is available 42 | * anchorBody (string) : '' - The content that will be placed inside the anchor; the `%heading%` placeholder is available 43 | * anchorClass (string) : '' - The class(es) that will be used for each anchor. Separate multiple classes with a space 44 | * anchorTitle (string) : '' - The `title` attribute that will be used for anchors 45 | * h_min (int) : 1 - The minimum header level to build an anchor for; any header lower than this value will be ignored 46 | * h_max (int) : 6 - The maximum header level to build an anchor for; any header greater than this value will be ignored 47 | * bodyPrefix (string) : '' - Anything that should be inserted inside of the heading tag _before_ its anchor and content 48 | * bodySuffix (string) : '' - Anything that should be inserted inside of the heading tag _after_ its anchor and content 49 | 50 | Output: 51 | The original HTML with the addition of anchors inside of all of the h1-h6 headings. 52 | {% endcomment %} 53 | 54 | {% assign minHeader = include.h_min | default: 1 %} 55 | {% assign maxHeader = include.h_max | default: 6 %} 56 | {% assign beforeHeading = include.beforeHeading %} 57 | {% assign nodes = include.html | split: ' 72 | {% if headerLevel == 0 %} 73 | 74 | {% assign firstChunk = node | split: '>' | first %} 75 | 76 | 77 | {% unless firstChunk contains '<' %} 78 | {% capture node %}' | first }}>{% endcapture %} 91 | {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} 92 | 93 | 94 | {% capture anchor %}{% endcapture %} 95 | 96 | {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %} 97 | {% capture anchor %}href="#{{ html_id }}"{% endcapture %} 98 | 99 | {% if include.anchorClass %} 100 | {% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %} 101 | {% endif %} 102 | 103 | {% if include.anchorTitle %} 104 | {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', header }}"{% endcapture %} 105 | {% endif %} 106 | 107 | {% if include.anchorAttrs %} 108 | {% capture anchor %}{{ anchor }} {{ include.anchorAttrs | replace: '%heading%', header }}{% endcapture %} 109 | {% endif %} 110 | 111 | {% capture anchor %}{{ include.anchorBody | replace: '%heading%', header | default: '' }}{% endcapture %} 112 | 113 | 114 | {% if beforeHeading %} 115 | {% capture anchor %}{{ anchor }} {% endcapture %} 116 | {% else %} 117 | {% capture anchor %} {{ anchor }}{% endcapture %} 118 | {% endif %} 119 | {% endif %} 120 | 121 | {% capture new_heading %} 122 | ` tag; you may NOT use `href`, `class` or `title`; 41 | the `%heading%` placeholder is available 42 | * anchorBody (string) : '' - The content that will be placed inside the anchor; the `%heading%` placeholder is available 43 | * anchorClass (string) : '' - The class(es) that will be used for each anchor. Separate multiple classes with a space 44 | * anchorTitle (string) : '' - The `title` attribute that will be used for anchors 45 | * h_min (int) : 1 - The minimum header level to build an anchor for; any header lower than this value will be ignored 46 | * h_max (int) : 6 - The maximum header level to build an anchor for; any header greater than this value will be ignored 47 | * bodyPrefix (string) : '' - Anything that should be inserted inside of the heading tag _before_ its anchor and content 48 | * bodySuffix (string) : '' - Anything that should be inserted inside of the heading tag _after_ its anchor and content 49 | 50 | Output: 51 | The original HTML with the addition of anchors inside of all of the h1-h6 headings. 52 | {% endcomment %} 53 | 54 | {% assign minHeader = include.h_min | default: 1 %} 55 | {% assign maxHeader = include.h_max | default: 6 %} 56 | {% assign beforeHeading = include.beforeHeading %} 57 | {% assign nodes = include.html | split: ' 72 | {% if headerLevel == 0 %} 73 | 74 | {% assign firstChunk = node | split: '>' | first %} 75 | 76 | 77 | {% unless firstChunk contains '<' %} 78 | {% capture node %}' | first }}>{% endcapture %} 91 | {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} 92 | 93 | 94 | {% capture anchor %}{% endcapture %} 95 | 96 | {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %} 97 | {% capture anchor %}href="#{{ html_id }}"{% endcapture %} 98 | 99 | {% if include.anchorClass %} 100 | {% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %} 101 | {% endif %} 102 | 103 | {% if include.anchorTitle %} 104 | {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', header }}"{% endcapture %} 105 | {% endif %} 106 | 107 | {% if include.anchorAttrs %} 108 | {% capture anchor %}{{ anchor }} {{ include.anchorAttrs | replace: '%heading%', header }}{% endcapture %} 109 | {% endif %} 110 | 111 | {% capture anchor %}{{ include.anchorBody | replace: '%heading%', header | default: '' }}{% endcapture %} 112 | 113 | 114 | {% if beforeHeading %} 115 | {% capture anchor %}{{ anchor }} {% endcapture %} 116 | {% else %} 117 | {% capture anchor %} {{ anchor }}{% endcapture %} 118 | {% endif %} 119 | {% endif %} 120 | 121 | {% capture new_heading %} 122 | 9 | 10 | ## Data about yourself 11 | 12 | Want to keep track of your own progress, achievements or other account matters? These are the endpoints for you. 13 | 14 | GET 15 | Get profile info (self): 16 | ```js 17 | /api/v4/user/info 18 | ``` 19 | `🥙 RESPONSE` 20 | ```json 21 | { 22 | "info": { 23 | "id": 9001, 24 | "name": "L33tUser", 25 | "email": "l33t@email.com", 26 | "timezone": "UTC", 27 | "isVip": true, 28 | "canAccessVIP": true, 29 | "isServerVIP": true, 30 | "server_id": 222, 31 | "avatar": "\/storage\/avatars\/e6baffa3faa.png" 32 | } 33 | } 34 | ``` 35 | 36 | 37 | GET 38 | Get VPN connection status info (self): 39 | 40 | ```js 41 | /api/v4/user/connection/status 42 | ``` 43 | `🥙 RESPONSE` 44 | ```json 45 | { 46 | "status": "1", 47 | "connection": { 48 | "name": "Username", 49 | "ip4": "10.10.14.50", 50 | "ip6": "dead:beef:2::100a", 51 | "down": "0.09", 52 | "up": "0.08" 53 | } 54 | } 55 | ``` 56 | 57 | GET 58 | Get your own running machine instance (VIP): 59 | 60 | ```js 61 | /api/v4/machine/active 62 | ``` 63 | `🥙 RESPONSE` 64 | ```json 65 | { 66 | "info": { 67 | "id": 244, 68 | "name": "Quick", 69 | "avatar": "\/storage\/avatars\/c2096057971181c8d36031fb6f1f7a8a.png", 70 | "expires_at": "2020-07-08 14:14:53", 71 | "voting": false, 72 | "voted": false 73 | } 74 | } 75 | ``` 76 | 77 | GET 78 | Get machines you marked as **TODO**, if any: 79 | 80 | ```js 81 | /api/v4/machine/todo 82 | ``` 83 | `🥙 RESPONSE` 84 | ```json 85 | { 86 | "info": [ "... an array of standard machine objects ..." ] 87 | } 88 | ``` 89 | 90 | GET 91 | Get challenges you marked as **TODO**, if any: 92 | 93 | ```js 94 | /api/v4/challenge/todo 95 | ``` 96 | `🥙 RESPONSE` 97 | ```json 98 | { 99 | "info": [ "... an array of standard challenge objects ..." ] 100 | } 101 | ``` 102 | 103 | GET 104 | Retrieve your anonymized ID: 105 | 106 | ```js 107 | /api/v4/user/anonymized/id 108 | ``` 109 | `🥙 RESPONSE` 110 | ```json 111 | {"id":"0bb526172123027df47df67cb6d032db"} 112 | ``` 113 | 114 | ## Update Operations 115 | 116 | ### Owning stuff 117 | 118 | POST 119 | Submit / own a challenge flag: 120 | ```js 121 | /api/v4/challenge/own 122 | ``` 123 | `🛍️ PAYLOAD` 124 | ```json 125 | {"flag":"4556","challenge_id":131,"difficulty":50} 126 | ``` 127 | `🥙 RESPONSE(S)` 128 | ```json 129 | {"message":"Incorrect flag"} 130 | ``` 131 | 132 | POST 133 | Submit / own a machine flag: 134 | > (Flags here are not real ones for obvious reasons!) 135 | ```js 136 | /api/v4/machine/own 137 | ``` 138 | `🛍️ PAYLOAD(S)` 139 | ```json 140 | {"flag":"r3523452345","id":244,"difficulty":20} 141 | ``` 142 | ```json 143 | { 144 | "flag": "2339393e949af088314cb027b65f4bcc", 145 | "id": 244, 146 | "difficulty": 30 147 | } 148 | ``` 149 | `🥙 RESPONSE(S)` 150 | ```json 151 | {"message":"Incorrect flag!"} 152 | ``` 153 | 154 | ```json 155 | { 156 | "message": "Multimaster user is now owned.", 157 | "id": 232, 158 | "own_type": "user" 159 | } 160 | ``` 161 | 162 | ```json 163 | { 164 | "message": "Quick root is now owned.", 165 | "id": 244, 166 | "own_type": "root" 167 | } 168 | ``` 169 | 170 | ### Marking Todos 171 | 172 | POST 173 | `Toggle` a machine's 'todo' status: 174 | ```js 175 | /api/v4/machine/todo/update/260 176 | ``` 177 | `🛍️ PAYLOAD` 178 | ```diff 179 | - No parameters for this request (machine ID specified in url). 180 | ``` 181 | `🥙 RETURNS` 182 | > _A list of the challenges currently marked as 'todo'_ 183 | ```json 184 | { 185 | "info": [{ 186 | "id": 260, 187 | "name": "RopeTwo", 188 | "os": "Linux", 189 | "points": 50, 190 | "static_points": 50, 191 | "authUserInUserOwns": null, 192 | "authUserInRootOwns": null, 193 | "authUserFirstUserTime": null, 194 | "authUserFirstRootTime": null, 195 | "stars": "4.2", 196 | "difficulty": 94, 197 | "feedbackForChart": { 198 | "counterCake": 1, 199 | "counterVeryEasy": 0, 200 | "counterEasy": 0, 201 | "counterTooEasy": 0, 202 | "counterMedium": 0, 203 | "counterBitHard": 0, 204 | "counterHard": 1, 205 | "counterTooHard": 0, 206 | "counterExHard": 0, 207 | "counterBrainFuck": 17 208 | }, 209 | "feedbackForChartArr": [1, 0, 0, 0, 0, 0, 1, 0, 0, 17], 210 | "avatar": "/storage/avatars/c2847af85c98ff1b15a75aec060fa2de.png", 211 | "difficultyText": "Insane", 212 | "playInfo": { 213 | "isSpawned": false, 214 | "isActive": null, 215 | "active_player_count": null, 216 | "expires_at": null 217 | }, 218 | "free": true, 219 | "release": "2020-06-27T16:00:00.000000Z", 220 | "user_owns_count": 14, 221 | "root_owns_count": 7, 222 | "recommended": 0 223 | }, { 224 | "id": 262, 225 | "name": "SneakyMailer", 226 | "os": "Linux", 227 | "points": 30, 228 | "static_points": 30, 229 | "authUserInUserOwns": null, 230 | "authUserInRootOwns": null, 231 | "authUserFirstUserTime": null, 232 | "authUserFirstRootTime": null, 233 | "stars": "0.0", 234 | "difficulty": 50, 235 | "feedbackForChart": { 236 | "counterCake": 0, 237 | "counterVeryEasy": 0, 238 | "counterEasy": 0, 239 | "counterTooEasy": 0, 240 | "counterMedium": 0, 241 | "counterBitHard": 0, 242 | "counterHard": 0, 243 | "counterTooHard": 0, 244 | "counterExHard": 0, 245 | "counterBrainFuck": 0 246 | }, 247 | "feedbackForChartArr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 248 | "avatar": "/storage/avatars/5f5ab2f3fb31673d80623bdd98b286c3.png", 249 | "difficultyText": "Medium", 250 | "playInfo": { 251 | "isSpawned": false, 252 | "isActive": null, 253 | "active_player_count": null, 254 | "expires_at": null 255 | }, 256 | "free": true, 257 | "release": "2020-07-11T16:00:00.000000Z", 258 | "user_owns_count": 0, 259 | "root_owns_count": 0, 260 | "recommended": 0 261 | }] 262 | } 263 | ``` 264 | 265 | POST 266 | `Toggle` a challenge's 'todo' status: 267 | ```js 268 | /api/v4/challenge/todo/update/75 269 | ``` 270 | `🛍️ PAYLOAD` 271 | ```diff 272 | - No parameters for this request (machine ID specified in url). 273 | ``` 274 | `🥙 RESPONSE(S)` 275 | > _A list of the challenges currently marked as 'todo'_ 276 | ```json 277 | { 278 | "info": [{ 279 | "id": 75, 280 | "name": "Fuzzy", 281 | "difficulty": "Easy", 282 | "points": 0, 283 | "difficulty_chart": { 284 | "counterCake": 752, 285 | "counterVeryEasy": 1222, 286 | "counterEasy": 4681, 287 | "counterTooEasy": 2753, 288 | "counterMedium": 1657, 289 | "counterBitHard": 531, 290 | "counterHard": 240, 291 | "counterTooHard": 48, 292 | "counterExHard": 22, 293 | "counterBrainFuck": 93 294 | }, 295 | "difficulty_chart_arr": [752, 1222, 4681, 2753, 1657, 531, 240, 48, 22, 93], 296 | "solves": 11962, 297 | "authUserSolve": true, 298 | "likes": 3123, 299 | "likeByAuthUser": false, 300 | "dislikes": 138, 301 | "dislikeByAuthUser": false, 302 | "isCompleted": true, 303 | "isActive": false, 304 | "release_date": "2019-07-05", 305 | "challenge_category_id": 5, 306 | "retired": 1, 307 | "recommended": 0 308 | }] 309 | } 310 | ``` 311 | 312 | ### VIP 313 | 314 | POST 315 | Spawn a new instance of the identified machine: 316 | ```js 317 | /api/v4/vm/spawn 318 | ``` 319 | `🛍️ PAYLOAD` 320 | ```json 321 | {"machine_id":262} 322 | ``` 323 | `🥙 RESPONSE(S)` 324 | ```json 325 | {"message":"Machine not available for VIP."} 326 | ``` 327 | ```json 328 | {"message":"Machine deployed to lab."} 329 | ``` 330 | 331 | POST 332 | Extend a running instance of the identified machine: 333 | ```js 334 | /api/v4/vm/spawn 335 | ``` 336 | `🛍️ PAYLOAD` 337 | ```json 338 | {"machine_id":244} 339 | ``` 340 | `🥙 RESPONSE(S)` 341 | ```json 342 | { 343 | "message": "Machine extended by 24 hours.", 344 | "expires_at": "2020-07-09T21:52:24.093483Z" 345 | } 346 | ``` 347 | ```json 348 | {"message":"Machine not found."} 349 | ``` 350 | ```json 351 | {"message":"Machine not assigned to this lab."} 352 | ``` 353 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: table_wrappers 3 | --- 4 | 5 | 6 | 7 | 8 | {% include head.html %} 9 | 10 | 11 | 12 | Link 13 | 14 | 15 | 16 | 17 | 18 | Search 19 | 20 | 21 | 22 | 23 | 24 | Menu 25 | 26 | 27 | 28 | 29 | 30 | Expand 31 | 32 | 33 | 34 | 35 | 36 | Document 37 | 38 | 39 | 40 | 41 | 42 | 43 | 57 |
58 |
59 | {% if site.search_enabled != false %} 60 | 67 | {% endif %} 68 | {% if site.aux_links %} 69 | 84 | {% endif %} 85 |
86 |
87 | {% unless page.url == "/" %} 88 | {% if page.parent %} 89 | 100 | {% endif %} 101 | {% endunless %} 102 |
103 | {% if site.heading_anchors != false %} 104 | {% include anchor_headings.html html=content beforeHeading="true" anchorBody="" anchorClass="anchor-heading" %} 105 | {% else %} 106 | {{ content }} 107 | {% endif %} 108 | 109 | {% if page.has_children == true and page.has_toc != false %} 110 |
111 |

Table of contents

112 |
    113 | {%- assign children_list = pages_list | where: "parent", page.title | where: "grand_parent", page.parent -%} 114 | {% for child in children_list %} 115 |
  • 116 | {{ child.title }}{% if child.summary %} - {{ child.summary }}{% endif %} 117 |
  • 118 | {% endfor %} 119 |
120 | {% endif %} 121 | 122 | {% if site.footer_content != nil or site.last_edit_timestamp or site.gh_edit_link %} 123 |
124 |
125 | {% if site.back_to_top %} 126 |

{{ site.back_to_top_text }}

127 | {% endif %} 128 | {% if site.footer_content != nil %} 129 |

{{ site.footer_content }}

130 | {% endif %} 131 | 132 | {% if site.last_edit_timestamp or site.gh_edit_link %} 133 |
134 | {% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %} 135 |

136 | Page last modified: {{ page.last_modified_date | date: site.last_edit_time_format }}. 137 |

138 | {% endif %} 139 | {% if 140 | site.gh_edit_link and 141 | site.gh_edit_link_text and 142 | site.gh_edit_repository and 143 | site.gh_edit_branch and 144 | site.gh_edit_view_mode 145 | %} 146 |

147 | {{ site.gh_edit_link_text }} 148 |

149 | {% endif %} 150 |
151 | {% endif %} 152 |
153 | {% endif %} 154 | 155 |
156 |
157 | 158 | {% if site.search_enabled != false %} 159 | {% if site.search.button %} 160 | 161 | 162 | 163 | {% endif %} 164 | 165 |
166 | {% endif %} 167 |
168 | 169 | 170 | -------------------------------------------------------------------------------- /api/machine/machine.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: Machine 4 | parent: Home 5 | nav_order: 3 6 | --- 7 | 8 | 9 | 10 | 11 | ## Machine 12 | 13 | It's everything you wanted to know about Hack The Box machines, all in one place! 14 | 15 | ### Listing Machines 16 | #### Active 17 | 18 | 19 | GET 20 | Get a list of active machines: 21 | ```js 22 | /api/v4/machine/list 23 | ``` 24 | 25 | ```json 26 | { 27 | "info": [{ 28 | "id": 227, 29 | "name": "Fatty", 30 | "os": "Linux", 31 | "points": 50, 32 | "static_points": 50, 33 | "release": "2020-02-08T17:00:00.000000Z", 34 | "user_owns_count": 1222, 35 | "root_owns_count": 1148, 36 | "authUserInUserOwns": null, 37 | "authUserInRootOwns": null, 38 | "isTodo": true, 39 | "stars": "4.7", 40 | "difficulty": 78, 41 | "feedbackForChart": { 42 | "counterCake": 45, 43 | "counterVeryEasy": 17, 44 | "counterEasy": 21, 45 | "counterTooEasy": 37, 46 | "counterMedium": 478, 47 | "counterBitHard": 101, 48 | "counterHard": 199, 49 | "counterTooHard": 313, 50 | "counterExHard": 418, 51 | "counterBrainFuck": 832 52 | }, 53 | "feedbackForChartArr": [45, 17, 21, 37, 478, 101, 199, 313, 418, 832], 54 | "avatar": "\/storage\/avatars\/434a84b479e2121f8dbf2c7c56becffd.png", 55 | "difficultyText": "Insane", 56 | "playInfo": { 57 | "isSpawned": false, 58 | "isActive": null, 59 | "active_player_count": null, 60 | "expires_at": null 61 | }, 62 | "free": true, 63 | "maker": { 64 | "id": 103578, 65 | "name": "qtc", 66 | "avatar": "\/storage\/avatars\/f89afe1ab159ad520ba3a63e50cd59ed.png", 67 | "isRespected": false 68 | }, 69 | "maker2": null, 70 | "recommended": 1 71 | }, "[ other machine objects ]"] 72 | } 73 | ``` 74 | 75 | #### Retired 76 | 77 | GET 78 | Get a list of retired machines: 79 | ```js 80 | /api/v4/machine/list/retired 81 | ``` 82 | 83 | ```json 84 | { 85 | "info": [{ 86 | "id": 1, 87 | "name": "Lame", 88 | "os": "Linux", 89 | "points": 0, 90 | "static_points": 20, 91 | "release": "2017-03-14T19:54:51.000000Z", 92 | "user_owns_count": 19434, 93 | "root_owns_count": 20863, 94 | "authUserInUserOwns": null, 95 | "authUserInRootOwns": null, 96 | "isTodo": false, 97 | "stars": "4.3", 98 | "difficulty": 26, 99 | "feedbackForChart": { 100 | "counterCake": 13228, 101 | "counterVeryEasy": 8668, 102 | "counterEasy": 4652, 103 | "counterTooEasy": 1520, 104 | "counterMedium": 7519, 105 | "counterBitHard": 262, 106 | "counterHard": 152, 107 | "counterTooHard": 111, 108 | "counterExHard": 50, 109 | "counterBrainFuck": 115 110 | }, 111 | "feedbackForChartArr": [13228, 8668, 4652, 1520, 7519, 262, 152, 111, 50, 115], 112 | "avatar": "\/storage\/avatars\/fb2d9f98400e3c802a0d7145e125c4ff.png", 113 | "difficultyText": "Easy", 114 | "playInfo": { 115 | "isSpawned": true, 116 | "isActive": false, 117 | "active_player_count": null, 118 | "expires_at": null 119 | }, 120 | "free": false, 121 | "maker": { 122 | "id": 1, 123 | "name": "ch4p", 124 | "avatar": "\/storage\/avatars\/08c255a334e10b3033ab7263e6b32422.png", 125 | "isRespected": false 126 | }, 127 | "maker2": null, 128 | "recommended": 0, 129 | "tags": [{ 130 | "id": 73, 131 | "tag_category_id": 6 132 | }, { 133 | "id": 81, 134 | "tag_category_id": 11 135 | }] 136 | }, "[ other machine objects ]"] 137 | } 138 | ``` 139 | 140 | ### Recommended Machines 141 | 142 | GET 143 | Get the latest box recommendation cards, fresh from the desk of HTB moderators: 144 | ```js 145 | /api/v4/machine/recommended 146 | ``` 147 | 148 | ```json 149 | { 150 | "state": ["live", "staff_pick"], 151 | "card1": { 152 | "id": 261, 153 | "name": "Intense", 154 | "os": "Linux", 155 | "release": "2020-07-04T16:00:00.000000Z", 156 | "difficultyText": "Hard", 157 | "avatar": "\/storage\/avatars\/41fa976e012eb51bee13efc5419ce8ac.png", 158 | "feedbackForChart": { 159 | "counterCake": 1, 160 | "counterVeryEasy": 1, 161 | "counterEasy": 2, 162 | "counterTooEasy": 6, 163 | "counterMedium": 15, 164 | "counterBitHard": 17, 165 | "counterHard": 19, 166 | "counterTooHard": 11, 167 | "counterExHard": 7, 168 | "counterBrainFuck": 8 169 | } 170 | }, 171 | "card2": { 172 | "id": 235, 173 | "name": "Cascade", 174 | "os": "Windows", 175 | "release": "2020-03-28T17:00:00.000000Z", 176 | "retired_date": null, 177 | "difficultyText": "Medium", 178 | "avatar": "\/storage\/avatars\/64fef851357b8de1c4834093bf3426f2.png", 179 | "feedbackForChart": [118, 182, 774, 1389, 2846, 1108, 865, 440, 141, 179] 180 | } 181 | } 182 | ``` 183 | 184 | ### Machine Vulnerability Tags 185 | #### Enumerate machine exploit categorization tags. 186 | 187 | 188 | GET 189 | Get the machine exploit categorization tags: 190 | ```js 191 | /api/v4/machine/tags/list 192 | ``` 193 | 194 | ```json 195 | { 196 | "info": [{ 197 | "id": 7, 198 | "name": "Attack Path", 199 | "tags": [{ 200 | "id": 75, 201 | "tag_category_id": 7, 202 | "name": "Web" 203 | }, { 204 | "id": 76, 205 | "tag_category_id": 7, 206 | "name": "Network" 207 | }, { 208 | "id": 77, 209 | "tag_category_id": 7, 210 | "name": "Binary Exploit" 211 | }, { 212 | "id": 91, 213 | "tag_category_id": 7, 214 | "name": "Active Directory" 215 | }, { 216 | "id": 92, 217 | "tag_category_id": 7, 218 | "name": "SMB" 219 | }, { 220 | "id": 93, 221 | "tag_category_id": 7, 222 | "name": "FTP" 223 | }] 224 | }, { 225 | "id": 11, 226 | "name": "Attack Sub", 227 | "tags": [{ 228 | "id": 81, 229 | "tag_category_id": 11, 230 | "name": "Injection" 231 | }, { 232 | "id": 86, 233 | "tag_category_id": 11, 234 | "name": "CMS Exploit" 235 | }, { 236 | "id": 90, 237 | "tag_category_id": 11, 238 | "name": "Web Fuzzing" 239 | }, { 240 | "id": 94, 241 | "tag_category_id": 11, 242 | "name": "Arbitrary File Upload" 243 | }, { 244 | "id": 95, 245 | "tag_category_id": 11, 246 | "name": "LFI" 247 | }, { 248 | "id": 96, 249 | "tag_category_id": 11, 250 | "name": "RFI" 251 | }, { 252 | "id": 97, 253 | "tag_category_id": 11, 254 | "name": "Password Reuse" 255 | }, { 256 | "id": 98, 257 | "tag_category_id": 11, 258 | "name": "Outdated Software" 259 | }, { 260 | "id": 99, 261 | "tag_category_id": 11, 262 | "name": "Patch Management" 263 | }, { 264 | "id": 100, 265 | "tag_category_id": 11, 266 | "name": "SUID" 267 | }, { 268 | "id": 101, 269 | "tag_category_id": 11, 270 | "name": "SQLi" 271 | }, { 272 | "id": 102, 273 | "tag_category_id": 11, 274 | "name": "DNS Zone Transfer" 275 | }, { 276 | "id": 103, 277 | "tag_category_id": 11, 278 | "name": "Cryptography" 279 | }, { 280 | "id": 104, 281 | "tag_category_id": 11, 282 | "name": "Padding Oracle Attack" 283 | }, { 284 | "id": 105, 285 | "tag_category_id": 11, 286 | "name": "File Misconfiguration" 287 | }, { 288 | "id": 106, 289 | "tag_category_id": 11, 290 | "name": "XSS" 291 | }, { 292 | "id": 108, 293 | "tag_category_id": 11, 294 | "name": "Sandbox Escape" 295 | }, { 296 | "id": 109, 297 | "tag_category_id": 11, 298 | "name": "Port Knocking" 299 | }, { 300 | "id": 110, 301 | "tag_category_id": 11, 302 | "name": "SSRF" 303 | }, { 304 | "id": 111, 305 | "tag_category_id": 11, 306 | "name": "API Fuzzing" 307 | }, { 308 | "id": 114, 309 | "tag_category_id": 11, 310 | "name": "XXE" 311 | }, { 312 | "id": 115, 313 | "tag_category_id": 11, 314 | "name": "Log Poisoning" 315 | }, { 316 | "id": 116, 317 | "tag_category_id": 11, 318 | "name": "Deserialisation" 319 | }, { 320 | "id": 118, 321 | "tag_category_id": 11, 322 | "name": "Client side attack" 323 | }, { 324 | "id": 120, 325 | "tag_category_id": 11, 326 | "name": "Kerberoasting" 327 | }, { 328 | "id": 121, 329 | "tag_category_id": 11, 330 | "name": "CSRF" 331 | }, { 332 | "id": 122, 333 | "tag_category_id": 11, 334 | "name": "AppLocker Bypass" 335 | }, { 336 | "id": 123, 337 | "tag_category_id": 11, 338 | "name": "SSL" 339 | }, { 340 | "id": 124, 341 | "tag_category_id": 11, 342 | "name": "Account Misconfiguration" 343 | }, { 344 | "id": 125, 345 | "tag_category_id": 11, 346 | "name": "File System Forensics" 347 | }, { 348 | "id": 127, 349 | "tag_category_id": 11, 350 | "name": "Process Inspection" 351 | }, { 352 | "id": 129, 353 | "tag_category_id": 11, 354 | "name": "DLL Hijack" 355 | }, { 356 | "id": 130, 357 | "tag_category_id": 11, 358 | "name": "Environment Misconfiguration" 359 | }, { 360 | "id": 131, 361 | "tag_category_id": 11, 362 | "name": "DBMS Misconfiguration" 363 | }, { 364 | "id": 132, 365 | "tag_category_id": 11, 366 | "name": "Printer Exploit" 367 | }] 368 | }, { 369 | "id": 9, 370 | "name": "Languages", 371 | "tags": [{ 372 | "id": 78, 373 | "tag_category_id": 9, 374 | "name": "PHP" 375 | }, { 376 | "id": 80, 377 | "tag_category_id": 9, 378 | "name": "Python" 379 | }, { 380 | "id": 83, 381 | "tag_category_id": 9, 382 | "name": "SQL" 383 | }, { 384 | "id": 84, 385 | "tag_category_id": 9, 386 | "name": "Bash" 387 | }, { 388 | "id": 85, 389 | "tag_category_id": 9, 390 | "name": "Powershell" 391 | }, { 392 | "id": 87, 393 | "tag_category_id": 9, 394 | "name": "Java" 395 | }, { 396 | "id": 88, 397 | "tag_category_id": 9, 398 | "name": "Ruby" 399 | }, { 400 | "id": 89, 401 | "tag_category_id": 9, 402 | "name": "Perl" 403 | }, { 404 | "id": 107, 405 | "tag_category_id": 9, 406 | "name": "JSON" 407 | }, { 408 | "id": 113, 409 | "tag_category_id": 9, 410 | "name": "C" 411 | }, { 412 | "id": 117, 413 | "tag_category_id": 9, 414 | "name": "JavaScript" 415 | }, { 416 | "id": 119, 417 | "tag_category_id": 9, 418 | "name": "VBScript" 419 | }, { 420 | "id": 126, 421 | "tag_category_id": 9, 422 | "name": "VBA" 423 | }] 424 | }] 425 | } 426 | ``` 427 | -------------------------------------------------------------------------------- /api/user/user.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: User 4 | parent: Home 5 | nav_order: 2 6 | --- 7 | 8 | 9 | ## User 10 | 11 | These queries should be suffixed by the user ID, (demo: `9001`) 12 | ### Profile 13 | GET 14 | Complete profile details for user: 15 | ```js 16 | https://www.hackthebox.eu/api/v4/user/profile/basic/9001 17 | ``` 18 | ```json 19 | { 20 | "profile": { 21 | "id": 9001, 22 | "name": "L33tUser", 23 | "timezone": "UTC", 24 | "isVip": true, 25 | "avatar": "\/storage\/avatars\/e6baffa3faa648fabf69761ca492213a.png", 26 | "points": 225, 27 | "system_owns": 25, 28 | "user_owns": 26, 29 | "user_bloods": 3, 30 | "system_bloods": 4, 31 | "respects": 5994, 32 | "country_name": "Fiji", 33 | "country_code": "TR", 34 | "team": { 35 | "name": "PartyFunbois", 36 | "ranking": 1, 37 | "avatar": "\/storage\/teams\/8232e119d8f59aa83050a741631803d6.jpg" 38 | }, 39 | "university_name": "L33t University", 40 | "description": "Hi I am L33t Hax0r, I like to hack box and profit", 41 | "github": "https://github.com/l33tb0i", 42 | "linkedin": "https://www.linkedin.com/in/L33tB0i/", 43 | "twitter": null, 44 | "website": null, 45 | "server": "EU VIP 27", 46 | "rank": "Guru", 47 | "rank_id": 4, 48 | "current_rank_progress": 0, 49 | "next_rank": "Omniscient", 50 | "next_rank_points": 31.331999999999997, 51 | "rank_ownership": "99.76", 52 | "rank_requirement": 45, 53 | "ranking": 23 54 | } 55 | } 56 | ``` 57 | #### Activity 58 | 59 | GET 60 | Complete list of owns involving a machine (user / root), challenge, or Endgame, for a given UID: 61 | ```js 62 | https://www.hackthebox.eu/api/v4/user/profile/activity/9001 63 | ``` 64 | 65 | ```json 66 | { 67 | "profile": { 68 | "activity": [{ 69 | "date": "2020-07-05T12:43:33.000000Z", 70 | "date_diff": "1 day ago", 71 | "object_type": "machine", 72 | "type": "root", 73 | "id": 261, 74 | "name": "Intense", 75 | "points": 40, 76 | "machine_avatar": "\/storage\/avatars\/41fa976e012eb51bee13efc5419ce8ac_thumb.png" 77 | }, { 78 | "date": "2020-07-03T20:02:11.000000Z", 79 | "date_diff": "3 days ago", 80 | "object_type": "challenge", 81 | "type": "challenge", 82 | "id": 131, 83 | "name": "ID Exposed", 84 | "points": 2, 85 | "challenge_category": "OSINT" 86 | }, { 87 | "date": "2020-06-21T16:30:54.000000Z", 88 | "date_diff": "2 weeks ago", 89 | "object_type": "endgame", 90 | "type": "endgame", 91 | "id": 4, 92 | "name": "RPG", 93 | "points": 40, 94 | "flag_title": "Collapse of the empire" 95 | }, { 96 | "date": "2020-05-20T15:01:04.000000Z", 97 | "date_diff": "1 month ago", 98 | "object_type": "fortress", 99 | "type": "fortress", 100 | "id": 2, 101 | "name": "AKERVA", 102 | "points": 15, 103 | "flag_title": "Little Secret" 104 | }, ... 105 | ] 106 | } 107 | } 108 | ``` 109 | 110 | #### Progress 111 | 112 | GET 113 | Machine progress for user: 114 | ```js 115 | https://www.hackthebox.eu/api/v4/user/profile/progress/machines/os/9001 116 | ``` 117 | ```json 118 | { 119 | "profile": { 120 | "operating_systems": [{ 121 | "name": "Linux", 122 | "completion_percentage": 10, 123 | "owned_machines": 11, 124 | "total_machines": 110 125 | {"name": "Windows" ... }, 126 | {"name": "FreeBSD" ... }, 127 | {"name": "Solaris" ... }, 128 | {"name": "Other" ... } 129 | ] 130 | } 131 | } 132 | 133 | ``` 134 | 135 | GET 136 | Challenge progress for user: 137 | ```js 138 | https://www.hackthebox.eu/api/v4/user/profile/progress/challenges/9001 139 | ``` 140 | ```json 141 | { 142 | "profile": { 143 | "challenge_owns": { 144 | "solved": 100, 145 | "total": 127 146 | }, 147 | "challenge_categories": [{ 148 | "name": "Reversing", 149 | "owned_flags": 2, 150 | "total_flags": 19, 151 | "completion_percentage": 11, 152 | "avg_user_solved": 0.77 153 | }, 154 | {"name": "Crypto" ... }, 155 | {"name": "Stego" ... }, 156 | {"name": "Pwn" ... }, 157 | {"name": "Web" ... }, 158 | {"name": "Misc" ... }, 159 | {"name": "Forensics" ... }, 160 | {"name": "Mobile" ... }, 161 | {"name": "OSINT" ... }, 162 | {"name": "Hardware" ... }, 163 | ] 164 | } 165 | } 166 | ``` 167 | 168 | `[GET]` Endgame progress for user: 169 | ```js 170 | https://www.hackthebox.eu/api/v4/user/profile/progress/endgame/9001 171 | ``` 172 | ```json 173 | { 174 | "profile": { 175 | "endgames": [{ 176 | "name": "P.O.O.", 177 | "completion_percentage": 0, 178 | "owned_flags": 0, 179 | "total_flags": 5 180 | }, 181 | {"name": "Xen" ... }, 182 | {"name": "Hades" ... }, 183 | {"name": "RPG" ... } 184 | ] 185 | } 186 | } 187 | 188 | ``` 189 | 190 | 191 | `[GET]` Fortress progress for user: 192 | ```js 193 | https://www.hackthebox.eu/api/v4/user/profile/progress/fortress/9001 194 | ``` 195 | ```json 196 | { 197 | "profile": { 198 | "fortresses": [{ 199 | "name": "Jet", 200 | "avatar": "https:\/\/www.hackthebox.eu\/storage\/companies\/3.png", 201 | "completion_percentage": 0, 202 | "owned_flags": 0, 203 | "total_flags": 11 204 | }, 205 | { "name": "Akerva" ... }, 206 | ] 207 | } 208 | } 209 | ``` 210 | 211 | `[GET]` Pro Lab progress for user: 212 | ```js 213 | https://www.hackthebox.eu/api/v4/user/profile/progress/prolab/9001 214 | ``` 215 | ```json 216 | { 217 | "profile": { 218 | "prolabs": [{ 219 | "name": "RastaLabs", 220 | "subscribed": false, 221 | "completion_percentage": 0, 222 | "owned_flags": 14, 223 | "total_flags": 20, 224 | "total_machines": 14, 225 | "average_ratings": 4.87 226 | }, 227 | { "name": "Offshore" ... }, 228 | { "name": "Cybernetics" ... } 229 | ] 230 | } 231 | } 232 | ``` 233 | #### Graph 234 | 235 | `[GET]` Chart data for one week, daily step: 236 | ```js 237 | https://www.hackthebox.eu/api/v4/user/profile/graph/1W/9001 238 | ``` 239 | ```json 240 | { 241 | "profile": { 242 | "graphData": { 243 | "user_owns": [71, 71, 71, 71, 71, 71, 71], 244 | "system_owns": [71, 71, 71, 71, 71, 71, 71], 245 | "challenge_owns": [90, 90, 90, 90, 90, 90, 91], 246 | "first_bloods": [0, 0, 0, 0, 0, 0, 0], 247 | "respects": [17, 17, 17, 17, 18, 18, 18] 248 | } 249 | } 250 | } 251 | ``` 252 | 253 | `[GET]` Chart data for one month, weekly step: 254 | ```js 255 | https://www.hackthebox.eu/api/v4/user/profile/graph/1Y/9001 256 | ``` 257 | ```json 258 | { 259 | "profile": { 260 | "graphData": { 261 | "user_owns": { 262 | "0": 47, 263 | "1": 64, 264 | "2": 71, 265 | "3": 82, 266 | "-1": 46 267 | }, 268 | "system_owns": { ... }, 269 | "challenge_owns": { ... }, 270 | "first_bloods": { ... }, 271 | "respects": { ... } 272 | } 273 | } 274 | } 275 | ``` 276 | 277 | `[GET]` Chart data for one year, 1-month step: 278 | ```js 279 | https://www.hackthebox.eu/api/v4/user/profile/graph/1Y/9001 280 | ``` 281 | ```json 282 | { 283 | "profile": { 284 | "graphData": { 285 | "user_owns": [11, 11, 11, 11, 11, 11, 20, 27, 37, 40, 71, 71], 286 | "system_owns": [9, 9, 9, 9, 9, 9, 17, 25, 35, 38, 71, 71], 287 | "challenge_owns": [0, 0, 0, 0, 0, 0, 4, 4, 73, 84, 90, 91], 288 | "first_bloods": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 289 | "respects": [0, 0, 0, 0, 0, 0, 2, 5, 9, 12, 17, 18] 290 | } 291 | } 292 | } 293 | ``` 294 | #### Content 295 | 296 | `[GET]` Content submitted by user: 297 | ```js 298 | https://www.hackthebox.eu/api/v4/user/profile/content/9001 299 | ``` 300 | ```json 301 | { 302 | "profile": { 303 | "content": { 304 | "machines": [{ 305 | "id": 196, 306 | "name": "Player", 307 | "os": "Linux", 308 | "machine_avatar": "\/storage\/avatars\/8a85f2aadb40bc8cf633f400d2236ef2.png", 309 | "difficulty": "Hard", 310 | "rating": "4.6", 311 | "user_owns": 1358, 312 | "system_owns": 1315 313 | }, ... 314 | ], 315 | "challenges": [{ 316 | "id": 129, 317 | "name": "Bounty Head", 318 | "category": "Hardware", 319 | "likes": 50, 320 | "dislikes": 0 321 | }, ... 322 | ], 323 | "writeups": [{ 324 | "id": 244, 325 | "machine_id": 192, 326 | "machine_avatar": "\/storage\/avatars\/ca06c447787b38ec940eb55d5c54b14c.png", 327 | "machine_name": "Writeup", 328 | "url": "https:\/\/www.youtube.com\/watch?v=g22ftc5KUFk", 329 | "likes": 0, 330 | "dislikes": 0, 331 | "type": "machine" 332 | }, ... 333 | ] 334 | } 335 | } 336 | } 337 | ``` 338 | #### Bloods 339 | `[GET]` Blood wins for user: 340 | ```js 341 | https://www.hackthebox.eu/api/v4/user/profile/bloods/9001 342 | ``` 343 | ```json 344 | { 345 | "profile": { 346 | "bloods": { 347 | "machines": [{ 348 | "id": 179, 349 | "name": "Arkham", 350 | "avatar": "\/storage\/avatars\/e77b1be865e66fde51d5ca25b7d8ba61.png", 351 | "os": "Windows", 352 | "difficulty_text": "Medium", 353 | "user_blood": true, 354 | "user_blood_difference": "2h 55m 34s", 355 | "root_blood": true, 356 | "root_blood_difference": "4h 44m 27s" 357 | }, 358 | { "id": 164 ... }, 359 | { "id": 175 ... }, 360 | { "id": 177 ... }, 361 | { "id": 179 ... } ... 362 | ], 363 | "challenges": [{ 364 | "id": 61, 365 | "name": "Not Art", 366 | "category_name": "Stego", 367 | "difficulty_text": "Hard", 368 | "blood_difference": "1d 7h 15m" 369 | }, 370 | { "id": 64 ... }, 371 | { "id": 68 ... }, 372 | { "id": 94 ... } ... 373 | ] 374 | } 375 | } 376 | } 377 | ``` 378 | #### Machine Attack Data [Chart] 379 | `[GET]` Overall machine solve progress (NOTE: User owns are counted here), including categories: 380 | ```js 381 | https://www.hackthebox.eu/api/v4/user/profile/chart/machines/attack/9001 382 | ``` 383 | ```json 384 | { 385 | "profile": { 386 | "machine_owns": { 387 | "solved": 25, 388 | "total": 168 389 | }, 390 | "machine_attack_paths": { 391 | "Web": { 392 | "solved": 16, 393 | "total": 124, 394 | "avg_user_solved": 10.29 395 | }, 396 | "Active Directory": { ... }, 397 | "File Misconfiguration": { ... }, 398 | "Outdated Software": { ... }, 399 | "Cryptography": { ... }, 400 | "Injection": { ... }, 401 | "Kerberoasting": { ... }, 402 | "CMS Exploit": { ... }, 403 | "Sandbox Escape": { ... }, 404 | "Network": { ... } 405 | } 406 | } 407 | } 408 | ``` 409 | -------------------------------------------------------------------------------- /_sass/support/_htbfonts.scss: -------------------------------------------------------------------------------- 1 | @import url("https://p.typekit.net/p.css?s=1&k=ryt3opf&ht=tk&f=39512.39516.39517.39518.39521.39523.40863.40866.40868.40872.40878.40879.40881.40888.40890.40891.40899.40905.40906&a=29927922&app=typekit&e=css"); 2 | 3 | @font-face { 4 | font-family:"neue-haas-unica"; 5 | src:url("https://use.typekit.net/af/6a58f8/00000000000000003b9b2058/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n6&v=3") format("woff2"),url("https://use.typekit.net/af/6a58f8/00000000000000003b9b2058/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n6&v=3") format("woff"),url("https://use.typekit.net/af/6a58f8/00000000000000003b9b2058/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n6&v=3") format("opentype"); 6 | font-display:auto;font-style:normal;font-weight:600; 7 | } 8 | 9 | @font-face { 10 | font-family:"neue-haas-unica"; 11 | src:url("https://use.typekit.net/af/6559ad/00000000000000003b9b205c/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff2"),url("https://use.typekit.net/af/6559ad/00000000000000003b9b205c/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff"),url("https://use.typekit.net/af/6559ad/00000000000000003b9b205c/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("opentype"); 12 | font-display:auto;font-style:normal;font-weight:700; 13 | } 14 | 15 | @font-face { 16 | font-family:"neue-haas-unica"; 17 | src:url("https://use.typekit.net/af/040829/00000000000000003b9b205d/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff2"),url("https://use.typekit.net/af/040829/00000000000000003b9b205d/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff"),url("https://use.typekit.net/af/040829/00000000000000003b9b205d/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("opentype"); 18 | font-display:auto;font-style:italic;font-weight:700; 19 | } 20 | 21 | @font-face { 22 | font-family:"neue-haas-unica"; 23 | src:url("https://use.typekit.net/af/18efc2/00000000000000003b9b205e/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff2"),url("https://use.typekit.net/af/18efc2/00000000000000003b9b205e/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff"),url("https://use.typekit.net/af/18efc2/00000000000000003b9b205e/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("opentype"); 24 | font-display:auto;font-style:italic;font-weight:400; 25 | } 26 | 27 | @font-face { 28 | font-family:"neue-haas-unica"; 29 | src:url("https://use.typekit.net/af/dff101/00000000000000003b9b2061/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n5&v=3") format("woff2"),url("https://use.typekit.net/af/dff101/00000000000000003b9b2061/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n5&v=3") format("woff"),url("https://use.typekit.net/af/dff101/00000000000000003b9b2061/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n5&v=3") format("opentype"); 30 | font-display:auto;font-style:normal;font-weight:500; 31 | } 32 | 33 | @font-face { 34 | font-family:"neue-haas-unica"; 35 | src:url("https://use.typekit.net/af/3da9bf/00000000000000003b9b2063/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff2"),url("https://use.typekit.net/af/3da9bf/00000000000000003b9b2063/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff"),url("https://use.typekit.net/af/3da9bf/00000000000000003b9b2063/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("opentype"); 36 | font-display:auto;font-style:normal;font-weight:400; 37 | } 38 | 39 | @font-face { 40 | font-family:"zeitung-micro"; 41 | src:url("https://use.typekit.net/af/f4f25a/00000000000000003b9b2a09/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff2"),url("https://use.typekit.net/af/f4f25a/00000000000000003b9b2a09/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff"),url("https://use.typekit.net/af/f4f25a/00000000000000003b9b2a09/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("opentype"); 42 | font-display:auto;font-style:italic;font-weight:400; 43 | } 44 | 45 | @font-face { 46 | font-family:"zeitung-micro"; 47 | src:url("https://use.typekit.net/af/fa1620/00000000000000003b9b2a0c/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff2"),url("https://use.typekit.net/af/fa1620/00000000000000003b9b2a0c/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff"),url("https://use.typekit.net/af/fa1620/00000000000000003b9b2a0c/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("opentype"); 48 | font-display:auto;font-style:normal;font-weight:400; 49 | } 50 | 51 | @font-face { 52 | font-family:"zeitung-micro"; 53 | src:url("https://use.typekit.net/af/4091a2/00000000000000003b9b2a0e/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff2"),url("https://use.typekit.net/af/4091a2/00000000000000003b9b2a0e/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff"),url("https://use.typekit.net/af/4091a2/00000000000000003b9b2a0e/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("opentype"); 54 | font-display:auto;font-style:normal;font-weight:700; 55 | } 56 | 57 | @font-face { 58 | font-family:"zeitung-micro"; 59 | src:url("https://use.typekit.net/af/78ef43/00000000000000003b9b2a12/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff2"),url("https://use.typekit.net/af/78ef43/00000000000000003b9b2a12/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff"),url("https://use.typekit.net/af/78ef43/00000000000000003b9b2a12/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("opentype"); 60 | font-display:auto;font-style:italic;font-weight:700; 61 | } 62 | 63 | @font-face { 64 | font-family:"zeitung-mono"; 65 | src:url("https://use.typekit.net/af/d93006/00000000000000003b9b2a18/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff2"),url("https://use.typekit.net/af/d93006/00000000000000003b9b2a18/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff"),url("https://use.typekit.net/af/d93006/00000000000000003b9b2a18/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("opentype"); 66 | font-display:auto;font-style:normal;font-weight:400; 67 | } 68 | 69 | @font-face { 70 | font-family:"zeitung-mono"; 71 | src:url("https://use.typekit.net/af/e000ca/00000000000000003b9b2a19/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff2"),url("https://use.typekit.net/af/e000ca/00000000000000003b9b2a19/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff"),url("https://use.typekit.net/af/e000ca/00000000000000003b9b2a19/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("opentype"); 72 | font-display:auto;font-style:italic;font-weight:400; 73 | } 74 | 75 | @font-face { 76 | font-family:"zeitung-mono"; 77 | src:url("https://use.typekit.net/af/3d2f76/00000000000000003b9b2a1b/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n6&v=3") format("woff2"),url("https://use.typekit.net/af/3d2f76/00000000000000003b9b2a1b/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n6&v=3") format("woff"),url("https://use.typekit.net/af/3d2f76/00000000000000003b9b2a1b/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n6&v=3") format("opentype"); 78 | font-display:auto;font-style:normal;font-weight:600; 79 | } 80 | 81 | @font-face { 82 | font-family:"zeitung-mono"; 83 | src:url("https://use.typekit.net/af/62caf7/00000000000000003b9b2a22/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff2"),url("https://use.typekit.net/af/62caf7/00000000000000003b9b2a22/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff"),url("https://use.typekit.net/af/62caf7/00000000000000003b9b2a22/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("opentype"); 84 | font-display:auto;font-style:italic;font-weight:700; 85 | } 86 | 87 | @font-face { 88 | font-family:"zeitung-mono"; 89 | src:url("https://use.typekit.net/af/9ac9d4/00000000000000003b9b2a24/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff2"),url("https://use.typekit.net/af/9ac9d4/00000000000000003b9b2a24/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff"),url("https://use.typekit.net/af/9ac9d4/00000000000000003b9b2a24/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("opentype"); 90 | font-display:auto;font-style:normal;font-weight:700; 91 | } 92 | 93 | @font-face { 94 | font-family:"zeitung"; 95 | src:url("https://use.typekit.net/af/37ff2c/00000000000000003b9b2a25/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff2"),url("https://use.typekit.net/af/37ff2c/00000000000000003b9b2a25/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("woff"),url("https://use.typekit.net/af/37ff2c/00000000000000003b9b2a25/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n7&v=3") format("opentype"); 96 | font-display:auto;font-style:normal;font-weight:700; 97 | } 98 | 99 | @font-face { 100 | font-family:"zeitung"; 101 | src:url("https://use.typekit.net/af/c9cd50/00000000000000003b9b2a2d/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff2"),url("https://use.typekit.net/af/c9cd50/00000000000000003b9b2a2d/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("woff"),url("https://use.typekit.net/af/c9cd50/00000000000000003b9b2a2d/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i7&v=3") format("opentype"); 102 | font-display:auto;font-style:italic;font-weight:700; 103 | } 104 | 105 | @font-face { 106 | font-family:"zeitung"; 107 | src:url("https://use.typekit.net/af/9ca44e/00000000000000003b9b2a33/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff2"),url("https://use.typekit.net/af/9ca44e/00000000000000003b9b2a33/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("woff"),url("https://use.typekit.net/af/9ca44e/00000000000000003b9b2a33/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=i4&v=3") format("opentype"); 108 | font-display:auto;font-style:italic;font-weight:400; 109 | } 110 | 111 | @font-face { 112 | font-family:"zeitung"; 113 | src:url("https://use.typekit.net/af/e4756b/00000000000000003b9b2a34/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff2"),url("https://use.typekit.net/af/e4756b/00000000000000003b9b2a34/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff"),url("https://use.typekit.net/af/e4756b/00000000000000003b9b2a34/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("opentype"); 114 | font-display:auto;font-style:normal;font-weight:400; 115 | } 116 | 117 | .tk-neue-haas-unica { font-family: "neue-haas-unica",sans-serif; } 118 | .tk-zeitung-micro { font-family: "zeitung-micro",sans-serif; } 119 | .tk-zeitung-mono { font-family: "zeitung-mono",sans-serif; } 120 | .tk-zeitung { font-family: "zeitung",sans-serif; } 121 | -------------------------------------------------------------------------------- /_posts/HTB Endpoint Map.md: -------------------------------------------------------------------------------- 1 | # HTB Endpoint Map 2 | ## For Api V4 3 | ## General requirements: 4 | Each API request must include a valid Authorization header with a currently valid JSON Web Token / JWT, e.g.: 5 | ```http 6 | Authorization: Bearer eyJ0eXAiOiJK.V1QiLCJhbGciOiJS.UzI1NiJ9 ... 7 | ``` 8 | ## Self 9 | `[GET]` Profile info for requesting account: 10 | ```css 11 | https://www.hackthebox.eu/api/v4/user/info 12 | ``` 13 | ```json 14 | { 15 | "info": { 16 | "id": 9001, 17 | "name": "L33tUser", 18 | "email": "l33t@email.com", 19 | "timezone": "UTC", 20 | "isVip": true, 21 | "canAccessVIP": true, 22 | "isServerVIP": true, 23 | "server_id": 222, 24 | "avatar": "\/storage\/avatars\/e6baffa3faa.png" 25 | } 26 | } 27 | ``` 28 | `[GET]` VPN connection status info, such as current IP and uptime, for requesting account: 29 | ```css 30 | https://www.hackthebox.eu/api/v4/user/connection/status 31 | ``` 32 | ```json 33 | { 34 | "status": "1", 35 | "connection": { 36 | "name": "Username", 37 | "ip4": "10.10.14.50", 38 | "ip6": "dead:beef:2::100a", 39 | "down": "0.09", 40 | "up": "0.08" 41 | } 42 | } 43 | ``` 44 | `[GET]` The active machine, if user is VIP and has a running instance: 45 | ```css 46 | https://www.hackthebox.eu/api/v4/machine/active 47 | ``` 48 | ```json 49 | { 50 | "info": { 51 | "id": 244, 52 | "name": "Quick", 53 | "avatar": "\/storage\/avatars\/c2096057971181c8d36031fb6f1f7a8a.png", 54 | "expires_at": "2020-07-08 14:14:53", 55 | "voting": false, 56 | "voted": false 57 | } 58 | } 59 | ``` 60 | 61 | `[GET]` Machines marked as 'Todo' by the API user: 62 | ```css 63 | https://www.hackthebox.eu/api/v4/machine/todo 64 | ``` 65 | ```json 66 | { 67 | "info": [ "... an array of standard machine objects ..." ] 68 | } 69 | ``` 70 | 71 | `[GET]` Challenges marked as 'Todo' by the API user: 72 | ```css 73 | https://www.hackthebox.eu/api/v4/challenge/todo 74 | ``` 75 | ```json 76 | { 77 | "info": [ "... an array of standard challenge objects ..." ] 78 | } 79 | ``` 80 | 81 | `[GET]` Anonymized id for requesting account: 82 | ```css 83 | https://www.hackthebox.eu/api/v4/user/anonymized/id 84 | ``` 85 | ```json 86 | {"id":"0bb526172123027df47df67cb6d032db"} 87 | ``` 88 | ## User 89 | These queries should be suffixed by the user ID, (demo: `9001`) 90 | ### Profile 91 | `[GET]` Complete profile details for user: 92 | ```css 93 | https://www.hackthebox.eu/api/v4/user/profile/basic/9001 94 | ``` 95 | ```json 96 | { 97 | "profile": { 98 | "id": 9001, 99 | "name": "L33tUser", 100 | "timezone": "UTC", 101 | "isVip": true, 102 | "avatar": "\/storage\/avatars\/e6baffa3faa648fabf69761ca492213a.png", 103 | "points": 225, 104 | "system_owns": 25, 105 | "user_owns": 26, 106 | "user_bloods": 3, 107 | "system_bloods": 4, 108 | "respects": 5994, 109 | "country_name": "Fiji", 110 | "country_code": "TR", 111 | "team": { 112 | "name": "PartyFunbois", 113 | "ranking": 1, 114 | "avatar": "\/storage\/teams\/8232e119d8f59aa83050a741631803d6.jpg" 115 | }, 116 | "university_name": "L33t University", 117 | "description": "Hi I am L33t Hax0r, I like to hack box and profit", 118 | "github": "https://github.com/l33tb0i", 119 | "linkedin": "https://www.linkedin.com/in/L33tB0i/", 120 | "twitter": null, 121 | "website": null, 122 | "server": "EU VIP 27", 123 | "rank": "Guru", 124 | "rank_id": 4, 125 | "current_rank_progress": 0, 126 | "next_rank": "Omniscient", 127 | "next_rank_points": 31.331999999999997, 128 | "rank_ownership": "99.76", 129 | "rank_requirement": 45, 130 | "ranking": 23 131 | } 132 | } 133 | ``` 134 | #### Activity 135 | 136 | `[GET]` Complete list of owns involving a machine (user / root), challenge, or Endgame, for a given UID: 137 | ```css 138 | https://www.hackthebox.eu/api/v4/user/profile/activity/9001 139 | ``` 140 | 141 | ```json 142 | { 143 | "profile": { 144 | "activity": [{ 145 | "date": "2020-07-05T12:43:33.000000Z", 146 | "date_diff": "1 day ago", 147 | "object_type": "machine", 148 | "type": "root", 149 | "id": 261, 150 | "name": "Intense", 151 | "points": 40, 152 | "machine_avatar": "\/storage\/avatars\/41fa976e012eb51bee13efc5419ce8ac_thumb.png" 153 | }, { 154 | "date": "2020-07-03T20:02:11.000000Z", 155 | "date_diff": "3 days ago", 156 | "object_type": "challenge", 157 | "type": "challenge", 158 | "id": 131, 159 | "name": "ID Exposed", 160 | "points": 2, 161 | "challenge_category": "OSINT" 162 | }, { 163 | "date": "2020-06-21T16:30:54.000000Z", 164 | "date_diff": "2 weeks ago", 165 | "object_type": "endgame", 166 | "type": "endgame", 167 | "id": 4, 168 | "name": "RPG", 169 | "points": 40, 170 | "flag_title": "Collapse of the empire" 171 | }, { 172 | "date": "2020-05-20T15:01:04.000000Z", 173 | "date_diff": "1 month ago", 174 | "object_type": "fortress", 175 | "type": "fortress", 176 | "id": 2, 177 | "name": "AKERVA", 178 | "points": 15, 179 | "flag_title": "Little Secret" 180 | }, ... 181 | ] 182 | } 183 | } 184 | ``` 185 | 186 | #### Progress 187 | 188 | `[GET]` Machine progress for user: 189 | ```css 190 | https://www.hackthebox.eu/api/v4/user/profile/progress/machines/os/9001 191 | ``` 192 | ```json 193 | { 194 | "profile": { 195 | "operating_systems": [{ 196 | "name": "Linux", 197 | "completion_percentage": 10, 198 | "owned_machines": 11, 199 | "total_machines": 110 200 | {"name": "Windows" ... }, 201 | {"name": "FreeBSD" ... }, 202 | {"name": "Solaris" ... }, 203 | {"name": "Other" ... } 204 | ] 205 | } 206 | } 207 | 208 | ``` 209 | `[GET]` Challenge progress for user: 210 | ```css 211 | https://www.hackthebox.eu/api/v4/user/profile/progress/challenges/9001 212 | ``` 213 | ```json 214 | { 215 | "profile": { 216 | "challenge_owns": { 217 | "solved": 100, 218 | "total": 127 219 | }, 220 | "challenge_categories": [{ 221 | "name": "Reversing", 222 | "owned_flags": 2, 223 | "total_flags": 19, 224 | "completion_percentage": 11, 225 | "avg_user_solved": 0.77 226 | }, 227 | {"name": "Crypto" ... }, 228 | {"name": "Stego" ... }, 229 | {"name": "Pwn" ... }, 230 | {"name": "Web" ... }, 231 | {"name": "Misc" ... }, 232 | {"name": "Forensics" ... }, 233 | {"name": "Mobile" ... }, 234 | {"name": "OSINT" ... }, 235 | {"name": "Hardware" ... }, 236 | ] 237 | } 238 | } 239 | ``` 240 | 241 | `[GET]` Endgame progress for user: 242 | ```css 243 | https://www.hackthebox.eu/api/v4/user/profile/progress/endgame/9001 244 | ``` 245 | ```json 246 | { 247 | "profile": { 248 | "endgames": [{ 249 | "name": "P.O.O.", 250 | "completion_percentage": 0, 251 | "owned_flags": 0, 252 | "total_flags": 5 253 | }, 254 | {"name": "Xen" ... }, 255 | {"name": "Hades" ... }, 256 | {"name": "RPG" ... } 257 | ] 258 | } 259 | } 260 | 261 | ``` 262 | 263 | 264 | `[GET]` Fortress progress for user: 265 | ```css 266 | https://www.hackthebox.eu/api/v4/user/profile/progress/fortress/9001 267 | ``` 268 | ```json 269 | { 270 | "profile": { 271 | "fortresses": [{ 272 | "name": "Jet", 273 | "avatar": "https:\/\/www.hackthebox.eu\/storage\/companies\/3.png", 274 | "completion_percentage": 0, 275 | "owned_flags": 0, 276 | "total_flags": 11 277 | }, 278 | { "name": "Akerva" ... }, 279 | ] 280 | } 281 | } 282 | ``` 283 | 284 | `[GET]` Pro Lab progress for user: 285 | ```css 286 | https://www.hackthebox.eu/api/v4/user/profile/progress/prolab/9001 287 | ``` 288 | ```json 289 | { 290 | "profile": { 291 | "prolabs": [{ 292 | "name": "RastaLabs", 293 | "subscribed": false, 294 | "completion_percentage": 0, 295 | "owned_flags": 14, 296 | "total_flags": 20, 297 | "total_machines": 14, 298 | "average_ratings": 4.87 299 | }, 300 | { "name": "Offshore" ... }, 301 | { "name": "Cybernetics" ... } 302 | ] 303 | } 304 | } 305 | ``` 306 | #### Graph 307 | 308 | `[GET]` Chart data for one week, daily step: 309 | ```css 310 | https://www.hackthebox.eu/api/v4/user/profile/graph/1W/9001 311 | ``` 312 | ```json 313 | { 314 | "profile": { 315 | "graphData": { 316 | "user_owns": [71, 71, 71, 71, 71, 71, 71], 317 | "system_owns": [71, 71, 71, 71, 71, 71, 71], 318 | "challenge_owns": [90, 90, 90, 90, 90, 90, 91], 319 | "first_bloods": [0, 0, 0, 0, 0, 0, 0], 320 | "respects": [17, 17, 17, 17, 18, 18, 18] 321 | } 322 | } 323 | } 324 | ``` 325 | 326 | `[GET]` Chart data for one month, weekly step: 327 | ```css 328 | https://www.hackthebox.eu/api/v4/user/profile/graph/1Y/9001 329 | ``` 330 | ```json 331 | { 332 | "profile": { 333 | "graphData": { 334 | "user_owns": { 335 | "0": 47, 336 | "1": 64, 337 | "2": 71, 338 | "3": 82, 339 | "-1": 46 340 | }, 341 | "system_owns": { ... }, 342 | "challenge_owns": { ... }, 343 | "first_bloods": { ... }, 344 | "respects": { ... } 345 | } 346 | } 347 | } 348 | ``` 349 | 350 | `[GET]` Chart data for one year, 1-month step: 351 | ```css 352 | https://www.hackthebox.eu/api/v4/user/profile/graph/1Y/9001 353 | ``` 354 | ```json 355 | { 356 | "profile": { 357 | "graphData": { 358 | "user_owns": [11, 11, 11, 11, 11, 11, 20, 27, 37, 40, 71, 71], 359 | "system_owns": [9, 9, 9, 9, 9, 9, 17, 25, 35, 38, 71, 71], 360 | "challenge_owns": [0, 0, 0, 0, 0, 0, 4, 4, 73, 84, 90, 91], 361 | "first_bloods": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 362 | "respects": [0, 0, 0, 0, 0, 0, 2, 5, 9, 12, 17, 18] 363 | } 364 | } 365 | } 366 | ``` 367 | #### Content 368 | 369 | `[GET]` Content submitted by user: 370 | ```css 371 | https://www.hackthebox.eu/api/v4/user/profile/content/9001 372 | ``` 373 | ```json 374 | { 375 | "profile": { 376 | "content": { 377 | "machines": [{ 378 | "id": 196, 379 | "name": "Player", 380 | "os": "Linux", 381 | "machine_avatar": "\/storage\/avatars\/8a85f2aadb40bc8cf633f400d2236ef2.png", 382 | "difficulty": "Hard", 383 | "rating": "4.6", 384 | "user_owns": 1358, 385 | "system_owns": 1315 386 | }, ... 387 | ], 388 | "challenges": [{ 389 | "id": 129, 390 | "name": "Bounty Head", 391 | "category": "Hardware", 392 | "likes": 50, 393 | "dislikes": 0 394 | }, ... 395 | ], 396 | "writeups": [{ 397 | "id": 244, 398 | "machine_id": 192, 399 | "machine_avatar": "\/storage\/avatars\/ca06c447787b38ec940eb55d5c54b14c.png", 400 | "machine_name": "Writeup", 401 | "url": "https:\/\/www.youtube.com\/watch?v=g22ftc5KUFk", 402 | "likes": 0, 403 | "dislikes": 0, 404 | "type": "machine" 405 | }, ... 406 | ] 407 | } 408 | } 409 | } 410 | ``` 411 | #### Bloods 412 | `[GET]` Blood wins for user: 413 | ```css 414 | https://www.hackthebox.eu/api/v4/user/profile/bloods/9001 415 | ``` 416 | ```json 417 | { 418 | "profile": { 419 | "bloods": { 420 | "machines": [{ 421 | "id": 179, 422 | "name": "Arkham", 423 | "avatar": "\/storage\/avatars\/e77b1be865e66fde51d5ca25b7d8ba61.png", 424 | "os": "Windows", 425 | "difficulty_text": "Medium", 426 | "user_blood": true, 427 | "user_blood_difference": "2h 55m 34s", 428 | "root_blood": true, 429 | "root_blood_difference": "4h 44m 27s" 430 | }, 431 | { "id": 164 ... }, 432 | { "id": 175 ... }, 433 | { "id": 177 ... }, 434 | { "id": 179 ... } ... 435 | ], 436 | "challenges": [{ 437 | "id": 61, 438 | "name": "Not Art", 439 | "category_name": "Stego", 440 | "difficulty_text": "Hard", 441 | "blood_difference": "1d 7h 15m" 442 | }, 443 | { "id": 64 ... }, 444 | { "id": 68 ... }, 445 | { "id": 94 ... } ... 446 | ] 447 | } 448 | } 449 | } 450 | ``` 451 | #### Machine Attack Data [Chart] 452 | `[GET]` Overall machine solve progress (NOTE: User owns are counted here), including categories: 453 | ```css 454 | https://www.hackthebox.eu/api/v4/user/profile/chart/machines/attack/9001 455 | ``` 456 | ```json 457 | { 458 | "profile": { 459 | "machine_owns": { 460 | "solved": 25, 461 | "total": 168 462 | }, 463 | "machine_attack_paths": { 464 | "Web": { 465 | "solved": 16, 466 | "total": 124, 467 | "avg_user_solved": 10.29 468 | }, 469 | "Active Directory": { ... }, 470 | "File Misconfiguration": { ... }, 471 | "Outdated Software": { ... }, 472 | "Cryptography": { ... }, 473 | "Injection": { ... }, 474 | "Kerberoasting": { ... }, 475 | "CMS Exploit": { ... }, 476 | "Sandbox Escape": { ... }, 477 | "Network": { ... } 478 | } 479 | } 480 | } 481 | ``` 482 | 483 | ### Activity (Owns) 484 | 485 | 486 | ### Bloods 487 | 488 | ## Machine 489 | 490 | ### Categories 491 | ## Challenges 492 | ### Categories 493 | 494 | `https://www.hackthebox.eu/api/v4/challenge/categories/list` 495 | ### List 496 | ## Pro Labs 497 | ## Endgames 498 | ## Fortresses -------------------------------------------------------------------------------- /assets/js/just-the-docs.js: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | (function (jtd, undefined) { 4 | 5 | // Event handling 6 | 7 | jtd.addEvent = function(el, type, handler) { 8 | if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler); 9 | } 10 | jtd.removeEvent = function(el, type, handler) { 11 | if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler); 12 | } 13 | jtd.onReady = function(ready) { 14 | // in case the document is already rendered 15 | if (document.readyState!='loading') ready(); 16 | // modern browsers 17 | else if (document.addEventListener) document.addEventListener('DOMContentLoaded', ready); 18 | // IE <= 8 19 | else document.attachEvent('onreadystatechange', function(){ 20 | if (document.readyState=='complete') ready(); 21 | }); 22 | } 23 | 24 | // Show/hide mobile menu 25 | 26 | function initNav() { 27 | jtd.addEvent(document, 'click', function(e){ 28 | var target = e.target; 29 | while (target && !(target.classList && target.classList.contains('nav-list-expander'))) { 30 | target = target.parentNode; 31 | } 32 | if (target) { 33 | e.preventDefault(); 34 | target.parentNode.classList.toggle('active'); 35 | } 36 | }); 37 | 38 | const siteNav = document.getElementById('site-nav'); 39 | const mainHeader = document.getElementById('main-header'); 40 | const menuButton = document.getElementById('menu-button'); 41 | 42 | jtd.addEvent(menuButton, 'click', function(e){ 43 | e.preventDefault(); 44 | 45 | if (menuButton.classList.toggle('nav-open')) { 46 | siteNav.classList.add('nav-open'); 47 | mainHeader.classList.add('nav-open'); 48 | } else { 49 | siteNav.classList.remove('nav-open'); 50 | mainHeader.classList.remove('nav-open'); 51 | } 52 | }); 53 | 54 | {%- if site.search_enabled != false and site.search.button %} 55 | const searchInput = document.getElementById('search-input'); 56 | const searchButton = document.getElementById('search-button'); 57 | 58 | jtd.addEvent(searchButton, 'click', function(e){ 59 | e.preventDefault(); 60 | 61 | mainHeader.classList.add('nav-open'); 62 | searchInput.focus(); 63 | }); 64 | {%- endif %} 65 | } 66 | 67 | {%- if site.search_enabled != false %} 68 | // Site search 69 | 70 | function initSearch() { 71 | var request = new XMLHttpRequest(); 72 | request.open('GET', '{{ "assets/js/search-data.json" | absolute_url }}', true); 73 | 74 | request.onload = function(){ 75 | if (request.status >= 200 && request.status < 400) { 76 | var docs = JSON.parse(request.responseText); 77 | 78 | lunr.tokenizer.separator = {{ site.search.tokenizer_separator | default: site.search_tokenizer_separator | default: "/[\s\-/]+/" }} 79 | 80 | var index = lunr(function(){ 81 | this.ref('id'); 82 | this.field('title', { boost: 200 }); 83 | this.field('content', { boost: 2 }); 84 | {%- if site.search.rel_url != false %} 85 | this.field('relUrl'); 86 | {%- endif %} 87 | this.metadataWhitelist = ['position'] 88 | 89 | for (var i in docs) { 90 | this.add({ 91 | id: i, 92 | title: docs[i].title, 93 | content: docs[i].content, 94 | {%- if site.search.rel_url != false %} 95 | relUrl: docs[i].relUrl 96 | {%- endif %} 97 | }); 98 | } 99 | }); 100 | 101 | searchLoaded(index, docs); 102 | } else { 103 | console.log('Error loading ajax request. Request status:' + request.status); 104 | } 105 | }; 106 | 107 | request.onerror = function(){ 108 | console.log('There was a connection error'); 109 | }; 110 | 111 | request.send(); 112 | } 113 | 114 | function searchLoaded(index, docs) { 115 | var index = index; 116 | var docs = docs; 117 | var searchInput = document.getElementById('search-input'); 118 | var searchResults = document.getElementById('search-results'); 119 | var mainHeader = document.getElementById('main-header'); 120 | var currentInput; 121 | var currentSearchIndex = 0; 122 | 123 | function showSearch() { 124 | document.documentElement.classList.add('search-active'); 125 | } 126 | 127 | function hideSearch() { 128 | document.documentElement.classList.remove('search-active'); 129 | } 130 | 131 | function update() { 132 | currentSearchIndex++; 133 | 134 | var input = searchInput.value; 135 | if (input === '') { 136 | hideSearch(); 137 | } else { 138 | showSearch(); 139 | // scroll search input into view, workaround for iOS Safari 140 | window.scroll(0, -1); 141 | setTimeout(function(){ window.scroll(0, 0); }, 0); 142 | } 143 | if (input === currentInput) { 144 | return; 145 | } 146 | currentInput = input; 147 | searchResults.innerHTML = ''; 148 | if (input === '') { 149 | return; 150 | } 151 | 152 | var results = index.query(function (query) { 153 | var tokens = lunr.tokenizer(input) 154 | query.term(tokens, { 155 | boost: 10 156 | }); 157 | query.term(tokens, { 158 | wildcard: lunr.Query.wildcard.TRAILING 159 | }); 160 | }); 161 | 162 | if ((results.length == 0) && (input.length > 2)) { 163 | var tokens = lunr.tokenizer(input).filter(function(token, i) { 164 | return token.str.length < 20; 165 | }) 166 | if (tokens.length > 0) { 167 | results = index.query(function (query) { 168 | query.term(tokens, { 169 | editDistance: Math.round(Math.sqrt(input.length / 2 - 1)) 170 | }); 171 | }); 172 | } 173 | } 174 | 175 | if (results.length == 0) { 176 | var noResultsDiv = document.createElement('div'); 177 | noResultsDiv.classList.add('search-no-result'); 178 | noResultsDiv.innerText = 'No results found'; 179 | searchResults.appendChild(noResultsDiv); 180 | 181 | } else { 182 | var resultsList = document.createElement('ul'); 183 | resultsList.classList.add('search-results-list'); 184 | searchResults.appendChild(resultsList); 185 | 186 | addResults(resultsList, results, 0, 10, 100, currentSearchIndex); 187 | } 188 | 189 | function addResults(resultsList, results, start, batchSize, batchMillis, searchIndex) { 190 | if (searchIndex != currentSearchIndex) { 191 | return; 192 | } 193 | for (var i = start; i < (start + batchSize); i++) { 194 | if (i == results.length) { 195 | return; 196 | } 197 | addResult(resultsList, results[i]); 198 | } 199 | setTimeout(function() { 200 | addResults(resultsList, results, start + batchSize, batchSize, batchMillis, searchIndex); 201 | }, batchMillis); 202 | } 203 | 204 | function addResult(resultsList, result) { 205 | var doc = docs[result.ref]; 206 | 207 | var resultsListItem = document.createElement('li'); 208 | resultsListItem.classList.add('search-results-list-item'); 209 | resultsList.appendChild(resultsListItem); 210 | 211 | var resultLink = document.createElement('a'); 212 | resultLink.classList.add('search-result'); 213 | resultLink.setAttribute('href', doc.url); 214 | resultsListItem.appendChild(resultLink); 215 | 216 | var resultTitle = document.createElement('div'); 217 | resultTitle.classList.add('search-result-title'); 218 | resultLink.appendChild(resultTitle); 219 | 220 | var resultDoc = document.createElement('div'); 221 | resultDoc.classList.add('search-result-doc'); 222 | resultDoc.innerHTML = ''; 223 | resultTitle.appendChild(resultDoc); 224 | 225 | var resultDocTitle = document.createElement('div'); 226 | resultDocTitle.classList.add('search-result-doc-title'); 227 | resultDocTitle.innerHTML = doc.doc; 228 | resultDoc.appendChild(resultDocTitle); 229 | var resultDocOrSection = resultDocTitle; 230 | 231 | if (doc.doc != doc.title) { 232 | resultDoc.classList.add('search-result-doc-parent'); 233 | var resultSection = document.createElement('div'); 234 | resultSection.classList.add('search-result-section'); 235 | resultSection.innerHTML = doc.title; 236 | resultTitle.appendChild(resultSection); 237 | resultDocOrSection = resultSection; 238 | } 239 | 240 | var metadata = result.matchData.metadata; 241 | var titlePositions = []; 242 | var contentPositions = []; 243 | for (var j in metadata) { 244 | var meta = metadata[j]; 245 | if (meta.title) { 246 | var positions = meta.title.position; 247 | for (var k in positions) { 248 | titlePositions.push(positions[k]); 249 | } 250 | } 251 | if (meta.content) { 252 | var positions = meta.content.position; 253 | for (var k in positions) { 254 | var position = positions[k]; 255 | var previewStart = position[0]; 256 | var previewEnd = position[0] + position[1]; 257 | var ellipsesBefore = true; 258 | var ellipsesAfter = true; 259 | for (var k = 0; k < {{ site.search.preview_words_before | default: 5 }}; k++) { 260 | var nextSpace = doc.content.lastIndexOf(' ', previewStart - 2); 261 | var nextDot = doc.content.lastIndexOf('. ', previewStart - 2); 262 | if ((nextDot >= 0) && (nextDot > nextSpace)) { 263 | previewStart = nextDot + 1; 264 | ellipsesBefore = false; 265 | break; 266 | } 267 | if (nextSpace < 0) { 268 | previewStart = 0; 269 | ellipsesBefore = false; 270 | break; 271 | } 272 | previewStart = nextSpace + 1; 273 | } 274 | for (var k = 0; k < {{ site.search.preview_words_after | default: 10 }}; k++) { 275 | var nextSpace = doc.content.indexOf(' ', previewEnd + 1); 276 | var nextDot = doc.content.indexOf('. ', previewEnd + 1); 277 | if ((nextDot >= 0) && (nextDot < nextSpace)) { 278 | previewEnd = nextDot; 279 | ellipsesAfter = false; 280 | break; 281 | } 282 | if (nextSpace < 0) { 283 | previewEnd = doc.content.length; 284 | ellipsesAfter = false; 285 | break; 286 | } 287 | previewEnd = nextSpace; 288 | } 289 | contentPositions.push({ 290 | highlight: position, 291 | previewStart: previewStart, previewEnd: previewEnd, 292 | ellipsesBefore: ellipsesBefore, ellipsesAfter: ellipsesAfter 293 | }); 294 | } 295 | } 296 | } 297 | 298 | if (titlePositions.length > 0) { 299 | titlePositions.sort(function(p1, p2){ return p1[0] - p2[0] }); 300 | resultDocOrSection.innerHTML = ''; 301 | addHighlightedText(resultDocOrSection, doc.title, 0, doc.title.length, titlePositions); 302 | } 303 | 304 | if (contentPositions.length > 0) { 305 | contentPositions.sort(function(p1, p2){ return p1.highlight[0] - p2.highlight[0] }); 306 | var contentPosition = contentPositions[0]; 307 | var previewPosition = { 308 | highlight: [contentPosition.highlight], 309 | previewStart: contentPosition.previewStart, previewEnd: contentPosition.previewEnd, 310 | ellipsesBefore: contentPosition.ellipsesBefore, ellipsesAfter: contentPosition.ellipsesAfter 311 | }; 312 | var previewPositions = [previewPosition]; 313 | for (var j = 1; j < contentPositions.length; j++) { 314 | contentPosition = contentPositions[j]; 315 | if (previewPosition.previewEnd < contentPosition.previewStart) { 316 | previewPosition = { 317 | highlight: [contentPosition.highlight], 318 | previewStart: contentPosition.previewStart, previewEnd: contentPosition.previewEnd, 319 | ellipsesBefore: contentPosition.ellipsesBefore, ellipsesAfter: contentPosition.ellipsesAfter 320 | } 321 | previewPositions.push(previewPosition); 322 | } else { 323 | previewPosition.highlight.push(contentPosition.highlight); 324 | previewPosition.previewEnd = contentPosition.previewEnd; 325 | previewPosition.ellipsesAfter = contentPosition.ellipsesAfter; 326 | } 327 | } 328 | 329 | var resultPreviews = document.createElement('div'); 330 | resultPreviews.classList.add('search-result-previews'); 331 | resultLink.appendChild(resultPreviews); 332 | 333 | var content = doc.content; 334 | for (var j = 0; j < Math.min(previewPositions.length, {{ site.search.previews | default: 3 }}); j++) { 335 | var position = previewPositions[j]; 336 | 337 | var resultPreview = document.createElement('div'); 338 | resultPreview.classList.add('search-result-preview'); 339 | resultPreviews.appendChild(resultPreview); 340 | 341 | if (position.ellipsesBefore) { 342 | resultPreview.appendChild(document.createTextNode('... ')); 343 | } 344 | addHighlightedText(resultPreview, content, position.previewStart, position.previewEnd, position.highlight); 345 | if (position.ellipsesAfter) { 346 | resultPreview.appendChild(document.createTextNode(' ...')); 347 | } 348 | } 349 | } 350 | 351 | {%- if site.search.rel_url != false %} 352 | var resultRelUrl = document.createElement('span'); 353 | resultRelUrl.classList.add('search-result-rel-url'); 354 | resultRelUrl.innerText = doc.relUrl; 355 | resultTitle.appendChild(resultRelUrl); 356 | {%- endif %} 357 | } 358 | 359 | function addHighlightedText(parent, text, start, end, positions) { 360 | var index = start; 361 | for (var i in positions) { 362 | var position = positions[i]; 363 | var span = document.createElement('span'); 364 | span.innerHTML = text.substring(index, position[0]); 365 | parent.appendChild(span); 366 | index = position[0] + position[1]; 367 | var highlight = document.createElement('span'); 368 | highlight.classList.add('search-result-highlight'); 369 | highlight.innerHTML = text.substring(position[0], index); 370 | parent.appendChild(highlight); 371 | } 372 | var span = document.createElement('span'); 373 | span.innerHTML = text.substring(index, end); 374 | parent.appendChild(span); 375 | } 376 | } 377 | 378 | jtd.addEvent(searchInput, 'focus', function(){ 379 | setTimeout(update, 0); 380 | }); 381 | 382 | jtd.addEvent(searchInput, 'keyup', function(e){ 383 | switch (e.keyCode) { 384 | case 27: // When esc key is pressed, hide the results and clear the field 385 | searchInput.value = ''; 386 | break; 387 | case 38: // arrow up 388 | case 40: // arrow down 389 | case 13: // enter 390 | e.preventDefault(); 391 | return; 392 | } 393 | update(); 394 | }); 395 | 396 | jtd.addEvent(searchInput, 'keydown', function(e){ 397 | switch (e.keyCode) { 398 | case 38: // arrow up 399 | e.preventDefault(); 400 | var active = document.querySelector('.search-result.active'); 401 | if (active) { 402 | active.classList.remove('active'); 403 | if (active.parentElement.previousSibling) { 404 | var previous = active.parentElement.previousSibling.querySelector('.search-result'); 405 | previous.classList.add('active'); 406 | } 407 | } 408 | return; 409 | case 40: // arrow down 410 | e.preventDefault(); 411 | var active = document.querySelector('.search-result.active'); 412 | if (active) { 413 | if (active.parentElement.nextSibling) { 414 | var next = active.parentElement.nextSibling.querySelector('.search-result'); 415 | active.classList.remove('active'); 416 | next.classList.add('active'); 417 | } 418 | } else { 419 | var next = document.querySelector('.search-result'); 420 | if (next) { 421 | next.classList.add('active'); 422 | } 423 | } 424 | return; 425 | case 13: // enter 426 | e.preventDefault(); 427 | var active = document.querySelector('.search-result.active'); 428 | if (active) { 429 | active.click(); 430 | } else { 431 | var first = document.querySelector('.search-result'); 432 | if (first) { 433 | first.click(); 434 | } 435 | } 436 | return; 437 | } 438 | }); 439 | 440 | jtd.addEvent(document, 'click', function(e){ 441 | if (e.target != searchInput) { 442 | hideSearch(); 443 | } 444 | }); 445 | } 446 | {%- endif %} 447 | 448 | // Switch theme 449 | 450 | jtd.getTheme = function() { 451 | var cssFileHref = document.querySelector('[rel="stylesheet"]').getAttribute('href'); 452 | return cssFileHref.substring(cssFileHref.lastIndexOf('-') + 1, cssFileHref.length - 4); 453 | } 454 | 455 | jtd.setTheme = function(theme) { 456 | var cssFile = document.querySelector('[rel="stylesheet"]'); 457 | cssFile.setAttribute('href', '{{ "assets/css/just-the-docs-" | absolute_url }}' + theme + '.css'); 458 | } 459 | 460 | // Document ready 461 | 462 | jtd.onReady(function(){ 463 | initNav(); 464 | {%- if site.search_enabled != false %} 465 | initSearch(); 466 | {%- endif %} 467 | }); 468 | 469 | })(window.jtd = window.jtd || {}); 470 | 471 | {% include js/custom.js %} 472 | --------------------------------------------------------------------------------