Skip to content
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

General All-Purpose Update and Refactoring #460

Draft
wants to merge 165 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
612a295
Update readme.md
Strong-Foundation Sep 27, 2024
e34feb5
Update license.md
Strong-Foundation Nov 27, 2024
d4feefc
Logic in client name.
Strong-Foundation Nov 28, 2024
05d0389
Updated Github Actions to update the blocked hosts file
Strong-Foundation Dec 24, 2024
8647b2c
Merge pull request #1 from Strong-Foundation/patch-1
Strong-Foundation Dec 24, 2024
fe36679
Merge branch 'main' into patch-2
Strong-Foundation Dec 24, 2024
b9817ff
Merge pull request #2 from Strong-Foundation/patch-2
Strong-Foundation Dec 24, 2024
3aaf5a3
Merge branch 'main' into patch-3
Strong-Foundation Dec 24, 2024
7e5a286
Merge pull request #3 from Strong-Foundation/patch-3
Strong-Foundation Dec 24, 2024
7f34346
Merge branch 'main' into patch-5
Strong-Foundation Dec 24, 2024
34f027b
Merge pull request #4 from Strong-Foundation/patch-5
Strong-Foundation Dec 24, 2024
3a0e238
Update shell-check-wireguard-manager.yml
Strong-Foundation Dec 24, 2024
2492aa2
Updated INIT systme
Strong-Foundation Dec 24, 2024
bf9a667
Merge branch 'main' into patch-6
Strong-Foundation Dec 24, 2024
9ce35cd
Update shell-check-wireguard-manager.yml
Strong-Foundation Dec 24, 2024
7042636
Merge branch 'main' into patch-6
Strong-Foundation Dec 24, 2024
2ef83ee
Merge pull request #5 from Strong-Foundation/patch-6
Strong-Foundation Dec 24, 2024
ef66db3
update
Strong-Foundation Dec 24, 2024
3660c21
Update named.cache: Wed Dec 25 00:56:33 UTC 2024
invalid-email-address Dec 25, 2024
1c92d7a
Create .gitignore
Strong-Foundation Dec 25, 2024
997af8f
Update .gitignore
Strong-Foundation Dec 25, 2024
dca8d14
Update deploy-github-pages.yml
Strong-Foundation Dec 25, 2024
1735ace
Merge branch 'main' into terraform
Strong-Foundation Dec 25, 2024
16b1e79
Create main.tf
Strong-Foundation Dec 25, 2024
5c93ab0
Update deploy-github-pages.yml
Strong-Foundation Dec 25, 2024
82362d0
Merge branch 'main' into terraform
Strong-Foundation Dec 25, 2024
7948bab
Update main.tf
Strong-Foundation Dec 25, 2024
a9580f7
Merge pull request #7 from Strong-Foundation/terraform
Strong-Foundation Dec 25, 2024
97a653e
updated github actions for terraform
Strong-Foundation Dec 25, 2024
7e48ae1
updated github actions for terraform
Strong-Foundation Dec 25, 2024
173ae06
updated github actions for terraform
Strong-Foundation Dec 25, 2024
496574d
Update
Strong-Foundation Dec 25, 2024
a1a555b
Update
Strong-Foundation Dec 25, 2024
70b5249
update
Strong-Foundation Dec 25, 2024
f7de93f
updated tf stuff
Strong-Foundation Dec 25, 2024
85a3833
Update .gitignore
Strong-Foundation Dec 25, 2024
d35ced4
Update main.tf
Strong-Foundation Dec 25, 2024
af64b6e
Update .gitignore
Strong-Foundation Dec 25, 2024
351db19
Update main.tf
Strong-Foundation Dec 25, 2024
d49f504
Update terraform-workflow.yml
Strong-Foundation Dec 25, 2024
d7e4d76
update code
Strong-Foundation Dec 25, 2024
a84a234
update
Strong-Foundation Dec 25, 2024
db565fb
update
Strong-Foundation Dec 25, 2024
ff0ee8b
update logic to .tf file
Strong-Foundation Dec 25, 2024
97ffb1e
update
Strong-Foundation Dec 25, 2024
9f33d69
Update wireguard-manager.sh
Strong-Foundation Dec 25, 2024
1b4681c
Update wireguard-manager.sh
Strong-Foundation Dec 25, 2024
7da3887
Update readme.md
Strong-Foundation Dec 25, 2024
4ab7291
Create nft.sh
Strong-Foundation Dec 26, 2024
1fc64d7
Create nftables-test.yml
Strong-Foundation Dec 26, 2024
78c4007
Create nftables-test.sh
Strong-Foundation Dec 26, 2024
ce6fbf3
Delete nftables-test.sh
Strong-Foundation Dec 26, 2024
a122c1e
Create nftables-test.sh
Strong-Foundation Dec 26, 2024
62720c0
Merge branch 'main' into nft
Strong-Foundation Dec 26, 2024
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
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
Loading