A Remix application that syncs Google Photos albums to Ghost blog posts.
For more on how this works, run the app and view the dashboard after signing in, or head to ./app/routes/dashboard.tsx.
This is a Remix app; for more on Remix, see the Remix Docs.
Deployment has been configured for Fly.io by using npx create-remix@latest
and selecting Fly.io as the deployment target.
You must create a .env
file to run this application locally. It should contain the following:
# These details are used to upload files to Backblaze B2. For more on how to create application
# keys, see: https://www.backblaze.com/docs/cloud-storage-application-keys.
# The endpoint is available on the bucket settings shown in the Backblaze dashboard UI.
BACKBLAZE_B2_ACCESS_KEY_ID="replace_me"
BACKBLAZE_B2_BUCKET_NAME="replace_me"
BACKBLAZE_B2_BUCKET_REGION="replace_me"
BACKBLAZE_B2_ENDPOINT="replace_me"
BACKBLAZE_B2_SECRET_ACCESS_KEY="replace_me"
# Set these up by adding a "Custom integration" to your Ghost blog, which you can do in the blog
# settings in the admin dashboard.
GHOST_ADMIN_API_KEY="replace_me"
GHOST_ADMIN_API_URL="replace_me"
# A URL prefix to use for the uploaded images. If passed in, it will be prepended to the key
# to create the URL. If not passed in, the URL will read from the B2 upload result. This is
# useful if you want to use a CDN like Cloudflare to serve the images, rather than serving them
# directly from Backblaze B2.
# This is typically set up like: `https://images.<domain>.com/file/<bucketName>`,
# assuming that you've set up the subdomain `images.<domain>.com` to point to the B2 bucket in
# your CDN's settings.
GHOST_IMAGE_URL_PREFIX="replace_me"
# Follow these instructions to set up an OAuth 2.0 client ID:
# https://developers.google.com/photos/library/guides/get-started
#
# Make sure to set your client up with the following:
# - Authorized JavaScript origins: must include "http://localhost:3000" for local use and your
# deployed root URL for production
# - Authorized redirect URIs: must include "http://localhost:3000/auth/google/callback" for local
# use and the same path in your deployed domain for production
#
# Once you've set up the OAuth 2.0 Client, you can copy its Client ID and Client secret and add them
# here.
GOOGLE_CLIENT_ID="replace_me"
GOOGLE_CLIENT_SECRET="replace_me"
# Any random thirty-character string
SESSION_COOKIE_SECRET="replace_me"
You will also need to set these variables in your production environment; in Fly.io, you can do this by setting secrets.
The docs below were generated by running
npx create-remix@latest
.
-
Sign up and log in to Fly
flyctl auth signup
- Setup Fly. It might ask if you want to deploy, say no since you haven't built the app yet.
flyctl launch
From your terminal:
npm run dev
This starts your app in development mode, rebuilding assets on file changes.
If you've followed the setup instructions already, all you need to do is run this:
npm run deploy
You can run flyctl info
to get the url and ip address of your server.
Check out the fly docs for more information.