diff --git a/Dockerfile b/Dockerfile
old mode 100644
new mode 100755
index b651616..9809e42
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,11 +1,8 @@
+FROM frolvlad/alpine-glibc:alpine-3.9_glibc-2.29
+RUN apk update && apk add --no-cache ca-certificates git
-FROM golang:1.13-alpine as certs
-RUN apk update && apk add --no-cache ca-certificates
-
-FROM busybox:glibc
RUN mkdir -p /var/log
WORKDIR /main
-COPY --from=certs /etc/ssl/certs /etc/ssl/certs
COPY . .
@@ -13,4 +10,3 @@ ENV GOPATH=""
ENV MNT="/mnt/"
ENTRYPOINT ["/main/exec-notes-server"]
CMD []
-
diff --git a/TODO b/TODO
old mode 100644
new mode 100755
diff --git a/filetree/paths.go b/filetree/paths.go
index 7c3649a..c1e7aa1 100755
--- a/filetree/paths.go
+++ b/filetree/paths.go
@@ -5,6 +5,9 @@ type Paths []Path
func (p Paths) List(full ...bool) string {
content := "
\n"
for _, path := range p {
+ if len(path.Base) > 0 && path.Base[0] == '.' {
+ continue
+ }
if len(full) > 0 && full[0] {
content += path.FullLI() + "\n"
} else {
diff --git a/main.go b/main.go
old mode 100644
new mode 100755
diff --git a/main_test.go b/main_test.go
old mode 100644
new mode 100755
diff --git a/notes/delete.go b/notes/delete.go
old mode 100644
new mode 100755
diff --git a/notes/delete_test.go b/notes/delete_test.go
old mode 100644
new mode 100755
diff --git a/notes/notes.go b/notes/notes.go
old mode 100644
new mode 100755
diff --git a/notes/notes_test.go b/notes/notes_test.go
old mode 100644
new mode 100755
diff --git a/notes/search.go b/notes/search.go
old mode 100644
new mode 100755
index ae6515b..bef58a3
--- a/notes/search.go
+++ b/notes/search.go
@@ -4,9 +4,11 @@ import (
"bufio"
"bytes"
"local/notes-server/filetree"
+ "log"
"os"
"path"
"path/filepath"
+ "strings"
)
func (n *Notes) Search(phrase string) (string, error) {
@@ -19,11 +21,17 @@ func (n *Notes) Search(phrase string) (string, error) {
if info.IsDir() {
return nil
}
+ if splits := strings.Split(info.Name(), "."); len(splits) > 1 && !(strings.HasSuffix(info.Name(), ".md") || strings.HasSuffix(info.Name(), ".txt")) {
+ return nil
+ }
ok, err := grepFile(walked, []byte(phrase))
if err == nil && ok {
p := filetree.NewPathFromLocal(path.Dir(walked))
files.Push(p, info)
}
+ if err != nil {
+ log.Printf("failed to scan %v: %v", walked, err)
+ }
return err
},
)
diff --git a/notes/search_test.go b/notes/search_test.go
old mode 100644
new mode 100755
diff --git a/server/.notes/notes.go b/server/.notes/notes.go
old mode 100644
new mode 100755
diff --git a/server/html.go b/server/html.go
old mode 100644
new mode 100755
diff --git a/server/notes.go b/server/notes.go
old mode 100644
new mode 100755
diff --git a/versions/.versions.go b/versions/.versions.go
old mode 100644
new mode 100755
diff --git a/versions/.versions_test.go b/versions/.versions_test.go
old mode 100644
new mode 100755
diff --git a/versions/versions.go b/versions/versions.go
old mode 100644
new mode 100755
diff --git a/versions/versions_test.go b/versions/versions_test.go
old mode 100644
new mode 100755
diff --git a/wrapper.html b/wrapper.html
old mode 100644
new mode 100755