banner
AcoFork

AcoFork

LOVETOLOVE

Cloud Roll Call Sheet Based on Password + TOTP Protection

Introduction:#

I really can't understand why a roll call sheet needs to be password protected. Why not just let users input the list? I do not recommend reading this article; it's too dumbed down. See: This roll call sheet, based on HTML, can be installed as an APK

What is this#

This is a cloud-based roll call sheet hosted on Cloudflare Workers, which is very useful for certain positions. The roll call sheet displays the current time, and clicking on a name will strike it out and move it to the bottom. It also has select all, deselect all, and theme toggle options.

Login page:

image

Roll call sheet page:

9c9b7facdd8878704b8903a53e83bb27

50efb0a23afd3324791ef2e390f4dce7

Why create this strange project?#

Because the author found that most TODO software on the market cannot achieve the effect of a roll call sheet. In a fit of anger, I turned to AI for help and spent 20 days creating this piece of history (the code is indeed reliant, but it works; the future plan is to decouple it, such as storing HTML using KV variables).

Official Start#

  1. Create Cloudflare Workers and paste the code. The GitHub repository is: https://github.com/afoim/name_cf_workers

  2. Add environment variables

  • NAMES is the list, one per line
  • PASSWORD is the password you set
  • TOTP_SECRET is the TOTP key you set, which can be generated using the following Python code
import pyotp
import qrcode

def generate_totp(secret, account_name, issuer_name):
    # Generate a TOTP object
    totp = pyotp.TOTP(secret)
    
    # Print the current TOTP value
    print(f"Current TOTP: {totp.now()}")

    # Generate a URI suitable for QR code scanning (for Google Authenticator, etc.)
    uri = totp.provisioning_uri(name=account_name, issuer_name=issuer_name)
    print(f"TOTP URI: {uri}")

    # Generate QR code
    img = qrcode.make(uri)
    img.show()  # Display QR code

if __name__ == "__main__":
    # Custom name, account, and key
    account_name = input("Please enter account name: ")
    issuer_name = input("Please enter application name: ")

    # Generate a random key, or you can use your predefined key
    secret = pyotp.random_base32()
    print(f"Key: {secret}")

    generate_totp(secret, account_name, issuer_name)

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.