1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2024-11-23 08:35:43 +00:00
Image (or most any file) Web client and server Backed by MongoDB
Find a file
Vincent Batts 3c732c3b43
vendoring sources, for posterity sake
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-03-11 15:31:42 -04:00
assets adding javascript assets 2013-08-05 18:25:05 -04:00
client client upload works again 2013-10-10 10:31:27 -04:00
config vendoring sources, for posterity sake 2019-03-11 15:31:42 -04:00
dbutil *: fixes to be working on new abstractions 2017-04-07 13:29:07 -04:00
hash shorten the hash 2013-11-07 10:01:36 -05:00
openshift/templates openshift: switch to rolling strategy and fmt 2017-06-08 15:38:58 -04:00
server thinking about how to do a stand alone web server 2013-10-09 09:41:02 -04:00
types types: webm must not have a mimetype yet? 2017-08-08 16:18:44 -04:00
util moved LogRequest to github.com/vbatts/go-httplog 2013-06-18 15:17:44 -04:00
vendor vendoring sources, for posterity sake 2019-03-11 15:31:42 -04:00
.gitignore adding a gitignore 2013-02-11 10:56:42 -05:00
Dockerfile Dockerfile: permission denied 2017-06-08 15:30:14 -04:00
Gopkg.lock vendoring sources, for posterity sake 2019-03-11 15:31:42 -04:00
Gopkg.toml vendoring sources, for posterity sake 2019-03-11 15:31:42 -04:00
imgsrv.go *: bubble the dbhandler up to cli 2017-04-07 13:42:12 -04:00
layouts.go layouts: autoplay music and video 2017-08-08 16:24:05 -04:00
LICENSE adding the MIT license 2013-02-12 12:20:23 -05:00
README.md README: there are more deps 2017-03-10 15:47:23 -05:00
run.sh run.sh: allow for additional args through env variable 2017-06-08 14:52:25 -04:00
server.go *: bubble the dbhandler up to cli 2017-04-07 13:42:12 -04:00
version.go bumping version to 1.3.0 2013-10-10 10:46:25 -04:00

imgsrv

go v1.1.1 mongoDB v2.4 license MIT

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
imgsrv