Merge branch 'master' into celerysubmit

This commit is contained in:
Christopher Allan Webber 2011-04-30 08:27:15 -05:00
commit 776331fd96
17 changed files with 413 additions and 226 deletions

38
README Normal file
View File

@ -0,0 +1,38 @@
========
README
========
What is GNU MediaGoblin?
========================
* Initially, a place to store all your photos thats as awesome as, if
not more awesome than, existing network services (Flickr, SmugMug,
Picasa, etc)
* Later, a place for all sorts of media, such as video, music, etc hosting.
* Federated with OStatus!
* Customizable!
* A place for people to collaborate and show off original and derived
creations Free, as in freedom. Were a GNU project in the making,
afterall.
Is it ready for me to use?
==========================
Not yet! We're working on it and we hope to have a usable system by
September 2011.
Can I help/hang out/participate/whisper sweet nothings in your ear?
===================================================================
Yes! Please join us and hang out! For more information on where we
hang out, see `our Join page <http://mediagoblin.org/join/>`_
Where is the documentation?
===========================
Documentation is located in the ``docs/`` directory in a "raw"
restructured-text form. It is also mirrored at
http://docs.mediagoblin.org/ in HTML form.

0
docs/_static/placeholder vendored Normal file
View File

86
docs/beardomatic.rst Normal file
View File

@ -0,0 +1,86 @@
.. _beardomatic-chapter:
===========================================
Beardomatic: Infrastructure Documentation
===========================================
What the hell is Beardomatic?
=============================
You might be wondering, "Gah! What the hell is Beardomatic!?"
Well, I'll tell you. GNU MediaGoblin is a piece of software that sits
on a stack of libraries that do a bunch of stuff. It makes it easier
to differentiate the bits of code that encompass GNU MediaGoblin from
the bits of code that GNU MediaGoblin sit on top of. Thus, we came up
with the TOTALLY AWESOME name Beardomatic.
Now you might be saying, "Holy crap!? Another web framework? Are you
going to write a mocking framework and an enumeration library, too!?"
No, we're not. We're just calling this Beardomatic so that it's
easier to talk about things. However, at some point, we can take
these infrastructure bits from GNU MediaGoblin and turn them into a
full-blown "web framework". We wouldn't do this to compete for
mindshare with other web frameworks. We would do this to make it
easier for us to bootstrap other similar projects.
Beardomatic software stack
==========================
Beardomatic is a software stack "web framework" composed of the
following bits:
* Project infrastructure
* `Python <http://python.org/>`_: the language we're using to write
this
* `Nose <http://somethingaboutorange.com/mrl/projects/nose/>`_:
for unit tests
* `buildout <http://www.buildout.org/>`_: for getting dependencies,
building a runtime environment, ...
* Data storage
* `MongoDB <http://www.mongodb.org/>`_: the document database backend
for storage
* Web application
* `Paste Deploy <http://pythonpaste.org/deploy/>`_ and
`Paste Script <http://pythonpaste.org/script/>`_: we'll use this for
configuring and launching the application
* `WebOb <http://pythonpaste.org/webob/>`_: nice abstraction layer
from HTTP requests, responses and WSGI bits
* `Routes <http://routes.groovie.org/>`_: for URL routing
* `Beaker <http://beaker.groovie.org/>`_: for handling sessions
* `Jinja2 <http://jinja.pocoo.org/docs/>`_: the templating engine
* `MongoKit <http://namlook.github.com/mongokit/>`_: the lightweight
ORM for MongoDB we're using which will make it easier to define
structures and all that
* `WTForms <http://wtforms.simplecodes.com/>`_: for handling,
validation, and abstraction from HTML forms
* `Celery <http://celeryproject.org/>`_: for task queuing (resizing
images, encoding video, ...)
* `RabbitMQ <http://www.rabbitmq.com/>`_: for sending tasks to celery
* Front end
* `JQuery <http://jquery.com/>`_: for groovy JavaScript things
How to ... in Beardomatic?
==========================
FIXME - write this

