ICON_BLACKLIST_REGEX with domain not working #976

Closed
opened 2026-02-04 23:32:06 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @darootler on GitHub (Mar 16, 2021).

I am running bitwarden_rs with docker compose as follows:

version: '3'

services:
  bitwardenrs:
    deploy:
      resources:
        limits:
          cpus: '0.25'
          memory: 256M
    environment:
      ICON_BLACKLIST_REGEX: '.*mygreatdomain\.biz'
      DOMAIN: https://secret.domain:12345
      ROCKET_TLS: '{certs="/data/pub.pem",key="/data/priv.pem"}'
      SIGNUPS_ALLOWED: 'false'
      SIGNUPS_DOMAINS_WHITELIST: 'secret.domain'
      SMTP_HOST: 'smtp.secret.domain'
      SMTP_FROM: 'bitwarden_rs@secret.domain'
      SMTP_PORT: 587
      SMTP_SSL: 'true'
    image: bitwardenrs/server:latest
    restart: always
    ports:
      - 4711:80
    volumes:
      - /my/persistent/share/data:/data

I want to exclude some domains from the icon service, in this example i want to exclude "mygreatdomain.biz" from the icon service. As you can see this is not working:

[2021-03-16 15:05:31.122][request][INFO] GET /icons/mygreatdomain.biz/icon.png

Am i doing something wrong?

Regards
Richard

Originally created by @darootler on GitHub (Mar 16, 2021). I am running bitwarden_rs with docker compose as follows: ``` version: '3' services: bitwardenrs: deploy: resources: limits: cpus: '0.25' memory: 256M environment: ICON_BLACKLIST_REGEX: '.*mygreatdomain\.biz' DOMAIN: https://secret.domain:12345 ROCKET_TLS: '{certs="/data/pub.pem",key="/data/priv.pem"}' SIGNUPS_ALLOWED: 'false' SIGNUPS_DOMAINS_WHITELIST: 'secret.domain' SMTP_HOST: 'smtp.secret.domain' SMTP_FROM: 'bitwarden_rs@secret.domain' SMTP_PORT: 587 SMTP_SSL: 'true' image: bitwardenrs/server:latest restart: always ports: - 4711:80 volumes: - /my/persistent/share/data:/data ``` I want to exclude some domains from the icon service, in this example i want to exclude "mygreatdomain.biz" from the icon service. As you can see this is not working: `[2021-03-16 15:05:31.122][request][INFO] GET /icons/mygreatdomain.biz/icon.png` Am i doing something wrong? Regards Richard
Author
Owner

@BlackDex commented on GitHub (Mar 16, 2021):

That log-line isn't telling anything.
You need to see what it returns.

If it returns a 404 it means it worked.
This is what i see if i use your regex:

[2021-03-16 15:20:25.910][request][INFO] GET /icons/github.com/icon.png
[2021-03-16 15:20:25.937][reqwest::connect][DEBUG] starting new connection: https://github.com/
[2021-03-16 15:20:26.070][reqwest::async_impl::client][DEBUG] response '200 OK' for https://github.com/
[2021-03-16 15:20:26.715][reqwest::async_impl::client][DEBUG] response '200 OK' for https://github.com/fluidicon.png
[2021-03-16 15:20:26.716][bitwarden_rs::api::icons][INFO] Downloaded icon from https://github.com/fluidicon.png
[2021-03-16 15:20:26.722][response][INFO] GET /icons/<domain>/icon.png (icon) => 200 OK
[2021-03-16 15:20:27.577][request][INFO] GET /favicon.ico
[2021-03-16 15:20:27.577][response][INFO] GET /<p..> [10] (web_files) => 200 OK
[2021-03-16 15:20:44.975][request][INFO] GET /icons/mygreatdomain.biz/icon.png
[2021-03-16 15:20:44.976][bitwarden_rs::api::icons][WARN] Blacklisted domain: "mygreatdomain.biz" matched ".*mygreatdomain\\.biz"
[2021-03-16 15:20:44.977][bitwarden_rs::api::icons][ERROR] Domain is blacklisted. mygreatdomain.biz
[2021-03-16 15:20:44.977][bitwarden_rs::api::icons][ERROR] Error downloading icon: Domain is blacklisted. mygreatdomain.biz
@BlackDex commented on GitHub (Mar 16, 2021): That log-line isn't telling anything. You need to see what it returns. If it returns a 404 it means it worked. This is what i see if i use your regex: ``` [2021-03-16 15:20:25.910][request][INFO] GET /icons/github.com/icon.png [2021-03-16 15:20:25.937][reqwest::connect][DEBUG] starting new connection: https://github.com/ [2021-03-16 15:20:26.070][reqwest::async_impl::client][DEBUG] response '200 OK' for https://github.com/ [2021-03-16 15:20:26.715][reqwest::async_impl::client][DEBUG] response '200 OK' for https://github.com/fluidicon.png [2021-03-16 15:20:26.716][bitwarden_rs::api::icons][INFO] Downloaded icon from https://github.com/fluidicon.png [2021-03-16 15:20:26.722][response][INFO] GET /icons/<domain>/icon.png (icon) => 200 OK [2021-03-16 15:20:27.577][request][INFO] GET /favicon.ico [2021-03-16 15:20:27.577][response][INFO] GET /<p..> [10] (web_files) => 200 OK [2021-03-16 15:20:44.975][request][INFO] GET /icons/mygreatdomain.biz/icon.png [2021-03-16 15:20:44.976][bitwarden_rs::api::icons][WARN] Blacklisted domain: "mygreatdomain.biz" matched ".*mygreatdomain\\.biz" [2021-03-16 15:20:44.977][bitwarden_rs::api::icons][ERROR] Domain is blacklisted. mygreatdomain.biz [2021-03-16 15:20:44.977][bitwarden_rs::api::icons][ERROR] Error downloading icon: Domain is blacklisted. mygreatdomain.biz ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#976