Initial commit

This commit is contained in:
Brieuc Dubois 2024-01-26 21:38:51 +01:00
commit 6347c150d8
10 changed files with 98 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
key
root/etc/wireguard/*.conf

7
LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright © 2024 Brieuc Dubois
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1 @@
.vscode/

View File

@ -0,0 +1,7 @@
U2FsdGVkX1+ncivGbkl9xEPNrLpEKtnb0Pxry6/T3oWckvIIz8gsj/vWPBO8spcs
UpMsDbsXCcixkoXtlrbKl95F1X4u1EWJyI5qA7UKBezppnTr918kMlNm7KEF41ML
cxEEoLx8vA4CdIgsXAEKfOkGu+wroyYWwFCpqaqd5muYrr7DEy92dFmHbxd79rKW
yyGWACK9Uwju4oR3meZVu6FfXeygcSLNmX4sLBeVazpIU2CUuKui7jntwCtS79gW
cBawTcplAcjQGAYSH3o4YJHIoOaaPC+TVrRLebjpTIPR8D6WJ6I3XqSP8/45iG4/
7ohog51EFovotnKBHvIx2mSx+MzdGd/6vS5ew+UjckG/efp9CTCNuhwhNWDcVnqm
RXWKhjSyxlITFTnLKJZxu7qFvg+0CO4seN723XeqKCU=

View File

@ -0,0 +1,8 @@
U2FsdGVkX19aSzzg8Hk5XyxPZstPe2hwugKjc0NoRd0iAC7+UJahb6MCs0i2ZWeH
fafQ9bAu7+rY1My2F7GSiyjtcTXxtlm66pqaSsJW7MMi7eDgPo5Nr0udZYly259s
YQjsifE7LA3+f87U/v8PAbKVy2atRPh/uXVjC8qxjihNEQt9OSboUpyl5qakbM7X
2lVf7Ekr6E8e+tJzvDxI36ALsxhTCmO8cx+WF0qYIInAv84E+R83xl9PC19IftW6
1dy3w++kYGuldqKnDWV969Hl0BAHYPxyQDHRPvew73RO0dBKcyNYmXiuR469D9yM
OsBwfmRvygWKs9zpn7AAR0uCwh6y9PuH4BJAiyYhn0PTSZU7gmtgvNGpgV1g6CPH
glFHPElh1GaRAeUmDN4N4jmbORtC129MwwiJsY+9CCKRX71uVmhj6P5q5y8R8akQ
kUjZ/4pvmy2l/Z5LjN5LfhdDzs+CrmSb0efYpkj7WNM=

View File

@ -0,0 +1,7 @@
U2FsdGVkX1+91RK7IifU04BNXpMHyP3P2D7noVb68IPY4UfRXEsUbl9OZsVGqnAj
qfvZUwL8JvRTPeIppk+nKlaiBZC1+pb37eYHJ38/5D/3WMuM386T3TX5bQ+RGIN0
tITHuFoCtDe30olAEPCOG6Cr726rDket1AA2aRTrsgVn8LCvH3svJlRT0qpPSi1Z
u34k7Hy5Mo3r9Cpq5/PzDYX+ebfWbY5bVo9vzOKck3eWO15YKOjmC2EwOYkfYw3/
AHXECBlSkMKUVPIqwpRrDNPBio39JSPbk0l9L/r74eIYxSApyV858R5TPooql6hL
GDA/mSgYNR40VGskVSqPyAFOgPIWXUst2Io0GoUf2PGTULlx/xcF2GCaM/ugwJ3R
t/jwo0KqRHhVxeiOM8cXuY0tx6n6bWZ6aBdQ+Z6qgJw=

View File

@ -0,0 +1,8 @@
[include]
path = ~/Documents/sync/.config/git/.gitconfig
[safe]
directory = /opt/flutter
[core]
excludesfile = /home/bhasher/.gitignore_global
[init]
defaultBranch = master

18
scripts/decrypt.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
public_key_file="${1:-key}"
find "../root" -type f -name "*.enc" | while read -r file; do
dir=$(dirname "$file")
base=$(basename "$file" .enc)
openssl aes-256-cbc -d -a -md md5 -pbkdf2 -kfile $public_key_file -out "$dir/$base" -in "$file"
echo "$file -> $dir/$base"
done
amount=$(find "../root" -type f -name "*.enc" | wc -l)
echo ""
echo "$amount files decrypted."

20
scripts/encrypt.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $(basename "$0") <file_path>"
exit 1
fi
if [ ! -f "$1" ]; then
echo "Error: File not found or not a regular file: $1"
exit 1
fi
dir=$(dirname "$1")
base=$(basename "$1")
public_key_file="${2:-$PWD/key}"
openssl aes-256-cbc -e -a -salt -md md5 -pbkdf2 -kfile $public_key_file -out "$dir/${base}.enc" -in "$1"
echo "$1 -> $dir/${base}.enc"

20
scripts/sync.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
src_dir="../root"
dst_dir="/"
function create_hard_links() {
local src_path="$1"
local dst_path="$2"
for item in "$src_path"/*; do
if [ -d "$item" ]; then
mkdir -p "${dst_path}${item#$src_path}/"
create_hard_links "$item" "${dst_path}${item#$src_path}/"
elif [ -f "$item" ] && [[ ! "$item" =~ \.enc$ ]]; then
ln "$item" "${dst_path}${item#$src_path}"
fi
done
}
create_hard_links "$src_dir" "$dst_dir"