repos
/ timestrap-django gh-pages

timestrap-django

mirror archived upstream

Time tracking you can host anywhere, built on Django. Full export support in multiple formats and easily extensible.

djangodockerhandcodedpythonself-hostedtime-trackingtimetracker

18.2 KB · 566 lines · HTML Raw History
  1
  2
  3
  4<!doctype html>
  5<html lang="en" class="no-js">
  6  <head>
  7    
  8      <meta charset="utf-8">
  9      <meta name="viewport" content="width=device-width,initial-scale=1">
 10      
 11        <meta name="description" content="Docs for the Timestrap project.">
 12      
 13      
 14        <link rel="canonical" href="https://timestrap.bythewood.me/configuration/">
 15      
 16      
 17        <meta name="author" content="Isaac Bythewood">
 18      
 19      <link rel="shortcut icon" href="../assets/images/favicon.png">
 20      <meta name="generator" content="mkdocs-1.2.4, mkdocs-material-5.4.0">
 21    
 22    
 23      
 24        <title>Configuration - Timestrap Docs</title>
 25      
 26    
 27    
 28      <link rel="stylesheet" href="../assets/stylesheets/main.fe0cca5b.min.css">
 29      
 30        <link rel="stylesheet" href="../assets/stylesheets/palette.a46bcfb3.min.css">
 31      
 32      
 33        
 34        
 35        <meta name="theme-color" content="#3f51b5">
 36      
 37    
 38    
 39    
 40      
 41        <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
 42        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
 43        <style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
 44      
 45    
 46    
 47    
 48    
 49      
 50    
 51    
 52  </head>
 53  
 54  
 55    
 56    
 57    
 58    <body dir="ltr" data-md-color-scheme="" data-md-color-primary="indigo" data-md-color-accent="indigo">
 59  
 60    
 61    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
 62    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
 63    <label class="md-overlay" for="__drawer"></label>
 64    <div data-md-component="skip">
 65      
 66        
 67        <a href="#configuration" class="md-skip">
 68          Skip to content
 69        </a>
 70      
 71    </div>
 72    <div data-md-component="announce">
 73      
 74    </div>
 75    
 76      <header class="md-header" data-md-component="header">
 77  <nav class="md-header-nav md-grid" aria-label="Header">
 78    <a href="https://timestrap.bythewood.me/" title="Timestrap Docs" class="md-header-nav__button md-logo" aria-label="Timestrap Docs">
 79      
 80  
 81  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
 82
 83    </a>
 84    <label class="md-header-nav__button md-icon" for="__drawer">
 85      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
 86    </label>
 87    <div class="md-header-nav__title" data-md-component="header-title">
 88      
 89        <div class="md-header-nav__ellipsis">
 90          <span class="md-header-nav__topic md-ellipsis">
 91            Timestrap Docs
 92          </span>
 93          <span class="md-header-nav__topic md-ellipsis">
 94            
 95              Configuration
 96            
 97          </span>
 98        </div>
 99      
