Commit | Line | Data |
---|---|---|
ed6a0bcd | 1 | .. _original-design-decisions-chapter: |
43a2f7fe | 2 | |
ed6a0bcd E |
3 | =========================== |
4 | Original Design Decisions | |
5 | =========================== | |
43a2f7fe E |
6 | |
7 | .. contents:: Sections | |
8 | :local: | |
9 | ||
10 | ||
11 | This chapter talks a bit about design decisions. | |
12 | ||
f6097b2e CAW |
13 | Note: This is an outdated document. It's more or less the historical |
14 | reasons for a lot of things. That doesn't mean these decisions have | |
15 | stayed the same or we haven't changed our minds on some things! | |
16 | ||
43a2f7fe E |
17 | |
18 | Why GNU MediaGoblin? | |
19 | ==================== | |
20 | ||
21 | Chris and Will on "Why GNU MediaGoblin": | |
22 | ||
23 | Chris came up with the name MediaGoblin. The name is pretty fun. | |
24 | It merges the idea that this is a Media hosting project with | |
25 | Goblin which sort of sounds like gobbling. Here's a piece of | |
26 | software that gobbles up your media for all to see. | |
27 | ||
28 | `According to Wikipedia <http://en.wikipedia.org/wiki/Goblin>`_, a | |
29 | goblin is: | |
30 | ||
31 | a legendary evil or mischievous illiterate creature, described | |
32 | as grotesquely evil or evil-like phantom | |
33 | ||
34 | So are we evil? No. Are we mischievous or illiterate? Not | |
35 | really. So what kind of goblin are we thinking about? We're | |
36 | thinking about these goblins: | |
37 | ||
ed6a0bcd | 38 | .. figure:: ../_static/goblin.png |
43a2f7fe E |
39 | :alt: Cute goblin with a beret. |
40 | ||
9650aa39 | 41 | *Figure 1: Cute goblin with a beret. Illustrated by Chris |
43a2f7fe E |
42 | Webber* |
43 | ||
ed6a0bcd | 44 | .. figure:: ../_static/snugglygoblin.png |
43a2f7fe E |
45 | :scale: 50% |
46 | :alt: Snuggly goblin with a beret. | |
47 | ||
48 | *Figure 2: Snuggly goblin. Illustrated by Karen Rustad* | |
49 | ||
50 | Those are pretty cute goblins. Those are the kinds of goblins | |
51 | we're thinking about. | |
52 | ||
53 | Chris started doing work on the project after thinking about it | |
54 | for a year. Then, after talking with Matt and Rob, it became an | |
55 | official GNU project. Thus we now call it GNU MediaGoblin. | |
56 | ||
57 | That's a lot of letters, though, so in the interest of brevity and | |
58 | facilitating easier casual conversation and balancing that with | |
59 | what's important to us, we have the following rules: | |
60 | ||
61 | 1. "GNU MediaGoblin" is the name we're going to use in all official | |
62 | capacities: web site, documentation, press releases, ... | |
63 | ||
9650aa39 | 64 | 2. In casual conversation, it's OK to use more casual names. |
43a2f7fe E |
65 | |
66 | 3. If you're writing about the project, we ask that you call it GNU | |
67 | MediaGoblin. | |
68 | ||
69 | 4. If you don't like the name, we kindly ask you to take a deep | |
70 | breath, think a happy thought about cute little goblins playing | |
71 | on a playground and taking cute pictures of themselves, and let | |
72 | it go. (Will added this one.) | |
73 | ||
74 | ||
75 | Why Python | |
76 | ========== | |
77 | ||
78 | Chris Webber on "Why Python": | |
79 | ||
80 | Because I know Python, love Python, am capable of actually making | |
81 | this thing happen in Python (I've worked on a lot of large free | |
82 | software web applications before in Python, including `Miro | |
83 | Community`_, the `Miro Guide`_, a large portion of `Creative | |
84 | Commons`_, and a whole bunch of things while working at `Imaginary | |
85 | Landscape`_). Me starting a project like this makes sense if it's | |
86 | done in Python. | |
87 | ||
88 | You might say that PHP is way more deployable, that Rails has way | |
89 | more cool developers riding around on fixie bikes---and all of | |
90 | those things are true. But I know Python, like Python, and think | |
91 | that Python is pretty great. I do think that deployment in Python | |
92 | is not as good as with PHP, but I think the days of shared hosting | |
93 | are (thankfully) coming to an end, and will probably be replaced | |
94 | by cheap virtual machines spun up on the fly for people who want | |
95 | that sort of stuff, and Python will be a huge part of that future, | |
96 | maybe even more than PHP will. The deployment tools are getting | |
97 | better. Maybe we can use something like Silver Lining. Maybe we | |
98 | can just distribute as ``.debs`` or ``.rpms``. We'll figure it | |
99 | out when we get there. | |
100 | ||
101 | Regardless, if I'm starting this project, which I am, it's gonna | |
102 | be in Python. | |
103 | ||
104 | .. _Miro Community: http://mirocommunity.org/ | |
105 | .. _Miro Guide: http://miroguide.org/ | |
106 | .. _Creative Commons: http://creativecommons.org/ | |
107 | .. _Imaginary Landscape: http://www.imagescape.com/ | |
108 | ||
109 | ||
110 | Why WSGI Minimalism | |
111 | =================== | |
112 | ||
113 | Chris Webber on "Why WSGI Minimalism": | |
114 | ||
115 | If you notice in the technology list I list a lot of components | |
9650aa39 | 116 | that are very "Django-like", but not actually `Django`_ |
43a2f7fe E |
117 | components. What can I say, I really like a lot of the ideas in |
118 | Django! Which leads to the question: why not just use Django? | |
119 | ||
120 | While I really like Django's ideas and a lot of its components, I | |
121 | also feel that most of the best ideas in Django I want have been | |
122 | implemented as good or even better outside of Django. I could | |
123 | just use Django and replace the templating system with Jinja2, and | |
124 | the form system with wtforms, and the database with MongoDB and | |
125 | MongoKit, but at that point, how much of Django is really left? | |
126 | ||
127 | I also am sometimes saddened and irritated by how coupled all of | |
128 | Django's components are. Loosely coupled yes, but still coupled. | |
129 | WSGI has done a good job of providing a base layer for running | |
130 | applications on and if you know how to do it yourself [1]_, it's | |
131 | not hard or many lines of code at all to bind them together | |
132 | without any framework at all (not even say `Pylons`_, `Pyramid`_ | |
133 | or `Flask`_ which I think are still great projects, especially for | |
134 | people who want this sort of thing but have no idea how to get | |
135 | started). And even at this already really early stage of writing | |
136 | MediaGoblin, that glue work is mostly done. | |
137 | ||
138 | Not to say I don't think Django isn't great for a lot of things. | |
139 | For a lot of stuff, it's still the best, but not for MediaGoblin, | |
140 | I think. | |
141 | ||
142 | One thing that Django does super well though is documentation. It | |
143 | still has some faults, but even with those considered I can hardly | |
144 | think of any other project in Python that has as nice of | |
145 | documentation as Django. It may be worth learning some lessons on | |
146 | documentation from Django [2]_, on that note. | |
147 | ||
148 | I'd really like to have a good, thorough hacking-howto and | |
149 | deployment-howto, especially in the former making some notes on | |
150 | how to make it easier for Django hackers to get started. | |
151 | ||
152 | .. _Django: http://www.djangoproject.com/ | |
153 | .. _Pylons: http://pylonshq.com/ | |
154 | .. _Pyramid: http://docs.pylonsproject.org/projects/pyramid/dev/ | |
155 | .. _Flask: http://flask.pocoo.org/ | |
156 | ||
157 | .. [1] http://pythonpaste.org/webob/do-it-yourself.html | |
158 | .. [2] http://pycon.blip.tv/file/4881071/ | |
159 | ||
160 | ||
161 | Why MongoDB | |
162 | =========== | |
163 | ||
f6097b2e CAW |
164 | (Note: We don't use MongoDB anymore. This is the original rationale, |
165 | however.) | |
166 | ||
43a2f7fe E |
167 | Chris Webber on "Why MongoDB": |
168 | ||
169 | In case you were wondering, I am not a NOSQL fanboy, I do not go | |
170 | around telling people that MongoDB is web scale. Actually my | |
171 | choice for MongoDB isn't scalability, though scaling up really | |
172 | nicely is a pretty good feature and sets us up well in case large | |
173 | volume sites eventually do use MediaGoblin. But there's another | |
174 | side of scalability, and that's scaling down, which is important | |
175 | for federation, maybe even more important than scaling up in an | |
176 | ideal universe where everyone ran servers out of their own | |
177 | housing. As a memory-mapped database, MongoDB is pretty hungry, | |
178 | so actually I spent a lot of time debating whether the inability | |
9650aa39 | 179 | to scale down as nicely as something like SQL has with SQLite |
43a2f7fe E |
180 | meant that it was out. |
181 | ||
182 | But I decided in the end that I really want MongoDB, not for | |
183 | scalability, but for flexibility. Schema evolution pains in SQL | |
184 | are almost enough reason for me to want MongoDB, but not quite. | |
185 | The real reason is because I want the ability to eventually handle | |
186 | multiple media types through MediaGoblin, and also allow for | |
187 | plugins, without the rigidity of tables making that difficult. In | |
188 | other words, something like:: | |
189 | ||
190 | {"title": "Me talking until you are bored", | |
191 | "description": "blah blah blah", | |
192 | "media_type": "audio", | |
193 | "media_data": { | |
194 | "length": "2:30", | |
195 | "codec": "OGG Vorbis"}, | |
196 | "plugin_data": { | |
197 | "licensing": { | |
198 | "license": "http://creativecommons.org/licenses/by-sa/3.0/"}}} | |
199 | ||
200 | ||
201 | Being able to just dump media-specific information in a media_data | |
9650aa39 | 202 | hash table is pretty great, and even better is having a plugin |
43a2f7fe E |
203 | system where you can just let plugins have their own entire |
204 | key-value space cleanly inside the document that doesn't interfere | |
205 | with anyone else's stuff. If we were to let plugins to deposit | |
206 | their own information inside the database, either we'd let plugins | |
207 | create their own tables which makes SQL migrations even harder | |
208 | than they already are, or we'd probably end up creating a table | |
209 | with a column for key, a column for value, and a column for type | |
210 | in one huge table called "plugin_data" or something similar. (Yo | |
211 | dawg, I heard you liked plugins, so I put a database in your | |
212 | database so you can query while you query.) Gross. | |
213 | ||
214 | I also don't want things to be too loose so that we forget or lose | |
215 | the structure of things, and that's one reason why I want to use | |
216 | MongoKit, because we can cleanly define a much structure as we | |
217 | want and verify that documents match that structure generally | |
218 | without adding too much bloat or overhead (MongoKit is a pretty | |
219 | lightweight wrapper and doesn't inject extra MongoKit-specific | |
220 | stuff into the database, which is nice and nicer than many other | |
221 | ORMs in that way). | |
222 | ||
223 | ||
224 | Why Sphinx for documentation | |
225 | ============================ | |
226 | ||
227 | Will Kahn-Greene on "Why Sphinx": | |
228 | ||
229 | `Sphinx`_ is a fantastic tool for organizing documentation for a | |
230 | Python-based project that makes it pretty easy to write docs that | |
231 | are readable in source form and can be "compiled" into HTML, LaTeX | |
232 | and other formats. | |
233 | ||
234 | There are other doc systems out there, but given that GNU | |
235 | MediaGoblin is being written in Python and I've done a ton of | |
236 | documentation using Sphinx, it makes sense to use Sphinx for now. | |
237 | ||
238 | .. _Sphinx: http://sphinx.pocoo.org/ | |
239 | ||
240 | ||
241 | Why AGPLv3 and CC0? | |
242 | =================== | |
243 | ||
244 | Chris, Brett, Will, Rob, Matt, et al curated into a story where | |
245 | everyone is the hero by Will on "Why AGPLv3 and CC0": | |
246 | ||
247 | The `AGPL v3`_ preserves the freedoms guaranteed by the GPL v3 in | |
248 | the context of software as a service. Using this license ensures | |
249 | that users of the service have the ability to examine the source, | |
250 | deploy their own instance, and implement their own version. This | |
251 | is really important to us and a core mission component of this | |
252 | project. Thus we decided that the software parts should be under | |
253 | this license. | |
254 | ||
255 | However, the project is made up of more than just software: | |
256 | there's CSS, images, and other output-related things. We wanted | |
257 | the templates/images/css side of the project all permissive and | |
258 | permissive in the same absolutely permissive way. We're waiving | |
259 | our copyrights to non-software things under the CC0 waiver. | |
260 | ||
261 | That brings us to the templates where there's some code and some | |
262 | output. The template engine we're using is called Jinja2. It | |
263 | mixes HTML markup with Python code to render the output of the | |
264 | software. We decided the templates are part of the output of the | |
265 | software and not the software itself. We wanted the output of the | |
266 | software to be licensed in a hassle-free way so that when someone | |
267 | deploys their own GNU MediaGoblin instance with their own | |
268 | templates, they don't have to deal with the copyleft aspects of | |
269 | the AGPLv3 and we'd be fine with that because the changes they're | |
270 | making are identity-related. So at first we decided to waive our | |
271 | copyrights to the templates with a CC0 waiver and then add an | |
272 | exception to the AGPLv3 for the software such that the templates | |
273 | can make calls into the software and yet be a separately licensed | |
274 | work. However, Brett brought up the question of whether this | |
275 | allows some unscrupulous person to make changes to the software | |
276 | through the templates in such a way that they're not bound by the | |
277 | AGPLv3: i.e. a loophole. We thought about this loophole and | |
278 | between this and the extra legalese involved in the exception to | |
279 | the AGPLv3, we decided that it's just way simpler if the templates | |
280 | were also licensed under the AGPLv3. | |
281 | ||
282 | Then we have the licensing for the documentation. Given that the | |
283 | documentation is tied to the software content-wise, we don't feel | |
284 | like we have to worry about ensuring freedom of the documentation | |
285 | or worry about attribution concerns. Thus we're waiving our | |
286 | copyrights to the documentation under CC0 as well. | |
287 | ||
288 | Lastly, we have branding. This covers logos and other things that | |
289 | are distinctive to GNU MediaGoblin that we feel represents this | |
290 | project. Since we don't currently have any branding, this is an | |
291 | open issue, but we're thinking we'll go with a CC BY-SA license. | |
292 | ||
293 | By licensing in this way, we make sure that users of the software | |
294 | receive the freedoms that the AGPLv3 ensures regardless of what | |
295 | fate befalls this project. | |
296 | ||
297 | So to summarize: | |
298 | ||
299 | * software (Python, JavaScript, HTML templates): licensed | |
300 | under AGPLv3 | |
301 | * non-software things (CSS, images, video): copyrights waived | |
302 | under CC0 because this is output of the software | |
303 | * documentation: copyrights waived under CC0 because it's not part | |
304 | of the software | |
305 | * branding assets: we're kicking this can down the road, but | |
306 | probably CC BY-SA | |
307 | ||
308 | This is all codified in the ``COPYING`` file. | |
309 | ||
310 | .. _AGPL v3: http://www.gnu.org/licenses/agpl.html | |
311 | .. _CC0 v1: http://creativecommons.org/publicdomain/zero/1.0/ | |
312 | ||
313 | ||
314 | Why (non-mandatory) copyright assignment? | |
315 | ========================================= | |
316 | ||
317 | Chris Webber on "Why copyright assignment?": | |
318 | ||
319 | GNU MediaGoblin is a GNU project with non-mandatory but heavily | |
320 | encouraged copyright assignment to the FSF. Most, if not all, of | |
321 | the core contributors to GNU MediaGoblin will have done a | |
322 | copyright assignment, but unlike some other GNU projects, it isn't | |
323 | required here. We think this is the best choice for GNU | |
324 | MediaGoblin: it ensures that the Free Software Foundation may | |
325 | protect the software by enforcing the AGPL if the FSF sees fit, | |
326 | but it also means that we can immediately merge in changes from a | |
327 | new contributor. It also means that some significant non-FSF | |
328 | contributors might also be able to enforce the AGPL if seen fit. | |
329 | ||
330 | Again, assignment is not mandatory, but it is heavily encouraged, | |
331 | even incentivized: significant contributors who do a copyright | |
332 | assignment to the FSF are eligible to have a unique goblin drawing | |
333 | produced for them by the project's main founder, Christopher Allan | |
ed6a0bcd | 334 | Webber. See `the wiki <http://wiki.mediagoblin.org/>`_ for details. |
43a2f7fe E |
335 | |
336 |