Bot for Bluesky that adds watermarks to posted illustrations and replaces them with reposts.
The name fooroh comes from the Japanese word 封蝋, which means sealing wax.
Serverless Bluesky bot deployable on AWS via AWS CDK. The application part is a Lambda function or ECS service written in python and deployed as a Docker container image.
deploy target
- AWS Account
local development environment
- AWS CLI
- Node.js ^18
- Python ^3.13
- Poetry ^2
- Docker Service
1. Create cdk.env file and configure as desired.
Create the cdk.env file. By default, the settings for the development environment are enabled, but this usually does not need to be changed.
2. deploy the bot below operations.
This is an example of deploying as a development environment by giving env=dev in context. If you want to deploy as a production environment, you can specify env=prod. cdk.env can also be changed for production environment, so please change it in advance if necessary.
$ npm install
# bootstrap (only once)
$ npx cdk bootstrap --profile default
# if you want check the CloudFormation template before deploying
$ npx cdk synth --profile default -c env=dev --all
# deploying all stacks at once, usually used for the first deployment
$ npx cdk deploy -c env=dev --all --require-approval never
# deploying each stack, usually used for updating part of the stacks
$ npx cdk deploy fr-CommonResourceStack-dev -c env=dev
$ npx cdk deploy fr-FollowFlowStack-dev -c env=dev
$ npx cdk deploy fr-SignupFlowStack-dev -c env=dev
$ npx cdk deploy fr-SetWatermarkImgStack-dev -c env=dev
$ npx cdk deploy fr-WatermarkingFlowStack-dev -c env=dev
$ npx cdk deploy fr-SignoutFlowStack-dev -c env=dev
$ npx cdk deploy fr-FirehoseStack-dev -c env=dev3. Sets Secrets Manager secret for the bot.
When deploying the common resource stack, a Secrets Manager resource named ${APP_NAME}-secretsmanager-${STAGE} is created. The values are default values, so please set the following
{
"bot_userid": "xxx.bsky.social", // ID of bluesky bot user
"bot_app_password": "r375-hpg3-3mf4-uwl6", // App Password of bluesky bot user, with the Allow Access to your Direct Messages permission
"fernet_key": "/AyTCHY7jnC3JO4l5i0wzGgQUBG2YTpO8hu5LypZU1o=", // Key generated automatically on first cdk deploy. If you want to change it, set the one generated by Fernet.generate_key().
"ignore_list_uri": "https://bsky.app/profile/did:plc:xxx/lists/yyy", // URL of the ignore list; change the username part to DID
"white_list_uri": "https://bsky.app/profile/did:plc:xxx/lists/zzz", // URL for a whitelist that only processes registered users; change the user name part to DID
"password": "-" // dummy. not used.
}Note that SecretsManager is not destroyed or updated on the second or subsequent deployments.
4. Enable a service
Manually change the following settings By default, our bot is configured not to launch schedules or instances that incur fees.
-
Enables Event Bridge rules. (default is Disabled)
${APP_NAME}-SignoutFlowStack-${STAGE}-FindFollowEventsRulexxxx${APP_NAME}-SignupFlowStack-${STAGE}-SignupExecutionRuleCxxx
-
Set Desired count for the ECS service to 1. (default is 0)
${APP_NAME}-${STAGE}-service