Damus
pasjrwoctx👽 profile picture
pasjrwoctx👽
@pasjrwoctx👽

#fedi22

When we all live with and show true compassion, respect and love towards one another, we bring dignity to humanity and we as a society can truly prosper.
I am a #disabled man living in #poverty who is a passionately creative Bi-Polar social outcast, who’s goal in life is to inspire others to overcome what ever is holding them back. My mental issues foster my creativity. They allow me to see the world with an open mind. I have compassion towards others, because I know first hand. How hard life can be.

Relays (1)
  • wss://relay.ditto.pub – read & write

Recent Notes

utzer · 5w
Another massive distributed HTTP flood is currently hitting git.friendi.ca and causing slow responses. Operationally, this has to be treated as an application-layer DDoS attack, although we cannot det...
pasjrwoctx👽 profile picture
@utzer @utzer ok so you could block those user agents I have something like
# Fake browser detection
RewriteCond %{HTTP_USER_AGENT} (Chrome/[0-9]{3}|Chrome/1[3-9][0-9]|Chrome/150|Firefox/1[3-9][0-9]|Safari/60[0-9]|Version/17) [NC]
RewriteCond %{HTTP_ACCEPT_LANGUAGE} ^$
RewriteRule ^ - [G,L]

RewriteCond %{THE_REQUEST} "GET\shttp" [NC]
RewriteRule ^ - [G,L] and then # 1. BLOCK BAD BROWSER NAMES / BOT FRAMEWORKS

RewriteCond %{HTTP_USER_AGENT} (CCBot|SearchEngineBot|Pandalytics|UCBrowser|ZoneProjectBot|Embarcadero\sURI\sClient|Xenu\sLink\sSleuth|siteradar|SignalsBot|fun-cert-watch|SERankingBacklinksBot|Pinterestbot|CMS-Checker|HeadlessChrome|Puppeteer|SeznamBot|Sogou|8LEGS|HTTrack|cherrypicker|AhrefsBot|BLEXBot|DotBot|MJ12bot|PetalBot|SemrushBot|BuiltWith|Viewer/99|Python|aiohttp|curl|Wget|libwww|Go-http-client|GeedoShopProductFinder|DuckDuckBot|node|IMJ-CompanyPage-Scraper|baidu|RootEvidence|NetAPI\sv1|Scrapy|Bingbot|SummalyBot|got|HUNT-Bot|CibraxScanner|SalesOS-CompanyVerifier|RecordedFuture|SurdotlyBot|panscient\.com|Xiaomi|Android.*Firefox|GPTBot|ClaudeBot|BardBot|LLMScraper|Firecrawl|Crawl4AI|ia_archiver|archive\.org_bot|Google|wp2shell|okhttp|Cortex-Xpanse|Mozilla\.5\.0\.compatible;\.MSIE\.10\.0;\.Windows\.NT\.6\.1;\.Trident/6\.0|facebookexternalhit|facebookexternalua|Version\.13\.0\.3\.Mobile\.15E148\.Safari\.604\.1|iPhone.*Version/13\.0\.3|Safari/604\.1|cms-scanner|OAI-SearchBot|ChatGPT-User|PerplexityBot|Perplexity-User|Amazonbot|Applebot-Extended|Meta-ExternalAgent|Meta-ExternalFetcher|cohere-ai|DeepSeek|Bytespider|Diffbot|Omgilibot|Omgili|Google-Extended|Google-CloudVertex|MistralAI-User|OAI-AdsBot|YouBot|anthropic-ai|NosibleBot) [NC,OR]
RewriteCond %{THE_REQUEST} "^[A-Z]{3,9}\s+https?://" [NC]
RewriteRule ^.*$ - [G,L]

