Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favicon Internet.nl still visible in non-branded version #1551

Open
baknu opened this issue Nov 12, 2024 · 1 comment
Open

Favicon Internet.nl still visible in non-branded version #1551

baknu opened this issue Nov 12, 2024 · 1 comment
Labels
bug Unexpected or unwanted behaviour of current implementations

Comments

@baknu
Copy link
Contributor

baknu commented Nov 12, 2024

No description provided.

@baknu baknu added the bug Unexpected or unwanted behaviour of current implementations label Nov 12, 2024
@bwbroersma
Copy link
Collaborator

bwbroersma commented Nov 12, 2024

Currently the security.txt is done this way:

# disable security.txt if branding is disabled
set $internetnl_branding "${INTERNETNL_BRANDING}";
if ($internetnl_branding = "True"){
set $security_txt "/var/www/internet.nl/.well-known/security.txt";
}
if ($internetnl_branding != "True"){
set $security_txt "/var/www/internet.nl/.well-known/security-custom.txt";
}
location = /.well-known/security.txt {
# basic auth should not apply to this path
auth_basic off;
# IP allowlist should also not apply
alias $security_txt;
}

This uses the template nginx docker 20-envsubst-on-templates.sh logic. Note that nginx env is an alternative to this.
Maybe it's better to use:

http {
  env $INTERNETNL_BRANDING;
  map $INTERNETNL_BRANDING $branding_assets {
    True    "/var/www/internet.nl/";
    default "/var/www/no_branding/";
  }
  ...
  server {
     ...
    location = /.well-known/ { 
      # basic auth should not apply to this path 
      auth_basic off; 
      # IP allowlist should also not apply 
      root $branding_assets;
    }
    location = /favicon.ico {
      root $branding_assets;
    }
    ...
  }
  ...
}

Either root or alias should be used.

Variant $ tree -a
root $assets; ├── favicon.ico
├── static
│   ├── logo_en.svg
│   └── logo_nl.svg
└── .well-known
└── security.txt
alias $assets; ├── favicon.ico
├── logo_en.svg
├── logo_nl.svg
└── security.txt

Note that the logo currently is not a branding option, and not as easy as it seems since it's this in the HTML:

<a href="/">
  <span class="hidden">Internet.nl</span>
</a>

A no_branding variant should be there by default. Another option is to call it your_branding, so this can be changed in some branding.yml override with an extra mount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected or unwanted behaviour of current implementations
Development

No branches or pull requests

2 participants