View File

@ -1,5 +0,0 @@
====================
Code Documentation
====================
FIXME - stub!

View File

@ -41,16 +41,16 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = u'GNU MediaGoblin' project = u'GNU MediaGoblin'
copyright = u'2011, Chris Webber, et al' copyright = u'2011, Free Software Foundation, Inc and contributors'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.1a1' version = '0.0.1'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.1a1' release = '0.0.1'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -2,72 +2,114 @@
Contributing HOWTO Contributing HOWTO
==================== ====================
We're super glad you want to contribute! Join the community!
===================
We're super glad you want to join our community!
There are a variety of ways you can help us and become part of the There are a variety of ways you can help us and become part of the
team. We're not just looking for coders! We're also looking for team. We're not just looking for coders! We're also looking for
documentation writers, users, testers, evangelists, painters, bakers, documentation writers, users, testers, evangelists, user-interface
candle-stick makers... designers, graphics designers, user-experience designers, system
administrators, friends, painters, bakers, candle-stick makers...
However, if you are a coder and you're looking to code, check out the Here are some things you can do today:
:ref:`hacking-howto`.
The rest of this chapter talks about different things we need your
help with.
**Become a user** **Hang out with us**
We're building GNU MediaGoblin for us and for you but really You should hang out with us! We like people like you!
you're one of us and I am you and we are we and GNU MediaGoblin is
the walrus. At a bare minimum, join the `mailing list
<http://mediagoblin.org/join/>`_ and say, "Hi!"
We also hang out on IRC in ``#mediagoblin`` on Freenode.net.
**File bugs**
Filing bugs is a critical part of any project. For more
information on filing bugs, see :ref:`filing-bugs`.
**Write/Fix some code**
If you are a coder and you're looking to code, check out the
:ref:`hacking-howto`. We even have tips on *becoming* a coder
and we're willing to help you!
**Send encouragement**
A nice word from you could send someone into a tizzy of
productive work. Ten nice words could complete a feature.
One hundred nice words could get us to the next milestone.
Send it to the `mailing list <http://mediagoblin.org/join/>`_
or hop into ``#mediagoblin`` on Freenode.net and let us know.
**Spread the word**
The seductive call of Free Software services is a powerful
one, but many cannot hear it because it'd drowned out by the
rush hour traffic honking of proprietary walled gardens and
faux free services. Yuck! Be the sweet chirrup of the bird
amidst the din! Tell others that there is a better way to
live!
FIXME - do we want to talk about ways to spread the word?
FIXME - how can people notify us that they're spreading the
word?
We're still working on project infrastructure. We hope to have the
bits in place for these additional things to do in the coming months:
**Become a user**
We're building GNU MediaGoblin for us and for you but really
you're one of us and I am you and we are we and GNU
MediaGoblin is the walrus.
Sign up for an account. Use the service. Relish in the thought Sign up for an account. Use the service. Relish in the
that this service comes with a heaping side of Freedom and you can thought that this service comes with a heaping side of Freedom
salt and pepper it to your liking. and you can salt and pepper it to your liking.
**File bugs** **Help other users**
Filing bugs is a critical part of any project. For more Have you spent time with GNU MediaGoblin? If so, your
information on filing bugs, see :ref:`filing-bugs`. experience and wisdom are invaluable and you're the best
person we can think of to help other users with their
questions.
**Translate GNU MediaGoblin** **Run your own instance**
Knowing more than one language is an important skill. If you are Are there things about our instance you want to change? Are
multi-lingual and are interested in translating GNU MediaGoblin, there things about other instances you wish were different?
see :ref:`translating`. Want to test upcoming changes? Want to create patches to
implement things you need? That's great---you can run your
own instance!
**Create a theme**
As people deploy their own GNU MediaGoblin instances, good themes
are a must have! For more information on theming, see
:ref:`theming-howto`.
**Spread the word**
The seductive call of Free Software services is a powerful one,
but many cannot hear it because it'd drowned out by the rush hour
traffic honking of proprietary walled gardens and faux free
services. Yuck! Be the sweet chirrup of the bird amidst the din!
Tell others that there is a better way to live!
FIXME - do we want to talk about ways to spread the word?
FIXME - how can people notify us that they're spreading the word?
**Run your own instance**
Are there things about our instance you want to change? Are there
things about other instances you wish were different? That's
great--you can run your own instance!
For more information on deploying your own instance, see For more information on deploying your own instance, see
:ref:`deployment-howto`. :ref:`deployment-howto`.
**Translate GNU MediaGoblin**
Knowing more than one language is an important skill. If you
are multi-lingual and are interested in translating GNU
MediaGoblin, see :ref:`translating`.
**Create a theme**
As people deploy their own GNU MediaGoblin instances, good
themes are a must have! For more information on theming, see
:ref:`theming-howto`.
Contributing thank you drawings / copyright assignment Contributing thank you drawings / copyright assignment
@ -93,8 +135,7 @@ File bugs
GNU MediaGoblin uses a bug tracker called `Redmine GNU MediaGoblin uses a bug tracker called `Redmine
<http://www.redmine.org>`_. <http://www.redmine.org>`_.
The bug tracker is at http://bugs.foocorp.net/ and bugs go in the The bug tracker is at `<http://bugs.foocorp.net/projects/mediagoblin>`_.
``GNU mediagoblin`` project.
A good bug report has the following things in it: A good bug report has the following things in it:

