Commit Graph
25 Commits
Author SHA1 Message Date
skruger 97fba1f0eb Merge pull request 'Add transcode/packaging worker, job slugs, deletes and zip downloads' (#6) from transcode_control into main
Build and publish / test (push) Successful in 49s
Build and publish / cleanup (push) Skipped
Build and publish / build (push) Successful in 5m57s
Build and publish / pypi (push) Successful in 1m5s
Reviewed-on: #6
v0.3.3
2026-12-03 17:29:16 -07:00
Shaun KrugerandClaude Opus 5.5 73b549cb18 Add transcode/packaging worker, job slugs, deletes and zip downloads
Build and publish / cleanup (pull_request) Successful in 17s
Build and publish / test (pull_request) Skipped
Build and publish / build (pull_request) Skipped
Build and publish / pypi (pull_request) Skipped
Worker:
- manage.py run_worker polls the database for pending transcode jobs (ffmpeg)
  and packaging jobs (Bento4 mp4fragment + mp4hls). Jobs are claimed with a
  conditional UPDATE, a heartbeat thread marks progress, stale jobs are failed,
  and SIGTERM returns an interrupted job to the queue.
- SQLite runs in WAL mode with IMMEDIATE transactions and a busy timeout so the
  web server and worker can share the database.
- transcode.py exposes a reusable transcode() and the HW->CPU fallback works.
- Docker image includes ffmpeg and a checksum-verified Bento4 SDK.

Jobs and storage:
- TranscodeJob and PackagingJob have slugs, set explicitly on creation; outputs
  go to transcodes/<slug>/ and packages/<slug>/hls/. Migrations regenerated.
- Uploads into transcodes/ and packages/ are refused; the uploader defaults to
  the videos/raw folder.

UI:
- New packaging job button on transcode jobs.
- Delete views for packaging jobs, transcode jobs, uploaded files and content
  entries, each removing files before records and refusing while referenced.
  TranscodeJob.asset is now SET_NULL so deleting a source keeps its jobs.
- Streamed zip downloads for completed transcode jobs and packages, rooted at
  the job slug; the content page lists packages with download buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 16:34:44 -07:00
skruger 1e7483d9c6 Merge pull request 'Add web UI for transcode profiles and transcode/packaging jobs' (#5) from transcode_control into main
Build and publish / cleanup (push) Skipped
Build and publish / test (push) Successful in 41s
Build and publish / build (push) Successful in 3m35s
Build and publish / pypi (push) Successful in 1m7s
Reviewed-on: #5
v0.3.2
2026-12-03 14:58:24 -07:00
Shaun KrugerandClaude Opus 5.5 de13523ffd Add web UI for transcode profiles and transcode/packaging jobs
Build and publish / test (pull_request) Skipped
Build and publish / build (pull_request) Skipped
Build and publish / pypi (pull_request) Skipped
Build and publish / cleanup (pull_request) Successful in 17s
- Profiles tab on the studio page with create/edit/delete forms. The YAML
  editor sits beside an example definition, and definitions are validated
  (structure, resolution, bitrate, fps, encoder) by a shared validator
  that the API now uses too. The create form can fill in the bundled
  default profile.
- "Transcode" button on content rows opens a job form (profile plus an
  editable YAML snapshot) with Save draft / Submit. Creating a job also
  creates its linked PackagingJob.
- Draft jobs can be edited; TranscodeJob.clean() rejects edits once a job
  leaves draft. Job detail page has Edit/Submit; packaging jobs have a
  detail page.
- Content asset page lists its transcode and packaging jobs above the form.
- Model: TranscodeJob.content_asset FK, default status draft,
  transcode_output field, TranscodedAsset.content_asset FK. API-created
  jobs start as pending.
- Move profiles/ into the package so default.yaml ships in the wheel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 14:52:41 -07:00
skruger b5fd00250b Merge pull request 'Add Docker image, Gitea CI, PyPI publishing and BSD-3-Clause license' (#4) from ci into main
Build and publish / build (push) Successful in 4m23s
Build and publish / pypi (push) Successful in 1m7s
Build and publish / test (push) Successful in 41s
Build and publish / cleanup (push) Skipped
Reviewed-on: #4
v0.3.1
2026-12-03 09:54:40 -07:00
Shaun Kruger 23218b15f5 Replace readme
Build and publish / cleanup (pull_request) Successful in 1m4s
Build and publish / test (pull_request) Skipped
Build and publish / build (pull_request) Skipped
Build and publish / pypi (pull_request) Skipped
2026-12-03 09:48:36 -07:00
Shaun KrugerandClaude Opus 5.5 5d7d03a0a6 Use setup-uv instead of setup-python in CI
Build and publish / test (pull_request) Successful in 36s
Build and publish / cleanup (pull_request) Skipped
Build and publish / build (pull_request) Successful in 3m32s
Build and publish / pypi (pull_request) Skipped
actions/setup-python only ships binaries for Ubuntu releases, so it fails
on the Debian-based Gitea act_runner image. setup-uv installs portable
Python builds that work on any glibc Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.3
2026-12-02 14:11:03 -07:00
Shaun KrugerandClaude Opus 5.5 38f3a0da2f Add Docker image, Gitea CI, PyPI publishing and BSD-3-Clause license
Build and publish / test (pull_request) Failing after 40s
Build and publish / cleanup (pull_request) Skipped
Build and publish / build (pull_request) Skipped
Build and publish / pypi (pull_request) Skipped
- Dockerfile builds the npm bundle and serves the app with gunicorn
- Gitea workflow runs tests, tags releases on main, pushes the image to
  the Gitea registry, and publishes to PyPI when PYPI_TOKEN is set
- MANIFEST.in includes the built static bundle in distributions
- License the project under BSD-3-Clause

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:42:20 -07:00
skruger ba76671795 Merge pull request 'Add content assets for cataloging uploaded files' (#3) from asset_catalog into main
Reviewed-on: #3
2026-12-01 21:11:53 -07:00
Shaun Kruger 7231f69014 Fix italics in html editor 2026-12-01 21:00:59 -07:00
Shaun Kruger e582cb9234 Add icon config 2026-12-01 20:58:47 -07:00
Shaun KrugerandClaude Opus 5.5 5bb9a70c11 Add sanitized rich-text descriptions for content assets
Introduce HtmlTextField, which cleans submitted HTML with nh3 against a
tag/attribute allowlist, and use it for ContentAsset.description via
Meta.field_classes. Edit descriptions with TinyMCE and render the
sanitized HTML on the asset page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:57:31 -07:00
Shaun KrugerandClaude Opus 5.5 3fe49b47ea Add content assets for cataloging uploaded files
ContentAsset records metadata (kind, title, description, release date,
season/episode/sequence) for an UploadedAsset, scoped to a studio.
ContentGroup groups episodes into a series or movies into a collection.

The studio page now has tabs for uploaded files and content, both loaded
with htmx. Files without content get a "Create content" button. Content
opens read-only with an Edit button; the form shows immediately when a
save fails validation.

Also adds the draft job status to the migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:22:27 -07:00
skruger d73dddc3d9 Merge pull request 'Convert web service from FastAPI to Django 6.1' (#2) from django into main
Reviewed-on: #2
2026-12-01 17:30:32 -07:00
Shaun KrugerandClaude Opus 5.5 3bbb57760e Add resumable multipart uploads for large files
Stream uploads and downloads in 1 MB blocks so memory use does not grow
with file size, under both WSGI and ASGI.

- S3 multipart upload API (create, upload part, list parts, complete,
  abort), so boto3 upload_file works for files over 8 MB.
- Browser uploader on the studio page: sends 16 MB parts three at a
  time with retries, and resumes when the same file is picked again.
  Uses session-authenticated, CSRF-protected JSON endpoints under
  /studio/<bucket>/uploads/.
- Request bodies are checked against the signed X-Amz-Content-Sha256
  instead of being read into memory; signed requests must include it.
  boto3's aws-chunked bodies with CRC32 trailers are decoded.
- Objects are written to a temporary file and renamed into place, so a
  failed upload leaves the existing file intact.
- Downloads stream with FileResponse, or an async iterator under ASGI.
- SigV4 verification uses the encoded path, fixing keys with spaces.
- cleanup_uploads command removes abandoned uploads and temp files.
- DATA_UPLOAD_MAX_MEMORY_SIZE is capped at 10 MB again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:29:46 -07:00
Shaun Kruger af18031a14 Add basic UI with bootstrap and allauth profile handling 2026-12-01 16:46:55 -07:00
Shaun KrugerandClaude Opus 5.5 b3b51f6cc5 Convert web service from FastAPI to Django 6.1
Replace the FastAPI/SQLAlchemy/Alembic web service with a Django project
laid out like cumorah-build: manage.py at the root, settings in the
privatestudio.settings package (base/dev/production), and a
privatestudio.studio app.

- Studio model owns a unique bucket_name; access is granted through
  membership in the studio's auth Group. Assets, profiles and jobs are
  scoped to a studio; API keys and S3 credentials stay per user.
- JSON API via Django Ninja under /api/ (profiles and transcode jobs now
  live under /api/studios/{bucket}/).
- S3-compatible interface as plain class-based views under /s3/,
  supporting bearer tokens and AWS v4 signatures.
- create_studio and create_key management commands replace ps-serve.
- Fresh Django initial migration; tests ported to Django TestCase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 21:54:16 -07:00
skruger 46adddd50a Merge pull request 'Configure migrations as part of the package' (#1) from db_migrations into main
Reviewed-on: #1
2026-11-29 15:30:17 -07:00
Shaun Kruger 9522762de5 Configure migrations as part of the package 2026-11-22 17:46:27 -07:00
Shaun Kruger 97e6f8f873 Make models compatible with sqlite strict mode 2026-11-22 17:04:30 -07:00
Shaun KrugerandCopilot 97d2d99dae Add comprehensive ps-serve command guide
Includes:
- Installation instructions for testing in a virtualenv
- Detailed reference for all ps-serve commands (init, create-user, create-key, serve)
- Complete workflow examples
- Troubleshooting guide
- Development tips and security best practices
- Quick reference cheat sheet

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Update readme

Add userinfo endpoint and asset backup script.

Fix s3 and add new DB fields

Add pyproject file

Cleanup
2026-11-22 15:28:31 -07:00
Shaun KrugerandCopilot 057d6bed5c Add FastAPI web service for video transcoding management
Implements a complete video transcoding web service with:
- FastAPI framework for REST API
- SQLAlchemy ORM with SQLite database
- API key authentication using SHA256 hashing
- Per-user resource isolation for all assets and jobs
- S3-compatible file upload/download/delete/list interface
- YAML-based API for transcode job requests
- Transcode profile management (stored and inline)
- Database models for Users, APIKeys, Assets, Jobs, and Profiles
- CLI entry point for database initialization and server startup
- Comprehensive integration tests with 100% pass rate
- Deployment documentation with examples

New files:
- privatestudio/web/: Web service package
- privatestudio/web/models.py: SQLAlchemy ORM models
- privatestudio/web/auth.py: API key authentication
- privatestudio/web/database.py: Database configuration
- privatestudio/web/app.py: FastAPI application
- privatestudio/web/s3_interface.py: File storage backend
- privatestudio/web/cli.py: CLI commands
- privatestudio/web/routes/: API endpoint handlers
- tests/test_web.py: Integration tests
- DEPLOYMENT.md: Deployment guide

Updated files:
- pyproject.toml: Added dependencies and CLI entry point

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-22 15:28:25 -07:00
Shaun Kruger 72b4fcc107 Add pyproject.toml and make transcode.py a command 2026-10-25 18:12:07 -06:00
Shaun Kruger f637e34ea1 CPU transcoding works, quicksync needs help v0.1 2026-09-21 22:46:10 -06:00
Shaun Kruger 77a5a64a56 Initial checkin 2026-09-19 23:20:14 -06:00