Sync git repositories with dom0 (qubes-git-syncer) revisions

Go back to topic: Sync git repositories with dom0 (qubes-git-syncer)

  1. v6 anchor; v6 full version
  2. v5 anchor; v5 full version
  3. v4 anchor; v4 full version
  4. v3 anchor; v3 full version
  5. v2 anchor; v2 full version

Revision #6

Edited on
2024-01-03
Edited by user
Bearillo

Revision #5

Edited on
2024-01-03
Edited by user
bruno_schroeder
### Objectives 1. To be able to sync git (`git clone`, `git pull`, `git push`) repositories through different doms (VMs), so that users can have an infra-tools vault VM with git bares to serve as remote. 2. Having SaltStack states that create infra-tools vault and easily set's up desired git bares. It would be good to do it having a VM to interact with online git communities (codeberg, gitlab, github, etc..) and having infra-tools vault clone from there. 3. Integrate infra-tools to Qubes main development branch. ### Status At this point, all we have: To sync a git repo from dom0 to vm: # Sync git repositories with dom0 This solution is intended have git repos easily in sync with dom0. The initial motivation is to reduce the toil on the development of SaltStack/Jinja states for Qubes. The solution consists of a bash file (`dom0-syncer.sh` - a lib) with a function. It should be added somewhere in the project. On project root path, the user should create one (or two) bash script "sourcing the lib" (bash's "importing") and calling the function (as described in Suggested Usage). ### Under the hood To sync a git repo **from** dom0 to vm:
git bundle create $DOM0DIRPATH/$FILENAME --all sudo qvm-move-to-vm $VM_NAME $DOM0DIRPATH/$FILENAME # dom0: git bundle create $DOM0DIRPATH/$FILENAME --all sudo qvm-move-to-vm $VM_NAME $DOM0DIRPATH/$FILENAME
To sync a git repo to dom0: To sync a git repo **to** dom0:
sudo qvm-run --pass $VM_NAME 'cd ${VMPATH} && git bundle create - --all ' > $DOM0DIRPATH/$FILENAME # dom0: sudo qvm-run --pass $VM_NAME 'cd ${VMPATH} && git bundle create - --all ' > $DOM0DIRPATH/$FILENAME
### Working Repo, please contribute ### Context (History) We are in Qubes 4.1.2. It's 2023-12. First contribution by Bruno Schroeder. Similar effort by @solene: - (https://dataswamp.org/~solene/2023-06-17-qubes-os-git-bundle.html) ### Source Code It's GPL v3+, be my guest at codeberg:

Revision #4

Edited on
2024-01-03
Edited by user
bruno_schroeder

Revision #3

Edited on
2023-12-12
Edited by user
bruno_schroeder
https://codeberg.org/brunoschroeder/qubes-git-syncer
`````` ### Working Repo, please contribute https://codeberg.org/brunoschroeder/qubes-git-syncer

Revision #2

Edited on
2023-12-12
Edited by user
bruno_schroeder
https://codeberg.org/brunoschroeder/qubes-git-syncerhttps://codeberg.org/brunoschroeder/qubes-git-syncer ### Status At this point, all we have: To sync a git repo from dom0 to vm: ``` git bundle create $DOM0DIRPATH/$FILENAME --all sudo qvm-move-to-vm $VM_NAME $DOM0DIRPATH/$FILENAME ``` To sync a git repo to dom0: ``` sudo qvm-run --pass $VM_NAME 'cd ${VMPATH} && git bundle create - --all ' > $DOM0DIRPATH/$FILENAME ```