254 lines
17 KiB
HTML
254 lines
17 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang="en" class="sidebar-visible no-js light">
|
|
<head>
|
|
<!-- Book generated using mdBook -->
|
|
<meta charset="UTF-8">
|
|
<title>Introduction - Doc Server</title>
|
|
<base href="/docserver/">
|
|
|
|
|
|
<!-- Custom HTML head -->
|
|
|
|
<meta name="description" content="Doc Server">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="theme-color" content="#ffffff" />
|
|
|
|
<link rel="icon" href="/docserver/favicon.svg">
|
|
<link rel="shortcut icon" href="/docserver/favicon.png">
|
|
<link rel="stylesheet" href="/docserver/css/variables.css">
|
|
<link rel="stylesheet" href="/docserver/css/general.css">
|
|
<link rel="stylesheet" href="/docserver/css/chrome.css">
|
|
<link rel="stylesheet" href="/docserver/css/print.css" media="print">
|
|
|
|
<!-- Fonts -->
|
|
<link rel="stylesheet" href="/docserver/FontAwesome/css/font-awesome.css">
|
|
<link rel="stylesheet" href="/docserver/fonts/fonts.css">
|
|
|
|
<!-- Highlight.js Stylesheets -->
|
|
<link rel="stylesheet" href="/docserver/highlight.css">
|
|
<link rel="stylesheet" href="/docserver/tomorrow-night.css">
|
|
<link rel="stylesheet" href="/docserver/ayu-highlight.css">
|
|
|
|
<!-- Custom theme stylesheets -->
|
|
<link rel="stylesheet" href="/docserver/assets/css/custom.css">
|
|
<link rel="stylesheet" href="/docserver/assets/css/mdbook-admonish.css">
|
|
|
|
</head>
|
|
<body>
|
|
<div id="body-container">
|
|
<!-- Provide site root to javascript -->
|
|
<script>
|
|
var path_to_root = "/docserver/";
|
|
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
|
|
</script>
|
|
|
|
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
|
<script>
|
|
try {
|
|
var theme = localStorage.getItem('mdbook-theme');
|
|
var sidebar = localStorage.getItem('mdbook-sidebar');
|
|
|
|
if (theme.startsWith('"') && theme.endsWith('"')) {
|
|
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
|
}
|
|
|
|
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
|
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
|
}
|
|
} catch (e) { }
|
|
</script>
|
|
|
|
<!-- Set the theme before any content is loaded, prevents flash -->
|
|
<script>
|
|
var theme;
|
|
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
|
if (theme === null || theme === undefined) { theme = default_theme; }
|
|
var html = document.querySelector('html');
|
|
html.classList.remove('no-js')
|
|
html.classList.remove('light')
|
|
html.classList.add(theme);
|
|
html.classList.add('js');
|
|
</script>
|
|
|
|
<!-- Hide / unhide sidebar before it is displayed -->
|
|
<script>
|
|
var html = document.querySelector('html');
|
|
var sidebar = null;
|
|
if (document.body.clientWidth >= 1080) {
|
|
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
|
sidebar = sidebar || 'visible';
|
|
} else {
|
|
sidebar = 'hidden';
|
|
}
|
|
html.classList.remove('sidebar-visible');
|
|
html.classList.add("sidebar-" + sidebar);
|
|
</script>
|
|
|
|
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
|
<div class="sidebar-scrollbox">
|
|
<ol class="chapter"><li class="chapter-item expanded "><a href="/docserver/introduction.html" class="active"><strong aria-hidden="true">1.</strong> Introduction</a></li><li class="chapter-item "><a href="/docserver/index.html"><strong aria-hidden="true">2.</strong> What is this ?</a></li><li class="chapter-item "><a href="/docserver/features.html"><strong aria-hidden="true">3.</strong> Features</a></li><li class="chapter-item "><a href="/docserver/howto.html"><strong aria-hidden="true">4.</strong> How to</a></li><li class="chapter-item "><a href="/docserver/quick-start.html"><strong aria-hidden="true">5.</strong> Quick Start</a></li><li class="spacer"></li><li class="chapter-item affix "><li class="part-title">Server and Content</li><li class="chapter-item "><a href="/docserver/one_server.html"><strong aria-hidden="true">6.</strong> One web server instance</a></li><li class="chapter-item "><a href="/docserver/server_modes.html"><strong aria-hidden="true">7.</strong> Server modes</a></li><li class="chapter-item "><a href="/docserver/static_content.html"><strong aria-hidden="true">8.</strong> Static contents</a></li><li class="chapter-item "><a href="/docserver/url_path.html"><strong aria-hidden="true">9.</strong> url_path prefix</a></li><li class="chapter-item "><a href="/docserver/protect_access.html"><strong aria-hidden="true">10.</strong> Protect access</a></li><li class="chapter-item affix "><li class="part-title">Users and Policies</li><li class="chapter-item "><a href="/docserver/users.html"><strong aria-hidden="true">11.</strong> Users</a></li><li class="chapter-item "><a href="/docserver/users_sql.html"><strong aria-hidden="true">12.</strong> SQL storage</a></li><li class="chapter-item "><a href="/docserver/users_file_storage.html"><strong aria-hidden="true">13.</strong> File storage</a></li><li class="chapter-item "><a href="/docserver/roles.html"><strong aria-hidden="true">14.</strong> Roles</a></li><li class="chapter-item "><a href="/docserver/auths.html"><strong aria-hidden="true">15.</strong> Users auths</a></li><li class="chapter-item "><a href="/docserver/policies.html"><strong aria-hidden="true">16.</strong> Access policies</a></li><li class="chapter-item "><a href="/docserver/adminusers.html"><strong aria-hidden="true">17.</strong> Users Admin</a></li><li class="chapter-item affix "><li class="part-title">Sessions</li><li class="chapter-item "><a href="/docserver/sessions.html"><strong aria-hidden="true">18.</strong> Session data</a></li><li class="chapter-item "><a href="/docserver/pasetoken.html"><strong aria-hidden="true">19.</strong> Pasetoken</a></li><li class="chapter-item "><a href="/docserver/sessions_sql.html"><strong aria-hidden="true">20.</strong> SQL storage</a></li><li class="chapter-item "><a href="/docserver/sessions_file_storage.html"><strong aria-hidden="true">21.</strong> File storage</a></li><li class="chapter-item "><a href="/docserver/cookie.html"><strong aria-hidden="true">22.</strong> Cookie set</a></li><li class="chapter-item affix "><li class="part-title">Logs and Trace</li><li class="chapter-item "><a href="/docserver/trace.html"><strong aria-hidden="true">23.</strong> Traced</a></li><li class="chapter-item "><a href="/docserver/logs.html"><strong aria-hidden="true">24.</strong> Sessions logs</a></li><li class="chapter-item affix "><li class="part-title">Configuration</li><li class="chapter-item "><a href="/docserver/configuration.html"><strong aria-hidden="true">25.</strong> Configurable service</a></li><li class="chapter-item "><a href="/docserver/settings.html"><strong aria-hidden="true">26.</strong> Config settings</a></li><li class="spacer"></li></ol>
|
|
</div>
|
|
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
|
|
</nav>
|
|
|
|
<div id="page-wrapper" class="page-wrapper">
|
|
|
|
<div class="page">
|
|
<div id="menu-bar-hover-placeholder"></div>
|
|
<div id="menu-bar" class="menu-bar sticky bordered">
|
|
<div class="left-buttons">
|
|
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
|
<i class="fa fa-bars"></i>
|
|
</button>
|
|
<button id="sidebar-toggle" onclick="location.href='/'" class="icon-button" type="button" title="Home" aria-label="Home" aria-controls="">
|
|
<i class="fa fa-home"></i>
|
|
</button>
|
|
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
|
<i class="fa fa-paint-brush"></i>
|
|
</button>
|
|
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
|
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
|
</ul>
|
|
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
|
<i class="fa fa-search"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<h1 class="menu-title">Doc Server</h1>
|
|
|
|
<div class="right-buttons">
|
|
<a href="/docserver/print.html" title="Print this book" aria-label="Print this book">
|
|
<i id="print-button" class="fa fa-print"></i>
|
|
</a>
|
|
<a href="/logout" title="Sing out" aria-label="Sign out">
|
|
<i id="logout-button" class="fa fa-sign-out"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="search-wrapper" class="hidden">
|
|
<form id="searchbar-outer" class="searchbar-outer">
|
|
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
|
</form>
|
|
<div id="searchresults-outer" class="searchresults-outer hidden">
|
|
<div id="searchresults-header" class="searchresults-header"></div>
|
|
<ul id="searchresults">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
|
<script>
|
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|
});
|
|
</script>
|
|
|
|
<div id="content" class="content">
|
|
<main>
|
|
<p><a href="/docserver/">Doc Server</a> is a <strong>Web Server</strong> in <a href="https://www.rust-lang.org">Rust</a> for <a href="/docserver/static_content.html">static content</a>
|
|
with <strong>Control access</strong> via <a href="/docserver/auths.html">authorizations</a>, fully customizable with <a href="/docserver/settings.html">settings</a>.</p>
|
|
<p><svg style="display:none"><symbol id="symbl-check" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path></symbol></svg></p>
|
|
<div class="box"><img src="images/docserver.svg" class="logo" /></div>
|
|
<p><a href="README.html">DocServer</a> is created to:</p>
|
|
<ul>
|
|
<li>
|
|
<p>Serve several <a href="static_content.html">static contents</a> paths from <a href="one_server.html">one web server instance</a> at once. Server is based in <a href="https://www.rust-lang.org">Rust</a> <a href="https://github.com/tokio-rs/axum">Axum</a> crate under <a href="https://github.com/tokio-rs/tokio">Tokio</a>, with a lot of <a href="configuration.html">config settings</a> to customize in a config <a href="https://en.wikipedia.org/wiki/TOML">TOML</a> file: SSL, Paths, Menus, Keys, Contents, Roles, etc.</p>
|
|
</li>
|
|
<li>
|
|
<p>Use <a href="static_content.html">static contents</a> from <a href="https://rust-lang.github.io/mdBook/">mdbooks</a> with <a href="https://github.com/JesusPerez/mdBook">fixed absolute links via site-url</a> or <a href="https://doc.rust-lang.org/rust-by-example/meta/doc.html">code docs</a> from <a href="https://doc.rust-lang.org/cargo/commands/cargo-doc.html">Cargo doc</a>.</p>
|
|
</li>
|
|
<li>
|
|
<p><a href="protect_access.html">Protect access</a> to <a href="static_content.html">static contents</a> with <a href="auths.html">users authentication and authorizations</a> by <a href="url_path.html">url_path prefix</a>, <a href="roles.html">roles</a> or <a href="users.html">users</a> login names or emails.</p>
|
|
</li>
|
|
<li>
|
|
<p>Define <a href="policies.html">access policies</a> to <strong>enfoce</strong> for content access with <a href="https://github.com/casbin/casbin-rs">Casbin</a></p>
|
|
</li>
|
|
<li>
|
|
<p>Handle <a href="users.html">user</a> defininition: Create/Invite, SignIn/SignOut, Settings, Roles, Administration. Several users modes can be set via <a href="settings.html">config settings</a>.</p>
|
|
<ul>
|
|
<li>
|
|
<p>For <a href="users.html">user</a> authentication use Argon2 for password and <a href="https://en.wikipedia.org/wiki/Time-based_one-time_password">TOPT</a> as <a href="https://en.wikipedia.org/wiki/Multi-factor_authentication">2FA</a> with optional mail service for notifications</p>
|
|
</li>
|
|
<li>
|
|
<p><a href="sessions.html">Sessions</a> are stored in async <a href="https://github.com/launchbadge/sqlx">sqlx</a> to <a href="sqlite.html">Sqlite</a> or <a href="file_storage.html">File</a> storages and keys handled via <a href="cookie.html">cookie set</a>, for larger use <a href="https://github.com/launchbadge/sqlx">sqlx</a> as <u>Database Agnostic provides other <a href="https://en.wikipedia.org/wiki/SQL">SQL</a> options</p>
|
|
</li>
|
|
<li>
|
|
<p><a href="sessions.html">Session data</a> is saved as a <a href="pasetoken.html">Pasetoken</a> with asymmetric encripted data without passwords or <a href="https://en.wikipedia.org/wiki/Time-based_one-time_password">TOPT</a> codes.</p>
|
|
</li>
|
|
<li>
|
|
<p>Some requests responses are created by a <a href="https://github.com/Keats/tera">template engine</a>, so can be customized to some use cases.</p>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p>Optionally request can be <a href="trace.html">traced</a> in <a href="logs.html">sessions logs</a></p>
|
|
</li>
|
|
</ul>
|
|
<div id="admonition-main-purpose" class="admonition note">
|
|
<div class="admonition-title">
|
|
<p>Main purpose</p>
|
|
<p><a class="admonition-anchor-link" href="#admonition-main-purpose"></a></p>
|
|
</div>
|
|
<div>
|
|
<p><strong>Control access</strong> to <a href="static_content.html">static contents</a> paths from <a href="one_server.html">one web server instance</a> </p>
|
|
<p>Tested with <a href="https://rust-lang.github.io/mdBook/">mdbooks</a> with <a href="https://github.com/JesusPerez/mdBook">fixed absolute links via site-url</a> or <a href="https://doc.rust-lang.org/rust-by-example/meta/doc.html">code docs</a></p>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<nav class="nav-wrapper" aria-label="Page navigation">
|
|
<!-- Mobile navigation buttons -->
|
|
|
|
<a rel="next" href="index.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
<div style="clear: both"></div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
|
|
|
<a rel="next" href="index.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
window.playground_copyable = true;
|
|
</script>
|
|
|
|
<script src="/docserver/ace.js"></script>
|
|
<script src="/docserver/editor.js"></script>
|
|
<script src="/docserver/mode-rust.js"></script>
|
|
<script src="/docserver/theme-dawn.js"></script>
|
|
<script src="/docserver/theme-tomorrow_night.js"></script>
|
|
|
|
<script src="/docserver/elasticlunr.min.js"></script>
|
|
<script src="/docserver/mark.min.js"></script>
|
|
<script src="/docserver/searcher.js"></script>
|
|
|
|
<script src="/docserver/clipboard.min.js"></script>
|
|
<script src="/docserver/highlight.js"></script>
|
|
<script src="/docserver/book.js"></script>
|
|
|
|
<!-- Custom JS scripts -->
|
|
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|