<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Firewall / Spamassassin: Automatic list update]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a> explained <a href="https://forum.cloudron.io/post/19901">how to block IP ranges from certain countries</a><br />
I think it would be useful if such lists (e.g. from <a href="https://www.ipdeny.com/ipblocks/" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.ipdeny.com/ipblocks/</a>) could be kept updated automatically, e.g. by running an update script regularly.</p>
<p dir="auto">The same applies for spamassassin lists, e.g. the excellent <a href="https://www.heinlein-support.de/blog/news/aktuelle-spamassassin-regeln-von-heinlein-support/" target="_blank" rel="noopener noreferrer nofollow ugc">Spamassassin lists from Heinlein</a> who runs <a href="http://www.mailbox.org" target="_blank" rel="noopener noreferrer nofollow ugc">www.mailbox.org</a></p>
]]></description><link>https://forum.cloudron.io/topic/3795/firewall-spamassassin-automatic-list-update</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Nov 2026 13:39:15 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/3795.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Nov 2020 13:17:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Fri, 28 Feb 2025 16:54:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/necrevistonnezr" aria-label="Profile: necrevistonnezr">@<bdi>necrevistonnezr</bdi></a> I was looking in the forum <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f926.png?v=b6971addb6c" class="not-responsive emoji emoji-android emoji--face_palm" style="height:1.4em;width:auto;vertical-align:middle" title=":face_palm:" alt="🤦" />  Thank you!</p>
]]></description><link>https://forum.cloudron.io/post/102447</link><guid isPermaLink="true">https://forum.cloudron.io/post/102447</guid><dc:creator><![CDATA[humpty]]></dc:creator><pubDate>Fri, 28 Feb 2025 16:54:27 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Fri, 28 Feb 2025 15:14:24 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://docs.cloudron.io/guides/community/" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.cloudron.io/guides/community/</a></p>
]]></description><link>https://forum.cloudron.io/post/102446</link><guid isPermaLink="true">https://forum.cloudron.io/post/102446</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Fri, 28 Feb 2025 15:14:24 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Fri, 28 Feb 2025 14:18:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/necrevistonnezr" aria-label="Profile: necrevistonnezr">@<bdi>necrevistonnezr</bdi></a> link to the guide, pretty please!</p>
]]></description><link>https://forum.cloudron.io/post/102441</link><guid isPermaLink="true">https://forum.cloudron.io/post/102441</guid><dc:creator><![CDATA[humpty]]></dc:creator><pubDate>Fri, 28 Feb 2025 14:18:05 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Fri, 05 Jul 2024 10:30:58 GMT]]></title><description><![CDATA[<p dir="auto">... thought I got a "Failed pipeline for master | 3dbdac62" notification... <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=b6971addb6c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forum.cloudron.io/post/90948</link><guid isPermaLink="true">https://forum.cloudron.io/post/90948</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Fri, 05 Jul 2024 10:30:58 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Fri, 05 Jul 2024 08:45:12 GMT]]></title><description><![CDATA[<p dir="auto">With <a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a> permission, I created a community guide from this thread...</p>
]]></description><link>https://forum.cloudron.io/post/90943</link><guid isPermaLink="true">https://forum.cloudron.io/post/90943</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Fri, 05 Jul 2024 08:45:12 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Fri, 12 Jan 2024 11:15:51 GMT]]></title><description><![CDATA[<p dir="auto">Super!<br />
I have used this script now via <code>cron</code> and everything seems to work fine, including a significant reduction of "denied" mail attempts in the mail log.</p>
<p dir="auto">I've added the following lines to keep the last 20 url lists, compressed with 7z (which I prefer for compression), for analysis (if needed):</p>
<pre><code>7z a -mx9 "${current_datetime}.7z" "formatted_$output_file"
rm "formatted_$output_file"
rm "$output_file"
ls -td *.7z | grep -v '/$' | tail -n +20 | while IFS= read -r f; do rm -f "$f"; do&gt;
</code></pre>
<p dir="auto">Also: If you use the script, don't just blindly add url-lists. I already managed to lock myself out once by adding the "standard" Firehol list (<a href="https://iplists.firehol.org/files/firehol_level1.netset" target="_blank" rel="noopener noreferrer nofollow ugc">https://iplists.firehol.org/files/firehol_level1.netset</a>)</p>
]]></description><link>https://forum.cloudron.io/post/80954</link><guid isPermaLink="true">https://forum.cloudron.io/post/80954</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Fri, 12 Jan 2024 11:15:51 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Thu, 11 Jan 2024 09:40:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/necrevistonnezr" aria-label="Profile: necrevistonnezr">@<bdi>necrevistonnezr</bdi></a> said in <a href="/post/80894">Firewall / Spamassassin: Automatic list update</a>:</p>
<blockquote>
<p dir="auto">after doing the latter it worked</p>
</blockquote>
<p dir="auto">aha ok, I always use <code>./script.sh</code></p>
<p dir="auto">indeed <code>output.txt</code> also with me contains no data, as I read the script the right way it should contain errors during <code>wget</code></p>
]]></description><link>https://forum.cloudron.io/post/80896</link><guid isPermaLink="true">https://forum.cloudron.io/post/80896</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Thu, 11 Jan 2024 09:40:18 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Thu, 11 Jan 2024 08:46:15 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f926.png?v=b6971addb6c" class="not-responsive emoji emoji-android emoji--face_palm" style="height:1.4em;width:auto;vertical-align:middle" title=":face_palm:" alt="🤦" /> I executed the script with <code>sh script.sh</code> instead of <code>bash script.sh</code> - after doing the latter it worked!<br />
Thanks again.</p>
<p dir="auto">BTW the <code>output.txt</code> only contains <code>{}</code>...?</p>
]]></description><link>https://forum.cloudron.io/post/80894</link><guid isPermaLink="true">https://forum.cloudron.io/post/80894</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Thu, 11 Jan 2024 08:46:15 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Thu, 11 Jan 2024 08:26:49 GMT]]></title><description><![CDATA[<p dir="auto">Sorry for the Dutch language in the script, ChatGPT is wonderfully writing Dutch without asking haha.</p>
<p dir="auto">Strange it doesn't seem to work, I extended the script later to upload it in one run to 3 different Cloudrons and that also works perfect. The part of creating the <code>temp_data.txt</code> is exactly the same.</p>
<ul>
<li>Do you see the prompt "# Upload to Cloudron Blocklist API with wget..."?</li>
<li>What happens after that prompt is showed?</li>
<li>It takes with these lists about 1,5 minute (on a AMD EPYC 7702P 64-Core Processor with 32GB memory) to process it via API so you have to have some patience <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60a.png?v=b6971addb6c" class="not-responsive emoji emoji-android emoji--blush" style="height:1.4em;width:auto;vertical-align:middle" title=":blush:" alt="😊" />  (This is however exactly the same time like when you use the copy/paste in the GUI).</li>
<li>After the script is finished the <code>temp_data.txt</code> is deleted, did the script ever finished?</li>
<li>I execute the script in a LAMP app (on one of the Cloudrons) with only 256MB memory</li>
<li>last maybe a stupid question but you've set the API token to "read/write"?</li>
</ul>
<p dir="auto">I just executed the script (my 3 Cloudrons version) en after about 5 minutes all 3 Cloudrons had the new lists with 60562 IPs (ranges) blocked.</p>
]]></description><link>https://forum.cloudron.io/post/80892</link><guid isPermaLink="true">https://forum.cloudron.io/post/80892</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Thu, 11 Jan 2024 08:26:49 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Wed, 10 Jan 2024 08:21:44 GMT]]></title><description><![CDATA[<p dir="auto">Thanks again!<br />
I just tried this - it generated <code>merged_list_20240110_091244.txt</code> and <code>formatted_merged_list_20240110_091244.txt</code> but somehow, the <code>temp_data.txt</code> is not generated, and therefore the upload is not successful?</p>
<p dir="auto">BTW, here's your script with english comments and filenames:</p>
<pre><code>#!/bin/bash