View File

@ -9,3 +9,5 @@ Step 1: Write code that can be deployed.
Step 2: ? Step 2: ?
Step 3: Write the deployment guide and profit! Step 3: Write the deployment guide and profit!
But seriously, this is a stub since we're not quite there, yet.

View File

@ -17,11 +17,11 @@ Chris Webber on "Why Python":
software web applications before in Python, including `Miro software web applications before in Python, including `Miro
Community`_, the `Miro Guide`_, a large portion of `Creative Community`_, the `Miro Guide`_, a large portion of `Creative
Commons`_, and a whole bunch of things while working at `Imaginary Commons`_, and a whole bunch of things while working at `Imaginary
Landscape`_). I know Python, I can make this happen in Python, me Landscape`_). Me starting a project like this makes sense if it's
starting a project like this makes sense if it's done in Python. done in Python.
You might say that PHP is way more deployable, that Rails has way You might say that PHP is way more deployable, that Rails has way
more cool developers riding around on fixie bikes, and all of more cool developers riding around on fixie bikes---and all of
those things are true. But I know Python, like Python, and think those things are true. But I know Python, like Python, and think
that Python is pretty great. I do think that deployment in Python that Python is pretty great. I do think that deployment in Python
is not as good as with PHP, but I think the days of shared hosting is not as good as with PHP, but I think the days of shared hosting
@ -159,14 +159,16 @@ Why Sphinx for documentation
Will Kahn-Greene on "Why Sphinx": Will Kahn-Greene on "Why Sphinx":
Sphinx is a fantastic tool for organizing documentation for a `Sphinx`_ is a fantastic tool for organizing documentation for a
Python-based project that makes it pretty easy to write docs that Python-based project that makes it pretty easy to write docs that
are readable in source form and can be "compiled" into HTML, LaTeX are readable in source form and can be "compiled" into HTML, LaTeX
and other formats. and other formats.
There are other doc systems out there, but given that GNU There are other doc systems out there, but given that GNU
MediaGoblin is being written in Python, it makes sense to use MediaGoblin is being written in Python and I've done a ton of
Sphinx for now. documentation using Sphinx, it makes sense to use Sphinx for now.
.. _Sphinx: http://sphinx.pocoo.org/
Why AGPLv3 and CC0? Why AGPLv3 and CC0?

