nextcloud / nextcloud/assistant

Transcription Fails using localai backend - Content security policy block

Open
#362 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
88
Forks
43
Avg merge
18h 49m
Merged PRs (30d)
3

Description

Which version of assistant are you using?

2.8.0

Which version of Nextcloud are you using?

v31.0.9.1

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

firefox on linux v142.0.1

Describe the Bug

The browser console shows:

Content-Security-Policy: The page’s settings blocked the loading of a resource (connect-src) at blob:https://my.server.fake/somelonghash because it violates the following directive: “connect-src 'self'”

Steps to reproduce:
Assistant->Work With Audio->Tanscribe Audio
Click allow microphone if needed.
(starts recording) ->click green check mark when done recording
Nothing happens

I am an amateur so keep that in mind but...

changing:

protected $allowedConnectDomains = [
                '\'self\'',
        ];

to:

protected $allowedConnectDomains = [
                '\'self\'',
                'data:',
                'blob:',
        ];

in:
lib/public/AppFramework/Http/ContentSecurityPolicy.php

does seem to fix.

Expected Behavior

The audio is saved and the button to transcribe is illuminated.

To Reproduce

Assistant->Work With Audio->Tanscribe Audio
Click allow microphone if needed.
(starts recording) ->click green check mark when done recording
Nothing happens

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure through Assistant → Work With Audio → Transcribe Audio and inspect the browser console for the connect-src violation. Read lib/public/AppFramework/Http/ContentSecurityPolicy.php, especially the allowedConnectDomains configuration, and verify that the recording completes, the audio is saved, and the transcription button becomes available without the CSP block.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.