-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/axoflow/axosyslog-4-docs in…
…to main
- Loading branch information
Showing
8 changed files
with
134 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Prod image build | ||
|
||
on: | ||
push: | ||
tags: ["*"] | ||
|
||
# secrets: | ||
# - WIF_SERVICE_ACCOUNT | ||
# - WIF_PROVIDER | ||
# | ||
# vars: | ||
# - GCP_PROJECT | ||
# - REGISTRY_DOMAIN | ||
|
||
env: | ||
IMAGE_PREFIX: ${{ vars.REGISTRY_DOMAIN }}/${{ vars.GCP_PROJECT }}/axosyslog-core-docs | ||
IMAGE_NAME: axosyslog-core-docs | ||
|
||
jobs: | ||
image-build: | ||
name: build&push | ||
runs-on: ubuntu-latest | ||
# Add 'id-token' with the intended permissions for workload identity federation | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
steps: | ||
- name: Checkout | ||
uses: "actions/checkout@v4" | ||
|
||
### Preparation: Auth, setup ### | ||
|
||
- name: Google auth | ||
id: auth | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
workload_identity_provider: "${{ secrets.WIF_PROVIDER }}" | ||
service_account: "${{ secrets.WIF_SERVICE_ACCOUNT }}" | ||
token_format: "access_token" | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: "${{ vars.REGISTRY_DOMAIN }}" | ||
username: oauth2accesstoken | ||
password: "${{ steps.auth.outputs.access_token }}" | ||
|
||
# https://docs.docker.com/build/ci/github-actions/multi-platform/ | ||
# - name: Set up QEMU for multi-arch build | ||
# uses: docker/setup-qemu-action@v2 | ||
|
||
### Image building ### | ||
|
||
- name: Collect metadata for image | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.IMAGE_PREFIX }}/${{ env.IMAGE_NAME }} | ||
# https://github.com/docker/metadata-action#typesemver | ||
tags: | | ||
type=ref,event=branch,enable=${{ startsWith(github.ref, 'refs/heads/') }} | ||
type=semver,pattern={{raw}},enable=${{ startsWith(github.ref, 'refs/tags/') }} | ||
labels: | | ||
org.opencontainers.image.title=${{ env.IMAGE_NAME }} | ||
org.opencontainers.image.vendor: Axoflow | ||
org.opencontainers.image.authors: Axoflow | ||
maintainer: "Axoflow <info@axoflow.com>" | ||
org.opencontainers.image.url: https://axoflow.com | ||
org.opencontainers.image.source: https://axoflow.com | ||
- name: Build image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
# platforms: linux/amd64 | ||
context: "." | ||
file: Dockerfile | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Build stage | ||
FROM ubuntu:22.04 as hugo | ||
|
||
ARG TARGETARCH | ||
ARG HUGO_VERSION="0.119.0" | ||
|
||
RUN apt update && apt install -y wget git ca-certificates curl gnupg | ||
|
||
# Install nodejs | ||
# https://github.com/nodesource/distributions#installation-instructions | ||
ARG NODE_MAJOR=20 | ||
|
||
RUN mkdir -p /etc/apt/keyrings | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
RUN NODE_MAJOR=${NODE_MAJOR} echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
RUN apt-get update && apt-get install -y nodejs | ||
|
||
# Install hugo | ||
RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.deb | ||
RUN dpkg -i hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.deb | ||
|
||
# WORKDIR /app | ||
ADD . /app/ | ||
|
||
WORKDIR /app/themes/docsy | ||
|
||
RUN npm install | ||
|
||
WORKDIR /app/ | ||
|
||
RUN npm install autoprefixer postcss-cli | ||
|
||
RUN hugo \ | ||
--baseURL="https://docs.axoflow.com/axosyslog-core" \ | ||
-e production \ | ||
--enableGitInfo \ | ||
--ignoreCache | ||
|
||
# Run stage | ||
FROM nginx:1.25-alpine | ||
|
||
WORKDIR /usr/share/nginx/html | ||
|
||
RUN sed -i 's/server {/server {\n absolute_redirect off;/' /etc/nginx/conf.d/default.conf | ||
RUN sed -i 's/http {/http {\n server_tokens off;/' /etc/nginx/nginx.conf | ||
COPY --from=hugo /app/public ./axosyslog-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
--- | ||
<!-- DISCLAIMER: This file is based on the syslog-ng Open Source Edition documentation https://github.com/balabit/syslog-ng-ose-guides/commit/2f4a52ee61d1ea9ad27cb4f3168b95408fddfdf2 and is used under the terms of The syslog-ng Open Source Edition Documentation License. The file has been modified by Axoflow. --> | ||
If you store the Python code in a separate Python file and only include it in the {{% param "product.abbrev" %}} configuration file, make sure that the PYTHON_PATH environment variable includes the path to the Python file, and export the PYTHON_PATH environment variable. For example, if you start {{% param "product.abbrev" %}} manually from a terminal and you store your Python files in the `/opt/syslog-ng/etc` directory, use the following command: `export PYTHONPATH=/opt/syslog-ng/etc`. | ||
If you store the Python code in a separate Python file and only include it in the {{% param "product.abbrev" %}} configuration file, make sure that the PYTHONPATH environment variable includes the path to the Python file, and export the PYTHON_PATH environment variable. For example, if you start {{% param "product.abbrev" %}} manually from a terminal and you store your Python files in the `/opt/syslog-ng/etc` directory, use the following command: `export PYTHONPATH=/opt/syslog-ng/etc`. | ||
|
||
In production, when {{% param "product.abbrev" %}} starts on boot, you must configure your startup script to include the Python path. The exact method depends on your operating system. For recent Red Hat Enterprise Linux, Fedora, and CentOS distributions that use systemd, the `systemctl` command sources the `/etc/sysconfig/syslog-ng` file before starting {{% param "product.abbrev" %}}. (On openSUSE and SLES, `/etc/sysconfig/syslog` file.) Append the following line to the end of this file: `PYTHONPATH="<path-to-your-python-file>"`, for example, `PYTHONPATH="/opt/syslog-ng/etc"`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters