1
0
Fork
You've already forked go-thing
0
No description
  • Go 95.9%
  • JavaScript 2.9%
  • SCSS 1.1%
Find a file
2020年08月19日 00:11:47 -05:00
assets Integrate lazy-img and gif-player Web Components. 2019年04月14日 00:37:04 -05:00
debian Use conf flag in service, and TOML for config 2019年03月21日 00:17:39 -05:00
devd-0.5-linux64 Added devd for easy local dev. 2016年08月01日 15:37:34 -05:00
scss Embiggen all the things, videos and images. 2018年02月20日 21:39:32 -06:00
templates Remove Readme and Changelog endpoints. 2020年07月08日 14:00:52 -05:00
things Remove a lot of excess log.Prints 2019年03月15日 21:47:32 -05:00
utils Move various utils to dedicated folders so they can be compiled to binaries. 2018年01月01日 13:31:12 -06:00
vfs Remove println from vfs/templates_main 2019年04月16日 16:31:17 -05:00
.drone.yml Fix deploy package name 2020年07月05日 21:36:55 -05:00
.gitignore Switch from govendor to dep. 2017年12月31日 08:12:00 -06:00
.gitlab-ci.yml Cache relative vendor/ directory 2019年03月20日 22:18:52 -05:00
build-pkg.sh Move debian to top-level dir 2019年03月13日 18:47:36 -05:00
build_css.sh Bring build_css.sh back. Sticking with Foundation for now; should work on the code first. 2017年09月11日 19:05:42 -05:00
CHANGELOG.md ldap integration merged 2015年07月26日 01:17:54 -05:00
conf-dist.json Replace instances of es.gy with squanch.space. 2018年01月03日 11:33:38 -06:00
devd.sh Added devd for easy local dev. 2016年08月01日 15:37:34 -05:00
Dockerfile get and vendor in the same go. 2017年04月25日 19:50:56 -05:00
go.mod Bump auth lib version 2020年08月18日 23:49:13 -05:00
go.sum Bump auth lib version 2020年08月18日 23:49:13 -05:00
Gopkg.lock Switch to using CSRF integrated into my auth lib. 2018年09月08日 22:05:12 -05:00
Gopkg.toml Switch to using CSRF integrated into my auth lib. 2018年09月08日 22:05:12 -05:00
gothing.dist.json Move debian to top-level dir 2019年03月13日 18:47:36 -05:00
gothing.dist.toml Rename db variables. 2019年03月21日 01:01:01 -05:00
gothing.service Use conf flag in service, and TOML for config 2019年03月21日 00:17:39 -05:00
handlers.go Upgrade to the latest auth lib version. 2020年08月18日 23:35:35 -05:00
handlers_test.go Fix tests 2019年03月21日 01:06:17 -05:00
LICENSE Re-license as MIT 2019年12月04日 19:37:17 -06:00
main.go Add CSRF config flag to disable CSRF middleware 2020年08月19日 00:11:47 -05:00
modd.conf Using nginx instead of devd, for full stack testing locally. 2018年02月15日 21:31:04 -06:00
README.md Replace instances of es.gy with squanch.space. 2018年01月03日 11:33:38 -06:00
watch-and-build.sh Remove some unneeded files. 2017年09月11日 18:56:45 -05:00

About

This is my first major programming project, and my first major experience with Golang, so please excuse the messiness and feel free to let me know if there are any major issues! I started out with the Golang.org Wiki guide, but after finishing that up quicker than I thought, I decided to see what other functionality I could build in... Note: I may have gotten carried away. :D

You can see it in action here.

Features

As of 05/09/2015, the doodad has the following features:

  • User authentication, using my custom authentication functions, heavily based off this blog post
  • Shorten URLs to subdomains of my squanch.space domain, so I can have things like http://ygdr.squanch.space/
    • If the 'long URL' is found to point to an image uploaded to the app, the image is directly served
  • Handle image and file uploads from local filesystem and remote URLs
  • Separate image gallery listing all uploaded images, utilizing FreezeFrame which pauses GIFs until moused over, to try and avoid GIF-incurred CPU spikes when visited
  • Pastebin functionality, with rudimentary XSS (just <script> for now) protection
  • 'Snippet' functionality separate from pastes, who's main difference is the ability to view in-line, and append things to the page easily
  • List all uploaded files, short URLs, and snippets
    • If logged in as the admin user, you're given a Delete button on this page to do just that
  • Embiggen GIFs uploaded to the app (using gifsicle, not included), by using either a dedicated 'GifTLD' domain in-place of the configured 'ImageTLD', or a '/big/' subroute in the URL of the uploaded image (http://i.squanch.space/dayum.gif -> http://i.squanch.space/big/dayum.gif OR http://big.squanch.space/dayum.gif)
  • 'Looking Glass' functionality, with the ability to ping, traceroute, and perform an MTR to a specified domain or IP

Configuration

The app expects a file named 'conf.json' in the same directory as the binary, containing the following structure. I have added comments here for clarity, so if copying and pasting, remove them:

{
 //What port you want the app to listen on
 "Port": "3000",
 //Username of the initial admin user
 "Username": "admin",
 //Password of the initial admin user
 "Password": "admin",
 //Email of the initial admin user
 "Email": "admin@main.tld",
 //Directoy where images should be uploaded to
 "ImgDir": "./up-imgs/",
 //Directory where files should be uploaded to
 "FileDir": "./up-files/",
 //The domain where all functions should be
 "MainTLD": "the.main.tld",
 //The domain where wildcard-subdomains are used for short URLs
 "ShortTLD": "short.tld",
 //The domain where a feature-limited image gallery is served
 "ImageTLD": "image.tld",
 //The domain where all embiggened GIFs can be linked to, for easy linking
 "GifTLD": "gif.tld"
}