Skip to content

Commit

Permalink
Merge pull request #4 from obelisk/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
obelisk authored Nov 9, 2024
2 parents 6a22031 + fce9208 commit 20b0973
Show file tree
Hide file tree
Showing 68 changed files with 5,186 additions and 751 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# name of the workflow
name: Heroku

# run workflow when the condition is met
on:
# run when code is pushed on the `main` branch
push:
branches: ["*"]
# run when a pull request to the `main` branch
pull_request:
branches: ["*"]

# env variables
env:
CARGO_TERM_COLOR: always

# jobs
jobs:
# job name
build:
# os to run the job on support macOS and windows also
runs-on: ubuntu-latest
# steps for job
steps:
# this will get the code and set the git
- uses: actions/checkout@v3
# run the build

- name: Set up Elm
run: |
ELM_URL="https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz"
curl -L -o elm.gz $ELM_URL
gunzip elm.gz
chmod +x elm
sudo mv elm /usr/local/bin/
- name: Build Frontend
run: |
cd ./web && sh ./build.sh
- name: Build Server
# using cargo to build
run: cargo build --release

# for deployment
- name: make dir
# create a directory
run: mkdir app
# put the app in it
- name: copy
run: cp ./target/release/exhibit ./app/exhibit && cp -r ./webroot ./app/webroot

# heroku deployment
- uses: akhileshns/[email protected]
with:
# key from repository secrets
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
# name of the Heroku app
heroku_app_name: "exhibit"
# email from which the app is uploaded
heroku_email: "[email protected]"

# app directory
appdir: "./app"

# start command
procfile: "web: ./exhibit"
# buildpack is like environment used to run the app
buildpack: "https://github.com/ph3nx/heroku-binary-buildpack.git"
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/

.DS_Store
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
Expand All @@ -12,4 +12,13 @@ Cargo.lock

#Added by cargo

/web/elm/elm-stuff
/webroot
/target
#/app
#/bin

tools/output/
tools/output_code_images/
tools/md-slides/
tools/venv/
16 changes: 14 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
[package]
name = "exhibit"
version = "0.1.1"
version = "0.3.0"
authors = ["Mitchell Grenier <[email protected]>"]
edition = "2021"

