Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Refactor #97

Open
wants to merge 100 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
d2d8da3
remove notify. if provided from notify entity
iloveicedgreentea Feb 14, 2024
96bdb07
implement hdmi sync for plex
iloveicedgreentea Feb 23, 2024
76a5c9c
normalize envy name
iloveicedgreentea Feb 24, 2024
6aebdd3
implement sync for JF, improve misc
iloveicedgreentea Feb 24, 2024
bbff4e9
try to read atmos from file name
iloveicedgreentea Feb 24, 2024
0675f6b
fix typo
iloveicedgreentea Feb 24, 2024
7d8ca06
force rebuild
iloveicedgreentea Feb 24, 2024
c8cd6d2
no cache
iloveicedgreentea Feb 24, 2024
114c8b7
copy latest web
iloveicedgreentea Feb 24, 2024
78b4386
try to fix pr builds
iloveicedgreentea Feb 25, 2024
065dbbd
try implement AVR codec
iloveicedgreentea Feb 26, 2024
75b351d
improve matching
iloveicedgreentea Feb 26, 2024
879b079
remove need for scheme
iloveicedgreentea Feb 26, 2024
61d4e1a
improve speed of light action
iloveicedgreentea Feb 26, 2024
d97b388
fix req
iloveicedgreentea Feb 26, 2024
6cecba1
add timing instrumentation
iloveicedgreentea Feb 26, 2024
b174147
scaffolding for context
iloveicedgreentea Feb 27, 2024
2d47e30
improve log
iloveicedgreentea Feb 27, 2024
05323a7
missing return
iloveicedgreentea Feb 27, 2024
59f615b
add test endpoint
iloveicedgreentea Apr 29, 2024
72265f3
update docker
iloveicedgreentea Apr 29, 2024
dcdab92
case insensitive comparison for stuff
iloveicedgreentea Jun 2, 2024
1e80289
update field description
iloveicedgreentea Jun 2, 2024
9725b3f
update deps
iloveicedgreentea Jun 2, 2024
c8f6f3d
add support for TZ
iloveicedgreentea Jun 2, 2024
cabf4b1
update toolchain
iloveicedgreentea Jun 2, 2024
86d46b0
dont assume scheme
iloveicedgreentea Jun 6, 2024
616437e
update deps
iloveicedgreentea Jun 26, 2024
836a807
feat: start refactor
iloveicedgreentea Jul 4, 2024
39fc83d
fix: structure
iloveicedgreentea Jul 4, 2024
3a33e9a
working on more changes
iloveicedgreentea Jul 11, 2024
d62c507
feat: start event driven workflow
iloveicedgreentea Aug 3, 2024
ec1e318
flesh out webhooks
iloveicedgreentea Aug 4, 2024
c60006a
update tests, catch empty bodies
iloveicedgreentea Aug 4, 2024
f43f031
improve tests
iloveicedgreentea Aug 4, 2024
d68b113
rewrite most components
iloveicedgreentea Aug 8, 2024
c573e02
porting more code
iloveicedgreentea Aug 9, 2024
a6e0093
fix log
iloveicedgreentea Aug 9, 2024
49f6f8b
fixing more
iloveicedgreentea Aug 9, 2024
28b9ec1
fix code
iloveicedgreentea Aug 9, 2024
5babbfa
move sync, split common, fix events
iloveicedgreentea Aug 11, 2024
e94a451
start main loop
iloveicedgreentea Aug 11, 2024
d24a8a7
add config stuff
iloveicedgreentea Aug 19, 2024
80c6f68
add database based configs
iloveicedgreentea Aug 20, 2024
42dfe20
misc fixes
iloveicedgreentea Aug 20, 2024
a095fce
feat: match short hand beq catalogue
iloveicedgreentea Nov 11, 2024
7ff38a6
fix: url scheme for ezbeq, better edition matching
iloveicedgreentea Nov 14, 2024
afcd8b1
improve config, add new opts
iloveicedgreentea Nov 15, 2024
7fe0946
fix requests, support new opts
iloveicedgreentea Nov 15, 2024
9afbce9
remove mqtt and actions
iloveicedgreentea Nov 26, 2024
8a7d004
use retryable
iloveicedgreentea Dec 6, 2024
6f21ee4
config
iloveicedgreentea Dec 6, 2024
cdd41e1
test
iloveicedgreentea Dec 6, 2024
6c1f642
linter
iloveicedgreentea Dec 6, 2024
8ed4155
passing ezbeq tests
iloveicedgreentea Dec 6, 2024
b3f9242
remove mqtt, fix all tests, redo HA
iloveicedgreentea Dec 11, 2024
883b12d
just, tests
iloveicedgreentea Dec 11, 2024
804f53f
db frontend working
iloveicedgreentea Dec 11, 2024
2bf3c0c
add packages
iloveicedgreentea Dec 11, 2024
e7f2b0a
basic react rewrite
iloveicedgreentea Dec 13, 2024
54c7832
use toasts
iloveicedgreentea Dec 13, 2024
7599dd1
improve UI
iloveicedgreentea Dec 14, 2024
ccc761e
add logs
iloveicedgreentea Dec 14, 2024
7467b73
improve logger
iloveicedgreentea Dec 14, 2024
6f1e1e5
readme
iloveicedgreentea Dec 14, 2024
beca677
upgrade deps
iloveicedgreentea Dec 14, 2024
eebe0c4
Merge pull request #90 from iloveicedgreentea/refactor
iloveicedgreentea Dec 14, 2024
fde972e
fix path
iloveicedgreentea Dec 14, 2024
bf17246
Merge branch 'master' into develop
iloveicedgreentea Dec 14, 2024
30cc965
fix docker
iloveicedgreentea Dec 14, 2024
3e78360
improve log view
iloveicedgreentea Dec 14, 2024
3e87333
fix logs in docker
iloveicedgreentea Dec 14, 2024
28fb051
copy files
iloveicedgreentea Dec 14, 2024
54bae53
try fix actions
iloveicedgreentea Dec 15, 2024
5399a2c
fix gitignore
iloveicedgreentea Dec 15, 2024
c3fb608
fix: set url in docker
iloveicedgreentea Dec 17, 2024
7de0714
fix: endpoints
iloveicedgreentea Dec 17, 2024
4bf75e5
decompose client code, tests
iloveicedgreentea Dec 24, 2024
1d1003a
fix waitgroup
iloveicedgreentea Dec 24, 2024
7cce3ec
log
iloveicedgreentea Dec 24, 2024
fafa599
fix getting years
iloveicedgreentea Dec 24, 2024
19eba73
more logs
iloveicedgreentea Dec 24, 2024
910b5a7
add context management, pause, stop, etc
iloveicedgreentea Dec 24, 2024
4cccbd1
complete some todos
iloveicedgreentea Dec 24, 2024
50b4c92
update readme
iloveicedgreentea Dec 24, 2024
dc11e27
add panic logger
iloveicedgreentea Dec 31, 2024
7fb4587
remove supervisor, adjust panic handler
iloveicedgreentea Dec 31, 2024
7545c0a
fix docs
iloveicedgreentea Dec 31, 2024
7b069f5
add device profile view to dashboard
iloveicedgreentea Dec 31, 2024
252a32d
docs, fix error display
iloveicedgreentea Jan 1, 2025
48e830f
doc
iloveicedgreentea Jan 1, 2025
83e1cc6
add scheme
iloveicedgreentea Jan 3, 2025
e6afbb3
dont add year if blank
iloveicedgreentea Jan 4, 2025
66c5262
add uuid/owner filter, sync, tests
iloveicedgreentea Jan 15, 2025
d74b852
fix tests
iloveicedgreentea Jan 15, 2025
fad3232
bump action
iloveicedgreentea Jan 15, 2025
9b587f9
improve filters, reduce logspam
iloveicedgreentea Jan 25, 2025
e19c01e
fix stupid boolean bug
iloveicedgreentea Jan 27, 2025
711d06f
fix log date display
iloveicedgreentea Jan 27, 2025
0acd36f
support IsBeqTVEnabled
iloveicedgreentea Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
.git*
.git*
**/node_modules
Dockerfile*
docker-compose*
.dockerignore
.gitignore
README.md
.vscode
Makefile
helm-charts
.env
.editorconfig
.idea
coverage*
15 changes: 8 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Docker

