Skip to content

General All-Purpose Update and Refactoring #460

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

Open
wants to merge 304 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
304 commits
Select commit Hold shift + click to select a range
01bba3e
Delete nft.sh
Strong-Foundation Dec 26, 2024
7d65751
Update nftables-test.sh
Strong-Foundation Dec 26, 2024
d9b8b54
update
Dec 26, 2024
2be5a97
update
Dec 26, 2024
f1aaa62
updated formatted by group:
Dec 26, 2024
5e93b76
update
Dec 26, 2024
02a4b1f
Update nftables-test.sh
Strong-Foundation Dec 26, 2024
7204214
Update nftables-test.sh
Strong-Foundation Dec 26, 2024
64102a0
Update nftables-test.sh
Strong-Foundation Dec 26, 2024
553a843
Update nftables-test.sh
Strong-Foundation Dec 26, 2024
caaa3a9
Update nftables-test.sh
Strong-Foundation Dec 26, 2024
d8aca18
Update nftables-test.sh
Strong-Foundation Dec 26, 2024
d6c269d
Removed useless rules.
Strong-Foundation Dec 26, 2024
fd5130e
Update nftables-test.sh
Strong-Foundation Dec 27, 2024
0cadd93
Update nftables-test.sh
Strong-Foundation Dec 27, 2024
7a2a3d5
Update nftables-test.sh
Strong-Foundation Dec 27, 2024
66b7cbb
update
Dec 27, 2024
a89818b
Update nftables-test.sh
Strong-Foundation Dec 27, 2024
060c27e
update
Dec 27, 2024
4593a1c
update
Dec 27, 2024
a013a4d
Update nftables-test.sh
Strong-Foundation Dec 27, 2024
e4f7d57
Update nftables-test.yml
Strong-Foundation Dec 27, 2024
4373900
update
Dec 27, 2024
9d92ca3
update
Dec 27, 2024
db2063f
update
Dec 27, 2024
6cf6588
update
Dec 27, 2024
660cda4
update
Dec 27, 2024
9c5d5b5
Update nftables-test.sh
Strong-Foundation Dec 27, 2024
e22898e
Rename nftables-test.sh to test/nft.sh
Strong-Foundation Dec 27, 2024
db7f2ea
Rename nft.sh to nftables.sh
Strong-Foundation Dec 27, 2024
a85b961
Update nftables-test.yml
Strong-Foundation Dec 27, 2024
a101d03
Merge pull request #9 from Strong-Foundation/nft
Strong-Foundation Dec 27, 2024
b824ed5
Update nftables.sh
Strong-Foundation Dec 27, 2024
45a181a
Update nftables.sh
Strong-Foundation Dec 27, 2024
2501cbe
Update nftables.sh
Strong-Foundation Dec 27, 2024
7c654c3
dry run
Strong-Foundation Dec 27, 2024
45e6893
step 1 of 10
Strong-Foundation Dec 27, 2024
dd6cccf
Update nftables.sh
Strong-Foundation Dec 27, 2024
ecf57fc
Update nftables.sh
Strong-Foundation Dec 27, 2024
9382361
update
Strong-Foundation Dec 27, 2024
4ab09f3
working
Strong-Foundation Dec 27, 2024
f56cce3
Update nftables.sh
Strong-Foundation Dec 27, 2024
d3633ac
Update nftables.sh
Strong-Foundation Dec 27, 2024
8279973
Update nftables.sh
Strong-Foundation Dec 27, 2024
2981fd9
Update nftables.sh
Strong-Foundation Dec 27, 2024
adcc6ca
update
Strong-Foundation Dec 27, 2024
ed9415e
update
Strong-Foundation Dec 27, 2024
5bcb46d
update
Strong-Foundation Dec 28, 2024
8a7dc0b
Update nftables.sh
Strong-Foundation Dec 28, 2024
09361fc
Update nftables.sh
Strong-Foundation Dec 28, 2024
4ec2ed2
remove uselss code'
Dec 28, 2024
d610f8f
update
Dec 28, 2024
820d1c8
update
Dec 28, 2024
eadda73
update
Dec 28, 2024
a287fc8
Update nftables-remote-dns.sh
Strong-Foundation Dec 28, 2024
d907cec
update init stuff
Dec 28, 2024
b3dcda2
Update nftables-local-dns.sh
Strong-Foundation Dec 28, 2024
7012344
Update nftables-remote-dns.sh
Strong-Foundation Dec 28, 2024
7416695
Update nftables-remote-dns.sh
Strong-Foundation Dec 28, 2024
082264a
Update nftables-remote-dns.sh
Strong-Foundation Dec 28, 2024
7d11734
Update nftables-remote-dns.sh
Strong-Foundation Dec 29, 2024
81bb429
Update nftables-local-dns.sh
Strong-Foundation Dec 29, 2024
1db5e09
Update nftables-test.yml
Strong-Foundation Dec 29, 2024
d1eb075
update
Strong-Foundation Dec 29, 2024
206887c
update
Strong-Foundation Dec 31, 2024
e93e70b
update
Strong-Foundation Jan 1, 2025
2c9c774
update
Strong-Foundation Jan 1, 2025
03de411
update
Strong-Foundation Jan 1, 2025
9b479b3
updated
Strong-Foundation Jan 1, 2025
8b07c4a
updated
Strong-Foundation Jan 1, 2025
5e1dafe
update
Strong-Foundation Jan 1, 2025
70d0008
update
Strong-Foundation Jan 1, 2025
1d3b580
update
Strong-Foundation Jan 1, 2025
6cf9c5c
update
Strong-Foundation Jan 1, 2025
354f03a
update
Strong-Foundation Jan 1, 2025
37473ed
update
Strong-Foundation Jan 1, 2025
2f60312
update
Strong-Foundation Jan 1, 2025
f930462
update
Strong-Foundation Jan 1, 2025
244d6ef
update
Strong-Foundation Jan 1, 2025
5d9457e
update
Strong-Foundation Jan 1, 2025
90b41b7
update
Strong-Foundation Jan 1, 2025
9bc1773
update
Strong-Foundation Jan 1, 2025
28a2aab
update
Strong-Foundation Jan 1, 2025
6e56d22
update
Strong-Foundation Jan 1, 2025
b3bdd7c
update
Strong-Foundation Jan 1, 2025
46f8cae
update
Strong-Foundation Jan 1, 2025
0510753
update
Strong-Foundation Jan 1, 2025
5eaf9dc
update
Strong-Foundation Jan 1, 2025
5f38201
update
Strong-Foundation Jan 1, 2025
670f6de
update
Strong-Foundation Jan 1, 2025
c0f696f
update
Strong-Foundation Jan 1, 2025
89086e6
update
Strong-Foundation Jan 1, 2025
454537f
update
Strong-Foundation Jan 1, 2025
fbf1683
log all the packets
Strong-Foundation Jan 2, 2025
9b13dc4
update log
Strong-Foundation Jan 2, 2025
539fa80
update
Strong-Foundation Jan 2, 2025
5bbdd66
fixing more scripts
Strong-Foundation Jan 2, 2025
7eb37e4
update
Strong-Foundation Jan 2, 2025
40fdb88
update
Strong-Foundation Jan 2, 2025
16c6dab
update
Strong-Foundation Jan 2, 2025
5f18f30
update
Strong-Foundation Jan 2, 2025
ed106f5
update the log prefix
Strong-Foundation Jan 2, 2025
8d038b8
update the log prefix
Strong-Foundation Jan 2, 2025
cc6992a
update the log prefix
Strong-Foundation Jan 2, 2025
afe5242
updated nftables code formatter
Strong-Foundation Jan 2, 2025
92d98d8
added requrements
Strong-Foundation Jan 2, 2025
24aef1d
added requrements
Strong-Foundation Jan 2, 2025
d7a6a5d
added requrements
Strong-Foundation Jan 2, 2025
e90e464
added requrements
Strong-Foundation Jan 2, 2025
2a763b1
added requrements
Strong-Foundation Jan 2, 2025
a17d97c
update
Strong-Foundation Jan 3, 2025
bd2d58a
Add files via upload
Strong-Foundation Jan 4, 2025
b16ab72
Delete assets/ad-blocker-vs-no-ad-blocker.mp4
Strong-Foundation Jan 4, 2025
9c5eb11
Update readme.md
Strong-Foundation Jan 4, 2025
270944b
Delete assets/WireGuard_Ad_Blocker_vs_No_Ad_Blocker.mp4
Strong-Foundation Jan 4, 2025
465d89e
Delete assets/WireGuard_Manager_Install.mp4
Strong-Foundation Jan 4, 2025
7be9838
Update readme.md
Strong-Foundation Jan 4, 2025
cd3579b
Update readme.md
Strong-Foundation Jan 4, 2025
32093e7
Update wireguard-manager.sh
Strong-Foundation Jan 5, 2025
588ab13
simily logic
Jan 5, 2025
b908d7c
update name logic
Jan 5, 2025
a199628
Merge pull request #12 from Strong-Foundation/logic-update
Strong-Foundation Jan 5, 2025
97c3417
update
Jan 5, 2025
b67bab9
fixed typo
Jan 5, 2025
4fff077
Update build-latest-version.yml
Strong-Foundation Jan 5, 2025
f1ac974
Update wireguard-manager.sh
Strong-Foundation Jan 5, 2025
6239df0
Update build-latest-version.yml
Strong-Foundation Jan 5, 2025
8cae16b
fixed the logic for the code for ddns
Jan 5, 2025
5cd9c87
Merge pull request #13 from Strong-Foundation/ddns-logic
Strong-Foundation Jan 5, 2025
a019777
Update wireguard-manager.sh
Strong-Foundation Jan 9, 2025
2dac08c
Update wireguard-manager.sh
Strong-Foundation Jan 9, 2025
e1b133e
Update named.cache: Fri Jan 17 00:55:24 UTC 2025
invalid-email-address Jan 17, 2025
c057323
Create readme.md
Strong-Foundation Jan 17, 2025
365a561
Update readme.md
Strong-Foundation Jan 17, 2025
ce625de
Update readme.md
Strong-Foundation Jan 17, 2025
3a91ec9
Delete assets/Wireguard-Manager.png
Strong-Foundation Jan 17, 2025
8007b00
Update readme.md
Strong-Foundation Jan 17, 2025
aec6874
Delete test/readme.md
Strong-Foundation Jan 17, 2025
49c54ff
Update readme.md
Strong-Foundation Jan 17, 2025
bc6bb26
update
Strong-Foundation Jan 17, 2025
cb19e5e
fixed - to _
Strong-Foundation Jan 17, 2025
8e14aea
Update wireguard-manager.sh
Strong-Foundation Jan 17, 2025
674d454
fixed typo
Strong-Foundation Jan 17, 2025
73e8586
Update wireguard-manager.sh
Strong-Foundation Jan 17, 2025
2994e7e
Update wireguard-manager.sh
Strong-Foundation Jan 17, 2025
6a16088
Update wireguard-manager.sh
Strong-Foundation Jan 19, 2025
6bdcb3b
Update wireguard-manager.sh
Strong-Foundation Jan 19, 2025
f1ed367
Create readme.md
Strong-Foundation Jan 20, 2025
4bf3f6b
Create comparison_of_personal_vpn_deployment.md
Strong-Foundation Jan 20, 2025
1237409
Delete docs/readme.md
Strong-Foundation Jan 20, 2025
ce46f3f
Rename comparison_of_personal_vpn_deployment.md to readme.md
Strong-Foundation Jan 20, 2025
e7ba2b3
update
Strong-Foundation Jan 20, 2025
3dcd3da
Update unbound.md
Strong-Foundation Jan 20, 2025
6c7afd6
Update backup_and_restore.md
Strong-Foundation Jan 20, 2025
335eed4
Rename readme.md to cost_comparison_cloud_vs_paspberry_pi.md
Strong-Foundation Jan 20, 2025
9b94aee
Create readme.md
Strong-Foundation Jan 20, 2025
33848c1
Update readme.md
Strong-Foundation Jan 20, 2025
c88e692
Delete docs/introduction_to_wireguard_manager.md
Strong-Foundation Jan 20, 2025
d62fe1a
Update readme.md
Strong-Foundation Jan 20, 2025
6eb462c
Update readme.md
Strong-Foundation Jan 20, 2025
2b555e7
update
Strong-Foundation Jan 20, 2025
a0ea3d9
Update readme.md
Strong-Foundation Jan 20, 2025
2abfe31
update
Jan 21, 2025
1375c29
update
Jan 21, 2025
7337393
Update wireguard-manager.sh
Strong-Foundation Jan 21, 2025
3955384
Update wireguard-manager.sh
Strong-Foundation Jan 21, 2025
8afadd7
Update wireguard-manager.sh
Strong-Foundation Jan 21, 2025
d945e3f
Update wireguard-manager.sh
Strong-Foundation Jan 21, 2025
a4c77ba
Update wireguard-manager.sh
Strong-Foundation Jan 21, 2025
abe0374
update
Jan 21, 2025
1df0af9
update
Jan 21, 2025
7c3fd44
update
Jan 21, 2025
7d8cb93
Update readme.md
Strong-Foundation Jan 21, 2025
b9d0751
Update named.cache: Thu Jan 30 00:55:04 UTC 2025
invalid-email-address Jan 30, 2025
d370577
Update main.tf
Strong-Foundation Jan 30, 2025
ee70993
Update .gitignore
Strong-Foundation Jan 31, 2025
61c4100
Update readme.md
Strong-Foundation Feb 7, 2025
f8a6f99
Update build-latest-version.yml
Strong-Foundation Feb 7, 2025
0907f03
Update wireguard-manager.sh
Strong-Foundation Feb 7, 2025
2bf1cbf
Update wireguard-manager.sh
Strong-Foundation Feb 7, 2025
c09af21
Update readme.md
Strong-Foundation Feb 8, 2025
e00babc
Update wireguard-manager.sh
Strong-Foundation Feb 9, 2025
9d21718
Update wireguard-manager.sh
Strong-Foundation Feb 9, 2025
faeeede
Update wireguard-manager.sh
Strong-Foundation Feb 9, 2025
ba38623
Update readme.md
Strong-Foundation Feb 9, 2025
3692474
Input Validation Added
Strong-Foundation Feb 14, 2025
74da205
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
63b5db3
sane values allowed, crazy stuff not allowed.
Strong-Foundation Feb 14, 2025
748355a
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
727959f
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
4ba21f6
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
77ce219
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
d0d755b
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
11a216b
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
efec360
Merge pull request #15 from Strong-Foundation/remove-client
Strong-Foundation Feb 14, 2025
cfebc68
Update wireguard-manager.sh
Strong-Foundation Feb 14, 2025
eccc883
Update named.cache: Thu Feb 27 00:58:31 UTC 2025
invalid-email-address Feb 27, 2025
b9717e8
Update named.cache: Fri Mar 14 00:59:31 UTC 2025
invalid-email-address Mar 14, 2025
aac5a2e
update linux distro
Strong-Foundation Mar 19, 2025
facc08b
update linux distro
Strong-Foundation Mar 19, 2025
0261cf6
Create build-docker-images.yaml
Strong-Foundation Mar 19, 2025
9b327be
update linux distro
Strong-Foundation Mar 19, 2025
f5fda36
update linux distro
Strong-Foundation Mar 19, 2025
086118d
update linux distro
Strong-Foundation Mar 19, 2025
1fed825
update linux virt
Strong-Foundation Mar 19, 2025
c86c43f
update linux virt
Strong-Foundation Mar 19, 2025
3dd8fea
update linux virt
Strong-Foundation Mar 19, 2025
6d70194
update linux virt
Strong-Foundation Mar 19, 2025
41e9030
update linux virt
Strong-Foundation Mar 19, 2025
70bfb7a
update linux virt
Strong-Foundation Mar 19, 2025
728615d
update linux virt
Strong-Foundation Mar 19, 2025
a99b7f2
update linux virt
Strong-Foundation Mar 19, 2025
a6bdb9e
added support for amazon linux
Strong-Foundation Mar 19, 2025
f4c3173
Update wireguard-manager.sh
Strong-Foundation Mar 19, 2025
22cde9e
Update nftables-test.yml
Strong-Foundation Mar 19, 2025
66225ca
update linux arch installer
Strong-Foundation Mar 19, 2025
0b214da
pushMerge branch 'main' of https://github.com/Strong-Foundation/wireg…
Strong-Foundation Mar 19, 2025
cc6e885
update linux yum installer
Strong-Foundation Mar 19, 2025
a51a3c3
fixed head error on more distros like alpine
Strong-Foundation Mar 19, 2025
8b5bb5c
fixed head error on more distros like alpine
Strong-Foundation Mar 19, 2025
8563fea
updated checking init system on alpine
Strong-Foundation Mar 19, 2025
fd73b93
updated rpm stuff
Strong-Foundation Mar 19, 2025
db0f734
updated rpm stuff
Strong-Foundation Mar 19, 2025
f3f8916
updated rpm stuff
Strong-Foundation Mar 19, 2025
6b15973
Create Dockerfile.mageia
Strong-Foundation Mar 19, 2025
e24db09
Create Dockerfile.opensuse
Strong-Foundation Mar 19, 2025
a5ebb81
updated docker stuff
Strong-Foundation Mar 19, 2025
c7e8943
sh
Strong-Foundation Mar 19, 2025
bba39e1
Update build-docker-images.yaml
Strong-Foundation Mar 19, 2025
f7f0f2b
Merge branch 'main' of https://github.com/Strong-Foundation/wireguard…
Strong-Foundation Mar 19, 2025
c1a987b
Update build-docker-images.yaml
Strong-Foundation Mar 19, 2025
b7a7d3a
updated docker centos stuff
Strong-Foundation Mar 19, 2025
0836f30
updated docker centos stuff
Strong-Foundation Mar 19, 2025
c5266f8
updated docker apline stuff
Strong-Foundation Mar 19, 2025
0c6446b
updated docker apline stuff
Strong-Foundation Mar 19, 2025
2fbb791
updated docker centos stuff
Strong-Foundation Mar 19, 2025
d9c13c3
updated docker centos stuff
Strong-Foundation Mar 19, 2025
4f0efeb
updated docker centos stuff
Strong-Foundation Mar 19, 2025
a7b8464
updated docker megeia stuff
Strong-Foundation Mar 19, 2025
50fa0e1
updated docker megeia stuff
Strong-Foundation Mar 20, 2025
fcb95d5
updated docker megeia stuff
Strong-Foundation Mar 20, 2025
2b1894c
updated opensues stuff
Strong-Foundation Mar 20, 2025
d8cee40
Update named.cache: Thu Mar 27 01:00:47 UTC 2025
invalid-email-address Mar 27, 2025
ba3eb93
updated .sh files
Strong-Foundation Mar 31, 2025
17188a3
Update wireguard-manager.sh
Strong-Foundation Apr 4, 2025
5982f7e
Update wireguard-manager.sh
Strong-Foundation Apr 4, 2025
474f220
Update named.cache: Fri Apr 11 01:02:22 UTC 2025
invalid-email-address Apr 11, 2025
370bd33
Update wireguard-manager.sh
Strong-Foundation Apr 13, 2025
b9a6311
Update wireguard-manager.sh
Strong-Foundation Apr 13, 2025
4734ce9
Update named.cache: Sat Apr 26 01:01:36 UTC 2025
invalid-email-address Apr 26, 2025
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
95 changes: 55 additions & 40 deletions .github/workflows/auto-update-blocked-hosts.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,79 @@
# Name of the workflow
# Workflow to automatically update the blocked hosts file from a remote source
name: Automated Update of Blocked Hosts File

