Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
39c6c5d
playground
egandro Jan 5, 2026
744ddd8
spec
egandro Jan 5, 2026
b64e341
specs
egandro Jan 5, 2026
12c0ae3
FreshRSS
egandro Jan 5, 2026
c0dd2c2
removed old code
egandro Jan 5, 2026
2e64ea5
vim files
egandro Jan 5, 2026
e7d6de1
go hello world
egandro Jan 5, 2026
83a54ea
word press
egandro Jan 5, 2026
257ab9e
moved to 3 folders
egandro Jan 5, 2026
3f1bdd8
wordpress
egandro Jan 5, 2026
0f6e485
wp network
egandro Jan 5, 2026
45c63b0
isolated db
egandro Jan 5, 2026
4add492
rss bridge
egandro Jan 6, 2026
0711a44
framework
egandro Jan 6, 2026
94de8d7
ci fix
egandro Jan 6, 2026
42059c6
lint fix
egandro Jan 6, 2026
24d60c1
removed 2nd file
egandro Jan 6, 2026
e6e21b5
deleted file
egandro Jan 6, 2026
9920008
docker builds
egandro Jan 6, 2026
65dfc04
infra env and renamed networks
egandro Jan 6, 2026
fddf13f
compose file for our deframer
egandro Jan 6, 2026
124a25d
db and config
egandro Jan 6, 2026
85d5d82
test
egandro Jan 6, 2026
6429979
initial database
egandro Jan 6, 2026
735303b
valkey and postgres for unittest
egandro Jan 6, 2026
f37d45b
asserts
egandro Jan 6, 2026
ee70e80
removed db mock test
egandro Jan 6, 2026
1c3944a
fail test
egandro Jan 6, 2026
0add97b
broken test
egandro Jan 6, 2026
a92ffa0
disabled cache for tests
egandro Jan 6, 2026
7949b32
fixed dsn
egandro Jan 6, 2026
f199d23
framework and manual migration tool
egandro Jan 6, 2026
aadbcdb
launcher
egandro Jan 6, 2026
c5a9668
cache
egandro Jan 6, 2026
4e21b01
renamed to valkey
egandro Jan 6, 2026
d105660
make test invalid
egandro Jan 6, 2026
a5cea55
break valkey
egandro Jan 6, 2026
21a13c2
context
egandro Jan 6, 2026
f9add34
format test
egandro Jan 6, 2026
e3bdc5a
server
egandro Jan 6, 2026
54d168f
basic webserver
egandro Jan 6, 2026
ced40d4
new endpoints
egandro Jan 6, 2026
e3af2b3
facade pattern
egandro Jan 6, 2026
938b692
updated to URL changed valkey
egandro Jan 6, 2026
87eaa34
removed has
egandro Jan 6, 2026
c05a424
has Feed
egandro Jan 6, 2026
ec46647
db logger
egandro Jan 6, 2026
80ed72e
fix keys and enums
egandro Jan 6, 2026
0a181e2
filter
egandro Jan 6, 2026
b32d118
cli
egandro Jan 6, 2026
3dcb86d
better wording for interface
egandro Jan 6, 2026
0fbda10
docs
egandro Jan 6, 2026
e238520
downloader
egandro Jan 6, 2026
4fa5bda
file downloader and feeds
egandro Jan 6, 2026
dea8a10
render feed
egandro Jan 6, 2026
1a55ef9
trim url
egandro Jan 6, 2026
7021a55
stable key
egandro Jan 6, 2026
1b0b683
updated the tem hash key
egandro Jan 6, 2026
9efb804
reader and item to array
egandro Jan 6, 2026
09d0468
GetRssProxyFeed
egandro Jan 6, 2026
8f64cb4
downloader
egandro Jan 6, 2026
2884a55
xml serializer fix
egandro Jan 6, 2026
77ea19d
debug
egandro Jan 7, 2026
3cdc5c0
serializer fix
egandro Jan 7, 2026
7ca4e66
new dir for pg 18
egandro Jan 7, 2026
8b5e770
updated specs
egandro Jan 8, 2026
51bd2dd
cache naming
egandro Jan 8, 2026
1d80c87
updated database model
egandro Jan 8, 2026
280388d
repo / model updated
egandro Jan 8, 2026
078ca34
index, specs, multiple items per feed
egandro Jan 8, 2026
841a5ac
FindItemsByUrl test
egandro Jan 8, 2026
7658f46
index
egandro Jan 8, 2026
8d5af4c
fixed AI vomit for FindItemsByUrl
egandro Jan 8, 2026
5a70d45
Simpler tests
egandro Jan 8, 2026
42d48a0
facade for GetItems
egandro Jan 8, 2026
fd71f29
structs and CI fix
egandro Jan 8, 2026
6219dd2
fixed transaction, more seed data
egandro Jan 8, 2026
a696554
lb docker compose
egandro Jan 9, 2026
f58b5de
initial admin command
egandro Jan 9, 2026
63a957c
logger package
egandro Jan 9, 2026
9e9c8f6
logger
egandro Jan 9, 2026
f7ef4ca
command
egandro Jan 9, 2026
f4d2510
log handling
egandro Jan 9, 2026
472a74b
getAllFeeds
egandro Jan 9, 2026
1614b67
feed
egandro Jan 9, 2026
34be4ab
deleted redundant code
egandro Jan 9, 2026
86fe543
unit test
egandro Jan 9, 2026
2b54776
removed flags
egandro Jan 9, 2026
b744848
filter deleted as default in list
egandro Jan 9, 2026
41589fe
added DrainFeed
egandro Jan 9, 2026
81439f9
fixed tests
egandro Jan 9, 2026
a35ff32
mocked valkey
egandro Jan 9, 2026
38c591e
comment
egandro Jan 9, 2026
9a6af06
sync with code
egandro Jan 9, 2026
ac49a55
valkey fix
egandro Jan 10, 2026
d118152
added dummy domains
egandro Jan 10, 2026
3a9f9ea
valkey update
egandro Jan 10, 2026
d217af6
renames
egandro Jan 10, 2026
d9f7821
renamed to UpdateFeed
egandro Jan 10, 2026
ff12a03
updated document
egandro Jan 10, 2026
cf822bb
auto polling
egandro Jan 10, 2026
b4bd616
updated cli
egandro Jan 10, 2026
e0fe5d1
auto polling -> polling
egandro Jan 10, 2026
78ae92d
admin tool
egandro Jan 11, 2026
f37a79e
new database
egandro Jan 11, 2026
9864f33
reorg
egandro Jan 11, 2026
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
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ignore everything by default
*

