<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vincenzo Allocca</title>
    <description>The latest articles on DEV Community by Vincenzo Allocca (@vincenzoallocca).</description>
    <link>https://dev.to/vincenzoallocca</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4257539%2Ff9e204ab-afad-4cf4-bb4e-9c62473415b7.png</url>
      <title>DEV Community: Vincenzo Allocca</title>
      <link>https://dev.to/vincenzoallocca</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vincenzoallocca"/>
    <language>en</language>
    <item>
      <title>Use your own domain as a Bluesky handle on GitHub Pages, without touching DNS</title>
      <dc:creator>Vincenzo Allocca</dc:creator>
      <pubDate>Sat, 21 Nov 2026 15:56:19 +0000</pubDate>
      <link>https://dev.to/vincenzoallocca/use-your-own-domain-as-a-bluesky-handle-on-github-pages-without-touching-dns-5fne</link>
      <guid>https://dev.to/vincenzoallocca/use-your-own-domain-as-a-bluesky-handle-on-github-pages-without-touching-dns-5fne</guid>
      <description>&lt;p&gt;A Bluesky handle can be any domain you control. Instead of &lt;code&gt;@yourname.bsky.social&lt;/code&gt; you become &lt;code&gt;@yourdomain.dev&lt;/code&gt;, and anyone can check that the account really belongs to whoever runs that site.&lt;/p&gt;

&lt;p&gt;The usual instructions say to add a TXT record to your DNS. I didn't have convenient access to the DNS panel for my domain, but the site itself is a static site on &lt;strong&gt;GitHub Pages&lt;/strong&gt;, deployed from a repository I control. That turns out to be enough: Bluesky also accepts verification through a file served over HTTPS.&lt;/p&gt;

&lt;p&gt;Here is what I did for my own handle, &lt;a href="https://bsky.app/profile/vincenzoallocca.dev" rel="noopener noreferrer"&gt;@vincenzoallocca.dev&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Find your DID
&lt;/h2&gt;

&lt;p&gt;Every Bluesky account has a permanent identifier, the DID, that looks like &lt;code&gt;did:plc:&lt;/code&gt; followed by a string of letters and numbers. The handle is just a human-friendly name that points to it.&lt;/p&gt;

&lt;p&gt;In the app: &lt;strong&gt;Settings → Account → Handle → I have my own domain&lt;/strong&gt;, type your domain and switch to the &lt;strong&gt;No DNS panel&lt;/strong&gt; tab. Bluesky shows the exact file path and the DID it expects. You can also look it up from a terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=yourname.bsky.social"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Add the file to your repository
&lt;/h2&gt;

&lt;p&gt;The file must live at &lt;code&gt;/.well-known/atproto-did&lt;/code&gt; and contain &lt;strong&gt;only&lt;/strong&gt; the DID:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p .well-known
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'did:plc:xxxxxxxxxxxxxxxxxxxxxxxx'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .well-known/atproto-did
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I used &lt;code&gt;printf&lt;/code&gt; instead of &lt;code&gt;echo&lt;/code&gt; so the file has no trailing newline. The verification worked like that; I didn't test a version with a newline.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Make sure GitHub Pages actually serves it
&lt;/h2&gt;

&lt;p&gt;This is the step that trips people up. If your Pages site is built with Jekyll (the default for branch deployments), Jekyll skips files and folders whose name starts with a dot, so &lt;code&gt;.well-known/&lt;/code&gt; never makes it into the published site.&lt;/p&gt;

&lt;p&gt;Two ways around it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add an empty &lt;code&gt;.nojekyll&lt;/code&gt; file at the root of the published branch, which disables Jekyll entirely (my site already had one, because it is plain HTML);&lt;/li&gt;
&lt;li&gt;or, if you need Jekyll, include the folder explicitly in &lt;code&gt;_config.yml&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;include&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;".well-known"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you deploy with a GitHub Actions workflow that uploads a build folder, just check that the folder ends up in the artifact.&lt;/p&gt;

&lt;p&gt;Commit, push, wait for the deployment, then check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -i https://yourdomain.dev/.well-known/atproto-did
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You want a &lt;code&gt;200&lt;/code&gt; and the DID as the body. GitHub Pages serves the file as &lt;code&gt;application/octet-stream&lt;/code&gt; because it has no extension, and Bluesky accepted it anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Verify and switch
&lt;/h2&gt;

