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

Add gVisor blog post #48

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Add gVisor blog post #48

merged 4 commits into from
Sep 23, 2024

Conversation

eloquence
Copy link
Member

  • Also tweaks blockquote styling.
  • In draft form since formatting still needs a bit of love. At minimum we'll need to ensure that lists, preformatted text and the table are formatted correctly.

@eloquence
Copy link
Member Author

@EtiennePerot We can make further edits here (but easy enough to transfer additional stuff from GDoc if we need to). Once this PR is merged it'll go live on the site :)

@apyrgio
Copy link
Contributor

apyrgio commented Sep 18, 2024

CSS is not my strongest suit, but I tried the following:

  • Download one of those classless CSS libraries for static sites.
  • Check out how our site looks with them

There was a CSS library that stood out, Pico CSS. It breaks our site in various ways, but the elements (table, blockquote, code, lists) look great. I was thinking we can copy the respective styles from this library (with attribution, since it's MIT licensed), and add them in our style.css file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using SVGs instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my first impulse as well, but the Google-created SVGs all come with a large white background that needs to be manually cropped, which I've found surprisingly labor-intensive in Inkscape and unpredictable in other tools I've tried. If you have time and better luck with the cropping, a commit to push SVG copies would be welcome, I can take care of the search & replace.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, after taking a swing at it myself, I also wasn't able to find a quick way to do this. Surprisingly finicky files it generates with not just the canvas sizing wrong, but a bunch of stray elements in off-to-the-side locations.

I do wonder if we could have gotten similar results using mermaid... but maybe an experiment for a future time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a go as well, and had some success exporting SVGs that render fine in desktop image viewers or when converted to PNG with ImageMagick, but that look broken in both Chrome and Firefox (mostly due to missing or mis-transformed embedded images using base64 URLs). Given these difficulties and the evident existence of differences in rendering implementations, I concur we should go with PNGs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... Actually @apyrgio's SVGs appear to render fine when seen in the GitHub diff preview (which does use <img src="path/to/raw/svg"/> to display SVGs, not a server-side render), but when opening that same URL in a dedicated tab, fail to render. This is very confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's actually a side-effect of rendering the SVG file with, well... the <svg> tag. When we fetch this SVG via GitHub, it's downloaded as is, meaning that browsers can render it. This is an attack vector though (see: https://www.securesystems.de/blog/svg-security-risks-not-just-a-scalable-graphic/).

GitHub serves third-party content with a strict Content Security Policy (CSP). I see the following response header when fetching https://raw.githubusercontent.com/freedomofpress/dangerzone.rocks/1b9a41c23dd0a6e34a6cdda893d39fd6e97e1e73/src/assets/img/dangerzone-outline.svg:

content-security-policy:  default-src 'none'; style-src 'unsafe-inline'; sandbox

Most likely, this affects the rendering of the embedded icons somehow, since the browser can render the SVG fine on its own:

image

Note that our blogs should not be affected for the same reason that GitHub's diff preview is not affected; we load SVGs via the <img> tag, which has different security properties than embedding it straight in the HTML.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the SVGs themselves, I removed the white background with Vim, and messed around with the viewBox attribute, until I got something to my satisfaction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving the conversation open for comments. Else, I don't see something blocking here.

@EtiennePerot
Copy link
Contributor

@EtiennePerot We can make further edits here (but easy enough to transfer additional stuff from GDoc if we need to). Once this PR is merged it'll go live on the site :)

There are still a few edits being made on the doc. I suggest holding off on content edits this for 1 or 2 more days.

@eloquence
Copy link
Member Author

OK, I'm pretty happy with the styling now. I also changed the excerpt logic up a bit, so we can use --- to identify the section of a post that's shown in the feed, and have it preserve formatting.

Copy link
Contributor

@harrislapiroff harrislapiroff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small commentary-type notes, but nothing deploy-blocking. Will also take a quick look at SVGs.

eleventy.config.js Outdated Show resolved Hide resolved
eleventy.config.js Outdated Show resolved Hide resolved
src/news/2024-09-18-gvisor.md Outdated Show resolved Hide resolved
src/news/2024-09-18-gvisor.md Outdated Show resolved Hide resolved
@EtiennePerot
Copy link
Contributor

EtiennePerot commented Sep 21, 2024

Pull request on the gVisor blog side: google/gvisor#10937

(I updated the markdown to match the new contents from the doc, feel free to steal it.)

copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 21, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post a5c7ab4
PiperOrigin-RevId: 677215115
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 21, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post a5c7ab4
PiperOrigin-RevId: 677215115
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 21, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post a5c7ab4
PiperOrigin-RevId: 677215115
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 21, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post a5c7ab4
PiperOrigin-RevId: 677215115
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 21, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post a5c7ab4
PiperOrigin-RevId: 677215115
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 22, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post 136b0af
PiperOrigin-RevId: 677215115
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 22, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post 136b0af
PiperOrigin-RevId: 677215115
@apyrgio
Copy link
Contributor

apyrgio commented Sep 23, 2024

Heads up, I've pushed a commit (0776d88) where I've aligned our post title and publication notice with the ones that the gVisor team used as well. Other than that, I've approved the changes and I'm happy to squash and merge at any time.

@eloquence eloquence marked this pull request as ready for review September 23, 2024 16:10
eloquence and others added 3 commits September 23, 2024 19:32
Add CSS styles for rendered Markdown elements, such as blockquotes,
tables, ordered lists, and code blocks. Also, add styles for figures and
their captions.

Finally, make some small style tweaks.
Replace an instance of preformatted text (which served as empty space
for design purposes) with an HTML paragraph. We have recently started
styling preformatted text with a gray background, which means it can no
longer be used as empty space.
@apyrgio apyrgio merged commit b8f3c24 into main Sep 23, 2024
@apyrgio apyrgio deleted the add-gvisor-blog-post branch September 23, 2024 17:23
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 23, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post 9f3c604
PiperOrigin-RevId: 677215115
copybara-service bot pushed a commit to google/gvisor that referenced this pull request Sep 23, 2024
This PR depends on #10936.

It adds a blog post about Dangerzone & gVisor integration. The same blog post is being posted on the Dangerzone blog: freedomofpress/dangerzone.rocks#48

When published, it will appear at the following URL: `https://gvisor.dev/blog/2024/09/23/safe-ride-into-the-dangerzone/`

Preview:
![dangerzone-preview](https://github.com/user-attachments/assets/be889fb4-0b49-4bdb-931d-8a06a6b1e265)
FUTURE_COPYBARA_INTEGRATE_REVIEW=#10937 from EtiennePerot:dangerzone-blog-post 9f3c604
PiperOrigin-RevId: 677215115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants