项目作者: artemkin

项目描述 :
Git LFS server
高级语言: OCaml
项目地址: git://github.com/artemkin/git-lfs-server.git
创建时间: 2015-04-19T23:24:28Z
项目社区:https://github.com/artemkin/git-lfs-server

开源协议:Other

下载


Git LFS server

Project frozen
Project unmaintained
Build Status
Coverage Status

Simple HTTP(S) server for Git Large File Storage with PAM authentication.

  1. $ ./lfs_server.sh -help
  2. Start Git LFS server
  3. lfs_server [ROOT]
  4. === flags ===
  5. [-cert file] File of certificate for https
  6. [-key file] File of private key for https
  7. [-p port] TCP port to listen on
  8. [-pam service] PAM service name for user authentication
  9. [-s address] IP address to listen on
  10. [-verbose] Verbose logging
  11. [-build-info] print info about this build and exit
  12. [-version] print the version of this build and exit
  13. [-help] print this help text and exit
  14. (alias: -?)

By default, it starts on http://localhost:8080 and treats current directory as ROOT. All object files are stored locally in ROOT/.lfs/objects directory.

INSTALL

From binary packages:

RUN

HTTP server without authentication

  1. ./lfs_server.sh -verbose -s IP_ADDRESS -p PORT

A server will ignore credentials passed by LFS client, and accept all connections. To enable authentication, you need to specify PAM service.

HTTP server with PAM authentication

  1. ./lfs_server.sh -verbose -pam login -s IP_ADDRESS -p PORT

It will use built-in login PAM service defined in /etc/pam.d/login file.

Warning: LFS client uses HTTP basic authentication, so using HTTPS is a must!

HTTPS server with PAM authentication

  1. ./lfs_server.sh -verbose -pam login -s IP_ADDRESS -p PORT -cert domain.crt -key domain.key

Example

Download and install the LFS server as described above. You will also need to install the GIT LFS client.

  1. # Start a LFS server
  2. ./lfs_server.sh
  3. # Clone a repo
  4. git clone ....
  5. cd repo
  6. # Add a normal file
  7. touch test.txt
  8. git add test.txt
  9. git commit -m "normal file"
  10. # Add a lfs file
  11. git lfs install
  12. dd if=/dev/zero of=test.bin count=10240 bs=1024 # Create a file which is 10MB
  13. git lfs track test.bin
  14. git add .gitattributes test.bin
  15. git commit -m "lfs file"
  16. # Configure lfs remote to local server
  17. git config -f .lfsconfig lfs.url http://localhost:8080
  18. git add .lfsconfig
  19. git commit -m "lfs config"
  20. # Push changes
  21. git push

TODO

  • Multi server support
  • Create OPAM package
  • Add max file size option
  • Add connection timeouts
  • Authentication
  • Automated tests
  • Setup Travis continuous builds
  • Setup Coverals
  • Remove incomplete/broken temporary files
  • Upload validation (calculate SHA-256 digest)
  • Reject uppercase SHA-256 hex digests
  • Fix HTTPS urls
  • Rearrange files in release package and remove redundant libs
  • Add logging
  • Check SIGQUIT and SIGINT are handled correctly
  • HTTPS support (trivial to add)
  • Speed-up uploading (fixed in cohttp, see #330)