Introduction:#
I really can't understand why a roll call sheet needs to be password protected. Can't users just input the list? I don't recommend reading this article; it's quite dumb. 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 options for select all, deselect all, and toggle theme.
Login page:
Roll call sheet page:
Why create this strange project?#
Because the author found that most TODO software on the market cannot achieve a similar effect to 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 indeed relies on it, but it works). The future plan is to decouple it (for example, storing HTML using KV variables).
Official Start#
-
Create Cloudflare Workers and paste the code. The GitHub repository is: https://github.com/afoim/name_cf_workers
-
Add environment variables
- NAMES for the list, one per line
- PASSWORD for the password you set
- TOTP_SECRET for 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)