chore: add files from base_repo template

This commit is contained in:
Alexander Navarro 2025-02-10 13:16:28 -03:00
parent 5e8a72a714
commit fd44bd54a5
13 changed files with 151 additions and 31 deletions

0
.devfiles/hooks/.gitkeep Normal file
View file

View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euxo pipefail
cog verify --file "$1"

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euxo pipefail
root="$(git rev-parse --show-toplevel)"
cd "$root"
export PATH=$PATH:.devfiles/bin
gitleaks git
# Only validate encrypted files if we are tracking any
if [[ -e .ageboxreg.yml ]]; then
agebox validate --no-decrypt
fi

View file

@ -1,14 +1,22 @@
set dotenv-load := true
export PATH := source_dir() + "/bin:" + source_dir() + "/scripts:" + env("PATH")
export AGEBOX_DEBUG := "0"
export AGEBOX_PUBLIC_KEYS := source_dir() + "/public_keys.txt"
fetch-deps:
.devfiles/scripts/fetch_gh_release.sh "slok/agebox" "agebox-linux-amd64" "agebox"
# Install agebox from the latest github realse
install-agebox:
curl -sSL "https://github.com/slok/agebox/releases/latest/download/agebox-linux-amd64" -o .devfiles/bin/agebox
chmod + x .devfiles/bin/agebox
[no-cd]
install-hooks:
cog install-hook --all
# Easy and simple file repository encryption tool based on Age.
[working-directory('..')]
agebox +ARGS="--help":
@.devfiles/bin/agebox {{ ARGS }}
@agebox {{ ARGS }}
# Encrypt the provided files, relative to project root.
encrypt +FILES: (agebox "encrypt " + FILES)
@ -26,7 +34,11 @@ decrypt-all: (agebox "decrypt --all --force")
reencrypt: (agebox "reencrypt")
# Show the content of an encrypted file to stdout.
peek +FILES: (agebox "cat " + FILES)
crypt-peek +FILES: (agebox "cat " + FILES)
# Validate that all tracked files are encrypted.
check:(agebox "validate --no-decrypt ")
crypt-check:(agebox "validate --no-decrypt ")
# Validate no credentials are pushed to git
leaks:
@gitleaks git --verbose --redact

View file

