diff --git a/infra/build/blog/.gitignore b/infra/build/blog/.gitignore new file mode 100644 index 000000000..8041d68df --- /dev/null +++ b/infra/build/blog/.gitignore @@ -0,0 +1,2 @@ +oss-fuzz-blog +hugo-coder diff --git a/infra/build/blog/Dockerfile b/infra/build/blog/Dockerfile new file mode 100644 index 000000000..6b7d4b41c --- /dev/null +++ b/infra/build/blog/Dockerfile @@ -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 diff --git a/infra/build/blog/build_blog.sh b/infra/build/blog/build_blog.sh new file mode 100755 index 000000000..9c5fb7a16 --- /dev/null +++ b/infra/build/blog/build_blog.sh @@ -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 diff --git a/infra/build/blog/content/about.md b/infra/build/blog/content/about.md new file mode 100644 index 000000000..b1ac2defd --- /dev/null +++ b/infra/build/blog/content/about.md @@ -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. diff --git a/infra/build/blog/content/images/oss-fuzz-logo.png b/infra/build/blog/content/images/oss-fuzz-logo.png new file mode 100755 index 000000000..d4b786e14 Binary files /dev/null and b/infra/build/blog/content/images/oss-fuzz-logo.png differ diff --git a/infra/build/blog/content/posts/oss-fuzz-hello-world.md b/infra/build/blog/content/posts/oss-fuzz-hello-world.md new file mode 100644 index 000000000..a8ace9c0a --- /dev/null +++ b/infra/build/blog/content/posts/oss-fuzz-hello-world.md @@ -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. diff --git a/infra/build/blog/hugo.toml b/infra/build/blog/hugo.toml new file mode 100644 index 000000000..00464d1ed --- /dev/null +++ b/infra/build/blog/hugo.toml @@ -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/"