-
Notifications
You must be signed in to change notification settings - Fork 7
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
hotfix: Add lesmis la is valid url to pdf exporter #4062
Conversation
@@ -39,7 +39,7 @@ rm -rf lastpass-cli | |||
mkdir -p /home/ubuntu/.local/share/lpass | |||
|
|||
# install puppeteer dependencies https://pptr.dev/15.3.0/troubleshooting#chrome-headless-doesnt-launch-on-unix | |||
sudo apt-get -y install \ | |||
sudo apt-get -yqq install \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependencies didn't install in gold master, see if this will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious to know why adding qq
to the args would fix it? Doesn't that just affect logging?
303724e
to
dac846b
Compare
dac846b
to
0fcee53
Compare
ca-certificates \ | ||
fonts-liberation \ | ||
libappindicator3-1 \ | ||
libasound2 \ | ||
libatk-bridge2.0-0 \ | ||
libatk1.0-0 \ | ||
libc6 \ | ||
libcairo2 \ | ||
libcups2 \ | ||
libdbus-1-3 \ | ||
libexpat1 \ | ||
libfontconfig1 \ | ||
libgbm1 \ | ||
libgcc1 \ | ||
libglib2.0-0 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohan-bes And also one space in front of each dependency for fixing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh whitespace issues, I love em 😂 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor code readability change, but aside from that looks good to me 👍
@@ -38,12 +38,17 @@ export class PDFExportRoute extends Route<PDFExportRequest> { | |||
}; | |||
|
|||
private verifyBody = (body: any): Body => { | |||
const legitLESMISHostnames = ['lesmis.la', 'www.lesmis.la']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest having an explicit list of the domains that Tupaia supports
const legitLESMISHostnames = ['lesmis.la', 'www.lesmis.la']; | |
const validDomains= ['.tupaia.org', '.lesmis.la']; |
And then later do:
if (!validDomains.some(domain=> location.hostname.endsWith(domain)) && !location.hostname.endsWith('localhost')) {
Might even be best to store this list of valid hostnames in a utils file/function somewhere, but I can't see another area in the code where do we such a check, so it seems okay to me for it to be here for now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the renaming suggestion.
This check is for security, because pdf-export-server
will access the provided pdfPageUrl
from puppeteer
headless browser, and without this check, hacker could easily get user's session by a malicious link from the pdfPageUrl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found that we have to keep lesmis.la
because it is a legit DNS for lesmis as well.
@billli0 you know the drill when it comes to making changes to the |
@rohan-bes Yes I know how to update this file in s3, but I don't have permission to kick off a build. Could you grant me the access? |
@billli0 okay have bumped your permissions, wanna give it another shot? |
Thanks @rohan-bes, it works! |
Issue #:
pdf export is broken in
lesmis.la