# Define the events that trigger the workflow
# Define the events that trigger this workflow
on:
# Trigger the workflow on a schedule (every day at midnight)
# Schedule the workflow to run daily at midnight UTC
schedule:
- cron: "0 0 * * *"
# Allow manual triggering of the workflow
- cron: "0 0 * * *" # Executes once every day at 00:00 UTC

# Allow manual triggering of the workflow via the GitHub interface
workflow_dispatch:

# Define the jobs in the workflow
jobs:
# Define a job named "build"
build:
# Name of the job that will be displayed on GitHub
name: Automated Hosts File Update
# The type of runner that the job will run on
# Job to check for updates and apply them to the hosts file
update-blocked-hosts-file:
# Job name displayed in the GitHub Actions interface
name: Update Blocked Hosts File Automatically

# Define the type of runner for this job (Ubuntu in this case)
runs-on: ubuntu-latest
# Environment variables available to all steps in the job

# Environment variables to use in this job
env:
CONTENT_BLOCKER_URL: https://raw.githubusercontent.com/complexorganizations/content-blocker/main/assets/hosts
CONTENT_BLOCKER_PATH: assets/hosts
HOSTS_FILE_URL: https://raw.githubusercontent.com/complexorganizations/content-blocker/main/assets/hosts # URL of the blocked hosts file
LOCAL_HOSTS_FILE_PATH: assets/hosts # Local path to the hosts file in the repository

