360 lines
		
	
	
		
			18 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			360 lines
		
	
	
		
			18 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE HTML>
 | ||
| <html lang="en" class="sidebar-visible no-js light">
 | ||
|     <head>
 | ||
|         <!-- Book generated using mdBook -->
 | ||
|         <meta charset="UTF-8">
 | ||
|         <title>Config settings - 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 "><a href="/docserver/introduction.html"><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 expanded "><a href="/docserver/settings.html" class="active"><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>
 | ||
|                         <h1 id="config-settings"><a class="header" href="#config-settings">Config settings</a></h1>
 | ||
| <p>This is an example of <a href="/connfiguration.html">configuration file</a></p>
 | ||
| <p>Most of settings have default values to “/”  for paths or “” for text or false for boolean, if are not set properly <a href="/docserver/">Doc Server</a> config loadd will dispplay ain error an will not abort running.</p>
 | ||
| <p>Attributes order does not matter, in case of file path attributes relative path (the ones ending with path“) is tried and finally <strong>root_path</strong> valued as root path for values. Pay attention to <strong>cert</strong> and <strong>key</strong> paths</p>
 | ||
| <p>Base layout for example below as <strong>config.toml</strong>:</p>
 | ||
| <pre><code class="language-text">── Cargo.lock
 | ||
| ├── Cargo.toml
 | ||
| ├── certs 
 | ||
| │   ├── fullchain.pem
 | ||
| │   └── privkey.pem
 | ||
| ├── config.toml
 | ||
| ├── data
 | ||
| │   ├── users.db
 | ||
| │   └── sessions.db
 | ||
| ├── mdbook
 | ||
| ├── migrations
 | ||
| │   ├── users.sql
 | ||
| │   └── view.sql
 | ||
| ├── sitehome
 | ||
| │   ├── assets
 | ||
| │   ├── appdoc
 | ||
| │   ├── html
 | ||
| │   └── templates
 | ||
| ├── src
 | ||
| ├── paseto
 | ||
| │   ├── public.ky
 | ||
| │   └── secret.ky
 | ||
| └── tools
 | ||
|     └── get_mail_token.sh
 | ||
| </code></pre>
 | ||
| <pre><code class="language-toml">root_path = "sitehome"
 | ||
| name = "docserver"
 | ||
| org = "ORG"
 | ||
| verbose = 2
 | ||
| home_path = ""
 | ||
| prefix = ""
 | ||
| resources_path = "resources"
 | ||
| 
 | ||
| # Certs for SSL 
 | ||
| cert_file = "certs/fullchain.pem"
 | ||
| key_file = "certs/privkey.pem"
 | ||
| 
 | ||
| templates_path = "templates"
 | ||
| defaults_path = "resources/defaults"
 | ||
| 
 | ||
| html_url = "/html"
 | ||
| assets_url = "/assets"
 | ||
| 
 | ||
| allow_origin = ["http://localhost:8080"]
 | ||
| 
 | ||
| # HOST ip or name for Web service
 | ||
| hostport = "docs.example.com:8800"
 | ||
| bnd = "0.0.0.0"
 | ||
| 
 | ||
| # PORT for Web service
 | ||
| port = 8800
 | ||
| protocol = "http"
 | ||
| 
 | ||
| # Availables Langs
 | ||
| langs = ["en","es"]
 | ||
| dflt_lang = "en"
 | ||
| 
 | ||
| ## How to signup by 'invitation' or 'open'
 | ||
| signup_mode = "open"
 | ||
| invite_expire = 900 # in seconds
 | ||
| 
 | ||
| # topt Mode: mandatory, optional, no (default)  
 | ||
| totp_mode = "no"
 | ||
| # totp Digits: 6 (default) or 8 
 | ||
| totp_digits = 6
 | ||
| # topt Algorithm: sha1 (default), sha256, sha512
 | ||
| totp_algorithm = "sha256"
 | ||
| 
 | ||
| password_score = 3
 | ||
| admin_fields = "roles,otp_base32,status"
 | ||
| 
 | ||
| use_mail = false
 | ||
| smtp = "mail.example.com"
 | ||
| smtp_auth = "v4.public..."
 | ||
