Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers

add flag for disabling invite keys temporarily

without disturbing kv links

+10 -8
+1
src/types.d.ts
··· 14 14 BETTER_AUTH_URL: string; 15 15 TURNSTILE_PUBLIC_KEY: string; 16 16 TURNSTILE_SECRET_KEY: string; 17 + USE_INVITE_KEYS: boolean; 17 18 USE_TURNSTILE_CAPTCHA: boolean; 18 19 USE_BSKY_IMAGE_DIMENSIONS: boolean; 19 20 RESET_BOT_USERNAME: string;
+1 -1
src/utils/inviteKeys.ts
··· 2 2 import has from "just-has"; 3 3 4 4 export const isUsingInviteKeys = (c: Context) => { 5 - return has(c.env, "INVITE_POOL"); 5 + return has(c.env, "INVITE_POOL") && c.env.USE_INVITE_KEYS; 6 6 } 7 7 8 8 export const doesInviteKeyHaveValues = async (c: Context, inviteKey: string|undefined) => {
+4 -3
src/wrangler.d.ts
··· 1 1 /* eslint-disable */ 2 - // Generated by Wrangler by running `wrangler types src/wrangler.d.ts` (hash: 6b69f335a575dd8d79e7361724bb6d9e) 3 - // Runtime types generated with workerd@1.20251213.0 2024-12-13 nodejs_compat 2 + // Generated by Wrangler by running `wrangler types src/wrangler.d.ts` (hash: 1fd2c7810342546250df3f8cea204300) 3 + // Runtime types generated with workerd@1.20251217.0 2024-12-13 nodejs_compat 4 4 declare namespace Cloudflare { 5 5 interface GlobalProps { 6 6 mainModule: typeof import("./index"); ··· 9 9 KV: KVNamespace; 10 10 INVITE_POOL: KVNamespace; 11 11 USE_IMAGE_TRANSFORMS: true; 12 + USE_BSKY_IMAGE_DIMENSIONS: false; 12 13 MAX_IMAGE_QUALITY_STEPS: 6; 13 14 IMAGE_DEGRADE_PER_STEP: 5; 14 15 USE_TURNSTILE_CAPTCHA: true; 15 - USE_BSKY_IMAGE_DIMENSIONS: false; 16 + USE_INVITE_KEYS: true; 16 17 INVITE_THREAD: "https://bsky.app/profile/skyscheduler.work/post/3ltsfnzdmkk2l"; 17 18 DEFAULT_ADMIN_USER: string; 18 19 DEFAULT_ADMIN_PASS: string;
+4 -4
wrangler.toml
··· 52 52 53 53 # If we should use cf image transforms 54 54 USE_IMAGE_TRANSFORMS=true 55 + # this could possibly fail, and should probably be kept as false 56 + USE_BSKY_IMAGE_DIMENSIONS=false 55 57 56 58 # how many image quality steps should we attempt 57 59 MAX_IMAGE_QUALITY_STEPS=6 ··· 59 61 # how much should the image quality go down per steps 60 62 IMAGE_DEGRADE_PER_STEP=5 61 63 62 - # Should we use turnstile captchas? 64 + # Signup options 63 65 USE_TURNSTILE_CAPTCHA=true 64 - 65 - # Enforce bsky image dimensions (possible failure for resizes) 66 - USE_BSKY_IMAGE_DIMENSIONS=false 66 + USE_INVITE_KEYS=true 67 67 68 68 # link to invite threads 69 69 INVITE_THREAD="https://bsky.app/profile/skyscheduler.work/post/3ltsfnzdmkk2l"