Commit Graph

59 Commits

Author SHA1 Message Date
df78f3bfc3 refactor: apply env variable pattern to all sexy scripts
Extended environment variable usage to export scripts and simplified
the env loading pattern across all scripts.

Changes:
- sexy/db/export: now uses $DB_USER and $SEXY_DB_NAME
- sexy/export/all: now uses $DB_USER and $SEXY_DB_NAME
- All scripts: changed from 'set -a && source .env && set +a' to
  'export $(cat .env | xargs)' for cleaner, more concise syntax

This ensures consistent variable usage across all import/export scripts
and makes them work correctly in all environments.
2025-10-28 23:32:14 +01:00
4411698e9b fix: source .env file before executing import scripts
Added 'set -a && source .env && set +a' at the beginning of import scripts
to load environment variables from .env file.

This ensures DB_USER and SEXY_DB_NAME are properly set before executing
docker commands, regardless of whether arty exports them or not.

- set -a: enables automatic export of variables
- source .env: loads variables from .env file
- set +a: disables automatic export
2025-10-28 23:27:33 +01:00
6e47a85055 fix: use $VAR instead of ${VAR} for arty variable expansion
Changed from ${DB_USER}/${SEXY_DB_NAME} to $DB_USER/$SEXY_DB_NAME
for proper variable expansion in arty scripts.

Arty exports environment variables before executing scripts, so simple
$VAR syntax works correctly, while ${VAR} was being treated as literal
text in the shell context.
2025-10-28 23:26:57 +01:00
d3d9c7d0e2 fix: use hardcoded DB credentials for VPS production
Changed from ${DB_USER} and ${SEXY_DB_NAME} variables to hardcoded
values 'valknar' and 'directus' for production VPS environment.

Arty environment variables are not exported to the shell where scripts
execute, so the variables were empty when docker exec commands ran.

Production VPS always uses:
- PostgreSQL container: core_postgres
- DB user: valknar
- Database name: directus

These values are stable for production and won't change.
2025-10-28 23:26:12 +01:00
129a759795 fix: remove if/else from sexy/import/all to avoid arty syntax error
Removed interactive confirmation prompt (read -p and if/else/fi) from
sexy/import/all script. The if/else control structure caused syntax errors
when executed via arty due to how arty appends "$@" to scripts.

The script now runs directly without confirmation. Users should be careful
when running this destructive operation as it will immediately:
1. Drop and recreate all database tables
2. Apply Directus schema snapshot
3. Restart the Directus API

Warning message is still displayed before execution.
2025-10-28 23:24:36 +01:00
dee16f7321 fix: use environment variables in sexy import scripts
Changed hardcoded database credentials to use environment variables:
- `-U sexy` → `-U ${DB_USER}`
- `-d sexy` → `-d ${SEXY_DB_NAME}`

Also added missing interactive confirmation prompt to sexy/import/all script.

This fixes the script error on VPS where:
- VPS uses: DB_USER=valknar, SEXY_DB_NAME=directus
- Local dev uses: DB_USER=sexy, SEXY_DB_NAME=sexy (or directus)

The scripts now work correctly in both environments by reading
the appropriate values from .env files via arty's environment system.
2025-10-28 23:19:00 +01:00
c7608ae0b5 fix: scripts newline format 2025-10-28 23:13:19 +01:00
9c8be201ad refactor: standardize service naming and migrate track to umami
Service Naming Standardization:
- Renamed all compose service names to use consistent `{project}_app` pattern
- awsm: `awesome` → `awesome_app`
- gotify: `gotify` → `gotify_app` (also updated container_name)
- proxy: `traefik` → `traefik_app`
- vpn: `wg-easy` → `vpn_app`
- sexy: `directus` → `sexy_api`, `frontend` → `sexy_frontend`

Track to Umami Migration:
- Removed track/ directory (legacy naming)
- Created umami/ directory with updated compose.yaml
- Service now named `umami_app` following naming convention
- Configuration unchanged: PostgreSQL backend, Redis caching, Traefik routing
- Uses TRACK_* environment variables for compatibility with arty.yml

