chore(repo): add local runner and ignore rules

This commit is contained in:
2026-06-20 17:21:36 -05:00
parent a2dda9380d
commit e3fb46b079
2 changed files with 84 additions and 16 deletions

64
.gitignore vendored
View File

@@ -1,30 +1,62 @@
# ---> Go # Build outputs
# If you prefer the allow list template instead of the deny list, see community template: /bin/
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore /dist/
# /build/
# Binaries for programs and plugins
*.exe *.exe
*.exe~ *.exe~
*.dll *.dll
*.so *.so
*.dylib *.dylib
*.a
*.lib
*.o
*.obj
# Test binary, built with `go test -c` # Go tooling
*.test *.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out *.out
coverage.out
# Dependency directories (remove the comment below to include it) coverage.html
# vendor/ cover.out
# Go workspace file
go.work go.work
go.work.sum 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.*
!.env.example
# app data # IDE / editor
data/ .idea/
.vscode/
*.code-workspace
# OS / Windows noise
.DS_Store
Thumbs.db
Desktop.ini
$RECYCLE.BIN/
# Local test/debug artifacts
*.local
*.cache

36
run.bat Normal file
View File

@@ -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