Deploying to gh-pages from @ 58bb606879 🚀

This commit is contained in:
Aravinth Manivannan 2022-11-10 12:23:52 +00:00
parent 9c021631e6
commit 72f2d4096b
29 changed files with 140 additions and 112 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `pages` mod in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, pages"><title>pages::ctx::api::v1::pages - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../../../normalize.css"><link rel="stylesheet" href="../../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../../../ayu.css" disabled><link rel="stylesheet" href="../../../../../dark.css" disabled><link rel="stylesheet" href="../../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../../storage.js"></script><script defer src="../../../../../main.js"></script><noscript><link rel="stylesheet" href="../../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module pages</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../../pages/index.html"><img class="rust-logo" src="../../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../../../../index.html">pages</a>::<wbr><a href="../../../index.html">ctx</a>::<wbr><a href="../../index.html">api</a>::<wbr><a href="../index.html">v1</a>::<wbr><a class="mod" href="#">pages</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../../src/pages/ctx/api/v1/pages.rs.html#17-78">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.AddSite.html" title="pages::ctx::api::v1::pages::AddSite struct">AddSite</a></div><div class="item-right docblock-short">Data required to add site</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../../../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `pages` mod in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, pages"><title>pages::ctx::api::v1::pages - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../../../normalize.css"><link rel="stylesheet" href="../../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../../../ayu.css" disabled><link rel="stylesheet" href="../../../../../dark.css" disabled><link rel="stylesheet" href="../../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../../storage.js"></script><script defer src="../../../../../main.js"></script><noscript><link rel="stylesheet" href="../../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module pages</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../../pages/index.html"><img class="rust-logo" src="../../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../../../../index.html">pages</a>::<wbr><a href="../../../index.html">ctx</a>::<wbr><a href="../../index.html">api</a>::<wbr><a href="../index.html">v1</a>::<wbr><a class="mod" href="#">pages</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../../src/pages/ctx/api/v1/pages.rs.html#17-80">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.AddSite.html" title="pages::ctx::api::v1::pages::AddSite struct">AddSite</a></div><div class="item-right docblock-short">Data required to add site</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../../../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `LEN` constant in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, LEN"><title>LEN in pages::subdomains - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In pages::subdomains</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../pages/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">pages</a>::<wbr><a href="index.html">subdomains</a>::<wbr><a class="constant" href="#">LEN</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/pages/subdomains.rs.html#19">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const LEN: <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.usize.html">usize</a> = 876;</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `LEN` constant in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, LEN"><title>LEN in pages::subdomains - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In pages::subdomains</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../pages/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">pages</a>::<wbr><a href="index.html">subdomains</a>::<wbr><a class="constant" href="#">LEN</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/pages/subdomains.rs.html#21">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const LEN: <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.usize.html">usize</a> = 876;</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>

View file

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `WORDLIST` constant in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, WORDLIST"><title>WORDLIST in pages::subdomains - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In pages::subdomains</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../pages/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">pages</a>::<wbr><a href="index.html">subdomains</a>::<wbr><a class="constant" href="#">WORDLIST</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/pages/subdomains.rs.html#20-897">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const WORDLIST: <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.array.html">[</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.array.html">; 876]</a>;</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `WORDLIST` constant in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, WORDLIST"><title>WORDLIST in pages::subdomains - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In pages::subdomains</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../pages/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">pages</a>::<wbr><a href="index.html">subdomains</a>::<wbr><a class="constant" href="#">WORDLIST</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/pages/subdomains.rs.html#22-899">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const WORDLIST: <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.array.html">[</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.array.html">; 876]</a>;</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>

