Skip to content

Commit

Permalink
Try environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKerr1225 committed Dec 1, 2024
1 parent 83ee8d8 commit e8276c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/update_website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: |
pip3 install websocket-client

- name: Update site
shell: bash
env:
CSRF_TOKEN: {{ secrets.ION_CSRF_TOKEN }}
SESSION_ID: {{ secrets.ION_SESSION_ID }}
run: |
python3 update.py {{ secrets.ION_CSRF_TOKEN }} {{ secrets.ION_SESSION_ID }}
python3 update.py
4 changes: 2 additions & 2 deletions update.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from websocket import WebSocket
import sys
import os

conn = WebSocket()
conn.connect("wss://director.tjhsst.edu/sites/399/terminal/?", cookie=f"csrftoken={sys.argv[1]};sessionid={sys.argv[2]}")
conn.connect("wss://director.tjhsst.edu/sites/399/terminal/?", cookie=f"csrftoken={os.environ["CSRF_TOKEN"]};sessionid={os.environ["SESSION_ID"]}")
if 'true' not in conn.recv():
print("Could not connect")
exit(1)
Expand Down

0 comments on commit e8276c1

Please sign in to comment.