Skip to content

Commit b06f0b4

Browse files
authored
docs: Add a one line download + start command script (#19)
I think maybe `handles.sh` is a better domain but I already had `handles.run` and it sort of works (it's a command that can _run_ the server) so we'll roll with it. Maybe `handles.zip` would be nice.
1 parent 6115f4d commit b06f0b4

File tree

2 files changed

+61
-5
lines changed

2 files changed

+61
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ managing many DNS records.
66

77
## Quickstart
88

9-
```console
10-
curl -LO https://github.com/prompt/handles-server/releases/download/v1/handles-server-linux
11-
chmod +x handles-server-linux
12-
DID_PROVIDER="memory" MEMORY_DOMAINS="example.com" MEMORY_DIDS="alice.example.com@did:plc:001" \
13-
./handles-server-linux
9+
```bash
10+
sh -c "$(curl -Ls https://handles.run)"
1411
```
1512

13+
...or [download the latest release][releases].
14+
1615
## Implementation
1716

1817
A `handle` is a hostname (e.g: `alice.example.com`) which the server may or may
@@ -68,3 +67,4 @@ A string containing zero or more tokens which are replaced when rendering.
6867
| `{request.query}` | Query included in the request | `greeting=Hello+World` ` ` |
6968

7069
[atproto/resolution/well-known]: https://atproto.com/specs/handle#handle-resolution
70+
[releases]: https://github.com/prompt/handles-server/releases

download.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
os=$(uname -s | tr '[:upper:]' '[:lower:]')
4+
5+
case "$os" in
6+
darwin*) os="macos" ;;
7+
linux*) os="linux" ;;
8+
*)
9+
echo "Sorry, operating system ${os} not supported by this install script."
10+
exit 1
11+
;;
12+
esac
13+
14+
echo "Identified your operating system as ${os}"
15+
16+
file="handles-server-${os}"
17+
18+
echo "Starting download of ${file} from github.com/prompt/handles-server"
19+
20+
curl -L --progress-bar --output handles-server https://github.com/prompt/handles-server/releases/download/v1/handles-server-${os}
21+
chmod +x handles-server
22+
23+
echo "handles-server is downloaded and ready to run."
24+
25+
echo "Start demo of handles server using the in memory provider? (Y/n)"
26+
read response
27+
case "$response" in
28+
[yY][eE][sS] | [yY] | "")
29+
function ended_demo() {
30+
printf "\n\n"
31+
echo "> hopefully the demo was helpful!"
32+
printf "\n"
33+
}
34+
35+
echo "> Starting server for domain example.com with handles alice.example.com and bob.example.com"
36+
sleep 0.5 # An articial delay for time to read the message
37+
echo "> Test it out with: curl --header 'Host: alice.example.com' http://localhost:8888/.well-known/atproto-did"
38+
sleep 1 # An articial delay for time to read the message
39+
echo "> exit with ctrl+c once you're done."
40+
sleep 0.5
41+
printf "\n\n"
42+
trap ended_demo INT
43+
(
44+
set -x
45+
GIN_MODE=release LOG_LEVEL="debug" PORT=8888 DID_PROVIDER="memory" MEMORY_DOMAINS="example.com" MEMORY_DIDS="alice.example.com@did:plc:001,bob.example.com@did:plc:002" ./handles-server
46+
)
47+
;;
48+
*)
49+
echo "> No problem, no demo today :)"
50+
sleep 1
51+
;;
52+
esac
53+
54+
echo "> handles-server is downloaded and ready to run."
55+
sleep 0.5
56+
echo "> any questions? visit https://github.com/prompt/handles-server or email [email protected] :)"

0 commit comments

Comments
 (0)