Skip to main content

A tool to manage config files across machines.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

configfiles-0.3.1.linux-x86_64.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

configfiles-0.3.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file configfiles-0.3.1.linux-x86_64.tar.gz.

File metadata

  • Download URL: configfiles-0.3.1.linux-x86_64.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for configfiles-0.3.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 16c27d6a86c4effee8284394462bbbe8fe4348d51952d25d1dcab617e4067939
MD5 c62be1918abaf0a4f2651eb777be5235
BLAKE2b-256 447d080911b60b48c0697fb212a0d572d97f2e192a2fdcffd8ec90d386276de3

See more details on using hashes here.

File details

Details for the file configfiles-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: configfiles-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for configfiles-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be5f58c746e942b974aeaea1e993d379df7fcd1ee25088b0fd126fa15e2f8c4a
MD5 414464b4b03035b6bee0a63f3d4ee89c
BLAKE2b-256 cb14c84e99d86a352fd34ad1b494eed94f57da65068bdbee70aeb3d9bd6401ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page