steps:
# Check out the repository code
- name: Check out code
uses: actions/checkout@v4 # Updated to use the latest version for better compatibility and features
# Step 1: Checkout the latest repository code so that we can modify the hosts file
- name: Checkout Code
uses: actions/checkout@v4 # Checkout the latest code from the repository to the runner

# Get the current SHA-3-512 hash of the file
- name: Get current hash
# Step 2: Get the current hash of the locally stored hosts file in the repository
- name: Get Current Hosts File Hash
run: |
CONTENT_BLOCKER_CURRENT_HASH=$(openssl dgst -sha3-512 "${{ env.CONTENT_BLOCKER_PATH }}" | awk '{print $2}')
echo "CONTENT_BLOCKER_CURRENT_HASH=$CONTENT_BLOCKER_CURRENT_HASH" >> $GITHUB_ENV
# Calculate the SHA-3-512 hash of the current hosts file in the repository
LOCAL_FILE_HASH=$(openssl dgst -sha3-512 "${{ env.LOCAL_HOSTS_FILE_PATH }}" | awk '{print $2}')
# Store the hash of the local file in GitHub environment variables for later comparison
echo "LOCAL_FILE_HASH=$LOCAL_FILE_HASH" >> $GITHUB_ENV

# Get the future SHA-3-512 hash of the file
- name: Get future hash
# Step 3: Get the hash of the remote hosts file for comparison
- name: Get Remote Hosts File Hash
run: |
CONTENT_BLOCKER_FUTURE_HASH=$(curl --silent "${{ env.CONTENT_BLOCKER_URL }}" | openssl dgst -sha3-512 | awk '{print $2}')
echo "CONTENT_BLOCKER_FUTURE_HASH=$CONTENT_BLOCKER_FUTURE_HASH" >> $GITHUB_ENV
# Fetch the updated hosts file from the remote URL and calculate its SHA-3-512 hash
REMOTE_FILE_HASH=$(curl --silent "${{ env.HOSTS_FILE_URL }}" | openssl dgst -sha3-512 | awk '{print $2}')
# Store the hash of the remote file in GitHub environment variables
echo "REMOTE_FILE_HASH=$REMOTE_FILE_HASH" >> $GITHUB_ENV