[dependencies]
base64 = "0.21"
dashmap = "5.5"
env_logger = "0.10"
jsonwebtoken = "8"
log = "0.4"
tokio = { version = "1.19.2", features = ["macros", "sync", "rt-multi-thread"] }
tokio-stream = "0.1"
toml = "0.7"
warp = "0.3"
serde = {version = "1", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
futures = { version = "0.3", default-features = false }
uuid = { version = "1", features = ["serde", "v4"] }
zeroize = "1"

[build-dependencies]
regex = "1"

[[bin]]
name = "exhibit"
path = "src/main.rs"
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
build:
@cargo build
release:
@cargo build --release

clean:
@cargo clean
Expand Down
45 changes: 45 additions & 0 deletions examples/example.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
service_address = "0.0.0.0"
service_port = 8000

# Key from jwt.io
new_presentation_signing_key = """
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEVs/o5+uQbTjL3chynL4wXgUg2R9
q9UU8I5mEovUf86QZ7kOBIjJwqnzD1omageEHWwHdBO6B+dFabmdT9POxg==
-----END PUBLIC KEY-----
"""

# Corresponding private key
#
# -----BEGIN PRIVATE KEY-----
# MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgevZzL1gdAFr88hb2
# OF/2NxApJCzGCEDdfSp6VQO30hyhRANCAAQRWz+jn65BtOMvdyHKcvjBeBSDZH2r
# 1RTwjmYSi9R/zpBnuQ4EiMnCqfMPWiZqB4QdbAd0E7oH50VpuZ1P087G
# -----END PRIVATE KEY-----

test = """
# New presentation with id 5d313aea523d41569469e4abd72028d2
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0IiwicGlkIjoiNWQzMTNhZWE1MjNkNDE1Njk0NjllNGFiZDcyMDI4ZDIiLCJleHAiOjIwMDAwMDAwMDB9.IaL8xg_AF34oueaa5KxkplIC9AKJJ-D4OKuM-oLVwmpwyEGBKGxwa3wA6COHG5reyFPRlHpofsRPVVbtPZk6-A
# Sample authorization key
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpYDwCVZI5bUVgNOJR3lHTfO0oOQl
R+PbqML+RLVwjgHcaRJvi4R7GKvShFMp7KTj9FOdu/EHJrMoHNDSXUc3FA==
-----END PUBLIC KEY-----
# Corresponding private key for presentation viewers
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/YCN67i7pa4keOIP
tv1+3aRnUB5jcJEkm5Dnd0687aihRANCAASlgPAJVkjltRWA04lHeUdN87Sg5CVH
49uowv5EtXCOAdxpEm+LhHsYq9KEUynspOP0U5278Qcmsygc0NJdRzcU
-----END PRIVATE KEY-----
# Presenter JWT for presentation with id 5d313aea523d41569469e4abd72028d2
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjVkMzEzYWVhNTIzZDQxNTY5NDY5ZTRhYmQ3MjAyOGQyIn0.eyJzdWIiOiJwcmVzZW50ZXIiLCJwaWQiOiI1ZDMxM2FlYTUyM2Q0MTU2OTQ2OWU0YWJkNzIwMjhkMiIsImlhdCI6MTUxNjIzOTAyMiwiZXhwIjoyMDAwMDAwMDAwfQ.k3xCDeS-Y6IPVIzuyngzibHD2n66FmM4x4eY38PcjuDqzt8GYq2PLpBgXJlMae4jWjmGZfQoGbr8NYHFH_Q9SA
# User JWT for [email protected]
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjVkMzEzYWVhNTIzZDQxNTY5NDY5ZTRhYmQ3MjAyOGQyIn0.eyJzdWIiOiJtaXRjaGVsbEBjb25mdXJpb3VzLmlvIiwicGlkIjoiNWQzMTNhZWE1MjNkNDE1Njk0NjllNGFiZDcyMDI4ZDIiLCJpYXQiOjE1MTYyMzkwMjIsImV4cCI6MjAwMDAwMDAwMH0._EMOpEFhQbmsvabx7m1kS72SNbTS7tdRquCz3ahi5Nd5O26K97hhl0P2RpxLnNbpS2oFYsM6QAse4cfK106DRQ
# User JWT for [email protected]
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjVkMzEzYWVhNTIzZDQxNTY5NDY5ZTRhYmQ3MjAyOGQyIn0.eyJzdWIiOiJhbmRyZXdAY29uZnVyaW91cy5pbyIsInBpZCI6IjVkMzEzYWVhNTIzZDQxNTY5NDY5ZTRhYmQ3MjAyOGQyIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjIwMDAwMDAwMDB9.hScPBuxQVLLcYiC-ofMfr86pRkXPtjx6VFC0ZyCkKUic9McsGXIvg_3ehuYKYUxOvZS4REhkWZMcVLb1B9N09Q
"""
Binary file added examples/presentation/demo.001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/presentation/demo.009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
158 changes: 158 additions & 0 deletions examples/presentation/elm_slide_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
[
{
"slide": "demo.001.png",
"message": "Welcome To Exhibit!",
"emojis": [
"👋",
"😲",
"🙌",
"👏"
]
},
{
"slide": "demo.002.png",
"message": "Presentations Have Graphs",
"emojis": [
"👍",
"📊"
]
},
{
"slide": "demo.003.png",
"message": "Where's The Love?",
"emojis": [
"❤️",
"💗",
"💞",
"💕"
]
},
{
"slide": "demo.004.png",
"message": "So That Graphs",
"emojis": [
"📊"
]
},
{
"slide": "demo.005.png",
"message": "So That Graphs Have Love",
"emojis": [
"📊",
"❤️",
"💗",
"💞",
"💕"
]
},
{
"slide": "demo.006.png",
"message": "Emojis. Emojis Are The Answer",
"emojis": [
"😎",
"🤯",
"🙏",
"🛠️",
"💩",
"🎉",
"📣",
"📸",
"📱",
"👏"
]
},
{
"slide": "demo.007.png",
"message": "So We Go From This",
"emojis": []
},
{
"slide": "demo.008.png",
"message": "To This (and single vote poll)!",
"emojis": [
"😎",
"🤯",
"🙏",
"🛠️",
"💩",
"🎉",
"📣",
"📸",
"📱",
"👏"
],
"poll": {
"name": "What's Your Favorite Emoji?",
"options": [
"😎",
"🤯",
"🙏",
"🛠️",
"💩",
"🎉",
"📣",
"📸",
"📱",
"👏"
],
"vote_type": {
"SingleBinary": {
"choice": ""
}
}
},
"poll_render": {
"refresh_interval": 3,
"type_": "centroid",
"x": 68,
"y": 2,
"scale": 30,
"vbx": 230,
"vby": 230
}
},
{
"slide": "demo.009.png",
"message": "Multichoice Polls!",
"emojis": [
"📊",
"📈",
"📉",
"💹"
],
"rateLimiterOptions": {
"removeRateLimiter": "10s",
"addRateLimiter": {
"name": "1s",
"limiter": {
"Time": {
"interval": 1
}
}
}
},
"poll": {
"name": "Which Emojis's do you like?",
"options": [
"📊",
"📈",
"📉",
"💹"
],
"vote_type": {
"MultipleBinary": {
"choices": {}
}
}
},
"poll_render": {
"refresh_interval": 3,
"type_": "centroid",
"x": 68,
"y": 2,
"scale": 30,
"vbx": 230,
"vby": 230
}
}
]
19 changes: 0 additions & 19 deletions examples/slide_data.json

This file was deleted.

Loading

0 comments on commit 20b0973

Please sign in to comment.