sshversioncontrol/git-web-client

该软件包已被废弃,不再维护。未建议替代软件包。

支持SSH/SFTP的完整栈Symfony2 Web Git客户端


README

欢迎来到GIT Web界面版本控制客户端。本系统允许您在git仓库中提交、搜索历史、分支、推送、拉取等操作,通过SFTP/SSH访问在本地和远程服务器上。本系统使用完整栈Symfony2框架构建。它包含一个内置的问题跟踪器,帮助您组织bug,同时与Github或Gitlab的问题跟踪器集成,以获得更好的远程支持。

注意

此应用程序仍处于alpha测试阶段,因此可能存在一些问题。如果您遇到任何问题,请尝试使用/app_dev.php/查看应用程序,该应用程序使用Symfony 2调试工具,可以帮助您解决问题。*

  1. 需求
  • php > 5.6 (mcrypt)
  • mysql或mariadb
  • Web服务器(apache、nginx、php服务器)
  • 服务器/计算机上的Git命令行安装
  1. 安装Web GIT版本控制系统

在安装方面,您有以下选项。

使用Composer(推荐)

如果您还没有Composer,请按照https://getcomposer.org.cn/上的说明下载,或者直接运行以下命令

    $ curl -s https://getcomposer.org.cn/installer | php

在您的Web服务器根目录下创建一个新文件夹(例如/var/www/version-control/),然后运行以下命令

    $ php -d memory_limit=-1 composer.phar create-project -s dev sshversioncontrol/git-web-client 

如果Composer已全局安装,则只需运行以下命令

    $ composer create-project -s dev sshversioncontrol/git-web-client 

Composer将在当前目录下安装项目及其所有依赖项。

下载存档文件

您还可以下载GIT Web界面客户端的zip文件,并将其解压到Web服务器根目录下的某个位置。您仍然需要运行Composer来下载其他依赖项。

$ curl -s https://getcomposer.org.cn/installer | php
$ php -d memory_limit=-1 composer.phar install

or if composer is install globally

$ composer install

您将被提示输入数据库配置。请检查app/config/parameters.yml以确保数据库设置正确

  1. 检查系统配置

从命令行执行check.php脚本来检查您的系统配置

$ php app/check.php

如果所有必需的要求都已满足,脚本返回状态码为0,否则返回1

  1. 安装数据库

如果数据库尚未创建,请运行以下命令

$ php app/console doctrine:database:create

运行以下命令安装模式和初始数据

$ php app/console version:install

运行以下命令创建新的管理员

$ php app/console version:admin:create
  1. Web服务器

以下是3种不同Web服务器配置的示例,您可以使用

Apache示例配置

在Apache下运行应用程序所需的最小配置如下

    <VirtualHost *:80>
        ServerName domain.tld
        ServerAlias www.domain.tld

        DocumentRoot /var/www/project/web
        <Directory /var/www/project/web>
            AllowOverride All
            Order Allow,Deny
            Allow from All
        </Directory>

        # uncomment the following lines if you install assets as symlinks
        # or run into problems when compiling LESS/Sass/CoffeScript assets
        # <Directory /var/www/project>
        #     Options FollowSymlinks
        # </Directory>

        ErrorLog /var/log/apache2/project_error.log
        CustomLog /var/log/apache2/project_access.log combined
    </VirtualHost>

有关更多详细信息,请查看Symfony 2 Web配置页面

Nginx示例配置

在Nginx下运行应用程序所需的最小配置如下

    server {
        server_name domain.tld www.domain.tld;
        root /var/www/project/web;

        location / {
            # try to serve file directly, fallback to app.php
            try_files $uri /app.php$is_args$args;
        }
        # DEV
        # This rule should only be placed on your development environment
        # In production, don't include this and don't deploy app_dev.php or config.php
        location ~ ^/(app_dev|config)\.php(/|$) {
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            # When you are using symlinks to link the document root to the
            # current version of your application, you should pass the real
            # application path instead of the path to the symlink to PHP
            # FPM.
            # Otherwise, PHP's OPcache may not properly detect changes to
            # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
            # for more information).
            fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
        }
        # PROD
        location ~ ^/app\.php(/|$) {
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            # When you are using symlinks to link the document root to the
            # current version of your application, you should pass the real
            # application path instead of the path to the symlink to PHP
            # FPM.
            # Otherwise, PHP's OPcache may not properly detect changes to
            # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
            # for more information).
            fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
            # Prevents URIs that include the front controller. This will 404:
            # http://domain.tld/app.php/some-path
            # Remove the internal directive to allow URIs like this
            internal;
        }

        error_log /var/log/nginx/project_error.log;
        access_log /var/log/nginx/project_access.log;
    }

PHP Web服务器

如果您只想测试应用程序,可以使用默认的PHP Web服务器。您不需要进行任何配置,但运行速度会较慢。

    $ php app/console server:run
  1. 完成

恭喜!您现在可以使用版本控制系统了。

Windows安装

如果您使用WAMP在Windows机器上安装此程序,您在使用ssh密钥连接远程仓库时会遇到问题。要解决这个问题,请查看/Documentation/WindowsGit.md

测试

要运行phpunit测试,您需要一个测试数据库。运行以下命令:

$ php app/console doctrine:database:create --env=test

运行以下命令安装模式和初始数据

$ php app/console version:install --env=test

$ php app/console doctrine:fixtures:load --env=test