Commit Graph

59 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
8f1a912ccb Initial plan 2026-03-05 08:11:20 +00:00
xCyanGrizzly
81b65912aa Merge pull request #11 from xCyanGrizzly/copilot/fix-nextjs-deployment-issues
Fix Docker deployment: file permissions, missing env vars, healthcheck timing
2026-03-04 23:24:05 +01:00
copilot-swe-agent[bot]
5eb2cf05b9 Fix Docker deployment: file permissions, missing env vars, healthcheck timing, error handling
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 22:20:49 +00:00
copilot-swe-agent[bot]
f73d06b3d9 Initial plan 2026-03-04 22:06:36 +00:00
xCyanGrizzly
cac3d518e1 Merge pull request #10 from xCyanGrizzly/copilot/debug-docker-compose-worker
Enable worker service by default in docker-compose
2026-03-04 22:49:52 +01:00
copilot-swe-agent[bot]
987167de0c Enable worker service by default in docker-compose
Remove profiles from worker service in both docker-compose.yml and
docker-compose.dev.yml so the worker starts automatically with
`docker compose up`. This fixes the issue where verification SMS and
the scheduler timer were not working because the worker was never
started. The bot remains as an optional profile.

Update README to reflect the change.

Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 21:13:00 +00:00
copilot-swe-agent[bot]
4f331d5411 Initial plan 2026-03-04 21:09:51 +00:00
xCyanGrizzly
8088a86feb Merge pull request #9 from xCyanGrizzly/copilot/fix-admin-access-issue
Make all users admins in self-hosted deployment
2026-03-04 21:58:04 +01:00
copilot-swe-agent[bot]
b53934ebf2 Make all users admins: update schema default, add migration, simplify registration and OAuth flows
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 20:23:54 +00:00
copilot-swe-agent[bot]
464c86b32a Initial plan 2026-03-04 20:16:22 +00:00
xCyanGrizzly
fc00fb6f2e Merge pull request #8 from xCyanGrizzly/copilot/fix-admin-account-login
Fix first user not getting ADMIN role when signing up via OAuth
2026-03-04 20:24:38 +01:00
copilot-swe-agent[bot]
0c0c9c7f23 Fix first user not getting ADMIN role when signing up via OAuth
The createUser event in auth.ts now promotes the first user to ADMIN
if no admin exists yet. The JWT callback also fetches the role from the
database on sign-in to pick up the freshly assigned ADMIN role.

Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 19:21:25 +00:00
copilot-swe-agent[bot]
82d5fc1812 Initial plan 2026-03-04 19:15:27 +00:00
xCyanGrizzly
9120f0fb5d Merge pull request #7 from xCyanGrizzly/copilot/fix-telegram-page-redirect
Fix telegram page redirect: auto-admin first user, hide admin-only nav
2026-03-04 20:06:12 +01:00
copilot-swe-agent[bot]
5d88f9beb3 Wrap first-user admin check in transaction to prevent race condition
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 18:55:41 +00:00
copilot-swe-agent[bot]
3704708970 Fix telegram page redirect: make first user admin and hide admin-only nav items from non-admins
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 18:55:02 +00:00
copilot-swe-agent[bot]
0c789eabd6 Initial plan 2026-03-04 18:24:56 +00:00
xCyanGrizzly
9a88914f11 Merge pull request #6 from xCyanGrizzly/copilot/fix-module-not-found-error
Fix: replace selective node_modules allowlist with full copy to prevent missing Prisma CLI deps
2026-03-04 17:51:05 +01:00
copilot-swe-agent[bot]
6cc8e1185a Fix: Copy full node_modules to production image to prevent missing module errors
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 15:31:01 +00:00
copilot-swe-agent[bot]
066fb5a046 Fix: Copy valibot to production Docker image for Prisma CLI
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 15:22:59 +00:00
copilot-swe-agent[bot]
bed99f8167 Initial plan 2026-03-04 15:20:17 +00:00
xCyanGrizzly
80a8833f2c Merge pull request #5 from xCyanGrizzly/copilot/fix-prisma-schema-error
Fix ENOENT for prisma_schema_build_bg.wasm in production Docker image
2026-03-04 16:17:55 +01:00
copilot-swe-agent[bot]
7303d5c6d3 Fix missing prisma_schema_build_bg.wasm by using symlink for .bin/prisma in Dockerfile
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 14:37:15 +00:00
copilot-swe-agent[bot]
c5ca9a7460 Initial plan 2026-03-04 14:31:43 +00:00
xCyanGrizzly
186aae38b5 Merge pull request #4 from xCyanGrizzly/copilot/fix-portainer-deployment-issues
fix: replace pull_policy: build with pull_policy: never to unbreak Portainer redeploy
2026-03-04 15:25:30 +01:00
copilot-swe-agent[bot]
df006636de fix: change pull_policy from build to never; remove dead fonts.ts
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 14:21:46 +00:00
copilot-swe-agent[bot]
373f1f2f08 Initial plan 2026-03-04 14:01:13 +00:00
xCyanGrizzly
81d322a91c Merge pull request #3 from xCyanGrizzly/copilot/fix-redeploy-error
fix: eliminate Google Fonts CDN dependency from Docker builds
2026-03-04 14:55:27 +01:00
copilot-swe-agent[bot]
48829e2efc fix: switch to local geist fonts and use direct prisma binary in entrypoint
- Replace next/font/google Geist imports with geist npm package to eliminate
  Google Fonts CDN network dependency during Docker image builds (was causing
  intermittent build failures → redeployment errors)