# Current date and time
current_datetime=$(date +"%Y%m%d_%H%M%S")

# Array containing the URLs of the IP lists and their descriptions
declare -a urls=(
	"https://iplists.firehol.org/files/spamhaus_drop.netset,Spamhaus - Drop"
        "https://iplists.firehol.org/files/spamhaus_edrop.netset,Spamhaus - eDrop"
        "https://www.ipdeny.com/ipblocks/data/aggregated/af-aggregated.zone,AF - Afganistan"
        "https://www.ipdeny.com/ipblocks/data/aggregated/bd-aggregated.zone,BD - Bangladesh"
        "https://www.ipdeny.com/ipblocks/data/aggregated/by-aggregated.zone,BY - Belarus"
        "https://www.ipdeny.com/ipblocks/data/aggregated/br-aggregated.zone,BR - Brazil"
        "https://www.ipdeny.com/ipblocks/data/aggregated/cn-aggregated.zone,CN - China"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ir-aggregated.zone,IR - Iran"
        "https://www.ipdeny.com/ipblocks/data/aggregated/in-aggregated.zone,IN - India"
        "https://www.ipdeny.com/ipblocks/data/aggregated/kp-aggregated.zone,KP - North Korea"
        "https://www.ipdeny.com/ipblocks/data/aggregated/np-aggregated.zone,NP - Nepal"
        "https://www.ipdeny.com/ipblocks/data/aggregated/pk-aggregated.zone,PK - Pakistan"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ro-aggregated.zone,RO - Romania"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ru-aggregated.zone,RU - Russia"
        "https://www.ipdeny.com/ipblocks/data/aggregated/sg-aggregated.zone,SG - Singapore"
        "https://www.ipdeny.com/ipblocks/data/aggregated/sy-aggregated.zone,SY - Syria"
        "https://www.ipdeny.com/ipblocks/data/aggregated/tr-aggregated.zone,TR - Turkey"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ua-aggregated.zone,UA - Ukraine"
        "https://www.ipdeny.com/ipblocks/data/aggregated/vn-aggregated.zone,VN - Vietnam"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/af-aggregated.zone,AF - Afganistan"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/bd-aggregated.zone,BD - Bangladesh"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/by-aggregated.zone,BY - Belarus"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/br-aggregated.zone,BR - Brazil"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/cn-aggregated.zone,CN - China"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ir-aggregated.zone,IR - Iran"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/in-aggregated.zone,IN - India"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/np-aggregated.zone,NP - Nepal"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/pk-aggregated.zone,PK - Pakistan"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ro-aggregated.zone,RO - Romania"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ru-aggregated.zone,RU - Russia"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/sg-aggregated.zone,SG - Singapore"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/sy-aggregated.zone,SY - Syria"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/tr-aggregated.zone,TR - Turkey"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ua-aggregated.zone,UA - Ukraine"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/vn-aggregated.zone,VN - Vietnam"
)

