3 Star 0 Fork 0

Gitee 极速下载/lfs-test-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/github/lfs-test-server
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

LFS Test Server

LFS Test Server is an example server that implements the Git LFS API. It is intended to be used for testing the Git LFS client and is not in a production 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 and sending patches.

Installing

Use the Go installer:

  $ go install github.com/git-lfs/lfs-test-server@latest

Building

To build from source, use the Go tools:

  $ go get github.com/git-lfs/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 set
LFS_ADMINPASS   # An administrator password, default: not set
LFS_CERT        # Certificate file for tls
LFS_KEY         # tls key
LFS_SCHEME      # set to 'https' to override default http
LFS_USETUS      # set to 'true' to enable tusd (tus.io) resumable upload server; tusd must be on PATH, installed separately
LFS_TUSHOST     # The host used to start the tusd upload server, default "localhost:1080"

If the LFS_ADMINUSER and LFS_ADMINPASS variables are set, a rudimentary admin interface can be accessed via http://$LFS_HOST/mgmt. Here you can add and remove users, which must be done before you can use the server with the client. If either of these variables are not set (which is the default), the administrative interface is disabled.

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

  [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/bash

set -eu
set -o pipefail


LFS_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

Debugging

lfs-test-server supports a basic cmd to lookup OID's via the cmdline to help in debugging, eg. investigating client problems with a particular OID and it's properties. In this mode lfs-test-server expects the same configuration as when running in daemon mode, but will just executing the requested cmd and then exit.

This is especially helpful in server environments where it's not always possible to get to the web interface easily or where it's just too slow because of DB size.

lfs-test-server cmd <OID>

Outputs the full OID record

Example

% . /etc/default/lfs-instancefoo    # to source server config
% ./lfs-test-server cmd 7c9414fe21ad7b45ffb6e72da86f9a9e13dbb2971365ae7bcb8cc7fbbba7419c
&{Oid:7c9414fe21ad7b45ffb6e72da86f9a9e13dbb2971365ae7bcb8cc7fbbba7419c Size:3334144 Existing:false}
Copyright (c) GitHub, Inc. and LFS Test Server contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

LFS Test Server 是一个实现了 Git LFS API 的服务器 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/lfs-test-server.git
git@gitee.com:mirrors/lfs-test-server.git
mirrors
lfs-test-server
lfs-test-server
main

搜索帮助