diff --git a/README.md b/README.md index 3a45aa9..1d75e96 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,22 @@ # Millwright -Millwright is a self-hosted automation interface for [FFmpeg](https://ffmpeg.org/). It can be used to automate -media processing tasks, such as changing video codecs, containers, audio tracks, and subtitles. You can process -individual files or let Millwright handle new files automatically. +Millwright is a self-hosted [FFmpeg](https://ffmpeg.org/) automation tool. Convert individual files or +apply rules to a library to change codecs, containers, audio tracks, and subtitles. > [!WARNING] -> Millwright is in beta testing phase and may have bugs or incomplete features. -> -> I personally tested the app on my own library and it worked as expected at least for nvidia, qsv and software encoders. -> Unfortunately, I cannot guarantee that it will work perfectly for all setups or encoders without actual testing on -> those setups. **AMD** encoders may also work, but I haven't tested them as i dont have the necessary hardware. +> I've tested NVIDIA, Intel QSV, and software encoders on my own library AMD encoders are not tested. ### If you like my work, you might also like my other projects: -* [YTPTube](https://github.com/arabcoders/ytptube): Media download manager, automation interface, and media library preparation layer for yt-dlp. -* [WatchState](https://github.com/arabcoders/watchstate): Self-hosted service to sync your media servers without relying on 3rd-party external services. +* [WatchState](https://github.com/arabcoders/watchstate): Sync your media servers without relying on 3rd parties. +* [YTPTube](https://github.com/arabcoders/ytptube): Media downloader, automation, and library manager for yt-dlp. +* [DCompose](https://github.com/arabcoders/dcompose): Manage your servers/nodes compose stacks from one WebUI. ## Screenshots Dashboard: -![Dashboard](ui/public/images/screenshots/dashbaord.jpg) +![Dashboard](ui/public/images/screenshots/dashboard.jpg) Statistics: @@ -32,16 +28,11 @@ Job details: ## How it works -1. Add your media folders as a **Library**. -2. Choose a **Flow** that describes which files to process and what to change. -3. Preview the flow to see which files match. -4. A **Node** runs the conversion. Millwright checks the result before replacing the library file. - -You can add nodes on other machines to share the conversion work. +Add a **Library** and preview a **Flow** to see which files it would change. **Nodes** run conversions +on the server or on other machines. Millwright checks the output before replacing the original. > [!WARNING] -> Millwright can replace your media files. Keep originals in Trash while trying a new flow, and maintain -> a separate backup of media you can't replace. +> [Keep originals in Trash](docs/recovery.md#retain-originals) while trying a new flow. ## What you can do @@ -54,51 +45,22 @@ You can add nodes on other machines to share the conversion work. - Restore retained originals and track disk space saved. - Receive import notifications from Sonarr or Radarr and notify them after a conversion. -See [Using Millwright](docs/usage.md) for the workflow and [Flow recipes](docs/recipes.md) for examples. - ## Install -Run the installer in your chosen installation directory and enter your media folder when prompted: - -```bash -bash <(curl -fsSL https://raw.githubusercontent.com/arabcoders/millwright/dev/install.sh) -``` - -See the [installation guide](docs/installation.md) for requirements, storage, GPU access, and remote nodes. - -After starting Millwright, open `http://:8000`, create your account, claim the pending node on **Nodes**, and [add your first library](docs/usage.md#add-a-library). - -## Security - -> [!IMPORTANT] -> All accounts and API key holders have administrator access and can replace library files. -> Only give access to people you trust. - -Use HTTPS for network access and install plugins only from trusted sources. Read the -[security policy](SECURITY.md) before exposing an instance and use -[private vulnerability reporting](https://github.com/arabcoders/millwright/security/advisories/new) -to report security problems. - -## Documentation - -Please see - [Documentation index](docs/README.md). +Follow the [installation guide](docs/installation.md) to run the installer, claim a node, and add +your first library. See the [documentation index](docs/README.md) for setup guides and references. ## Project Policy -Millwright is a personal-first project. Contributions are welcome ONLY after approval from the maintainer following -prior discussion. Any unsolicited pull requests will be declined. Read [CONTRIBUTING](CONTRIBUTING.md) before starting -any work to avoid wasting your and the maintainer's time. - -AI-assisted tools have been used in this project and will continue to be used where I find them useful. This project is -built for my own needs and use cases, and I maintain it according to my own preferences. - -You're welcome to use it if it works for you, but I won't change the project's development approach. If the use of -AI-assisted tools is a deal-breaker for you, this project may not be the right fit for you. Feel free to build your own. +Millwright is built for my own needs and use cases first. Discuss contributions with me before starting any work that i +may decline to accept. Read [CONTRIBUTING.md](CONTRIBUTING.md). I use AI tools in this project. You're welcome to use the +project if it works for you. However, if you object to that, then this project is not good fit for you. Build your own +using technologies you approve of. ## Community For short questions, join the [Discord server](https://discord.gg/G3GpVR8xpb). Millwright is maintained as a solo project, so replies may take some time. -If you want to support the work financially, please donate to a children's charity such as -[Make-A-Wish](https://worldwish.org) international instead. +If you want to support the work financially, please donate to a children's charity such as +[Make-A-Wish international](https://worldwish.org) instead. diff --git a/docs/README.md b/docs/README.md index e3cc5ff..f93969f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,9 +1,9 @@ # Millwright documentation ## Getting started -- [project overview](../README.md): Basic introduction to Millwright. + - [Installation](installation.md): Run Millwright and give it access to your media. -- [Using Millwright](usage.md): Add a library, choose a flow, and try your first conversion. +- [Using Millwright](usage.md): Set up libraries, preview flows, and control automatic processing. - [Flow recipes](recipes.md): Examples you can adapt to your library. ## Setup and maintenance @@ -21,5 +21,3 @@ - [Development guide](development.md): Build containers, test OIDC, and change the database schema. For HTTP endpoints and the OpenAPI schema, [enable the API reference](installation.md#api-reference). -It's off by default. - diff --git a/docs/authentication.md b/docs/authentication.md index 2af0b3c..9c653ec 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -1,30 +1,18 @@ # Authentication -Create your account the first time you open Millwright. You can sign in with that username and password, -or add OIDC to use an existing identity provider. +Account registration closes after the first account is created. See the +[security policy](../SECURITY.md#who-should-have-access) for access limits. -Every account has full access to the instance. There are no read-only accounts or per-library permissions. +## Recover access -## Create the first account - -Open the web interface and choose a username and password. Finish this step before making Millwright -accessible to other people. Account registration closes after the first account is created. - -## Change your password - -Open **Account**, enter your current password, and enter the new password twice. Choose **Change password**. -You stay signed in on this browser. Your other browsers and devices must sign in again. - -## Reset a forgotten password - -You need terminal access to the server. From the directory containing `compose.yml`, run: +Changing your password in **Account** signs out other devices but keeps the current browser signed in. +If you've forgotten your password, run this from the directory containing `compose.yml`: ```bash docker compose exec server millwright auth reset-password --username owner ``` -Replace `owner` with your username. Enter the new password twice when prompted, then sign in again. -The reset signs that account out on all devices. +Replace `owner` with your username. A reset signs that account out on all devices. ## Configure OIDC @@ -66,11 +54,5 @@ Restart Millwright, then test both password and OIDC login. If you use a reverse Remove the person's access at the provider. To end existing Millwright logins too, reset the mapped account's password. This signs everyone using that account out. -Changing a local password doesn't stop someone who still has provider access from signing in through -OIDC again. Likewise, logging out of Millwright doesn't log you out of the provider. - -## Back up your account - -Configuration exports don't include accounts. Include PostgreSQL in your -[backup plan](recovery.md#database-and-filesystem-backups) if you want to preserve your login when -recovering the instance. +Someone with provider access can still sign in through OIDC after a password reset. Signing out of +Millwright doesn't sign you out of the provider. diff --git a/docs/development.md b/docs/development.md index 6370e01..78ebd60 100644 --- a/docs/development.md +++ b/docs/development.md @@ -2,12 +2,6 @@ For the standard setup and check commands, see [Contributing](../CONTRIBUTING.md). -## Frontend runtime - -Vue type checking requires Node.js because -[`vue-tsc` doesn't work under Bun](https://github.com/oven-sh/bun/issues/4754). -This also affects the type check during production builds. - ## Keep development data In `compose.dev.yml`, the `postgres` and `postgres-test` services use temporary storage. To keep @@ -32,21 +26,13 @@ Then start the server and a local node from the repository root: uv run python run.py --role all ``` -Open `http://localhost:8000` and claim the pending node on **Nodes**. Use `--role server` if you don't -need a local node. +The built interface is at `http://localhost:8000`. For a separate source node, set `MW_NODE_SERVER_URL` and `MW_NODE_WORKSPACE_DIR`, then run `uv run python -m node` from `node/`. Claim it on **Nodes**. See [Add a node](installation.md#add-a-node) for connection and shared-storage setup. -## Use the CLI - -Run CLI commands from `server/`: - -```bash -uv run millwright libraries list -uv run millwright auth reset-password --username owner -``` +Run `uv run millwright` from `server/` for [CLI access](usage.md#command-line-and-api-access). ## Build the container diff --git a/docs/installation.md b/docs/installation.md index 449c081..95365d1 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -8,17 +8,14 @@ tools are included in the image. Run this in the directory where you want to keep Millwright: ```bash -bash <(curl -fsSL https://raw.githubusercontent.com/arabcoders/millwright/HEAD/install.sh) +bash <(curl -fsSL https://raw.githubusercontent.com/arabcoders/millwright/dev/install.sh) ``` -Enter your media folder when prompted. The installer asks before starting compose file. Press Enter to skip startup. -Rerunning it keeps your existing configuration and credentials. +Enter your media folder and confirm startup. Rerunning the installer keeps existing configuration and +credentials. -Open `http://YOUR_SERVER_IP:8000` and create your account. Use your server's IP address, or -`http://localhost:8000` if your browser is on the same machine. - -Open **Nodes** and click **Claim** on the pending node. Then [add a library](usage.md#add-a-library), -using `/media` for the folder you selected during installation. +Open `http://:8000` and create your account before exposing the service. Claim the pending +node under **Nodes**, then [add a library](usage.md#add-a-library) using `/media`. ## Update Millwright @@ -33,12 +30,9 @@ Update any nodes on other machines too, using the same image version. See ## Configuration and storage -Change processing limits, scanning, playback, and history retention under **Configuration -> Settings**. -These changes don't need a restart. - -Other server settings are in `config/millwright/config.toml` inside your installation directory. -See the [configuration example](../server/src/server/config.example.toml) for available options. -After editing this file, restart the server: +**Configuration -> Settings** changes apply without restarting. For startup options, see the +[configuration example](../server/src/server/config.example.toml). After editing +`config/millwright/config.toml`, restart the server: ```bash docker compose restart server @@ -58,8 +52,6 @@ Accounts, settings, and job history are stored in the PostgreSQL volume `db-data directories. Include the database in your [backups](recovery.md#database-and-filesystem-backups). Don't use `docker compose down --volumes` for updates. It deletes the database volume. -For disk space problems, see [Workspace cleanup](recovery.md#workspace-cleanup). - To move retained originals, let active work and recovery finish, then stop the server and nodes. Copy the complete trash directory to the new location. Mount it writable in the server container and set `trash_dir` in `config/millwright/config.toml` to its container path before starting Millwright again. @@ -121,16 +113,12 @@ Start the node: docker compose up -d --pull always ``` -Open **Nodes** in the web interface and click **Claim**. Use **Edit** to set the node's processing limits. - -New node registration is enabled by default. The **Allow new nodes** switch on **Nodes** stops new -registration. +Claim the pending node under **Nodes**. If it doesn't appear, check that **Allow new nodes** is on. Keep each node's `node-config` and `node-data` directories separate. The node saves its credentials there and reconnects automatically after a restart. Only the workspace is shared. -You can keep or remove the node on the server machine. For connections across an untrusted network, -use [HTTPS](#reverse-proxies) for the server address. +Across an untrusted network, use an [HTTPS server address](#reverse-proxies). ## Hardware acceleration @@ -210,15 +198,13 @@ For OIDC login, follow the callback instructions in [Authentication](authenticat ### API reference -To enable API documentation, add this at the top level of `config/millwright/config.toml` and restart -the server: +The API reference is off by default. Enable it in `config/millwright/config.toml` and restart the server: ```toml enable_docs = true ``` Open `/api/docs` for Swagger, `/api/redoc` for ReDoc, or `/api/openapi.json` for the schema. -Set `enable_docs = false` and restart to turn them off. ### File access errors diff --git a/docs/plugins.md b/docs/plugins.md index 2a06fdb..6e66a9f 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -60,8 +60,6 @@ ones. Reinstalling an uploaded ID replaces that uploaded plugin. ## Choose a plugin kind -The kind determines which outputs appear in the flow editor: - | Kind | Use it for | Decisions and ports | | ----------- | ---------------------------------------------------------- | -------------------------------------- | | `filter` | Allow or reject input | `match`, `veto` | @@ -69,9 +67,7 @@ The kind determines which outputs appear in the flow editor: | `transcode` | Request a processing stage | `plan`, `skip` | | `action` | Request an action without selecting the flow branch itself | `actions`, followed by the `next` port | -For example, a duration inspector returns `match` when the next step should run. A transcode returns -`skip` if the file already meets its requirements. Include a readable `reason` with `skip` and `veto` -so someone opening the job can understand the decision. +Include a `reason` with `skip` and `veto` so the job log explains the decision. Return an error when the plugin can't make a valid decision: @@ -119,22 +115,9 @@ settings or records need a migration. Each saved plugin node records its own `co nodes without that field are version `1`. New steps use the installed plugin's current configuration version. Actions emitted by plugins also carry `plugin_id` and `config_version` metadata. -Declare migrations in `plugin.toml`, alongside the other manifest fields. For example, the external -notification plugin's configuration version `2` renames its step, action, event, progress field, and -delivery prefix: - -```toml -id = "action.notify_external" -version = "1.1.0" -config_version = 2 -migrations = [{ from_version = 1, to_version = 2, changes = [ - { type = "rename_plugin", from = "action.notify_media_manager", to = "action.notify_external" }, - { type = "rename_action", from = "notify_media_manager", to = "notify_external" }, - { type = "rename_event", from = "media_manager_notification", to = "external_notification" }, - { type = "rename_field", scope = "event", from = "refresh", to = "progress" }, - { type = "rename_target_prefix", from = "media-manager:", to = "external:" }, -] }] -``` +Declare `migrations` in `plugin.toml`. The +[external notification manifest](../plugins/action.notify_external/plugin.toml) shows a version +transition using each supported rename. The supported changes are: @@ -167,8 +150,7 @@ configuration versions rather than applying migrations itself. If you retry a finished job, its saved execution configuration is migrated when the retry is requested. -Unrelated configurations stay unchanged. After a successful commit, logs identify the plugin, record, -version transition, and changes applied. +Logs identify which records were migrated and what changed. ## Read media information diff --git a/docs/recipes.md b/docs/recipes.md index e8c223c..dcfc331 100644 --- a/docs/recipes.md +++ b/docs/recipes.md @@ -1,7 +1,7 @@ # Flow recipes -Use these examples as starting points for your own library. Build them under **Flows**, save the flow, -and [run a dry run](usage.md#preview-a-flow) before assigning it to automatic processing. +Run a [dry run](usage.md#preview-a-flow) before assigning a new flow to a library. Unless marked as a +full import, JSON snippets below show step inputs or conditions, not whole flows. In the editor, **Start** connects to the first step. Each step has outputs that lead to another step or a result. **Done** accepts the converted file, **Skip** leaves it alone, and **Veto** rejects the result. @@ -10,10 +10,8 @@ a result. **Done** accepts the converted file, **Skip** leaves it alone, and **V To convert video to HEVC in an MKV container: -1. Add **Video transcode** and set its target to HEVC. -2. Connect **Start** to that step. -3. Connect its `plan` output to a **Done** result and `skip` to **Skip**. -4. Save the flow and preview it against a few files. +Connect **Start** to **Video transcode** with the target set to HEVC. Connect `plan` to **Done** and +`skip` to **Skip**. Leave the encoder unset to use `libx265` for HEVC, `libx264` for AVC, or `libsvtav1` for AV1. Use quality mode to choose quality without a fixed bitrate. Try a sample to judge the quality and file size. @@ -90,18 +88,14 @@ choose a path. A Japanese-audio condition doesn't remove other audio tracks. ## Remux and convert selected audio -Use **Remux** when you want to change containers without re-encoding video. For example, choose MKV, -AAC audio at `192k`, and DTS as the audio codec to convert. Other audio tracks remain copied. - -These are the step inputs, not a complete flow import: +This **Remux** step changes the container to MKV and converts DTS tracks to AAC. Video and other +audio tracks are copied: ```json {"container": "mkv", "audio_codec": "aac", "audio_bitrate": "192k", "audio_when_codecs": ["dts"]} ``` -Connect `plan` to **Done** and `skip` to **Skip**, as in the video example. Leave the audio-codec filter -empty to convert all selected audio. Use the language and commentary options if you also want to narrow -the track selection. +Leave the audio-codec filter empty to convert all selected audio. The [`transcode` trash mode](recovery.md#retain-originals) keeps the original when audio is re-encoded. @@ -124,19 +118,9 @@ Use **Embed sidecar metadata** to copy metadata from Kodi NFO or yt-dlp JSON fil For `Example.mkv`, put `Example.nfo` or `Example.info.json` beside it. Add **Embed sidecar metadata** before the remux or video step, and connect its `next` output to that step. -The step offers these settings: - -| Setting | Default | Choice | -| ----------------------- | ---------------------- | --------------------------------------------------------------------- | -| `existing_tags` | `fill_missing` | Fill missing tags, or use `overwrite` to replace supplied fields | -| `source_priority` | `["nfo", "info_json"]` | Prefer NFO or JSON when both supply a tag | -| `when_no_media_changes` | `skip` | Use `remux` to update tags without re-encoding | - -NFO files must describe a Kodi movie or episode. JSON must describe one yt-dlp video, not a playlist or -channel. Missing sidecars are allowed. If tags aren't added, check the job log and confirm that the step -runs before conversion. - -MP4 tag support varies by player. Try a file in your player before applying this to a library. +NFO files must describe a Kodi movie or episode. JSON must describe one yt-dlp video, not a playlist +or channel. To update tags when no conversion is needed, choose `remux` for `when_no_media_changes`. +MP4 tag support varies by player. ## Job notifications @@ -144,27 +128,21 @@ Create a target under **Notifications** using an [Apprise URL](https://appriseit example, name a target `ops`, then add **Notify** to your flow before its first conversion step. Connect its `next` output to the conversion. -Choose the target and the outcomes you want to receive. For success, failure, and cancellation: +For success, failure, and cancellation: ```json {"targets": ["ops"], "on": ["job.succeeded", "job.failed", "job.cancelled"]} ``` -Turn off **Enabled** to stop notifications without removing the step. Notifications can occasionally -arrive more than once. +Notifications can arrive more than once. ## Notify external applications Use **Notify external application** to tell another application when Millwright replaces a file. Supported applications are Radarr, Sonarr, Plex, Jellyfin, and Emby. -1. Add the step to the flow's successful path. -2. Select the application and enter its URL and API key or token. -3. Add **Path mappings** if the application uses different paths for your files. -4. Save the flow. - -Use the application's base URL, such as `https://example.org/sonarr`, without an API endpoint. Add a -separate step for each application. +Add a step to the flow's successful path for each application. Use its base URL, such as +`https://example.org/sonarr`, without an API endpoint. Each mapping pairs a **Millwright path** with an **Application path**. For example: diff --git a/docs/recovery.md b/docs/recovery.md index f170e14..4836f43 100644 --- a/docs/recovery.md +++ b/docs/recovery.md @@ -1,20 +1,18 @@ # Recovery and backups -Use trash to undo a conversion, workspace cleanup to remove temporary files, and backups to recover an -instance or media you've lost. These serve different purposes. Keeping an original in trash isn't a -replacement for a backup on separate storage. +Trash can undo a conversion. It doesn't replace a backup on separate storage. ## Retain originals -Set **trash mode** in each library before processing: +Set **Trash mode** in each library before processing: -| Mode | What happens to replaced originals | -| ----------- | -------------------------------------------------------------- | -| `all` | Keep every original, including files changed only by remuxing | -| `transcode` | Keep originals when video or audio is re-encoded | -| `none` | Discard the original after the replacement passes verification | +| Mode | What happens to replaced originals | +| ----------- | --------------------------------------------------------------- | +| `all` | Keep every original, including files changed only by remuxing | +| `transcode` | Keep originals when video or audio is re-encoded | +| `none` | Discard the original after the replacement passes verification | -Start with `all` when trying a flow. Set **trash retention days** long enough to inspect the results. +Start with `all` when trying a flow. Set **Trash retention days** long enough to inspect the results. After that period, Millwright deletes expired originals automatically. Conversions need space for the input copy, output, and any original you're keeping. If storage is tight, @@ -22,9 +20,6 @@ review trash and unused workspaces rather than deleting working files by hand. ## Restore an original -Open **trash**, find the file, and choose **restore**. The dialog shows where the original will go. -If a file already exists there, you can choose to replace it and move that existing file to trash too. - Leave **Sync restored file to disk (fsync)** enabled unless you accept the risk of losing an unsynced copy after a crash or power failure. @@ -32,8 +27,7 @@ copy after a crash or power failure. > **Replace existing destination** without **Move destination file to trash** permanently discards the > file currently at that path. -A restored file isn't automatically converted again by the restore action. If restore reports a conflict, -inspect the existing file before choosing replacement options or retrying. +A restore doesn't queue another conversion. Trash remains available after deleting a library. **Empty trash** deletes every entry, including ones hidden by your current filters. Deleting selected entries is permanent too. @@ -43,9 +37,7 @@ To restore from a terminal, use `millwright trash restore ENTRY_ID`. See ## Workspace cleanup -**Workspaces** shows the temporary files left by processing jobs. Use **Prune selected** for selected -eligible rows, or **Prune unused** to remove unused workspaces across the instance. The latter isn't -limited to the current page or filters. +**Prune unused** on **Workspaces** applies across the instance, regardless of page or filters. Millwright skips files that are still in use. If a workspace remains protected after a failure, inspect the job and any surviving node process before trying to free it. Deleting the directory yourself can @@ -56,13 +48,9 @@ clean the workspace, so use the appropriate control for each. ## Configuration backups -Use **System operations -> Export configuration backup** to save settings you can reuse or restore later. -Choose a password of at least eight characters and keep it with your backup records. The downloaded -`.mwbackup` file is encrypted. - -It includes library definitions, flows, notification targets, incoming webhooks, node settings, plugins, -and server configuration. It also includes credentials from the exported configuration, so keep the -backup and its password private. +**System operations -> Export configuration backup** saves an encrypted `.mwbackup` file. It includes +library definitions, flows, notification targets, incoming webhooks, node settings, plugins, and server +configuration. Exports can contain credentials. Keep the file and its password private. It does **not** include your media, trash files, accounts, file index, or job history. Back up Compose files, environment settings, external secret files, and each node's configuration and state separately. @@ -70,12 +58,9 @@ Node state includes the issued credentials in `node-credentials.json`. ### Restore configuration -Choose **Import configuration backup**, select the file, and enter its password. Review the preview -and choose which parts to restore before applying it. - -Check library paths, flows, node settings, and webhook path replacements afterward. Restored libraries -are paused and uploaded plugins are disabled so you can review them before resuming. Changes to server -startup configuration need a restart. +Review the import preview before applying a configuration backup. Restored libraries are paused and +uploaded plugins are disabled. Check library paths and webhook path replacements before resuming. +Changes to server startup configuration need a restart. If a restore fails partway through, inspect the current settings before retrying. Some selected items may already have been restored. diff --git a/docs/usage.md b/docs/usage.md index a058665..fed5480 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -1,216 +1,97 @@ # Using Millwright -Millwright can process a file you select or look after a library automatically. A library tells it where -to find media. A flow tells it which files need work and what to change. Nodes do the processing. - -A typical setup converts new imports to your preferred codec, keeps the original for a few days, and -notifies your media manager when the new file is ready. You can also use a library just to browse and -check files without converting anything. - ## Add a library -Open **Libraries** and create a library. Add the folders as Millwright sees them. For example, a host -folder mounted at `/media` in Docker must be entered as `/media`, not its host path. - -For an initial look at your media, select **No flow** and leave **Health check** and **MKV statistics** -off. Choose **Scan now**. Millwright finds the files, reads their media information, and lists them under -**Files**. You can add more root folders to the same library later. - -Scanning alone doesn't convert files. Assigning a flow enables processing, so choose your -[original-retention policy](recovery.md#retain-originals) before doing that. - -## Show library artwork - -Open **Account -> Web UI settings** to choose a theme or enable **Library artwork background**. -Adjust **Background visibility** or choose **Another background** to change the image. If your libraries -have no artwork, the interface uses its default background. These preferences save in your browser. - -## Choose what to change - -Open **Flows** to create a flow or start with a preset. A flow can convert video, change containers, -select audio and subtitle tracks, or combine several steps. - -Conditions let you treat different files differently. For example, you could convert only large AVC -files, leave existing HEVC files alone, or require a particular audio language. You don't need to write -Python to build a flow. The editor provides the available steps and their settings. +Use paths as seen by the server. If Docker mounts a host directory at `/media`, enter `/media` as the +library root, not the host path. -The [recipes](recipes.md) cover common setups. The [plugin guide](plugins.md) is for writing new steps -that aren't already provided. +To index files without processing them, scan with **No flow** and leave automatic healthchecks and +MKV statistics off. Set [original retention](recovery.md#retain-originals) before assigning a flow. -### Preview a flow +## Preview a flow -Choose **Actions -> Dry run** on a library to see what its flow would do. A dry run doesn't change media. -Review the matched and skipped files before starting a conversion. +Use **Dry run** on a library to preview its assigned flow, or select files to preview any saved flow. +The preview doesn't change media. **Deferred** means the result depends on processing output or an +encoder choice the preview can't determine. -Some results are **Deferred** because they depend on a converted file or an encoder choice that isn't -available during the preview. They're not failed conversions. - -You can also select files on **Files** and choose **Dry run** to try a saved flow on that selection. -Use **Export CSV** to keep a report. Closing the preview doesn't cancel it. Use its cancel control if -you want to stop it, and export anything you need before restarting the server. - -### Try one file - -On **Files**, open a file and choose **Transcode**. Select a flow, use **Dry run** to preview it, -then choose **Transcode** to start. Follow progress on **Jobs**. - -Keep [originals in Trash](recovery.md#retain-originals) while testing a new flow. +Closing a batch preview doesn't cancel it. Export the CSV before restarting the server if you need the report. +Use the [flow recipes](recipes.md) for examples to try on a few files before processing an entire library. ## Find new files automatically -Each library offers several scanning options: - -| Option | When to use it | -| ------------------- | ----------------------------------------------- | -| **Scan now** | Check the whole library immediately | -| **Scan on start** | Check for changes whenever Millwright starts | -| **Watch** | Pick up local filesystem changes as they happen | -| **Recurring scans** | Check the whole library at a regular interval | +**Watch** picks up local filesystem changes but can miss writes made by other machines on a network +share. Use recurring scans for those shares, or [webhooks](webhooks.md) for Sonarr and Radarr imports +and renames. -Watch can't see every change made through network storage. Use recurring scans if other machines write -to a network share. You can use Watch and recurring scans together. - -Sonarr and Radarr can also [notify Millwright](webhooks.md) about new imports and renames. This lets it scan the -affected paths without waiting for the next full scan. - -Hidden files and folders aren't scanned. Change extension and ignored-folder filters under -**Configuration -> Settings**. Use **Actions -> Cancel scan** to stop a scan. +Scans ignore hidden files and folders. Check extension and folder filters under **Configuration -> Settings** +if a file doesn't appear. ### Cooldown and schedules -Set a **Cooldown** to give new or changing files time to finish copying before automatic processing. -Set it to zero if no delay is needed. **Skip cooldown** removes the wait for selected files. It doesn't -override a pause, a schedule, or the need for a free node. - -A weekly **Schedule** limits when library processing can run. This is useful for keeping conversions out of the hours -when you use the machine for other work. Schedules use the [server timezone](installation.md#timezone). - -Manual transcodes, healthchecks, and retries bypass cooldown, but can still wait for other processing limits. +Use **Cooldown** to give incoming files time to finish copying. Manual transcodes, manual healthchecks, +retries, and **Skip cooldown** bypass that wait, not pauses, schedules, or node limits. +Schedules use the [server timezone](installation.md#timezone). ### Limit automatic processing by date -Use the library's **Cutoff** if you want to process new files without converting the existing library. -For example, scan the library with no flow first, then set a cutoff using **Added to Millwright** before -assigning a flow. Files indexed before the cutoff won't be picked for new automatic processing. - -You can compare the date a file was added, when a changed source was first seen, or its file modification -date. File modification dates can be preserved by download and copy tools, so they don't always tell you -when a file was added to the library. With several dates selected, choose whether **All selected dates** -or **Any selected date** must meet the cutoff. - -Manual requests and jobs already requested aren't stopped by the cutoff. Clear it to remove the date filter. +To process only new additions, finish the initial scan with no flow. Set a cutoff after that scan and +select **Added to Millwright** before assigning the flow. Copy and download tools can preserve old +modification dates. Cutoffs don't apply to manual requests or jobs already requested. ## Pause and resume -Use **Pause activity** in the header to stop new scans and processing across the instance. Running jobs -finish. Queued jobs wait until you choose **Resume activity**. The pause remains in effect after a restart. - -**Pause library** affects only that library. If both the instance and library are paused, resume both. -Node pause and capacity controls are on **Nodes**. - -To stop work that's already running, cancel the job or scan rather than pausing activity. - -## Browse and check files - -Open **Files**, or click a library name to browse just that library. Search by filename, path, or media -information and combine the library, processing, and health filters. Use `file_id:123` to find one file. - -File details show video, audio, and subtitle information. When previous job snapshots are available, -you can compare them with the current file. These snapshots are media information, not backup copies. - -Use **Refresh metadata** if the displayed information needs rereading. **Health check** decodes the file -to look for media errors. You can run a healthcheck manually or enable automatic checks in a library. - -### Healthchecks and MKV statistics +**Pause activity** prevents new scans and processing across the instance and survives a restart. +Running jobs finish. Cancel a job or scan to stop it. If both the instance and a library are paused, +resume both before expecting work from that library. -Healthchecks take CPU and disk time because they read and decode the media. A failed tool run isn't the -same as a confirmed media error. Open the job log to see why the check failed. Hardware decoding is -available, with a CPU retry when hardware decoding fails or reports errors. +## Healthchecks and MKV statistics -A successful manual healthcheck can also start pending conversions. - -MKV statistics add missing stream statistics tags to MKV files. Enable this when you need those tags, -not as a requirement for ordinary scanning. - -Under **Configuration -> Settings**, choose whether healthchecks and MKV statistics run on the server, -nodes, or both. Set each node's job limits under **Nodes -> Edit**. +Healthchecks read and decode the file. A failed tool run isn't a confirmed media error. Check the job +log for the cause. If hardware decoding fails or reports errors, the check retries on the CPU. A +successful manual check can also release a conversion waiting for that file. > [!IMPORTANT] -> Server-side MKV statistics modify the library file in place. Stopping the job doesn't undo tags already -> written. Node-side statistics work on a copy before replacing the original. +> Server-side MKV statistics modify the library file in place. Cancelling the job doesn't undo tags +> already written. Node-side statistics work on a copy before replacing the original. ## Follow jobs -**Jobs** shows conversions, healthchecks, metadata reads, and MKV statistics. Open a job for progress, -logs, the steps it followed, and recorded input and output details. Search by path, `job_id:123`, or -`file_id:123`. - -Pending or staging work can be waiting for preparation. Queued work needs a free compatible worker. -If it doesn't start, check pauses, schedules, cooldown, and node availability. +Search **Jobs** by `job_id:123` or `file_id:123`. The file ID also works on **Files**. +Job snapshots contain metadata, not copies of your media. -- **Cancel** stops the job without scheduling another attempt. -- **Requeue** tries the job again and keeps previous attempts for comparison. Jobs started with a - selected flow reuse its original settings. -- **Delete** removes job history, not library media. Use [workspace cleanup](recovery.md#workspace-cleanup) - separately to remove unused temporary files. - -Bulk actions apply to the selected rows on the current page. A failed row remains selected so you can -inspect it. Bulk transcodes use each file's library flow. Export a job before deleting it if you want to -keep its logs and media snapshots. +Requeuing keeps previous attempts. Jobs started with a selected flow reuse its original settings. +Bulk transcodes use each file's library flow. Deleting a job removes history, not media or +[unused workspaces](recovery.md#workspace-cleanup). ### Delete a library -Choose **Actions -> Delete library** to stop tracking its folders. Millwright cancels that library's active -work and removes its file list. It keeps your media files, completed job history, and retained originals -in Trash. Large deletions can take time. A failed deletion stays visible so you can retry it. +Deleting a library cancels its active work and removes its file list. It keeps the media, completed job +history, and retained originals in Trash. ## Playback -Choose **Play** on a file to watch it in the browser. You can switch audio and subtitle tracks and resume -from the position saved in that browser. If the browser can't play the original directly, Millwright -converts it for playback without changing the library file. - -For playback failures, use the bug-icon control or **Copy playback diagnostics** on the error screen. -Capture the diagnostics while the problem is happening. - -## Settings and statistics - -Use **Configuration -> Settings** for processing limits, scanning, playback, and history retention. Paths, -authentication, and timezone are [server configuration](installation.md#configuration-and-storage). - -**Statistics** shows job outcomes, space savings, and media inventory. Transcodes and remuxes are counted -separately. Larger output files produce negative savings. Totals count jobs, so converting the same file -twice can contribute twice. Inventory language charts count tracks, not files. - -Charts refresh every five minutes. **Refresh** loads the latest available chart data. File-added charts -describe files still in the library, and deleting history can change earlier size totals. +If the browser can't play the original directly, Millwright can convert it for playback without changing +the library file. For playback failures, copy playback diagnostics while the problem is happening. -## Notifications and integrations +## Statistics -- Create an Apprise target under **Notifications** and add a [notification step](recipes.md#job-notifications) - to the flows you want to hear about. -- Use [incoming webhooks](webhooks.md) to receive imports and renames from other applications. -- [Notify applications after conversion](recipes.md#notify-external-applications). +Savings count jobs, so converting one file twice can contribute twice. Deleting job history can change +past totals. File-added charts count files still in the library. Language charts count tracks, not files. ## Command-line and API access -You can manage libraries and jobs from a terminal too. With Compose, run commands from the directory -containing `compose.yml`: +Run the CLI from the directory containing `compose.yml`: ```bash docker compose exec server millwright libraries list -docker compose exec server millwright jobs show 7 -docker compose exec server millwright jobs requeue 7 ``` -Use `millwright --help` or a resource's `--help` for more commands, and `--json` when using the output -in a script. +Use `millwright --help` to list commands and `millwright --json` for scripts. ### Connect from another machine -Set `MW_API_URL` to your server address and `MW_API_TOKEN` to the instance API key from `config.toml`. -The default key file is `secrets/api_key` beside that configuration file. This key grants administrator -access, so keep it private and use HTTPS. +Set `MW_API_URL` to your server address and `MW_API_TOKEN` to the instance API key. The installer +stores it in `config/millwright/secrets/api_key`. The key grants administrator access. Use HTTPS. ```bash export MW_API_URL=https://millwright.example.org diff --git a/server/src/server/core/db.py b/server/src/server/core/db.py index 12db8e8..6f3aacf 100644 --- a/server/src/server/core/db.py +++ b/server/src/server/core/db.py @@ -9,8 +9,9 @@ from alembic.config import Config from alembic.script import ScriptDirectory from psycopg import AsyncConnection +from psycopg import OperationalError as PsycopgOperationalError from sqlalchemy import create_engine, event, make_url, text -from sqlalchemy.exc import SQLAlchemyError +from sqlalchemy.exc import OperationalError, SQLAlchemyError from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, async_sessionmaker, create_async_engine LOG = logging.getLogger("server.db") @@ -35,6 +36,22 @@ def normalize_database_url(database_url: str | URL) -> URL: return url +def postgres_disconnect_reason(exc: Exception) -> str | None: + if not isinstance(exc, OperationalError) or not isinstance(exc.orig, PsycopgOperationalError): + return None + + original = exc.orig + reason = original.diag.message_primary or str(original).partition("\n")[0] + if exc.connection_invalidated: + return reason + # libpq reports these connection setup failures as text without a SQLSTATE. + if original.sqlstate is None and reason.casefold().endswith( + ("connection refused", "server closed the connection unexpectedly", "the database system is shutting down") + ): + return reason + return None + + async def _complete[T](operation: Coroutine[Any, Any, T]) -> T: task = asyncio.create_task(operation) cancelled = False diff --git a/server/src/server/nodehub/hub.py b/server/src/server/nodehub/hub.py index 557d79b..2fdf51a 100644 --- a/server/src/server/nodehub/hub.py +++ b/server/src/server/nodehub/hub.py @@ -55,6 +55,7 @@ from pydantic import TypeAdapter, ValidationError from sqlalchemy import delete, func, or_, select, tuple_, update +from server.core.db import postgres_disconnect_reason from server.events import EventBus, publish_job_status from server.finalization import ( FinalizationError, @@ -4245,8 +4246,12 @@ async def _dispatch_loop(self) -> None: self._wake.clear() try: await self.dispatch_once() - except Exception: - LOG.exception("dispatch pass failed") + except Exception as exc: + reason = postgres_disconnect_reason(exc) + if reason is None: + LOG.exception("Job dispatch pass failed.") + else: + LOG.warning("Job dispatch will retry. PostgreSQL: %s", reason) except asyncio.CancelledError: pass @@ -4256,8 +4261,12 @@ async def _sweep_loop(self) -> None: await asyncio.sleep(self.sweep_interval_s) try: await self.sweep_once() - except Exception: - LOG.exception("sweep pass failed") + except Exception as exc: + reason = postgres_disconnect_reason(exc) + if reason is None: + LOG.exception("Job sweep pass failed.") + else: + LOG.warning("Job sweep will retry. PostgreSQL: %s", reason) except asyncio.CancelledError: pass diff --git a/server/src/server/notifications.py b/server/src/server/notifications.py index fa9688a..e02c3e5 100644 --- a/server/src/server/notifications.py +++ b/server/src/server/notifications.py @@ -16,6 +16,7 @@ from common.process import drain from sqlalchemy import select, update +from server.core.db import postgres_disconnect_reason from server.external_notifications import notify_external from server.models import ( FinalizationJournal, @@ -311,7 +312,11 @@ async def _run(self) -> None: except asyncio.CancelledError: raise except Exception as exc: - LOG.warning("Notification delivery pass failed", extra={"error": error_message(exc)}) + reason = postgres_disconnect_reason(exc) + if reason is None: + LOG.warning("Notification delivery pass failed.", extra={"error": error_message(exc)}) + else: + LOG.warning("Notification delivery will retry. PostgreSQL: %s", reason) await asyncio.sleep(self._interval) async def deliver_pending(self) -> int: diff --git a/server/src/server/plugins/migrations.py b/server/src/server/plugins/migrations.py index a2f752d..4af0b00 100644 --- a/server/src/server/plugins/migrations.py +++ b/server/src/server/plugins/migrations.py @@ -268,9 +268,8 @@ def migrate_action( ): result["plugin_id"] = change.target changes.append(f"rename_plugin: {change.source} -> {change.target}") - elif isinstance(change, RenameField) and change.scope == "action": - if _rename_field(result, change, record): - changes.append(f"rename_field (action): {change.source} -> {change.target}") + elif isinstance(change, RenameField) and change.scope == "action" and _rename_field(result, change, record): + changes.append(f"rename_field (action): {change.source} -> {change.target}") result["config_version"] = migration.to_version if migration is steps[-1] and result.get("plugin_id") is None: result["plugin_id"] = manifest.id diff --git a/tests/test_db.py b/tests/test_db.py index a8ff911..4966874 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -2,17 +2,20 @@ import asyncio import logging +import socket import pytest from alembic import command from psycopg import AsyncConnection from sqlalchemy import event, insert, inspect, select, text, update -from sqlalchemy.exc import IntegrityError +from sqlalchemy.engine import URL +from sqlalchemy.exc import IntegrityError, OperationalError from server.core.db import ( check_db_revision, create_engine_and_session, migration_config, + postgres_disconnect_reason, prepare_db, ) from server.models import Job, Library, MediaFile, ProbeRow, SessionRow, User, utcnow @@ -120,6 +123,43 @@ async def test_stale_connection_replaced() -> None: await asyncio.wait_for(engine.dispose(), 5) +@pytest.mark.asyncio +async def test_interrupted_connection_recovers() -> None: + with database_url_context("interrupted-connection", migrated=False) as url: + engine, _ = create_engine_and_session(url) + try: + async with engine.connect() as connection, engine.connect() as admin: + pid = await connection.scalar(text("SELECT pg_backend_pid()")) + assert await admin.scalar(text("SELECT pg_terminate_backend(:pid, 1000)"), {"pid": pid}) + with pytest.raises(OperationalError) as interrupted: + await connection.scalar(text("SELECT 1")) + assert "terminating connection" in (postgres_disconnect_reason(interrupted.value) or "") + + async with engine.connect() as connection: + assert await connection.scalar(text("SELECT 1")) == 1 + with pytest.raises(OperationalError) as cancelled: + await connection.execute(text("DO $$ BEGIN RAISE SQLSTATE '57014'; END $$")) + assert postgres_disconnect_reason(cancelled.value) is None + finally: + await asyncio.wait_for(engine.dispose(), 5) + + +@pytest.mark.asyncio +async def test_refused_connection_reason() -> None: + # Reserve a port without listening so the connection fails at the TCP boundary. + with socket.socket() as endpoint: + endpoint.bind(("127.0.0.1", 0)) + host, port = endpoint.getsockname() + engine, _ = create_engine_and_session(URL.create("postgresql+psycopg", host=host, port=port)) + try: + with pytest.raises(OperationalError) as refused: + async with engine.connect(): + pytest.fail("Connected to a port with no listener.") + assert "Connection refused" in (postgres_disconnect_reason(refused.value) or "") + finally: + await asyncio.wait_for(engine.dispose(), 5) + + @pytest.mark.asyncio async def test_cancel_connect_closes(monkeypatch: pytest.MonkeyPatch) -> None: opened, release, closing, finish_close = (asyncio.Event() for _ in range(4)) diff --git a/ui/app/app.config.ts b/ui/app/app.config.ts index 8c091dc..a2d6d68 100644 --- a/ui/app/app.config.ts +++ b/ui/app/app.config.ts @@ -1,3 +1,6 @@ +const floatingSurface = + 'mw-floating-surface rounded-lg bg-(--mw-floating-bg) shadow-(--mw-floating-shadow) ring-0'; + export default defineAppConfig({ ui: { primary: 'indigo', @@ -9,7 +12,45 @@ export default defineAppConfig({ }, formField: { slots: { - label: 'block font-bold text-default', + label: 'block font-semibold text-default', + container: 'space-y-2', + description: 'text-sm text-toned', + hint: 'text-sm text-toned', + help: 'text-sm text-toned', + error: 'text-sm text-error', + }, + }, + empty: { + variants: { + variant: { + outline: { + root: 'border border-dashed border-default bg-muted/10 ring-0', + }, + }, + }, + }, + input: { + variants: { + variant: { + outline: 'bg-elevated/40 hover:bg-elevated/55 disabled:bg-elevated/20', + }, + }, + }, + textarea: { + variants: { + variant: { + outline: 'bg-elevated/40 hover:bg-elevated/55 disabled:bg-elevated/20', + }, + }, + }, + table: { + slots: { + root: 'mw-table-surface', + thead: 'bg-elevated/20', + tbody: '[&>tr]:hover:bg-elevated/30', + th: 'px-3 py-2 text-sm text-start font-medium text-toned', + td: 'px-3 py-2 text-sm text-default align-top whitespace-normal wrap-anywhere', + tfoot: 'bg-elevated/40 [&_th]:font-semibold [&_th]:text-highlighted', }, }, tooltip: { @@ -17,19 +58,72 @@ export default defineAppConfig({ content: 'pointer-events-auto', }, }, + toast: { + slots: { + root: 'shell-surface bg-transparent', + }, + }, + modal: { + slots: { + content: 'shell-surface bg-transparent', + }, + }, + slideover: { + slots: { + content: 'shell-surface bg-transparent', + }, + }, + card: { + slots: { + root: 'min-w-0 max-w-full rounded-lg overflow-hidden', + }, + variants: { + variant: { + outline: { + root: 'border border-(--mw-surface-border-soft) bg-elevated/20 divide-y divide-default ring-0', + }, + soft: { + root: 'bg-elevated/20 divide-y divide-default', + }, + subtle: { + root: 'border border-(--mw-surface-border-soft) bg-elevated/20 divide-y divide-default ring-0', + }, + }, + }, + }, dropdownMenu: { slots: { - content: 'mw-floating-surface', + content: floatingSurface, }, }, popover: { slots: { - content: 'mw-floating-surface', + content: floatingSurface, + }, + }, + inputMenu: { + slots: { + content: floatingSurface, + }, + variants: { + variant: { + outline: 'bg-elevated/40 hover:bg-elevated/55 disabled:bg-elevated/20', + }, + }, + }, + select: { + slots: { + content: floatingSurface, + }, + variants: { + variant: { + outline: 'bg-elevated/40 hover:bg-elevated/55 disabled:bg-elevated/20', + }, }, }, selectMenu: { slots: { - content: 'mw-floating-surface min-w-40', + content: `${floatingSurface} min-w-40`, }, variants: { variant: { diff --git a/ui/app/assets/css/tailwind.css b/ui/app/assets/css/tailwind.css index 0cb711e..614152e 100644 --- a/ui/app/assets/css/tailwind.css +++ b/ui/app/assets/css/tailwind.css @@ -3,6 +3,10 @@ @import 'tailwindcss'; @import '@nuxt/ui'; +.mask-it { + --mask-it: 0; +} + @layer base { html, body, @@ -14,22 +18,6 @@ min-height: 100vh; min-height: 100dvh; } - - html.bg-fanart { - background-position: center; - background-repeat: no-repeat; - background-size: cover; - background-attachment: fixed; - } - - html.bg-fanart body { - opacity: var(--mw-shell-opacity); - } - - /* Keep dialog portals opaque through their closing transition. */ - html.bg-fanart body:has([data-slot='overlay']) { - opacity: 1; - } } @layer components { @@ -62,7 +50,12 @@ radial-gradient(circle at top left, rgb(99 102 241 / 0.12), transparent 26%), radial-gradient(circle at top right, rgb(245 158 11 / 0.07), transparent 20%), linear-gradient(180deg, rgb(9 12 18 / 0.84), rgb(17 24 39 / 0.9)); - backdrop-filter: blur(16px); + } + + .shell-header-artwork { + background-position: center 35%; + background-size: cover; + mask-image: linear-gradient(to bottom, black, transparent); } .mw-page-header { @@ -70,7 +63,7 @@ } .mw-page-heading { - @apply flex min-w-0 items-center gap-3; + @apply flex min-w-0 items-start gap-4; } .mw-page-kicker { @@ -103,20 +96,34 @@ } .mw-card { - @apply min-w-0 max-w-full rounded-lg border bg-elevated/20 backdrop-blur-xl; + @apply min-w-0 max-w-full rounded-lg border bg-elevated/20; border-color: var(--mw-surface-border-soft); } .mw-card-padded { - @apply min-w-0 max-w-full rounded-lg border bg-elevated/20 p-4 backdrop-blur-xl; + @apply min-w-0 max-w-full rounded-lg border bg-elevated/20 p-4; border-color: var(--mw-surface-border-soft); } .mw-card-padded-lg { - @apply min-w-0 max-w-full rounded-lg border bg-elevated/20 p-4 backdrop-blur-xl sm:p-5; + @apply min-w-0 max-w-full rounded-lg border bg-elevated/20 p-4 sm:p-5; + border-color: var(--mw-surface-border-soft); + } + + .mw-form-group { + @apply rounded-lg border bg-muted/20; border-color: var(--mw-surface-border-soft); } + .mw-form-alert { + @apply sticky top-0 z-10 shadow-sm; + } + + .mw-inset { + @apply rounded-sm border bg-elevated/40; + border-color: var(--mw-surface-border-solid); + } + .mw-panel { @apply min-w-0 max-w-full rounded-lg border; border-color: var(--mw-surface-border-soft); @@ -138,35 +145,13 @@ } .mw-table-surface { - @apply min-w-0 max-w-full rounded-sm border bg-elevated/20; + @apply min-w-0 max-w-full rounded-lg border bg-elevated/20; border-color: var(--mw-surface-border-solid); } .mw-floating-surface { - @apply border bg-default/95 shadow-xl backdrop-blur-md; + @apply rounded-lg border bg-(--mw-floating-bg) shadow-(--mw-floating-shadow) backdrop-blur-md; border-color: var(--mw-surface-border-solid); - box-shadow: 0 1rem 2rem rgb(15 23 42 / 0.1); - } - - .mw-floating-surface [data-slot='item'][data-highlighted]::before, - .mw-floating-surface [data-slot='item'][data-state='open']::before, - .mw-floating-surface [data-slot='item']:hover::before { - background-color: color-mix(in oklab, var(--ui-primary) 11%, transparent) !important; - } - - .mw-floating-surface [data-slot='item'][data-disabled]::before { - background-color: transparent !important; - } - - .dark .mw-floating-surface { - background: color-mix(in oklab, var(--ui-bg) 92%, var(--ui-bg-elevated) 8%); - box-shadow: 0 1rem 2rem rgb(0 0 0 / 0.3); - } - - .dark .mw-floating-surface [data-slot='item'][data-highlighted]::before, - .dark .mw-floating-surface [data-slot='item'][data-state='open']::before, - .dark .mw-floating-surface [data-slot='item']:hover::before { - background-color: color-mix(in oklab, var(--ui-primary) 16%, transparent) !important; } .mw-border-top-soft { @@ -189,7 +174,7 @@ width: 100%; box-sizing: border-box; padding: 1rem; - background-color: var(--ui-bg-elevated); + background-color: color-mix(in srgb, var(--ui-bg-elevated) 40%, transparent); color: var(--ui-text); line-height: 1.7; border-radius: 0.5rem; @@ -327,12 +312,16 @@ --mw-border-strong: var(--ui-border-accented); --mw-surface-border-soft: var(--ui-border-accented); --mw-surface-border-solid: var(--ui-border-accented); + --mw-floating-bg: color-mix(in oklab, var(--ui-bg-elevated) 80%, transparent); + --mw-floating-shadow: 0 1rem 2rem rgb(15 23 42 / 0.1); } .dark { --mw-border-strong: var(--ui-border); --mw-surface-border-soft: color-mix(in oklab, var(--ui-border) 70%, transparent); --mw-surface-border-solid: var(--ui-border); + --mw-floating-bg: color-mix(in oklab, var(--ui-bg-elevated) 30%, transparent); + --mw-floating-shadow: 0 1rem 2rem rgb(0 0 0 / 0.3); } html:not(.no-page-anim) .page-enter-active { @@ -350,6 +339,12 @@ html:not(.no-page-anim) .page-enter-from { html:not(.no-page-anim) .page-leave-to { opacity: 0; } +@media (prefers-reduced-motion: reduce) { + html:not(.no-page-anim) .page-enter-active, + html:not(.no-page-anim) .page-leave-active { + transition: none; + } +} code { direction: ltr; unicode-bidi: bidi-override; diff --git a/ui/app/components/AccountModal.vue b/ui/app/components/AccountModal.vue index e49659c..d01fa73 100644 --- a/ui/app/components/AccountModal.vue +++ b/ui/app/components/AccountModal.vue @@ -1,38 +1,38 @@