- Use ./node_modules/.bin/prisma directly in docker-entrypoint.sh instead of
  npx for both migrate deploy and db seed commands

Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 13:51:28 +00:00
copilot-swe-agent[bot]
b11948d3b3 Initial plan
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 13:48:30 +00:00
copilot-swe-agent[bot]
ba6bad58fa Initial plan 2026-03-04 13:34:56 +00:00
xCyanGrizzly
30fe7d6855 Merge pull request #2 from xCyanGrizzly/copilot/fix-redeployment-issues
fix: Portainer redeployment fails when Telegram env vars are absent
2026-03-04 14:30:44 +01:00
copilot-swe-agent[bot]
2e1142dba5 fix: resolve Portainer redeployment issues
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 13:26:13 +00:00
copilot-swe-agent[bot]
13fa559f51 Initial plan 2026-03-04 13:16:37 +00:00
xCyanGrizzly
5079e65783 Merge pull request #1 from xCyanGrizzly/copilot/fix-docker-compose-error
fix: copy prisma CLI binary into production Docker image
2026-03-04 14:11:32 +01:00
copilot-swe-agent[bot]
b9eb6b6a2b fix: copy node_modules/.bin/prisma in production Docker image
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-04 13:07:29 +00:00
copilot-swe-agent[bot]
26ef3e6649 Initial plan 2026-03-04 13:05:33 +00:00
faaefd6c31 fix: correct User table name in bot migration FK
The User model has no @@map so its table is "User" (PascalCase),
not "users". The FK reference was wrong.
2026-03-03 21:47:15 +01:00
f42c51db3b fix: remove url from schema datasource (Prisma 7.x)
Prisma 7.x no longer supports 'url' in the schema datasource block.
The URL is provided exclusively via prisma.config.ts.
2026-03-03 21:45:05 +01:00
ed5ff3db43 fix: exclude bot/ from Next.js build and lint
tsconfig.json included **/*.ts but only excluded worker/**, not bot/**.
This caused next build to type-check bot source files whose dependencies
aren't installed in the root node_modules, breaking CI.

- Add bot/** to tsconfig.json exclude array
- Add bot/** and worker/** to eslint globalIgnores
2026-03-03 21:42:34 +01:00
575ffdbc31 feat: Docker audit + Telegram bot service + send UI
Docker:
- Harden docker-compose.yml: parameterized DB creds, required AUTH_SECRET,
  health checks, resource limits, network isolation, removed exposed DB port
- Add profiles (telegram/bot/full) so base 'docker compose up' needs only AUTH_SECRET
- Fix docker-entrypoint.sh: AUTH_SECRET startup guard
- Fix Dockerfile: copy prisma.config.ts + dotenv into production image
- Update .env.example with all new variables
- Update .dockerignore

Telegram Bot Service (bot/):
- TDLib-based bot using bot token auth (not HTTP Bot API)
- Commands: /search, /latest, /package, /link, /unlink, /subscribe, /unsubscribe
- pg_notify listener for send requests (bot_send) and new packages (new_package)
- Subscription-based notifications when matching packages arrive
- Dockerfile with multi-stage build (bookworm-slim for glibc/TDLib)

API & Database:
- Prisma: TelegramLink, BotSendRequest, BotSubscription models + migration
- POST /api/telegram/bot/send - queue package delivery to linked TG account
- GET /api/telegram/bot/send/[id] - poll send request status
- Server actions: generateTelegramLinkCode, unlinkTelegram, getBotSendHistory
- Worker: emit pg_notify('new_package') after creating packages

Frontend:
- Settings: TelegramLinkCard for account linking via one-time code
- STL table + drawer: SendToTelegramButton with send dialog and status polling
- Telegram admin: Bot Sends tab with delivery history table
- Shared SendHistoryRow type

README: Updated with bot docs, profiles, config vars, project structure
2026-03-03 21:36:57 +01:00
xCyanGrizzly
4d0df6b1a4 addd TG integration 2026-03-02 11:57:17 +01:00
xCyanGrizzly
b427193d17 feat: add Telegram integration with forum topic support and creator tracking
Adds full Telegram ZIP ingestion pipeline: TDLib worker service scans source
channels for archive files, deduplicates by content hash, extracts metadata,
uploads to archive channel, and indexes in Postgres. Forum supergroups are
scanned per-topic with topic names used as creator. Filename-based creator
extraction (e.g. "Mammoth Factory - 2026-01.zip") serves as fallback.

Includes admin UI for managing accounts/channels, simplified account setup
(API credentials via env vars), auth code/password submission dialog,
package browser with creator column, and live ingestion activity tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:02:06 +01:00
xCyanGrizzly
beb9cfb312 Add log usage buttons on main page and seperate page 2026-02-19 11:46:19 +01:00
xCyanGrizzly
32683ecf5e added other materials tab 2026-02-18 21:55:39 +01:00
xCyanGrizzly
ec04e1bd0b add docker compose 2026-02-18 20:05:16 +01:00
xCyanGrizzly
5f12c8425b fix: use prisma-client-js generator — prisma-client requires custom output
The prisma-client generator mandates an output path, which conflicts
with using the standard @prisma/client import. Switch to prisma-client-js
which generates to node_modules by default.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-18 19:52:37 +01:00
xCyanGrizzly
46cb517b8d fix: use standard @prisma/client imports instead of custom output path
The custom generator output to src/generated/prisma caused persistent
Turbopack module resolution failures in CI. Switch to the standard
@prisma/client import path which all bundlers resolve correctly.

- Remove custom output from prisma schema generator
- Update all imports from ../generated/prisma to @prisma/client
- Add postinstall script to auto-run prisma generate after npm ci
- Remove generated files from git (no longer needed in source tree)
- Simplify CI workflow (remove verify step and --webpack workaround)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-18 19:49:53 +01:00
xCyanGrizzly
e70bdda511 fix: use webpack build in CI to bypass Turbopack resolution bug
Turbopack cannot resolve imports from src/generated/prisma even
with relative paths and committed files. Switch to --webpack for
CI build. Also add file verification step for debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:49:00 +01:00
xCyanGrizzly
8436a0e875 fix: use relative imports for generated Prisma client
Turbopack cannot resolve @/generated/prisma path alias during
next build, even with the files committed and baseUrl set.
Switch to relative imports (../generated/prisma) which Turbopack
resolves without issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:44:43 +01:00