&lt;p&gt;Back in the app, press &lt;strong&gt;Verify text file&lt;/strong&gt;. When it says the domain is verified, press &lt;strong&gt;Update to yourdomain.dev&lt;/strong&gt;. Your old &lt;code&gt;.bsky.social&lt;/code&gt; handle stays reserved for your account, so you can switch back if you ever need to.&lt;/p&gt;

&lt;p&gt;To confirm from outside the app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=yourdomain.dev"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should return your DID.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the file
&lt;/h2&gt;

&lt;p&gt;Leave &lt;code&gt;/.well-known/atproto-did&lt;/code&gt; in the repository. If it disappears, the handle can no longer be verified and the app flags it as invalid.&lt;/p&gt;

&lt;p&gt;I also linked the profile from my site's structured data (&lt;code&gt;sameAs&lt;/code&gt;) and with &lt;code&gt;&amp;lt;link rel="me"&amp;gt;&lt;/code&gt;, so the site and the account point at each other.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Vincenzo Allocca, a software developer and Computer Engineering student in Naples. The site where I set this up is &lt;a href="https://vincenzoallocca.dev/" rel="noopener noreferrer"&gt;vincenzoallocca.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>bluesky</category>
      <category>github</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Moving a PHP + SQLite site to one Cloudflare Worker on the free plan: what the D1 import didn't tell me</title>
      <dc:creator>Vincenzo Allocca</dc:creator>
      <pubDate>Sat, 21 Nov 2026 15:17:49 +0000</pubDate>
      <link>https://dev.to/vincenzoallocca/moving-a-php-sqlite-site-to-one-cloudflare-worker-on-the-free-plan-what-the-d1-import-didnt-35cb</link>
      <guid>https://dev.to/vincenzoallocca/moving-a-php-sqlite-site-to-one-cloudflare-worker-on-the-free-plan-what-the-d1-import-didnt-35cb</guid>
      <description>&lt;p&gt;Until November 2026, &lt;a href="https://haste.it/" rel="noopener noreferrer"&gt;haste.it&lt;/a&gt;, the website of the independent collective I founded in Campania, ran on a VPS: PHP, Nginx and SQLite. More than 200 PHP files (over 140 of them API endpoints), system cron jobs, uploaded images on the machine's disk, and a server that we had to keep patched ourselves.&lt;/p&gt;

&lt;p&gt;The site does very different things at once: an online magazine, a petition with open data, a small catalogue with Stripe payments and an internal portal for the editorial team. The goal of the migration was simple to state: move everything to Cloudflare, with no server to administer, &lt;strong&gt;staying on the free plan&lt;/strong&gt;, without losing a single feature or row of data.&lt;/p&gt;

&lt;p&gt;This post is about the parts that were not obvious.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Worker instead of 200 PHP files
&lt;/h2&gt;

&lt;p&gt;Pages and API endpoints were rewritten in TypeScript inside a single Cloudflare Worker, organised in roughly 95 modules. One Worker means one deploy, one set of bindings and one place where routing, sessions and security headers live.&lt;/p&gt;

&lt;p&gt;The interesting constraint is the free plan's daily request limit. The fix is to make sure the Worker runs only when it has to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CSS, JavaScript, fonts, images and every page that does not read the database are pre-rendered at build time and served by &lt;strong&gt;Workers Static Assets&lt;/strong&gt;. Those requests never invoke the Worker.&lt;/li&gt;
&lt;li&gt;The Worker only handles dynamic pages and the API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Normal browsing traffic therefore costs almost nothing against the limit.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQLite to D1: the dump is not enough
&lt;/h2&gt;

