• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

lfs-test-server: 这是一个独立的 Git LFS 测试服务器

原作者: [db:作者] 来自: Gitee 收藏 邀请

LFS Test Server

LFS Test Server is an example server that implements the Git LFS API. Itis intended to be used for testing the Git LFS client and is not in aproduction ready state.

LFS Test Server is written in Go, with pre-compiled binaries available for Mac,Windows, Linux, and FreeBSD.

See CONTRIBUTING.md for info on working on LFS Test Server andsending patches.

Installing

Download the latest version. It is a single binary file.

Alternatively, use the Go installer:

  $ go install github.com/github/lfs-test-server

Building

To build from source, use the Go tools:

  $ go get github.com/github/lfs-test-server

Running

Running the binary will start an LFS server on localhost:8080 by default.There are few things that can be configured via environment variables:

LFS_LISTEN      # The address:port the server listens on, default: "tcp://:8080"LFS_HOST        # The host used when the server generates URLs, default: "localhost:8080"LFS_METADB      # The database file the server uses to store meta information, default: "lfs.db"LFS_CONTENTPATH # The path where LFS files are store, default: "lfs-content"LFS_ADMINUSER   # An administrator username, default: not setLFS_ADMINPASS   # An administrator password, default: not setLFS_CERT        # Certificate file for tlsLFS_KEY         # tls keyLFS_SCHEME      # set to 'https' to override default httpLFS_USETUS      # set to 'true' to enable tusd (tus.io) resumable upload server; tusd must be on PATH, installed separatelyLFS_TUSHOST     # The host used to start the tusd upload server, default "localhost:1080"

If the LFS_ADMINUSER and LFS_ADMINPASS variables are set, arudimentary admin interface can be accessed viahttp://$LFS_HOST/mgmt. Here you can add and remove users, which mustbe done before you can use the server with the client. If either ofthese variables are not set (which is the default), the administrativeinterface is disabled.

To use the LFS test server with the Git LFS client, configure it in the repository's .gitconfig file:

  [lfs]    url = "http://localhost:8080/"

HTTPS:

NOTE: If using https with a self signed cert also disable cert checking in the client repo.

  [lfs]    url = "https://localhost:8080/"  [http]    sslverify = false

An example usage:

Generate a key pair

openssl req -x509 -sha256 -nodes -days 2100 -newkey rsa:2048 -keyout mine.key -out mine.crt

Make yourself a run script

#!/bin/bashset -euset -o pipefailLFS_LISTEN="tcp://:9999"LFS_HOST="127.0.0.1:9999"LFS_CONTENTPATH="content"LFS_ADMINUSER="<cool admin user name>"LFS_ADMINPASS="<better admin password>"LFS_CERT="mine.crt"LFS_KEY="mine.key"LFS_SCHEME="https"export LFS_LISTEN LFS_HOST LFS_CONTENTPATH LFS_ADMINUSER LFS_ADMINPASS LFS_CERT LFS_KEY LFS_SCHEME./lfs-test-server

Build the server

go build

Run

bash run.sh

Check the managment page

browser: https://localhost:9999/mgmt


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap