diff --git a/watch-faces/complication/.gitignore b/watch-faces/complication/.gitignore new file mode 100644 index 00000000..c33c0219 --- /dev/null +++ b/watch-faces/complication/.gitignore @@ -0,0 +1 @@ +totp_face.secrets.h diff --git a/watch-faces/complication/totp_face.c b/watch-faces/complication/totp_face.c index fdec0565..f405da8e 100644 --- a/watch-faces/complication/totp_face.c +++ b/watch-faces/complication/totp_face.c @@ -63,10 +63,14 @@ typedef struct { //////////////////////////////////////////////////////////////////////////////// // Enter your TOTP key data below +#if __has_include("totp_face.secrets.h") +#include "totp_face.secrets.h" +#else static totp_t credentials[] = { CREDENTIAL(2F, "JBSWY3DPEHPK3PXP", SHA1, 30), CREDENTIAL(AAC, "JBSWY3DPEHPK3PXP", SHA1, 30), }; +#endif // END OF KEY DATA. //////////////////////////////////////////////////////////////////////////////// diff --git a/watch-faces/complication/totp_face.h b/watch-faces/complication/totp_face.h index dc7e42a3..93cc4492 100644 --- a/watch-faces/complication/totp_face.h +++ b/watch-faces/complication/totp_face.h @@ -62,6 +62,10 @@ * o `algorithm` is one of the supported hashing algorithms listed above. * o `timestep` is how often the TOTP refreshes in seconds. This is usually * 30 seconds. + * o Alternatively, place the `credentials` variable as-is in a file named + * `totp_face.secrets.h` in this directory, and it will be included instead. + * This lowers the risk of commiting your OTP secrets to GitHub as that file + * is listed in the .gitignore file. * * If you have more than one secret key, press ALARM to cycle through them. * Press LIGHT to cycle in the other direction or keep it pressed longer to