# Keep Go module files
!go.mod
!go.sum

# Keep source code directories
!cmd/
!pkg/
!internal/
37 changes: 37 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: 2
updates:
# Keep Go modules up to date
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
# Group minor and patch updates together to reduce PR noise
go-minor-and-patch:
update-types:
- "minor"
- "patch"
commit-message:
prefix: "deps"

# Keep GitHub Actions up to date
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
commit-message:
prefix: "ci"

# Keep Dockerfiles up to date
- package-ecosystem: "docker"
directory: "/build/package/*"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
commit-message:
prefix: "docker"
125 changes: 125 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: CI

on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
branches: [ "main" ]

jobs:
# JOB 1: Test & Security
test:
runs-on: ubuntu-latest
container: debian:trixie
env:
PGPASSWORD: deframer
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: deframer
POSTGRES_PASSWORD: ${{ env.PGPASSWORD }}
POSTGRES_DB: deframer
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
valkey:
image: valkey/valkey:latest
options: >-
--health-cmd "valkey-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install System Dependencies
run: |
apt-get update && apt-get install -y git make curl bash binutils build-essential postgresql-client

- name: Checkout code
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25'

- name: Check Formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not formatted:"
gofmt -d .
exit 1
fi

- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
env:
GOFLAGS: "-buildvcs=false"

- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: ./...

- name: Run govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...

- name: Setup Database
run: |
psql -h postgres -U deframer -d deframer -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";'

- name: Run Tests
run: |
go test -v -count=1 -race -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
env:
CGO_ENABLED: 1
GOFLAGS: "-buildvcs=false"
DSN: "host=postgres user=deframer password=${{ env.PGPASSWORD }} dbname=deframer port=5432 sslmode=disable"
VALKEY_HOST: "valkey:6379"
VALKEY_PASSWORD: ""
VALKEY_DB: "0"

docker:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
app: [service, worker] # List your apps here
steps:
- uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Calculate Image ID
run: |
echo "IMAGE_ID=ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: build/package/${{ matrix.app }}/Dockerfile
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ env.IMAGE_ID }}/${{ matrix.app }}:latest
build-args: |
REPO_URL=${{ github.server_url }}/${{ github.repository }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.bin
/bin
/dist
.env*
!/.env.example
Expand All @@ -13,3 +14,5 @@ __debug_bin*
developer-sqlite.db
developer-source.json
.python-venv
*.swp
coverage.*
21 changes: 17 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"name": "Launch Command",
"type": "go",
"request": "launch",
"mode": "auto",
"preLaunchTask": "build",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/cmd/service",
"program": "${workspaceFolder}/cmd/${input:appName}",
"envFile": "${workspaceFolder}/.env"
}
],
"inputs": [
{
"id": "appName",
"type": "pickString",
"description": "Select the application to launch",
"options": [
"service",
"worker",
"migration",
"admin"
],
"default": "server"
}
]
}
}
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"go.testEnvFile": "${workspaceFolder}/.env",
"go.testFlags": ["-count=1"]
}
"go.testFlags": [
"-count=1"
],
"go.testEnvVars": {
"PROJECT_ROOT": "${workspaceFolder}"
}
}
12 changes: 0 additions & 12 deletions .vscode/tasks.json

