gomedia

command module
Version: v0.0.0-...-97f85ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2015 License: MIT Imports: 24 Imported by: 0

README

GoMedia

Tweetbot custom media endpoint for uploads to S3, written in Go. Heavily influenced by s3itch.

Install/Build/Deploy

Automatic

Deploy

See the Environment Variables section below for help with the configuration options.

Manual procedure
Configure the buildpack

If you're creating a new heroku app, set the buildpack on creation:

heroku create -b https://github.com/heroku/heroku-buildpack-go.git --region=eu

For an existing Heroku app, set the BUILDPACK_URL:

heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-go.git
Set environment variables

GoMedia uses environment variables for configuration (see all available options below).

Before pushing to Heroku, you should at the very least set the required options, e.g.

heroku config:set AWS_ACCESS_KEY_ID="…" AWS_SECRET_ACCESS_KEY="…"  \
AWS_REGION="eu-west-1" BUCKET_NAME="mybucket"

It is highly recommended that you also set a username and password (for the obvious reasons).

Push to Heroku
git push heroku master
Environment Variables / Configuration
  • AWS_ACCESS_KEY_ID — (required) self-explanatory
  • AWS_SECRET_ACCESS_KEY — (required) self-explanatory
  • AWS_REGION — (optional) the AWS region. Defaults to us-east-1
  • BUCKET_NAME — (required) the name of your S3 bucket
  • BASE_URL — (optional) the base URL for generated URLs (no trailing slash)
    • Defaults to the bucket url (e.g. https://s3-eu-west-1.amazonaws.com/BUCKET_NAME/)
    • If you're using a custom CNAME (or a CDN) set it to the hostname (beginning with http or https)
  • HTTP_PASSWORD — (recommended) protect the upload endpoints with basic auth
  • HTTP_USER — (recommended) protect the upload endpoints with basic auth
  • AIRBRAKE_API_KEY — (optional) set this to your Airbrake API key if you want airbrake support
  • AIRBRAKE_ENDPOINT — (optional) configure this if you use Errbit (or some other custom endpoint)
    • e.g. https://myerribt.herokuapp.com/notifier_api/v2/notices
  • AIRBRAKE_ENVIRONMENT — (optional) set the environment for Airbrake, defaults to development

Use with Tweetbot

GoMedia works as a Custom Media Upload endpoint for Tweetbot (both iOS and OS X).

All you need to do is set the custom endpoint URL to:

https://MYAPPNAME.herokuapp.com/tweetbot?username=USERNAME&password=PASSWORD

Replace USERNAME and PASSWORD with your own credentials and MYAPPNAME with your Heroku app name…

Tweetbot for Mac configuration

Tweetbot for iOS configuration

Use with Monosnap

For monosnap you need to configure a WebDAV endpoint with the app URL and credentials. Do not set the port!

GoMedia Monosnap configuration

You need to configure the Base URL in Monosnap regardless of whether you're using a custom base URL or not.

With Monosnap it is recommended to add %R to the filename template because the filename cannot be altered server side (thus there's a small chance that the filename will conflict with an existing file in the bucket).

Advanced Monosnap configuration

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/crowdmob/goamz/aws
goamz - Go packages to interact with the Amazon Web Services.
goamz - Go packages to interact with the Amazon Web Services.
_workspace/src/github.com/tv42/base58
Package base58 implements a human-friendly base58 encoding.
Package base58 implements a human-friendly base58 encoding.
_workspace/src/github.com/zenazn/goji
Package goji provides an out-of-box web server with reasonable defaults.
Package goji provides an out-of-box web server with reasonable defaults.
_workspace/src/github.com/zenazn/goji/bind
Package bind provides a convenient way to bind to sockets.
Package bind provides a convenient way to bind to sockets.
_workspace/src/github.com/zenazn/goji/example
Command example is a sample application built with Goji.
Command example is a sample application built with Goji.
_workspace/src/github.com/zenazn/goji/graceful
Package graceful implements graceful shutdown for HTTP servers by closing idle connections after receiving a signal.
Package graceful implements graceful shutdown for HTTP servers by closing idle connections after receiving a signal.
_workspace/src/github.com/zenazn/goji/graceful/listener
Package listener provides a way to incorporate graceful shutdown to any net.Listener.
Package listener provides a way to incorporate graceful shutdown to any net.Listener.
_workspace/src/github.com/zenazn/goji/web
Package web implements a fast and flexible middleware stack and mux.
Package web implements a fast and flexible middleware stack and mux.
_workspace/src/github.com/zenazn/goji/web/middleware
Package middleware provides several standard middleware implementations.
Package middleware provides several standard middleware implementations.
_workspace/src/github.com/zenazn/goji/web/mutil
Package mutil contains various functions that are helpful when writing http middleware.
Package mutil contains various functions that are helpful when writing http middleware.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL