Go to file
Balakrishnan Balasubramanian e7bb97019d add target for tmpfiles create 2024-05-09 12:13:08 -04:00
LICENSE Add LICENSE 2022-07-28 02:47:49 +00:00
Makefile add target for tmpfiles create 2024-05-09 12:13:08 -04:00
README.md fix typo 2023-05-31 13:49:40 -04:00
install.sh Copy symlinks instead of contents 2022-12-27 22:02:48 -05:00
sort_acl.sh Don't save custom acl permissions. 2023-02-25 01:45:18 -05:00

README.md

makepac is a simple configuration manager for a linux system

A typical linux app needs multiple files in different paths spread in the file-system. E.g. systemd service, timer, app config, webserver config, logrotate config. makepac keeps all configs in a single place in a git repository and copies them to real root

Easily share the setup to other user.

Initial setup

mkdir myfiles
cd myfiles
git init
git submodule add https://gitlab.com/balki/makepac'
echo "include makepac/Makefile" > Makefile'
sudo apt install acl
make skel
git add .
git commit -m 'initial commit'

Workflow

  1. Create required files under root/
  2. Set correct ownership and permissions
  3. Run make intall
  4. Run make sd-users and make sd-reload if required
  5. Enable and test the service and update all configs as required
  6. Run make save-perms to update ./acl file
  7. Add any important notes in README (like dependencies, additional commands ran)
  8. Finally git commit

Cloning from other user

git clone <other user repo url>
make set-perms
make install

Usage

 make help
makepac
--------
Simple configuration manager

See https://gitlab.com/balki/makepac for usage

help:         Show this help
install:      Installs files in root/ to real root
sd-reload:    Run this after editing systemd service/timer files
sd-users:     Run this after adding new users
save-perms:   Saves the file permissions to ./acl. Run this after adding new files with correct permissions
set-perms:    Restores permissions of all files from ./acl
skel:         Creates common directories needed

Tips

  1. When adding a file with no public read permissions, it can't be saved in the git repo. You can git-ignore the file or add read permission for the repo user using below command. Also consider setting up git-crypt for those files

    sudo setfacl -m "u:$USER:r" root/etc/app/secret_token