# 2. BLOCK SPAM WEBSITES (REFERRERS)
RewriteCond %{HTTP_REFERER} (baidu\.com|bsky\.(net|com|app)|facebook\.com|meta\.com|threads\.(com|net)|instagram\.com|google\.com|googleusercontent\.com|youtube\.com|x\.com|t\.co|twitter\.com|x\.ai|bing\.com|yahoo\.com|yandex\.com|duckduckgo\.com|microsoft\.com|amazon\.com|brave\.com|semalt\.com|buttons-for-website\.com|darodar\.com|blackhatworth\.com|ilovevitaly\.com|priceg\.com|ranksonic\.com) [NC]
RewriteRule ^.*$ - [G,L]

###############################################
# SAFE BOT & SCRAPER KILLER (FRIENDICA-COMPATIBLE)
###############################################

# Kill obvious scanners by User-Agent
RewriteCond %{HTTP_USER_AGENT} (nmap|nikto|acunetix|sqlmap|fimap|nessus|openvas|arachni|wpscan|dirbuster|fuzzer) [NC]
RewriteRule ^ - [G,L]

# Kill requests with directory traversal attempts
RewriteCond %{QUERY_STRING} (\.\./|\.\.\\|%2e%2e|%5c) [NC]
RewriteRule ^ - [G,L]

# Kill malformed absolute URLs
RewriteCond %{THE_REQUEST} "^[A-Z]{3,9}\s+https?://" [NC]
RewriteRule ^ - [G,L]

# Kill empty User-Agent ONLY if NOT federation
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteCond %{REQUEST_URI} !^/\.well-known/ [NC]
RewriteRule ^ - [G,L]
which has cut down a lot of bad traffic from getting 200, and getting hit with a 410 when it knocks on my door, I would start there, because blocking ips is fun and easy, but if they are being spoofed, they will just spoof more, and worse when they get recycled to actual valid users then you lose traffic, I have found the agent blocking is more effective, they are not willing to rewrite every script to adjust for that so for now it seems to be the fastest block, and if it is getting that hard, run it through cloudflare on the free side proxied for a while anyways to help slowdown and divert the bad traffic, it will keep your server happier, I know not everyone is a fan of that, but somtimes you have to change the route to stay on the road
pasjrwoctx👽 profile picture
Does anyone have a dummies guide to setting up #Cloudflare for #friemdica, I have been getting hammered by bots and scrapers to the point they are consuming bandwidth even though I have most of them blocked in my htaccess, my host recommended I try it, any help that is super easy to follow as my health is not great and reading and implementing is not easy at the moment, anyways any help would be great @Friendica Support @admins @Friendica Developers

Thank You
1
pasjrwoctx👽 · 5w
So I think I got #Cloudflare all setup now, and supposedly this instance is running through it, but I have no idea if anything at all is really happening;
pasjrwoctx👽 profile picture
Ok so video uploads to #friendica kind of suck, I get it, it is not exactly a video platform, but I have made it my all in one social and website, so I created a complex solution to an easy problem, as I want control over where my content is hosted/served from, I made this convoluted script and process for my video uploads, it starts with opening #filezilla and ftping into my /storage/videos folder in my instance, yes I created a folder in /storage labeled videos, after I move the .mp4 into that folder I run a script that I placed in the root of my instance which is called register-video.php and here is the script,<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);

// CONFIGURE THESE:
$friendica_root = '/home/someplace/public_html/your.instance.domain/';
$ftp_folder = $friendica_root . 'storage/videos/';
$uid = your user number;

// DATABASE CONFIG:
$db_host = 'localhost';
$db_user = 'your db user';
$db_pass = 'your db password';
$db_name = 'your db name';

// Connect to Friendica database
$mysqli = new mysqli($db_host, $db_user, $db_pass, $db_name);

if ($mysqli->connect_errno) {
die("DB ERROR: " . $mysqli->connect_error . "\n");
}

// Debug: show folder
echo "Checking folder: $ftp_folder\n";

// Find all files in FTP folder
$files = glob($ftp_folder . '*');

if (!$files) {
echo "No files found.\n";
exit;
}

$allowed = array('mp4', 'webm', 'mov');

foreach ($files as $file) {

$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));

if (!in_array($ext, $allowed)) {
continue;
}

