From ebafe04d354fbfe1ccf89faf495568aed6660c31 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Fri, 24 Feb 2023 15:59:42 -0700 Subject: [PATCH 1/5] Better README --- .env.example | 4 --- README.md | 61 +++++++++++++++++++++++++++++++++++++++-- presentation/chessh.org | 2 ++ 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 6636fb9..2f43485 100644 --- a/.env.example +++ b/.env.example @@ -2,10 +2,6 @@ HOST=0.0.0.0 NODE_ID=aUniqueString DATABASE_URL=ecto://chessh:password@database/chessh -POSTGRES_USER=chessh -POSTGRES_PASSWORD=password -POSTGRES_DATABASE=chessh - WEB_PORT=8080 REACT_APP_DISCORD_INVITE=https://discord.gg/ajsdlkfjaskldjf diff --git a/README.md b/README.md index 3b06450..0240fa9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,62 @@ # CheSSH -Check out the USUFSLC presentation for this application to understand best what the hell this is: +CheSSH is a distributed multiplayer implementation of the game of Chess over SSH, +written in Elixir, with Discord integrations to deliver alerts when players are +looking for opponents, or in games when it is a player's turn. -[https://linux.usu.edu/stream/12](https://linux.usu.edu/stream/12) +## Usage + +### Dependencies ++ `npm` ++ `elixir` ++ `postgresql` ++ `redis` (which you can ignore if you only use the ETS backend for Hammer for + `config/dev.exs`) + +### Installation + +Do something among the lines of: + +``` +git clone https://github.com/Simponic/chessh +cd chessh + +cp .env.example .env +chmod 0700 .env + +# In one shell (after filling in your .env), start CheSSH +export $(cat .env | xargs) +mix ecto.create +mix ecto.migrate +iex -S mix + +# In another shell, start the frontend +export $(cat .env | xargs) +cd front +npm install +npm start +``` + +### Environment Variables (mostly optional) ++ `REACT_APP_DISCORD_INVITE` is the invite link to the discord server with the + CheSSH bot ++ `REACT_APP_DISCORD_OAUTH` is the link (after replacing the GET params) that will + be used to start OAUTH from the frontend ++ `CLIENT_REDIRECT_AFTER_OAUTH` & `SERVER_REDIRECT_URI` are self-explanatory ++ `REACT_APP_SSH_SERVER` and `REACT_APP_SSH_PORT` are used to build the .ssh config + given to users on the home page of CheSSH after authentication ++ `NEW_GAME_PINGABLE_ROLE_ID` is the role id of the role to ping when a player is + looking for an opponent ++ `REMIND_MOVE_CHANNEL_ID` is the channel id to create private threads with players + for move reminders and other communications ++ `NEW_GAME_CHANNEL_ID` is similar to the above + +## Architecture +The process of building the pi cluster is wholly contained in the awful +~buildscripts~, which will individually ~ssh~ into separate pi's and build the +services locally as well as update the load balancer pi's configurations for nginx +and HAproxy. + +More brief architecture talk of CheSSH can be in my (albeit kinda cringe) FSLC +presentation on Elixir: +[https://github.com/Simponic/chessh/blob/main/presentation/chessh.org](https://github.com/Simponic/chessh/blob/main/presentation/chessh.org) diff --git a/presentation/chessh.org b/presentation/chessh.org index ff13cfd..f425f3c 100644 --- a/presentation/chessh.org +++ b/presentation/chessh.org @@ -5,6 +5,8 @@ * Reminder: linux.usu.edu This meeting should be being streamed live at [[https://linux.usu.edu/streams]]. +(UPDATE: It is now archived at [[https://linux.usu.edu/stream/12]]) + * Introduction #+BEGIN_SRC elixir defmodule Hello do From 31a7303114171cb79ada5807f60649654500de84 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Fri, 24 Feb 2023 16:06:59 -0700 Subject: [PATCH 2/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0240fa9..62582e9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ CheSSH is a distributed multiplayer implementation of the game of Chess over SSH written in Elixir, with Discord integrations to deliver alerts when players are looking for opponents, or in games when it is a player's turn. +https://user-images.githubusercontent.com/25559600/221317658-a80046ca-6009-456d-b43c-67d95baa4bf6.mp4 + ## Usage ### Dependencies From 859db1bf4430a13e5990430b4ec3bb9c8f11a6ca Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Fri, 24 Feb 2023 23:37:52 -0700 Subject: [PATCH 3/5] Update README.md --- README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 62582e9..955ef79 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ CheSSH is a distributed multiplayer implementation of the game of Chess over SSH, written in Elixir, with Discord integrations to deliver alerts when players are -looking for opponents, or in games when it is a player's turn. +looking for opponents, or in games when it is one's turn. https://user-images.githubusercontent.com/25559600/221317658-a80046ca-6009-456d-b43c-67d95baa4bf6.mp4 @@ -12,8 +12,8 @@ https://user-images.githubusercontent.com/25559600/221317658-a80046ca-6009-456d- + `npm` + `elixir` + `postgresql` -+ `redis` (which you can ignore if you only use the ETS backend for Hammer for - `config/dev.exs`) ++ `redis` (which you can ignore if you only use the ETS backend for Hammer in + `config/dev.exs` [set by default]) ### Installation @@ -39,6 +39,17 @@ npm install npm start ``` +## Architecture +The process of building the pi cluster is wholly contained in the awful +`buildscripts`, which will individually `ssh` into separate pi's and build the +services locally there as well as update the load balancer pi's configurations for nginx +and HAproxy. + +More architecture talk of CheSSH can be found in my (albeit kinda cringe) FSLC +presentation on Elixir: +[https://github.com/Simponic/chessh/blob/main/presentation/chessh.org](https://github.com/Simponic/chessh/blob/main/presentation/chessh.org) + + ### Environment Variables (mostly optional) + `REACT_APP_DISCORD_INVITE` is the invite link to the discord server with the CheSSH bot @@ -52,13 +63,3 @@ npm start + `REMIND_MOVE_CHANNEL_ID` is the channel id to create private threads with players for move reminders and other communications + `NEW_GAME_CHANNEL_ID` is similar to the above - -## Architecture -The process of building the pi cluster is wholly contained in the awful -~buildscripts~, which will individually ~ssh~ into separate pi's and build the -services locally as well as update the load balancer pi's configurations for nginx -and HAproxy. - -More brief architecture talk of CheSSH can be in my (albeit kinda cringe) FSLC -presentation on Elixir: -[https://github.com/Simponic/chessh/blob/main/presentation/chessh.org](https://github.com/Simponic/chessh/blob/main/presentation/chessh.org) From 94ed3ded8be302a1ac8d2d783a80479a81e27c02 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Fri, 24 Feb 2023 23:39:34 -0700 Subject: [PATCH 4/5] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 955ef79..9b72b6a 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,15 @@ presentation on Elixir: [https://github.com/Simponic/chessh/blob/main/presentation/chessh.org](https://github.com/Simponic/chessh/blob/main/presentation/chessh.org) -### Environment Variables (mostly optional) +## Environment Variables (mostly optional) + `REACT_APP_DISCORD_INVITE` is the invite link to the discord server with the CheSSH bot -+ `REACT_APP_DISCORD_OAUTH` is the link (after replacing the GET params) that will - be used to start OAUTH from the frontend ++ `REACT_APP_DISCORD_OAUTH` is the link (after replacing the GET URL params) that will + be used to initiate discord OAUTH from the frontend + `CLIENT_REDIRECT_AFTER_OAUTH` & `SERVER_REDIRECT_URI` are self-explanatory + `REACT_APP_SSH_SERVER` and `REACT_APP_SSH_PORT` are used to build the .ssh config given to users on the home page of CheSSH after authentication -+ `NEW_GAME_PINGABLE_ROLE_ID` is the role id of the role to ping when a player is ++ `NEW_GAME_PINGABLE_ROLE_ID` is the role id of the role to ping when one is looking for an opponent + `REMIND_MOVE_CHANNEL_ID` is the channel id to create private threads with players for move reminders and other communications From 6bef6494c229759f7fd6852b7b94901ee2b242a1 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Fri, 24 Feb 2023 23:44:34 -0700 Subject: [PATCH 5/5] Update build_server.sh --- buildscripts/build/build_server.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buildscripts/build/build_server.sh b/buildscripts/build/build_server.sh index 57a3a1c..5a1a5b7 100755 --- a/buildscripts/build/build_server.sh +++ b/buildscripts/build/build_server.sh @@ -37,5 +37,4 @@ cd $HOME sudo mv chessh.service /etc/systemd/system/chessh.service sudo systemctl daemon-reload sudo systemctl enable chessh -sudo systemctl stop chessh -sudo systemctl start chessh +sudo systemctl restart chessh