From 97a0c5a20cb33312a2e681163e8be6deec2d990f Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Tue, 21 May 2024 23:40:17 +0100 Subject: [PATCH] infra: add set up for blog (#11981) Adds a blog set up that will make it easy to publish new posts. You can test this locally by running the `build_blog.sh` script from the directory of the script. You'll need to have hugo for this, which you can do in the same way as the Dockerfile: ```sh 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/" ``` --------- Signed-off-by: David Korczynski --- infra/build/blog/.gitignore | 2 + infra/build/blog/Dockerfile | 37 ++++++++++++ infra/build/blog/build_blog.sh | 54 ++++++++++++++++++ infra/build/blog/content/about.md | 13 +++++ .../blog/content/images/oss-fuzz-logo.png | Bin 0 -> 6614 bytes .../content/posts/oss-fuzz-hello-world.md | 16 ++++++ infra/build/blog/hugo.toml | 52 +++++++++++++++++ 7 files changed, 174 insertions(+) create mode 100644 infra/build/blog/.gitignore create mode 100644 infra/build/blog/Dockerfile create mode 100755 infra/build/blog/build_blog.sh create mode 100644 infra/build/blog/content/about.md create mode 100755 infra/build/blog/content/images/oss-fuzz-logo.png create mode 100644 infra/build/blog/content/posts/oss-fuzz-hello-world.md create mode 100644 infra/build/blog/hugo.toml 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 0000000000000000000000000000000000000000..d4b786e14b6ba7c490fd4c3ebd3f905c450d7c60 GIT binary patch literal 6614 zcmeHMS5#A5w@wI60TB=pLs221G(~#%APPtm1VO4M3erOf2@r)SB27>_(i8*?J&M!- zQ36pZInt$s01Ahm9Ha<@+|7UfdmrxW9pgUz4|}ggfzPq0s^VX96Vr5iBT8`BpzpO@`pVpZ)Fml z?s+AL!dyGbee}fBT3Imk=$C7DMTrTrqN?D%HB6ZNtcgy-Y8!4qxe6x2gv2LJ_EeQo$vOCTexkum1btEfqgZ>Mjio3zG?CCa8?e|2 zCSTX@2vHov#eDk5q!ecxS01-3XDG|al~Sftd;(K)H9Kdgn>3El;G`Mg5ID);LJX)K zWC(Ko^V5f?1WDWZhswi9Wrq2giC%9)@|7U$ORWT)qfZPlC)V5Q=z0)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~IOQx8C&egb#6)-Q1&yy3@6~ zs@7`J@`iKk?{QD#yQd~fs~-9ngOn;qSmM&sQGQW_BLA+u k>-?uE|Ns4=VP87--ro$qUK}0xPy;f*Vr^1weEZRV0cr&7Bme*a literal 0 HcmV?d00001 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/"