$basename = basename($file);
$filesize = filesize($file);
$filetype = mime_content_type($file);

echo "Registering: $basename\n";

// Read file contents into memory
$filedata = file_get_contents($file);

if ($filedata === false) {
echo "Failed to read file data.\n";
continue;
}

// Create Friendica hash
$hash = hash('sha256', $basename . microtime(true));

$created = date('Y-m-d H:i:s');
$edited = $created;

// Insert into Friendica attach table
$stmt = $mysqli->prepare("
INSERT INTO attach
(uid, hash, filename, filetype, filesize, data, created, edited)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
");

$null = NULL;

$stmt->bind_param(
"isssisss",
$uid,
$hash,
$basename,
$filetype,
$filesize,
$filedata,
$created,
$edited
);

$stmt->send_long_data(5, $filedata);

$stmt->execute();

$attach_id = $stmt->insert_id;

echo "Attachment ID: " . $attach_id . "\n";
echo "Embed using:\n";
echo "\n\n";

$stmt->close();
}

echo "Done.\n";

?>

after you have imported your video via ftp to your /storage/videos you go to your cmd that your sshed into and in the root of your instance you run php register-video.php and you should receive php register-video.php
Checking folder: /home/someplace/public_html/your.instance.domain/storage/videos/
Registering: somerandom.mp4
Attachment ID: some number will appear here say 00
Embed using:


Done. then you can embed into your post, yes I created something no one needs or wants, but I wanted and needed it so I am sharing on the off chance someone may find it useful;
⚖️ License (MIT)
Copyright (c) 2026 pasjrwoctx👽 (Philip A. Swiderski Jr.)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

@Friendica Support @Friendica Developers @admins

You can encourage my continued useless ideas, and by doing so your helping to feed, house and clothe a #disabled man living in #poverty, $5-10-15 It All Helps, via #cashapp at $woctxphotog or via #paypal at paypal.com/donate?campaign_id=…

https://your.instance.domain/attach/00
pasjrwoctx👽 profile picture
Ok so video uploads to #friendica kind of suck, I get it, it is not exactly a video platform, but I have made it my all in one social and website, so I created a complex solution to an easy problem, as I want control over where my content is hosted/served from, I made this convoluted script and process for my video uploads, it starts with opening #filezilla and ftping into my /storage/videos folder in my instance, yes I created a folder in /storage labeled videos, after I move the .mp4 into that folder I run a script that I placed in the root of my instance which is called register-video.php and here is the script,<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);

// CONFIGURE THESE:
$friendica_root = '/home/someplace/public_html/your.instance.domain/';
$ftp_folder = $friendica_root . 'storage/videos/';
$uid = your user number;

// DATABASE CONFIG:
$db_host = 'localhost';
$db_user = 'your db user';
$db_pass = 'your db password';
$db_name = 'your db name';

// Connect to Friendica database
$mysqli = new mysqli($db_host, $db_user, $db_pass, $db_name);

if ($mysqli->connect_errno) {
die("DB ERROR: " . $mysqli->connect_error . "\n");
}

// Debug: show folder
echo "Checking folder: $ftp_folder\n";

// Find all files in FTP folder
$files = glob($ftp_folder . '*');

if (!$files) {
echo "No files found.\n";
exit;
}

$allowed = array('mp4', 'webm', 'mov');

foreach ($files as $file) {

$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));

if (!in_array($ext, $allowed)) {
continue;
}

$basename = basename($file);
$filesize = filesize($file);
$filetype = mime_content_type($file);

echo "Registering: $basename\n";

// Read file contents into memory
$filedata = file_get_contents($file);

if ($filedata === false) {
echo "Failed to read file data.\n";
continue;
}

// Create Friendica hash
$hash = hash('sha256', $basename . microtime(true));

$created = date('Y-m-d H:i:s');
$edited = $created;

