diff --git a/archetypes/default.md b/archetypes/default.md index c6f3fce..977aef3 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -2,4 +2,5 @@ title = '{{ replace .File.ContentBaseName "-" " " | title }}' date = {{ .Date }} draft = true +tags = [] +++ diff --git a/content/posts/hosting_hugo_troubles.md b/content/posts/hosting_hugo_troubles.md new file mode 100644 index 0000000..b3a424e --- /dev/null +++ b/content/posts/hosting_hugo_troubles.md @@ -0,0 +1,117 @@ ++++ +title = 'Trouble Hosting Hugo with Nginx' +date = 2023-09-20T11:33:22-04:00 +draft = false +tags = ["tips & tricks", "self-hosted", "troubleshooting" ] ++++ + +For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not +loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse +proxy protocols such as `$proxy_host`, `$forward_scheme`, and `$port`. There are a few more and I'm happy to share some +reverse proxy nginx config files. See my post on [moving from NPM to Nginx]({{< ref "posts/npm_to_nginx_tutorial.md" >}}) for more information. + +Once I got the basic idea of this blog up and running, I ran `hugo` and then used `scp` to send the files to my nginx host's +public folder. Despite `index.html` and all the CSS files being in the right spots, I kept getting a few repetitive errors +from nginx - either in my browser's console or in nginx's log files. I swore I read through every StackOverflow or personal +blog post I could find. In fact, the next day, I would sit back down after work to debug and I would continue to find the +same sites and posts I found the day before! It was getting frustrating. + +Wouldn't you know... it was one of the simplest solutions that got it all working. Here's a breakdown of what I was seeing +and my hypothesis. + +*Console Errors:* + +* Incorrect MIME type --> `css` files being set as `text/html` type. +* 500/502 Errors when trying to load javascript files +* 500 Errors when trying to load child pages. + +*Nginx Log Errors for this server:* + +* `[error] 1147432#1147432: *84013 invalid URL prefix in "://:/favicon-16x16.png"` +* `[warn] 1147432#1147432: *84013 using uninitialized "port" variable` + +*Nginx `error.log` errors:* + +* `[error] 1118832#1118832: *77105 directory index of "/var/www/html/" is forbidden` + +I thought I had tried everything, but it was a rip and replace from a single blog post that solved it for me. Some of the +things I tried include the following. _Note: when I mention 'nginx config file' below, I am referring to the specific file +for this subdomain. I have a single global nginx.conf and then individual files for each subdomain/proxy host. + +* Editing `index.html` to ensure that any referenced file had an explicit mime type associated with it. +* Included `include { full path }/mime.types` in the specific nginx config file. +* Included specific `location ~ \.(css|js)$ {` sections in my nginx config file. +* Tried assigning the `$forward_scheme`, `$host`, and `$port` variables (similar to a reverse proxy host). +* Removing any SSL references <-- This caused similar behavior but different errors! I thought I was making progress...๐Ÿซฅ +* Switched out the variables of `root` and `alias` between my `server` and `location` blocks. +* Started with something super simple, such as the suggestions from [Gideon Wolfe's Block](https://gideonwolfe.com/posts/sysadmin/hugonginx/). + +If you clicked on the link I just shared, you'll see that Gideon's setup is quite similar to the one that I finally got to +work. My thought there is that my errors were less about the nginx config setup from within the file, and instead it's very +possible that I set incorrect directory permissions after transferring all the public files to the web server. Gideon's blog +was the very first I clicked on, so I owe them my thanks since their site was the entry point to figuring all this out! +You can find a list of all the blogs I stumbled upon in this weird and fluctuating journey of doing something as simple as +sharing my static files on an nginx web server. + +In the end, [newbs.rocks blog post](https://newbs.rocks/posts/hugo-setup/) on setting up Hugo with nginx provided me a config +example that worked for my setup. I think part of what happened was that as I was cycling through all the blog posts and +StackOverflow posts, I would remove one or two lines (usually the one or two I changed from the previous post's +recommendations) but in doing that, was making more of a mess for myself, burying the error even more deeply. By replacing +everything, I've brought it back to a manageable place. + +You'll also notice in my [final config file]({{}}), I was able to add back in the [Authelia](https://www.authelia.com/) snippets, paths for the SSL certs, and a few other items that connect nginx to the rest of my infrastructure. + +If you've stumbled upon this, I hope it helps you figure out your Hugo/Nginx issues! I definitely saw a lot of people posting +in Hugo's Discourse asking about [mime type errors](https://discourse.gohugo.io/search?expanded=true&q=mime%20type), so it is +very likely that whatever you're facing isn't isolated to just you. + +Now that I have this up and running, I need to write (and post!) a script that will pull from my repo, change directory +ownership, and reload nginx. + +### Working nginx config file {#nginx-config} + +```config +# ------------------------------------------------------------ +# selfhosted.rsmsn.co +# ------------------------------------------------------------ + +server { + listen 80; + listen [::]:80; + + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name selfhosted.rsmsn.co; + + root /var/www/html/public/; + index /index.html; + + # Force SSL + include conf.d/include/force-ssl.conf; + + # Custom SSL + ssl_certificate custom_ssl/npm-3/fullchain.pem; + ssl_certificate_key custom_ssl/npm-3/privkey.pem; + + + access_log /var/log/nginx/blog.log combined; + error_log /var/log/nginx/blog_error.log warn; + + include snippets/authelia-location.conf; + + location / { + try_files $uri $uri/ =404; + include snippets/authelia-authrequest.conf; + } +} +``` + +### Blogs and Sites I used + +* [Gideon Wolfe - Deploying a static Hugo site with NGINX](https://gideonwolfe.com/posts/sysadmin/hugonginx/) +* [Pvera - Deploying a simple static website using Nginx and Hugo](https://pvera.net/posts/create-site-nginx-hugo/) +* [Hugo Support thread on Discourse](https://discourse.gohugo.io/t/help-deploying-with-nginx/12609) +* [BravosLab - Static website with Hugo and Nginx](https://bravoslab.com/post/static-website-wirh-hugo-io-and-ngnix/) +* [Cavelab - Hugo Build deploy to Nginx](https://blog.cavelab.dev/2021/02/hugo-build-deploy-to-nginx/) +* [River - Serving Hugo from a non-root location with Nginx](https://river.me/blog/hugo-non-root-location/) diff --git a/dark-theme-config.toml b/dark-theme-config.toml deleted file mode 100644 index d6fe9c5..0000000 --- a/dark-theme-config.toml +++ /dev/null @@ -1,56 +0,0 @@ -[params] - [params.site] - faviconUrl = "" - localCss = [] - externalCss = [] - localJs = [] - externalJs = [] - [params.header] - title = "My New Hugo Site" - subtitle = "A Site Built by Hugo" - [params.header.logo] - imgUrl = "" - logoLink = "" - - [params.footer] - copyrightStr = "All Rights Reserved ยฎ." - counter = true - language = true - hugoVersion = true - theme = true - modifiedTime = true - dateFormat = "Jan 02 2006 15:04:05" - gitHash = true - - [params.footer.socialLink] - github = "" - facebook = "" - twitter = "" - email = "" - linkedin = "" - instagram = "" - telegram = "" - medium = "" - vimeo = "" - youtube = "" - - [params.globalFrontmatter] - author = "Jing Wang" - description = "This is my new hugo site" - keywords = "hugo,site,new" - - [params.homePage] - siteLongDescription = "Hugo is a fast and easy-to-use static website generator written in Go. It renders a complete HTML website from content and templates in a directory, utilizing Markdown files for metadata. It's optimized for speed and suitable for various website types." - - siteLongDescriptionTitle = "Start" - showRecentPostsBlock = true - numOfRecentPosts = 5 - recentPostShowUrl = true - - [params.page] - includeToc = true - showAuthor = true - showDate = true - dateFormat = "2006.01.02" - showTimeToRead = true - showBreadcrumb = true diff --git a/hugo.toml b/hugo.toml deleted file mode 100644 index 570d826..0000000 --- a/hugo.toml +++ /dev/null @@ -1,26 +0,0 @@ -baseURL = 'https://selfhosted.rsmsn.co/' -relativeURLs = true -languageCode = 'en-us' -title = 'Rsmsn Blog' -subtitle = 'A mostly technical blog & series of experiences working in tech and my homelab' -theme = 'terminal' -themesDir = './themes/' - -[params] - dateFormat = "02 Jan 2006" - -[params.globalFrontmatter] - author = "Norm Rasmussen" - description = "A blog site about my homelab journey, command line commands to remember, and other thoughts around technology." - keywords = "cli,tech,site,blog,homelab,selfhosted,self-hosted" - -[params.page] - includeToc = true - showAuthor = true - showDate = true - showTimeToRead = true - showBreadcrumb = true - -[mediaTypes] -[mediaTypes."application/javascript"] -suffixes = ["js","jsm","mjs"] diff --git a/hugo.yaml b/hugo.yaml new file mode 100644 index 0000000..172539b --- /dev/null +++ b/hugo.yaml @@ -0,0 +1,21 @@ +baseURL: '/' +uglyURLs: true +relativeURLs: true +languageCode: 'en-us' +title: 'Rsmsn Blog' +subtitle: 'A mostly technical blog & series of experiences working in tech and my homelab' +theme: "PaperMod" +themesDir: './themes/' +paginate: 7 + +params: + env: production + title: RsmsnBlog + description: "A site to share self hosted tutorials, troubleshooting, and tips/tricks." + keywords: [Blog, Website, Resume, Interests, Portfolio] + author: Norm Rasmussen + DateFormat: "January 2, 2006" + defaultTheme: dark + assets: + favicon: "static/favicon.ico" + favicon32x32: "static/favicon.ico" diff --git a/public/404.html b/public/404.html index ced9554..b6ef60d 100644 --- a/public/404.html +++ b/public/404.html @@ -1,132 +1,153 @@ - - - - 404 Page not found :: Rsmsn Blog - - - - - + - + + + + +404 Page not found | Rsmsn Blog + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + - + + -
-
- - - -
- -
+ + - - - - - - - + + + diff --git a/public/assets/css/stylesheet.5cfc680b1eeaeef9efbced92d46c2a9e876b72ee14fba85846afc4cff9e6e6f8.css b/public/assets/css/stylesheet.5cfc680b1eeaeef9efbced92d46c2a9e876b72ee14fba85846afc4cff9e6e6f8.css new file mode 100644 index 0000000..c32c959 --- /dev/null +++ b/public/assets/css/stylesheet.5cfc680b1eeaeef9efbced92d46c2a9e876b72ee14fba85846afc4cff9e6e6f8.css @@ -0,0 +1,7 @@ +/* + PaperMod v7 + License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE + Copyright (c) 2020 nanxiaobei and adityatelange + Copyright (c) 2021-2023 adityatelange +*/ +:root{--gap:24px;--content-gap:20px;--nav-width:1024px;--main-width:720px;--header-height:60px;--footer-height:60px;--radius:8px;--theme:rgb(255, 255, 255);--entry:rgb(255, 255, 255);--primary:rgb(30, 30, 30);--secondary:rgb(108, 108, 108);--tertiary:rgb(214, 214, 214);--content:rgb(31, 31, 31);--hljs-bg:rgb(28, 29, 33);--code-bg:rgb(245, 245, 245);--border:rgb(238, 238, 238)}.dark{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--hljs-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--code-bg)}.dark.list{background:var(--theme)}*,::after,::before{box-sizing:border-box}html{-webkit-tap-highlight-color:transparent;overflow-y:scroll;-webkit-text-size-adjust:100%;text-size-adjust:100%}a,button,body,h1,h2,h3,h4,h5,h6{color:var(--primary)}body{font-family:-apple-system,BlinkMacSystemFont,segoe ui,Roboto,Oxygen,Ubuntu,Cantarell,open sans,helvetica neue,sans-serif;font-size:18px;line-height:1.6;word-break:break-word;background:var(--theme)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section,table{display:block}h1,h2,h3,h4,h5,h6{line-height:1.2}h1,h2,h3,h4,h5,h6,p{margin-top:0;margin-bottom:0}ul{padding:0}a{text-decoration:none}body,figure,ul{margin:0}table{width:100%;border-collapse:collapse;border-spacing:0;overflow-x:auto;word-break:keep-all}button,input,textarea{padding:0;font:inherit;background:0 0;border:0}input,textarea{outline:0}button,input[type=button],input[type=submit]{cursor:pointer}input:-webkit-autofill,textarea:-webkit-autofill{box-shadow:0 0 0 50px var(--theme)inset}img{display:block;max-width:100%}.not-found{position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:center;height:80%;font-size:160px;font-weight:700}.archive-posts{width:100%;font-size:16px}.archive-year{margin-top:40px}.archive-year:not(:last-of-type){border-bottom:2px solid var(--border)}.archive-month{display:flex;align-items:flex-start;padding:10px 0}.archive-month-header{margin:25px 0;width:200px}.archive-month:not(:last-of-type){border-bottom:1px solid var(--border)}.archive-entry{position:relative;padding:5px;margin:10px 0}.archive-entry-title{margin:5px 0;font-weight:400}.archive-count,.archive-meta{color:var(--secondary);font-size:14px}.footer,.top-link{font-size:12px;color:var(--secondary)}.footer{max-width:calc(var(--main-width) + var(--gap) * 2);margin:auto;padding:calc((var(--footer-height) - var(--gap))/2)var(--gap);text-align:center;line-height:24px}.footer span{margin-inline-start:1px;margin-inline-end:1px}.footer span:last-child{white-space:nowrap}.footer a{color:inherit;border-bottom:1px solid var(--secondary)}.footer a:hover{border-bottom:1px solid var(--primary)}.top-link{visibility:hidden;position:fixed;bottom:60px;right:30px;z-index:99;background:var(--tertiary);width:42px;height:42px;padding:12px;border-radius:64px;transition:visibility .5s,opacity .8s linear}.top-link,.top-link svg{filter:drop-shadow(0 0 0 var(--theme))}.footer a:hover,.top-link:hover{color:var(--primary)}.top-link:focus,#theme-toggle:focus{outline:0}.nav{display:flex;flex-wrap:wrap;justify-content:space-between;max-width:calc(var(--nav-width) + var(--gap) * 2);margin-inline-start:auto;margin-inline-end:auto;line-height:var(--header-height)}.nav a{display:block}.logo,#menu{display:flex;margin:auto var(--gap)}.logo{flex-wrap:inherit}.logo a{font-size:24px;font-weight:700}.logo a img,.logo a svg{display:inline;vertical-align:middle;pointer-events:none;transform:translate(0,-10%);border-radius:6px;margin-inline-end:8px}button#theme-toggle{font-size:26px;margin:auto 4px}body.dark #moon{vertical-align:middle;display:none}body:not(.dark) #sun{display:none}#menu{list-style:none;word-break:keep-all;overflow-x:auto;white-space:nowrap}#menu li+li{margin-inline-start:var(--gap)}#menu a{font-size:16px}#menu .active{font-weight:500;border-bottom:2px solid}.lang-switch li,.lang-switch ul,.logo-switches{display:inline-flex;margin:auto 4px}.lang-switch{display:flex;flex-wrap:inherit}.lang-switch a{margin:auto 3px;font-size:16px;font-weight:500}.logo-switches{flex-wrap:inherit}.main{position:relative;min-height:calc(100vh - var(--header-height) - var(--footer-height));max-width:calc(var(--main-width) + var(--gap) * 2);margin:auto;padding:var(--gap)}.page-header h1{font-size:40px}.pagination{display:flex}.pagination a{color:var(--theme);font-size:13px;line-height:36px;background:var(--primary);border-radius:calc(36px/2);padding:0 16px}.pagination .next{margin-inline-start:auto}.social-icons{padding:12px 0}.social-icons a:not(:last-of-type){margin-inline-end:12px}.social-icons a svg{height:26px;width:26px}code{direction:ltr}div.highlight,pre{position:relative}.copy-code{display:none;position:absolute;top:4px;right:4px;color:rgba(255,255,255,.8);background:rgba(78,78,78,.8);border-radius:var(--radius);padding:0 5px;font-size:14px;user-select:none}div.highlight:hover .copy-code,pre:hover .copy-code{display:block}.first-entry{position:relative;display:flex;flex-direction:column;justify-content:center;min-height:320px;margin:var(--gap)0 calc(var(--gap) * 2)}.first-entry .entry-header{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.first-entry .entry-header h1{font-size:34px;line-height:1.3}.first-entry .entry-content{margin:14px 0;font-size:16px;-webkit-line-clamp:3}.first-entry .entry-footer{font-size:14px}.home-info .entry-content{-webkit-line-clamp:unset}.post-entry{position:relative;margin-bottom:var(--gap);padding:var(--gap);background:var(--entry);border-radius:var(--radius);transition:transform .1s;border:1px solid var(--border)}.post-entry:active{transform:scale(.96)}.tag-entry .entry-cover{display:none}.entry-header h2{font-size:24px;line-height:1.3}.entry-content{margin:8px 0;color:var(--secondary);font-size:14px;line-height:1.6;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.entry-footer{color:var(--secondary);font-size:13px}.entry-link{position:absolute;left:0;right:0;top:0;bottom:0}.entry-cover,.entry-isdraft{font-size:14px;color:var(--secondary)}.entry-cover{margin-bottom:var(--gap);text-align:center}.entry-cover img{border-radius:var(--radius);pointer-events:none;width:100%;height:auto}.entry-cover a{color:var(--secondary);box-shadow:0 1px 0 var(--primary)}.page-header,.post-header{margin:24px auto var(--content-gap)}.post-title{margin-bottom:2px;font-size:40px}.post-description{margin-top:10px;margin-bottom:5px}.post-meta,.breadcrumbs{color:var(--secondary);font-size:14px;display:flex;flex-wrap:wrap}.post-meta .i18n_list li{display:inline-flex;list-style:none;margin:auto 3px;box-shadow:0 1px 0 var(--secondary)}.breadcrumbs a{font-size:16px}.post-content{color:var(--content)}.post-content h3,.post-content h4,.post-content h5,.post-content h6{margin:24px 0 16px}.post-content h1{margin:40px auto 32px;font-size:40px}.post-content h2{margin:32px auto 24px;font-size:32px}.post-content h3{font-size:24px}.post-content h4{font-size:16px}.post-content h5{font-size:14px}.post-content h6{font-size:12px}.post-content a,.toc a:hover{box-shadow:0 1px;box-decoration-break:clone;-webkit-box-decoration-break:clone}.post-content a code{margin:auto 0;border-radius:0;box-shadow:0 -1px 0 var(--primary)inset}.post-content del{text-decoration:line-through}.post-content dl,.post-content ol,.post-content p,.post-content figure,.post-content ul{margin-bottom:var(--content-gap)}.post-content ol,.post-content ul{padding-inline-start:20px}.post-content li{margin-top:5px}.post-content li p{margin-bottom:0}.post-content dl{display:flex;flex-wrap:wrap;margin:0}.post-content dt{width:25%;font-weight:700}.post-content dd{width:75%;margin-inline-start:0;padding-inline-start:10px}.post-content dd~dd,.post-content dt~dt{margin-top:10px}.post-content table{margin-bottom:32px}.post-content table th,.post-content table:not(.highlighttable,.highlight table,.gist .highlight) td{min-width:80px;padding:12px 8px;line-height:1.5;border-bottom:1px solid var(--border)}.post-content table th{font-size:14px;text-align:start}.post-content table:not(.highlighttable) td code:only-child{margin:auto 0}.post-content .highlight table{border-radius:var(--radius)}.post-content .highlight:not(table){margin:10px auto;background:var(--hljs-bg)!important;border-radius:var(--radius);direction:ltr}.post-content li>.highlight{margin-inline-end:0}.post-content ul pre{margin-inline-start:calc(var(--gap) * -2)}.post-content .highlight pre{margin:0}.post-content .highlighttable{table-layout:fixed}.post-content .highlighttable td:first-child{width:40px}.post-content .highlighttable td .linenodiv{padding-inline-end:0!important}.post-content .highlighttable td .highlight,.post-content .highlighttable td .linenodiv pre{margin-bottom:0}.post-content code{margin:auto 4px;padding:4px 6px;font-size:.78em;line-height:1.5;background:var(--code-bg);border-radius:2px}.post-content pre code{display:block;margin:auto 0;padding:10px;color:#d5d5d6;background:var(--hljs-bg)!important;border-radius:var(--radius);overflow-x:auto;word-break:break-all}.post-content blockquote{margin:20px 0;padding:0 14px;border-inline-start:3px solid var(--primary)}.post-content hr{margin:30px 0;height:2px;background:var(--tertiary);border:0}.post-content iframe{max-width:100%}.post-content img{border-radius:4px;margin:1rem 0}.post-content img[src*="#center"]{margin:1rem auto}.post-content figure.align-center{text-align:center}.post-content figure>figcaption{color:var(--primary);font-size:16px;font-weight:700;margin:8px 0 16px}.post-content figure>figcaption>p{color:var(--secondary);font-size:14px;font-weight:400}.toc{margin:0 2px 40px;border:1px solid var(--border);background:var(--code-bg);border-radius:var(--radius);padding:.4em}.dark .toc{background:var(--entry)}.toc details summary{cursor:zoom-in;margin-inline-start:20px}.toc details[open] summary{cursor:zoom-out}.toc .details{display:inline;font-weight:500}.toc .inner{margin:0 20px;padding:10px 20px}.toc li ul{margin-inline-start:var(--gap)}.toc summary:focus{outline:0}.post-footer{margin-top:56px}.post-tags li{display:inline-block;margin-inline-end:3px;margin-bottom:5px}.post-tags a,.share-buttons,.paginav{border-radius:var(--radius);background:var(--code-bg);border:1px solid var(--border)}.post-tags a{display:block;padding-inline-start:14px;padding-inline-end:14px;color:var(--secondary);font-size:14px;line-height:34px;background:var(--code-bg)}.post-tags a:hover,.paginav a:hover{background:var(--border)}.share-buttons{margin:14px 0;padding-inline-start:var(--radius);display:flex;justify-content:center;overflow-x:auto}.share-buttons a{margin-top:10px}.share-buttons a:not(:last-of-type){margin-inline-end:12px}h1:hover .anchor,h2:hover .anchor,h3:hover .anchor,h4:hover .anchor,h5:hover .anchor,h6:hover .anchor{display:inline-flex;color:var(--secondary);margin-inline-start:8px;font-weight:500;user-select:none}.paginav{margin:10px 0;display:flex;line-height:30px;border-radius:var(--radius)}.paginav a{padding-inline-start:14px;padding-inline-end:14px;border-radius:var(--radius)}.paginav .title{letter-spacing:1px;text-transform:uppercase;font-size:small;color:var(--secondary)}.paginav .prev,.paginav .next{width:50%}.paginav span:hover:not(.title){box-shadow:0 1px}.paginav .next{margin-inline-start:auto;text-align:right}[dir=rtl] .paginav .next{text-align:left}h1>a>svg{display:inline}img.in-text{display:inline;margin:auto}.buttons,.main .profile{display:flex;justify-content:center}.main .profile{align-items:center;min-height:calc(100vh - var(--header-height) - var(--footer-height) - (var(--gap) * 2));text-align:center}.profile .profile_inner h1{padding:12px 0}.profile img{display:inline-table;border-radius:50%}.buttons{flex-wrap:wrap;max-width:400px;margin:0 auto}.button{background:var(--tertiary);border-radius:var(--radius);margin:8px;padding:6px;transition:transform .1s}.button-inner{padding:0 8px}.button:active{transform:scale(.96)}#searchbox input{padding:4px 10px;width:100%;color:var(--primary);font-weight:700;border:2px solid var(--tertiary);border-radius:var(--radius)}#searchbox input:focus{border-color:var(--secondary)}#searchResults li{list-style:none;border-radius:var(--radius);padding:10px;margin:10px 0;position:relative;font-weight:500}#searchResults{margin:10px 0;width:100%}#searchResults li:active{transition:transform .1s;transform:scale(.98)}#searchResults a{position:absolute;width:100%;height:100%;top:0;left:0;outline:none}#searchResults .focus{transform:scale(.98);border:2px solid var(--tertiary)}.terms-tags li{display:inline-block;margin:10px;font-weight:500}.terms-tags a{display:block;padding:3px 10px;background:var(--tertiary);border-radius:6px;transition:transform .1s}.terms-tags a:active{background:var(--tertiary);transform:scale(.96)}.hljs-comment,.hljs-quote{color:#b6b18b}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#eb3c54}.hljs-built_in,.hljs-builtin-name,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#e7ce56}.hljs-attribute{color:#ee7c2b}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#4fb4d7}.hljs-section,.hljs-title{color:#78bb65}.hljs-keyword,.hljs-selector-tag{color:#b45ea4}.hljs{display:block;overflow-x:auto;background:#1c1d21;color:#c0c5ce;padding:.5em}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-track{background:var(--code-bg)}::-webkit-scrollbar-thumb{background:var(--tertiary);border:5px solid var(--theme);border-radius:var(--radius)}.list:not(.dark)::-webkit-scrollbar-thumb{border:5px solid var(--code-bg)}::-webkit-scrollbar-thumb:hover{background:var(--secondary)}::-webkit-scrollbar:not(.highlighttable,.highlight table,.gist .highlight){background:var(--theme)}.post-content .highlighttable td .highlight pre code::-webkit-scrollbar{display:none}.post-content :not(table) ::-webkit-scrollbar-thumb{border:2px solid var(--hljs-bg);background:#717175}.post-content :not(table) ::-webkit-scrollbar-thumb:hover{background:#a3a3a5}.gist table::-webkit-scrollbar-thumb{border:2px solid #fff;background:#adadad}.gist table::-webkit-scrollbar-thumb:hover{background:#707070}.post-content table::-webkit-scrollbar-thumb{border-width:2px}@media screen and (min-width:768px){::-webkit-scrollbar{width:19px;height:11px}}@media screen and (max-width:768px){:root{--gap:14px}.profile img{transform:scale(.85)}.first-entry{min-height:260px}.archive-month{flex-direction:column}.archive-year{margin-top:20px}.footer{padding:calc((var(--footer-height) - var(--gap) - 10px)/2)var(--gap)}}@media screen and (max-width:900px){.list .top-link{transform:translateY(-5rem)}}@media(prefers-reduced-motion){.terms-tags a:active,.button:active,.post-entry:active,.top-link,#searchResults .focus,#searchResults li:active{transform:none}} \ No newline at end of file diff --git a/public/assets/js/highlight.f413e19d0714851f6474e7ee9632408e58ac146fbdbe62747134bea2fa3415e0.js b/public/assets/js/highlight.f413e19d0714851f6474e7ee9632408e58ac146fbdbe62747134bea2fa3415e0.js new file mode 100644 index 0000000..93a6f86 --- /dev/null +++ b/public/assets/js/highlight.f413e19d0714851f6474e7ee9632408e58ac146fbdbe62747134bea2fa3415e0.js @@ -0,0 +1,44 @@ +/* + Highlight.js 10.2.1 (32fb9a1d) + License: BSD-3-Clause + Copyright (c) 2006-2020, Ivan Sagalaev +*/ +var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!Object.hasOwnProperty.call(n,r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function t(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){var t={};for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}function a(e){return e.nodeName.toLowerCase()}var i=Object.freeze({__proto__:null,escapeHTML:t,inherit:r,nodeStream:function(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),a(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n},mergeStreams:function(e,n,r){var i=0,s="",o=[];function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){s+=""}function g(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var d=l();if(s+=t(r.substring(i,d[0].offset)),i=d[0].offset,d===e){o.reverse().forEach(u);do{g(d.splice(0,1)[0]),d=l()}while(d===e&&d.length&&d[0].offset===i);o.reverse().forEach(c)}else"start"===d[0].event?o.push(d[0].node):o.pop(),g(d.splice(0,1)[0])}return s+t(r.substr(i))}});const s="",o=e=>!!e.kind;class l{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=t(e)}openNode(e){if(!o(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){o(e)&&(this.buffer+=s)}value(){return this.buffer}span(e){this.buffer+=``}}class c{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{c._collapse(e)}))}}class u extends c{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function g(e){return e?"string"==typeof e?e:e.source:null}const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h={begin:"\\\\[\\s\\S]",relevance:0},f={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[h]},p={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[h]},m={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},b=function(e,n,t={}){var a=r({className:"comment",begin:e,end:n,contains:[]},t);return a.contains.push(m),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},v=b("//","$"),x=b("/\\*","\\*/"),E=b("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>g(e)).join("")}(n,/.*\b/,e.binary,/\b.*/)),r({className:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:h,APOS_STRING_MODE:f,QUOTE_STRING_MODE:p,PHRASAL_WORDS_MODE:m,COMMENT:b,C_LINE_COMMENT_MODE:v,C_BLOCK_COMMENT_MODE:x,HASH_COMMENT_MODE:E,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:d,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[h,{begin:/\[/,end:/\]/,relevance:0,contains:[h]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}}),w="of and for in not or if then".split(" ");function N(e,n){return n?+n:function(e){return w.includes(e.toLowerCase())}(e)?0:1}const y={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!hljs.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,t(this.code);let e;return this.autoDetect?(e=hljs.highlightAuto(this.code),this.detectedLanguage=e.language):(e=hljs.highlight(this.language,this.code,this.ignoreIllegals),this.detectectLanguage=this.language),e.value},autoDetect(){return!(this.language&&(e=this.autodetect,!e&&""!==e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}},R={install(e){e.component("highlightjs",y)}},k=t,M=r,{nodeStream:O,mergeStreams:L}=i,A=Symbol("nomatch");return function(t){var a=[],i=Object.create(null),s=Object.create(null),o=[],l=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,d="Could not find the language '{}', did you forget to load/include a language module?";const h={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:u};function p(e){return f.noHighlightRe.test(e)}function m(e,n,t,r){var a={code:n,language:e};j("before:highlight",a);var i=a.result?a.result:b(a.language,a.code,t,r);return i.code=a.code,j("after:highlight",i),i}function b(e,t,a,s){var o=t;function c(e,n){var t=E.case_insensitive?n[0].toLowerCase():n[0];return Object.prototype.hasOwnProperty.call(e.keywords,t)&&e.keywords[t]}function u(){null!=R.subLanguage?function(){if(""!==L){var e=null;if("string"==typeof R.subLanguage){if(!i[R.subLanguage])return void O.addText(L);e=b(R.subLanguage,L,!0,M[R.subLanguage]),M[R.subLanguage]=e.top}else e=v(L,R.subLanguage.length?R.subLanguage:null);R.relevance>0&&(I+=e.relevance),O.addSublanguage(e.emitter,e.language)}}():function(){if(!R.keywords)return void O.addText(L);let e=0;R.keywordPatternRe.lastIndex=0;let n=R.keywordPatternRe.exec(L),t="";for(;n;){t+=L.substring(e,n.index);const r=c(R,n);if(r){const[e,a]=r;O.addText(t),t="",I+=a,O.addKeyword(n[0],e)}else t+=n[0];e=R.keywordPatternRe.lastIndex,n=R.keywordPatternRe.exec(L)}t+=L.substr(e),O.addText(t)}(),L=""}function h(e){return e.className&&O.openNode(e.className),R=Object.create(e,{parent:{value:R}})}function p(e){return 0===R.matcher.regexIndex?(L+=e[0],1):(S=!0,0)}var m={};function x(t,r){var i=r&&r[0];if(L+=t,null==i)return u(),0;if("begin"===m.type&&"end"===r.type&&m.index===r.index&&""===i){if(L+=o.slice(r.index,r.index+1),!l){const n=Error("0 width match regex");throw n.languageName=e,n.badRule=m.rule,n}return 1}if(m=r,"begin"===r.type)return function(e){var t=e[0],r=e.rule;const a=new n(r),i=[r.__beforeBegin,r["on:begin"]];for(const n of i)if(n&&(n(e,a),a.ignore))return p(t);return r&&r.endSameAsBegin&&(r.endRe=RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),r.skip?L+=t:(r.excludeBegin&&(L+=t),u(),r.returnBegin||r.excludeBegin||(L=t)),h(r),r.returnBegin?0:t.length}(r);if("illegal"===r.type&&!a){const e=Error('Illegal lexeme "'+i+'" for mode "'+(R.className||"")+'"');throw e.mode=R,e}if("end"===r.type){var s=function(e){var t=e[0],r=o.substr(e.index),a=function e(t,r,a){let i=function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(t.endRe,a);if(i){if(t["on:end"]){const e=new n(t);t["on:end"](r,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,r,a)}(R,e,r);if(!a)return A;var i=R;i.skip?L+=t:(i.returnEnd||i.excludeEnd||(L+=t),u(),i.excludeEnd&&(L=t));do{R.className&&O.closeNode(),R.skip||R.subLanguage||(I+=R.relevance),R=R.parent}while(R!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),h(a.starts)),i.returnEnd?0:t.length}(r);if(s!==A)return s}if("illegal"===r.type&&""===i)return 1;if(j>1e5&&j>3*r.index)throw Error("potential infinite loop, way more iterations than matches");return L+=i,i.length}var E=y(e);if(!E)throw console.error(d.replace("{}",e)),Error('Unknown language: "'+e+'"');var _=function(e){function n(n,t){return RegExp(g(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n="|"){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i0&&(a+=n),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"===l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("===l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex((e,n)=>n>0&&void 0!==e),r=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}function i(e,n){const t=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==t&&"."!==r||n.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function t(s,o){const l=s;if(s.compiled)return l;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let c=null;if("object"==typeof s.keywords&&(c=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,N(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemes&&c)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l.keywordPatternRe=n(s.lexemes||c||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=i),s.begin||(s.begin=/\B|\b/),l.beginRe=n(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(l.endRe=n(s.end)),l.terminator_end=g(s.end)||"",s.endsWithParent&&o.terminator_end&&(l.terminator_end+=(s.end?"|":"")+o.terminator_end)),s.illegal&&(l.illegalRe=n(s.illegal)),void 0===s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(n){return r(e,{variants:null},n)}))),e.cached_variants?e.cached_variants:function e(n){return!!n&&(n.endsWithParent||e(n.starts))}(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e}("self"===e?s:e)}))),s.contains.forEach((function(e){t(e,l)})),s.starts&&t(s.starts,o),l.matcher=function(e){const n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&n.addRule(e.terminator_end,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(l),l}(e)}(E),w="",R=s||_,M={},O=new f.__emitter(f);!function(){for(var e=[],n=R;n!==E;n=n.parent)n.className&&e.unshift(n.className);e.forEach(e=>O.openNode(e))}();var L="",I=0,T=0,j=0,S=!1;try{for(R.matcher.considerAll();;){j++,S?S=!1:R.matcher.considerAll(),R.matcher.lastIndex=T;const e=R.matcher.exec(o);if(!e)break;const n=x(o.substring(T,e.index),e);T=e.index+n}return x(o.substr(T)),O.closeAllNodes(),O.finalize(),w=O.toHTML(),{relevance:I,value:w,language:e,illegal:!1,emitter:O,top:R}}catch(n){if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:n.message,context:o.slice(T-100,T+100),mode:n.mode},sofar:w,relevance:0,value:k(o),emitter:O};if(l)return{illegal:!1,relevance:0,value:k(o),emitter:O,language:e,top:R,errorRaised:n};throw n}}function v(e,n){n=n||f.languages||Object.keys(i);var t=function(e){const n={relevance:0,emitter:new f.__emitter(f),value:k(e),illegal:!1,top:h};return n.emitter.addText(e),n}(e),r=t;return n.filter(y).filter(T).forEach((function(n){var a=b(n,e,!1);a.language=n,a.relevance>r.relevance&&(r=a),a.relevance>t.relevance&&(r=t,t=a)})),r.language&&(t.second_best=r),t}function x(e){return f.tabReplace||f.useBR?e.replace(c,e=>"\n"===e?f.useBR?"
":e:f.tabReplace?e.replace(/\t/g,f.tabReplace):e):e}function E(e){let n=null;const t=function(e){var n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=f.languageDetectRe.exec(n);if(t){var r=y(t[1]);return r||(console.warn(d.replace("{}",t[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?t[1]:"no-highlight"}return n.split(/\s+/).find(e=>p(e)||y(e))}(e);if(p(t))return;j("before:highlightBlock",{block:e,language:t}),f.useBR?(n=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"):n=e;const r=n.textContent,a=t?m(t,r,!0):v(r),i=O(n);if(i.length){const e=document.createElement("div");e.innerHTML=a.value,a.value=L(i,O(e),r)}a.value=x(a.value),j("after:highlightBlock",{block:e,result:a}),e.innerHTML=a.value,e.className=function(e,n,t){var r=n?s[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),e.includes(r)||a.push(r),a.join(" ").trim()}(e.className,t,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const w=()=>{if(!w.called){w.called=!0;var e=document.querySelectorAll("pre code");a.forEach.call(e,E)}};function y(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]}function I(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach(e=>{s[e]=n})}function T(e){var n=y(e);return n&&!n.disableAutodetect}function j(e,n){var t=e;o.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(t,{highlight:m,highlightAuto:v,fixMarkup:function(e){return console.warn("fixMarkup is deprecated and will be removed entirely in v11.0"),console.warn("Please see https://github.com/highlightjs/highlight.js/issues/2534"),x(e)},highlightBlock:E,configure:function(e){f=M(f,e)},initHighlighting:w,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",w,!1)},registerLanguage:function(e,n){var r=null;try{r=n(t)}catch(n){if(console.error("Language definition for '{}' could not be registered.".replace("{}",e)),!l)throw n;console.error(n),r=h}r.name||(r.name=e),i[e]=r,r.rawDefinition=n.bind(null,t),r.aliases&&I(r.aliases,{languageName:e})},listLanguages:function(){return Object.keys(i)},getLanguage:y,registerAliases:I,requireLanguage:function(e){var n=y(e);if(n)return n;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:T,inherit:M,addPlugin:function(e){o.push(e)},vuePlugin:R}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString="10.2.1";for(const n in _)"object"==typeof _[n]&&e(_[n]);return Object.assign(t,_),t}({})}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); +hljs.registerLanguage("apache",function(){"use strict";return function(e){var n={className:"number",begin:"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?"};return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:"section",begin:"",contains:[n,{className:"number",begin:":\\d{1,5}"},e.inherit(e.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute",begin:/\w+/,relevance:0,keywords:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"},contains:[{className:"meta",begin:"\\s\\[",end:"\\]$"},{className:"variable",begin:"[\\$%]\\{",end:"\\}",contains:["self",{className:"number",begin:"[\\$%]\\d+"}]},n,{className:"number",begin:"\\d+"},e.QUOTE_STRING_MODE]}}],illegal:/\S/}}}()); +hljs.registerLanguage("bash",function(){"use strict";return function(e){const s={};Object.assign(s,{className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{/,end:/\}/,contains:[{begin:/:-/,contains:[s]}]}]});const t={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,t]};t.contains.push(n);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,s]},i=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b-?[a-z\._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[i,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,n,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},s]}}}()); +hljs.registerLanguage("c-like",function(){"use strict";return function(e){function t(e){return"(?:"+e+")?"}var n="(decltype\\(auto\\)|"+t("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+t("<.*?>")+")",r={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},i={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},s={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},o={className:"title",begin:t("[a-zA-Z_]\\w*::")+e.IDENT_RE,relevance:0},c=t("[a-zA-Z_]\\w*::")+e.IDENT_RE+"\\s*\\(",l={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",literal:"true false nullptr NULL"},d=[r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i,a],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:l,contains:d.concat([{begin:/\(/,end:/\)/,keywords:l,contains:d.concat(["self"]),relevance:0}]),relevance:0},u={className:"function",begin:"("+n+"[\\*&\\s]+)+"+c,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:l,illegal:/[^\w\s\*&:<>]/,contains:[{begin:"decltype\\(auto\\)",keywords:l,relevance:0},{begin:c,returnBegin:!0,contains:[o],relevance:0},{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,i,r,{begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:["self",e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,i,r]}]},r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s]};return{aliases:["c","cc","h","c++","h++","hpp","hh","hxx","cxx"],keywords:l,disableAutodetect:!0,illegal:"",keywords:l,contains:["self",r]},{begin:e.IDENT_RE+"::",keywords:l},{className:"class",beginKeywords:"class struct",end:/[{;:]/,contains:[{begin://,contains:["self"]},e.TITLE_MODE]}]),exports:{preprocessor:s,strings:a,keywords:l}}}}()); +hljs.registerLanguage("c",function(){"use strict";return function(e){var n=e.requireLanguage("c-like").rawDefinition();return n.name="C",n.aliases=["c","h"],n}}()); +hljs.registerLanguage("coffeescript",function(){"use strict";const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);return function(r){var t={keyword:e.concat(["then","unless","until","loop","by","when","and","or","is","isnt","not"]).filter((e=>n=>!e.includes(n))(["var","const","let","function","static"])).join(" "),literal:n.concat(["yes","no","on","off"]).join(" "),built_in:a.concat(["npm","print"]).join(" ")},i="[A-Za-z$_][0-9A-Za-z$_]*",s={className:"subst",begin:/#\{/,end:/}/,keywords:t},o=[r.BINARY_NUMBER_MODE,r.inherit(r.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[r.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[r.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[r.BACKSLASH_ESCAPE,s]},{begin:/"/,end:/"/,contains:[r.BACKSLASH_ESCAPE,s]}]},{className:"regexp",variants:[{begin:"///",end:"///",contains:[s,r.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)",relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+i},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{begin:"```",end:"```"},{begin:"`",end:"`"}]}];s.contains=o;var c=r.inherit(r.TITLE_MODE,{begin:i}),l={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:t,contains:["self"].concat(o)}]};return{name:"CoffeeScript",aliases:["coffee","cson","iced"],keywords:t,illegal:/\/\*/,contains:o.concat([r.COMMENT("###","###"),r.HASH_COMMENT_MODE,{className:"function",begin:"^\\s*"+i+"\\s*=\\s*(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[c,l]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function",begin:"(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[l]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[c]},c]},{begin:i+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}}()); +hljs.registerLanguage("cpp",function(){"use strict";return function(e){var i=e.requireLanguage("c-like").rawDefinition();return i.disableAutodetect=!1,i.name="C++",i.aliases=["cc","c++","h++","hpp","hh","hxx","cxx"],i}}()); +hljs.registerLanguage("csharp",function(){"use strict";return function(e){var n={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in init int interface internal is lock long object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let nameof on orderby partial remove select set value var when where yield",literal:"null false true"},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},t=e.inherit(s,{illegal:/\n/}),l={className:"subst",begin:"{",end:"}",keywords:n},r=e.inherit(l,{illegal:/\n/}),c={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:"{{"},{begin:"}}"},e.BACKSLASH_ESCAPE,r]},o={className:"string",begin:/\$@"/,end:'"',contains:[{begin:"{{"},{begin:"}}"},{begin:'""'},l]},g=e.inherit(o,{illegal:/\n/,contains:[{begin:"{{"},{begin:"}}"},{begin:'""'},r]});l.contains=[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],r.contains=[g,c,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];var d={variants:[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},i]},_=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",b={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},d,a,{beginKeywords:"class interface",end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",end:/[{;=]/,illegal:/[^\s:]/,contains:[i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"meta-string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+_+"\\s+)+"+e.IDENT_RE+"\\s*(\\<.+\\>)?\\s*\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{begin:e.IDENT_RE+"\\s*(\\<.+\\>)?\\s*\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0,contains:[d,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},b]}}}()); +hljs.registerLanguage("css",function(){"use strict";return function(e){var n={begin:/(?:[A-Z\_\.\-]+|--[a-zA-Z0-9_-]+)\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[{className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[{begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}}]};return{name:"CSS",case_insensitive:!0,illegal:/[=\/|'\$]/,contains:[e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/},{className:"selector-class",begin:/\.[A-Za-z0-9_-]+/},{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",illegal:/:/,returnBegin:!0,contains:[{className:"keyword",begin:/@\-?\w[\w]*(\-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:"and or not only",contains:[{begin:/[a-z-]+:/,className:"attribute"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[e.C_BLOCK_COMMENT_MODE,n]}]}}}()); +hljs.registerLanguage("diff",function(){"use strict";return function(e){return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{begin:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{begin:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{className:"comment",variants:[{begin:/Index: /,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^\-{3}/,end:/$/},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/}]},{className:"addition",begin:"^\\+",end:"$"},{className:"deletion",begin:"^\\-",end:"$"},{className:"addition",begin:"^\\!",end:"$"}]}}}()); +hljs.registerLanguage("go",function(){"use strict";return function(e){var n={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{name:"Go",aliases:["golang"],keywords:n,illegal:"e(n)).join("")}return function(a){var s={className:"number",relevance:0,variants:[{begin:/([\+\-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},i=a.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];var t={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)}/}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,r,t,l,s,"self"],relevance:0},g="("+[/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/].map(n=>e(n)).join("|")+")";return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:n(g,"(\\s*\\.\\s*",g,")*",n("(?=",/\s*=\s*[^#\s]/,")")),className:"attr",starts:{end:/$/,contains:[i,c,r,t,l,s]}}]}}}()); +hljs.registerLanguage("java",function(){"use strict";function e(e){return e?"string"==typeof e?e:e.source:null}function n(e){return a("(",e,")?")}function a(...n){return n.map(n=>e(n)).join("")}function s(...n){return"("+n.map(n=>e(n)).join("|")+")"}return function(e){var t="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",i={className:"meta",begin:"@[ร€-สธa-zA-Z_$][ร€-สธa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},r=e=>a("[",e,"]+([",e,"_]*[",e,"]+)?"),c={className:"number",variants:[{begin:`\\b(0[bB]${r("01")})[lL]?`},{begin:`\\b(0${r("0-7")})[dDfFlL]?`},{begin:a(/\b0[xX]/,s(a(r("a-fA-F0-9"),/\./,r("a-fA-F0-9")),a(r("a-fA-F0-9"),/\.?/),a(/\./,r("a-fA-F0-9"))),/([pP][+-]?(\d+))?/,/[fFdDlL]?/)},{begin:a(/\b/,s(a(/\d*\./,r("\\d")),r("\\d")),/[eE][+-]?[\d]+[dDfF]?/)},{begin:a(/\b/,r(/\d/),n(/\.?/),n(r(/\d/)),/[dDfFlL]?/)}],relevance:0};return{name:"Java",aliases:["jsp"],keywords:t,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface enum",end:/[{;=]/,excludeEnd:!0,keywords:"class interface enum",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"function",begin:"([ร€-สธa-zA-Z_$][ร€-สธa-zA-Z_$0-9]*(<[ร€-สธa-zA-Z_$][ร€-สธa-zA-Z_$0-9]*(\\s*,\\s*[ร€-สธa-zA-Z_$][ร€-สธa-zA-Z_$0-9]*)*>)?\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:t,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:t,relevance:0,contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},c,i]}}}()); +hljs.registerLanguage("javascript",function(){"use strict";const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function s(e){return r("(?=",e,")")}function r(...e){return e.map(e=>(function(e){return e?"string"==typeof e?e:e.source:null})(e)).join("")}return function(t){var i="[A-Za-z$_][0-9A-Za-z$_]*",c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/},o={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:e.join(" "),literal:n.join(" "),built_in:a.join(" ")},l={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:t.C_NUMBER_RE+"n?"}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"xml"}},g={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"css"}},u={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,E]};E.contains=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,g,u,l,t.REGEXP_MODE];var b=E.contains.concat([{begin:/\(/,end:/\)/,contains:["self"].concat(E.contains,[t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE])},t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]),_={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:b};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,contains:[t.SHEBANG({binary:"node",relevance:5}),{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,g,u,t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,l,{begin:r(/[{,\n]\s*/,s(r(/(((\/\/.*$)|(\/\*(.|\n)*\*\/))\s*)*/,i+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:i+s("\\s*:"),relevance:0}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.REGEXP_MODE,{className:"function",begin:"(\\([^(]*(\\([^(]*(\\([^(]*\\))?\\))?\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:"<>",end:""},{begin:c.begin,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:i}),_],illegal:/\[|%/},{begin:/\$[(.]/},t.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0},{begin:"(get|set)\\s+(?="+i+"\\()",end:/{/,keywords:"get set",contains:[t.inherit(t.TITLE_MODE,{begin:i}),{begin:/\(\)/},_]}],illegal:/#(?!!)/}}}()); +hljs.registerLanguage("json",function(){"use strict";return function(n){var e={literal:"true false null"},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],t=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:e},l={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(a,{begin:/:/})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(a)],illegal:"\\S"};return t.push(l,s),i.forEach((function(n){t.push(n)})),{name:"JSON",contains:t,keywords:e,illegal:"\\S"}}}()); +hljs.registerLanguage("kotlin",function(){"use strict";return function(e){var n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:"\\${",end:"}",contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},t={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(t);var r={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(t,{className:"meta-string"})]}]},c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),o={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=o;return d.variants[1].contains=[o],o.variants[1].contains=[d],{name:"Kotlin",aliases:["kt"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},a,r,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,illegal:/fun\s+(<.*>)?[^\s\(]+(\s+[^\s\(]+)\s*=/,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[o,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,r,l,t,e.C_NUMBER_MODE]},c]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},r,l]},t,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},{className:"number",begin:"\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",relevance:0}]}}}()); +hljs.registerLanguage("less",function(){"use strict";return function(e){var n="([\\w-]+|@{[\\w-]+})",a=[],s=[],t=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},r=function(e,n,a){return{className:e,begin:n,relevance:a}},i={begin:"\\(",end:"\\)",contains:s,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t("'"),t('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},r("number","#[0-9A-Fa-f]+\\b"),i,r("variable","@@?[\\w-]+",10),r("variable","@{[\\w-]+}"),r("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},{className:"meta",begin:"!important"});var c=s.concat({begin:"{",end:"}",contains:a}),l={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},o={begin:n+"\\s*:",returnBegin:!0,end:"[;}]",relevance:0,contains:[{className:"attribute",begin:n,end:":",excludeEnd:!0,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",returnEnd:!0,contains:s,relevance:0}},d={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:c}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:n,end:"{"}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l,r("keyword","all\\b"),r("variable","@{[\\w-]+}"),r("selector-tag",n+"%?",0),r("selector-id","#"+n),r("selector-class","\\."+n,0),r("selector-tag","&",0),{className:"selector-attr",begin:"\\[",end:"\\]"},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"\\(",end:"\\)",contains:c},{begin:"!important"}]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,d,o,b),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:a}}}()); +hljs.registerLanguage("lua",function(){"use strict";return function(e){var t={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},a=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[t],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[t],relevance:5}])}}}()); +hljs.registerLanguage("makefile",function(){"use strict";return function(e){var i={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[a,i,t,s,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"",contains:[a,s,i,t]}]}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:")",end:">",keywords:{name:"style"},contains:[c],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:")",end:">",keywords:{name:"script"},contains:[c],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},c]}]}}}()); +hljs.registerLanguage("markdown",function(){"use strict";return function(n){const e={begin:"<",end:">",subLanguage:"xml",relevance:0},a={begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},i={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};i.contains.push(s),s.contains.push(i);var c=[e,a];return i.contains=i.contains.concat(c),s.contains=s.contains.concat(c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:c=c.concat(i,s)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:c}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:c,end:"$"},{className:"code",variants:[{begin:"(`{3,})(.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})(.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}}()); +hljs.registerLanguage("nginx",function(){"use strict";return function(e){var n={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/}/},{begin:"[\\$\\@]"+e.UNDERSCORE_IDENT_RE}]},a={endsWithParent:!0,keywords:{$pattern:"[a-z/_]+",literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[n]},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:"\\s\\^",end:"\\s|{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|{|;",returnEnd:!0},{begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},n]};return{name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{begin:e.UNDERSCORE_IDENT_RE+"\\s+{",returnBegin:!0,end:"{",contains:[{className:"section",begin:e.UNDERSCORE_IDENT_RE}],relevance:0},{begin:e.UNDERSCORE_IDENT_RE+"\\s",end:";|{",returnBegin:!0,contains:[{className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:a}],relevance:0}],illegal:"[^\\s\\}]"}}}()); +hljs.registerLanguage("objectivec",function(){"use strict";return function(e){var n=/[a-zA-Z@][a-zA-Z0-9_]*/,_={$pattern:n,keyword:"@interface @class @protocol @implementation"};return{name:"Objective-C",aliases:["mm","objc","obj-c"],keywords:{$pattern:n,keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+_.keyword.split(" ").join("|")+")\\b",end:"({|$)",excludeEnd:!0,keywords:_,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}}()); +hljs.registerLanguage("perl",function(){"use strict";return function(e){var n={$pattern:/[\w.]+/,keyword:"getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmget sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when"},t={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:"->{",end:"}"},r={variants:[{begin:/\$\d/},{begin:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{begin:/[\$%@][^\s\w{]/,relevance:0}]},i=[e.BACKSLASH_ESCAPE,t,r],a=[r,e.HASH_COMMENT_MODE,e.COMMENT("^\\=\\w","\\=cut",{endsWithParent:!0}),s,{className:"string",contains:i,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*\\<",end:"\\>",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:"{\\w+}",contains:[],relevance:0},{begin:"-?\\w+\\s*\\=\\>",contains:[],relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",begin:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",relevance:10},{className:"regexp",begin:"(m|qr)?/",end:"/[a-z]*",contains:[e.BACKSLASH_ESCAPE],relevance:0}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return t.contains=a,s.contains=a,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:a}}}()); +hljs.registerLanguage("php",function(){"use strict";return function(e){var r={begin:"\\$+[a-zA-Z_-รฟ][a-zA-Z0-9_-รฟ]*"},t={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},a={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},n=e.inherit(e.APOS_STRING_MODE,{illegal:null}),i=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),o=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l={className:"string",contains:[e.BACKSLASH_ESCAPE,t],variants:[e.inherit(n,{begin:"b'",end:"'"}),e.inherit(i,{begin:'b"',end:'"'}),i,n,o]},s={variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]},c={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Throwable Traversable WeakReference Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{aliases:["php","php3","php4","php5","php6","php7"],case_insensitive:!0,keywords:c,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t]}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler"}),t,{className:"keyword",begin:/\$this\b/},r,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[e.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,s]}]},{className:"class",beginKeywords:"class interface",end:"{",excludeEnd:!0,illegal:/[:\(\$"]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",end:";",illegal:/[\.']/,contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",end:";",contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"=>"},l,s]}}}()); +hljs.registerLanguage("php-template",function(){"use strict";return function(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}}()); +hljs.registerLanguage("plaintext",function(){"use strict";return function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}}()); +hljs.registerLanguage("properties",function(){"use strict";return function(e){var n="[ \\t\\f]*",t="("+n+"[:=]"+n+"|[ \\t\\f]+)",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",s={end:t,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\n"}]}};return{name:".properties",case_insensitive:!0,illegal:/\S/,contains:[e.COMMENT("^\\s*[!#]","$"),{begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+"+t,returnBegin:!0,contains:[{className:"attr",begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",endsParent:!0,relevance:0}],starts:s},{begin:a+t,returnBegin:!0,relevance:0,contains:[{className:"meta",begin:a,endsParent:!0,relevance:0}],starts:s},{className:"attr",relevance:0,begin:a+n+"$"}]}}}()); +hljs.registerLanguage("python",function(){"use strict";return function(e){var n={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10",built_in:"Ellipsis NotImplemented",literal:"False None True"},a={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},r={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(fr|rf|f)'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(fr|rf|f)"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},{begin:/(fr|rf|f)'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/(fr|rf|f)"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l={className:"number",relevance:0,variants:[{begin:e.BINARY_NUMBER_RE+"[lLjJ]?"},{begin:"\\b(0o[0-7]+)[lLjJ]?"},{begin:e.C_NUMBER_RE+"[lLjJ]?"}]},t={className:"params",variants:[{begin:/\(\s*\)/,skip:!0,className:null},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:["self",a,l,r,e.HASH_COMMENT_MODE]}]};return i.contains=[r,l,a],{name:"Python",aliases:["py","gyp","ipython"],keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[a,l,{beginKeywords:"if",relevance:0},r,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,t,{begin:/->/,endsWithParent:!0,keywords:"None"}]},{className:"meta",begin:/^[\t ]*@/,end:/$/},{begin:/\b(print|exec)\(/}]}}}()); +hljs.registerLanguage("python-repl",function(){"use strict";return function(n){return{aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}}()); +hljs.registerLanguage("ruby",function(){"use strict";return function(e){var n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",a={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},s={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},r=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^\\=begin","^\\=end",{contains:[s],relevance:10}),e.COMMENT("^__END__","\\n$")],c={className:"subst",begin:"#\\{",end:"}",keywords:a},t={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[qQwWx]?\\(",end:"\\)"},{begin:"%[qQwWx]?\\[",end:"\\]"},{begin:"%[qQwWx]?{",end:"}"},{begin:"%[qQwWx]?<",end:">"},{begin:"%[qQwWx]?/",end:"/"},{begin:"%[qQwWx]?%",end:"%"},{begin:"%[qQwWx]?-",end:"-"},{begin:"%[qQwWx]?\\|",end:"\\|"},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{begin:/<<[-~]?'?(\w+)(?:.|\n)*?\n\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},b={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:a},d=[t,i,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE}]}].concat(r)},{className:"function",beginKeywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),b].concat(r)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(\\!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[t,{begin:n}],relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{className:"params",begin:/\|/,end:/\|/,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[i,{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r{",end:"}[a-z]*"},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(r),relevance:0}].concat(r);c.contains=d,b.contains=d;var g=[{begin:/^\s*=>/,starts:{end:"$",contains:d}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{end:"$",contains:d}}];return{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:r.concat(g).concat(d)}}}()); +hljs.registerLanguage("rust",function(){"use strict";return function(e){var n="([ui](8|16|32|64|128|size)|f(32|64))?",t="drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!";return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",keyword:"abstract as async await become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self Self static struct super trait true try type typeof unsafe unsized use virtual where while yield",literal:"true false Some None Ok Err",built_in:t},illegal:""}]}}}()); +hljs.registerLanguage("scss",function(){"use strict";return function(e){var t={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"},i={className:"number",begin:"#[0-9A-Fa-f]+"};return e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"\\#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},{className:"selector-attr",begin:"\\[",end:"\\]",illegal:"$"},{className:"selector-tag",begin:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",relevance:0},{className:"selector-pseudo",begin:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{className:"selector-pseudo",begin:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},t,{className:"attribute",begin:"\\b(src|z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",illegal:"[^\\s]"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[t,i,e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"meta",begin:"!important"}]},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",returnBegin:!0,keywords:"and or not only",contains:[{begin:"@[a-z-]+",className:"keyword"},t,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i,e.CSS_NUMBER_MODE]}]}}}()); +hljs.registerLanguage("shell",function(){"use strict";return function(s){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}}()); +hljs.registerLanguage("sql",function(){"use strict";return function(e){var t=e.COMMENT("--","$");return{name:"SQL",case_insensitive:!0,illegal:/[<>{}*]/,contains:[{beginKeywords:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with",end:/;/,endsWithParent:!0,keywords:{$pattern:/[\w\.]+/,keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound bucket buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour hours http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lateral lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minutes minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second seconds section securefile security seed segment select self semi sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tablesample tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace window with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varchar2 varying void"},contains:[{className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{className:"string",begin:'"',end:'"',contains:[{begin:'""'}]},{className:"string",begin:"`",end:"`"},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,e.HASH_COMMENT_MODE]},e.C_BLOCK_COMMENT_MODE,t,e.HASH_COMMENT_MODE]}}}()); +hljs.registerLanguage("swift",function(){"use strict";return function(e){var i={keyword:"#available #colorLiteral #column #else #elseif #endif #file #fileLiteral #function #if #imageLiteral #line #selector #sourceLocation _ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype associativity break case catch class continue convenience default defer deinit didSet do dynamic dynamicType else enum extension fallthrough false fileprivate final for func get guard if import in indirect infix init inout internal is lazy left let mutating nil none nonmutating open operator optional override postfix precedence prefix private protocol Protocol public repeat required rethrows return right self Self set static struct subscript super switch throw throws true try try! try? Type typealias unowned var weak where while willSet",literal:"true false nil",built_in:"abs advance alignof alignofValue anyGenerator assert assertionFailure bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal fatalError filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare map max maxElement min minElement numericCast overlaps partition posix precondition preconditionFailure print println quickSort readLine reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith stride strideof strideofValue swap toString transcode underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers withUnsafePointer withUnsafePointers withVaList zip"},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),t={className:"subst",begin:/\\\(/,end:"\\)",keywords:i,contains:[]},a={className:"string",contains:[e.BACKSLASH_ESCAPE,t],variants:[{begin:/"""/,end:/"""/},{begin:/"/,end:/"/}]},r={className:"number",begin:"\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b",relevance:0};return t.contains=[r],{name:"Swift",keywords:i,contains:[a,e.C_LINE_COMMENT_MODE,n,{className:"type",begin:"\\b[A-Z][\\wร€-สธ']*[!?]"},{className:"type",begin:"\\b[A-Z][\\wร€-สธ']*",relevance:0},r,{className:"function",beginKeywords:"func",end:"{",excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/}),{begin://},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,contains:["self",r,a,e.C_BLOCK_COMMENT_MODE,{begin:":"}],illegal:/["']/}],illegal:/\[|%/},{className:"class",beginKeywords:"struct protocol class extension enum",keywords:i,end:"\\{",excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/})]},{className:"meta",begin:"(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix|@autoclosure|@testable|@available|@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|@propertyWrapper)\\b"},{beginKeywords:"import",end:/$/,contains:[e.C_LINE_COMMENT_MODE,n]}]}}}()); +hljs.registerLanguage("typescript",function(){"use strict";const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);return function(r){var t={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:e.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]).join(" "),literal:n.join(" "),built_in:a.concat(["any","void","number","boolean","string","object","never","enum"]).join(" ")},s={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},i={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:r.C_NUMBER_RE+"n?"}],relevance:0},o={className:"subst",begin:"\\$\\{",end:"\\}",keywords:t,contains:[]},c={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,o],subLanguage:"xml"}},l={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,o],subLanguage:"css"}},E={className:"string",begin:"`",end:"`",contains:[r.BACKSLASH_ESCAPE,o]};o.contains=[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,c,l,E,i,r.REGEXP_MODE];var d={begin:"\\(",end:/\)/,keywords:t,contains:["self",r.QUOTE_STRING_MODE,r.APOS_STRING_MODE,r.NUMBER_MODE]},u={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:[r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,s,d]};return{name:"TypeScript",aliases:["ts"],keywords:t,contains:[r.SHEBANG(),{className:"meta",begin:/^\s*['"]use strict['"]/},r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,c,l,E,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,i,{begin:"("+r.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,r.REGEXP_MODE,{className:"function",begin:"(\\([^(]*(\\([^(]*(\\([^(]*\\))?\\))?\\)|"+r.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:r.UNDERSCORE_IDENT_RE},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:d.contains}]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[\{;]/,excludeEnd:!0,keywords:t,contains:["self",r.inherit(r.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*"}),u],illegal:/%/,relevance:0},{beginKeywords:"constructor",end:/[\{;]/,excludeEnd:!0,contains:["self",u]},{begin:/module\./,keywords:{built_in:"module"},relevance:0},{beginKeywords:"module",end:/\{/,excludeEnd:!0},{beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},{begin:/\$[(.]/},{begin:"\\."+r.IDENT_RE,relevance:0},s,d]}}}()); +hljs.registerLanguage("yaml",function(){"use strict";return function(e){var n="true false yes no null",a="[\\w#;/?:@&=+$,.~*\\'()[\\]]+",s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]},i=e.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={end:",",endsWithParent:!0,excludeEnd:!0,contains:[],keywords:n,relevance:0},t={begin:"{",end:"}",contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"\\-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b"},t,g,s],c=[...b];return c.pop(),c.push(i),l.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml","YAML"],contains:b}}}()); \ No newline at end of file diff --git a/public/categories.html b/public/categories.html new file mode 100644 index 0000000..daf479a --- /dev/null +++ b/public/categories.html @@ -0,0 +1,159 @@ + + + + + + + +Categories | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
    +
+
+ + + + + + + + + + + + + + diff --git a/public/categories/index.xml b/public/categories/index.xml index ba8c052..0653a84 100644 --- a/public/categories/index.xml +++ b/public/categories/index.xml @@ -1,10 +1,10 @@ - + Categories on Rsmsn Blog - https://selfhosted.rsmsn.co/categories/ + /categories.html Recent content in Categories on Rsmsn Blog Hugo -- gohugo.io - en-us + en-us diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..a687ed0 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html index 74ca47f..0a5f994 100644 --- a/public/index.html +++ b/public/index.html @@ -1,182 +1,192 @@ - + + - - - Rsmsn Blog - - - - - + + + + +Rsmsn Blog + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + + -
-
- - -
+ + - - - - - - - + + + diff --git a/public/index.xml b/public/index.xml index 2552758..552c918 100644 --- a/public/index.xml +++ b/public/index.xml @@ -1,280 +1,29 @@ - + Rsmsn Blog - https://selfhosted.rsmsn.co/ + / Recent content on Rsmsn Blog Hugo -- gohugo.io en-us - Sat, 05 Aug 2023 15:23:51 -0500 + Wed, 20 Sep 2023 11:33:22 -0400 + + Trouble Hosting Hugo with Nginx + /posts/hosting_hugo_troubles.html + Wed, 20 Sep 2023 11:33:22 -0400 + + /posts/hosting_hugo_troubles.html + For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and I&rsquo;m happy to share some reverse proxy nginx config files. + + Tutorial: Move from NginxProxyManager to Nginx - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html Sat, 05 Aug 2023 15:23:51 -0500 - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by. Goal To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition. - <p>A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for <a href="https://www.reddit.com/r/selfhosted/comments/15j4v80/minitutorial_migrating_from_nginx_proxy_manager/">this reddit -post</a> and to post this <a href="https://github.com/Normanras/Npm_to_Nginx">my Github profile</a>. Thought my website would also be a good place to share it for any passers-by.</p> -<h2 id="goal">Goal</h2> -<p>To give clear instructions to help users migrate from using <a href="https://nginxproxymanager.com/">Nginx Proxy Manager</a> (NPM) to standard <a href="https://docs.nginx.com/">Nginx</a>. This tutorial is not exhaustive and there are many other implementations of this transition. I would recommend checking out the many Nginx <a href="http://nginx.org/en/docs/">Documentation Sites</a> and tutorials to learn more.</p> -<h3 id="introduction">Introduction</h3> -<p>If you&rsquo;re anything like me and you got into the self-hosted/homelab/diy game sometime within the last 5 years, you&rsquo;ve likely been recommended to use Nginx Proxy Manager as one of the choice Reverse Proxy services. If you&rsquo;ve also been paying attention to various self-hosted communities, you may have also come across Christian Lempa&rsquo;s Video on <a href="https://youtu.be/uaixCKTaqY0">trusting smaller self hosted projects and tools</a>.</p> -<p><em>Spoilers:</em> He roasts NPM in his video and towards the end says he won&rsquo;t be using NPM anymore. He also, perhaps purposely, doesn&rsquo;t share which tool he will be migrating to.</p> -<p>Whether you follow Christian away from NPM or not, it dawned on me that while NPM is using a very trusted web server and reverse proxy under the hood, I hadn&rsquo;t taken the time to understand how an Nginx Config actually worked. Since NPM was already creating most of the files for Nginx, I got to reading through all the files and reworking them so that I could begin using Nginx without the NPM gui.</p> -<p><em>Contributing: This is not all encompassing of Nginx possibilities. Including instructions for various installation methods, using OpenResty, and any other migrations or use cases would help the community. If you&rsquo;d like to add in additional information on how to migrate from NPM to Nginx, that is welcome. Simply submit a PR with your steps.</em></p> -<h3 id="tldr---quick-steps">TL;DR - Quick Steps</h3> -<ol> -<li> -<p>Copy the following contents (including sub-directories) from the NPM <code>/data/nginx</code> directory to the Nginx <code>/etc/nginx</code> folder:</p> -<ul> -<li><code>proxy_hosts</code> &gt; <code>sites-available</code></li> -<li><code>conf.d</code> &gt; <code>conf.d</code></li> -<li><code>snippets</code> &gt; <code>snippets</code></li> -<li><code>custom_ssl</code> &gt; <code>custom_ssl</code> (if applicable)</li> -</ul> -</li> -<li> -<p>Edit each file in your <code>sites-available</code> directory and update the paths. Most will change from <code>/data/nginx/</code> to <code>/etc/nginx</code>.</p> -</li> -<li> -<p>Edit your <code>nginx.conf</code> file and ensure the following two paths are there:</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>Symlink the proxy host files in <code>sites-available</code> to <code>sites-enabled</code></p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Test your changes with <code>nginx -t</code>. Make appropriate changes if there are error messages.</p> -</li> -</ol> -<h3 id="pre-requisites--assumptions">Pre-requisites &amp; Assumptions</h3> -<p>I am using an Ubuntu VM with NPM and it&rsquo;s db as a Docker Container while Nginx is installed natively on the machine. You don&rsquo;t have to use this setup exactly, but I am making a few assumptions as to what you should have access to before you begin. I am also using custom SSL certs, but theoretically, the transition should be the same when using Lets Encrypt.</p> -<p>I&rsquo;ve added some example files to show before and after changes to this repo and outlined file trees below.</p> -<ul> -<li>You understand the basics of what a Reverse Proxy is doing and are sticking with some stock settings (like exposing port 80 an 443).</li> -<li>You&rsquo;ve installed <a href="https://nginxproxymanager.com/setup/">NPM</a> and <a href="https://www.nginx.com/resources/wiki/start/topics/tutorials/install/">Nginx</a> using your preferred method.</li> -<li>You have access to both NPMs file tree and Nginx&rsquo;s.</li> -<li>If using NPM in docker, make sure you&rsquo;ve mapped a local volume on the host to the container.</li> -<li>My setup using docker-compose is the following: <code>/user/nginx/data:/data</code>.</li> -<li>Know where your Nginx files are. If using docker, same as above, make sure your container directories are mapped to the host.</li> -<li>For a linux install, they should be accessible at <code>/etc/nginx</code>.</li> -<li>You know how to edit files at the command line using <code>nano</code>, <code>vi</code>, <code>vim</code>, <code>neovim</code>, <code>emacs</code>, or something else.</li> -</ul> -<h3 id="nginx-files">Nginx Files</h3> -<p>Nginx uses the <code>nginx.conf</code> file and within that file, it will include your proxy files. These exist under <code>./nginx/sites-enabled/</code>. In the main <code>nginx.conf</code> file, the line <code>include /etc/nginx/sites-enabled/*;</code> will bring in those files to the config file, making the proxies accessible.</p> -<h3 id="how-to-transition---detailed-version">How to Transition - Detailed Version</h3> -<ol> -<li> -<p>Since NPM uses Nginx under the hood, they are both, by default, going to try and use ports 80 and 443 to serve up your apps and content. Turn off both systems.</p> -<ul> -<li>Docker: <code>docker stop [app_container, db_container]</code></li> -<li>Systemd: <code>systemctl stop nginx</code></li> -</ul> -</li> -<li> -<p>Copy your <code>proxy_host</code> (NPM) files to the <code>sites-available</code> (Nginx) folder. -<code>cp -r /user/nginx/data/nginx/proxy_hosts/* /etc/nginx/sites-available/</code></p> -</li> -<li> -<p>Nginx doesn&rsquo;t really care what the files are called, but NPM numbers them based on the order in which you added them in the GUI. I find it better to rename them to what service they actually serve up for easier identification later.</p> -</li> -<li> -<p>Copy your <code>custom_ssl</code> folder from NPM to the <code>custom_ssl</code> folder in Nginx. See the following step for the various default paths in both systems.</p> -<ul> -<li><code>cp -r /user/nginx/data/custom_ssl/* /etc/nginx/custom_ssl/</code></li> -</ul> -</li> -<li> -<p>Copy the <code>conf.d</code> folder from NPM to the <code>conf.d</code> folder in Nginx. <em>Note: For some reason, not all of the files in -the proxy files were actually in my <code>conf.d</code> directory. If you&rsquo;re missing any files, please download and/or copy and -paste them from the <a href="https://github.com/NginxProxyManager/nginx-proxy-manager/tree/fa851b61da3fe3726d1a04c25e69d36e79edea2d/docker/rootfs/etc/nginx/conf.d/include">NPM Repo</a></em></p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/conf.d /etc/nginx/</code></li> -</ul> -</li> -<li> -<p>If you had any additional files included in the Advanced section of an NPM Proxy Host, make sure you copy them over. For my setup and this tutorial, they were all located in the <code>snippets</code> directory.</p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/snippets/* /etc/nginx/snippets/</code></li> -</ul> -</li> -<li> -<p>There are a number of lines that need to be updated in each proxy configuration file to make them work with Nginx. I&rsquo;ve placed additional comments in <a href="./proxy_host/npm_proxy.conf"><code>./proxy_host/npm_proxy.conf</code></a> file. The line changes are the following:</p> -<ol> -<li> -<p>Custom SSL path:</p> -<ul> -<li>NPM path: <code>/data/custom_ssl...</code></li> -<li>Nginx path: <code>/etc/nginx/custom_ssl...</code></li> -</ul> -</li> -<li> -<p>conf.d:</p> -<ul> -<li>The paths should remain the same. However, if you changed the path for <code>conf.d</code> in Nginx and differed in step 5, above, make sure you use the correct path.</li> -</ul> -</li> -<li> -<p>Access &amp; Error Logs</p> -<ul> -<li>NPM path: <code>/data/logs/...</code></li> -<li>Nginx path: <code>/var/log/nginx/...</code></li> -</ul> -</li> -</ol> -</li> -<li> -<p>Double Check all your paths! If this is your first time using Nginx, make sure every directory is correct! Save your work.</p> -</li> -<li> -<p>Navigate to the <code>nginx.conf</code> file which is located at <code>/etc/nginx/</code>. You can see the one I am using in this repo.</p> -</li> -<li> -<p>Make sure that you have the following two lines in the main conf file and that they are pointing to the appropriate directories in the nginx directory path.</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>You&rsquo;ll notice that you ensured there was a <code>sites-enabled</code> directory in the configuration file, but you changed all your proxy host config files in <code>sites-available</code>! Good eye, all that&rsquo;s left is to symlink the files to <code>sites-enabled</code> so that nginx can start using them.</p> -</li> -<li> -<p>To symlink the available proxy files run the following command within the <code>sites-available</code> directory:</p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Once you&rsquo;re confident that you&rsquo;ve done all the above correctly, you can test your setup using nginx command and flags. While in the directory with your <code>nginx.conf</code> file - usually <code>/etc/nginx</code> - run the following command: <code>nginx -t</code>.</p> -</li> -<li> -<p>If all is working as expected you should see the below output. If it returns any errors, fix them appropriately. It will usually tell you what line is throwing the error. In this case, there&rsquo;s a high likelihood that it will be path error.</p> -</li> -</ol> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok -</span></span><span style="display:flex;"><span>nginx: configuration file /etc/nginx/nginx.conf test is successful -</span></span></code></pre></div><p>And that&rsquo;s it! You can now restart your nginx service on the host and access all your sites just as if you were using Nginx Proxy Manager! Make sure you take a look at your logs and system&rsquo;s status should nginx fail to start.</p> -<h3 id="additional-informationappendix">Additional Information/Appendix</h3> -<h4 id="file-trees-for-npm-in-container-and-nginx-on-host">File Trees for NPM (in container) and Nginx (on host)</h4> -<p><em>I did not expand every directory in these trees. Only the ones that are pertinent for reference in this tutorial.</em></p> -<h4 id="nginx">NGINX</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ conf.d -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ include -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ assets.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ block-exploits.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ force-ssl.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ ip_ranges.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ resolvers.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-utf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-win -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ mime.types -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-available -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-enabled -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ nginx.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ proxy_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ scgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-available -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default.backup -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ rsmsn-root.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-enabled -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -&gt; /etc/nginx/sites-available/auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -&gt; /etc/nginx/sites-available/bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -&gt; /etc/nginx/sites-available/codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -&gt; /etc/nginx/sites-available/files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -&gt; /etc/nginx/sites-available/notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -&gt; /etc/nginx/sites-available/photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -&gt; /etc/nginx/sites-available/wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -&gt; /etc/nginx/sites-available/wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fastcgi-php.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ snakeoil.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ uwsgi_params -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ win-utf -</span></span></code></pre></div><h4 id="npm">NPM</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ data -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ access -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ keys.json -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ letsencrypt-acme-challenge -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ logs -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ mysql -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ nginx -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dead_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_www -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummycert.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummykey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 10.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 11.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 12.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 13.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 15.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 1.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 2.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 4.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 5.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 6.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ redirection_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ stream -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ temp -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ docker-compose.yml -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ letsencrypt -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ renewal-hooks -</span></span></code></pre></div> diff --git a/public/page/1.html b/public/page/1.html new file mode 100644 index 0000000..92c1246 --- /dev/null +++ b/public/page/1.html @@ -0,0 +1,10 @@ + + + + / + + + + + + diff --git a/public/posts.html b/public/posts.html new file mode 100644 index 0000000..879e335 --- /dev/null +++ b/public/posts.html @@ -0,0 +1,198 @@ + + + + + + + +Posts | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+
+

Trouble Hosting Hugo with Nginx +

+
+
+

For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and Iโ€™m happy to share some reverse proxy nginx config files....

+
+
September 20, 2023 ยท Norm Rasmussen
+ +
+ +
+
+

Tutorial: Move from NginxProxyManager to Nginx +

+
+
+

A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by. +Goal To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition....

+
+
August 5, 2023 ยท Norm Rasmussen
+ +
+
+ + + + + + + + + + + + + + diff --git a/public/posts/hosting_hugo_troubles.html b/public/posts/hosting_hugo_troubles.html new file mode 100644 index 0000000..b7eddc7 --- /dev/null +++ b/public/posts/hosting_hugo_troubles.html @@ -0,0 +1,326 @@ + + + + + + + +Trouble Hosting Hugo with Nginx | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ +

+ Trouble Hosting Hugo with Nginx +

+ +
+

For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not +loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse +proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and I’m happy to share some +reverse proxy nginx config files. See my post on moving from NPM to Nginx for more information.

+

Once I got the basic idea of this blog up and running, I ran hugo and then used scp to send the files to my nginx host’s +public folder. Despite index.html and all the CSS files being in the right spots, I kept getting a few repetitive errors +from nginx - either in my browser’s console or in nginx’s log files. I swore I read through every StackOverflow or personal +blog post I could find. In fact, the next day, I would sit back down after work to debug and I would continue to find the +same sites and posts I found the day before! It was getting frustrating.

+

Wouldn’t you know… it was one of the simplest solutions that got it all working. Here’s a breakdown of what I was seeing +and my hypothesis.

+

Console Errors:

+
    +
  • Incorrect MIME type –> css files being set as text/html type.
  • +
  • 500/502 Errors when trying to load javascript files
  • +
  • 500 Errors when trying to load child pages.
  • +
+

Nginx Log Errors for this server:

+
    +
  • [error] 1147432#1147432: *84013 invalid URL prefix in "://:/favicon-16x16.png"
  • +
  • [warn] 1147432#1147432: *84013 using uninitialized "port" variable
  • +
+

Nginx error.log errors:

+
    +
  • [error] 1118832#1118832: *77105 directory index of "/var/www/html/" is forbidden
  • +
+

I thought I had tried everything, but it was a rip and replace from a single blog post that solved it for me. Some of the +things I tried include the following. _Note: when I mention ’nginx config file’ below, I am referring to the specific file +for this subdomain. I have a single global nginx.conf and then individual files for each subdomain/proxy host.

+
    +
  • Editing index.html to ensure that any referenced file had an explicit mime type associated with it.
  • +
  • Included include { full path }/mime.types in the specific nginx config file.
  • +
  • Included specific location ~ \.(css|js)$ { sections in my nginx config file.
  • +
  • Tried assigning the $forward_scheme, $host, and $port variables (similar to a reverse proxy host).
  • +
  • Removing any SSL references <– This caused similar behavior but different errors! I thought I was making progress…๐Ÿซฅ
  • +
  • Switched out the variables of root and alias between my server and location blocks.
  • +
  • Started with something super simple, such as the suggestions from Gideon Wolfe’s Block.
  • +
+

If you clicked on the link I just shared, you’ll see that Gideon’s setup is quite similar to the one that I finally got to +work. My thought there is that my errors were less about the nginx config setup from within the file, and instead it’s very +possible that I set incorrect directory permissions after transferring all the public files to the web server. Gideon’s blog +was the very first I clicked on, so I owe them my thanks since their site was the entry point to figuring all this out! +You can find a list of all the blogs I stumbled upon in this weird and fluctuating journey of doing something as simple as +sharing my static files on an nginx web server.

+

In the end, newbs.rocks blog post on setting up Hugo with nginx provided me a config +example that worked for my setup. I think part of what happened was that as I was cycling through all the blog posts and +StackOverflow posts, I would remove one or two lines (usually the one or two I changed from the previous post’s +recommendations) but in doing that, was making more of a mess for myself, burying the error even more deeply. By replacing +everything, I’ve brought it back to a manageable place.

+

You’ll also notice in my final config file, I was able to add back in the Authelia snippets, paths for the SSL certs, and a few other items that connect nginx to the rest of my infrastructure.

+

If you’ve stumbled upon this, I hope it helps you figure out your Hugo/Nginx issues! I definitely saw a lot of people posting +in Hugo’s Discourse asking about mime type errors, so it is +very likely that whatever you’re facing isn’t isolated to just you.

+

Now that I have this up and running, I need to write (and post!) a script that will pull from my repo, change directory +ownership, and reload nginx.

+

Working nginx config file

+
# ------------------------------------------------------------
+# selfhosted.rsmsn.co
+# ------------------------------------------------------------
+
+server {
+    listen 80;
+    listen [::]:80;
+
+    listen 443 ssl http2;
+    listen [::]:443 ssl http2;
+
+    server_name selfhosted.rsmsn.co;
+
+    root /var/www/html/public/;
+    index /index.html;
+
+    # Force SSL
+    include conf.d/include/force-ssl.conf;
+
+    # Custom SSL
+    ssl_certificate custom_ssl/npm-3/fullchain.pem;
+    ssl_certificate_key custom_ssl/npm-3/privkey.pem;
+
+
+    access_log /var/log/nginx/blog.log combined;
+    error_log /var/log/nginx/blog_error.log warn;
+
+    include snippets/authelia-location.conf;
+
+    location / {
+        try_files $uri $uri/ =404;
+        include snippets/authelia-authrequest.conf;
+    }
+}
+

Blogs and Sites I used

+ + + +
+ + +
+
+ + + + + + + + + + + + + + diff --git a/public/posts/index.xml b/public/posts/index.xml index 434a8ed..318593b 100644 --- a/public/posts/index.xml +++ b/public/posts/index.xml @@ -1,280 +1,29 @@ - + Posts on Rsmsn Blog - https://selfhosted.rsmsn.co/posts/ + /posts.html Recent content in Posts on Rsmsn Blog Hugo -- gohugo.io en-us - Sat, 05 Aug 2023 15:23:51 -0500 + Wed, 20 Sep 2023 11:33:22 -0400 + + Trouble Hosting Hugo with Nginx + /posts/hosting_hugo_troubles.html + Wed, 20 Sep 2023 11:33:22 -0400 + + /posts/hosting_hugo_troubles.html + For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and I&rsquo;m happy to share some reverse proxy nginx config files. + + Tutorial: Move from NginxProxyManager to Nginx - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html Sat, 05 Aug 2023 15:23:51 -0500 - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by. Goal To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition. - <p>A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for <a href="https://www.reddit.com/r/selfhosted/comments/15j4v80/minitutorial_migrating_from_nginx_proxy_manager/">this reddit -post</a> and to post this <a href="https://github.com/Normanras/Npm_to_Nginx">my Github profile</a>. Thought my website would also be a good place to share it for any passers-by.</p> -<h2 id="goal">Goal</h2> -<p>To give clear instructions to help users migrate from using <a href="https://nginxproxymanager.com/">Nginx Proxy Manager</a> (NPM) to standard <a href="https://docs.nginx.com/">Nginx</a>. This tutorial is not exhaustive and there are many other implementations of this transition. I would recommend checking out the many Nginx <a href="http://nginx.org/en/docs/">Documentation Sites</a> and tutorials to learn more.</p> -<h3 id="introduction">Introduction</h3> -<p>If you&rsquo;re anything like me and you got into the self-hosted/homelab/diy game sometime within the last 5 years, you&rsquo;ve likely been recommended to use Nginx Proxy Manager as one of the choice Reverse Proxy services. If you&rsquo;ve also been paying attention to various self-hosted communities, you may have also come across Christian Lempa&rsquo;s Video on <a href="https://youtu.be/uaixCKTaqY0">trusting smaller self hosted projects and tools</a>.</p> -<p><em>Spoilers:</em> He roasts NPM in his video and towards the end says he won&rsquo;t be using NPM anymore. He also, perhaps purposely, doesn&rsquo;t share which tool he will be migrating to.</p> -<p>Whether you follow Christian away from NPM or not, it dawned on me that while NPM is using a very trusted web server and reverse proxy under the hood, I hadn&rsquo;t taken the time to understand how an Nginx Config actually worked. Since NPM was already creating most of the files for Nginx, I got to reading through all the files and reworking them so that I could begin using Nginx without the NPM gui.</p> -<p><em>Contributing: This is not all encompassing of Nginx possibilities. Including instructions for various installation methods, using OpenResty, and any other migrations or use cases would help the community. If you&rsquo;d like to add in additional information on how to migrate from NPM to Nginx, that is welcome. Simply submit a PR with your steps.</em></p> -<h3 id="tldr---quick-steps">TL;DR - Quick Steps</h3> -<ol> -<li> -<p>Copy the following contents (including sub-directories) from the NPM <code>/data/nginx</code> directory to the Nginx <code>/etc/nginx</code> folder:</p> -<ul> -<li><code>proxy_hosts</code> &gt; <code>sites-available</code></li> -<li><code>conf.d</code> &gt; <code>conf.d</code></li> -<li><code>snippets</code> &gt; <code>snippets</code></li> -<li><code>custom_ssl</code> &gt; <code>custom_ssl</code> (if applicable)</li> -</ul> -</li> -<li> -<p>Edit each file in your <code>sites-available</code> directory and update the paths. Most will change from <code>/data/nginx/</code> to <code>/etc/nginx</code>.</p> -</li> -<li> -<p>Edit your <code>nginx.conf</code> file and ensure the following two paths are there:</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>Symlink the proxy host files in <code>sites-available</code> to <code>sites-enabled</code></p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Test your changes with <code>nginx -t</code>. Make appropriate changes if there are error messages.</p> -</li> -</ol> -<h3 id="pre-requisites--assumptions">Pre-requisites &amp; Assumptions</h3> -<p>I am using an Ubuntu VM with NPM and it&rsquo;s db as a Docker Container while Nginx is installed natively on the machine. You don&rsquo;t have to use this setup exactly, but I am making a few assumptions as to what you should have access to before you begin. I am also using custom SSL certs, but theoretically, the transition should be the same when using Lets Encrypt.</p> -<p>I&rsquo;ve added some example files to show before and after changes to this repo and outlined file trees below.</p> -<ul> -<li>You understand the basics of what a Reverse Proxy is doing and are sticking with some stock settings (like exposing port 80 an 443).</li> -<li>You&rsquo;ve installed <a href="https://nginxproxymanager.com/setup/">NPM</a> and <a href="https://www.nginx.com/resources/wiki/start/topics/tutorials/install/">Nginx</a> using your preferred method.</li> -<li>You have access to both NPMs file tree and Nginx&rsquo;s.</li> -<li>If using NPM in docker, make sure you&rsquo;ve mapped a local volume on the host to the container.</li> -<li>My setup using docker-compose is the following: <code>/user/nginx/data:/data</code>.</li> -<li>Know where your Nginx files are. If using docker, same as above, make sure your container directories are mapped to the host.</li> -<li>For a linux install, they should be accessible at <code>/etc/nginx</code>.</li> -<li>You know how to edit files at the command line using <code>nano</code>, <code>vi</code>, <code>vim</code>, <code>neovim</code>, <code>emacs</code>, or something else.</li> -</ul> -<h3 id="nginx-files">Nginx Files</h3> -<p>Nginx uses the <code>nginx.conf</code> file and within that file, it will include your proxy files. These exist under <code>./nginx/sites-enabled/</code>. In the main <code>nginx.conf</code> file, the line <code>include /etc/nginx/sites-enabled/*;</code> will bring in those files to the config file, making the proxies accessible.</p> -<h3 id="how-to-transition---detailed-version">How to Transition - Detailed Version</h3> -<ol> -<li> -<p>Since NPM uses Nginx under the hood, they are both, by default, going to try and use ports 80 and 443 to serve up your apps and content. Turn off both systems.</p> -<ul> -<li>Docker: <code>docker stop [app_container, db_container]</code></li> -<li>Systemd: <code>systemctl stop nginx</code></li> -</ul> -</li> -<li> -<p>Copy your <code>proxy_host</code> (NPM) files to the <code>sites-available</code> (Nginx) folder. -<code>cp -r /user/nginx/data/nginx/proxy_hosts/* /etc/nginx/sites-available/</code></p> -</li> -<li> -<p>Nginx doesn&rsquo;t really care what the files are called, but NPM numbers them based on the order in which you added them in the GUI. I find it better to rename them to what service they actually serve up for easier identification later.</p> -</li> -<li> -<p>Copy your <code>custom_ssl</code> folder from NPM to the <code>custom_ssl</code> folder in Nginx. See the following step for the various default paths in both systems.</p> -<ul> -<li><code>cp -r /user/nginx/data/custom_ssl/* /etc/nginx/custom_ssl/</code></li> -</ul> -</li> -<li> -<p>Copy the <code>conf.d</code> folder from NPM to the <code>conf.d</code> folder in Nginx. <em>Note: For some reason, not all of the files in -the proxy files were actually in my <code>conf.d</code> directory. If you&rsquo;re missing any files, please download and/or copy and -paste them from the <a href="https://github.com/NginxProxyManager/nginx-proxy-manager/tree/fa851b61da3fe3726d1a04c25e69d36e79edea2d/docker/rootfs/etc/nginx/conf.d/include">NPM Repo</a></em></p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/conf.d /etc/nginx/</code></li> -</ul> -</li> -<li> -<p>If you had any additional files included in the Advanced section of an NPM Proxy Host, make sure you copy them over. For my setup and this tutorial, they were all located in the <code>snippets</code> directory.</p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/snippets/* /etc/nginx/snippets/</code></li> -</ul> -</li> -<li> -<p>There are a number of lines that need to be updated in each proxy configuration file to make them work with Nginx. I&rsquo;ve placed additional comments in <a href="./proxy_host/npm_proxy.conf"><code>./proxy_host/npm_proxy.conf</code></a> file. The line changes are the following:</p> -<ol> -<li> -<p>Custom SSL path:</p> -<ul> -<li>NPM path: <code>/data/custom_ssl...</code></li> -<li>Nginx path: <code>/etc/nginx/custom_ssl...</code></li> -</ul> -</li> -<li> -<p>conf.d:</p> -<ul> -<li>The paths should remain the same. However, if you changed the path for <code>conf.d</code> in Nginx and differed in step 5, above, make sure you use the correct path.</li> -</ul> -</li> -<li> -<p>Access &amp; Error Logs</p> -<ul> -<li>NPM path: <code>/data/logs/...</code></li> -<li>Nginx path: <code>/var/log/nginx/...</code></li> -</ul> -</li> -</ol> -</li> -<li> -<p>Double Check all your paths! If this is your first time using Nginx, make sure every directory is correct! Save your work.</p> -</li> -<li> -<p>Navigate to the <code>nginx.conf</code> file which is located at <code>/etc/nginx/</code>. You can see the one I am using in this repo.</p> -</li> -<li> -<p>Make sure that you have the following two lines in the main conf file and that they are pointing to the appropriate directories in the nginx directory path.</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>You&rsquo;ll notice that you ensured there was a <code>sites-enabled</code> directory in the configuration file, but you changed all your proxy host config files in <code>sites-available</code>! Good eye, all that&rsquo;s left is to symlink the files to <code>sites-enabled</code> so that nginx can start using them.</p> -</li> -<li> -<p>To symlink the available proxy files run the following command within the <code>sites-available</code> directory:</p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Once you&rsquo;re confident that you&rsquo;ve done all the above correctly, you can test your setup using nginx command and flags. While in the directory with your <code>nginx.conf</code> file - usually <code>/etc/nginx</code> - run the following command: <code>nginx -t</code>.</p> -</li> -<li> -<p>If all is working as expected you should see the below output. If it returns any errors, fix them appropriately. It will usually tell you what line is throwing the error. In this case, there&rsquo;s a high likelihood that it will be path error.</p> -</li> -</ol> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok -</span></span><span style="display:flex;"><span>nginx: configuration file /etc/nginx/nginx.conf test is successful -</span></span></code></pre></div><p>And that&rsquo;s it! You can now restart your nginx service on the host and access all your sites just as if you were using Nginx Proxy Manager! Make sure you take a look at your logs and system&rsquo;s status should nginx fail to start.</p> -<h3 id="additional-informationappendix">Additional Information/Appendix</h3> -<h4 id="file-trees-for-npm-in-container-and-nginx-on-host">File Trees for NPM (in container) and Nginx (on host)</h4> -<p><em>I did not expand every directory in these trees. Only the ones that are pertinent for reference in this tutorial.</em></p> -<h4 id="nginx">NGINX</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ conf.d -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ include -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ assets.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ block-exploits.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ force-ssl.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ ip_ranges.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ resolvers.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-utf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-win -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ mime.types -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-available -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-enabled -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ nginx.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ proxy_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ scgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-available -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default.backup -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ rsmsn-root.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-enabled -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -&gt; /etc/nginx/sites-available/auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -&gt; /etc/nginx/sites-available/bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -&gt; /etc/nginx/sites-available/codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -&gt; /etc/nginx/sites-available/files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -&gt; /etc/nginx/sites-available/notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -&gt; /etc/nginx/sites-available/photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -&gt; /etc/nginx/sites-available/wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -&gt; /etc/nginx/sites-available/wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fastcgi-php.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ snakeoil.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ uwsgi_params -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ win-utf -</span></span></code></pre></div><h4 id="npm">NPM</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ data -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ access -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ keys.json -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ letsencrypt-acme-challenge -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ logs -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ mysql -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ nginx -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dead_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_www -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummycert.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummykey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 10.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 11.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 12.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 13.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 15.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 1.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 2.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 4.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 5.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 6.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ redirection_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ stream -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ temp -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ docker-compose.yml -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ letsencrypt -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ renewal-hooks -</span></span></code></pre></div> diff --git a/public/posts/npm_to_nginx_tutorial.html b/public/posts/npm_to_nginx_tutorial.html new file mode 100644 index 0000000..7ee36ca --- /dev/null +++ b/public/posts/npm_to_nginx_tutorial.html @@ -0,0 +1,488 @@ + + + + + + + +Tutorial: Move from NginxProxyManager to Nginx | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ +

+ Tutorial: Move from NginxProxyManager to Nginx +

+ +
+

A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit +post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by.

+

Goal

+

To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition. I would recommend checking out the many Nginx Documentation Sites and tutorials to learn more.

+

Introduction

+

If you’re anything like me and you got into the self-hosted/homelab/diy game sometime within the last 5 years, you’ve likely been recommended to use Nginx Proxy Manager as one of the choice Reverse Proxy services. If you’ve also been paying attention to various self-hosted communities, you may have also come across Christian Lempa’s Video on trusting smaller self hosted projects and tools.

+

Spoilers: He roasts NPM in his video and towards the end says he won’t be using NPM anymore. He also, perhaps purposely, doesn’t share which tool he will be migrating to.

+

Whether you follow Christian away from NPM or not, it dawned on me that while NPM is using a very trusted web server and reverse proxy under the hood, I hadn’t taken the time to understand how an Nginx Config actually worked. Since NPM was already creating most of the files for Nginx, I got to reading through all the files and reworking them so that I could begin using Nginx without the NPM gui.

+

Contributing: This is not all encompassing of Nginx possibilities. Including instructions for various installation methods, using OpenResty, and any other migrations or use cases would help the community. If you’d like to add in additional information on how to migrate from NPM to Nginx, that is welcome. Simply submit a PR with your steps.

+

TL;DR - Quick Steps

+
    +
  1. +

    Copy the following contents (including sub-directories) from the NPM /data/nginx directory to the Nginx /etc/nginx folder:

    +
      +
    • proxy_hosts > sites-available
    • +
    • conf.d > conf.d
    • +
    • snippets > snippets
    • +
    • custom_ssl > custom_ssl (if applicable)
    • +
    +
  2. +
  3. +

    Edit each file in your sites-available directory and update the paths. Most will change from /data/nginx/ to /etc/nginx.

    +
  4. +
  5. +

    Edit your nginx.conf file and ensure the following two paths are there:

    +
      +
    • include /etc/nginx/conf.d/*.conf; and include /etc/nginx/sites-enabled/*;
    • +
    +
  6. +
  7. +

    Symlink the proxy host files in sites-available to sites-enabled

    +
      +
    • ln -s * ./sites-enabled
    • +
    +
  8. +
  9. +

    Test your changes with nginx -t. Make appropriate changes if there are error messages.

    +
  10. +
+

Pre-requisites & Assumptions

+

I am using an Ubuntu VM with NPM and it’s db as a Docker Container while Nginx is installed natively on the machine. You don’t have to use this setup exactly, but I am making a few assumptions as to what you should have access to before you begin. I am also using custom SSL certs, but theoretically, the transition should be the same when using Lets Encrypt.

+

I’ve added some example files to show before and after changes to this repo and outlined file trees below.

+
    +
  • You understand the basics of what a Reverse Proxy is doing and are sticking with some stock settings (like exposing port 80 an 443).
  • +
  • You’ve installed NPM and Nginx using your preferred method.
  • +
  • You have access to both NPMs file tree and Nginx’s.
  • +
  • If using NPM in docker, make sure you’ve mapped a local volume on the host to the container.
  • +
  • My setup using docker-compose is the following: /user/nginx/data:/data.
  • +
  • Know where your Nginx files are. If using docker, same as above, make sure your container directories are mapped to the host.
  • +
  • For a linux install, they should be accessible at /etc/nginx.
  • +
  • You know how to edit files at the command line using nano, vi, vim, neovim, emacs, or something else.
  • +
+

Nginx Files

+

Nginx uses the nginx.conf file and within that file, it will include your proxy files. These exist under ./nginx/sites-enabled/. In the main nginx.conf file, the line include /etc/nginx/sites-enabled/*; will bring in those files to the config file, making the proxies accessible.

+

How to Transition - Detailed Version

+
    +
  1. +

    Since NPM uses Nginx under the hood, they are both, by default, going to try and use ports 80 and 443 to serve up your apps and content. Turn off both systems.

    +
      +
    • Docker: docker stop [app_container, db_container]
    • +
    • Systemd: systemctl stop nginx
    • +
    +
  2. +
  3. +

    Copy your proxy_host (NPM) files to the sites-available (Nginx) folder. +cp -r /user/nginx/data/nginx/proxy_hosts/* /etc/nginx/sites-available/

    +
  4. +
  5. +

    Nginx doesn’t really care what the files are called, but NPM numbers them based on the order in which you added them in the GUI. I find it better to rename them to what service they actually serve up for easier identification later.

    +
  6. +
  7. +

    Copy your custom_ssl folder from NPM to the custom_ssl folder in Nginx. See the following step for the various default paths in both systems.

    +
      +
    • cp -r /user/nginx/data/custom_ssl/* /etc/nginx/custom_ssl/
    • +
    +
  8. +
  9. +

    Copy the conf.d folder from NPM to the conf.d folder in Nginx. Note: For some reason, not all of the files in +the proxy files were actually in my conf.d directory. If you’re missing any files, please download and/or copy and +paste them from the NPM Repo

    +
      +
    • cp -r /user/nginx/data/nginx/conf.d /etc/nginx/
    • +
    +
  10. +
  11. +

    If you had any additional files included in the Advanced section of an NPM Proxy Host, make sure you copy them over. For my setup and this tutorial, they were all located in the snippets directory.

    +
      +
    • cp -r /user/nginx/data/nginx/snippets/* /etc/nginx/snippets/
    • +
    +
  12. +
  13. +

    There are a number of lines that need to be updated in each proxy configuration file to make them work with Nginx. I’ve placed additional comments in ./proxy_host/npm_proxy.conf file. The line changes are the following:

    +
      +
    1. +

      Custom SSL path:

      +
        +
      • NPM path: /data/custom_ssl...
      • +
      • Nginx path: /etc/nginx/custom_ssl...
      • +
      +
    2. +
    3. +

      conf.d:

      +
        +
      • The paths should remain the same. However, if you changed the path for conf.d in Nginx and differed in step 5, above, make sure you use the correct path.
      • +
      +
    4. +
    5. +

      Access & Error Logs

      +
        +
      • NPM path: /data/logs/...
      • +
      • Nginx path: /var/log/nginx/...
      • +
      +
    6. +
    +
  14. +
  15. +

    Double Check all your paths! If this is your first time using Nginx, make sure every directory is correct! Save your work.

    +
  16. +
  17. +

    Navigate to the nginx.conf file which is located at /etc/nginx/. You can see the one I am using in this repo.

    +
  18. +
  19. +

    Make sure that you have the following two lines in the main conf file and that they are pointing to the appropriate directories in the nginx directory path.

    +
      +
    • include /etc/nginx/conf.d/*.conf; and include /etc/nginx/sites-enabled/*;
    • +
    +
  20. +
  21. +

    You’ll notice that you ensured there was a sites-enabled directory in the configuration file, but you changed all your proxy host config files in sites-available! Good eye, all that’s left is to symlink the files to sites-enabled so that nginx can start using them.

    +
  22. +
  23. +

    To symlink the available proxy files run the following command within the sites-available directory:

    +
      +
    • ln -s * ./sites-enabled
    • +
    +
  24. +
  25. +

    Once you’re confident that you’ve done all the above correctly, you can test your setup using nginx command and flags. While in the directory with your nginx.conf file - usually /etc/nginx - run the following command: nginx -t.

    +
  26. +
  27. +

    If all is working as expected you should see the below output. If it returns any errors, fix them appropriately. It will usually tell you what line is throwing the error. In this case, there’s a high likelihood that it will be path error.

    +
  28. +
+
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
+nginx: configuration file /etc/nginx/nginx.conf test is successful
+

And that’s it! You can now restart your nginx service on the host and access all your sites just as if you were using Nginx Proxy Manager! Make sure you take a look at your logs and system’s status should nginx fail to start.

+

Additional Information/Appendix

+

File Trees for NPM (in container) and Nginx (on host)

+

I did not expand every directory in these trees. Only the ones that are pertinent for reference in this tutorial.

+

NGINX

+
โ”œโ”€โ”€ conf.d
+โ”‚ย ย  โ””โ”€โ”€ include
+โ”‚ย ย      โ”œโ”€โ”€ assets.conf
+โ”‚ย ย      โ”œโ”€โ”€ block-exploits.conf
+โ”‚ย ย      โ”œโ”€โ”€ force-ssl.conf
+โ”‚ย ย      โ”œโ”€โ”€ ip_ranges.conf
+โ”‚ย ย      โ”œโ”€โ”€ proxy.conf
+โ”‚ย ย      โ””โ”€โ”€ resolvers.conf
+โ”œโ”€โ”€ custom_ssl
+โ”‚ย ย  โ”œโ”€โ”€ npm-1
+โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem
+โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem
+โ”‚ย ย  โ”œโ”€โ”€ npm-2
+โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem
+โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem
+โ”‚ย ย  โ””โ”€โ”€ npm-3
+โ”‚ย ย      โ”œโ”€โ”€ fullchain.pem
+โ”‚ย ย      โ””โ”€โ”€ privkey.pem
+โ”œโ”€โ”€ fastcgi.conf
+โ”œโ”€โ”€ fastcgi_params
+โ”œโ”€โ”€ koi-utf
+โ”œโ”€โ”€ koi-win
+โ”œโ”€โ”€ mime.types
+โ”œโ”€โ”€ modules-available
+โ”œโ”€โ”€ modules-enabled
+โ”œโ”€โ”€ nginx.conf
+โ”œโ”€โ”€ proxy_params
+โ”œโ”€โ”€ scgi_params
+โ”œโ”€โ”€ sites-available
+โ”‚ย ย  โ”œโ”€โ”€ auth.conf
+โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf
+โ”‚ย ย  โ”œโ”€โ”€ codehub.conf
+โ”‚ย ย  โ”œโ”€โ”€ default.backup
+โ”‚ย ย  โ”œโ”€โ”€ files.conf
+โ”‚ย ย  โ”œโ”€โ”€ notes.conf
+โ”‚ย ย  โ”œโ”€โ”€ photos.conf
+โ”‚ย ย  โ”œโ”€โ”€ rsmsn-root.conf
+โ”‚ย ย  โ”œโ”€โ”€ wordle.conf
+โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf
+โ”œโ”€โ”€ sites-enabled
+โ”‚ย ย  โ”œโ”€โ”€ auth.conf -> /etc/nginx/sites-available/auth.conf
+โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -> /etc/nginx/sites-available/bitwarden.conf
+โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -> /etc/nginx/sites-available/codehub.conf
+โ”‚ย ย  โ”œโ”€โ”€ files.conf -> /etc/nginx/sites-available/files.conf
+โ”‚ย ย  โ”œโ”€โ”€ notes.conf -> /etc/nginx/sites-available/notes.conf
+โ”‚ย ย  โ”œโ”€โ”€ photos.conf -> /etc/nginx/sites-available/photos.conf
+โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -> /etc/nginx/sites-available/wordle.conf
+โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -> /etc/nginx/sites-available/wordle-it.conf
+โ”œโ”€โ”€ snippets
+โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf
+โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf
+โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf
+โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf
+โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf
+โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf
+โ”‚ย ย  โ”œโ”€โ”€ fastcgi-php.conf
+โ”‚ย ย  โ”œโ”€โ”€ proxy.conf
+โ”‚ย ย  โ””โ”€โ”€ snakeoil.conf
+โ”œโ”€โ”€ uwsgi_params
+โ””โ”€โ”€ win-utf
+

NPM

+
โ”œโ”€โ”€ data
+โ”‚ย ย  โ”œโ”€โ”€ access
+โ”‚ย ย  โ”œโ”€โ”€ custom_ssl
+โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-1
+โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem
+โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem
+โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-2
+โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem
+โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem
+โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ npm-3
+โ”‚ย ย  โ”‚ย ย      โ”œโ”€โ”€ fullchain.pem
+โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ privkey.pem
+โ”‚ย ย  โ”œโ”€โ”€ keys.json
+โ”‚ย ย  โ”œโ”€โ”€ letsencrypt-acme-challenge
+โ”‚ย ย  โ”œโ”€โ”€ logs
+โ”‚ย ย  โ”œโ”€โ”€ mysql
+โ”‚ย ย  โ””โ”€โ”€ nginx
+โ”‚ย ย      โ”œโ”€โ”€ custom
+โ”‚ย ย      โ”œโ”€โ”€ dead_host
+โ”‚ย ย      โ”œโ”€โ”€ default_host
+โ”‚ย ย      โ”œโ”€โ”€ default_www
+โ”‚ย ย      โ”œโ”€โ”€ dummycert.pem
+โ”‚ย ย      โ”œโ”€โ”€ dummykey.pem
+โ”‚ย ย      โ”œโ”€โ”€ proxy_host
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 10.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 11.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 12.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 13.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 15.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 1.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 2.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 4.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ 5.conf
+โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ 6.conf
+โ”‚ย ย      โ”œโ”€โ”€ redirection_host
+โ”‚ย ย      โ”œโ”€โ”€ snippets
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf
+โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf
+โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ proxy.conf
+โ”‚ย ย      โ”œโ”€โ”€ stream
+โ”‚ย ย      โ””โ”€โ”€ temp
+โ”œโ”€โ”€ docker-compose.yml
+โ””โ”€โ”€ letsencrypt
+โ””โ”€โ”€ renewal-hooks
+
+ +
+ + +
+
+ + + + + + + + + + + + + + diff --git a/public/posts/page/1.html b/public/posts/page/1.html new file mode 100644 index 0000000..ec6b10c --- /dev/null +++ b/public/posts/page/1.html @@ -0,0 +1,10 @@ + + + + /posts.html + + + + + + diff --git a/public/rsmsncircles.ico b/public/rsmsncircles.ico new file mode 100644 index 0000000..a687ed0 Binary files /dev/null and b/public/rsmsncircles.ico differ diff --git a/public/sitemap.xml b/public/sitemap.xml index 52ddf67..6be2eb1 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -2,24 +2,33 @@ - https://selfhosted.rsmsn.co/posts/ + /posts.html + 2023-09-20T11:33:22-04:00 + + / + 2023-09-20T11:33:22-04:00 + + /tags/self-hosted.html + 2023-09-20T11:33:22-04:00 + + /tags.html + 2023-09-20T11:33:22-04:00 + + /tags/tips-tricks.html + 2023-09-20T11:33:22-04:00 + + /posts/hosting_hugo_troubles.html + 2023-09-20T11:33:22-04:00 + + /tags/troubleshooting.html + 2023-09-20T11:33:22-04:00 + + /tags/tutorial.html 2023-08-05T15:23:51-05:00 - https://selfhosted.rsmsn.co/ + /posts/npm_to_nginx_tutorial.html 2023-08-05T15:23:51-05:00 - https://selfhosted.rsmsn.co/tags/self-hosted/ - 2023-08-05T15:23:51-05:00 - - https://selfhosted.rsmsn.co/tags/ - 2023-08-05T15:23:51-05:00 - - https://selfhosted.rsmsn.co/tags/tutorial/ - 2023-08-05T15:23:51-05:00 - - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ - 2023-08-05T15:23:51-05:00 - - https://selfhosted.rsmsn.co/categories/ + /categories.html diff --git a/public/tags.html b/public/tags.html new file mode 100644 index 0000000..e240345 --- /dev/null +++ b/public/tags.html @@ -0,0 +1,171 @@ + + + + + + + +Tags | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+ + + + + + + + + + + + + + diff --git a/public/tags/index.xml b/public/tags/index.xml index c043cd3..4306d16 100644 --- a/public/tags/index.xml +++ b/public/tags/index.xml @@ -1,30 +1,46 @@ - + Tags on Rsmsn Blog - https://selfhosted.rsmsn.co/tags/ + /tags.html Recent content in Tags on Rsmsn Blog Hugo -- gohugo.io en-us - Sat, 05 Aug 2023 15:23:51 -0500 + Wed, 20 Sep 2023 11:33:22 -0400 self-hosted - https://selfhosted.rsmsn.co/tags/self-hosted/ - Sat, 05 Aug 2023 15:23:51 -0500 + /tags/self-hosted.html + Wed, 20 Sep 2023 11:33:22 -0400 - https://selfhosted.rsmsn.co/tags/self-hosted/ + /tags/self-hosted.html + + + + + tips & tricks + /tags/tips-tricks.html + Wed, 20 Sep 2023 11:33:22 -0400 + + /tags/tips-tricks.html + + + + + troubleshooting + /tags/troubleshooting.html + Wed, 20 Sep 2023 11:33:22 -0400 + + /tags/troubleshooting.html - tutorial - https://selfhosted.rsmsn.co/tags/tutorial/ + /tags/tutorial.html Sat, 05 Aug 2023 15:23:51 -0500 - https://selfhosted.rsmsn.co/tags/tutorial/ + /tags/tutorial.html - diff --git a/public/tags/self-hosted.html b/public/tags/self-hosted.html new file mode 100644 index 0000000..9f2705d --- /dev/null +++ b/public/tags/self-hosted.html @@ -0,0 +1,183 @@ + + + + + + + +self-hosted | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+
+

Trouble Hosting Hugo with Nginx +

+
+
+

For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and Iโ€™m happy to share some reverse proxy nginx config files....

+
+
September 20, 2023 ยท Norm Rasmussen
+ +
+ +
+
+

Tutorial: Move from NginxProxyManager to Nginx +

+
+
+

A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by. +Goal To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition....

+
+
August 5, 2023 ยท Norm Rasmussen
+ +
+
+ + + + + + + + + + + + + + diff --git a/public/tags/self-hosted/index.xml b/public/tags/self-hosted/index.xml index bc5e678..8f9d484 100644 --- a/public/tags/self-hosted/index.xml +++ b/public/tags/self-hosted/index.xml @@ -1,280 +1,29 @@ - + self-hosted on Rsmsn Blog - https://selfhosted.rsmsn.co/tags/self-hosted/ + /tags/self-hosted.html Recent content in self-hosted on Rsmsn Blog Hugo -- gohugo.io en-us - Sat, 05 Aug 2023 15:23:51 -0500 + Wed, 20 Sep 2023 11:33:22 -0400 + + Trouble Hosting Hugo with Nginx + /posts/hosting_hugo_troubles.html + Wed, 20 Sep 2023 11:33:22 -0400 + + /posts/hosting_hugo_troubles.html + For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and I&rsquo;m happy to share some reverse proxy nginx config files. + + Tutorial: Move from NginxProxyManager to Nginx - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html Sat, 05 Aug 2023 15:23:51 -0500 - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by. Goal To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition. - <p>A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for <a href="https://www.reddit.com/r/selfhosted/comments/15j4v80/minitutorial_migrating_from_nginx_proxy_manager/">this reddit -post</a> and to post this <a href="https://github.com/Normanras/Npm_to_Nginx">my Github profile</a>. Thought my website would also be a good place to share it for any passers-by.</p> -<h2 id="goal">Goal</h2> -<p>To give clear instructions to help users migrate from using <a href="https://nginxproxymanager.com/">Nginx Proxy Manager</a> (NPM) to standard <a href="https://docs.nginx.com/">Nginx</a>. This tutorial is not exhaustive and there are many other implementations of this transition. I would recommend checking out the many Nginx <a href="http://nginx.org/en/docs/">Documentation Sites</a> and tutorials to learn more.</p> -<h3 id="introduction">Introduction</h3> -<p>If you&rsquo;re anything like me and you got into the self-hosted/homelab/diy game sometime within the last 5 years, you&rsquo;ve likely been recommended to use Nginx Proxy Manager as one of the choice Reverse Proxy services. If you&rsquo;ve also been paying attention to various self-hosted communities, you may have also come across Christian Lempa&rsquo;s Video on <a href="https://youtu.be/uaixCKTaqY0">trusting smaller self hosted projects and tools</a>.</p> -<p><em>Spoilers:</em> He roasts NPM in his video and towards the end says he won&rsquo;t be using NPM anymore. He also, perhaps purposely, doesn&rsquo;t share which tool he will be migrating to.</p> -<p>Whether you follow Christian away from NPM or not, it dawned on me that while NPM is using a very trusted web server and reverse proxy under the hood, I hadn&rsquo;t taken the time to understand how an Nginx Config actually worked. Since NPM was already creating most of the files for Nginx, I got to reading through all the files and reworking them so that I could begin using Nginx without the NPM gui.</p> -<p><em>Contributing: This is not all encompassing of Nginx possibilities. Including instructions for various installation methods, using OpenResty, and any other migrations or use cases would help the community. If you&rsquo;d like to add in additional information on how to migrate from NPM to Nginx, that is welcome. Simply submit a PR with your steps.</em></p> -<h3 id="tldr---quick-steps">TL;DR - Quick Steps</h3> -<ol> -<li> -<p>Copy the following contents (including sub-directories) from the NPM <code>/data/nginx</code> directory to the Nginx <code>/etc/nginx</code> folder:</p> -<ul> -<li><code>proxy_hosts</code> &gt; <code>sites-available</code></li> -<li><code>conf.d</code> &gt; <code>conf.d</code></li> -<li><code>snippets</code> &gt; <code>snippets</code></li> -<li><code>custom_ssl</code> &gt; <code>custom_ssl</code> (if applicable)</li> -</ul> -</li> -<li> -<p>Edit each file in your <code>sites-available</code> directory and update the paths. Most will change from <code>/data/nginx/</code> to <code>/etc/nginx</code>.</p> -</li> -<li> -<p>Edit your <code>nginx.conf</code> file and ensure the following two paths are there:</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>Symlink the proxy host files in <code>sites-available</code> to <code>sites-enabled</code></p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Test your changes with <code>nginx -t</code>. Make appropriate changes if there are error messages.</p> -</li> -</ol> -<h3 id="pre-requisites--assumptions">Pre-requisites &amp; Assumptions</h3> -<p>I am using an Ubuntu VM with NPM and it&rsquo;s db as a Docker Container while Nginx is installed natively on the machine. You don&rsquo;t have to use this setup exactly, but I am making a few assumptions as to what you should have access to before you begin. I am also using custom SSL certs, but theoretically, the transition should be the same when using Lets Encrypt.</p> -<p>I&rsquo;ve added some example files to show before and after changes to this repo and outlined file trees below.</p> -<ul> -<li>You understand the basics of what a Reverse Proxy is doing and are sticking with some stock settings (like exposing port 80 an 443).</li> -<li>You&rsquo;ve installed <a href="https://nginxproxymanager.com/setup/">NPM</a> and <a href="https://www.nginx.com/resources/wiki/start/topics/tutorials/install/">Nginx</a> using your preferred method.</li> -<li>You have access to both NPMs file tree and Nginx&rsquo;s.</li> -<li>If using NPM in docker, make sure you&rsquo;ve mapped a local volume on the host to the container.</li> -<li>My setup using docker-compose is the following: <code>/user/nginx/data:/data</code>.</li> -<li>Know where your Nginx files are. If using docker, same as above, make sure your container directories are mapped to the host.</li> -<li>For a linux install, they should be accessible at <code>/etc/nginx</code>.</li> -<li>You know how to edit files at the command line using <code>nano</code>, <code>vi</code>, <code>vim</code>, <code>neovim</code>, <code>emacs</code>, or something else.</li> -</ul> -<h3 id="nginx-files">Nginx Files</h3> -<p>Nginx uses the <code>nginx.conf</code> file and within that file, it will include your proxy files. These exist under <code>./nginx/sites-enabled/</code>. In the main <code>nginx.conf</code> file, the line <code>include /etc/nginx/sites-enabled/*;</code> will bring in those files to the config file, making the proxies accessible.</p> -<h3 id="how-to-transition---detailed-version">How to Transition - Detailed Version</h3> -<ol> -<li> -<p>Since NPM uses Nginx under the hood, they are both, by default, going to try and use ports 80 and 443 to serve up your apps and content. Turn off both systems.</p> -<ul> -<li>Docker: <code>docker stop [app_container, db_container]</code></li> -<li>Systemd: <code>systemctl stop nginx</code></li> -</ul> -</li> -<li> -<p>Copy your <code>proxy_host</code> (NPM) files to the <code>sites-available</code> (Nginx) folder. -<code>cp -r /user/nginx/data/nginx/proxy_hosts/* /etc/nginx/sites-available/</code></p> -</li> -<li> -<p>Nginx doesn&rsquo;t really care what the files are called, but NPM numbers them based on the order in which you added them in the GUI. I find it better to rename them to what service they actually serve up for easier identification later.</p> -</li> -<li> -<p>Copy your <code>custom_ssl</code> folder from NPM to the <code>custom_ssl</code> folder in Nginx. See the following step for the various default paths in both systems.</p> -<ul> -<li><code>cp -r /user/nginx/data/custom_ssl/* /etc/nginx/custom_ssl/</code></li> -</ul> -</li> -<li> -<p>Copy the <code>conf.d</code> folder from NPM to the <code>conf.d</code> folder in Nginx. <em>Note: For some reason, not all of the files in -the proxy files were actually in my <code>conf.d</code> directory. If you&rsquo;re missing any files, please download and/or copy and -paste them from the <a href="https://github.com/NginxProxyManager/nginx-proxy-manager/tree/fa851b61da3fe3726d1a04c25e69d36e79edea2d/docker/rootfs/etc/nginx/conf.d/include">NPM Repo</a></em></p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/conf.d /etc/nginx/</code></li> -</ul> -</li> -<li> -<p>If you had any additional files included in the Advanced section of an NPM Proxy Host, make sure you copy them over. For my setup and this tutorial, they were all located in the <code>snippets</code> directory.</p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/snippets/* /etc/nginx/snippets/</code></li> -</ul> -</li> -<li> -<p>There are a number of lines that need to be updated in each proxy configuration file to make them work with Nginx. I&rsquo;ve placed additional comments in <a href="./proxy_host/npm_proxy.conf"><code>./proxy_host/npm_proxy.conf</code></a> file. The line changes are the following:</p> -<ol> -<li> -<p>Custom SSL path:</p> -<ul> -<li>NPM path: <code>/data/custom_ssl...</code></li> -<li>Nginx path: <code>/etc/nginx/custom_ssl...</code></li> -</ul> -</li> -<li> -<p>conf.d:</p> -<ul> -<li>The paths should remain the same. However, if you changed the path for <code>conf.d</code> in Nginx and differed in step 5, above, make sure you use the correct path.</li> -</ul> -</li> -<li> -<p>Access &amp; Error Logs</p> -<ul> -<li>NPM path: <code>/data/logs/...</code></li> -<li>Nginx path: <code>/var/log/nginx/...</code></li> -</ul> -</li> -</ol> -</li> -<li> -<p>Double Check all your paths! If this is your first time using Nginx, make sure every directory is correct! Save your work.</p> -</li> -<li> -<p>Navigate to the <code>nginx.conf</code> file which is located at <code>/etc/nginx/</code>. You can see the one I am using in this repo.</p> -</li> -<li> -<p>Make sure that you have the following two lines in the main conf file and that they are pointing to the appropriate directories in the nginx directory path.</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>You&rsquo;ll notice that you ensured there was a <code>sites-enabled</code> directory in the configuration file, but you changed all your proxy host config files in <code>sites-available</code>! Good eye, all that&rsquo;s left is to symlink the files to <code>sites-enabled</code> so that nginx can start using them.</p> -</li> -<li> -<p>To symlink the available proxy files run the following command within the <code>sites-available</code> directory:</p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Once you&rsquo;re confident that you&rsquo;ve done all the above correctly, you can test your setup using nginx command and flags. While in the directory with your <code>nginx.conf</code> file - usually <code>/etc/nginx</code> - run the following command: <code>nginx -t</code>.</p> -</li> -<li> -<p>If all is working as expected you should see the below output. If it returns any errors, fix them appropriately. It will usually tell you what line is throwing the error. In this case, there&rsquo;s a high likelihood that it will be path error.</p> -</li> -</ol> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok -</span></span><span style="display:flex;"><span>nginx: configuration file /etc/nginx/nginx.conf test is successful -</span></span></code></pre></div><p>And that&rsquo;s it! You can now restart your nginx service on the host and access all your sites just as if you were using Nginx Proxy Manager! Make sure you take a look at your logs and system&rsquo;s status should nginx fail to start.</p> -<h3 id="additional-informationappendix">Additional Information/Appendix</h3> -<h4 id="file-trees-for-npm-in-container-and-nginx-on-host">File Trees for NPM (in container) and Nginx (on host)</h4> -<p><em>I did not expand every directory in these trees. Only the ones that are pertinent for reference in this tutorial.</em></p> -<h4 id="nginx">NGINX</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ conf.d -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ include -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ assets.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ block-exploits.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ force-ssl.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ ip_ranges.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ resolvers.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-utf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-win -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ mime.types -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-available -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-enabled -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ nginx.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ proxy_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ scgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-available -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default.backup -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ rsmsn-root.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-enabled -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -&gt; /etc/nginx/sites-available/auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -&gt; /etc/nginx/sites-available/bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -&gt; /etc/nginx/sites-available/codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -&gt; /etc/nginx/sites-available/files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -&gt; /etc/nginx/sites-available/notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -&gt; /etc/nginx/sites-available/photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -&gt; /etc/nginx/sites-available/wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -&gt; /etc/nginx/sites-available/wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fastcgi-php.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ snakeoil.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ uwsgi_params -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ win-utf -</span></span></code></pre></div><h4 id="npm">NPM</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ data -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ access -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ keys.json -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ letsencrypt-acme-challenge -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ logs -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ mysql -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ nginx -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dead_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_www -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummycert.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummykey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 10.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 11.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 12.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 13.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 15.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 1.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 2.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 4.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 5.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 6.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ redirection_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ stream -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ temp -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ docker-compose.yml -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ letsencrypt -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ renewal-hooks -</span></span></code></pre></div> diff --git a/public/tags/self-hosted/page/1.html b/public/tags/self-hosted/page/1.html new file mode 100644 index 0000000..954ea41 --- /dev/null +++ b/public/tags/self-hosted/page/1.html @@ -0,0 +1,10 @@ + + + + /tags/self-hosted.html + + + + + + diff --git a/public/tags/tips-tricks.html b/public/tags/tips-tricks.html new file mode 100644 index 0000000..42d87a0 --- /dev/null +++ b/public/tags/tips-tricks.html @@ -0,0 +1,170 @@ + + + + + + + +tips & tricks | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+
+

Trouble Hosting Hugo with Nginx +

+
+
+

For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and Iโ€™m happy to share some reverse proxy nginx config files....

+
+
September 20, 2023 ยท Norm Rasmussen
+ +
+
+ + + + + + + + + + + + + + diff --git a/public/tags/tips-tricks/index.xml b/public/tags/tips-tricks/index.xml new file mode 100644 index 0000000..f65571c --- /dev/null +++ b/public/tags/tips-tricks/index.xml @@ -0,0 +1,20 @@ + + + + tips & tricks on Rsmsn Blog + /tags/tips-tricks.html + Recent content in tips & tricks on Rsmsn Blog + Hugo -- gohugo.io + en-us + Wed, 20 Sep 2023 11:33:22 -0400 + + Trouble Hosting Hugo with Nginx + /posts/hosting_hugo_troubles.html + Wed, 20 Sep 2023 11:33:22 -0400 + + /posts/hosting_hugo_troubles.html + For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and I&rsquo;m happy to share some reverse proxy nginx config files. + + + + diff --git a/public/tags/tips-tricks/page/1.html b/public/tags/tips-tricks/page/1.html new file mode 100644 index 0000000..40a1641 --- /dev/null +++ b/public/tags/tips-tricks/page/1.html @@ -0,0 +1,10 @@ + + + + /tags/tips-tricks.html + + + + + + diff --git a/public/tags/troubleshooting.html b/public/tags/troubleshooting.html new file mode 100644 index 0000000..c84bb3d --- /dev/null +++ b/public/tags/troubleshooting.html @@ -0,0 +1,170 @@ + + + + + + + +troubleshooting | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+
+

Trouble Hosting Hugo with Nginx +

+
+
+

For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and Iโ€™m happy to share some reverse proxy nginx config files....

+
+
September 20, 2023 ยท Norm Rasmussen
+ +
+
+ + + + + + + + + + + + + + diff --git a/public/tags/troubleshooting/index.xml b/public/tags/troubleshooting/index.xml new file mode 100644 index 0000000..f1370f1 --- /dev/null +++ b/public/tags/troubleshooting/index.xml @@ -0,0 +1,20 @@ + + + + troubleshooting on Rsmsn Blog + /tags/troubleshooting.html + Recent content in troubleshooting on Rsmsn Blog + Hugo -- gohugo.io + en-us + Wed, 20 Sep 2023 11:33:22 -0400 + + Trouble Hosting Hugo with Nginx + /posts/hosting_hugo_troubles.html + Wed, 20 Sep 2023 11:33:22 -0400 + + /posts/hosting_hugo_troubles.html + For the last 3 days, I have been spending a few hours after working trying to figure out why my brand new Hugo site was not loading correctly on my sub-domain. For context, I use Nginx to host all my apps and servers, most of them using reverse proxy protocols such as $proxy_host, $forward_scheme, and $port. There are a few more and I&rsquo;m happy to share some reverse proxy nginx config files. + + + + diff --git a/public/tags/troubleshooting/page/1.html b/public/tags/troubleshooting/page/1.html new file mode 100644 index 0000000..6181dc5 --- /dev/null +++ b/public/tags/troubleshooting/page/1.html @@ -0,0 +1,10 @@ + + + + /tags/troubleshooting.html + + + + + + diff --git a/public/tags/tutorial.html b/public/tags/tutorial.html new file mode 100644 index 0000000..a8f486c --- /dev/null +++ b/public/tags/tutorial.html @@ -0,0 +1,171 @@ + + + + + + + +tutorial | Rsmsn Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+
+

Tutorial: Move from NginxProxyManager to Nginx +

+
+
+

A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by. +Goal To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition....

+
+
August 5, 2023 ยท Norm Rasmussen
+ +
+
+ + + + + + + + + + + + + + diff --git a/public/tags/tutorial/index.xml b/public/tags/tutorial/index.xml index 29071c7..2ff7337 100644 --- a/public/tags/tutorial/index.xml +++ b/public/tags/tutorial/index.xml @@ -1,280 +1,20 @@ - + tutorial on Rsmsn Blog - https://selfhosted.rsmsn.co/tags/tutorial/ + /tags/tutorial.html Recent content in tutorial on Rsmsn Blog Hugo -- gohugo.io en-us - Sat, 05 Aug 2023 15:23:51 -0500 + Sat, 05 Aug 2023 15:23:51 -0500 Tutorial: Move from NginxProxyManager to Nginx - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html Sat, 05 Aug 2023 15:23:51 -0500 - https://selfhosted.rsmsn.co/posts/npm_to_nginx_tutorial/ + /posts/npm_to_nginx_tutorial.html A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for this reddit post and to post this my Github profile. Thought my website would also be a good place to share it for any passers-by. Goal To give clear instructions to help users migrate from using Nginx Proxy Manager (NPM) to standard Nginx. This tutorial is not exhaustive and there are many other implementations of this transition. - <p>A Tutorial Repo for migrating your Nginx Proxy Manager proxy setup to Nginx. I wrote this originally for <a href="https://www.reddit.com/r/selfhosted/comments/15j4v80/minitutorial_migrating_from_nginx_proxy_manager/">this reddit -post</a> and to post this <a href="https://github.com/Normanras/Npm_to_Nginx">my Github profile</a>. Thought my website would also be a good place to share it for any passers-by.</p> -<h2 id="goal">Goal</h2> -<p>To give clear instructions to help users migrate from using <a href="https://nginxproxymanager.com/">Nginx Proxy Manager</a> (NPM) to standard <a href="https://docs.nginx.com/">Nginx</a>. This tutorial is not exhaustive and there are many other implementations of this transition. I would recommend checking out the many Nginx <a href="http://nginx.org/en/docs/">Documentation Sites</a> and tutorials to learn more.</p> -<h3 id="introduction">Introduction</h3> -<p>If you&rsquo;re anything like me and you got into the self-hosted/homelab/diy game sometime within the last 5 years, you&rsquo;ve likely been recommended to use Nginx Proxy Manager as one of the choice Reverse Proxy services. If you&rsquo;ve also been paying attention to various self-hosted communities, you may have also come across Christian Lempa&rsquo;s Video on <a href="https://youtu.be/uaixCKTaqY0">trusting smaller self hosted projects and tools</a>.</p> -<p><em>Spoilers:</em> He roasts NPM in his video and towards the end says he won&rsquo;t be using NPM anymore. He also, perhaps purposely, doesn&rsquo;t share which tool he will be migrating to.</p> -<p>Whether you follow Christian away from NPM or not, it dawned on me that while NPM is using a very trusted web server and reverse proxy under the hood, I hadn&rsquo;t taken the time to understand how an Nginx Config actually worked. Since NPM was already creating most of the files for Nginx, I got to reading through all the files and reworking them so that I could begin using Nginx without the NPM gui.</p> -<p><em>Contributing: This is not all encompassing of Nginx possibilities. Including instructions for various installation methods, using OpenResty, and any other migrations or use cases would help the community. If you&rsquo;d like to add in additional information on how to migrate from NPM to Nginx, that is welcome. Simply submit a PR with your steps.</em></p> -<h3 id="tldr---quick-steps">TL;DR - Quick Steps</h3> -<ol> -<li> -<p>Copy the following contents (including sub-directories) from the NPM <code>/data/nginx</code> directory to the Nginx <code>/etc/nginx</code> folder:</p> -<ul> -<li><code>proxy_hosts</code> &gt; <code>sites-available</code></li> -<li><code>conf.d</code> &gt; <code>conf.d</code></li> -<li><code>snippets</code> &gt; <code>snippets</code></li> -<li><code>custom_ssl</code> &gt; <code>custom_ssl</code> (if applicable)</li> -</ul> -</li> -<li> -<p>Edit each file in your <code>sites-available</code> directory and update the paths. Most will change from <code>/data/nginx/</code> to <code>/etc/nginx</code>.</p> -</li> -<li> -<p>Edit your <code>nginx.conf</code> file and ensure the following two paths are there:</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>Symlink the proxy host files in <code>sites-available</code> to <code>sites-enabled</code></p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Test your changes with <code>nginx -t</code>. Make appropriate changes if there are error messages.</p> -</li> -</ol> -<h3 id="pre-requisites--assumptions">Pre-requisites &amp; Assumptions</h3> -<p>I am using an Ubuntu VM with NPM and it&rsquo;s db as a Docker Container while Nginx is installed natively on the machine. You don&rsquo;t have to use this setup exactly, but I am making a few assumptions as to what you should have access to before you begin. I am also using custom SSL certs, but theoretically, the transition should be the same when using Lets Encrypt.</p> -<p>I&rsquo;ve added some example files to show before and after changes to this repo and outlined file trees below.</p> -<ul> -<li>You understand the basics of what a Reverse Proxy is doing and are sticking with some stock settings (like exposing port 80 an 443).</li> -<li>You&rsquo;ve installed <a href="https://nginxproxymanager.com/setup/">NPM</a> and <a href="https://www.nginx.com/resources/wiki/start/topics/tutorials/install/">Nginx</a> using your preferred method.</li> -<li>You have access to both NPMs file tree and Nginx&rsquo;s.</li> -<li>If using NPM in docker, make sure you&rsquo;ve mapped a local volume on the host to the container.</li> -<li>My setup using docker-compose is the following: <code>/user/nginx/data:/data</code>.</li> -<li>Know where your Nginx files are. If using docker, same as above, make sure your container directories are mapped to the host.</li> -<li>For a linux install, they should be accessible at <code>/etc/nginx</code>.</li> -<li>You know how to edit files at the command line using <code>nano</code>, <code>vi</code>, <code>vim</code>, <code>neovim</code>, <code>emacs</code>, or something else.</li> -</ul> -<h3 id="nginx-files">Nginx Files</h3> -<p>Nginx uses the <code>nginx.conf</code> file and within that file, it will include your proxy files. These exist under <code>./nginx/sites-enabled/</code>. In the main <code>nginx.conf</code> file, the line <code>include /etc/nginx/sites-enabled/*;</code> will bring in those files to the config file, making the proxies accessible.</p> -<h3 id="how-to-transition---detailed-version">How to Transition - Detailed Version</h3> -<ol> -<li> -<p>Since NPM uses Nginx under the hood, they are both, by default, going to try and use ports 80 and 443 to serve up your apps and content. Turn off both systems.</p> -<ul> -<li>Docker: <code>docker stop [app_container, db_container]</code></li> -<li>Systemd: <code>systemctl stop nginx</code></li> -</ul> -</li> -<li> -<p>Copy your <code>proxy_host</code> (NPM) files to the <code>sites-available</code> (Nginx) folder. -<code>cp -r /user/nginx/data/nginx/proxy_hosts/* /etc/nginx/sites-available/</code></p> -</li> -<li> -<p>Nginx doesn&rsquo;t really care what the files are called, but NPM numbers them based on the order in which you added them in the GUI. I find it better to rename them to what service they actually serve up for easier identification later.</p> -</li> -<li> -<p>Copy your <code>custom_ssl</code> folder from NPM to the <code>custom_ssl</code> folder in Nginx. See the following step for the various default paths in both systems.</p> -<ul> -<li><code>cp -r /user/nginx/data/custom_ssl/* /etc/nginx/custom_ssl/</code></li> -</ul> -</li> -<li> -<p>Copy the <code>conf.d</code> folder from NPM to the <code>conf.d</code> folder in Nginx. <em>Note: For some reason, not all of the files in -the proxy files were actually in my <code>conf.d</code> directory. If you&rsquo;re missing any files, please download and/or copy and -paste them from the <a href="https://github.com/NginxProxyManager/nginx-proxy-manager/tree/fa851b61da3fe3726d1a04c25e69d36e79edea2d/docker/rootfs/etc/nginx/conf.d/include">NPM Repo</a></em></p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/conf.d /etc/nginx/</code></li> -</ul> -</li> -<li> -<p>If you had any additional files included in the Advanced section of an NPM Proxy Host, make sure you copy them over. For my setup and this tutorial, they were all located in the <code>snippets</code> directory.</p> -<ul> -<li><code>cp -r /user/nginx/data/nginx/snippets/* /etc/nginx/snippets/</code></li> -</ul> -</li> -<li> -<p>There are a number of lines that need to be updated in each proxy configuration file to make them work with Nginx. I&rsquo;ve placed additional comments in <a href="./proxy_host/npm_proxy.conf"><code>./proxy_host/npm_proxy.conf</code></a> file. The line changes are the following:</p> -<ol> -<li> -<p>Custom SSL path:</p> -<ul> -<li>NPM path: <code>/data/custom_ssl...</code></li> -<li>Nginx path: <code>/etc/nginx/custom_ssl...</code></li> -</ul> -</li> -<li> -<p>conf.d:</p> -<ul> -<li>The paths should remain the same. However, if you changed the path for <code>conf.d</code> in Nginx and differed in step 5, above, make sure you use the correct path.</li> -</ul> -</li> -<li> -<p>Access &amp; Error Logs</p> -<ul> -<li>NPM path: <code>/data/logs/...</code></li> -<li>Nginx path: <code>/var/log/nginx/...</code></li> -</ul> -</li> -</ol> -</li> -<li> -<p>Double Check all your paths! If this is your first time using Nginx, make sure every directory is correct! Save your work.</p> -</li> -<li> -<p>Navigate to the <code>nginx.conf</code> file which is located at <code>/etc/nginx/</code>. You can see the one I am using in this repo.</p> -</li> -<li> -<p>Make sure that you have the following two lines in the main conf file and that they are pointing to the appropriate directories in the nginx directory path.</p> -<ul> -<li><code>include /etc/nginx/conf.d/*.conf;</code> and <code>include /etc/nginx/sites-enabled/*;</code></li> -</ul> -</li> -<li> -<p>You&rsquo;ll notice that you ensured there was a <code>sites-enabled</code> directory in the configuration file, but you changed all your proxy host config files in <code>sites-available</code>! Good eye, all that&rsquo;s left is to symlink the files to <code>sites-enabled</code> so that nginx can start using them.</p> -</li> -<li> -<p>To symlink the available proxy files run the following command within the <code>sites-available</code> directory:</p> -<ul> -<li><code>ln -s * ./sites-enabled</code></li> -</ul> -</li> -<li> -<p>Once you&rsquo;re confident that you&rsquo;ve done all the above correctly, you can test your setup using nginx command and flags. While in the directory with your <code>nginx.conf</code> file - usually <code>/etc/nginx</code> - run the following command: <code>nginx -t</code>.</p> -</li> -<li> -<p>If all is working as expected you should see the below output. If it returns any errors, fix them appropriately. It will usually tell you what line is throwing the error. In this case, there&rsquo;s a high likelihood that it will be path error.</p> -</li> -</ol> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok -</span></span><span style="display:flex;"><span>nginx: configuration file /etc/nginx/nginx.conf test is successful -</span></span></code></pre></div><p>And that&rsquo;s it! You can now restart your nginx service on the host and access all your sites just as if you were using Nginx Proxy Manager! Make sure you take a look at your logs and system&rsquo;s status should nginx fail to start.</p> -<h3 id="additional-informationappendix">Additional Information/Appendix</h3> -<h4 id="file-trees-for-npm-in-container-and-nginx-on-host">File Trees for NPM (in container) and Nginx (on host)</h4> -<p><em>I did not expand every directory in these trees. Only the ones that are pertinent for reference in this tutorial.</em></p> -<h4 id="nginx">NGINX</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ conf.d -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ include -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ assets.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ block-exploits.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ force-ssl.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ ip_ranges.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ resolvers.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ fastcgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-utf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ koi-win -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ mime.types -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-available -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ modules-enabled -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ nginx.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ proxy_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ scgi_params -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-available -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default.backup -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ rsmsn-root.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ sites-enabled -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ auth.conf -&gt; /etc/nginx/sites-available/auth.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ bitwarden.conf -&gt; /etc/nginx/sites-available/bitwarden.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ codehub.conf -&gt; /etc/nginx/sites-available/codehub.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ files.conf -&gt; /etc/nginx/sites-available/files.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ notes.conf -&gt; /etc/nginx/sites-available/notes.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ photos.conf -&gt; /etc/nginx/sites-available/photos.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ wordle.conf -&gt; /etc/nginx/sites-available/wordle.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ wordle-it.conf -&gt; /etc/nginx/sites-available/wordle-it.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ fastcgi-php.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ snakeoil.conf -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ uwsgi_params -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ win-utf -</span></span></code></pre></div><h4 id="npm">NPM</h4> -<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>โ”œโ”€โ”€ data -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ access -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom_ssl -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-1 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ npm-2 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ npm-3 -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ fullchain.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ privkey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ keys.json -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ letsencrypt-acme-challenge -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ logs -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ mysql -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ nginx -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ custom -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dead_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ default_www -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummycert.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ dummykey.pem -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ proxy_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 10.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 11.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 12.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 13.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 15.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 1.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 2.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 4.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ 5.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ 6.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ redirection_host -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ snippets -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-authrequest-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-basic.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ authelia-location-detect.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ proxy.conf -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ”œโ”€โ”€ stream -</span></span><span style="display:flex;"><span>โ”‚ย ย  โ””โ”€โ”€ temp -</span></span><span style="display:flex;"><span>โ”œโ”€โ”€ docker-compose.yml -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ letsencrypt -</span></span><span style="display:flex;"><span>โ””โ”€โ”€ renewal-hooks -</span></span></code></pre></div> diff --git a/public/tags/tutorial/page/1.html b/public/tags/tutorial/page/1.html new file mode 100644 index 0000000..c83485d --- /dev/null +++ b/public/tags/tutorial/page/1.html @@ -0,0 +1,10 @@ + + + + /tags/tutorial.html + + + + + + diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..a687ed0 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/rsmsncircles.ico b/static/rsmsncircles.ico new file mode 100644 index 0000000..a687ed0 Binary files /dev/null and b/static/rsmsncircles.ico differ diff --git a/themes/PaperMod b/themes/PaperMod new file mode 160000 index 0000000..efe4cb4 --- /dev/null +++ b/themes/PaperMod @@ -0,0 +1 @@ +Subproject commit efe4cb45161be836d602d5cd0f857e62661dae8b diff --git a/themes/dark-theme-editor b/themes/dark-theme-editor deleted file mode 160000 index 8aa1d49..0000000 --- a/themes/dark-theme-editor +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8aa1d497b0ab458905dac8295dce3538b33fb3ee diff --git a/themes/terminal b/themes/terminal deleted file mode 160000 index 7e13d24..0000000 --- a/themes/terminal +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7e13d24d10c59c1cf1d1f011f7c4c93266d8aa7d