banner
AcoFork

AcoFork

LOVETOLOVE

Cloud Roll Call Sheet Based on Password + TOTP Protection

What is this#

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

Login page:

image

Attendance sheet page:

9c9b7facdd8878704b8903a53e83bb27

50efb0a23afd3324791ef2e390f4dce7

Why do this strange project?#

Because the author found that most TODO software on the market cannot achieve the effect of an attendance 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 based on it but is usable; 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 name 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.