diff --git a/main.go b/main.go
index 1da7902..b8c4d1e 100644
--- a/main.go
+++ b/main.go
@@ -2,8 +2,10 @@ package main
import (
"flag"
+ "net"
"net/http"
+ "fornaxian.tech/pixeldrain_server/util"
web "fornaxian.tech/pixeldrain_web/init"
"github.com/Fornaxian/log"
@@ -14,17 +16,32 @@ import (
// be directly embedded by another Go project. And when deployed it will run
// independently.
func main() {
+ var err error
+ var sock = flag.Bool("systemd-socket", false, "Enable/disable systemd socket activation")
var listen = flag.String("listen", ":8081", "The address which the API server will listen on")
var prefix = flag.String("prefix", "", "Prefix that comes before the API URL")
flag.Parse()
- r := httprouter.New()
+ var listener net.Listener
- web.Init(r, *prefix, true)
+ // Serve the API on a socket. If systemd-socket is enabled we'll reuse
+ // systemd's socket, else we'll create our own to serve on
+ if *sock {
+ // Socket activation enabled. Get the provided sockets and serve on them
+ if listener, err = util.SystemdSocketByName("pd-web.socket"); err != nil {
+ panic("Socket pd-web.socket not found")
+ }
+ } else {
+ // Socket activation disabled, so we create our own listener to serve on
+ if listener, err = net.Listen("tcp", *listen); err != nil {
+ panic(err)
+ }
+ }
- err := http.ListenAndServe(*listen, r)
+ var router = httprouter.New()
+ web.Init(router, *prefix, true)
- if err != nil {
+ if err = http.Serve(listener, router); err != nil {
log.Error("Can't listen and serve Pixeldrain Web: %v", err)
}
}
diff --git a/res/include/md/about.md b/res/include/md/about.md
index 77c8943..37ddda6 100644
--- a/res/include/md/about.md
+++ b/res/include/md/about.md
@@ -34,6 +34,33 @@ spare some coins. Possible methods for donating are:
*
Donate with PayPal
+## Content policy
+
+The following types of content are not allowed to be shared on pixeldrain. They
+will be removed when reported.
+
+ * **Copyright violation**: Works which are shared without permission from the
+ copyright holder.
+ * **Abuse of minors**: Videos, images or audio fragments depicting abuse or
+ inappropriate touching of minors will be removed and reported to the National
+ Center for Missing and Exploited Children when found.
+ * **Terrorism**: Videos, images or audio fragments which promote and
+ glorify acts of terrorism.
+ * **Gore**: Graphic and shocking videos or images depicting severe harm to
+ humans.
+ * **Malware and computer viruses**: Software designed to cause harm to computer
+ systems.
+
+If you have found content which falls in any of these categories on pixeldrain
+please report the download link to me at
+[abuse@pixeldrain.com](mailto:abuse@pixeldrain.com) and I will review it. If the
+content does not fit into one of the categories your e-mail will be ignored.
+
+Fornaxian Technologies cannot be held liable for any illegal or copyrighted
+material that's uploaded by the users of this application under the Online
+Copyright Infringement Liability Limitation Act ยง 512\(c) in the USA and the
+Electronic Commerce Directive 2000 Article 14 in the EU.
+
## How does pixeldrain store files?
Pixeldrain uses a few different techniques to store files cheaply, efficiently
@@ -87,16 +114,8 @@ When uploading a file pixeldrain will save a list of file links on your
browser's local storage. This data is **only** used for viewing your upload
history on the [history page](/history).
-## Legality
-
-I cannot be held liable for any illegal and / or copyrighted material that's
-uploaded by the users of this application. Files uploaded to this website are
-subjected to local laws. If laws are being broken, and I've been notified of the
-fact I'll have to delete the offending content. If you find any files on this
-domain that break the law, please contact me at
-[abuse@pixeldrain.com](mailto:abuse@pixeldrain.com), and I'll take care of it.
-
-Please share responsibly.
+## Support
For other questions you can reach me at
-[support@pixeldrain.com](mailto:support@pixeldrain.com)
+[support@pixeldrain.com](mailto:support@pixeldrain.com). Abuse reports sent to
+this address will not be reviewed, use the abuse address.
diff --git a/res/include/md/acknowledgements.md b/res/include/md/acknowledgements.md
index 50f9cd2..c8f4480 100644
--- a/res/include/md/acknowledgements.md
+++ b/res/include/md/acknowledgements.md
@@ -15,12 +15,12 @@
* [BurntSushi/toml](https://github.com/BurntSushi/toml)
* [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter)
* [gabriel-vasile/mimetype](https://github.com/gabriel-vasile/mimetype)
- * [disintegration/imaging](github.com/disintegration/imaging)
- * [gorilla/websocket](github.com/gorilla/websocket)
- * [shopspring/decimal](github.com/shopspring/decimal)
- * [jhillyerd/enmime](github.com/jhillyerd/enmime)
+ * [disintegration/imaging](https://github.com/disintegration/imaging)
+ * [gorilla/websocket](https://github.com/gorilla/websocket)
+ * [shopspring/decimal](https://github.com/shopspring/decimal)
+ * [jhillyerd/enmime](https://github.com/jhillyerd/enmime)
* [russross/blackfriday](https://github.com/russross/blackfriday)
- * [microcosm-cc/bluemonday](github.com/microcosm-cc/bluemonday)
+ * [microcosm-cc/bluemonday](https://github.com/microcosm-cc/bluemonday)
### Web framework
diff --git a/res/template/home.html b/res/template/home.html
index 661b2ef..e4a0ad0 100644
--- a/res/template/home.html
+++ b/res/template/home.html
@@ -22,7 +22,7 @@
border-top: 1px solid var(--layer_2_color_border);
border-bottom: 1px solid var(--layer_2_color_border);
box-sizing: border-box;
- margin: 10px 0;
+ margin: 1.5em 0;
padding: 5px;
}
.big_number {
@@ -122,9 +122,8 @@
Upload Text
- By uploading files to pixeldrain you accept that a cookie will
- be placed in your web browser. More information on the
- about page
+ By uploading files to pixeldrain you acknowledge and accept our
+ content policy.