&lt;p&gt;D1 is SQLite underneath, so I expected &lt;code&gt;sqlite3 .dump&lt;/code&gt; to be the whole story. It was not. I ended up writing a small converter that turns the SQLite file into SQL that D1 accepts, because of two problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. FTS5 shadow tables.&lt;/strong&gt; The magazine uses an FTS5 full-text index. An FTS5 virtual table is backed by internal "shadow" tables (&lt;code&gt;&amp;lt;name&amp;gt;_data&lt;/code&gt;, &lt;code&gt;&amp;lt;name&amp;gt;_idx&lt;/code&gt;, &lt;code&gt;&amp;lt;name&amp;gt;_content&lt;/code&gt;, &lt;code&gt;&amp;lt;name&amp;gt;_docsize&lt;/code&gt;, &lt;code&gt;&amp;lt;name&amp;gt;_config&lt;/code&gt;), and a plain dump writes them out as ordinary tables. D1 rejects them on import. The converter skips them, and the index is rebuilt after the import from the real content tables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- after the import, repopulate the full-text index&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="nf"&gt;articles_fts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;articles_fts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'rebuild'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The table name above is illustrative; the &lt;code&gt;'rebuild'&lt;/code&gt; command is standard FTS5.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. ID counters.&lt;/strong&gt; Tables declared with &lt;code&gt;AUTOINCREMENT&lt;/code&gt; keep their counter in &lt;code&gt;sqlite_sequence&lt;/code&gt;. If the counters are not carried over, new rows can be given identifiers that were already used and deleted, which breaks anything that kept a reference to the old ID. The converter writes the counters back explicitly after the data.&lt;/p&gt;

&lt;p&gt;Lesson: treat "SQLite-compatible" as "compatible for your queries", not "compatible for your file".&lt;/p&gt;

&lt;h2&gt;
  
  
  KV instead of R2 for images
&lt;/h2&gt;

&lt;p&gt;R2 is the natural home for files uploaded by the editorial team, but enabling it requires a payment card even on the free tier. Workers KV does not. For our volume (editorial images, not user-generated media at scale) KV is enough, so uploads live in KV and are served by the Worker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cron without a server
&lt;/h2&gt;

&lt;p&gt;The old crontab became two &lt;strong&gt;cron triggers&lt;/strong&gt; on the same Worker:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every 30 minutes, sync the news feed shown on the site;&lt;/li&gt;
&lt;li&gt;every night, delete expired sessions and rate-limit entries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same code base, same bindings, no extra service.&lt;/p&gt;

&lt;h2&gt;
  
  
  One address only
&lt;/h2&gt;

&lt;p&gt;A Worker is reachable by default on a &lt;code&gt;*.workers.dev&lt;/code&gt; subdomain, and preview deployments get their own URLs. Both were disabled, so the site exists only on haste.it and search engines never see duplicate copies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="c1"&gt;// wrangler.jsonc (excerpt)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"workers_dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"preview_urls"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Tests and headers
&lt;/h2&gt;

&lt;p&gt;The Worker has automated tests with &lt;strong&gt;Vitest&lt;/strong&gt; (security, input validation, database access) plus the TypeScript type check. The build minifies CSS and JavaScript and versions them with a content hash, so browsers can cache them for a long time without ever serving a stale file.&lt;/p&gt;

&lt;p&gt;Every response carries HSTS, a Content-Security-Policy that allows scripts through a nonce generated per request, &lt;code&gt;frame-ancestors&lt;/code&gt; to block embedding and a strict Referrer-Policy. All of it is visible to anyone who inspects the headers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell myself before starting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check what the free plan &lt;em&gt;requires&lt;/em&gt;, not only what it &lt;em&gt;allows&lt;/em&gt;: R2's card requirement changed the storage design.&lt;/li&gt;
&lt;li&gt;Move static output out of the Worker first; it changes how much headroom you have for everything else.&lt;/li&gt;
&lt;li&gt;Write the database converter early and run it repeatedly against a copy of production data. The FTS5 and counter issues only show up with real data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the migration was complete, the PHP code and the VPS configuration were removed from the repository.&lt;/p&gt;

&lt;p&gt;I wrote a longer case study (in Italian) with the architecture and the status page that monitors the site: &lt;a href="https://vincenzoallocca.dev/progetti/haste/" rel="noopener noreferrer"&gt;HASTE Collective, technical case study&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm Vincenzo Allocca, a software developer and Computer Engineering student in Naples. More projects on &lt;a href="https://vincenzoallocca.dev/" rel="noopener noreferrer"&gt;vincenzoallocca.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cloudflare</category>
      <category>sqlite</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
