From ac7fd1f68d396cb676a9a111bddae7e36302b4c6 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 28 Jun 2021 12:06:20 -0700 Subject: tor proxy, added server version in faq, increased verification time --- README.md | 6 ++++-- config-init | 5 +++-- main.go | 5 +++++ static/faq.html | 12 ++++++++++-- static/main.html | 2 +- verification.go | 2 +- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2f6740d..721b836 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ Any contributions or suggestions are appreciated. Best way to give immediate fee `dbpass:password` Database password for dbuser. + `torproxy:127.0.0.1:9050` Tor proxy route and port, leave blank if you do not want to support + Currently e-mail is not implemented to do anything special, but the code is in place @@ -78,9 +80,9 @@ Any contributions or suggestions are appreciated. Best way to give immediate fee ### local testing - When testing on a local env when setting the `instance` value in the config file you have to append the port number to the local address eg. `instance:localhost:3000` with `instanceport` also being set to the same port. + When testing on a local env when setting the `instance` value in the config file you have to append the port number to the local address eg. `instance:localhost:3000` with `instanceport` also being set to the same port. - If you want to test federation between servers locally you have to use your local ip as the `instance` eg. `instance:192.168.0.2:3000` and `instance:192:168:0:3:3000` adding the port to localhost will not route correctly. + If you want to test federation between servers locally you have to use your local ip as the `instance` eg. `instance:192.168.0.2:3000` and `instance:192:168:0:3:3000` adding the port to localhost will not route correctly. ### Managing the server diff --git a/config-init b/config-init index 7da7b26..6ca4aa9 100644 --- a/config-init +++ b/config-init @@ -1,4 +1,4 @@ -instance:server.fchan.xyz +instance:fchan.xyz instancetp:https:// instanceport:3000 instancename:FChan @@ -6,7 +6,7 @@ instancesummary:FChan is a federated image board instance. dbhost:localhost dbport:5432 -dbname:fchan_server +dbname:server dbuser:postgres dbpass:password @@ -15,3 +15,4 @@ emailport: emailaddress: emailpass: +torproxy: \ No newline at end of file diff --git a/main.go b/main.go index c632e53..a8faeca 100644 --- a/main.go +++ b/main.go @@ -1491,6 +1491,11 @@ func ParseCommentForReplies(comment string) []ObjectBase { func CheckValidActivity(id string) (Collection, bool) { + re := regexp.MustCompile(`.+\.onion(.+)?`) + if re.MatchString(id) { + id = strings.Replace(id, "https", "http", 1) + } + req, err := http.NewRequest("GET", id, nil) if err != nil { diff --git a/static/faq.html b/static/faq.html index 4398466..8c7c4fe 100644 --- a/static/faq.html +++ b/static/faq.html @@ -1,7 +1,12 @@ + + + - [Back] + [Back]

FAQ

What is fchan

@@ -29,7 +34,10 @@

sequential numbers have run their course. random base 16 (now base 36) is better.

Activitypub specific examples

-

coming soon(tm).

+

coming soon(tm).

+ +

Server Version

+

v0.0.1

[Home][Rules][FAQ] diff --git a/static/main.html b/static/main.html index 91d8344..72ed321 100644 --- a/static/main.html +++ b/static/main.html @@ -90,7 +90,7 @@ {{ template "content" . }} {{ template "bottom" . }} -
+
[Home][Rules][FAQ]

All media are copyright to their respective owners.

diff --git a/verification.go b/verification.go index db44689..38c7bbe 100644 --- a/verification.go +++ b/verification.go @@ -661,7 +661,7 @@ func VerifyHeaderSignature(r *http.Request, actor Actor) bool { t, _ := time.Parse(time.RFC1123, date) - if(time.Now().Sub(t).Seconds() > 30) { + if(time.Now().Sub(t).Seconds() > 75) { return false } -- cgit v1.2.3