diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..afc91f2 --- /dev/null +++ b/.env.example @@ -0,0 +1,46 @@ +# --- SMTP Server Settings --- +# (change if using a service other than GMail for sending alerts) +SMTP_SERVER = smtp.gmail.com +SMTP_PORT = 587 + +# --- SECRET Settings --- +SENDER_EMAIL_ADDRESS = # the email account used for sending automated alerts +SENDER_EMAIL_PASSWORD = # the password for the above-mentioned email account +RECIPIENT_EMAIL_ADDRESS = # the person who needs to be notified of status changes + +# --- VARIABLE Settings --- +CHECK_INTERVAL_SECONDS = 300 # 5 minutely user activity checks +ALERT_INTERVAL_SECONDS = 900 # 15 minute trailing window of activity + # + periodicity of Github status updates + +# --- GITHUB related vars --- + +# you will need to change REPO_URL to reflect the url for your forked repo +# change ACCOUNT_NAME to reflect your Github account name. +REPO_URL = "https://github.com/ACCOUNT_NAME/SignsOfLife.git" + +# How to obtain a Github Personal Access Token: +# On Github, click on your user account icon (top right) +# Select "Developer Settings" +# Open "Personal Access Tokens" and select "Fine Grained Tokens" +# Click on Generate New Token +# * Name: SignsOfLife +# * Expiration: no expiration (NOTE: security risk if leaked) +# * Description: (whatever you want) +# * Select "Only Select Repositories" and choose SignsOfLife +# * Repository Permissions: Contents (read & write) +# Click on "Generate Token" +GITHUB_TOKEN = # cut and paste your Githiub PErsonal Access Token here + +BRANCH = "main" # there should be no need to change this + +# CLIENT ID is used to distinguish statuses from multiple clients (electronic devices +# being monitored for soigns of life). The client will write status and heartbeat files +# called state_.txt and heartbeat_.txt. You can either simply number +# your devices (01, 02,...) or give them names here (e.g. 'laptop', 'desktop' etc...). +CLIENT_ID = "01" # if you have mo + +# These are the files written by your client device +# At present they are hard coded here. In future I intend to infer them using the CLIENT_ID +HEARTBEAT_FILE = "data/heartbeats/heartbeat_01.txt" +STATE_FILE = "data/states/state_01.txt" \ No newline at end of file diff --git a/README.md b/README.md index 35ce35f..00c3e7c 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,15 @@ User activity state is evaluated over the past 15 minutes. If any activity is de - heartbeat.txt must contain a timestamp only. I welcome pull requests that add Android or Apple iOS signs-of-life monitoring capabilities to the repository. + + +# Github PAT + +User Icon - top right +Developer Settings +Personal Access Tokens - Fine Grained +Set for individual repo (SignsOfLife) +Permissions: + - Read access to metadata (mandatory) + - Read and Write access to code (required to push status updates to repo) +