Benefits:
- Consistent naming makes service identification easier across projects
- Aligns with container_name conventions ({PROJECT}_app pattern)
- Improves docker ps readability and service management
- Umami directory name matches actual product name
2025-10-28 22:16:38 +01:00
960056cdf9 feat: add database and schema import scripts to arty.yml
Added three import scripts for sexy.pivoine.art database restoration:

1. sexy/db/import
   - Imports PostgreSQL database from directus.sql
   - Includes warning about destructive operation
   - Restarts Directus API after import

2. sexy/schema/import
   - Applies Directus schema snapshot from schema.yaml
   - Uses 'directus schema apply --yes'
   - Restarts Directus API after import

3. sexy/import/all
   - Combined import with interactive confirmation
   - Prompts user to type 'yes' to proceed
   - Imports database then applies schema
   - Complete restoration workflow

All scripts include comprehensive comments and safety warnings.
Complements existing export scripts (sexy/db/export, sexy/schema/export, sexy/export/all).

Usage:
  pnpm arty sexy/db/import       # Import database only
  pnpm arty sexy/schema/import   # Import schema only
  pnpm arty sexy/import/all      # Full import (with confirmation)
2025-10-28 22:12:25 +01:00
36f48de7ad feat: update database and add Directus schema snapshot
Database Changes (directus.sql):
- Updated with complete gamification system (5 new tables)
- Added original_recording_id field to sexy_recordings for tracking duplicates
- Changed sexy_recordings.duration to NUMERIC(10,2) for decimal milliseconds
- Changed sexy_recordings.tags from text[] to json type
- All 17 achievements seeded (recordings, playback, social, special)
- Includes DROP IF EXISTS statements for safe re-imports
- Flags used: --clean --if-exists --no-owner --no-acl

New File - Directus Schema (schema.yaml):
- Complete Directus v11.12.0 schema snapshot
- All collections, fields, relations, and metadata
- Custom collections: sexy_recordings, sexy_videos, sexy_achievements, etc.
- Gamification tables: sexy_user_points, sexy_user_stats, sexy_user_achievements
- Can be applied with: npx directus schema apply schema.yaml

Export Command:
  docker exec sexy_postgres pg_dump -U sexy -d sexy \
    --no-owner --no-acl --clean --if-exists > directus.sql

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 21:51:14 +01:00
c682494289 fix: directus db revert 2025-10-28 21:35:41 +01:00
800c59ff94 feat: directus scheme 2025-10-28 21:24:34 +01:00
7949366477 feat: directus scheme 2025-10-28 21:10:26 +01:00
5c0b97e180 feat: update database dump with complete gamification system
- Added 5 new tables:
  - sexy_user_points: Point tracking history
  - sexy_achievements: Achievement definitions (17 seeded)
  - sexy_user_achievements: User achievement unlocks
  - sexy_user_stats: Aggregated user statistics and rankings
  - sexy_recording_plays: Playback tracking for gamification

- Updated sexy_recordings schema:
  - duration: INTEGER → NUMERIC(10,2) for decimal milliseconds
  - tags: text[] → json for consistent array handling

- Seeded 17 achievements across categories:
  - Recordings: First Recording, Recording Enthusiast, Prolific Creator, etc.
  - Playback: First Play, Active Player, Completionist
  - Social: First Comment, Conversationalist, Community Voice
  - Special: Early Adopter, Top 10 Rank, Balanced Creator

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 14:07:04 +01:00
b8467dda54 fix: change sexy_recordings duration to numeric type
Change duration column from integer to numeric(10,2) to support
decimal values in milliseconds. Fixes error when saving recordings
with fractional durations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 13:41:16 +01:00
3dcd76f35a feat: update database dump with gamification tables
Add gamification system tables to database dump:
- sexy_user_points: Point transaction log
- sexy_achievements: Achievement definitions (17 seeded)
- sexy_user_achievements: User achievement progress
- sexy_user_stats: Cached user statistics for leaderboard
- sexy_recording_plays: Recording playback tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 13:37:23 +01:00
e845ad2625 feat: add sexy_recordings table to database schema
Added missing sexy_recordings table which stores hardware device session recordings. This table is required for the /me dashboard page to load properly.