View File

@ -16,8 +16,8 @@ This manual is a living document and is in the ``mediagoblin``
repository in the ``docs/`` directory. repository in the ``docs/`` directory.
Who wrote this documentation Who wrote this documentation?
============================ =============================
In no particular order: In no particular order:
@ -26,16 +26,18 @@ In no particular order:
* Deb * Deb
* Greg * Greg
* Karen * Karen
* Matt
* Asheesh
How should I bring up errors in the documentation I found an error in the docs---who do I tell?
================================================= =============================================
There are a few ways--please pick the one most convenient to you! There are a few ways---please pick the one most convenient to you!
1. Send an email to Will ``willg at bluesock dot org``. 1. Write up a bug report in the bug tracker at http://bugs.foocorp.net/ .
2. Write up a bug report in the bug tracker at http://bugs.foocorp.net/ . 2. Tell someone on IRC ``#mediagoblin`` on Freenode.
3. Tell someone on IRC ``#mediagoblin`` on Freenode. 3. Send an email to Will ``willg at bluesock dot org``.
When you tell us about your issue, please let us know: When you tell us about your issue, please let us know:

View File

@ -8,8 +8,9 @@
So you want to hack on GNU MediaGoblin? So you want to hack on GNU MediaGoblin?
======================================= =======================================
First thing to do is check out the Web site where we list all the First thing to do is check out the `Web site
project infrastructure including: <http://mediagoblin.org>`_ where we list all the project
infrastructure including:
* the mailing list * the mailing list
* the IRC channel * the IRC channel
@ -41,7 +42,8 @@ If you're running Debian GNU/Linux or a Debian-derived distribution
such as Mint or Ubuntu, running the following should install these such as Mint or Ubuntu, running the following should install these
requirements:: requirements::
sudo apt-get install mongodb git-core python python-dev python-lxml sudo apt-get install mongodb git-core python python-dev \
python-lxml
Running bootstrap and buildout Running bootstrap and buildout
@ -78,11 +80,34 @@ Updating dependencies
--------------------- ---------------------
While hacking on GNU MediaGoblin over time, you'll eventually have to While hacking on GNU MediaGoblin over time, you'll eventually have to
update the dependencies. To do that, run:: update your development environment. To do that, run::
./bin/buildout ./bin/buildout
Wiping your environment for a clean-slate
-----------------------------------------
.. Note::
Unless you're doing development and working on and testing creating
a new instance, you will probably never have to do this. Will
plans to do this work and thus he documented it.
Delete the following directories:
* bin/
* develop-eggs/
* eggs/
* mediagoblin.egg-info/
* parts/
* user_dev/
FIXME - how to drop data from mongodb? we should probably write a
script.
Running the server Running the server
================== ==================
@ -99,6 +124,32 @@ Run::
./bin/nosetests ./bin/nosetests
What's where
============
After you've run buildout, you're faced with the following directory
tree::
mediagoblin/
|- mediagoblin/ source code
| |- tests/
| |- templates/
| |- auth/
| \- submit/
|- docs/ documentation
|
| the rest of these directories are generated by
| buildout.
|
|- bin/ scripts
|- develop-eggs/
|- eggs/
|- mediagoblin.egg-info/
|- parts/
|- user_dev/ sessions, etc
Quickstart for Django programmers Quickstart for Django programmers
================================= =================================
@ -109,3 +160,49 @@ Bite-sized bugs to start with
============================= =============================
FIXME - write this FIXME - write this
Tips for people new to coding
=============================
Python
------
GNU MediaGoblin is written using a programming language called `Python
<http://python.org/>`_.
There are two different incompatible iterations of Python which I'll
refer to as Python 2 and Python 3. GNU MediaGoblin is written in
Python 2 and requires Python 2.6 or 2.7. At some point, we might
switch to Python 3, but that's a future thing.
You can learn how to code in Python 2 from several excellent books
that are freely available on the Internet:
* `Learn Python the Hard Way <http://learnpythonthehardway.org/>`_
* `Dive Into Pyton <http://diveintopython.org/>`_
* `Python for Software Design <http://www.greenteapress.com/thinkpython/>`_
* `A Byte of Python <http://www.swaroopch.com/notes/Python>`_
These are all excellent texts.
FIXME - are there good quality Python tutorial videos?
Libraries
---------
GNU MediaGoblin uses a variety of libraries in order to do what it
does. These libraries are listed in the :ref:`beardomatic-chapter`
along with links to the project Web sites and documentation for the
libraries.
There are a variety of Python-related conferences every year that have
sessions covering many aspects of these libraries. You can find them
at `Python Miro Community <http://python.mirocommunity.org>`_ [0]_.
.. [0] This is a shameless plug. Will Kahn-Greene runs Python Miro
Community.
If you have questions or need help, find us on the mailing list and on
IRC.

