This playbook creates a bash script which can,
- Deploy totp.maverickgeek.xyz to InterPlanetary File System (IPFS)
- Update the Content Identifier (CID) in InterPlanetary Name System (IPNS)
Demo,
- CloudFlare: https://cloudflare-ipfs.com/ipns/k51qzi5uqu5dii8e5k7q6qpbz91or4gjluu2egnrtm6lkhb15lwok3a0ylxqf9
- IPFS.io: https://ipfs.io/ipns/k51qzi5uqu5dii8e5k7q6qpbz91or4gjluu2egnrtm6lkhb15lwok3a0ylxqf9
- dweb.link: https://dweb.link/ipns/k51qzi5uqu5dii8e5k7q6qpbz91or4gjluu2egnrtm6lkhb15lwok3a0ylxqf9
Assumption: The instance runs in Oracle Cloud using the Terraform script below,
- terraform__oci-instance-2
bin/deploy.sh
uses an Ansible ad-hoc task to run publish_totp_ipfs.sh
on the instance.
- GitHub: github.com/k3karthic/ansible__totp-generator-ipfs
- Codeberg: codeberg.org/k3karthic/ansible__totp-generator-ipfs
Install the following before running the playbook,
$ pip install oci
$ ansible-galaxy collection install oracle.oci
The Oracle Ansible Inventory Plugin populates public Ubuntu instances.
The target Ubuntu instance must have the freeform tag ipfs_service: yes
.
- Update
inventory/oracle.oci.yml
,- Specify the region where you have deployed your server on Oracle Cloud. List of regions are at docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm.
- Configure the authentication as per the Oracle Guide
- Set username and SSH authentication in
inventory/group_vars/
IPNS derives the public URL from a keypair. Follow the instructions below to create a keypair.
Create a key using the following command and note the ID in the result,
$ ipfs key gen <name>
Export the key using the following command,
$ ipfs key export <name>
- Save the ID and name in
inventory/group_vars/tag_ipfs_service=yes.yml
. Useinventory/group_vars/tag_ipfs_service=yes.yml.sample
as a reference. - Save the exported key in the
files
directory.
Run the playbook using the following command,
$ ./bin/apply.sh
Encrypt sensitive files (IPFS key, SSH private keys and inventory/group_vars/tag_ipfs_service=yes.yml
) before saving them. .gitignore
must contain the unencrypted file paths.
Use the following command to decrypt the files after cloning the repository,
$ ./bin/decrypt.sh
Use the following command after running terraform to update the encrypted files,
$ ./bin/encrypt.sh <gpg key id>