1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2024-11-23 16:45:39 +00:00
Image (or most any file) Web client and server Backed by MongoDB
Find a file
Vincent Batts 51ff306fd9 Revert "my rand helper wasn't helping"
This reverts commit 84e5af9fc2.
2013-02-13 22:30:04 -05:00
.gitignore adding a gitignore 2013-02-11 10:56:42 -05:00
client.go cleanup: more separating into files 2013-02-08 23:43:39 -05:00
config.go cleanup: more separating into files 2013-02-08 23:43:39 -05:00
db_fileutil.go Revert "my rand helper wasn't helping" 2013-02-13 22:30:04 -05:00
hash.go Revert "my rand helper wasn't helping" 2013-02-13 22:30:04 -05:00
imgsrv.go many updates, and cleanup, but the /upload form is not quite working yet 2013-02-11 14:27:38 -05:00
layouts.go adding app version, and putting it in the footer 2013-02-12 11:09:41 -05:00
LICENSE adding the MIT license 2013-02-12 12:20:23 -05:00
README a little bit of README docs 2013-02-12 13:10:59 -05:00
server.go Revert "my rand helper wasn't helping" 2013-02-13 22:30:04 -05:00
types.go multipart form! it actually uploads now. 2013-02-11 18:05:43 -05:00
version.go adding app version, and putting it in the footer 2013-02-12 11:09:41 -05:00

== 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


== Building

Either 

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

or

  go get github.com/vbatts/imgsrv