Image (or most any file) Web client and server Backed by MongoDB
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Vincent Batts 7fac419675
small container build
4 years ago
assets adding javascript assets 9 years ago
client client upload works again 9 years ago
config vendoring sources, for posterity sake 4 years ago
dbutil *: fixes to be working on new abstractions 6 years ago
hash shorten the hash 9 years ago
openshift/templates openshift: switch to rolling strategy and fmt 6 years ago
server thinking about how to do a stand alone web server 9 years ago
types types: webm must not have a mimetype yet? 5 years ago
util moved LogRequest to github.com/vbatts/go-httplog 10 years ago
vendor vendoring sources, for posterity sake 4 years ago
.gitignore adding a gitignore 10 years ago
Dockerfile small container build 4 years ago
Gopkg.lock vendoring sources, for posterity sake 4 years ago
Gopkg.toml vendoring sources, for posterity sake 4 years ago
LICENSE adding the MIT license 10 years ago
README.md README: there are more deps 6 years ago
imgsrv.go *: bubble the dbhandler up to cli 6 years ago
layouts.go layouts: autoplay music and video 5 years ago
run.sh run.sh: allow for additional args through env variable 6 years ago
server.go *: bubble the dbhandler up to cli 6 years ago
version.go bumping version to 1.3.0 9 years ago

README.md

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