Skip to content
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: 1 addition & 1 deletion .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
-
name: Checkout Branch ${{ github.ref_name }}
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Create Pull Request
uses: bfren/pull-request@v2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
steps:
-
name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
Expand All @@ -31,20 +31,20 @@ jobs:
id: version
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
-
name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Get repository name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
Expand All @@ -36,20 +36,20 @@ jobs:
id: version
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
build-args: |
BF_IMAGE=${{ env.REPOSITORY_NAME }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
shell: bash
-
name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2023 bfren
Copyright (c) 2020-2024 bfren

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ The image contains a handful of useful Nginx configuration 'helper' files, which

## Copyright

> Copyright (c) 2020-2023 [bfren](https://bfren.dev) (unless otherwise stated)
> Copyright (c) 2020-2024 [bfren](https://bfren.dev) (unless otherwise stated)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.5
7.1.0
2 changes: 1 addition & 1 deletion VERSION_MINOR
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0
7.1
14 changes: 7 additions & 7 deletions overlay/etc/bf/templates/nginx-proxy.conf.esh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Use environment variable PROXY_DOMAIN to change this file.
#
# Copyright (c) 2021-2023 bfren
# Copyright (c) 2021-2024 bfren
#======================================================================================================================

#======================================================================================================================
Expand Down Expand Up @@ -39,19 +39,19 @@ server {
return 301 <%= "https://${DOMAIN_NAME}" %>$request_uri;
}

# because he was a legend
include helpers/nginx-discworld.conf;

# include secure headers
include helpers/proxy-secure-headers.conf;

# include custom configuration
include <%= "${CUSTOM_CONF}/*.conf" %>;

# include standard helpers
include helpers/nginx-ignore-favicon.conf;
include helpers/nginx-static-files.conf;

# include custom configuration
include <%= "${CUSTOM_CONF}/*.conf" %>;

# because he was a legend
include helpers/nginx-discworld.conf;

# serve pages in <%= "${NGINX_PUBLIC}" %> (map volume to override default pages)
root <%= "${NGINX_PUBLIC}" %>;

Expand Down
7 changes: 5 additions & 2 deletions overlay/etc/bf/templates/nginx-site.conf.esh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# "custom": true
# This will cause this file to be regenerated next time the container is started.
#
# Copyright (c) 2021-2023 bfren
# Copyright (c) 2021-2024 bfren
#======================================================================================================================
<% else -%>
#======================================================================================================================
Expand All @@ -29,7 +29,7 @@
# "custom": true
# This will stop this file being generated next time the container is started.
#
# Copyright (c) 2021-2023 bfren
# Copyright (c) 2021-2024 bfren
#======================================================================================================================
<% fi %>
#======================================================================================================================
Expand Down Expand Up @@ -96,6 +96,9 @@ server {
include helpers/proxy-params.conf;
include helpers/proxy-secure-headers.conf;

# block AI bots
include helpers/nginx-block-ai-bots.conf;

<% if [ "${PROXY_ENABLE_NAXSI-}" = "1" ] ; then -%>
# enable NAXSI web application firewall with custom rules
include helpers/naxsi.conf;
Expand Down
4 changes: 4 additions & 0 deletions overlay/etc/nginx/helpers/nginx-block-ai-bots.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if ($http_user_agent ~* "(AdsBot-Google|Amazonbot|anthropic-ai|Applebot|Applebot-Extended|AwarioRssBot|AwarioSmartBot|Bytespider|CCBot|ChatGPT-User|Claude-Web|ClaudeBot|cohere-ai|DataForSeoBot|Diffbot|FacebookBot|FriendlyCrawler|Google-Extended|GoogleOther|GPTBot|ImagesiftBot|img2dataset|magpie-crawler|Meltwater|omgili|omgilibot|peer39_crawler|peer39_crawler/1.0|PerplexityBot|PiplBot|scoop.it|Seekr|SemrushBot|YandexBot|YouBot)"){
access_log off;
return 403;
}
11 changes: 11 additions & 0 deletions overlay/etc/periodic/weekly/clear-logs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/command/with-contenv bash

set -euo pipefail
export BF_E=`basename ${0}`


#======================================================================================================================
# Clear access and error logs to prevent files getting huge.
#======================================================================================================================

nginx-clear-logs
2 changes: 1 addition & 1 deletion overlay/tmp/NGINX_BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.0-r6
1.24.0-r7
12 changes: 12 additions & 0 deletions overlay/usr/bin/bf/nginx-clear-logs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/command/with-contenv sh

set -euo pipefail
export BF_E=`basename ${0}`


#======================================================================================================================
# Echo an empty string to access and error logs.
#======================================================================================================================

echo "" > /var/log/nginx/access.log
echo "" > /var/log/nginx/error.log
Loading