fix errors in redirects on website, don't try to insert null owner, add cd for oracle server

dev
Oracle Server 2023-05-21 19:23:07 +00:00
parent 8e7bd10312
commit 54c9722048
4 changed files with 32 additions and 4 deletions

20
.github/workflows/deploy_oracle.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Deploy to VelNet Oracle server
on:
push:
branches: ["main"]
paths: ["velconnect/**"]
jobs:
run_pull:
name: Pull new version
runs-on: ubuntu-latest
steps:
- name: install ssh keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect and pull
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.SSH_WORK_DIR }} && git pull && docker compose up -d --build && exit"
- name: cleanup
run: rm -rf ~/.ssh

View File

@ -19,6 +19,7 @@ class DB:
# create the db # create the db
with open('CreateDB.sql', 'r') as f: with open('CreateDB.sql', 'r') as f:
curr.executescript(f.read()) curr.executescript(f.read())
conn.commit()
conn.set_trace_callback(print) conn.set_trace_callback(print)
return conn, curr return conn, curr

View File

@ -237,10 +237,14 @@ def set_data_with_random_key(request: fastapi.Request, data: dict, owner: str, m
@router.post('/set_data/{key}') @router.post('/set_data/{key}')
def set_data(request: fastapi.Request, data: dict, key: str = None, owner: str = None, modified_by: str = None, def set_data(request: fastapi.Request, data: dict, key: str = None, owner: str = 'none', modified_by: str = None,
category: str = None, visibility: Visibility = Visibility.public) -> dict: category: str = None, visibility: Visibility = Visibility.public) -> dict:
"""Creates a little storage bucket for arbitrary data""" """Creates a little storage bucket for arbitrary data"""
# sqlite composite key isn't necessarily unique if a value is null
if owner == None:
owner = 'none'
# add the client's IP address if no sender specified # add the client's IP address if no sender specified
if 'modified_by' in data: if 'modified_by' in data:
modified_by = data['modified_by'] modified_by = data['modified_by']

View File

@ -312,14 +312,17 @@
] ]
}); });
if (respData['device']['current_app']) {
document.getElementById('cover_image').src = `/static/img/cover_${respData['device']['current_app']}.png` document.getElementById('cover_image').src = `/static/img/cover_${respData['device']['current_app']}.png`
document.getElementById('shareable_link').href = `/join/${respData['device']['current_app']}/${respData['device']['current_room']}` document.getElementById('shareable_link').href = `/join/${respData['device']['current_app']}/${respData['device']['current_room']}`
}
loading.style.display = "none"; loading.style.display = "none";
headset_details.style.display = "block"; headset_details.style.display = "block";
}, (status) => { }, (status) => {
loading.style.display = "none"; loading.style.display = "none";
failure.style.display = "block"; failure.style.display = "block";
window.location.href = "/pair";
}); });
@ -441,7 +444,7 @@
const bntPubCam = document.getElementById("bnt_pubcam"); const bntPubCam = document.getElementById("bnt_pubcam");
const bntPubScreen = document.getElementById("bnt_pubscreen"); const bntPubScreen = document.getElementById("bnt_pubscreen");
setDeviceData({"streamer_stream_id": roomName}); // setDeviceData({"streamer_stream_id": roomName});
const serverURL = "wss://velnet.ugavel.com/ws"; const serverURL = "wss://velnet.ugavel.com/ws";