View file

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_random_id` fn in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, get_random_id"><title>get_random_id in pages::subdomains - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In pages::subdomains</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../pages/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="../index.html">pages</a>::<wbr><a href="index.html">subdomains</a>::<wbr><a class="fn" href="#">get_random_id</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/pages/subdomains.rs.html#916-946">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>fn get_random_id() -&gt; <a class="struct" href="struct.ID.html" title="struct pages::subdomains::ID">ID</a>&lt;'static&gt;</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>

View file

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_random_subdomain` fn in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, get_random_subdomain"><title>get_random_subdomain in pages::subdomains - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In pages::subdomains</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../pages/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="../index.html">pages</a>::<wbr><a href="index.html">subdomains</a>::<wbr><a class="fn" href="#">get_random_subdomain</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/pages/subdomains.rs.html#899-925">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn get_random_subdomain() -&gt; <a class="struct" href="https://doc.rust-lang.org/1.65.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_random_subdomain` fn in crate `pages`."><meta name="keywords" content="rust, rustlang, rust-lang, get_random_subdomain"><title>get_random_subdomain in pages::subdomains - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../pages/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In pages::subdomains</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../pages/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="../index.html">pages</a>::<wbr><a href="index.html">subdomains</a>::<wbr><a class="fn" href="#">get_random_subdomain</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/pages/subdomains.rs.html#948-951">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn get_random_subdomain(s: &amp;<a class="struct" href="../settings/struct.Settings.html" title="struct pages::settings::Settings">Settings</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.65.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="pages" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
window.SIDEBAR_ITEMS = {"constant":[["LEN",""],["WORDLIST",""]],"fn":[["get_random_subdomain",""]]};
window.SIDEBAR_ITEMS = {"constant":[["LEN",""],["WORDLIST",""]],"fn":[["get_random_id",""],["get_random_subdomain",""]],"struct":[["ID",""]]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -76,6 +76,8 @@
<span id="76">76</span>
<span id="77">77</span>
<span id="78">78</span>
<span id="79">79</span>
<span id="80">80</span>
</pre><pre class="rust"><code><span class="comment">/*
* Copyright (C) 2022 Aravinth Manivannan &lt;realaravinth@batsense.net&gt;
*
@ -100,6 +102,8 @@
<span class="kw">use </span><span class="kw">crate</span>::db::Site;
<span class="kw">use </span><span class="kw">crate</span>::errors::<span class="kw-2">*</span>;
<span class="kw">use </span><span class="kw">crate</span>::page::Page;
<span class="kw">use </span><span class="kw">crate</span>::settings::Settings;
<span class="kw">use </span><span class="kw">crate</span>::subdomains::get_random_subdomain;
<span class="kw">use </span><span class="kw">crate</span>::utils::get_random;
<span class="attribute">#[derive(Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
@ -107,30 +111,30 @@
</span><span class="kw">pub struct </span>AddSite {
<span class="kw">pub </span>repo_url: String,
<span class="kw">pub </span>branch: String,
<span class="kw">pub </span>hostname: String,
<span class="kw">pub </span>owner: String,
}
<span class="kw">impl </span>AddSite {
<span class="kw">fn </span>to_site(<span class="self">self</span>) -&gt; Site {
<span class="kw">fn </span>to_site(<span class="self">self</span>, s: <span class="kw-2">&amp;</span>Settings) -&gt; Site {
<span class="kw">let </span>site_secret = get_random(<span class="number">32</span>);
<span class="kw">let </span>hostname = get_random_subdomain(s);
Site {
site_secret,
repo_url: <span class="self">self</span>.repo_url,
branch: <span class="self">self</span>.branch,
hostname: <span class="self">self</span>.hostname,
hostname,
owner: <span class="self">self</span>.owner,
}
}
}
<span class="kw">impl </span>Ctx {
<span class="kw">pub async fn </span>add_site(<span class="kw-2">&amp;</span><span class="self">self</span>, site: AddSite) -&gt; ServiceResult&lt;()&gt; {
<span class="kw">let </span>db_site = site.to_site();
<span class="kw">pub async fn </span>add_site(<span class="kw-2">&amp;</span><span class="self">self</span>, site: AddSite) -&gt; ServiceResult&lt;Page&gt; {
<span class="kw">let </span>db_site = site.to_site(<span class="kw-2">&amp;</span><span class="self">self</span>.settings);
<span class="self">self</span>.db.add_site(<span class="kw-2">&amp;</span>db_site).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>page = Page::from_site(<span class="kw-2">&amp;</span><span class="self">self</span>.settings, db_site);
page.update(<span class="kw-2">&amp;</span>page.branch)<span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
<span class="prelude-val">Ok</span>(page)
}
<span class="kw">pub async fn </span>update_site(<span class="kw-2">&amp;</span><span class="self">self</span>, secret: <span class="kw-2">&amp;</span>str, branch: <span class="prelude-ty">Option</span>&lt;String&gt;) -&gt; ServiceResult&lt;()&gt; {

View file

@ -180,11 +180,6 @@
<span id="180">180</span>
<span id="181">181</span>
<span id="182">182</span>
<span id="183">183</span>
<span id="184">184</span>
<span id="185">185</span>
<span id="186">186</span>
<span id="187">187</span>
</pre><pre class="rust"><code><span class="comment">/*
* Copyright (C) 2022 Aravinth Manivannan &lt;realaravinth@batsense.net&gt;
*
@ -304,14 +299,11 @@
<span class="kw">let </span>(_dir, ctx) = tests::get_ctx().<span class="kw">await</span>;
<span class="kw">let _ </span>= ctx.delete_user(NAME, PASSWORD).<span class="kw">await</span>;
<span class="kw">let </span>(<span class="kw">_</span>, _signin_resp) = ctx.register_and_signin(NAME, EMAIL, PASSWORD).<span class="kw">await</span>;
<span class="kw">let </span>hostname = ctx.get_test_hostname(NAME);
ctx.add_test_site(NAME.into(), hostname.clone()).<span class="kw">await</span>;
<span class="kw">let </span>page = ctx.add_test_site(NAME.into()).<span class="kw">await</span>;
<span class="kw">let </span>app = <span class="macro">get_app!</span>(ctx).<span class="kw">await</span>;
<span class="kw">let </span>page = ctx.db.get_site(NAME, <span class="kw-2">&amp;</span>hostname).<span class="kw">await</span>.unwrap();
<span class="kw">let </span><span class="kw-2">mut </span>payload = DeployEvent {
secret: page.site_secret.clone(),
secret: page.secret.clone(),
branch: page.branch.clone(),
};
@ -341,13 +333,11 @@
<span class="kw">let </span>(_dir, ctx) = tests::get_ctx().<span class="kw">await</span>;
<span class="kw">let _ </span>= ctx.delete_user(NAME, PASSWORD).<span class="kw">await</span>;
<span class="kw">let </span>(<span class="kw">_</span>, _signin_resp) = ctx.register_and_signin(NAME, EMAIL, PASSWORD).<span class="kw">await</span>;
<span class="kw">let </span>hostname = ctx.get_test_hostname(NAME);
ctx.add_test_site(NAME.into(), hostname.clone()).<span class="kw">await</span>;
<span class="kw">let </span>page = ctx.add_test_site(NAME.into()).<span class="kw">await</span>;
<span class="kw">let </span>app = <span class="macro">get_app!</span>(ctx).<span class="kw">await</span>;
<span class="kw">let </span>page = ctx.db.get_site(NAME, <span class="kw-2">&amp;</span>hostname).<span class="kw">await</span>.unwrap();
<span class="kw">let </span><span class="kw-2">mut </span>payload = DeploySecret {
secret: page.site_secret.clone(),
secret: page.secret.clone(),
};
<span class="kw">let </span>resp = test::call_service(
@ -360,7 +350,7 @@
<span class="kw">let </span>response: DeployInfo = actix_web::test::read_body_json(resp).<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(response.head, page.branch);
<span class="macro">assert_eq!</span>(response.remote, page.repo_url);
<span class="macro">assert_eq!</span>(response.remote, page.repo);
payload.secret = page.branch.clone();

View file

@ -141,7 +141,7 @@
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>&gt; Preview&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">pub fn </span>new(ctx: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>AppCtx) -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
base: <span class="kw-2">&amp;</span>ctx.settings.server.domain,
base: <span class="kw-2">&amp;</span>ctx.settings.page.base_domain,
delimiter: <span class="string">&quot;.&quot;</span>,
prefix: <span class="string">&quot;deploy-preview-&quot;</span>,
}

View file

@ -136,19 +136,17 @@
host = host.split(<span class="string">&#39;:&#39;</span>).next().unwrap();
}
<span class="kw">if </span>host == ctx.settings.server.domain || host == <span class="string">&quot;localhost&quot; </span>{
<span class="comment">// serve meta page
</span><span class="kw">if </span>host == ctx.settings.server.domain || host == <span class="string">&quot;localhost&quot; </span>{
<span class="kw">return </span><span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(ContentType::html())
.body(<span class="string">&quot;Welcome to Librepages!&quot;</span>));
}
<span class="kw">if </span>host.contains(<span class="kw-2">&amp;</span>ctx.settings.server.domain) {
<span class="comment">// serve default hostname content
</span><span class="kw">if </span>host.contains(<span class="kw-2">&amp;</span>ctx.settings.page.base_domain) {
<span class="kw">let </span>extractor = <span class="kw">crate</span>::preview::Preview::new(<span class="kw-2">&amp;</span>ctx);
<span class="kw">if let </span><span class="prelude-val">Some</span>(preview_branch) = extractor.extract(host) {
<span class="macro">unimplemented!</span>(
<span class="string">&quot;map a local subdomain on settings.server.domain and use it to fetch page&quot;
</span>);
<span class="kw">let </span>res = <span class="kw">if </span>ctx.db.hostname_exists(<span class="kw-2">&amp;</span>host).<span class="kw">await</span><span class="question-mark">? </span>{
<span class="kw">let </span>path = <span class="kw">crate</span>::utils::get_website_path(<span class="kw-2">&amp;</span>ctx.settings, <span class="kw-2">&amp;</span>host);
<span class="kw">let </span>content =
@ -165,10 +163,12 @@
} <span class="kw">else </span>{
<span class="prelude-val">Err</span>(ServiceError::WebsiteNotFound)
};
<span class="kw">return </span>res;
}
}
<span class="kw">if </span>ctx.db.hostname_exists(host).<span class="kw">await</span><span class="question-mark">? </span>{
<span class="comment">// TODO: custom domains.
</span><span class="kw">if </span>ctx.db.hostname_exists(host).<span class="kw">await</span><span class="question-mark">? </span>{
<span class="kw">let </span>path = <span class="kw">crate</span>::utils::get_website_path(<span class="kw-2">&amp;</span>ctx.settings, <span class="kw-2">&amp;</span>host);
<span class="kw">let </span>content = <span class="kw">crate</span>::git::read_file(<span class="kw-2">&amp;</span>path, req.uri().path())<span class="question-mark">?</span>;
<span class="kw">let </span>mime = <span class="kw">if let </span><span class="prelude-val">Some</span>(mime) = content.mime.first_raw() {

View file

@ -190,29 +190,6 @@
<span id="190">190</span>
<span id="191">191</span>
<span id="192">192</span>
<span id="193">193</span>
<span id="194">194</span>
<span id="195">195</span>
<span id="196">196</span>
<span id="197">197</span>
<span id="198">198</span>
<span id="199">199</span>
<span id="200">200</span>
<span id="201">201</span>
<span id="202">202</span>
<span id="203">203</span>
<span id="204">204</span>
<span id="205">205</span>
<span id="206">206</span>
<span id="207">207</span>
<span id="208">208</span>
<span id="209">209</span>
<span id="210">210</span>
<span id="211">211</span>
<span id="212">212</span>
<span id="213">213</span>
<span id="214">214</span>
<span id="215">215</span>
</pre><pre class="rust"><code><span class="comment">/*
* Copyright (C) 2022 Aravinth Manivannan &lt;realaravinth@batsense.net&gt;
*
@ -304,6 +281,7 @@
<span class="attribute">#[derive(Debug, Clone, Serialize, Deserialize)]
</span><span class="kw">pub struct </span>PageConfig {
<span class="kw">pub </span>base_path: String,
<span class="kw">pub </span>base_domain: String,
}
<span class="attribute">#[cfg(not(tarpaulin_include))]
@ -396,32 +374,8 @@
}
}
<span class="comment">// create_dir_util(Path::new(&amp;page.path));
</span>create_dir_util(Path::new(<span class="kw-2">&amp;</span><span class="self">self</span>.page.base_path));
<span class="comment">// for (index, page) in self.pages.iter().enumerate() {
// Url::parse(&amp;page.repo).unwrap();
//
// for (index2, page2) in self.pages.iter().enumerate() {
// if index2 == index {
// continue;
// }
// if page.secret == page2.secret {
// error!(&quot;{}&quot;, ServiceError::SecretTaken(page.clone(), page2.clone()));
// } else if page.repo == page2.repo {
// error!(
// &quot;{}&quot;,
// ServiceError::DuplicateRepositoryURL(page.clone(), page2.clone(),)
// );
// } else if page.path == page2.path {
// error!(&quot;{}&quot;, ServiceError::PathTaken(page.clone(), page2.clone()));
// }
// }
// if let Err(e) = page.update(&amp;page.branch) {
// error!(&quot;{e}&quot;);
// }
// }
</span>}
create_dir_util(Path::new(<span class="kw-2">&amp;</span><span class="self">self</span>.page.base_path));
}
<span class="attribute">#[cfg(not(tarpaulin_include))]
</span><span class="kw">fn </span>check_url(<span class="kw-2">&amp;</span><span class="self">self</span>) {

View file

@ -937,6 +937,39 @@
<span id="937">937</span>
<span id="938">938</span>
<span id="939">939</span>
<span id="940">940</span>
<span id="941">941</span>
<span id="942">942</span>
<span id="943">943</span>
<span id="944">944</span>
<span id="945">945</span>
<span id="946">946</span>
<span id="947">947</span>
<span id="948">948</span>
<span id="949">949</span>
<span id="950">950</span>
<span id="951">951</span>
<span id="952">952</span>
<span id="953">953</span>
<span id="954">954</span>
<span id="955">955</span>
<span id="956">956</span>
<span id="957">957</span>
<span id="958">958</span>
<span id="959">959</span>
<span id="960">960</span>
<span id="961">961</span>
<span id="962">962</span>
<span id="963">963</span>
<span id="964">964</span>
<span id="965">965</span>
<span id="966">966</span>
<span id="967">967</span>
<span id="968">968</span>
<span id="969">969</span>
<span id="970">970</span>
<span id="971">971</span>
<span id="972">972</span>
</pre><pre class="rust"><code><span class="comment">/*
* Copyright (C) 2022 Aravinth Manivannan &lt;realaravinth@batsense.net&gt;
*
@ -954,7 +987,9 @@
* along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.
*/
// source: https://www.randomlists.com/data/nouns.json
</span><span class="kw">use </span><span class="kw">crate</span>::settings::Settings;
<span class="comment">// source: https://www.randomlists.com/data/nouns.json
</span><span class="kw">const </span>LEN: usize = <span class="number">876</span>;
<span class="kw">const </span>WORDLIST: [<span class="kw-2">&amp;</span>str; LEN] = [
<span class="string">&quot;account&quot;</span>,
@ -1835,7 +1870,22 @@
<span class="string">&quot;zoo&quot;</span>,
];
<span class="kw">pub fn </span>get_random_subdomain() -&gt; String {
<span class="kw">struct </span>ID&lt;<span class="lifetime">&#39;a</span>&gt; {
first: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
second: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
third: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
}
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>&gt; ID&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">fn </span>hostname(<span class="kw-2">&amp;</span><span class="self">self</span>, base_domain: <span class="kw-2">&amp;</span>str) -&gt; String {
<span class="macro">format!</span>(
<span class="string">&quot;{}-{}-{}.{}&quot;</span>,
<span class="self">self</span>.first, <span class="self">self</span>.second, <span class="self">self</span>.third, base_domain
)
}
}
<span class="kw">fn </span>get_random_id() -&gt; ID&lt;<span class="lifetime">&#39;static</span>&gt; {
<span class="kw">use </span>rand::{rngs::ThreadRng, thread_rng, Rng};
<span class="kw">let </span><span class="kw-2">mut </span>rng: ThreadRng = thread_rng();
@ -1860,7 +1910,16 @@
<span class="kw">let </span>first = WORDLIST[first];
<span class="kw">let </span>second = WORDLIST[second];
<span class="kw">let </span>third = WORDLIST[third];
<span class="macro">format!</span>(<span class="string">&quot;{first}-{second}-{third}&quot;</span>)
ID {
first,
second,
third,
}
}
<span class="kw">pub fn </span>get_random_subdomain(s: <span class="kw-2">&amp;</span>Settings) -&gt; String {
<span class="kw">let </span>id = get_random_id();
id.hostname(<span class="kw-2">&amp;</span>s.page.base_domain)
}
<span class="attribute">#[cfg(test)]
@ -1868,12 +1927,19 @@
<span class="kw">use super</span>::<span class="kw-2">*</span>;
<span class="attribute">#[test]
</span><span class="kw">fn </span>test_get_random_subdomain() {
<span class="kw">let </span>sub = get_random_subdomain();
<span class="kw">let </span>splits: Vec&lt;<span class="kw-2">&amp;</span>str&gt; = sub.split(<span class="string">&#39;-&#39;</span>).collect();
<span class="macro">assert_ne!</span>(splits[<span class="number">0</span>], splits[<span class="number">1</span>]);
<span class="macro">assert_ne!</span>(splits[<span class="number">0</span>], splits[<span class="number">2</span>]);
<span class="macro">assert_ne!</span>(splits[<span class="number">1</span>], splits[<span class="number">2</span>]);
</span><span class="kw">fn </span>test_subdomains() {
<span class="comment">// test random ID
</span><span class="kw">let </span>id = get_random_id();
<span class="macro">assert_ne!</span>(id.first, id.second);
<span class="macro">assert_ne!</span>(id.first, id.third);
<span class="macro">assert_ne!</span>(id.third, id.second);
<span class="comment">// test ID::hostname
</span><span class="kw">let </span>delimiter = <span class="string">&quot;foobar21312&quot;</span>;
<span class="macro">assert_eq!</span>(
id.hostname(delimiter),
<span class="macro">format!</span>(<span class="string">&quot;{}-{}-{}.{delimiter}&quot;</span>, id.first, id.second, id.third,)
);
}
}
</code></pre></div>