# Copyright (C) 2010-2012 Chris Ball <cjb@laptop.org>
-# W. Trevor King <wking@drexel.edu>
+# W. Trevor King <wking@tremily.us>
#
# This file is part of Bugs Everywhere.
#
# You should have received a copy of the GNU General Public License along with
# Bugs Everywhere. If not, see <http://www.gnu.org/licenses/>.
-"""Define the :class:`Serve` serving BE Storage over HTTP.
+"""Define the :py:class:`Serve` serving BE Storage over HTTP.
See Also
--------
-:mod:`libbe.storage.http` : the associated client
+:py:mod:`libbe.storage.http` : the associated client
"""
import logging
import libbe
import libbe.command
import libbe.command.util
+import libbe.util.http
import libbe.util.subproc
import libbe.util.wsgi
import libbe.version
The GET and HEAD requests are identical except that the HEAD
request omits the actual content of the file.
"""
- server_version = "BE-server/" + libbe.version.version()
+ server_version = 'BE-storage-server/' + libbe.version.version()
def __init__(self, storage=None, notify=False, **kwargs):
super(ServerApp, self).__init__(
**kwargs)
self.storage = storage
self.notify = notify
- self.http_user_error = 418
# handlers
def add(self, environ, start_response):
revision = self.storage.commit(summary, body, allow_empty)
except libbe.storage.EmptyCommit, e:
raise libbe.util.wsgi.HandlerError(
- self.http_user_error, 'EmptyCommit')
+ libbe.util.http.HTTP_USER_ERROR, 'EmptyCommit')
if self.notify:
self._notify(environ, 'commit', id,
[('allow_empty', allow_empty), ('summary', summary),
This allows you to run local `be` commands interfacing with remote
data, transmitting file reads/writes/etc. over the network.
- :class:`~libbe.command.base.Command` wrapper around
- :class:`ServerApp`.
+ :py:class:`~libbe.command.base.Command` wrapper around
+ :py:class:`ServerApp`.
"""
name = 'serve-storage'
If you bind your server to a public interface, take a look at the
``--read-only`` option or the combined ``--ssl --auth FILE``
options so other people can't mess with your repository. If you do use
-authentication, you'll need to send in your username and password with,
-for example::
+authentication, you'll need to send in your username and password::
$ be --repo http://username:password@localhost:8000/ list
"""