Web service for generating location/time aware Apple Wallet passes
272
Web service for generating location/time aware Apple Wallet passes.
The following environment variables are required (except the last one):
APPLE_PRIVATE_KEY_PASSWORD
APPLE_PASS_TYPE_IDENTIFIER
APPLE_TEAM_IDENTIFIER
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_BUCKET
AWS_SECRETS_PREFIX
SKIP_DOWNLOAD_SECRETS
The APPLE_* variables can be obtained by following the guide at
Passbook.
The AWS_* variables are required to download Apple secrets and the api_keys.yaml
from AWS S3. During development, you only need to download them once,
or just use local files (place them in the ./secrets folder).
In this case just set SKIP_DOWNLOAD_SECRETS to any non-empty value.
The following files should exist on the AWS bucket under the configured prefix (leave empty if on root):
private.keycertificate.pemapple-wwdrca.pemapi_keys.yamlAn example api_keys.yaml can be found in the root of this repo (api_keys-example.yaml).
If you do not have Docker Compose installed, skip to the next section.
docker-compose up --build
Then navigate to http://localhost:3000.
docker build . -t passgen:1
docker run -it \
-e APPLE_PRIVATE_KEY_PASSWORD=<VALUE> \
-e APPLE_PASS_TYPE_IDENTIFIER=<VALUE> \
-e APPLE_TEAM_IDENTIFIER=<VALUE> \
-e SKIP_DOWNLOAD_SECRETS=1 \
-p 3000:3000 --rm passgen:1
Then navigate to http://localhost:3000.
docker build . -f prod.dockerfile -t passgen:prod
docker run -d \
-e APPLE_PRIVATE_KEY_PASSWORD=<VALUE> \
-e APPLE_PASS_TYPE_IDENTIFIER=<VALUE> \
-e APPLE_TEAM_IDENTIFIER=<VALUE> \
-e AWS_ACCESS_KEY_ID=<VALUE> \
-e AWS_SECRET_ACCESS_KEY=<VALUE> \
-e AWS_BUCKET=<VALUE> \
-p 3000:3333 -e PORT=3333 --rm passgen:prod
Then navigate to http://localhost:3000.
Basically, you need to create a heroku app, set up environment variables and set the stack to container:
heroku stack:set container
Finally link your repository to heroku and set up automatic builds. For more information please refer to the official docs here.
Assuming you have a swarm cluster:
docker secret create private.key.1 /path/to/private.key
docker secret create certificate.pem.1 /path/to/certificate.pem
docker secret create apple-wwdrca.pem.1 /path/to/apple-wwdrca
docker secret create api_keys.yaml.1 /path/to/api_keys.yaml
docker config create icon.png.1 /path/to/icon.png
With the correct tag set in docker-compose.yaml, run the following:
docker stack deploy -c docker-compose.yaml passgen
Content type
Image
Digest
Size
381.2 MB
Last updated
over 5 years ago
docker pull hammady/passgen