Archivo is created to be the final way of archiving files, especially configuration files or any type of documents on servers, by making file backup management easy and useful in case of data loss or disaster occurrence.
The design of Archivo is a push mechanism in which any server will push its desired files to one place to maintain snapshots of files the time. Two main components act in this process, first archivo server
(which we call archivo
precisely) and second archivo agent
(which we call agent
).
Archivo
is responsible for file backups maintaining and file snapshot access management. Every server that you want to send files from there to backup should be defined in archivo
and they are called a source server
. For each source server
, we have a unique name and API key which will be used to authorize them on every file rotation.
Agent
's duty is to send the file to archivo
. It receives a configuration file that defines which file with what interval should be stored on the archivo
server and how many snapshots should it taken from that file.
Note: To prevent any data loss, the file rotation count decrease is blocked. So you can only increase your file backup rotation count.
For running Archivo, you need first to run archivo
on a server that should have enough disk space, and any other agents
can see it through the network. After that, you need to have at least one configured agent
to store your desired file's snapshots.
To run archivo, you need a running instance of PostgreSQL
database and a healthy and running instance of archivo
server. The postgresql database will store any required data with archivo needs.
There are two ways of running archivo
server:
- Running with
docker-compose
. You can use docker-compose.yaml which will use archivo docker image or using docker-compose.local.yaml which will require to clone the project and build your docker image from source. - Run the binary version. For running as a binary archivo server you need first to download the proper binary build of the project that matches your target operating system (look at release page to download compressed binaries) and have a running version of
PostgreSQL
on the server.
After you do one of the options, you need to prepare your configuration file. By default, archivo
tries to read the configuration file from ${HOME}/.archivo.yaml
( If you run it with docker, the default configuration path is /home/archivo/.archivo.yaml
).
You can find an example of .archivo.yaml
here.
After your configuration is ready, you should run archivo
server by running the following:
# If you set your config file at ${HOME}/.archivo.yaml
./archivo
# If you set your config file elsewhere, pass the path of the config file
./archivo -c /absolute/path/config/.archivo.yml
You can validate your configuration with the following command:
# If you set your config file at ${HOME}/.archivo.yaml
./archivo validate
# If you set your config file elsewhere, pass the path of the config file
./archivo validate -c /absolute/path/config/.archivo.yml
If everything is ok, your archivo
server starts listening on 0.0.0.0:<PORT>
which PORT is the port number that you defined in the config file. By default, it starts listening on 8010
.
The next step is to open the Archivo listening address and register the Admin user in the Archivo panel.
After Register and Login, you see the dashboard page which is the home page of the Archivo panel
By going to the servers section and creating a new source server
, you will get an API KEY which will be used for agent OAuth to send files. IMPORTANT, this API KEY is not accessible anymore. So, keep it somewhere safe.
Now you are ready to set up your agent
.
To run agent server you need first to download the proper binary build of the project that matches your target host (look at release page to download compressed binaries).
After you get the binary file, you need to prepare your configuration file. By default, agent
tries to read the configuration file from ${HOME}/.agent.yaml
. You can find an example of .agent.yaml
here.
You need to place your registered source server name to agent_name and API KEY to agent_key in the configuration file that you got from the last section.
After your configuration is ready, you should run agent
by running:
# If you set your config file at ${HOME}/.agent1.yaml
./agent
# If you set your config file elsewhere, pass the path of the config file
./agent -c /absolute/path/config/.agent.yml
You can validate your configuration with the following command:
# If you set your config file at ${HOME}/.agent1.yaml
./agent validate
# If you set your config file elsewhere, pass the path of the config file
./agent validate -c /absolute/path/config/.agent.yml
If everything goes successfully, it will start to send files to the Archivo server.
In Archivo Panel, by clicking on each source server in the list you can see your files below:
By selecting each file, you can access the list of file's snapshots and download any as you want:
On each row, you can see this information for each snapshot that explained as below:
Fields | Description |
---|---|
Name | Each snapshot will be named by the combination of date and time |
Size | Snapshot size on disk |
Checksum | Snapshot checksum that is file sha256 hash and can be used to determine whether the file has been changed or not |
Created at | Time that snapshot created |
Currently, only the admin user can register a new user. Each user has an initial password that the admin sets for them. At first login, each non-admin user will asked for a password change and that new password will be used by the user in the panel.
The only difference between admin and non-admin users is registering new users and listing user activities in the panel.
Feel free to open an issue if you have questions, run into bugs, or have a feature request.
Contributions are welcome! Happy Coding :)