This file was deleted.

126 changes: 72 additions & 54 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,74 +1,92 @@
APP_NAME := news-deframer
DOCKER_REPO := egandro
BUILD_DIR := bin
CMD_DIR := cmd
DOCKER_COMPOSE_FILE ?= docker-compose.yml

# we want to avoid to share the developer .env file with docker compose (the DSN hosts etc. are different)
COMPOSE_ENV_FILE ?= .env-compose
DOCKER_ENV_FLAG := $(if $(wildcard $(COMPOSE_ENV_FILE)),--env-file $(COMPOSE_ENV_FILE),--env-file /dev/null)

ifneq ("$(wildcard .env)","")
#$(info using .env file)
include .env
export $(shell sed 's/=.*//' .env)
endif

all:
@echo all
.PHONY: all build clean test help

.PHONY: deps
deps:
go install goa.design/goa/v3/cmd/goa@latest
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install go.uber.org/mock/mockgen@latest
.PHONY: all test-env-start test-env-stop test-env-down test-env-zap infra-env-start infra-env-stop infra-env-down infra-env-zap zap build clean test help docker-all docker-build

.PHONY: build
build:
$(MAKE) gen
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o infra/deploy/service ./cmd/service
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o infra/deploy/service-cli ./cmd/service-cli
cp ./gen/http/openapi3.json infra/deploy
all: build

test-env-start:
$(MAKE) -C test-env start

test-env-stop:
$(MAKE) -C test-env stop

test-env-down:
$(MAKE) -C test-env down

test-env-zap:
$(MAKE) -C test-env zap

infra-env-start:
$(MAKE) -C infra-env start

infra-env-stop:
$(MAKE) -C infra-env stop

infra-env-down:
$(MAKE) -C infra-env down

infra-env-zap:
$(MAKE) -C infra-env zap

.PHONY: run
run: build
infra/deploy/service
zap: down start

.PHONY: test-ci
test-ci: run-migration test
# DOCKER_COMPOSE_FILE=docker-compose-lb.yml make start/stop/down/logs

start:
docker compose $(DOCKER_ENV_FLAG) -f $(DOCKER_COMPOSE_FILE) up -d --build --force-recreate --no-deps

stop:
docker compose $(DOCKER_ENV_FLAG) -f $(DOCKER_COMPOSE_FILE) stop

down:
docker compose $(DOCKER_ENV_FLAG) -f $(DOCKER_COMPOSE_FILE) down --remove-orphans --volumes

logs:
docker compose $(DOCKER_ENV_FLAG) -f $(DOCKER_COMPOSE_FILE) logs -f

build:
mkdir -p $(BUILD_DIR)
go build -o $(BUILD_DIR)/ ./$(CMD_DIR)/...

clean:
rm -rf $(BUILD_DIR)
docker compose $(DOCKER_ENV_FLAG) -f $(DOCKER_COMPOSE_FILE) down --rmi local

.PHONY: test
test:
$(MAKE) gen
go clean -testcache
go test -v ./...
go test ./...

coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html

.PHONY: lint
lint:
$(MAKE) gen
golangci-lint run ./...
gosec -exclude-dir=gen -exclude-dir=.gomodcache ./...
gosec ./...
govulncheck ./...
gofmt -l .

.PHONY: tidy
tidy:
go mod tidy

.PHONY: gen
gen:
goa gen github.com/egandro/news-deframer/pkg/design
go mod tidy
go generate ./...

.PHONY: example
example: gen
goa example github.com/egandro/news-deframer/pkg/design

.PHONY: package
package:
docker pull $(CI_REGISTRY_IMAGE):latest || true
docker pull $(IMAGE)
cd infra/deploy && \
DOCKER_BUILDKIT=1 docker build --build-arg "IMAGE=$(IMAGE)" --cache-from $(CONTAINER_IMAGE):latest \
--tag $(CI_REGISTRY_IMAGE):$(TAG) \
--tag $(CI_REGISTRY_IMAGE):latest .
@echo created $(CI_REGISTRY_IMAGE):$(TAG)

.PHONY: push
push:
docker push $(CI_REGISTRY_IMAGE):$(TAG)
docker push $(CI_REGISTRY_IMAGE):latest

.PHONY: run-container
run-container: package
docker run -p 8080:8080 --rm -it --name $(CI_PROJECT_NAME) $(CI_REGISTRY_IMAGE):latest
docker-all: $(addprefix docker-,$(notdir $(wildcard build/package/*)))

docker-%:
@echo "Building Docker image for $*..."
docker build -t $(DOCKER_REPO)/$*:latest -f build/package/$*/Dockerfile .
Loading