@@ -35,6 +35,7 @@ if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . 'cache')) { | |||
require 'vendor/autoload.php'; | |||
$config = GitList\Config::fromFile('config.ini'); | |||
$config->set('app', 'clone_url', 'ssh://git@teknik.io:'); | |||
if ($_GET['user']) | |||
{ | |||
if ($userTools->checkUsernameExists($_GET['user'])) | |||
@@ -44,7 +45,8 @@ if ($_GET['user']) | |||
$_SERVER['HTTP_X_ORIGINAL_URL'] = str_replace("/u/".$_GET['user'], "", $_SERVER['HTTP_X_ORIGINAL_URL']); | |||
$config->set('git', 'repositories', array('G:\\Repositories\\u\\'.$_GET['user'])); | |||
$config->set('git', 'hidden', array('')); | |||
$config->set('app', 'path_prefix', '/u/'.$_GET['user']); | |||
$config->set('app', 'path_prefix', 'u/'.$_GET['user']); | |||
$config->set('app', 'clone_url', 'ssh://git@teknik.io:u/'.$_GET['user'].'/'); | |||
$app = require 'boot.php'; | |||
$app->run(); | |||
} |
@@ -32,7 +32,8 @@ class Application extends SilexApplication | |||
$this['debug'] = $config->get('app', 'debug'); | |||
$this['filetypes'] = $config->getSection('filetypes'); | |||
$this['cache.archives'] = $this->getCachePath() . 'archives'; | |||
$this['path_prefix'] = $config->get('app', 'path_prefix'); | |||
$this['path_prefix'] = '/'.$config->get('app', 'path_prefix'); | |||
$this['clone_url'] = $config->get('app', 'clone_url'); | |||
// Register services | |||
$this->register(new TwigServiceProvider(), array( |
@@ -7,7 +7,7 @@ | |||
{% block extra %} | |||
<div class="pull-right"> | |||
<div class="btn-group download-buttons"> | |||
<a href="ssh://git@teknik.io:{{ repo }}" class="btn btn-default btn-xs" title="Clone '{{ repo }}'"><span class="fa fa-cloud-download"></span> Clone</a> | |||
<a href="{{ app.clone_url }}{{ repo }}" class="btn btn-default btn-xs" title="Clone '{{ repo }}'"><span class="fa fa-cloud-download"></span> Clone</a> | |||
<a href="{{ app.path_prefix }}{{ path('archive', {repo: repo, branch: branch, format: 'zip'}) }}" class="btn btn-default btn-xs" title="Download '{{ branch }}' as a ZIP archive">ZIP</a> | |||
<a href="{{ app.path_prefix }}{{ path('archive', {repo: repo, branch: branch, format: 'tar'}) }}" class="btn btn-default btn-xs" title="Download '{{ branch }}' as a TAR archive">TAR</a> | |||
</div> |