Skip to content
Merged

Dev #16

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 17 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# leaving it for now because have to figure out how to deploy because server is behind private network

name: Deploy both frontend and backend on server

Expand All @@ -7,31 +8,23 @@ on:
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

Deploy:
runs-on: ubuntu-latest

environment: production
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: checkout code
uses: actions/checkout@v4

- name: Add private key to agent
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.SSH_PK }}

- name: Deploy to server
env:
SERVER_USER: ${{ secrets.SERVER_USER }}
SERVER_IP:


2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h2>UIC NetID:</h2>
</div>
<p id="status" style="text-align: center;"></p>
</div>
<p style="color: black; text-align: center; position: relative; font-size: 0.7em">Beta Version. Created by <a class="shameless-plug" href="https://github.com/hmodi51">Harish Modi</a> and <a class="shameless-plug" href="https://github.com/mgorski760">Marcin Gorski</a>.</p>
<p style="color: black; text-align: center; position: relative; font-size: 0.7em">Beta Version. Created by <a class="shameless-plug" href="https://github.com/hmodi51">Harshit Modi</a> and <a class="shameless-plug" href="https://github.com/mgorski760">Marcin Gorski</a>.</p>
</div>

<style>
Expand Down
8 changes: 3 additions & 5 deletions frontend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function launch() {
const button = document.getElementById("login-button");
netid.trim();

if(template_id == -1 || netid == null){
if(template_id == -1 || !netid){
document.getElementById("status").innerHTML = `<span id="fail-label">[FAILED]</span> Please enter your NetID and select a container.`;
return;
}
Expand All @@ -14,7 +14,7 @@ function launch() {
button.textContent = "Launching..."
document.getElementById("status").textContent = "";

fetch("http://doom.acmuic.org/api/launch", {
fetch("/api/launch", {
method: "POST",
headers: {
"Content-Type": "application/json"
Expand Down Expand Up @@ -52,9 +52,7 @@ function launch() {

//[Key: Name of Container, Value: value for launch]
const containers = new Map();
containers.set("Default Debian Linux", 100);
containers.set("Linux Week 2026", 200);
containers.set("TEST ID=142", 142);
containers.set("Default Debian Linux", 142);
let template_id = -1; //Nothing selected.

const dropdownButton = document.getElementById("dropdown-button");
Expand Down