# Iceshrimp Update Blocklist Scripts ## Introduction: A couple of scripts for Iceshrimp Blocklist maintenance Right now, there is no simple way to maintain an Iceshrimp blocklist It involves finding a blocklist (usually a.csv file), extracting the column with the Domains to be blocked, copying the column, and manually pasting this information into a text field in the Admin dashboard The scripts below replace that manual task by collecting an online list, performing the data extraction, and then inserting the info into the Postgres database using Python Additionally, the [update_blocklist_multiple.py] script allows for a '[personal_blocklist]' to be maintained that will add extra Domains to the Blocklist ## Files: Both of the below update the 'blockedHosts' field in the 'meta' Table This is where the name(s) of instance-wide Blocked domains are held These can then be set via a cron job to run daily * ### [update_blocklist_single.py] Takes a single Blocklist, manipulates the list and inserts the Domains to be blocked into the database Requires: * The remote URL link to a .csv Blocklist file * A local path setting (the directory where the Python file is stored) * The local filename for the .csv file (this can be the same as the remote name) * A local filename for the log file to be created, that shows when the UPDATE last successfully ran * ### [update_blocklist_multiple.py] Takes multiple Blocklists, manipulates them and inserts the Domains to be blocked into the database Requires: * A '[blocklist_multiple.txt]' file that contains URLs to the remote .csv files * An **optional** .csv file containing URLS to be blocked; a '[personal_blocklist.csv]' * A local path setting (the directory where the Python file is stored) * A local filename for the log file to be created, that shows when the UPDATE last successfully ran