# File name with the current date and time
output_file="merged_list_${current_datetime}.txt"

# Download and merge the IP lists
for url_info in "${urls[@]}"
do
    # Splitting the URL information
    IFS=',' read -r url description &lt;&lt;&lt; "$url_info"

    # Add comment with the URL and description
    echo "# URL: $url" &gt;&gt; "$output_file"
    echo "# Description: $description" &gt;&gt; "$output_file"

    echo "Download IP list from $url"
    # Download the IP list and add it to the file
    curl -sS "$url" &gt;&gt; "$output_file"
done

echo "Merge completed! The merged list is stored in $output_file"

# Formatting the file for the Cloudron Blocklist API
formatted_file="formatted_$output_file"

# # Add "\n" to the end of each line
awk '{printf "%s\\n",$0}' "$output_file" &gt; "$formatted_file"

# Cloudron Blocklist API endpoint
cloudron_api_endpoint="https://yourcloudrondomain.com/api/v1/network/blocklist"

# API Key for authentication (replace 'your-api-key' with your API key)
api_key="your-api-key"

# Upload to Cloudron Blocklist API with wget
echo "# Upload to Cloudron Blocklist API with wget..."

# The data in the required format for the API
data="{\"blocklist\":\"$(cat "$formatted_file" | tr '\n' '\\n')\"}"

# Send the file with a POST request via wget
echo "$data"&gt; temp_data.txt
wget --method=POST --header="Content-Type: application/json" --header="Authorization: Bearer $api_key" --body-file=temp_data.txt "$cloudron_api_endpoint" --quiet --output-document=output.txt

# Show the output of wget
cat output.txt

