Image (or most any file) Web client and server Backed by MongoDB
Go to file
Vincent Batts 361f461810 adding javascript assets 2013-08-05 18:25:05 -04:00
assets adding javascript assets 2013-08-05 18:25:05 -04:00
client separating out more code 2013-05-10 15:03:54 -04:00
config moving the config handler out of the main set 2013-05-10 16:22:58 -04:00
hash fixing hash package name 2013-05-09 09:47:24 -04:00
types adding layout for audio mime type files 2013-06-04 16:44:31 -04:00
util moved LogRequest to github.com/vbatts/go-httplog 2013-06-18 15:17:44 -04:00
.gitignore adding a gitignore 2013-02-11 10:56:42 -05:00
LICENSE adding the MIT license 2013-02-12 12:20:23 -05:00
README adding notes and information 2013-05-10 23:44:02 -04:00
db_fileutil.go moved types out to a package 2013-05-09 12:13:46 -04:00
imgsrv.go client provides the 'view' link when a file is uploaded 2013-06-04 16:44:31 -04:00
layouts.go removing the css from the layouts file 2013-08-05 18:14:40 -04:00
server.go referrence the new CSS asset 2013-08-05 18:15:06 -04:00
version.go version bump 2013-05-09 12:54:16 -04:00

README

== Overview

Initially, I just wanted a server that I could upload images to, and quickly
serve back. While it's mostly that, it is the client and server side tooling.

The files are stored in mongoDB, using its GridFS.

== Usage

Server side
For a basic start, make sure mongo is running on the localhost, and run:
  ./imgsrv -server
  2013/02/12 13:03:37 0.0.0.0
  2013/02/12 13:03:37 Serving on 0.0.0.0:7777 ...

For something a bit more complicated, like an openshift diy-0.1 cartridge, 
set your .openshift/action_hooks/start to:
  nohup ${OPENSHIFT_REPO_DIR}/bin/server \
    -server \
    -ip ${OPENSHIFT_INTERNAL_IP} \
    -port 8080 \
    -mongo-host ${OPENSHIFT_NOSQL_DB_URL} \
    >> ${OPENSHIFT_LOG_DIR}/server.log 2>&1 &


Client side:
Either pass the -remotehost flag pointing to your server instance

  imgsrv -remotehost http://hurp.til.derp.com:7777 -put ./lolz.gif -keywords 'cats,lols'


or setup your ~/.imgsrv.yaml, with a the value 'remotehost', like so:
  ---
  remotehost: http://hurp.til.derp.com:7777

then you can drop that flag out, for quicker lolzing:

  imgsrv -put ./lolz.gif -keywords 'cats,lols'
  2013/02/12 13:00:28 POSTing: http://hurp.til.derp.com:7777/f/?filename=lolz.gif&keywords=cats,lols
  2013/02/12 13:00:29 New Image!: http://hurp.til.derp.com:7777/f/lolz.gif


== Dependencies

  go get launchpad.net/goyaml
  go get labix.org/v2/mgo

and put this imgsrv in your GOPATH,
since it references itself.

== Building

Either 

  git clone git://<host>/imgsrv.git
  cd imgsrv
  go build
  ./imgsrv

or

  go get github.com/vbatts/imgsrv