|
@@ -1,14 +1,45 @@
|
|
tunasync
|
|
tunasync
|
|
========
|
|
========
|
|
|
|
|
|
|
|
+## Design
|
|
|
|
+
|
|
|
|
+```
|
|
|
|
+# Architecture
|
|
|
|
+
|
|
|
|
+- Manager: Centural instance on status and job management
|
|
|
|
+- Worker: Runs mirror jobs
|
|
|
|
+
|
|
|
|
+
|
|
|
|
++----------+ +---+ worker configs +---+ +----------+ +----------+
|
|
|
|
+| Status | | |+-----------------> | w +--->| mirror +---->| mirror |
|
|
|
|
+| Manager | | | | o | | config | | provider |
|
|
|
|
++----------+ | W | start/stop job | r | +----------+ +----+-----+
|
|
|
|
+ | E |+-----------------> | k | |
|
|
|
|
++----------+ | B | | e | +------------+ |
|
|
|
|
+| Job | | | update status | r |<------+ mirror job |<----+
|
|
|
|
+|Controller| | | <-----------------+| | +------------+
|
|
|
|
++----------+ +---+ +---+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# Job Run Process
|
|
|
|
+
|
|
|
|
++-----------+ +-----------+ +-------------+ +--------------+
|
|
|
|
+| pre-job +--+->| job run +--->| post-job +-+-->| post-success |
|
|
|
|
++-----------+ ^ +-----------+ +-------------+ | +--------------+
|
|
|
|
+ | |
|
|
|
|
+ | +-----------------+ |
|
|
|
|
+ +------+ post-fail |<---------+
|
|
|
|
+ +-----------------+
|
|
|
|
+```
|
|
|
|
+
|
|
## TODO
|
|
## TODO
|
|
|
|
|
|
-- [ ] use context manager to handle job contexts
|
|
|
|
-- [x] Hooks need "before_exec", "after_exec"
|
|
|
|
-- [x] implement `tunasynctl tail` and `tunasynctl log` or equivalent feature
|
|
|
|
-- [x] status file
|
|
|
|
- - [ ] mirror size
|
|
|
|
- - [x] upstream
|
|
|
|
-- [x] btrfs backend (create snapshot before syncing)
|
|
|
|
-- [x] add mirror job online
|
|
|
|
-- [x] use toml as configuration
|
|
|
|
|
|
+- [ ] split to `tunasync-manager` and `tunasync-worker` instances
|
|
|
|
+ - use HTTP as communication protocol
|
|
|
|
+- Web frontend for `tunasync-manager`
|
|
|
|
+ - [ ] start/stop/restart job
|
|
|
|
+ - [ ] enable/disable mirror
|
|
|
|
+ - [ ] view log
|
|
|
|
+- [ ] config file structure
|
|
|
|
+ - [ ] support multi-file configuration (`/etc/tunasync.d/mirror-enabled/*.conf`)
|
|
|
|
+
|