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

infra: add set up for blog #11981

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions infra/build/blog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
oss-fuzz-blog
hugo-coder
37 changes: 37 additions & 0 deletions infra/build/blog/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
FROM python:3.11-bullseye

# Allow statements and log messages to immediately appear in the Knative logs
ENV PYTHONUNBUFFERED True

RUN mkdir -p hugo-bin && \
cd hugo-bin && \
wget https://github.com/gohugoio/hugo/releases/download/v0.126.1/hugo_extended_0.126.1_linux-amd64.tar.gz && \
tar -xzf hugo_extended_0.126.1_linux-amd64.tar.gz

ENV PATH="${PATH}:/hugo-bin/"

RUN git clone https://github.com/luizdepra/hugo-coder hugo-coder && \
cd hugo-coder && \
git checkout 759cc945636473d251a28597e2007cbb7d11631d # 17th May 2024

COPY content /content
COPY hugo.toml /hugo.toml
COPY build_blog.sh /build_blog.sh
RUN /build_blog.sh

CMD exec python3 -m http.server 8011 -d /oss-fuzz-blog/page/public
Copy link
Collaborator

Choose a reason for hiding this comment

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

For our infra, we probably want to build a simple Cloud Build integration that just dumps the static site to a GCS bucket instead. We can do this later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep sounds good, would you be able to do this? /oss-fuzz-blog/page/public holds the static website content.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, we can handle this!

54 changes: 54 additions & 0 deletions infra/build/blog/build_blog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash -eux
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

BASE=$PWD

if [ -d "${BASE}/hugo-coder" ]
then
echo "Local version of hugo exists. Using this."
else
# When writing the blog outeside of docker we clone Hugo here.
git clone https://github.com/luizdepra/hugo-coder hugo-coder
cd hugo-coder
git checkout 759cc945636473d251a28597e2007cbb7d11631d # 17th May 2024
cd ../
fi

# Build the site
if [ -d "${BASE}/oss-fuzz-blog" ]
then
rm -rf ${BASE}/oss-fuzz-blog
fi
mkdir oss-fuzz-blog
cd oss-fuzz-blog

hugo new site page
cd page

git init

# Copy over our content
cp -rf ${BASE}/hugo-coder themes/hugo-coder
cp $BASE/hugo.toml .
rm -rf ./content
cp -rf $BASE/content .

# Build the site
hugo -D

# Uncomment the following to launch site automatically
#python3 -m http.server 8011 -d ./oss-fuzz-blog/page/public
13 changes: 13 additions & 0 deletions infra/build/blog/content/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
+++
title = "About"
description = "OSS-Fuzz's blog"
date = "2024-05-20"
aliases = ["about-us", "about-oss-fuzz", "contact"]
author = "OSS-Fuzz maintainers"
+++

This is a blog for updates, research and initiatives of the OSS-Fuzz project.
OSS-Fuzz is an open source fuzzing framework focused on large scale fuzzing
of open source projects. The efforts described in this blog focuses on this
domain and includes both feature updates to OSS-Fuzz itself as well as insights
into research and development efforts of OSS-Fuzz.
Binary file added infra/build/blog/content/images/oss-fuzz-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions infra/build/blog/content/posts/oss-fuzz-hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
+++
authors = ["OSS-Fuzz Maintainers"]
title = "OSS-Fuzz blog"
date = "2024-05-20"
description = "Introduction to the OSS-Fuzz blog"
tags = [
"fuzzing",
"blogging",
]
categories = [
"introduction",
]
+++

Welcome to the new OSS-Fuzz blog! In this place we will publish feature
updates, research efforts and all-things OSS-Fuzz related.
52 changes: 52 additions & 0 deletions infra/build/blog/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
seURL = ''
languageCode = 'en-us'
title = 'OSS-Fuzz blog'
theme = 'hugo-coder'

languagecode = "en"
defaultcontentlanguage = "en"

paginate = 20

[markup.highlight]
style = "github-dark"

[params]
info = "Fuzzing Open Source Software at Scale"
description = "OSS-Fuzz fuzzing blog"
keywords = "fuzzing, vulnerability research, open source, security"
avatarurl = "images/oss-fuzz-logo.png"

faviconSVG = "/img/favicon.svg"
favicon_32 = "/img/favicon-32x32.png"
favicon_16 = "/img/favicon-16x16.png"

since = 2024

enableTwemoji = true

colorScheme = "auto"
hidecolorschemetoggle = false

[taxonomies]
category = "categories"
series = "series"
tag = "tags"
author = "authors"

# Social links
[[params.social]]
name = "Github"
icon = "fa-brands fa-github fa-2x"
weight = 1
url = "https://github.com/google/oss-fuzz"

# Menu links
[[menu.main]]
name = "Blog"
weight = 1
url = "posts/"
[[menu.main]]
name = "About"
weight = 2
url = "about/"
Loading