# Delete temporary files
rm temp_data.txt
</code></pre>
]]></description><link>https://forum.cloudron.io/post/80825</link><guid isPermaLink="true">https://forum.cloudron.io/post/80825</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Wed, 10 Jan 2024 08:21:44 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Sat, 06 Jan 2024 07:45:24 GMT]]></title><description><![CDATA[<p dir="auto">Every time you execute the script the existing list is replaced by the newly generated version. There might be duplicates at generating the list because IP’s from the first two URL’s can exist in the later ones but that’s not a problem for me.</p>
]]></description><link>https://forum.cloudron.io/post/80574</link><guid isPermaLink="true">https://forum.cloudron.io/post/80574</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Sat, 06 Jan 2024 07:45:24 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Sat, 06 Jan 2024 06:45:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a> thanks for this! Have you seen duplicate entries if you apply the method more than once?</p>
]]></description><link>https://forum.cloudron.io/post/80571</link><guid isPermaLink="true">https://forum.cloudron.io/post/80571</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Sat, 06 Jan 2024 06:45:27 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Wed, 27 Dec 2023 11:28:48 GMT]]></title><description><![CDATA[<p dir="auto">use at your own risk and be aware that with this long list it takes 1,5 minute to process the API call (same as in the GUI), replace the API input and copy/paste it in a .sh file (don't forget to make it executable). It's works but it's not perfect.</p>
<pre><code>#!/bin/bash

# Huidige datum en tijd
current_datetime=$(date +"%Y%m%d_%H%M%S")

# Array met de URL's van de IP-lijsten en hun beschrijvingen
declare -a urls=(
	"https://iplists.firehol.org/files/spamhaus_drop.netset,Spamhaus - Drop"
        "https://iplists.firehol.org/files/spamhaus_edrop.netset,Spamhaus - eDrop"
        "https://www.ipdeny.com/ipblocks/data/aggregated/af-aggregated.zone,AF - Afganistan"
        "https://www.ipdeny.com/ipblocks/data/aggregated/bd-aggregated.zone,BD - Bangladesh"
        "https://www.ipdeny.com/ipblocks/data/aggregated/by-aggregated.zone,BY - Belarus"
        "https://www.ipdeny.com/ipblocks/data/aggregated/br-aggregated.zone,BR - Brazil"
        "https://www.ipdeny.com/ipblocks/data/aggregated/cn-aggregated.zone,CN - China"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ir-aggregated.zone,IR - Iran"
        "https://www.ipdeny.com/ipblocks/data/aggregated/in-aggregated.zone,IN - India"
        "https://www.ipdeny.com/ipblocks/data/aggregated/kp-aggregated.zone,KP - North Korea"
        "https://www.ipdeny.com/ipblocks/data/aggregated/np-aggregated.zone,NP - Nepal"
        "https://www.ipdeny.com/ipblocks/data/aggregated/pk-aggregated.zone,PK - Pakistan"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ro-aggregated.zone,RO - Romania"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ru-aggregated.zone,RU - Russia"
        "https://www.ipdeny.com/ipblocks/data/aggregated/sg-aggregated.zone,SG - Singapore"
        "https://www.ipdeny.com/ipblocks/data/aggregated/sy-aggregated.zone,SY - Syria"
        "https://www.ipdeny.com/ipblocks/data/aggregated/tr-aggregated.zone,TR - Turkey"
        "https://www.ipdeny.com/ipblocks/data/aggregated/ua-aggregated.zone,UA - Ukraine"
        "https://www.ipdeny.com/ipblocks/data/aggregated/vn-aggregated.zone,VN - Vietnam"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/af-aggregated.zone,AF - Afganistan"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/bd-aggregated.zone,BD - Bangladesh"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/by-aggregated.zone,BY - Belarus"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/br-aggregated.zone,BR - Brazil"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/cn-aggregated.zone,CN - China"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ir-aggregated.zone,IR - Iran"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/in-aggregated.zone,IN - India"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/np-aggregated.zone,NP - Nepal"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/pk-aggregated.zone,PK - Pakistan"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ro-aggregated.zone,RO - Romania"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ru-aggregated.zone,RU - Russia"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/sg-aggregated.zone,SG - Singapore"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/sy-aggregated.zone,SY - Syria"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/tr-aggregated.zone,TR - Turkey"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/ua-aggregated.zone,UA - Ukraine"
        "https://www.ipdeny.com/ipv6/ipaddresses/aggregated/vn-aggregated.zone,VN - Vietnam"
)

# Bestandsnaam met de huidige datum en tijd
output_file="samengevoegde_lijst_${current_datetime}.txt"

# Downloaden en samenvoegen van de IP-lijsten
for url_info in "${urls[@]}"
do
    # Opsplitsen van de URL-informatie
    IFS=',' read -r url description &lt;&lt;&lt; "$url_info"

    # Opmerking toevoegen met de URL en beschrijving
    echo "# URL: $url" &gt;&gt; "$output_file"
    echo "# Description: $description" &gt;&gt; "$output_file"

    echo "IP-lijst downloaden van $url"
    # Downloaden van de IP-lijst en toevoegen aan het bestand
    curl -sS "$url" &gt;&gt; "$output_file"