View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(git rev-parse --show-toplevel)"
export PATH=$root/.devfiles/bin:$root/.devfiles/scripts:$PATH
devtools=(
age
agebox
cog
gitleaks
)
missing_tools=()
for cmd in "${devtools[@]}"; do
if ! command -v "$cmd" &>/dev/null; then
missing_tools+=("$cmd")
fi
done
if [[ ${#missing_tools[@]} != 0 ]]; then
echo "The following tools where not found:"
printf "%s\n" "${missing_tools[@]}"
exit 1
else
echo -e "All tools are installed!"
fi

42
.devfiles/scripts/gitignore.sh Executable file
View file

@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(git rev-parse --show-toplevel)"
base_url="https://git.alecodes.page/api/v1/gitignore/templates"
query="$*"
list_available() {
curl -Ssl $base_url | jq -r '.[]'
}
if [[ -z $query ]]; then
list_available
exit 0
fi
tmp_file="$(mktemp)"
for template in $query; do
# Capitalize the string
template=${template,,}
template=${template^}
response="$(curl -Ssl "$base_url/$template")"
name="$(echo "$response" | jq -r '.name')"
content="$(echo "$response" | jq -r '.source')"
if [[ "$content" == "null" ]]; then
echo "Template not found, available options:"
list_available
exit 1
fi
printf "\n### %s\n\n%s\n\n" "$name" "$content" >>"$tmp_file"
done
sed -i -ne "/#### -- TEMPLATES BEGIN -- ####/ {p; r $tmp_file" -e ':a; n; /#### -- TEMPLATES END -- ####/ {p; b}; ba}; p' "$root/.gitignore"
rm "$tmp_file"

BIN
.env.agebox Normal file

Binary file not shown.

3
.gitleaksignore Normal file
View file

@ -0,0 +1,3 @@
467de171837c165cd412332584d54201f93b0d41:files/docker/lemmy/lemmy.hjson:generic-api-key:12
467de171837c165cd412332584d54201f93b0d41:files/docker/lemmy/lemmy.hjson:generic-api-key:8
467de171837c165cd412332584d54201f93b0d41:files/docker/lemmy/pictrs.toml:generic-api-key:2

View file

@ -1,4 +1,5 @@
import '.devfiles/justfile'
# Repo management tasks
mod repo '.devfiles/justfile'
export ANSIBLE_VAULT_PASSWORD_FILE := justfile_directory() + "/.decrypt-pass.txt"
export ANSIBLE_BECOME_PASSWORD_FILE := justfile_directory() + "/.become-pass.txt"

31
cog.toml Normal file
View file

@ -0,0 +1,31 @@
from_latest_tag = false
ignore_merge_commits = true
disable_changelog = false
disable_bump_commit = false
generate_mono_repository_global_tag = true
generate_mono_repository_package_tags = true
branch_whitelist = []
skip_ci = "[skip ci]"
skip_untracked = false
pre_bump_hooks = []
post_bump_hooks = []
pre_package_bump_hooks = []
post_package_bump_hooks = []
[git_hooks]
[git_hooks.pre-commit]
path = ".devfiles/hooks/pre-commit.sh"
[git_hooks.commit-msg]
path = ".devfiles/hooks/commit-msg.sh"
[commit_types]
[changelog]
path = "CHANGELOG.md"
authors = []
[bump_profiles]
[packages]

View file

@ -1,25 +0,0 @@
$ANSIBLE_VAULT;1.1;AES256
34326137303139636664306330643433353766383839373262633531633336336434326136633331
6266336136633662366234303339343435633935653835330a313337386531346535633164363732
33333162663564343032323038353737663532616133353538626265646665393131336132393863
3335613064643365380a366633363531363332663939343030373265343438633365633264376236
30313862373337343961363164666166633137636232646365666333333261356264313235643365
36663336636132376366396338346164303066343234613236633561393063313636616630303838
33636231373465333830613630393366653363643561396465363765383764326538633464366530
66626363336565343832373631363237653333653265616331623938356266343235656239656134
66306565646333656337336632636162356531666337613766396439623135633430623132643335
32373965613962336338633933346437396139393539656437326666363661653231653230313634
61633032316436646663616437343161363534383365656364303131646636643232366361653231
30643839343961366665653265666662386537623738356537393364336365396136346361656538
38653936613261306632386665336162666539646564666232353064646564643036343437396566
64656261633534316166656564326563323732316436316161303633373564653834356433366561
39643164373866346531353037613563623038626536616434316266323130643534303736653263
63643632316562616462333835343437613865363763323464646231343066393264653833383662
30326332373432326665306338383963333137376538373839626631356236353838376332636132
64636632336139396437356336326331343832346166386136356239323966376532346130613833
36316633633536653163313166396238373139383763306532346334343466366136636339646235
66326162323666306566616339353930353732336538303835366132363139336462373736366538
39636138383536363332326534356366313362353739373666303133326364643832616431316363
35393364386536393761303733336230633832646531623264616463323862313565316566666137
30306433313563313363643034356265316564393166336361663431633930663361356432313861
38393732626237353131

View file

@ -0,0 +1,5 @@
age-encryption.org/v1
-> X25519 gYcsPablv8DX5YR2YElCe9IYxd4jACU30GaL97JfETM
PSYUSaAkiHBtprz6qUKqP8RFPkgHCwwnFCACzKlsGU0
--- giGOMUX2iMWaixyGM7ZxyCPMz10xFxNIJA9vpsJEW+4
Jïö™µvÝtôüpŸT(~AnfL¦™¿“3Â$PÈyU î<>“²ü!˜…]ìoÞ˜×/×<>£LµÓ ¦S:…bÔå-fÓÂrÿ¢Åq=@Ùwrq6{±eÛƒ€lg¸ø<C2B8>ö ué”Ã×{<7B>b·L_®“º>cÆb4?eŠ®}¡)Pp|ÚD,üØo²¢IëX•_×c´ì‰êƒpGÖø¡¿%y¾ÿG)`<60>žãŒsR7PR<50>æKu%¼ ÁØz0aÔ®˜XKìrÍ>'ðßSáÖLwÁp¬pIo/MåšçÎ è/2:€@.n9 þcXùåÔÃÙG_¤-ŽObš†½O<C2BD>PÆTDÆ™`p:F˜¬{,ŠxUµûLa• 1•ãšerÓÙB»½‹‡\ÅJ Bë˜q¬e…sBѽ=ˆíù"è‹X7õ0<C3B5>=vyWÆÇ<C386> Îÿ¿æ}U¦'ÒÅõ!å:Ö ;p·‡nÌÂr2ªD¨*²n¤äQv4™É%ª|Kx¯ó®ŸîÃH“\“Ç1¬¤:D40r«ì†{†”