From e3fb46b07953e0cc9d71bb918312bf59067c9942 Mon Sep 17 00:00:00 2001 From: GigabiteStudios Date: Sat, 20 Jun 2026 17:21:36 -0500 Subject: [PATCH] chore(repo): add local runner and ignore rules --- .gitignore | 64 ++++++++++++++++++++++++++++++++++++++++-------------- run.bat | 36 ++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 16 deletions(-) create mode 100644 run.bat diff --git a/.gitignore b/.gitignore index ce1e4ff..059a07e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,62 @@ -# ---> Go -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins +# Build outputs +/bin/ +/dist/ +/build/ *.exe *.exe~ *.dll *.so *.dylib +*.a +*.lib +*.o +*.obj -# Test binary, built with `go test -c` +# Go tooling *.test - -# Output of the go coverage tool, specifically when used with LiteIDE *.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file +coverage.out +coverage.html +cover.out go.work go.work.sum -# env file +# Dependency/vendor +# Uncomment if you vendor dependencies locally +# /vendor/ + +# Runtime data +/data/ +*.db +*.db-journal +*.db-shm +*.db-wal +*.sqlite +*.sqlite3 + +# Logs and temp files +*.log +*.tmp +*.temp +/tmp/ +/temp/ + +# Environment and local overrides .env +.env.* +!.env.example -# app data -data/ +# IDE / editor +.idea/ +.vscode/ +*.code-workspace +# OS / Windows noise +.DS_Store +Thumbs.db +Desktop.ini +$RECYCLE.BIN/ + +# Local test/debug artifacts +*.local +*.cache diff --git a/run.bat b/run.bat new file mode 100644 index 0000000..47feb7d --- /dev/null +++ b/run.bat @@ -0,0 +1,36 @@ +@echo off +setlocal + +cd /d "%~dp0" + +if not exist ".env" ( + echo No .env found. Using built-in defaults and any current environment variables. +) + +if not exist "data" ( + mkdir "data" +) + +if defined MAINTAINARR_ADDR ( + set "BIND_ADDR=%MAINTAINARR_ADDR%" +) else ( + for /f "usebackq delims=" %%P in (`powershell -NoProfile -Command ^ + "$listener = Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue; " ^ + "foreach ($port in 8080..8090) { if (-not ($listener | Where-Object LocalPort -eq $port)) { Write-Output $port; break } }"`) do ( + set "PORT=%%P" + ) + + if not defined PORT ( + echo No free port found in the range 8080-8090. + echo Set MAINTAINARR_ADDR manually and try again. + exit /b 1 + ) + + set "BIND_ADDR=:%PORT%" + set "MAINTAINARR_ADDR=%BIND_ADDR%" +) + +echo Starting Maintainarr on http://localhost%MAINTAINARR_ADDR% +go run ./cmd/maintainarr + +endlocal