To get started with your own deployment, follow these steps:
- Fork the repository
- In the fork, go to settings > secrets > actions > new repository secret
- Set up the following secrets instructions here (requires paid apple developer account):
- SIGNER_CERT - downloaded from apple and converted to pem
- SIGNER_KEY - a key generated by command line
- SIGNER_KEY_PASSPHRASE - a password you set from command line
- PASS_TYPE_IDENTIFIER - you can find this on signer cert, should look like: pass.com.passkit.admin
- TEAM_IDENTIFIER - you can find this on signer cert, should look like: U4LNY2SS5N
- Get a cloudflare API key with permission to edit workers and save it as
- CF_API_TOKEN
- Go to actions > publish cloudflare worker and hit run
- Your worker should now be live and serving a hello-world pass
This repository is continously published and available here (link downloads the hello world passbook).
This template is used in the following places:
- getrunpass.com (github: run-pass/run-pass)
As shown in the screenshots below, this function runs in about 280ms. Most of the time is spent in node-forge performing the signing operations. The time taken to run means that this won't be supported by the free (max 10ms) or bundled (max 50ms) pricing tiers. As such for production use, the 5$/month unbound plan is required.
Using this plan, you get 400,000GB-s + 1 million requests included per month. In production environment I've observed the function using 0.22GB-s per request which equated to around 1.8 million requests. Each extra million requests is charged at 15 cents, each extra million GB-s are charged at $12.50. As such I'd estimate the following costs:
Request count | GB-s | Monthly cost | Notes |
---|---|---|---|
1,000,000 | 220,000 | 5$ | Min monthly cost |
1,818,181 | 400,000 | 5.15$ | 15 cents for extra requests |
6,363,636 | 1,400,000 | 18.4$ | 12.50 for extra GB-s + 0.15 * 6 for extra requests |