tuna/tunasync

Name: tunasync

Owner: Tsinghua University TUNA Association

Description: Mirror job management tool.

Created: 2014-10-17 08:24:26.0

Updated: 2018-01-18 10:34:33.0

Pushed: 2017-09-29 10:14:22.0

Homepage:

Size: 656

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

tunasync

Build Status Coverage Status Commitizen friendly GPLv3

Get Started
Download

Pre-built binary for Linux x86_64 is available at Github releases.

Design
chitecture

nager: Central instance for status and job management
rker: Runs mirror jobs

---------+ +---+                  +---+
ient API | |   |    Job Status    |   |    +----------+     +----------+ 
---------+ |   +----------------->|   |--->|  mirror  +---->|  mirror  | 
---------+ |   |                  | w |    |  config  |     | provider | 
rker API | | H |                  | o |    +----------+     +----+-----+ 
---------+ | T |   Job Control    | r |                          |       
---------+ | T +----------------->| k |       +------------+     |       
b/Status | | P |   Start/Stop/... | e |       | mirror job |<----+       
nagement | | S |                  | r |       +------^-----+             
---------+ |   |   Update Status  |   |    +---------+---------+         
---------+ |   <------------------+   |    |     Scheduler     |
BoltDB   | |   |                  |   |    +-------------------+
---------+ +---+                  +---+


b Run Process


yncing           Syncing                               Success
--------+     +-----------+    +-------------+     +--------------+
re-job  +--+->|  job run  +--->|  post-exec  +-+-->| post-success |
--------+  ^  +-----------+    +-------------+ |   +--------------+
           |                                   |
           |      +-----------------+          | Failed
           +------+    post-fail    |<---------+
                  +-----------------+
Generate Self-Signed Certificate

First, create root CA

ssl genrsa -out rootCA.key 2048
ssl req -x509 -new -nodes -key rootCA.key -days 365 -out rootCA.crt

Create host key

ssl genrsa -out host.key 2048

Now create CSR, before that, write a req.cnf

]
inguished_name = req_distinguished_name
extensions = v3_req

_distinguished_name]
tryName = Country Name (2 letter code)
tryName_default = CN
eOrProvinceName = State or Province Name (full name)
eOrProvinceName_default = BJ
lityName = Locality Name (eg, city)
lityName_default = Beijing
nizationalUnitName  = Organizational Unit Name (eg, section)
nizationalUnitName_default  = TUNA
onName = Common Name (server FQDN or domain name)
onName_default = <server_FQDN>
onName_max  = 64

req]
tensions to add to a certificate request
cConstraints = CA:FALSE
sage = nonRepudiation, digitalSignature, keyEncipherment
ectAltName = @alt_names

_names]
1 = <server_FQDN_1>
2 = <server_FQDN_2>

Substitute <server_FQDN> with your server's FQDN, then run

ssl req -new -key host.key -out host.csr -config req.cnf

Finally generate and sign host cert with root CA

ssl x509 -req -in host.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out host.crt -days 365 -extensions v3_req -extfile req.cnf
Building

Setup GOPATH like this.

Then:

et -d github.com/tuna/tunasync/cmd/tunasync
GOPATH/src/github.com/tuna/tunasync

If you have multiple GOPATHs, replace the $GOPATH with your first one.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.