Compare commits

...

8 Commits

Author SHA1 Message Date
bel cbba8fa7e4 meta header fixes high res devices 2024-01-21 13:57:22 -07:00
bel 072e4b279d embed water.css 2024-01-21 13:57:09 -07:00
Bel LaPointe 0a700f19c8 set /raw/ to cache 2024-01-09 15:04:51 -07:00
Bel LaPointe 5b645b1898 to gitea 2024-01-09 14:45:36 -07:00
Bel LaPointe a4d39d38dc gogs.inhome 2023-04-10 11:14:06 -06:00
Bel LaPointe 6a82a7d90c wip 2023-04-10 11:09:40 -06:00
bel b495652eb9 up go mod 2022-06-26 21:56:50 -06:00
bel 706b78257a submod 2022-06-26 21:27:04 -06:00
44 changed files with 344 additions and 183 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
#! /usr/local/bin/python3
#! /usr/gitea.inhome.blapointe.com/local/bin/python3
def main(args) :
print("args", args)

251
config/water.css.txt Normal file
View File

@ -0,0 +1,251 @@
body{
font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.4;max-width:800px;margin:20px auto;padding:0 10px;word-wrap:break-word;color:#dbdbdb;background:#421531;text-rendering:optimizeLegibility
}.button,button,input,textarea{
transition:background-color .1s linear,border-color .1s linear,color .1s linear,box-shadow .1s linear,transform .1s ease
}h1{
font-size:2.2em;margin-top:0
}h1,h2,h3,h4,h5,h6{
margin-bottom:12px
}h1,h2,h3,h4,h5,h6,strong{
color:#fff
}b,h1,h2,h3,h4,h5,h6,strong,th{
font-weight:600
}q:after,q:before{
content:none
}blockquote,q{
border-left:4px solid #adb4a0;margin:1.5em 0;padding:.5em 1em;font-style:italic
}blockquote>footer{
font-style:normal;border:0
}address,blockquote cite{
font-style:normal
}a[href^=mailto\:]:before{
content:"📧 "
}a[href^=tel\:]:before{
content:"📞 "
}a[href^=sms\:]:before{
content:"💬 "
}mark{
background-color:#8fae83;border-radius:2px;padding:0 2px;color:#000
}.button,button,input[type=button],input[type=checkbox],input[type=radio],input[type=range],input[type=submit],select{
cursor:pointer
}input:not([type=checkbox]):not([type=radio]),select{
display:block
}.button,button,input,select,textarea{
color:#fff;background-color:#300330;font-family:inherit;font-size:inherit;margin-right:6px;margin-bottom:6px;padding:10px;border:none;border-radius:6px;outline:none
}.button,button,input,select,textarea{
-webkit-appearance:none
}textarea{
margin-right:0;width:100%;box-sizing:border-box;resize:vertical
}select{
background:#300330 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='63' width='117' fill='%23efefef'%3E%3Cpath d='M115 2c-1-2-4-2-5 0L59 53 7 2a4 4 0 0 0-5 5l54 54 2 2 3-2 54-54c2-1 2-4 0-5z'/%3E%3C/svg%3E") calc(100% - 12px) 50%/12px no-repeat;padding-right:35px
}select::-ms-expand{
display:none
}select[multiple]{
padding-right:10px;background-image:none;overflow-y:auto
}.button,button,input[type=button],input[type=submit]{
padding-right:30px;padding-left:30px
}.button:hover,button:hover,input[type=button]:hover,input[type=submit]:hover{
background:#55354c
}.button:focus,button:focus,input:focus,select:focus,textarea:focus{
box-shadow:0 0 0 2px #adb4a0
}input[type=checkbox],input[type=radio]{
position:relative;width:14px;height:14px;display:inline-block;vertical-align:middle;margin:0 2px 0 0
}input[type=radio]{
border-radius:50%
}input[type=checkbox]:checked,input[type=radio]:checked{
background:#55354c
}input[type=checkbox]:checked:before,input[type=radio]:checked:before{
content:"•";display:block;position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(-50%)
}input[type=checkbox]:checked:before{
content:"✔";transform:translateY(-50%) translateY(.5px) translateX(-6px)
}.button:active,button:active,input[type=button]:active,input[type=checkbox]:active,input[type=radio]:active,input[type=range]:active,input[type=submit]:active{
transform:translateY(2px)
}.button:disabled,button:disabled,input:disabled,select:disabled,textarea:disabled{
cursor:not-allowed;opacity:.5
}::-webkit-input-placeholder{
color:#a9a9a9
}:-ms-input-placeholder{
color:#a9a9a9
}::-ms-input-placeholder{
color:#a9a9a9
}::placeholder{
color:#a9a9a9
}fieldset{
border:1px solid #adb4a0;border-radius:6px;margin:0 0 6px;padding:10px
}legend{
font-size:.9em;font-weight:600
}input[type=range]{
margin:10px 0;padding:10px 0;background:transparent
}input[type=range]:focus{
outline:none
}input[type=range]::-webkit-slider-runnable-track{
width:100%;height:9.5px;transition:.2s;background:#300330;border-radius:3px
}input[type=range]::-webkit-slider-thumb{
box-shadow:0 1px 1px #000,0 0 1px #0d0d0d;height:20px;width:20px;border-radius:50%;background:#dbdbdb;-webkit-appearance:none;margin-top:-7px
}input[type=range]:focus::-webkit-slider-runnable-track{
background:#300330
}input[type=range]::-moz-range-track{
width:100%;height:9.5px;transition:.2s;background:#300330;border-radius:3px
}input[type=range]::-moz-range-thumb{
box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d;height:20px;width:20px;border-radius:50%;background:#dbdbdb
}input[type=range]::-ms-track{
width:100%;height:9.5px;background:transparent;border-color:transparent;border-width:16px 0;color:transparent
}input[type=range]::-ms-fill-lower,input[type=range]::-ms-fill-upper{
background:#300330;border:.2px solid #010101;border-radius:3px;box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d
}input[type=range]::-ms-thumb{
box-shadow:1px 1px 1px #000,0 0 1px #0d0d0d;border:1px solid #000;height:20px;width:20px;border-radius:50%;background:#dbdbdb
}input[type=range]:focus::-ms-fill-lower,input[type=range]:focus::-ms-fill-upper{
background:#300330
}a{
text-decoration:none;color:#7fc090
}a:hover{
text-decoration:underline
}code,samp,time{
background:#300330;color:#dcff7f;padding:2.5px 5px;border-radius:6px;font-size:1em
}pre>code{
padding:10px;display:block;overflow-x:auto
}var{
color:#8a9e84;font-style:normal;font-family:monospace
}kbd{
background:#300330;border:1px solid #dbdbdb;border-radius:2px;color:#dbdbdb;padding:2px 4px
}img{
max-width:100%;height:auto
}hr{
border:none;border-top:1px solid #dbdbdb
}table{
border-collapse:collapse;margin-bottom:10px;width:100%
}td,th{
padding:6px;text-align:left
}thead{
border-bottom:1px solid #dbdbdb
}tfoot{
border-top:1px solid #dbdbdb
}tbody tr:nth-child(2n){
background-color:#3e0a2b
}::-webkit-scrollbar{
height:10px;width:10px
}::-webkit-scrollbar-track{
background:#300330;border-radius:6px
}::-webkit-scrollbar-thumb{
background:#55354c;border-radius:6px
}::-webkit-scrollbar-thumb:hover{
background:#6e4562
}::-moz-selection{
background-color:#200220
}::selection{
background-color:#200220
}details{
display:flex;flex-direction:column;align-items:flex-start;background-color:#3e0a2b;padding:10px 10px 0;margin:1em 0;border-radius:6px;overflow:hidden
}details[open]{
padding:10px
}details>:last-child{
margin-bottom:0
}details[open] summary{
margin-bottom:10px
}summary{
display:list-item;background-color:#300330;padding:10px;margin:-10px -10px 0
}details>:not(summary){
margin-top:0
}summary::-webkit-details-marker{
color:#dbdbdb
}footer{
border-top:1px solid #300330;padding-top:10px;font-size:.8em;color:#787878
}
button, input, select, textarea {
background-color: #300330;
}
thead, tr:nth-child(2n) {
background-color:#3e0a2b;
background-color:#300330 !important;
}
nav {
display: block;
background: #300330;
padding: .5pt;
border-radius: 6px;
}
nav li li li li {
display: none;
}
img {
max-height: 400px;
}
body {
/*font-size: 125%;*/
background: #3b242b;
margin-top: 0;
margin-bottom: 0;
height: calc(100vh - 1em);
overflow: auto;
display: flex;
flex-direction: column;
}
body > .form {
flex-grow: 2;
}
body > .form > form {
height: 100%;
display: flex;
flex-direction: column;
}
body > .form > form > textarea ,
body > .form > form > div {
flex-grow: 2;
}
rendered > h2:nth-child(2) {
margin: 0;
position: fixed;
padding: .25em;
width: 100%;
background: #3b242b;
top: 0;
}
h1, h2, h3, h4, h5, h6, h7, h8 {
position: relative;
}
.comment {
display: none;
margin: 0;
padding: 0;
flex-direction: column;
justify-content: center;
position: absolute;
right: 100%;
padding-right: 1em;
width: 10em;
top: 0;
text-align: right;
font-size: 12pt;
}
body > h2:first-of-type {
margin: 0;
margin-bottom: .5em;
padding: .3em 0 .3em 0;
background-color: #3b242b;
z-index: 999;
position: -webkit-sticky;
position: sticky;
top: 0;
}
h1:hover > .comment,
h2:hover > .comment,
h3:hover > .comment,
h4:hover > .comment,
h5:hover > .comment,
h6:hover > .comment,
h7:hover > .comment,
h8:hover > .comment,
.comment:focus,
.comment:focus-within {
display: inline-flex;
}
.attachments > details > form {
display: flex;
flex-direction: row;
width: 100%;
}
.attachments > details > form > input:first-of-type {
flex-grow: 2;
}

