dani-garcia / vaultwarden

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
GNU Affero General Public License v3.0
34.71k stars 1.69k forks source link

User invite from server administration is not working #4610

Closed Opicka879 closed 1 month ago

Opicka879 commented 1 month ago

User invite is not working via server administration. User is not made and email not sent. It is working via organization administration. It is not working on latest version and testing version. It works before.

Sorry for short description. It is hard for me to write in english. :)

stefan0xC commented 1 month ago

Given the error messages in the other thread you probably have overwritten the admin templates. Cf. https://github.com/dani-garcia/vaultwarden/discussions/4605#discussioncomment-9629954

Opicka879 commented 1 month ago

Given the error messages in the other thread you probably have overwritten the admin templates. Cf. #4605 (comment)

I don't think I'm overwriting the template. I only edited some icons and email templates. I am sending the log from the browser console and the way I start the container. Can you advise me what I am doing wrong? On version 1.30.2, sending invitations worked normally, then I don't know, I didn't need it for a long time.

Thank you.

Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
Error with Permissions-Policy header: Unrecognized feature: 'battery'.
Error with Permissions-Policy header: Unrecognized feature: 'document-domain'.
Error with Permissions-Policy header: Unrecognized feature: 'execution-while-not-rendered'.
Error with Permissions-Policy header: Unrecognized feature: 'execution-while-out-of-viewport'.
overview:982 

        GET https://myvwadress/vw_static/jquery-3.7.0.slim.js net::ERR_ABORTED 400 (Bad Request)
 overview:1 Refused to execute script from 'https://myvwadress/vw_static/jquery-3.7.0.slim.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
 datatables.js:71 Uncaught ReferenceError: jQuery is not defined
     at datatables.js:71:31
     at datatables.js:73:2
 (anonymous) @ datatables.js:71
 (anonymous) @ datatables.js:73
 admin_users.js:162 Uncaught ReferenceError: jQuery is not defined
     at admin_users.js:162:1
 (anonymous) @ admin_users.js:162
 overview:985 

        GET https://myvwadress/vw_static/jdenticon.js net::ERR_ABORTED 400 (Bad Request)
 overview:1 Refused to execute script from 'https://myvwadress/vw_static/jdenticon.js' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
 inject-root-bundle.js:1 RSS_Basic_Detect.js: Expected contentType string
 Wt @ inject-root-bundle.js:1
 Promise.then (async)
 zt @ inject-root-bundle.js:1
 (anonymous) @ inject-root-bundle.js:1
 (anonymous) @ inject-root-bundle.js:1
 (anonymous) @ inject-root-bundle.js:1
 Show 5 more frames
 Show less
docker run -d \
 --name vaultwarden \
 --restart always \
 -e EXPERIMENTAL_CLIENT_FEATURE_FLAGS=autofill-v2,autofill-overlay \
 -e LOG_FILE=/data/vaultwarden.log \
 -e LOG_LEVEL=warn -e EXTENDED_LOGGING=true \
 -e TZ=Europe/Prague \
 -e PUSH_ENABLED=true \
 -e PUSH_RELAY_URI=https://push.bitwarden.eu \
 -e PUSH_IDENTITY_URI=https://identity.bitwarden.eu \
 -e PUSH_INSTALLATION_ID=myid \
 -e PUSH_INSTALLATION_KEY=mykey \
 -v /vw-data/:/data/ \
 -v /home/opicka/images/fallback-icon.png:/web-vault/images/fallback-icon.png:ro \
 -v /home/opicka/images/icon-white.png:/web-vault/images/icon-white.png:ro \
 -v /home/opicka/images/logo-dark@2x.png:/web-vault/images/logo-dark@2x.png:ro \
 -v /home/opicka/images/logo-gray.png:/web-vault/images/logo-gray.png:ro \
 -v /home/opicka/images/logo-white@2x.png:/web-vault/images/logo-white@2x.png:ro \
 -v /home/opicka/images/vaultwarden-favicon.png:/web-vault/images/vaultwarden-favicon.png:ro \
 -v /home/opicka/images/vaultwarden-icon.png:/web-vault/images/vaultwarden-icon.png:ro \
 -v /home/opicka/images/apple-touch-icon.png:/web-vault/images/apple-touch-icon.png:ro \
 -v /home/opicka/images/favicon-16x16.png:/web-vault/images/favicon-16x16.png:ro \
 -v /home/opicka/images/favicon-32x32.png:/web-vault/images/favicon-32x32.png:ro \
 -v /home/opicka/images/safari-pinned-tab.svg:/web-vault/images/safari-pinned-tab.svg:ro \
 -p 8081:80 \
 vaultwarden/server:testing
stefan0xC commented 1 month ago

Like I said you probably are overwriting the admin templates because your admin interface is requesting files that have been renamed by d6b97090fab5eba429a79c35735a0760b2fa9ee2 and f05398a6b36891e6e979a39937f8f8eaa6360d52. Cf. https://github.com/dani-garcia/vaultwarden/wiki/Translating-the-email-templates

Commit d6b97090fab5eba429a79c35735a0760b2fa9ee2 (which is shipped since 1.30.4) updated jquery-3.7.0.slim.js to jquery-3.7.1.slim.js https://github.com/dani-garcia/vaultwarden/blob/f05398a6b36891e6e979a39937f8f8eaa6360d52/src/static/templates/admin/users.hbs#L143 https://github.com/dani-garcia/vaultwarden/blob/f05398a6b36891e6e979a39937f8f8eaa6360d52/src/static/templates/admin/organizations.hbs#L62

And if you are using the testing image you'll also need to change jdenticon.js to jdenticon-3.3.0.js in those files because of f05398a6b36891e6e979a39937f8f8eaa6360d52 https://github.com/dani-garcia/vaultwarden/blob/f05398a6b36891e6e979a39937f8f8eaa6360d52/src/static/templates/admin/users.hbs#L146 https://github.com/dani-garcia/vaultwarden/blob/f05398a6b36891e6e979a39937f8f8eaa6360d52/src/static/templates/admin/organizations.hbs#L65

So if you have overwritten src/static/templates/admin/users.hbs (by placing a corresponding file in /vw-data/templates/admin/users.hbs) you need to update that file (and also /vw-data/templates/admin/organizations.hbs accordingly).

Opicka879 commented 1 month ago

@stefan0xC Thank you for help. I will try to fix it.