// Insert into Friendica attach table
$stmt = $mysqli->prepare("
INSERT INTO attach
(uid, hash, filename, filetype, filesize, data, created, edited)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
");

$null = NULL;

$stmt->bind_param(
"isssisss",
$uid,
$hash,
$basename,
$filetype,
$filesize,
$filedata,
$created,
$edited
);

$stmt->send_long_data(5, $filedata);

$stmt->execute();

$attach_id = $stmt->insert_id;

echo "Attachment ID: " . $attach_id . "\n";
echo "Embed using:\n";
echo "\n\n";

$stmt->close();
}

echo "Done.\n";

?>

after you have imported your video via ftp to your /storage/videos you go to your cmd that your sshed into and in the root of your instance you run php register-video.php and you should receive php register-video.php
Checking folder: /home/someplace/public_html/your.instance.domain/storage/videos/
Registering: somerandom.mp4
Attachment ID: some number will appear here say 00
Embed using:


Done. then you can embed into your post, yes I created something no one needs or wants, but I wanted and needed it so I am sharing on the off chance someone may find it useful;
⚖️ License (MIT)
Copyright (c) 2026 pasjrwoctx👽 (Philip A. Swiderski Jr.)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

@Friendica Support @Friendica Developers @admins

You can encourage my continued useless ideas, and by doing so your helping to feed, house and clothe a #disabled man living in #poverty, $5-10-15 It All Helps, via #cashapp at $woctxphotog or via #paypal at paypal.com/donate?campaign_id=…

https://your.instance.domain/attach/00
pasjrwoctx👽 profile picture
You can encourage my continued useless #poetry, creativity and expression of self, #commentary, random thoughts, #philosophy and ideas, and by doing so your helping to feed, house and clothe a #disabled man living in #poverty, $5-10-15 It All Helps, via #cashapp at $woctxphotog or via #paypal at paypal.com/donate?campaign_id=…


note14uc79...
pasjrwoctx👽 profile picture
@webfan the other reason I elected to not have a server side stored is one privacy of actual humans that visit my site directly, and I just rather not be collecting useless data on a fairly restricted shared hosting environment, I am sure with a little time and a bit more effort on my part I could build fort knox around my instance, but the whole point of this was to cut down on the constant abusive bots and scrappers, and at this time it appears to have worked or is working as is;
webfan · 13w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqdacfrkvy6d97wefx87pqk9as542ptmdll3cwur82z0zclejywjkse0ccqc You are right, sorry I did not read the complete code, I was in $is_fediverse =... line. if ($request === '/' makes it clear, sorry! $is_fediverse and is_static is not necessary then?
note1fv9pw...
pasjrwoctx👽 profile picture
@webfan cookie could be faked but so can headers, and the way I have it now the cookie is only good for the session, bots and scrapers start a new session every time they probe a domain so no need to store, each time they troll its a new session, putting inbox in the check I guess could be useful to gate it, but when I sat down to do this and dug through all my access logs I did not have even one call for the inbox to be worried about it, now if I get bots or scrapers that start calling for my inbox I will gate it, but my understanding of how friendica and activitypub are setup the inbox should not be callable by bots and scrapers, I maybe wrong on that, I have had this instance up an running a year, and it has be en a lot of learning and trial and error so many errors, but so far this gate has really made my access logs go empty, which for me is good, im still fully federated but the datahogs have slowed or stopped trolling me
note1wef42...
pasjrwoctx👽 profile picture
@webfan the only reason to exclude the /inbox route is if you are finding a lot of bots and scrapers accessing your inbox before they scrape your profile, in theory friendicas rules and activitypubs rules should already have your inbox blocked from that activity, I created this because even with a very robust .htaccess file I was getting a lot of bots and scrapers accessing "GET" and "Profile" in my access logs, most where defeating my robots.txt and breaking the rules in .htaccess, this at the moment has killed them, first 2 days they all got 403's and then they just stopped trolling my instance at all; I think it could be customized to your individual needs, I made it shareable, I wont maintain it, it works for me and if by chance it helps anyone well all the better, by all means adapt and modify it to your instance's needs and if it works share it with the community, security and privacy in numbers I say;