Skip to content

Commit

Permalink
.env example
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Molloy committed Dec 21, 2024
1 parent 0334da5 commit 08ec3f9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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_<CLIENT_ID>.txt and heartbeat_<CLIENT_ID>.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"
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 08ec3f9

Please sign in to comment.