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

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