View File

@ -1,7 +1,7 @@
package filetree
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"testing"
)

View File

@ -1,7 +1,7 @@
package filetree
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"testing"
)

View File

@ -2,7 +2,7 @@ package filetree
import (
"fmt"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"path"
"strings"

View File

@ -1,7 +1,7 @@
package filetree
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"testing"
)

25
go.mod
View File

@ -1,28 +1,15 @@
module local/notes-server
module gitea.inhome.blapointe.com/local/notes-server
go 1.16
require (
gitea.inhome.blapointe.com/local/args v0.0.0-20240109214601-658deda479a4
gitea.inhome.blapointe.com/local/gziphttp v0.0.0-20240109214739-0d639b0a9eb9
gitea.inhome.blapointe.com/local/oauth2 v0.0.0-20240109220403-8897142866f1
gitea.inhome.blapointe.com/local/router v0.0.0-20231109150317-e6b81bf7c23c
github.com/fairlyblank/md2min v0.0.0-20171213131418-39cd6e9904ac
github.com/gomarkdown/markdown v0.0.0-20210208175418-bda154fe17d8
github.com/gomarkdown/markdown v0.0.0-20220607163217-45f7c050e2d1
github.com/russross/blackfriday v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0
github.com/yuin/goldmark v1.3.4-0.20210326114109-75d8cce5b78c
local/args v0.0.0-00010101000000-000000000000
local/gziphttp v0.0.0-00010101000000-000000000000
local/oauth2 v0.0.0-00010101000000-000000000000
local/router v0.0.0-00010101000000-000000000000
local/simpleserve v0.0.0-00010101000000-000000000000
)
replace local/gziphttp => ../gziphttp
replace local/oauth2 => ../oauth2
replace local/simpleserve => ../simpleserve
replace local/args => ../args
replace local/router => ../router
replace local/storage => ../storage