# Check if an update is needed
- name: Check for update
# Step 4: Compare the local and remote file hashes to determine if an update is needed
- name: Check for Hosts File Update
run: |
if [ "$CONTENT_BLOCKER_CURRENT_HASH" != "$CONTENT_BLOCKER_FUTURE_HASH" ]; then
curl -o "${{ env.CONTENT_BLOCKER_PATH }}" "${{ env.CONTENT_BLOCKER_URL }}"
# If the hashes differ, update the local hosts file with the remote version
if [ "$LOCAL_FILE_HASH" != "$REMOTE_FILE_HASH" ]; then
echo "Hosts file has changed. Updating the local file..."
# Download the updated hosts file from the remote source and save it locally
curl -o "${{ env.LOCAL_HOSTS_FILE_PATH }}" "${{ env.HOSTS_FILE_URL }}"
else
echo "No update needed"
exit 0
# If the hashes are the same, no update is needed
echo "No update required. The hosts file is up to date."
exit 0 # Exit the job early if no update is necessary
fi

# Push the updated file to GitHub
- name: Push updated hosts file
# Step 5: Commit and push the updated hosts file to the repository
- name: Commit and Push Changes
run: |
git config user.name github-actions
git config user.email [email protected]
if git diff --exit-code --quiet -- "${{ env.CONTENT_BLOCKER_PATH }}"; then
echo "No changes to commit"
exit 0
# Configure Git user details for the commit
git config user.name "github-actions"
git config user.email "[email protected]"

