Our company Has a SVN repository for an our software, based off Rails.
We've also had a manually updated encrypted repository - pull unencrypted, encode with RubyEncoder, push to encrypted.
We've mostly transitioned to Git, and would like to make the process automatic, and I'd like to make the process automatic, and per-commit.
So
- Server recieves a push to unencrypted, any branch
- Server filters changed .rb files, passing them through Rubyencoder
- Encrypted .rb files & other files are pushed to encrypted repository, commit message kept, so there is a 1:1 commit ratio
- Branch creation and deletion is also mirrored.
Unlike solutions like git-encrypt, it's the customer's comuter we interpret as insecure, not the code repository.
My first attempt was a long post-recieve hook, which was slow and branching didn't work correctly, so I abandoned it.
My second attempt was setting *.rb = rubyencode
and setting up clean
and smudge
filters. While RubyEncoder can be set to input on /dev/stdin and output to /dev/stdout, it seems these affect files on disk without effecting git history, requiring another commit per received push.
The server-local pull and push ( git remote origin add git@git.work.com:product/work_unencrypted.git
and git remote set-url origin --push git@git.work.com:product/work_encrypted.git
to get it to push and pull from the expected repository ) would have been triggered by the post-recieve hook, if clean/smudge was working as expected.
I'm lost enough I don't even know the proper question to ask at this point. Maybe it's how to step through & modify commits to keep the 1:1 history?