21
go.sum
View File

@ -1,10 +1,19 @@
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
cloud.google.com/go v0.33.1/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
gitea.inhome.blapointe.com/local/args v0.0.0-20240109214601-658deda479a4 h1:4qBHjKAiEwRV1A1tN1JK6PsLV1+UwESXKrjGqfCCdNk=
gitea.inhome.blapointe.com/local/args v0.0.0-20240109214601-658deda479a4/go.mod h1:SqCOE3bE3wvrztVIQGHuyxHKfDjRKU9EWhBdkmkiwyc=
gitea.inhome.blapointe.com/local/gziphttp v0.0.0-20240109214739-0d639b0a9eb9 h1:Vq4jPYz6pCDMx7rxySw7SbKH3FHBywt1oS1TpXx4noM=
gitea.inhome.blapointe.com/local/gziphttp v0.0.0-20240109214739-0d639b0a9eb9/go.mod h1:YSOO/quInfKxfgqHH8exd71292hkLgqu2BO5oz6EATE=
gitea.inhome.blapointe.com/local/logb v0.0.0-20231109150430-1221d87a6dbc/go.mod h1:KwilawX4UgD4HxSJAVFEzkuckrnHeQrd49KwUX6GpYU=
gitea.inhome.blapointe.com/local/oauth2 v0.0.0-20240109220403-8897142866f1 h1:GO2/M+5a5i4FqiOnG6hq73nITDv2Rf8oTF973RsYQgo=
gitea.inhome.blapointe.com/local/oauth2 v0.0.0-20240109220403-8897142866f1/go.mod h1:XvS1/YJqCL+HoLo76dSLTjRYR+4Hfg4srhEVhMK3L8E=
gitea.inhome.blapointe.com/local/router v0.0.0-20231109150317-e6b81bf7c23c h1:+9kTZ3+ziuvmo+mC/xh/wVogFIAT1LeMzJMfSk0onsE=
gitea.inhome.blapointe.com/local/router v0.0.0-20231109150317-e6b81bf7c23c/go.mod h1:xYz/cn236KTBSWNQ9bqCyBmy8aQ7VL95pDDJmeupmN4=
gitea.inhome.blapointe.com/local/storage v0.0.0-20231109151605-736d446d407d/go.mod h1:TRK5z/XTT6jws++Q21Y8DQot+5vZGTNeHf+RjuY8aQk=
github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg=
github.com/Azure/azure-storage-blob-go v0.0.0-20181023070848-cf01652132cc/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Unknwon/goconfig v0.0.0-20181105214110-56bd8ab18619/go.mod h1:wngxua9XCNjvHjDiTiV26DaKDT+0c63QR6H5hjVUUxw=
github.com/a8m/tree v0.0.0-20180321023834-3cf936ce15d6/go.mod h1:FSdwKX97koS5efgm8WevNf7XS3PqtyFkKDDXrz778cg=
github.com/abbot/go-http-auth v0.4.0/go.mod h1:Cz6ARTIzApMJDzh5bRMSUou6UMSp0IEXg9km/ci7TJM=
@ -12,9 +21,6 @@ github.com/anacrolix/dms v0.0.0-20180117034613-8af4925bffb5/go.mod h1:DGqLjaZ3zi
github.com/aws/aws-sdk-go v1.15.81/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM=
github.com/billziss-gh/cgofuse v1.1.0/go.mod h1:LJjoaUojlVjgo5GQoEJTcJNqZJeRU0nCR84CyxKt2YM=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
github.com/buraksezer/consistent v0.9.0/go.mod h1:6BrVajWq7wbKZlTOUPs/XVfR8c0maujuPowduSpZqmw=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/coreos/bbolt v0.0.0-20180318001526-af9db2027c98/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/cpuguy83/go-md2man v1.0.8/go.mod h1:N6JayAiVKtlHSnuTCeuLSQVs75hb8q+dYQLjr7cDsKY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -55,8 +61,8 @@ github.com/goftp/server v0.0.0-20190111142836-88de73f463af/go.mod h1:k/SS6VWkxY7
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomarkdown/markdown v0.0.0-20210208175418-bda154fe17d8 h1:nWU6p08f1VgIalT6iZyqXi4o5cZsz4X6qa87nusfcsc=
github.com/gomarkdown/markdown v0.0.0-20210208175418-bda154fe17d8/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU=
github.com/gomarkdown/markdown v0.0.0-20220607163217-45f7c050e2d1 h1:wAupuFkZ/yq219/mSbqDtMfUZQY0gTYEtoz3/LKtppU=
github.com/gomarkdown/markdown v0.0.0-20220607163217-45f7c050e2d1/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
github.com/gomodule/redigo v1.8.5/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
@ -132,7 +138,6 @@ github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:s
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@ -153,7 +158,6 @@ github.com/yuin/goldmark v1.3.4-0.20210326114109-75d8cce5b78c h1:cPcogYxzMuZfHQk
github.com/yuin/goldmark v1.3.4-0.20210326114109-75d8cce5b78c/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yunify/qingstor-sdk-go v2.2.15+incompatible/go.mod h1:w6wqLDQ5bBTzxGJ55581UrSwLrsTAsdo9N6yX/8d9RY=
go.mongodb.org/mongo-driver v1.7.2/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8=
golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@ -182,6 +186,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

