diff --git a/.env b/.env new file mode 100644 index 0000000..8bfaa86 --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +STATIC_HOSTER_HOME=/home/nikurasu/hoster +STATIC_HOSTER_HOST_DIR=/home/dave/hosted/ +STATIC_HOSTER_API_KEY=e621 +STATIC_HOSTER_PORT=4200 +STATIC_HOSTER_BASE_ROUTE=/site diff --git a/.gitignore b/.gitignore index 587eea4..4008d94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ static-hoster hostdir +.env diff --git a/src/helper/helper.go b/src/helper/helper.go new file mode 100644 index 0000000..119e1cf --- /dev/null +++ b/src/helper/helper.go @@ -0,0 +1,20 @@ +package helper + +import ( + "io" + "os" +) + +func IsEmpty(path string) (bool, error) { + f, err := os.Open(path) + if err != nil { + return false, err + } + defer f.Close() + + _, err = f.Readdirnames(1) + if err == io.EOF { + return true, err + } + return false, err +} diff --git a/src/static/Go-Logo_Aqua.svg b/src/static/Go-Logo_Aqua.svg new file mode 100644 index 0000000..6a814c7 --- /dev/null +++ b/src/static/Go-Logo_Aqua.svg @@ -0,0 +1,47 @@ + + + \ No newline at end of file diff --git a/src/static/OpenSans-ExtraBold.ttf b/src/static/OpenSans-ExtraBold.ttf new file mode 100644 index 0000000..08d7185 Binary files /dev/null and b/src/static/OpenSans-ExtraBold.ttf differ diff --git a/src/static/OpenSans-Regular.ttf b/src/static/OpenSans-Regular.ttf new file mode 100644 index 0000000..1dc226d Binary files /dev/null and b/src/static/OpenSans-Regular.ttf differ diff --git a/src/static/gopherPride.png b/src/static/gopherPride.png new file mode 100644 index 0000000..0d59448 Binary files /dev/null and b/src/static/gopherPride.png differ diff --git a/src/static/index.html b/src/static/index.html new file mode 100644 index 0000000..d11e566 --- /dev/null +++ b/src/static/index.html @@ -0,0 +1,29 @@ + + +
+ + + + +Now upload some files to
+Site+
with a HTTP push request.
+Click on the link to copy.
+