done

echo "Samenvoegen voltooid! De samengevoegde lijst is opgeslagen in $output_file"

# Formatteren van het bestand voor de Cloudron Blocklist API
formatted_file="formatted_$output_file"

# Voeg "\n" toe aan het einde van elke regel
awk '{printf "%s\\n",$0}' "$output_file" &gt; "$formatted_file"

# Cloudron Blocklist API endpoint
cloudron_api_endpoint="https://your-cloudron-domain.com/api/v1/network/blocklist"

# API Key voor authenticatie (vervang 'your-api-key' door jouw API-sleutel)
api_key="your-api-key"

# Uploaden naar Cloudron Blocklist API met wget
echo "Uploaden naar Cloudron Blocklist API met wget..."

# De gegevens in het vereiste formaat voor de API
data="{\"blocklist\":\"$(cat "$formatted_file" | tr '\n' '\\n')\"}"

# Verzend het bestand met een POST-verzoek via wget
echo "$data" &gt; temp_data.txt
wget --method=POST --header="Content-Type: application/json" --header="Authorization: Bearer $api_key" --body-file=temp_data.txt "$cloudron_api_endpoint" --quiet --output-document=output.txt

# Toon de uitvoer van wget
cat output.txt

# Verwijder tijdelijke bestanden
rm temp_data.txt

