IPFS Automation
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide has instructions to set up workflow which will run automatically to pin the latest hashes and create/update the transform rules set in Cloudflare whenever new version releases will be published across all apps.
pWallet -
pStake -
Dexter -
Set the correct value for `MONGO_URI`. You can use any MongoDB instance, including one inside a self-hosted container. If you don't have a MongoDB instance, you can use the free tier of [] as shown in the image below. Copy the URI marked by the arrow:
Account -> Account Rulesets -> Read
Zone -> Transform Rules -> Read
Zone -> Transform Rules -> Edit
Set the TELEGRAM_BOT_TOKEN in the .env
file
Ensure to assign Group Admin Rights and Channel Admin Rights to the created bot using BotFather
The rules can have any values for now as our application will fix them for us. We just need to do this for the Rule ID to be available in the next step.
src/utils/config.sample.ts
file and rename it to src/utils/config.ts
Get your rulesetId querying the below URL and search for the object with phase: http_request_transform and copy that rulesetId. This becomes your cloudflareRulesetId.
curl https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets \ --header "Authorization: Bearer <API_TOKEN>"
Now use this cloudflareRulesetId to query the below URL and get the respective cloudflareRuleId for individual transform rules and update it in src/utils/config.ts
curlhttps://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets
/{ruleset_id} \ --header "Authorization: Bearer <API_TOKEN>"
Token and set it in the .env file. Make sure to have the pinByHash and unpin permission enabled.
and set it in the .env file. No permissions are required if only fetching releases from public repositories.
and set it in the .env file. Make sure to have the Zone.Transform Rules permissions for the API Token as shown in the image below.
Create a new group, add your new bot to it, make it the group admin. Find out the chat ID of the group by checking and selecting the group. The chat ID will be in the URL, it usually starts with -100 for groups that have bot admins. Set the TELEGRAM_CHAT_ID in the .env file.
Add the appUUID, transformedURL, transformedURL inside cloudflareRuleExpression, cloudflareZoneId, cloudflareRulesetId and cloudflareRuleId for each of the apps. You can obtain the cloudflareZoneId by following the instructions in the . The cloudflareRulesetId and cloudflareRuleId can be obtained by following the instructions on .
src/utils/config.ts