Categorygithub.com/quic-s/quics
module
0.1.0
Repository: https://github.com/quic-s/quics.git
Documentation: pkg.go.dev

# README

QUIC-S

#file-synchronization #quic #server #go #golang #http3 #cobra

QUIC-S is a continuous file synchronization system based on QUIC protocol. This system is designed to synchronize files between multiple devices, to manage file versions, and to share files with other users.

QUIC-S consists of a server and a client, and the quic-go based quics-protocol is used for communication between the two.

This repository is a server repository.
To see client: quics-client
To see protocol: quics-protocol

NOTICE: If you want to use this tool, you should use the client of QUIC-S. You can find the client in here

Features | Getting Started | How to use| Documentation | Contribute

Features

1. Manage client

Server can receive the registration request from the client. server saves the registered/connected client information to database badger. The saved client information is client uuid(created by client), IP address, etc.

2. Manage root directory per client

Server can manage root directory per client for synchronizing. The synchronization is performed in the registered root directory. When client request the root directory with registration, then server save the root directory to database badger, too. In addition the root directory can be registered one more.

3. Save & manage files synchronized from client

Similar to root directory, the file can be registered/saved to server. Requested file from client is updated with latestHash and latestSyncTimestamp. Server save latest files from client in their own directory (e.g., .quics/sync/${root-directory-name}/latest/*)

4. Manage & resolve conflict of file

If LastUpdatedTimestamp from client is larger than LatestSyncTimestamp from server, then any conflict could not be occurred. However, in the case of not above, conflict occurred. When conflict occurs, then server makes a directory for managing conflict (e.g., .quics/sync/${root-directory-name}/conflict/*). The created conflict file can be removed after resolving conflict. Server sends client with two options (client side, server side). Client chooses one option with two options, then sends chosen file with message to server. Server removes the conflict file, and create new file version/history about resolved file.

4. Save the history of file

Server manages all histories of all files. The history file is saved to directory (e.g., .quics/sync/${root-directory-name}/history/*). If the user wants, a file can be replaced with a previous file history.

For more detail logic and implementation, please check QUIC-S Docs

Getting Started

1. Docker

docker run -it -d -e PASSWORD=passwordwhatyouwant -v /path/to/your/dir:/data --name quics -p 6120:6120 -p 6121:6121/udp -p 6122:6122/udp quics/quics

2. Local install

    1. Download the latest version from release page
    1. Unpack the archive
    1. Run mv ./qis /usr/local/bin/qis

3. Build from source

    1. Install Go 1.21 or later.
    1. Clone this repository.
      git clone https://github.com/quic-s/quics.git
      
    1. Run the command below in the root of the repository.
      go mod download
      go build -o qis ./cmd
      

How to use

Check the video for how to use

quics-video

Environment variables

Environment variables are used to set initial server configuration. If you use docker, you can set environment variables with -e option.

NameDescriptionDefault
QUICS_SERVER_ADDRServer addresslocalhost
QUICS_SERVER_PORTLegacy http port for Rest API server6120
QUICS_SERVER_H3_PORTHttp/3 port for Rest API server6121
QUICS_PASSWORDServer passwordpassword
QUICS_PORTquics-protocol port for communication between server and client6122
QUICS_CERT_NAMEServer certificate name for TLScert-quics.pem
QUICS_KEY_NAMEServer key name for TLSkey-quics.pem

CLI & REST API

QUIC-S currently supports CLI, but it all operates based on REST API. So you can use either cli or REST API for anything except starting the initial server process.

Below table is the list of commands and rest api path.

If you use docker, you meed to use docker exec -it quics qis or set alias alias qis="docker exec -it quics qis".

TagCommandOptionsDescriptionRest API
controllerqisroot command meaning quic-s
controllerqis-h, --helpshow help
controllerqis startstart rest server with default IP and port
controllerqis start--addr stringstart rest server with user-defined address
controllerqis start--port stringstart rest server with user-defined port for legacy http
controllerqis start--port3 stringstart rest server with user-defined port for http/3
controllerqis runrun is a command that combines qis start and qis listen
controllerqis run--addr stringstart server with user-defined address
controllerqis run--port stringstart server with user-defined port for legacy http
controllerqis run--port3 stringstart server with user-defined port for http/3
controllerqis listenlisten protocol/api/v1/server/listen
controllerqis stopstop server/api/v1/server/stop
configqis password set--pw stringchange server password/api/v1/server/password/set
configqis password resetReset server password/api/v1/server/password/reset
logqis showshow various information
logqis show client-i, --idshow client information by key/api/v1/server/logs/clients
logqis show client-a, --allshow all client information/api/v1/server/logs/clients
logqis show dir-i, --idshow root directory information by key/api/v1/server/logs/directories
logqis show dir-a, --allshow all root directory information/api/v1/server/logs/directories
logqis show file-i, --idshow file information by key/api/v1/server/logs/files
logqis show file-a, --allshow all files information/api/v1/server/logs/files
logqis show history-i, --idshow history information by key/api/v1/server/logs/histories
logqis show history-a, --allshow all histories information/api/v1/server/logs/histories

Documentation

For more detail logic and implementation, please check QUIC-S Docs

Also you can check quics-client for client side and quics-protocol for protocol.

Contribute

QUIC-S is an open source project, and contributions of any kind are welcome and appreciated.

We also have a awesome plan to make QUIC-S better. Check ROADMAP.md will be helpful to understand our project's direction.

  • To contribute, please read CONTRIBUTING.md

  • To report bugs or request features, please use the issue tracker. Before you do so, make sure you are running the latest version, and please do a quick search to see if the issue has already been reported.

  • For more discussion, please join the quics discord

# Packages

No description provided by the author
No description provided by the author
No description provided by the author