</code></pre>
]]></description><link>https://forum.cloudron.io/post/79889</link><guid isPermaLink="true">https://forum.cloudron.io/post/79889</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Wed, 27 Dec 2023 11:28:48 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Wed, 27 Dec 2023 11:22:16 GMT]]></title><description><![CDATA[<p dir="auto">Again ChatGPT did it!!! It's really unbelievable how "patient" it is and after keep trying all it's variants (after feedback the errors) and asking if there is another way except curl it came with wget and after the second try it worked!</p>
]]></description><link>https://forum.cloudron.io/post/79886</link><guid isPermaLink="true">https://forum.cloudron.io/post/79886</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Wed, 27 Dec 2023 11:22:16 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Wed, 27 Dec 2023 10:45:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robi" aria-label="Profile: robi">@<bdi>robi</bdi></a> I did a check and somehow the browser is able to do a POST with the huge string ... <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f635.png?v=b6971addb6c" class="not-responsive emoji emoji-android emoji--dizzy_face" style="height:1.4em;width:auto;vertical-align:middle" title=":dizzy_face:" alt="😵" /></p>
]]></description><link>https://forum.cloudron.io/post/79881</link><guid isPermaLink="true">https://forum.cloudron.io/post/79881</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Wed, 27 Dec 2023 10:45:49 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Wed, 27 Dec 2023 10:44:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> said in <a href="/post/79853">Firewall / Spamassassin: Automatic list update</a>:</p>
<blockquote>
<p dir="auto"><a href="https://stackoverflow.com/questions/54090784/curl-argument-list-too-long" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/54090784/curl-argument-list-too-long</a></p>
</blockquote>
<p dir="auto">I tried that in the beginning but got this error:</p>
<pre><code>{
  "status": "Bad Request",
  "message": "blocklist must be a string"
}
</code></pre>
]]></description><link>https://forum.cloudron.io/post/79880</link><guid isPermaLink="true">https://forum.cloudron.io/post/79880</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Wed, 27 Dec 2023 10:44:37 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Tue, 26 Dec 2023 16:10:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a> said in <a href="/post/79815">Firewall / Spamassassin: Automatic list update</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a> I get a line 83: /usr/bin/curl: Argument list too long</p>
</blockquote>
<p dir="auto">this is related to <code>curl</code> . I don't know the answer but you can look for posts similar to <a href="https://stackoverflow.com/questions/54090784/curl-argument-list-too-long" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/54090784/curl-argument-list-too-long</a> where you have to pass the args as a file instead of on the command line itself.</p>
]]></description><link>https://forum.cloudron.io/post/79853</link><guid isPermaLink="true">https://forum.cloudron.io/post/79853</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Tue, 26 Dec 2023 16:10:16 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Sun, 24 Dec 2023 18:45:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a> Since it works from the browser, you should be able to inspect the API calls in the browser console.</p>
]]></description><link>https://forum.cloudron.io/post/79822</link><guid isPermaLink="true">https://forum.cloudron.io/post/79822</guid><dc:creator><![CDATA[robi]]></dc:creator><pubDate>Sun, 24 Dec 2023 18:45:36 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Sun, 24 Dec 2023 14:33:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/necrevistonnezr" aria-label="Profile: necrevistonnezr">@<bdi>necrevistonnezr</bdi></a> I gave it a try with some help by ChatGPT and it works flawless!! Except the API can't handle large list where the GUI is able to handle without an issue.</p>
<p dir="auto">The script automatically downloads all the geo lists in an array, creates a copy/paste file for the GUI and then prepares the file in JSON style and connect/upload via API.</p>
<p dir="auto">When I choose only a few countries is works perfect, however when choosing all the desired ones:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a> I get a <code>line 83: /usr/bin/curl: Argument list too long</code></p>
<p dir="auto">I can copy/paste the full list in the GUI, it takes some time but it uploads and settles all IP ranges (about 87k)</p>
<p dir="auto">Does anyone know how to do this via the API?</p>
]]></description><link>https://forum.cloudron.io/post/79815</link><guid isPermaLink="true">https://forum.cloudron.io/post/79815</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Sun, 24 Dec 2023 14:33:22 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Thu, 21 Dec 2023 06:18:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a>  No, as I don’t know how to avoid duplicates in the database - I don’t want to fill up a database with a hard entry limit with nonsense</p>
]]></description><link>https://forum.cloudron.io/post/79731</link><guid isPermaLink="true">https://forum.cloudron.io/post/79731</guid><dc:creator><![CDATA[necrevistonnezr]]></dc:creator><pubDate>Thu, 21 Dec 2023 06:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Tue, 19 Dec 2023 09:54:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/necrevistonnezr" aria-label="Profile: necrevistonnezr">@<bdi>necrevistonnezr</bdi></a> said in <a href="/post/77148">Firewall / Spamassassin: Automatic list update</a>:</p>
<blockquote>
<p dir="auto">I guess something like this should work</p>
</blockquote>
<p dir="auto">Did you managed it to get it worked like that?</p>
]]></description><link>https://forum.cloudron.io/post/79645</link><guid isPermaLink="true">https://forum.cloudron.io/post/79645</guid><dc:creator><![CDATA[imc67]]></dc:creator><pubDate>Tue, 19 Dec 2023 09:54:49 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Wed, 29 Nov 2023 08:30:31 GMT]]></title><description><![CDATA[<p dir="auto">Is it possible to improve / add the IP block list feature to Cloudron in 8.0?</p>
]]></description><link>https://forum.cloudron.io/post/78415</link><guid isPermaLink="true">https://forum.cloudron.io/post/78415</guid><dc:creator><![CDATA[d19dotca]]></dc:creator><pubDate>Wed, 29 Nov 2023 08:30:31 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Thu, 16 Nov 2023 11:07:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> IME it's a custom support request for the network operator to put those filters on for your IP(s).</p>
]]></description><link>https://forum.cloudron.io/post/77510</link><guid isPermaLink="true">https://forum.cloudron.io/post/77510</guid><dc:creator><![CDATA[robi]]></dc:creator><pubDate>Thu, 16 Nov 2023 11:07:26 GMT</pubDate></item><item><title><![CDATA[Reply to Firewall / Spamassassin: Automatic list update on Thu, 16 Nov 2023 09:10:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/imc67" aria-label="Profile: imc67">@<bdi>imc67</bdi></a> IMO, the correct place to implement this is in the network firewall. Most Cloud providers already have a firewall feature and they can then implement this firewall rule at the edge of the network instead of the server itself.</p>
<p dir="auto">I have a Synology router (not NAS) at home. I just use their blocklists. For home setups, the router is the correct place for this. Otherwise, you allow all traffic to come into your home and then it gets rejected by the server wasting cpu and network traffic.</p>
<p dir="auto">That said, I understand why this feature is being requested here instead - no cloud network firewall has this feature. And most likely cloud providers don't listen to our suggestions <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f615.png?v=b6971addb6c" class="not-responsive emoji emoji-android emoji--confused" style="height:1.4em;width:auto;vertical-align:middle" title=":/" alt="😕" /></p>
]]></description><link>https://forum.cloudron.io/post/77501</link><guid isPermaLink="true">https://forum.cloudron.io/post/77501</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Thu, 16 Nov 2023 09:10:25 GMT</pubDate></item></channel></rss>