| mail_from ="admini@example.com"
 | ||
| 
 | ||
| #users_store_uri = "file:///data/users"
 | ||
| users_store_uri = "sqlite:data/users.db"
 | ||
| user_store_access = "access"
 | ||
| authz_model_path = "srvc/model.conf"
 | ||
| authz_policy_path = "srvc/policy.csv"
 | ||
| #session_store_uri = "file:///data/sessions"
 | ||
| session_store_uri = "sqlite:data/sessions.db"
 | ||
| session_store_file = "session"
 | ||
| session_expire = 300
 | ||
| 
 | ||
| [tpls]
 | ||
|   url = "http://docs.example.com/"
 | ||
|   main = "home.html.j2"
 | ||
|   info = "info.html.j2"
 | ||
|   help = "help.html.j2"
 | ||
|   notfound = "notfound.html.j2"
 | ||
|   notauth = "notauth.html.j2"
 | ||
|   login = "login.html.j2"
 | ||
|   logout = "logout.html.j2"
 | ||
|   signup = "signup.html.j2"
 | ||
|   user_settings = "user_settings.html.j2"
 | ||
|   invite_create = "invite_create.html.j2"
 | ||
|   invite_output = "invite_output.html.j2"
 | ||
|   invite_mail_html = "invite_mail.html.j2"
 | ||
|   invite_maili_txt = "invite_mail.txt.j2"
 | ||
|   users = "users.html.j2"
 | ||
|   trylater = "trylater.j2"
 | ||
|   session  = "session.j2"
 | ||
|   js = "js"
 | ||
|   css = ""
 | ||
| 
 | ||
| [paseto] 
 | ||
|   public_path = "paseto/public.ky"
 | ||
|   secret_path = "paseto/secret.ky"
 | ||
|   is_bin = false
 | ||
|   assert_val = ""
 | ||
|   expire = true
 | ||
| [paseto.map_footer]
 | ||
| [paseto.data]
 | ||
| 
 | ||
| [ui]
 | ||
| css_link = "https://cdn.jsdelivr.net/npm/@unocss/reset/tailwind.min.css"
 | ||
| js_link = "https://cdn.jsdelivr.net/npm/@unocss/runtime"
 | ||
| main_js_link = "/assets/js/main.js"
 | ||
| utils_js_link = "/assets/js/utils.js"
 | ||
| other_css_link = "https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.5/flowbite.min.css"
 | ||
| other_js_link="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.5/flowbite.min.js"
 | ||
| 
 | ||
| [[ui.web_menu_items]]
 | ||
| # ~home text part will be removed, it is to indicate it is a home link
 | ||
| text = "~home"
 | ||
| url = "/"
 | ||
| roles = []
 | ||
| 
 | ||
| [[ui.web_menu_items]]
 | ||
| text = "AppDoc"
 | ||
| url = "/appdoc"
 | ||
| roles = ["dev"]
 | ||
| 
 | ||
| [[ui.web_menu_items]]
 | ||
| text = "Users"
 | ||
| url = "/users"
 | ||
| roles = ["admin"]
 | ||
| 
 | ||
| [[serv_paths]]
 | ||
| src_path = "appdoc"
 | ||
| url_path = "/appdoc"
 | ||
| not_found = ""
 | ||
| roles = "dev"
 | ||
| redirect_to = "/login"
 | ||
| not_auth = "/login"
 | ||
| is_restricted = true
 | ||
| </code></pre>
 | ||
| 
 | ||
|                     </main>
 | ||
| 
 | ||
|                     <nav class="nav-wrapper" aria-label="Page navigation">
 | ||
|                         <!-- Mobile navigation buttons -->
 | ||
|                             <a rel="prev" href="configuration.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
 | ||
|                                 <i class="fa fa-angle-left"></i>
 | ||
|                             </a>
 | ||
| 
 | ||
| 
 | ||
|                         <div style="clear: both"></div>
 | ||
|                     </nav>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
| 
 | ||
|             <nav class="nav-wide-wrapper" aria-label="Page navigation">
 | ||
|                     <a rel="prev" href="configuration.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
 | ||
|                         <i class="fa fa-angle-left"></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>
 | 
