Giter Club home page Giter Club logo

Comments (5)

ZenithalHourlyRate avatar ZenithalHourlyRate commented on September 26, 2024

同步后我们使用了 git-http-backend 提供服务。

from tunasync-scripts.

v2less avatar v2less commented on September 26, 2024

git-http-backend

tunasync-scripts 里有对应的脚本吗?

from tunasync-scripts.

ZenithalHourlyRate avatar ZenithalHourlyRate commented on September 26, 2024

没有相关脚本,这是官方工具。您可能需要配置 nginx 或 apache 以使用该工具

from tunasync-scripts.

v2less avatar v2less commented on September 26, 2024

安装依赖

sudo apt install -y git gitweb highlight fcgiwrap

git代码存放位置

/share/filedir/git

修改/etc/gitweb.conf

$projectroot = "/share/filedir/git/";

nginx.conf

location ~ /git(/.*) {
         root      /usr/share/gitweb;
         fastcgi_pass  unix:/var/run/fcgiwrap.socket;
         include       fastcgi_params;
         fastcgi_param SCRIPT_FILENAME     /usr/lib/git-core/git-http-backend;
         # export all repositories under GIT_PROJECT_ROOT
         fastcgi_param GIT_HTTP_EXPORT_ALL "";
         fastcgi_param GIT_PROJECT_ROOT    /share/filedir/git;
         fastcgi_param PATH_INFO           $1;
     }

mirror-web代码修改

_data/options.yml
添加ohmyzsh.git的说明以及强制使用help页面

mirror_desc:
   - name: ohmyzsh.git
     desc: ohmyzsh 的源码仓库
force_redirect_help_mirrors:
    - ohmyzsh.git

git.sh修改

复制一份git.sh到/app/scripts/git.sh
需要对启动的代码做简单修改,git clone后面不跟--mirror

worker.conf增加一个任务

[[mirrors]]
 name = "ohmyzsh.git"
 provider = "command"
 command = "/app/scripts/git.sh"
 upstream = "https://github.com/ohmyzsh/ohmyzsh.git"
 size_pattern = "size-pack: ([0-9\\.]+[KMGTP])"
 interval = 1440
   [mirrors.env]
   TUNASYNC_WORKING_DIR = "/data/mirrors/git/ohmyzsh.git"

同步代码

tunasynctl reload -w mirror_work
/bin/tunasynctl start -w mirror_work ohmyzsh.git

重启nginx

service fcgiwrap restart
nginx -t
nginx -s reload

参考

https://gist.github.com/mcxiaoke/055af99e86f8e8d3176e

但是还存在问题:
只能用git clone项目,不能用浏览器浏览git项目,也不能直接下载git项目里的文件。

from tunasync-scripts.

ZenithalHourlyRate avatar ZenithalHourlyRate commented on September 26, 2024

只能用git clone项目,不能用浏览器浏览git项目,也不能直接下载git项目里的文件。

目前 TUNA 就是这个行为,不能用浏览器浏览项目,也不能直接下载文件。

如果您需要上述功能,您可以使用别的后端。

from tunasync-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.