Table structure:
- id, title, description, slug (unique)
- duration (integer), events (JSONB), device_info (JSONB)
- tags (text array), linked_video (foreign key to sexy_videos)
- status (draft/published/archived), public flag
- user_created/updated, date_created/updated
- Indexes on user_created, status, slug, linked_video, tags (GIN)

This fixes the 5-minute timeout issue on /me page where the recordings endpoint was trying to access a non-existent table.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 12:31:53 +01:00
c4a84ff0fb feat: add missing junction tables for models and videos
Added sexy_model_photos and sexy_videos_models junction tables to support
many-to-many relationships between models/files and videos/models.

This resolves 500 errors on homepage and endpoints that were querying
these missing tables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 12:09:35 +01:00
12056fa657 feat: add video likes and plays tracking schema
Added missing database tables and columns for video engagement:
- sexy_video_likes: tracks user likes on videos
- sexy_video_plays: tracks video play analytics
- sexy_videos: added likes_count, plays_count, views_count columns

This enables the like/unlike feature and video analytics that were
already implemented in the frontend but missing the database schema.

Tables include proper indexes and foreign key constraints for performance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 11:39:42 +01:00
2a1ab80136 feat: artifact from github script 2025-10-26 21:20:57 +01:00
c481400873 feat: artifact from github script 2025-10-26 21:18:05 +01:00
c3e6327cb6 feat: artifact from github script 2025-10-26 21:08:56 +01:00
0ebc4d0e4e feat: artifact from github script 2025-10-26 20:56:25 +01:00
0c45ab185f feat: sdf 2025-10-26 20:32:16 +01:00
da29eaa80b feat: sdf 2025-10-26 20:27:06 +01:00
8039cdbd8b feat: sdf 2025-10-26 20:23:20 +01:00
8c37761ee9 feat: sdf 2025-10-26 20:18:47 +01:00
1d7dfa667d feat: sdf 2025-10-26 20:07:08 +01:00
dd90fb2b78 feat: sdf 2025-10-26 20:04:56 +01:00
2704987916 feat: sdf 2025-10-26 19:59:11 +01:00
904491d983 feat: sdf 2025-10-26 19:43:34 +01:00
46b67d00c7 feat: sdf 2025-10-26 19:41:56 +01:00
47178fe3d6 feat: awsm db download 2025-10-26 18:57:20 +01:00
9e20002f18 feat: awsm db download 2025-10-26 18:48:45 +01:00
529e33fd1a docs: readme 2025-10-26 18:40:00 +01:00
2aaeefb37f fix: awsm labels 2025-10-26 18:22:11 +01:00
c02ac86d31 fix: awsm labels 2025-10-26 18:09:22 +01:00
494eecf9ee fix: awsm labels 2025-10-26 18:03:13 +01:00
e2cc37c3c8 fix: awsm labels 2025-10-26 17:52:57 +01:00
7226417411 fix: awsm network name 2025-10-26 17:34:20 +01:00
e7977434d4 fix: awsm network name 2025-10-26 17:17:07 +01:00
2abc1b68ec fix: awsm network name 2025-10-26 17:13:11 +01:00
b7e1312dc8 feat: awsm 2025-10-26 17:07:37 +01:00
a1d3c33dca feat: awsm 2025-10-26 17:05:56 +01:00
d6b38fab8c fix: github workflow 2025-10-26 14:15:21 +01:00
db98d388a8 feat: arty cmd args passing 2025-10-26 12:33:05 +01:00
434b974758 feat: extend arty for new arty 2025-10-26 12:07:06 +01:00
903e585659 fix: umami 2025-10-26 11:52:01 +01:00
142fd5442f feat: uploads import/export 2025-10-26 11:40:07 +01:00
b4568e4756 feat: uploads import/export 2025-10-26 11:39:25 +01:00