"$schema" = "./node_modules/wrangler/config-schema.json" name = "skyscheduler" main = "src/index.tsx" compatibility_date = "2025-11-18" compatibility_flags = [ "nodejs_compat", "nodejs_compat_do_not_populate_process_env", "disable_ctx_exports", "disable_nodejs_http_server_modules" ] send_metrics = false minify = true upload_source_maps = true preview_urls = false assets = { binding = "ASSETS", run_worker_first = ["/robots.txt"], directory = "./assets/", not_found_handling = "single-page-application" } routes = [{ pattern = "skyscheduler.work", custom_domain = true }] # Redis for sessions [[kv_namespaces]] binding = "KV" id = "0ecd892014ac47eea38c72be94586e7b" # Invite key pool [[kv_namespaces]] binding = "INVITE_POOL" id = "45e1cff45cad45c28b22c4fbcd30db00" [[d1_databases]] binding = "DB" database_name = "skyposts" database_id = "5553e724-4dfb-4771-9c08-3584da5855d1" migrations_table = "migrations" migrations_dir = "migrations" # media storage [[r2_buckets]] binding = "R2" bucket_name = "skyembeds" # temporary storage to get CF Images working, this bucket should be WAF'd so no one but the worker can access it. [[r2_buckets]] binding = "R2RESIZE" bucket_name = "skyscheduler-resize" # rate limits to help combat abuse [[ratelimits]] name = "REPOST_LIMITER" namespace_id = "5471001" simple = { limit = 4, period = 60 } [[ratelimits]] name = "POST_LIMITER" namespace_id = "5471002" simple = { limit = 5, period = 10 } [[ratelimits]] name = "UPDATE_LIMITER" namespace_id = "5471003" simple = { limit = 7, period = 60 } [[ratelimits]] name = "ACCOUNT_LIMITER" namespace_id = "5471004" simple = { limit = 10, period = 60 } [triggers] # Schedule cron triggers at the start of every hour and ~5:30pm on sunday for big cleanups: crons = [ "0 * * * *", "30 17 * * sun" ] # flags required to run wrangler in linux [dev] ip = "127.0.0.1" [observability] enabled = true head_sampling_rate = 1 [observability.traces] enabled = true head_sampling_rate = 0.5 persist = true [[queues.producers]] queue = "skyscheduler-post-queue" binding = "POST_QUEUE" [[queues.producers]] queue = "skyscheduler-repost-queue" binding = "REPOST_QUEUE" [[queues.consumers]] queue = "skyscheduler-post-queue" max_batch_size = 3 max_batch_timeout = 5 max_retries = 3 [[queues.consumers]] queue = "skyscheduler-repost-queue" max_batch_size = 15 max_batch_timeout = 10 max_retries = 3 # used for resizing the thumbnails for link posts [images] binding = "IMAGES" [build] command = "npm run minify" [vars] # the domain and protocol that this application is hosted on. note this value is also used for CORS BETTER_AUTH_URL="https://skyscheduler.work" # If we should use cf image transforms & how much of a quality percentage should we try and the public location of the resize bucket. IMAGE_SETTINGS={enabled=true, steps=[95, 85, 75], bucket_url="https://resize.skyscheduler.work/", max_width=3000} # Signup options and if keys should be used SIGNUP_SETTINGS = {use_captcha=true, invite_only=false, invite_thread="", invite_uses=10} # queue handling, pushing information. QUEUE_SETTINGS = {enabled=true, repostsEnabled=true, postNowEnabled=false, threadEnabled=true, pressure_retries=true, delay_val=100, max_retries=3, post_queues=["POST_QUEUE"], repost_queues=["REPOST_QUEUE"]} # redirect links REDIRECTS = {contact="https://bsky.app/profile/skyscheduler.work", tip="https://ko-fi.com/socksthewolf/tip"} # if we should be removing abandoned files from R2 storage R2_SETTINGS={auto_prune=true, prune_days=3} # settings about tasks TASK_SETTINGS={use_posts=true, use_reposts=true} # set this to true in your .dev.vars to turn off turnstile IN_DEV=false