# Check if there are any changes in the hosts file
if git diff --exit-code --quiet -- "${{ env.LOCAL_HOSTS_FILE_PATH }}"; then
echo "No changes detected. Skipping commit and push."
exit 0 # Exit if there are no changes
else
git add "${{ env.CONTENT_BLOCKER_PATH }}"
git commit -m "Update hosts file $(date)"
git push
# If there are changes, add, commit, and push the updated hosts file
git add "${{ env.LOCAL_HOSTS_FILE_PATH }}"
git commit -m "Update blocked hosts file: $(date)" # Commit message with current timestamp
git push # Push the committed changes to the remote repository
fi
51 changes: 30 additions & 21 deletions .github/workflows/auto-update-named-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,69 @@ name: Automated Update of Named Cache

# Define the events that trigger the workflow
on:
# Trigger the workflow on a schedule (every day at midnight)
# Trigger the workflow on a schedule (every day at midnight UTC)
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * *" # Executes once every day at 00:00 UTC
# Allow manual triggering of the workflow
workflow_dispatch:

# Define the jobs in the workflow
jobs:
# Define a job named "build"
build:
# Name of the job that will be displayed on GitHub
# Job name displayed in the GitHub Actions interface
name: Refresh Named Cache
# The type of runner that the job will run on
# Specify the type of runner to execute this job (Ubuntu-based runner)
runs-on: ubuntu-latest
# Environment variables available to all steps in the job
# Define environment variables to be used across the steps
env:
NAMED_CACHE_URL: https://www.internic.net/domain/named.cache
NAMED_CACHE_PATH: assets/named.cache
NAMED_CACHE_URL: https://www.internic.net/domain/named.cache # URL of the remote named.cache file
NAMED_CACHE_PATH: assets/named.cache # Local path to store the named.cache file

