initial commit

main
William Perron 4 weeks ago
commit 5ac660838a
No known key found for this signature in database
GPG Key ID: F701727E6034EEC9

8
.gitignore vendored

@ -0,0 +1,8 @@
/node_modules/
/public/build/
/public/
.DS_Store
public/posts.json
config-prod.toml

@ -0,0 +1,28 @@
http://localhost, http://babypool.lol, http://babypool-lol.fly.dev {
bind 0.0.0.0
root * /usr/share/caddy/babypool.lol
file_server
encode gzip
header orig-server Caddy
basic_auth {
wperron $2y$10$79.4ujIzCrSY9kAVUrjjNu.cZ1nShU2Y8.AkoxRzNv4DhhuRRy2.e
}
log {
output file /var/log/caddy.log {
roll_uncompressed
roll_keep_for 168h # 7d
}
format json {
time_format rfc3339
time_local
duration_format nano
}
}
}
:9091 {
bind 0.0.0.0
metrics /metrics
}

@ -0,0 +1,14 @@
# Download Caddy binary from GitHub releases
FROM ubuntu:24.04 as caddy_downloader
WORKDIR /dl
RUN apt update && apt install -y curl
RUN curl -sL -o caddy_2.8.4_linux_amd64.tar.gz https://github.com/caddyserver/caddy/releases/download/v2.8.4/caddy_2.8.4_linux_amd64.tar.gz
RUN tar -xzf caddy_2.8.4_linux_amd64.tar.gz && mv caddy /usr/local/bin
FROM ubuntu:24.04
WORKDIR /build
RUN apt update && apt install -y tzdata net-tools && apt clean
COPY --from=caddy_downloader /usr/local/bin/caddy /usr/local/bin/caddy
COPY ./static /usr/share/caddy/babypool.lol
COPY ./Caddyfile /etc/caddy/Caddyfile
CMD ["caddy", "run", "--config=/etc/caddy/Caddyfile", "--adapter=caddyfile"]

@ -0,0 +1,57 @@
# Babypool.lol
An _anonymous_ baby pool website.
## How it works
You create a new new pool, choose the games you want to include and that's it.
No need to register, enter an email or a password or anything like that. Each
pool is given an ID that you can share with whoever you want to participate, you
can optionally select a password to make sure no strangers participate, and you
are given a unique token that gives you access to see the pool's entries and
select a winner. For participants, you need to include an email address so that
you can be contacted if you win, but there's no validation step involved, and
the email addresses are purged when a pool is closed, or at most 3 months after
the expected end date has passed.
## Games Included
You can choose whichever games you want to include in the pool, with a minimum
of one selected of course.
- Date
- Time of Day
- Weight
- Height
- Biological Sex
## Technical details
There are two tables: Pools, and Pool Entries.
Pools table:
| Column Name | Type | Constraints |
| ----------- | -------- | ----------- |
| ID | ULID | Unique |
| admin token | String | |
| password | bcrypt | |
| games | []String | |
`games` must a Set containing, from these possible values: `DAY`, `TIME`,
`WEIGHT`, `HEIGHT`, `BIOSEX`.
Pool Entries:
| Column Name | Type | Constraints |
| ----------- | ------ | ----------- |
| Pool ID | ULID | FK |
| email | String | |
| guesses | JSON | |
`guesses` must satisfy the following schema:
```
[]struct{
game string // one of DAY, TIME, WEIGHT, HEIGHT, BIOSEX
val: date | time | { v: int, unit: string } | ['M', 'F']
}
```

@ -0,0 +1,41 @@
# fly.toml file generated for wperron-io on 2022-05-19T10:44:27-04:00
app = "babypool-lol"
primary_region = "yul"
[processes]
caddy = "caddy run --config /etc/caddy/Caddyfile --adapter caddyfile"
[metrics]
port = 9091
path = "/metrics"
[env]
TZ = "America/New_York"
[[services]]
http_checks = []
internal_port = 80
processes = ["caddy"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"

@ -0,0 +1,9 @@
<!DOCTYPE html>
<head>
<title>babypool.lol</title>
<meta charset="utf8" />
</head>
<body>
<h1>404 Not Found</h1>
<p>There ain't nothing here chief.</p>
</body>

@ -0,0 +1,4 @@
body {
width: 50%;
margin: auto;
}

@ -0,0 +1,9 @@
<!DOCTYPE html>
<head>
<title>babypool.lol</title>
<meta charset="utf8" />
<link rel="stylesheet" href="index.html" />
</head>
<body>
<h1>Hello Babypool.lol!</h1>
</body>

@ -0,0 +1,2 @@
User-agent: *
Disallow: /
Loading…
Cancel
Save