Skip to content
Open
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
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dockerComposeFile": "../docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"postStartCommand": "npm ci"
}
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"
6 changes: 0 additions & 6 deletions .github/workflows/deployFromMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,3 @@ jobs:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run test:ci
- name: Deploy to fly.io
uses: superfly/flyctl-actions@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
with:
args: "deploy --detach"
2 changes: 1 addition & 1 deletion .github/workflows/prBuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
image: redis
ports:
- 6379:6379
container: mcr.microsoft.com/playwright:latest
container: mcr.microsoft.com/playwright:v1.55.1-jammy
steps:
- uses: actions/checkout@v2
- run: npm ci
Expand Down
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,12 @@ People can click "Join a nearby queue" to see a list of nearby queues.

This project is built to be self-hosted. There are no cloud dependencies. You'll need:

- Node.js server (v14 or greater)
- Node.js server (v24 or greater)
- Redis database (v6 or greater)
- domain name or public IP (free dynamic dns is enough)

A $35 Raspberry Pi and a home internet connection can handle a significant amount of traffic, don't be afraid to use one.

A very easy way to get started is with flyctl (config is included in this repo). They have a generous free tier, and managed redis for you.

```sh
$ brew install superfly/tap/flyctl
$ flyctl auth signup
$ flyctl deploy
$ flyctl secrets set REDIS_CONNECTION_STRING=redis://YOUR CONNECTION STRING HERE
```

See the [development](#development) section for more details on getting started locally

### Environment Variables
Expand Down Expand Up @@ -117,8 +108,6 @@ The client website can be hosted as static files ANYWHERE, and this means this s
4. visit `localhost:6363` (external port is configurable in the docker-compose.yml file)
5. set your localhost environment variables there

You could also grab a pre-built image from the Github actions "Deploy to Fly.io" step. Look for a line like, "registry.fly.io/chisoonnumber:deployment-1630155850" and use `docker pull registry.fly.io/chisoonnumber:deployment-1630155850` to work with it locally.

Using `caddy reverse-proxy --to http://localhost:3000` can help you test locally with https. Use with `/setBackend` route;

### Localhost Environment Variables
Expand All @@ -128,7 +117,7 @@ Using `/setBackend` does this for you

```js
window.localStorage.setItem("env", "test");
window.localStorage.setItem("test host", "localhost:${port}");
window.localStorage.setItem("host", "localhost:${port}");
```

### Debug
Expand Down
6 changes: 2 additions & 4 deletions client/queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
<title>Queue</title>
<script
defer
src="https://cdn.jsdelivr.net/gh/google/[email protected]/js/src/openlocationcode.min.js"
integrity="sha256-VLEhs9CPhP4nrGyllTmF3KPGi04HVq5gFGKxGetzkYY="
src="https://cdn.jsdelivr.net/gh/google/open-location-code@1/js/src/openlocationcode.min.js"
crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/mvp.css"
integrity="sha256-WDlAJ4pTJXGoGscyx2aoJBdb4wYUljMrgaY3PRG936o="
href="https://cdn.jsdelivr.net/npm/mvp.css@1/mvp.css"
crossorigin="anonymous"
/>
<script type="module" src="./queue.js"></script>
Expand Down
7 changes: 5 additions & 2 deletions client/sharedClientUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ export const urlSearchParams = new URLSearchParams(location.search);
const env = localStorage.getItem('env') || 'prod';
export const config = {
'socket.io server host': {
prod: 'chisoonnumber.fly.dev',
test: localStorage.getItem('test host') || 'localhost:3000',
prod: document.cookie
.split("; ")
.find((row) => row.startsWith("host="))
?.split("=")[1] ?? 'localhost:3000',
test: localStorage.getItem('host') || 'localhost:3000',
}[env],
};

Expand Down
25 changes: 7 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
version: "3.8"

services:
redis:
queue:
image: "redis"
container_name: queue
labels:
kompose.service.expose: "false"
expose:
- 6379
ports:
- 6379:6379
app:
build:
context: .
args:
- NODE_ENV_ARG=development
command: npm run back-end-dev

devcontainer:
image: mcr.microsoft.com/devcontainers/javascript-node:24
volumes:
- ./:/usr/src/app
links:
- redis
- ../..:/workspaces:cached
command: sleep infinity
depends_on:
- redis
- queue
labels:
kompose.service.expose: "true"
ports:
Expand Down
47 changes: 0 additions & 47 deletions fly.toml

This file was deleted.

Loading