Skip to content

Instantly share code, notes, and snippets.

View shsunmoonlee's full-sized avatar

Seunghun Sunmoon Lee shsunmoonlee

View GitHub Profile
@shsunmoonlee
shsunmoonlee / README.md
Created October 20, 2026 09:52
Read-only preflight and verify SQL for a self-hosted Supabase Postgres upgrade: sizes, extensions, event-trigger owners, cron jobs, slots, collation, ACL fingerprints, PASS/FAIL checks.

The maintained version of these files lives in the self-hosted-supabase handbook. This gist is a snapshot of 2026-10-20; check the repo for fixes.

Preflight and verify SQL for a Supabase Postgres upgrade

Both files only read catalogs. They print names, counts, owners, sizes and hashes, never secret values.

docker cp . supabase-db-<service-uuid>:/tmp/checks/
docker exec supabase-db-<service-uuid> psql -U supabase_admin -d postgres -X -f /tmp/checks/preflight.sql > preflight.out
# ... upgrade ...
@shsunmoonlee
shsunmoonlee / README.md
Created October 20, 2026 09:52
27 things that broke, or nearly did, while updating an old self-hosted Supabase on Coolify (Kong to Envoy, Postgres 15 to 17), plus a script that checks secret lengths without printing values.

The maintained version of these files lives in the self-hosted-supabase handbook. This gist is a snapshot of 2026-10-20; check the repo for fixes.

Files:

  • things-that-broke.md: the short list.
  • check-secret-lengths.sh: prints the NAME and LENGTH of each variable in a compose .env (never the value); fails on empty secrets and on anything interpolated into SECRET_KEY_BASE shorter than 64 characters. Usage: bash check-secret-lengths.sh <.env> [docker-compose.yml] [NAME=MIN ...]. Needs bash 4+.

Longer version of every item: https://github.com/shsunmoonlee/self-hosted-supabase.


Maintained by Seunghun Lee. I offer production self-hosted SaaS setup as a service: LinkedIn · X.

@shsunmoonlee
shsunmoonlee / README.md
Created October 20, 2026 09:52
Recreate one container of a Coolify service from the host without losing the `coolify` network: record networks and aliases, dry-run gate, recreate, reattach, check bind files, probe.

The maintained version of these files lives in the self-hosted-supabase handbook. This gist is a snapshot of 2026-10-20; check the repo for fixes.

Recreate one Supabase container on Coolify without losing the coolify network

Coolify connects service containers to its shared coolify network during its own deploys, as a separate docker network connect. The network is not in the compose file on disk. So this, run on the host:

docker compose -p <service-uuid> -f /data/coolify/services/<service-uuid>/docker-compose.yml up -d --no-deps --force-recreate supabase-kong
@shsunmoonlee
shsunmoonlee / README.md
Created October 20, 2026 09:52
In-place Postgres 15 to 17 for a Coolify-managed self-hosted Supabase db (pg_upgrade, copy mode), with prepare gates and a tested rollback.

The maintained version of these files lives in the self-hosted-supabase handbook. This gist is a snapshot of 2026-10-20; check the repo for fixes.

Postgres 15 to 17 for Supabase on Coolify, with rollback

pg17-upgrade.sh upgrades supabase/postgres:15.14.1.163 to supabase/postgres:17.6.1.163 in place, on the named volumes Coolify creates for a Supabase service (<service-uuid>_supabase-db-data and <service-uuid>_supabase-db-config). It ran on a production stack on 2026-10-19 after a full rehearsal on a clone. Full write-up and the rest of the runbook: https://github.com/shsunmoonlee/self-hosted-supabase.

Derived from upstream supabase/supabase docker/utils/upgrade-pg17.sh (tag self-hosted/v0.8.3) and supabase/postgres initiate.sh / complete.sh (tag 17.6.1.163). For a different take on the same job, which runs upstream's initiate.sh directly, see [Vadko's migration guide](https://gist.github.com/Vadko/57d1dbc309f5b7440036f660

@shsunmoonlee
shsunmoonlee / yc-jobs-list.json
Created March 16, 2024 13:00
yc-jobs-list.json
[
{
"companyName": "One Month",
"companyDescription": "One Month's affordable online bootcamps teach people how to code in just one month. Topics include Python, Ruby on Rails, JavaScript, and Front-end Development. For a full list of courses, visit https://onemonth.com/courses.",
"jobName": "Full Stack Tech Lead // Web3 Chat App (Console.xyz) ",
"website": "onemonth.com",
"jobLinkInYc": "https://www.workatastartup.com/jobs/55758",
"details": {
"info1": "Remote (New York City, NY)",
"info2": "fulltime",
@shsunmoonlee
shsunmoonlee / example-landmark.json
Created August 17, 2020 19:40
example-landmark.json
{
"IMG_20200709_181039_2.jpg": {
"width": 3024,
"height": 4032,
"fullFaceDescriptions": [
{
"detection": {
"_imageDims": { "_width": 3024, "_height": 4032 },
"_score": 0.756403923034668,
"_classScore": 0.756403923034668,
@shsunmoonlee
shsunmoonlee / gist:c10cc89b07fa752fac0222fc9ca4eb9e
Created July 4, 2020 06:44
blocket automated find tenant like script
let clickButton = () => {
let button = document.querySelector('#app > div > div.FocusContainer > div > div > div.MatchingUserEvaluationHandler > div.Submit > div > div.button.apply')
button.click()
}
let intervalID
let startAutomaticInterval = (seconds) => {
if(intervalID) { clearTimeout(intervalID) }
intervalID = setInterval(clickButton, seconds*1000)
}
@shsunmoonlee
shsunmoonlee / LRU Cache.js
Created February 4, 2020 13:39
Classic LRU Cache in JavaScript. Goal: Real World Implementation
function ListNode(key, value) {
this.value = value
this.key = key
this.next = this.prev = null
}
/**
* @param {number} capacity
*/
var LRUCache = function(capacity) {
@shsunmoonlee
shsunmoonlee / LRU Cache.js
Created February 4, 2020 13:39
Classic LRU Cache in JavaScript. Goal: Real World Implementation
function ListNode(key, value) {
this.value = value
this.key = key
this.next = this.prev = null
}
/**
* @param {number} capacity
*/
var LRUCache = function(capacity) {
{
"events": {
"restart": "kill-port 3010",
"crash": "kill-port 3010"
},
"delay": "1500"
}