Compare commits

3 Commits

Author SHA1 Message Date
8d7834b38f update anyhttp 2024-12-19 15:56:42 -05:00
2bf8c9926d fix mode 2024-09-18 10:37:32 -04:00
db6e99e9ea Fix README formatting 2024-09-01 23:47:21 -04:00
4 changed files with 12 additions and 10 deletions

View File

@@ -21,9 +21,9 @@ Note:
2. Make sure the webapp is properly authenticated without relying on
localStorage. E.g.
a. Setup HTTP Basic Auth
b. Webapp is only served inside home network
c. Served under a secret URL not shared with anyone like [tor onion url][3]
1. Setup HTTP Basic Auth
2. Webapp is only served inside home network
3. Served under a secret URL not shared with anyone like [tor onion url][3]
## Usecase example
@@ -62,7 +62,7 @@ Let me know at `@balki@balki.me` in fediverse, if you find it useful
go install go.balki.me/remote-local-storage@latest
```
## Links
---
[0]: https://developer.mozilla.org/docs/Web/API/Window/localStorage
[1]: https://torproject.org

4
go.mod
View File

@@ -1,5 +1,5 @@
module go.balki.me/remote-local-storage
go 1.23.0
go 1.23.4
require go.balki.me/anyhttp v0.3.0
require go.balki.me/anyhttp v0.4.0

4
go.sum
View File

@@ -1,2 +1,2 @@
go.balki.me/anyhttp v0.3.0 h1:WtBQ0rnkg567sX/O4ij/+qBbdCIUt5VURSe718sITBY=
go.balki.me/anyhttp v0.3.0/go.mod h1:JhfekOIjgVODoVqUCficjpIgmB3wwlB7jhN0eN2EZ/s=
go.balki.me/anyhttp v0.4.0 h1:K639Mc8qCIO5B6ugLJCLQenkwxh9rihEK5JZ/xNfvV0=
go.balki.me/anyhttp v0.4.0/go.mod h1:JhfekOIjgVODoVqUCficjpIgmB3wwlB7jhN0eN2EZ/s=

View File

@@ -25,7 +25,9 @@ func main() {
flag.Parse()
http.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) {
w.Write([]byte("<h2>Error!</h2><p>Check your webserver config, You should not see this!</p>"))
if _, err := w.Write([]byte("<h2>Error!</h2><p>Check your webserver config, You should not see this!</p>")); err != nil {
log.Panic(err)
}
})
http.HandleFunc("/wrap/", func(w http.ResponseWriter, r *http.Request) {
@@ -39,7 +41,7 @@ func main() {
log.Panic(err)
}
if err := os.WriteFile(*dumpFile, data, 0o400); err != nil {
if err := os.WriteFile(*dumpFile, data, 0o600); err != nil {
log.Panic(err)
}