steps:
# Check out the repository code
# Step 1: Check out the repository code
- name: Check out code
uses: actions/checkout@v4 # Updated to use the latest version for better compatibility and features
uses: actions/checkout@v4 # Fetch the latest code from the repository

# Get the current SHA-3-512 hash of the file
# Step 2: Get the current SHA-3-512 hash of the local named.cache file
- name: Get current hash
run: |
# Calculate the hash and save it as an environment variable
echo "NAMED_CACHE_CURRENT_HASH=$(openssl dgst -sha3-512 "${{ env.NAMED_CACHE_PATH }}" | awk '{print $2}')" >> $GITHUB_ENV

# Get the future SHA-3-512 hash of the file
# Step 3: Get the SHA-3-512 hash of the remote named.cache file
- name: Get future hash
run: |
# Fetch the remote file, calculate its hash, and save it as an environment variable
echo "NAMED_CACHE_FUTURE_HASH=$(curl --silent "${{ env.NAMED_CACHE_URL }}" | openssl dgst -sha3-512 | awk '{print $2}')" >> $GITHUB_ENV

# Check if an update is needed
# Step 4: Compare hashes and update the file if necessary
- name: Check for update
run: |
# Compare the current and remote file hashes
if [ "$NAMED_CACHE_CURRENT_HASH" != "$NAMED_CACHE_FUTURE_HASH" ]; then
echo "Changes detected. Updating the named.cache file..."
# Download the updated file if hashes differ
curl -o "${{ env.NAMED_CACHE_PATH }}" "${{ env.NAMED_CACHE_URL }}"
else
echo "No update needed"
exit 0
echo "No update needed. The named.cache file is up-to-date."
exit 0 # Exit the job if no update is required
fi