View File

@ -1,10 +1,10 @@
package main
import (
"local/notes-server/config"
"local/notes-server/notes/editor"
"local/notes-server/server"
"local/notes-server/versions"
"gitea.inhome.blapointe.com/local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/notes/editor"
"gitea.inhome.blapointe.com/local/notes-server/server"
"gitea.inhome.blapointe.com/local/notes-server/versions"
"log"
"net/http"
"os"

View File

@ -3,8 +3,8 @@ package main
import (
"fmt"
"io/ioutil"
"local/notes-server/config"
"local/notes-server/server"
"gitea.inhome.blapointe.com/local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/server"
"log"
"net/http"
"net/http/httptest"

View File

@ -7,7 +7,7 @@ import (
"fmt"
"io"
"io/ioutil"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"os"
"path"
"strings"

View File

@ -3,7 +3,7 @@ package notes
import (
"bytes"
"io/ioutil"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"path"
"strings"

View File

@ -2,7 +2,7 @@ package notes
import (
"errors"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"path"
)

View File

@ -1,7 +1,7 @@
package notes
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"testing"
)

View File

@ -2,7 +2,7 @@ package notes
import (
"fmt"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"os"
)

View File

@ -2,7 +2,7 @@ package notes
import (
"io/ioutil"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"path"
"testing"

View File

@ -3,7 +3,7 @@ package notes
import (
"errors"
"io/ioutil"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
)
func (n *Notes) Dir(urlPath string) (string, string, error) {

View File

@ -1,7 +1,7 @@
package notes
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"testing"
)

View File

@ -4,8 +4,8 @@ import (
"errors"
"fmt"
"io/ioutil"
"local/notes-server/filetree"
"local/notes-server/notes/editor"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/notes/editor"
"strings"
)

View File

@ -1,7 +1,7 @@
package notes
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"strings"
"testing"
)

View File

@ -7,8 +7,8 @@ import (
"fmt"
"io"
"io/ioutil"
"local/notes-server/filetree"
"local/notes-server/notes/md"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/notes/md"
"path"
"regexp"
"strings"

View File

@ -3,7 +3,7 @@ package notes
import (
"fmt"
"io/ioutil"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"path"
"strings"

View File

@ -1,6 +1,6 @@
package notes
import "local/notes-server/config"
import "gitea.inhome.blapointe.com/local/notes-server/config"
type Notes struct {
root string

View File

@ -4,7 +4,7 @@ import (
"bufio"
"errors"
"io"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"log"
"os"
"path"

View File

@ -45,7 +45,7 @@ func TestSearch(t *testing.T) {
func TestSearchBigFiles(t *testing.T) {
n := New()
n.root = "/usr/local/bin"
n.root = "/usr/gitea.inhome.blapointe.com/local/bin"
_, err := n.Search("this file")
if err != nil {

View File

@ -2,7 +2,7 @@ package notes
import (
"io/ioutil"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"os"
"path"
)

View File

@ -2,7 +2,7 @@ package notes
import (
"io/ioutil"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"testing"
)

View File

@ -3,7 +3,7 @@ package server
import (
"errors"
"io"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"net/http"
"os"
"path"

View File

@ -2,7 +2,7 @@ package server
import (
"html"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"net/http"
"path"
"strconv"

View File

@ -2,7 +2,7 @@ package server
import (
"fmt"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"net/http"
)

View File

@ -2,7 +2,7 @@ package server
import (
"fmt"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"net/http"
)

View File

@ -1,7 +1,7 @@
package server
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"net/http/httptest"
"regexp"
"strings"

View File

@ -2,8 +2,8 @@ package server
import (
"fmt"
"local/notes-server/config"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"net/http"
"path"
"regexp"

View File

@ -2,10 +2,11 @@ package server
import (
"io"
"local/notes-server/filetree"
"local/simpleserve/simpleserve"
"net/http"
"os"
"gitea.inhome.blapointe.com/local/gziphttp"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
)
func (s *Server) raw(w http.ResponseWriter, r *http.Request) {
@ -15,7 +16,7 @@ func (s *Server) raw(w http.ResponseWriter, r *http.Request) {
}
func (s *Server) _raw(w http.ResponseWriter, r *http.Request) error {
simpleserve.SetContentTypeIfMedia(w, r)
gziphttp.SetContentTypeIfMedia(w, r)
p := filetree.NewPathFromURL(r.URL.Path)
if !p.IsFile() {
http.NotFound(w, r)

View File

@ -2,12 +2,13 @@ package server
import (
"fmt"
"local/gziphttp"
"local/notes-server/config"
"local/router"
"net/http"
"path/filepath"
"strings"
"gitea.inhome.blapointe.com/local/gziphttp"
"gitea.inhome.blapointe.com/local/notes-server/config"
"gitea.inhome.blapointe.com/local/router"
)
func (s *Server) Routes() error {
@ -19,7 +20,7 @@ func (s *Server) Routes() error {
handler: s.root,
},
fmt.Sprintf("raw/%s%s", wildcard, wildcard): {
handler: s.gzip(s.authenticate(s.raw)),
handler: s.gzip(s.authenticate(s.cached(s.raw))),
},
fmt.Sprintf("notes/%s%s", wildcard, wildcard): {
handler: s.gzip(s.authenticate(s.notes)),

View File

@ -3,7 +3,7 @@ package server
import (
"fmt"
"html"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"net/http"
)

View File

@ -1,12 +1,13 @@
package server
import (
"local/notes-server/config"
"local/notes-server/notes"
"local/oauth2/oauth2client"
"local/router"
"log"
"net/http"
"gitea.inhome.blapointe.com/local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/notes"
"gitea.inhome.blapointe.com/local/oauth2/oauth2client"
"gitea.inhome.blapointe.com/local/router"
)
type Server struct {
@ -21,6 +22,13 @@ func New() *Server {
}
}
func (s *Server) cached(foo http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "private, max-age=7776000")
foo(w, r)
}
}
func (s *Server) authenticate(foo http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if config.OAuthServer != "" {

View File

@ -4,7 +4,7 @@ import (
"bytes"
"fmt"
"html"
"local/notes-server/filetree"
"gitea.inhome.blapointe.com/local/notes-server/filetree"
"net/http"
"path"
"strings"

View File

@ -1,7 +1,7 @@
package versions
import (
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"time"
git "gopkg.in/src-d/go-git.v4"

View File

@ -2,7 +2,7 @@ package versions
import (
"io/ioutil"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"path"
"testing"

View File

@ -2,7 +2,7 @@ package versions
import (
"fmt"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"strings"
)

View File

@ -3,7 +3,7 @@ package versions
import (
"fmt"
"io/ioutil"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"log"
"os"
"os/exec"

View File

@ -2,7 +2,7 @@ package versions
import (
"io/ioutil"
"local/notes-server/config"
"gitea.inhome.blapointe.com/local/notes-server/config"
"os"
"path"
"testing"