View File

@ -17,10 +17,9 @@ Table of Contents:
deploymenthowto deploymenthowto
hackinghowto hackinghowto
theminghowto theminghowto
softwarestack
designdecisions designdecisions
workflow vision
codedocs beardomatic
Indices and tables Indices and tables

View File

@ -5,12 +5,13 @@
What is GNU MediaGoblin What is GNU MediaGoblin
======================= =======================
Three years ago, a number of free software luminaries got together at Three years ago (2008), a number of free software luminaries got
the FSF office to answer the question, "What should software freedom together at the FSF office to answer the question, "What should
look like on the participatory web?" Those thinkers included Richard software freedom look like on the participatory web?" Those thinkers
Stallman - founder of the free software movement and instigator of the included Richard Stallman---founder of the free software movement and
GNU project, Evan Prodromou - the driving force behind Status.net, a instigator of the GNU project, Evan Prodromou---the driving force
highly sucessful federated micro-blogging service, and FIXME. behind Status.net, a highly sucessful federated micro-blogging
service, and FIXME.
Since that time Identi.ca and Libre.fm have answered the Since that time Identi.ca and Libre.fm have answered the
freedom-loving web-user's need for micro-blogging and music sharing. freedom-loving web-user's need for micro-blogging and music sharing.
@ -46,10 +47,12 @@ How can I participate?
See `Get Involved <http://mediagoblin.org/join/>`. See `Get Involved <http://mediagoblin.org/join/>`.
How is this licensed? How is GNU MediaGoblin licensed?
===================== ================================
FIXME - write this once we work out the details GNU MediaGoblin software is released under an AGPLv3 license.
See the ``COPYING`` file in the source for details.
Is this an official GNU Project? What does that mean? Is this an official GNU Project? What does that mean?

View File

@ -1,127 +0,0 @@
=======
Stack
=======
The software stack for this project might change over time, but this
is what we're thinking right now.
There's some explanation of design decisions in the
:ref:`design-decisions-chapter`.
Python
======
* http://python.org/
The core team does a lot of work in Python and it's the language we're
most likely to do a project like this in.
MongoDB
=======
* http://www.mongodb.org/
A "document database". Because it's extremely flexible and scales up
well, but I guess not down well.
MongoKit
========
* http://namlook.github.com/mongokit/
A lightweight ORM for mongodb. Helps us define our structures better,
does schema validation, schema evolution, and helps make things more
fun and pythonic.
Jinja2
======
* http://jinja.pocoo.org/docs/
For templating. Pretty much django templates++ but allows us to pass
arguments into method calls instead of writing custom tags.
WTForms
=======
* http://wtforms.simplecodes.com/
For form handling, validation, abstraction. Almost just like Django's
templates.
WebOb
=====
* http://pythonpaste.org/webob/
Gives nice request/response objects (also somewhat Django-ish).
Paste Deploy and Paste Script
=============================
* http://pythonpaste.org/deploy/
* http://pythonpaste.org/script/
This will be the default way of configuring and launching the
application. Since GNU MediaGoblin will be fairly WSGI minimalist though,
you can probably use other ways to launch it, though this will be the
default.
Routes
======
* http://routes.groovie.org/
For URL Routing. It works well enough.
JQuery
======
* http://jquery.com/
For all sorts of things on the JavaScript end of things, for all sorts
of reasons.
Beaker
======
* http://beaker.groovie.org/
For sessions, because that seems like it's generally considered the
way to go I guess.
Nose
====
* http://somethingaboutorange.com/mrl/projects/nose/1.0.0/
For unit tests because it makes testing a bit nicer.
Celery
======
* http://celeryproject.org/
For task queueing (resizing images, encoding video, ...).
RabbitMQ
========
* http://www.rabbitmq.com/
For sending tasks to celery, because I guess that's what most people
do. Might be optional, might also let people use MongoDB for this if
they want.

