Няма описание

Wang Kang 70d73b5709 docs(tunasync): First step on documentation: get started, zh_CN version. преди 9 години
autocomplete 83fc766147 feat(bash and zsh autocompletion for tunasynctl): преди 9 години
cmd ca80dff5cb feat(manager): flush disabled jobs преди 9 години
docs 70d73b5709 docs(tunasync): First step on documentation: get started, zh_CN version. преди 9 години
internal ca80dff5cb feat(manager): flush disabled jobs преди 9 години
manager ca80dff5cb feat(manager): flush disabled jobs преди 9 години
scripts 3ddbbfda94 docker script: added ubuntu-precise and gpg преди 9 години
systemd 28c8145137 feature(worker): limit rsync memory using cgroup преди 9 години
tests 5c8d90608c feature(worker): implemented multi-file configrations. closing #23 преди 9 години
worker 2b83ea4b45 feat(worker): added global `exec_on_success` and `exec_on_failure` options преди 9 години
.gitignore 03fdaeeb7f chore(cmd): added git hash and build date to version преди 9 години
.testandcover.bash 03fdaeeb7f chore(cmd): added git hash and build date to version преди 9 години
.testpackages.txt 44af0d5e62 feature(worker): framework of mirror provider преди 9 години
.travis.yml 03fdaeeb7f chore(cmd): added git hash and build date to version преди 9 години
LICENSE 78f3501e19 Initial commit преди 11 години
Makefile 03fdaeeb7f chore(cmd): added git hash and build date to version преди 9 години
README.md 70d73b5709 docs(tunasync): First step on documentation: get started, zh_CN version. преди 9 години
package.json c311648546 chore(git): Made this repo commitizen frendly преди 9 години

README.md

tunasync

Build Status Coverage Status Commitizen friendly GPLv3

Get Started

Design

# Architecture

- Manager: Centural instance on status and job management
- Worker: Runs mirror jobs

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


# Job Run Process


PreSyncing           Syncing                               Success
+-----------+     +-----------+    +-------------+     +--------------+
|  pre-job  +--+->|  job run  +--->|  post-exec  +-+-->| post-success |
+-----------+  ^  +-----------+    +-------------+ |   +--------------+
			   |                                   |
			   |      +-----------------+          | Failed
			   +------+    post-fail    |<---------+
					  +-----------------+

Generate Self-Signed Certificate

Fisrt, create root CA

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

Create host key

openssl genrsa -out host.key 2048

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

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req

[req_distinguished_name]
countryName = Country Name (2 letter code)
countryName_default = CN
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = BJ
localityName = Locality Name (eg, city)
localityName_default = Beijing
organizationalUnitName  = Organizational Unit Name (eg, section)
organizationalUnitName_default  = TUNA
commonName = Common Name (server FQDN or domain name)
commonName_default = <server_FQDN>
commonName_max  = 64

[v3_req]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = <server_FQDN_1>
DNS.2 = <server_FQDN_2>

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

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

Finally generate and sign host cert with root CA

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