pastebin
pastebin copied to clipboard
Favicon does not respect sub path
Hey, very nice project!
I found one small issue, when I set --uri-prefix="/pastebin"
the favicon does not respect it and always tries to be downloaded from the https://FQDN/static/favicon.ico
instead of e.g. https://FQDN/pastebin/static/favicon.ico
.
Quick fix in apache2 will be:
# Favicon
Redirect 301 "/static/favicon.ico" "/pastebin/static/favicon.ico"
nginx proxy manager
location /paste/ {
proxy_pass http://10.31.1.205:7777/paste/;
}
location = /static/favicon.ico {
return 301 /paste/static/favicon.ico;
}
cat docker-compose.yml
version: "3.7"
services:
pastebin:
image: mkaczanowski/pastebin:latest
container_name: pastebin
restart: unless-stopped
command: --address 0.0.0.0 --port 8081 --uri http://test.xxx.com/paste --uri-prefix="/paste" --db=/var/lib/pastebin/
ports:
- "7777:8081"
volumes:
- ./db:/var/lib/pastebin/
the error log:
pastebin | => Matched: GET /paste/new?<id>&<level>&<msg>&<glyph>&<url> (get_new)
pastebin | => Outcome: Success
pastebin | => Response succeeded.
pastebin | GET /paste/new?level=success&glyph=fas%20fa-check&msg=The%20paste%20has%20been%20successfully%20created:&url=%3C!doctype%20html%3E%0A%3Chtml%20lang=%22en%22%3E%0A%20%20%20%20%3Chead%3E%0A%20%20%20%20%20%20%20%20%3Cmeta%20charset=%22utf-8%22%3E%0A%20%20%20%20%20%20%20%20%3Cmeta%20name=%22viewport%22%20content=%22width=device-width,%20initial-scale=1,%20shrink-to-fit=no%22%3E%0A%20%20%20%20%20%20%20%20%3Cmeta%20name=%22description%22%20content=%22Simple,%20fast%20and%20standalone%20pastebin%20service%22%3E%0A%20%20%20%20%20%20%20%20%3Cmeta%20name=%22author%22%20content=%22Mateusz%20Kaczanowski%22%3E%0A%0A%20%20%20%20%20%20%20%20%3Ctitle%3EPastebin%3C/title%3E%0A%0A%20%20%20%20%20%20%20%20%3Clink%20rel=%22icon%22%20href=%22/static/favicon.ico%22%3E%0A%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3Clink%20href=%22/paste/static/prism.css%22%20rel=%22stylesheet%22%20/%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3Clink%20href=%22https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css%22%20rel=%22stylesheet%22%20/%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3Clink%20href=%22https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css%22%20rel=%22stylesheet%22%20/%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3Clink%20href=%22/paste/static/custom.css%22%20rel=%22stylesheet%22%20/%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%3C/head%3E%0A%0A%20%20%20%20%3Cbody%3E%0A%20%20%20%20%20%20%20%20%3Cnav%20class=%22navbar%20navbar-expand-md%20navbar-dark%20fixed-top%20bg-dark%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%20class=%22navbar-brand%22%20href=%22/paste/new%22%3EPASTEBIN%3C/a%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cbutton%20class=%22navbar-toggler%22%20type=%22button%22%20data-toggle=%22collapse%22%20data-target=%22 text/html:
pastebin | => Matched: GET /paste/new?<id>&<level>&<msg>&<glyph>&<url> (get_new)
pastebin | => Outcome: Success
pastebin | => Response succeeded.
pastebin | GET /paste/static/prism.css