View File

@ -1,21 +1,26 @@
========================================================================== =========================================
Design Document: Workflow, and other structurally significant braindumps Design Document: GNU MediaGoblin vision
========================================================================== =========================================
.. Note:: .. Note::
When we get a wiki, this will get moved there. It's here for now When we get a wiki, this will get moved there. It's here for now
mostly because we didn't have a better place for it. mostly because we didn't have a better place for it.
.. Note::
This document attempts to describe the envisioned workflow of By the time you read this, it's very likely it'll be out of date.
mediagoblin, from a structural standpoint. For now, *nothing* in this
This document attempts to describe the envisioned workflow of GNU
MediaGoblin, from a structural standpoint. For now, *nothing* in this
document is probably the eventual, final way that things will work. document is probably the eventual, final way that things will work.
Eventually as things come to exist, this document will hopefully be Eventually as things come to exist, this document will hopefully be
refactored to describe how things *do* work. refactored to describe how things *do* work.
This documented on hopes, dreams, rainbows, and unicorns. And it will This documented on hopes, dreams, rainbows, and unicorns. And it will
come to fulfillment through a lot of hard work. come to fulfillment through a lot of hard work. Your hard work and my
hard work.
Look and feel Look and feel
@ -31,6 +36,7 @@ here.
http://mairin.wordpress.com/2010/03/09/another-design-hub-mockup/ http://mairin.wordpress.com/2010/03/09/another-design-hub-mockup/
User profile mockup User profile mockup
------------------- -------------------

View File

@ -49,7 +49,7 @@ class User(Document):
'created': datetime.datetime.utcnow, 'created': datetime.datetime.utcnow,
'email_verified': False, 'email_verified': False,
# TODO: shouldn't be active by default, must have email registration # TODO: shouldn't be active by default, must have email registration
'status': 'active'} 'status': u'active'}
def check_login(self, password): def check_login(self, password):
""" """

View File

@ -0,0 +1,39 @@
{#
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 Free Software Foundation, Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "mediagoblin/base.html" %}
{% block mediagoblin_content %}
<h2>Welcome to GNU MediaGoblin!</h2>
{% if request.user %}
<p>
<a href="{{ request.urlgen('mediagoblin.submit.start') }}">Submit an item</a>.
</p>
{% else %}
<p>
If you have an account, you can
<a href="{{ request.urlgen('mediagoblin.auth.login') }}">Login</a>.
</p>
<p>
If you don't have an account, please
<a href="{{ request.urlgen('mediagoblin.auth.register') }}">Register</a>.
</p>
{% endif %}
{% endblock %}

View File

@ -22,7 +22,11 @@ import wtforms
from mediagoblin import models from mediagoblin import models
def root_view(request): def root_view(request):
return Response("This is the root") template = request.template_env.get_template(
'mediagoblin/root.html')
return Response(
template.render(
{'request': request}))
class ImageSubmitForm(wtforms.Form): class ImageSubmitForm(wtforms.Form):