forked from jelmer/dulwich
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working pass at an HTTP server, only dumb at the moment
Change-Id: I92c883b2274252ad83bc044f87fc8608b006b6ab
- Loading branch information
Showing
6 changed files
with
362 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/python | ||
# dul-web - HTTP-based git server | ||
# Copyright (C) 2010 David Borowitz <dborowitz@google.com> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; version 2 | ||
# of the License. | ||
# | ||
# 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 General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
# MA 02110-1301, USA. | ||
|
||
import os | ||
import sys | ||
from dulwich.repo import Repo | ||
from dulwich.server import GitBackend | ||
from dulwich.web import HTTPGitApplication | ||
from wsgiref.simple_server import make_server | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) > 1: | ||
gitdir = sys.argv[1] | ||
else: | ||
gitdir = os.getcwd() | ||
|
||
backend = GitBackend(Repo(gitdir)) | ||
app = HTTPGitApplication(backend) | ||
# TODO: allow serving on other ports via command-line flag | ||
server = make_server('', 8000, app) | ||
server.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.