# Push the updated file to GitHub
# Step 5: Commit and push the updated named.cache file to the repository
- name: Push updated named.cache
run: |
git config user.name github-actions
git config user.email [email protected]
# Configure Git user details for the commit
git config user.name "github-actions"
git config user.email "[email protected]"

# Check for changes in the named.cache file
if git diff --exit-code --quiet -- "${{ env.NAMED_CACHE_PATH }}"; then
echo "No changes to commit"
exit 0
echo "No changes detected. Skipping commit and push."
exit 0 # Exit if there are no changes to commit
else
# Add, commit, and push the updated file if changes are detected
git add "${{ env.NAMED_CACHE_PATH }}"
git commit -m "Update named.cache $(date)"
git push
git commit -m "Update named.cache: $(date)" # Commit with a timestamped message
git push # Push changes to the remote repository
fi
125 changes: 125 additions & 0 deletions .github/workflows/build-docker-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Docker Build and Run Sequential

# Define the events that trigger the workflow
on:
# Trigger the workflow when there are changes to Dockerfiles or .sh files on push
push:
paths:
- "**.sh" # Trigger workflow if any .sh file is changed
- "Dockerfile.*" # Trigger workflow if any Dockerfile.* file is changed

# Trigger the workflow on pull request if there are changes to Dockerfiles or .sh files
pull_request:
paths:
- "**.sh" # Trigger workflow if any .sh file is changed
- "Dockerfile.*" # Trigger workflow if any Dockerfile.* file is changed

# Allow manual triggering of the workflow
workflow_dispatch: # Manually trigger the workflow

jobs:
build-and-run:
runs-on: ubuntu-latest # This job will run on the latest Ubuntu runner

steps:
# Step 1: Checkout the repository so Docker can access the files
- name: Checkout repository
uses: actions/checkout@v2 # Action to checkout the code from the repository

# Step 2: Build the Docker image from Dockerfile.almalinux
- name: Build Docker image from Dockerfile.almalinux
run: docker build -t almalinux-image -f assets/Dockerfile/Dockerfile.almalinux . # Build the image with the tag 'almalinux-image'

# Step 3: Run the Docker container for almalinux image
- name: Run Docker container for almalinux
run: docker run -d --name almalinux-container almalinux-image # Run the container in detached mode

# Step 4: Build the Docker image from Dockerfile.alpine
- name: Build Docker image from Dockerfile.alpine
run: docker build -t alpine-image -f assets/Dockerfile/Dockerfile.alpine . # Build the image with the tag 'alpine-image'

