Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mincrmatt12/configfiles
A system to manage configuration using something similar to version control
https://github.com/mincrmatt12/configfiles
cli config python vcs
Last synced: 8 days ago
JSON representation
A system to manage configuration using something similar to version control
- Host: GitHub
- URL: https://github.com/mincrmatt12/configfiles
- Owner: mincrmatt12
- License: mit
- Created: 2018-11-02T01:26:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T14:15:03.000Z (about 6 years ago)
- Last Synced: 2024-11-13T19:44:50.372Z (about 2 months ago)
- Topics: cli, config, python, vcs
- Language: Python
- Size: 28.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# configfiles
[![PyPI version](https://badge.fury.io/py/configfiles.svg)](https://badge.fury.io/py/configfiles)
[![Python 3.6+](https://img.shields.io/badge/python-3.6%2B-blue.svg)](https://www.python.org)A system to synchronize configuration files across multiple machines, the smart way.
## Installation
```
$ pip install configfilesor
$ pip install -r requirements.txt
$ python setup.py install
```## Design
`configfiles` works on a model of storing and incrementally updating config files, or more accurately scripts to update config files.
These scripts are usually autogenerated from file changes, but can be customized to do things like install dependencies or fill-in system
specific information.Unlike git, the updates to these files are stored as a sequence of scripts, as opposed to a graph of diffs. This makes for less powerful
branching, but a much simpler internal model. In future versions this may be amended, but it works better for something based around scripts.The scripts in question are not actually shell scripts, rather small pieces of python for better interoperability. Most of the time they are
auto-generated.---
Be aware that when using configfiles you open yourself to running arbitrary python code at the same privilege as your account, and
be sure to only `sync` to trusted repos---
## Usage
There are a few main operations in configfiles, the first being `sync`, which updates a system to the latest version of a config repo.
---
Do note that once `sync`-ed to a repo, one must `desync` to use another one---
```
$ configfiles sync config.someserver.url:repo/path
```The server path may be omitted to use the last `sync`-ed server.
To update a configfiles repo, one may use the `update` operation, which takes the diff of a file and adds it as a script. The net result
is that the file is "checked-in" to the repo.```
$ configfiles update .zshrc
```---
Do note that configfiles paths operate relative to the current user folder by default, and `update` will warn against adding files below the home directory.---
To use a custom python script as an update method, use `add`.
```
$ configfiles add my_updater.py modifies_file.rc
```Scripts are ran in the home directory, with full access guaranteed to the configfiles public API.
To revert a change made by `sync`, use `rollback`.
```
$ configfiles rollbackor (with caution)
$ configfiles rollback --remote
```---
Do note that rollback only cares about files, and there is currently no way to create transactional scripts (i.e. a custom rollback script)
The main purpose of the scripting functionality is to customize files for machine-specific things, which is why it is designed this way.---
Before using any of the above, a configfiles repo must be `init`-ed.
`init` creates a new repo with no additional scripts.
```
$ configfiles init config.someserver.url:repo/path
$ configfiles sync config.someserver.url:repo/path
$ configfiles update .zshrc
```## Further documentation
TODO, refer to code comments for more information
## Server requirements
A server hosting a configfiles repo must support sftp, and that is it. There is no "configfiles server", the entire system's code is client-only
## Changelog
0.3.1:
- bugfixes0.3.0:
- added ability to sync specific number of times
- bugfixes0.2.1:
- bugfix release0.2.0:
- initial release