100    </div>
101    
102      <label class="md-header-nav__button md-icon" for="__search">
103        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
104      </label>
105      
106<div class="md-search" data-md-component="search" role="dialog">
107  <label class="md-search__overlay" for="__search"></label>
108  <div class="md-search__inner" role="search">
109    <form class="md-search__form" name="search">
110      <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
111      <label class="md-search__icon md-icon" for="__search">
112        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
113        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
114      </label>
115      <button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
116        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
117      </button>
118    </form>
119    <div class="md-search__output">
120      <div class="md-search__scrollwrap" data-md-scrollfix>
121        <div class="md-search-result" data-md-component="search-result">
122          <div class="md-search-result__meta">
123            Initializing search
124          </div>
125          <ol class="md-search-result__list"></ol>
126        </div>
127      </div>
128    </div>
129  </div>
130</div>
131    
132    
133      <div class="md-header-nav__source">
134        
135<a href="https://github.com/overshard/timestrap/" title="Go to repository" class="md-source">
136  <div class="md-source__icon md-icon">
137    
138    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05L244 40.45a28.87 28.87 0 00-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 01-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 000 40.81l195.61 195.6a28.86 28.86 0 0040.8 0l194.69-194.69a28.86 28.86 0 000-40.81z"/></svg>
139  </div>
140  <div class="md-source__repository">
141    overshard/timestrap
142  </div>
143</a>
144      </div>
145    
146  </nav>
147</header>
148    
149    <div class="md-container" data-md-component="container">
150      
151        
152      
153      
154        
155      
156      <main class="md-main" data-md-component="main">
157        <div class="md-main__inner md-grid">
158          
159            
160              <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
161                <div class="md-sidebar__scrollwrap">
162                  <div class="md-sidebar__inner">
163                    <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
164  <label class="md-nav__title" for="__drawer">
165    <a href="https://timestrap.bythewood.me/" title="Timestrap Docs" class="md-nav__button md-logo" aria-label="Timestrap Docs">
166      
167  
168  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
169
170    </a>
171    Timestrap Docs
172  </label>
173  
174    <div class="md-nav__source">
175      
176<a href="https://github.com/overshard/timestrap/" title="Go to repository" class="md-source">
177  <div class="md-source__icon md-icon">
178    
179    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05L244 40.45a28.87 28.87 0 00-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 01-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 000 40.81l195.61 195.6a28.86 28.86 0 0040.8 0l194.69-194.69a28.86 28.86 0 000-40.81z"/></svg>
180  </div>
181  <div class="md-source__repository">
182    overshard/timestrap
183  </div>
184</a>
185    </div>
186  
187  <ul class="md-nav__list" data-md-scrollfix>
188    
189      
190      
191      
192
193
194  <li class="md-nav__item">
195    <a href=".." title="Home" class="md-nav__link">
196      Home
197    </a>
198  </li>
199
200    
201      
202      
203      
204
205
206  <li class="md-nav__item">
207    <a href="../screenshots/" title="Screenshots" class="md-nav__link">
208      Screenshots
209    </a>
210  </li>
211
212    
213      
214      
215      
216
217  
218
219
220  <li class="md-nav__item md-nav__item--active">
221    
222    <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
223    
224      
225    
226    
227      <label class="md-nav__link md-nav__link--active" for="__toc">
228        Configuration
229        <span class="md-nav__icon md-icon">
230          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>
231        </span>
232      </label>
233    
234    <a href="./" title="Configuration" class="md-nav__link md-nav__link--active">
235      Configuration
236    </a>
237    
238      
239<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
240  
241  
242    
243  
244  
245    <label class="md-nav__title" for="__toc">
246      <span class="md-nav__icon md-icon">
247        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
248      </span>
249      Table of contents
250    </label>
251    <ul class="md-nav__list" data-md-scrollfix>
252      
253        <li class="md-nav__item">
254  <a href="#security" class="md-nav__link">
255    Security
256  </a>
257  
258</li>
259      
260        <li class="md-nav__item">
261  <a href="#email" class="md-nav__link">
262    Email
263  </a>
264  
265    <nav class="md-nav" aria-label="Email">
266      <ul class="md-nav__list">
267        
268          <li class="md-nav__item">
269  <a href="#email-docker" class="md-nav__link">
270    Email Docker
271  </a>
272  
273</li>
274        
275      </ul>
276    </nav>
277  
278</li>
279      
280        <li class="md-nav__item">
281  <a href="#time-and-date-localization" class="md-nav__link">
282    Time and Date Localization
283  </a>
284  
285</li>
286      
287    </ul>
288  
289</nav>
290    
291  </li>
292
293    
294      
295      
296      
297
298
299  <li class="md-nav__item">
300    <a href="../permissions/" title="Permissions" class="md-nav__link">
301      Permissions
302    </a>
303  </li>
304
305    
306      
307      
308      
309
310
311  <li class="md-nav__item">
312    <a href="../sites/" title="Sites" class="md-nav__link">
313      Sites
314    </a>
315  </li>
316
317    
318      
319      
320      
321
322
323  <li class="md-nav__item">
324    <a href="../uses/" title="Uses" class="md-nav__link">
325      Uses
326    </a>
327  </li>
328
329    
330      
331      
332      
333
334
335  <li class="md-nav__item">
336    <a href="../docs/" title="Docs" class="md-nav__link">
337      Docs
338    </a>
339  </li>
340
341    
342      
343      
344      
345
346
347  <li class="md-nav__item">
348    <a href="../contributing/" title="Contributing" class="md-nav__link">
349      Contributing
350    </a>
351  </li>
352
353    
354      
355      
356      
357
358
359  <li class="md-nav__item">
360    <a href="../license/" title="License" class="md-nav__link">
361      License
362    </a>
363  </li>
364
365    
366  </ul>
367</nav>
368                  </div>
369                </div>
370              </div>
371            
372            
373              <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
374                <div class="md-sidebar__scrollwrap">
375                  <div class="md-sidebar__inner">
376                    
377<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
378  
379  
380    
381  
382  
383    <label class="md-nav__title" for="__toc">
384      <span class="md-nav__icon md-icon">
385        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
386      </span>
387      Table of contents
388    </label>
389    <ul class="md-nav__list" data-md-scrollfix>
390      
391        <li class="md-nav__item">
392  <a href="#security" class="md-nav__link">
393    Security
394  </a>
395  
396</li>
397      
398        <li class="md-nav__item">
399  <a href="#email" class="md-nav__link">
400    Email
401  </a>
402  
403    <nav class="md-nav" aria-label="Email">
404      <ul class="md-nav__list">
405        
406          <li class="md-nav__item">
407  <a href="#email-docker" class="md-nav__link">
408    Email Docker
409  </a>
410  
411</li>
412        
413      </ul>
414    </nav>
415  
416</li>
417      
418        <li class="md-nav__item">
419  <a href="#time-and-date-localization" class="md-nav__link">
420    Time and Date Localization
421  </a>
422  
423</li>
424      
425    </ul>
426  
427</nav>
428                  </div>
429                </div>
430              </div>
431            
432          
433          <div class="md-content">
434            <article class="md-content__inner md-typeset">
435              
436                
437                  <a href="https://github.com/overshard/timestrap/edit/master/docs/src/configuration.md" title="Edit this page" class="md-content__button md-icon">
438                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
439                  </a>
440                
441                
442                  
443                
444                
445                <h1 id="configuration">Configuration<a class="headerlink" href="#configuration" title="Permanent link">&para;</a></h1>
446<h2 id="security">Security<a class="headerlink" href="#security" title="Permanent link">&para;</a></h2>
447<p>By default we don't enable TLS/SSL features since this project is often run on
448an intranet, locally, or in testing environments. If security is a concern of
449yours, and it should be, you will need to enable TLS/SSL on your reverse proxy
450and setup a certificate there. For an easy TLS enabled reverse proxy check out
451Caddy.</p>
452<p>You will need to configure two settings when you use TLS/SSL on this project.
453The first is to force TLS/SSL when people visit your site and the second is to
454make sure that Django REST framework returns corrected URLs behind a reverse
455proxy. These can be added to <code>timestrap/settings/base.py</code> anywhere:</p>
456<div class="codehilite"><pre><span></span><code>SECURE_SSL_REDIRECT = True
457SECURE_PROXY_SSL_HEADER = (&#39;HTTP_X_FORWARDED_PROTO&#39;, &#39;https&#39;)
458</code></pre></div>
459
460<h2 id="email">Email<a class="headerlink" href="#email" title="Permanent link">&para;</a></h2>
461<p>Email configuration options are available from the Timestrap admin on a
462per-site basis. These settings must be supplied to support features such as
463password reset. To access the settings, navigate to <code>/admin/sites/site/</code> and
464select the site to modify.</p>
465<h3 id="email-docker">Email Docker<a class="headerlink" href="#email-docker" title="Permanent link">&para;</a></h3>
466<p>You can configure email by setting environmental variables in the
467<code>docker-compose</code> config for <code>web</code>. These would be:</p>
468<ul>
469<li><strong>EMAIL_HOST</strong></li>
470<li><strong>EMAIL_HOST_USER</strong></li>
471<li><strong>EMAIL_HOST_PASSWORD</strong></li>
472<li><strong>EMAIL_PORT</strong> defaults to port <code>25</code></li>
473<li><strong>EMAIL_USE_TLS</strong> defaults to <code>False</code>, you can set this to <code>True</code></li>
474</ul>
475<p>These would go where the <code>SECRET_KEY</code> environmental variable is set</p>
476<h2 id="time-and-date-localization">Time and Date Localization<a class="headerlink" href="#time-and-date-localization" title="Permanent link">&para;</a></h2>
477<p>Language and timezone settings are available on a per-site basis in the site
478configuration area (<code>/admin/sites/site/</code>). Timestrap uses <a href="http://momentjs.com/">Moment.js</a>
479on the frontend so localization will be applied to all dates based on these
480settings. We'd like to eventually have localization of everything.</p>
481                
482              
483              
484                
485
486
487              
488            </article>
489          </div>
490        </div>
491      </main>
492      
493        
494<footer class="md-footer">
495  
496    <div class="md-footer-nav">
497      <nav class="md-footer-nav__inner md-grid" aria-label="Footer">
498        
499          <a href="../screenshots/" title="Screenshots" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
500            <div class="md-footer-nav__button md-icon">
501              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
502            </div>
503            <div class="md-footer-nav__title">
504              <div class="md-ellipsis">
505                <span class="md-footer-nav__direction">
506                  Previous
507                </span>
508                Screenshots
509              </div>
510            </div>
511          </a>
512        
513        
514          <a href="../permissions/" title="Permissions" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
515            <div class="md-footer-nav__title">
516              <div class="md-ellipsis">
517                <span class="md-footer-nav__direction">
518                  Next
519                </span>
520                Permissions
521              </div>
522            </div>
523            <div class="md-footer-nav__button md-icon">
524              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
525            </div>
526          </a>
527        
528      </nav>
529    </div>
530  
531  <div class="md-footer-meta md-typeset">
532    <div class="md-footer-meta__inner md-grid">
533      <div class="md-footer-copyright">
534        
535          <div class="md-footer-copyright__highlight">
536            Copyright &copy; 2019 Isaac Bythewood
537          </div>
538        
539        Made with
540        <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
541          Material for MkDocs
542        </a>
543      </div>
544      
545    </div>
546  </div>
547</footer>
548      
549    </div>
550    
551      <script src="../assets/javascripts/vendor.d710d30a.min.js"></script>
552      <script src="../assets/javascripts/bundle.b39636ac.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents"}</script>
553      
554      <script>
555        app = initialize({
556          base: "..",
557          features: [],
558          search: Object.assign({
559            worker: "../assets/javascripts/worker/search.a68abb33.min.js"
560          }, typeof search !== "undefined" && search)
561        })
562      </script>
563      
564    
565  </body>
566</html>