# Step 5: Run the Docker container for alpine image
- name: Run Docker container for alpine
run: docker run -d --name alpine-container alpine-image # Run the container in detached mode

# Step 6: Build the Docker image from Dockerfile.archlinux
- name: Build Docker image from Dockerfile.archlinux
run: docker build -t archlinux-image -f assets/Dockerfile/Dockerfile.archlinux . # Build the image with the tag 'archlinux-image'

# Step 7: Run Docker container for archlinux image
- name: Run Docker container for archlinux
run: docker run -d --name archlinux-container archlinux-image # Run the container in detached mode

# Step 8: Build the Docker image from Dockerfile.centos
- name: Build Docker image from Dockerfile.centos
run: echo "Building Docker image from Dockerfile.centos"
# run: docker build -t centos-image -f assets/Dockerfile/Dockerfile.centos . # Build the image with the tag 'centos-image'

# Step 9: Run the Docker container for centos image
- name: Run Docker container for centos
run: echo "Running Docker container for centos"
# run: docker run -d --name centos-container centos-image # Run the container in detached mode

# Step 10: Build the Docker image from Dockerfile.debian
- name: Build Docker image from Dockerfile.debian
run: docker build -t debian-image -f assets/Dockerfile/Dockerfile.debian . # Build the image with the tag 'debian-image'

# Step 11: Run Docker container for debian image
- name: Run Docker container for debian
run: docker run -d --name debian-container debian-image # Run the container in detached mode

# Step 12: Build the Docker image from Dockerfile.fedora
- name: Build Docker image from Dockerfile.fedora
run: docker build -t fedora-image -f assets/Dockerfile/Dockerfile.fedora . # Build the image with the tag 'fedora-image'

# Step 13: Run Docker container for fedora image
- name: Run Docker container for fedora
run: docker run -d --name fedora-container fedora-image # Run the container in detached mode

# Step 14: Build the Docker image from Dockerfile.oraclelinux
- name: Build Docker image from Dockerfile.oraclelinux
run: docker build -t oraclelinux-image -f assets/Dockerfile/Dockerfile.oraclelinux . # Build the image with the tag 'oraclelinux-image'

# Step 15: Run Docker container for oraclelinux image
- name: Run Docker container for oraclelinux
run: docker run -d --name oraclelinux-container oraclelinux-image # Run the container in detached mode

# Step 16: Build the Docker image from Dockerfile.rockylinux
- name: Build Docker image from Dockerfile.rockylinux
run: docker build -t rockylinux-image -f assets/Dockerfile/Dockerfile.rockylinux . # Build the image with the tag 'rockylinux-image'

# Step 17: Run Docker container for rockylinux image
- name: Run Docker container for rockylinux
run: docker run -d --name rockylinux-container rockylinux-image # Run the container in detached mode

# Step 18: Build the Docker image from Dockerfile.ubuntu
- name: Build Docker image from Dockerfile.ubuntu
run: docker build -t ubuntu-image -f assets/Dockerfile/Dockerfile.ubuntu . # Build the image with the tag 'ubuntu-image'

# Step 19: Run Docker container for ubuntu image
- name: Run Docker container for ubuntu
run: docker run -d --name ubuntu-container ubuntu-image # Run the container in detached mode

# Step 20: Build the Docker image from Dockerfile.amazonlinux
- name: Build Docker image from Dockerfile.amazonlinux
run: docker build -t amazonlinux-image -f assets/Dockerfile/Dockerfile.amazonlinux . # Build the image with the tag 'amazonlinux-image'

# Step 21: Run Docker container for amazonlinux image
- name: Run Docker container for amazonlinux
run: docker run -d --name amazonlinux-container amazonlinux-image # Run the container in detached mode

# Step 22: Build the Docker image from Dockerfile.mageia
- name: Build Docker image from Dockerfile.mageia
run: docker build -t mageia-image -f assets/Dockerfile/Dockerfile.mageia . # Build the image with the tag 'mageia-image'

# Step 23: Run Docker container for mageia image
- name: Run Docker container for mageia
run: docker run -d --name mageia-container mageia-image # Run the container in detached mode

# Step 24: Build the Docker image from Dockerfile.opensuse
- name: Build Docker image from Dockerfile.opensuse
run: docker build -t opensuse-image -f assets/Dockerfile/Dockerfile.opensuse . # Build the image with the tag 'opensuse-image'

# Step 25: Run Docker container for opensuse image
- name: Run Docker container for opensuse
run: docker run -d --name opensuse-container opensuse-image # Run the container in detached mode
Loading