Compare commits
2 Commits
622b98f40a
...
05c0eaebaa
Author | SHA1 | Date | |
---|---|---|---|
05c0eaebaa | |||
a0fb9657eb |
2
.gitignore
vendored
2
.gitignore
vendored
@ -33,5 +33,5 @@ go.work.sum
|
||||
|
||||
watcher
|
||||
lts
|
||||
|
||||
store
|
||||
ALLOWED_USERS.txt
|
||||
|
12
Makefile
Normal file
12
Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
all:
|
||||
go build
|
||||
|
||||
watcher:
|
||||
cc -o watcher watcher.c
|
||||
|
||||
clean:
|
||||
go clean
|
||||
rm watcher
|
||||
|
||||
.PHONY: all clean watcher
|
||||
|
8
lts.go
8
lts.go
@ -83,7 +83,7 @@ func basicAuth(handler http.HandlerFunc, realm string) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
var storePath string
|
||||
var storePath string = "./store"
|
||||
|
||||
// https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/
|
||||
func byteCountSI(b int64) string {
|
||||
@ -233,12 +233,6 @@ func watchAllowedUsers() chan bool {
|
||||
}
|
||||
|
||||
func main() {
|
||||
storePathValue, ok := os.LookupEnv("LTS_STORE_PATH")
|
||||
if !ok {
|
||||
log.Fatal("LTS_STORE_PATH not set")
|
||||
}
|
||||
storePath = storePathValue
|
||||
|
||||
reloadAllowedUsers()
|
||||
doneWatching := watchAllowedUsers()
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
<section>
|
||||
<h2>Browse</h2>
|
||||
<p>
|
||||
Browse the files <a href="/store">here</a>
|
||||
Browse the files <a href="/browse">here</a>
|
||||
</p>
|
||||
</section>
|
||||
<script>
|
||||
|
Reference in New Issue
Block a user