on:
push:
tags: ['v*.*.*'] # Triggers on tag following semantic versioning
tags: ['v*.*.*']
pull_request:
branches: ['master', 'develop'] # Triggers on PR to these branches
types: [opened, synchronize]
branches: ['master', 'develop']

env:
REGISTRY: ghcr.io
Expand All @@ -17,16 +17,16 @@ jobs:
contents: read
packages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

- name: Setup Docker buildx
uses: docker/[email protected]

- name: Log into registry ${{ env.REGISTRY }}
# if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event_name == 'pull_request'}}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -40,8 +40,9 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5.3.0
uses: docker/build-push-action@v6.11.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
no-cache: true
tags: ${{ steps.meta.outputs.tags }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build
.DS_Store
*config.json
**/config.json
media.*.priv*
docker/data
coverage.*
Expand All @@ -20,3 +20,8 @@ coverage.*

# Dependency directories (remove the comment below to include it)
# vendor/

*.db
*.sqlite3
applog.log
test_web.sh
82 changes: 82 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Options for analysis running
run:
# Timeout for analysis, e.g. 30s, 5m
timeout: 60s

# Include test files
tests: true

# Use all available CPU cores
concurrency: 4

# Exit code when at least one issue was found
issues-exit-code: 1

# Output configuration options
output:
# Make issues output unique by line
uniq-by-line: true

# Sort results by: filepath, line and column
sort-results: true

# Linters settings
linters:
disable-all: true
enable:
# - gofmt # Checks formatting
# - gofumpt # Stricter gofmt
- govet # Reports suspicious constructs
- errcheck # Checks for unchecked errors
- gosimple # Suggests code simplifications
- staticcheck # Go static analysis
- unused # Checks for unused constants, variables, functions and types
- ineffassign # Detects ineffective assignments
- typecheck # Go type checker
- bodyclose # Checks whether HTTP response bodies are closed
- gosec # Inspects code for security problems
- prealloc # Suggests slice preallocation
- revive # Fast, configurable, extensible, flexible, and beautiful linter
- misspell # Finds commonly misspelled English words
- copyloopvar # Checks for pointers to enclosing loop variables
- gocritic # Provides diagnostics that check for bugs, performance and style issues

# Linter-specific settings
linters-settings:
gosec:
excludes:
- G104 # Audit errors not being checked (too noisy)

revive:
rules:
- name: exported
severity: warning
disabled: true
- name: unexported-return
severity: warning
disabled: false
- name: receiver-naming
severity: warning
disabled: false

gocritic:
disabled-checks:
- commentedOutCode
enabled-tags:
- performance
- style
- diagnostic


# Issues configuration
issues:
# Maximum count of issues with the same text
max-same-issues: 3

# Maximum issues count per one linter
max-issues-per-linter: 50

# Don't show issues from excluded files
exclude-use-default: false
exclude-dirs:
- vendor
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-mod-tidy
# Formatting
- id: go-fumpt
args: [-l, -w]
# GolangCI-Lint
- id: golangci-lint-mod
args: [--fix, --config=.golangci.yml]
64 changes: 51 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,60 @@
FROM golang:1.22 as build

# Backend build stage
FROM golang:1.23 AS backend-build
WORKDIR /go/src/app
COPY . .
RUN go mod download
WORKDIR /go/src/app/cmd
RUN go vet -v
WORKDIR /go/src/app/cmd/gowatchit

RUN go build -o /go/bin/app

# Frontend build stage
FROM oven/bun:1 AS frontend-build
WORKDIR /usr/src/app
COPY web/package.json web/bun.lockb ./
RUN bun install --frozen-lockfile
COPY web/ ./
RUN bun run build

RUN CGO_ENABLED=0 go build -o /go/bin/app
# Final stage
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
tzdata \
nginx \
sqlite3 \
libsqlite3-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

FROM alpine:20240329
# Create necessary directories
RUN mkdir -p /data \
/run/nginx \
/var/lib/nginx \
/var/lib/nginx/tmp \
/var/lib/nginx/logs \
/var/lib/nginx/tmp/client_body \
/var/lib/nginx/tmp/proxy \
/var/lib/nginx/tmp/fastcgi \
/var/lib/nginx/tmp/uwsgi \
/var/lib/nginx/tmp/scgi

RUN apk add supervisor
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY docker/watch.py /watch.py
# Copy backend
COPY --from=backend-build /go/bin/app /gowatchit
RUN chmod +x /gowatchit

# Copy frontend build files
COPY --from=frontend-build /usr/src/app/dist /var/www/html/

# Copy config files
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

COPY --from=build /go/bin/app /
COPY --from=build /go/src/app/web /web
EXPOSE 9999
EXPOSE 3000

ENV TZ=America/New_York
ENV GIN_MODE=release
ENV LOG_FILE=true
ENV BASE_DIR=/data

# CMD ["/app"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
CMD ["/entrypoint.sh"]
21 changes: 0 additions & 21 deletions Dockerfile.dev

This file was deleted.

18 changes: 18 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
help:

build:
cd cmd/gowatchit && go build -o ../../build/gowatchit
test:
./test.sh
docker-build:
docker buildx build --platform linux/arm64 --load --tag gowatchit-local . -f ./Dockerfile
docker-push:
docker buildx build --push --platform linux/amd64 --tag ghcr.io/iloveicedgreentea/gowatchit:test .
docker-run: docker-build
LOG_FILE=true LOG_LEVEL=debug docker-compose -f docker-compose.yml up
run:
LOG_ENV=local LOG_FILE=true LOG_LEVEL=debug go run ./cmd/gowatchit/
run-ui:
cd web && bun run dev
live-test:
./test_web.sh
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Without limiting other conditions in the License, the grant of rights under the

For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license notice or attribution required by the License must also include this Commons Clause License Condition notice.

Software: Plex Webhook Automation
Software: Gowatchit

License: Commons Clause + The license below

Expand Down
14 changes: 0 additions & 14 deletions Makefile

This file was deleted.

Loading
Loading