Skip to main content

configfiles

PyPI version Python 3.6+

A system to synchronize configuration files across multiple machines, the smart way.

Installation

$ pip install configfiles

or

$ 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 rollback <number of changes>

or (with caution)

$ configfiles rollback --remote <number of changes>

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 <etc>

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:

  • bugfixes

0.3.0:

  • added ability to sync specific number of times
  • bugfixes

0.2.1:

  • bugfix release

0.2.0:

  • initial release

Release files for configfiles 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for configfiles 0.3.1
File Size Uploaded
configfiles-0.3.1.linux-x86_64.tar.gz 21.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for configfiles 0.3.1
File Interpreter ABI Platform
configfiles-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 kB

Release files / configfiles-0.3.1.linux-x86_64.tar.gz

Download URL configfiles-0.3.1.linux-x86_64.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
16c27d6a86c4effee8284394462bbbe8fe4348d51952d25d1dcab617e4067939
BLAKE2b-256 checksum
How to use checksums
447d080911b60b48c0697fb212a0d572d97f2e192a2fdcffd8ec90d386276de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release files / configfiles-0.3.1-py3-none-any.whl

Download URL configfiles-0.3.1-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be5f58c746e942b974aeaea1e993d379df7fcd1ee25088b0fd126fa15e2f8c4a
BLAKE2b-256 checksum
How to use checksums
cb14c84e99d86a352fd34ad1b494eed94f57da65068bdbee70aeb3d9bd6401ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page