-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·62 lines (62 loc) · 1.93 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
if ! command -v cargo &> /dev/null
then
echo "cargo could not be found, installing rust now..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
exit
fi
rustup update
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# echo "linux, maybe debian/ubuntu. Trying to install protobuf, this will ask you for your password"
# sudo apt-get install -y protobuf-compiler
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip
unzip protoc-3.15.8-linux-x86_64.zip -d $HOME/.local
export PATH="$PATH:$HOME/.local/bin"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "OSX detected, this must be a local development machine"
if ! command -v brew &> /dev/null
then
echo "brew could not be found, installing now..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
exit
fi
brew install protobuf
brew install tmux
# brew install haproxy
# brew services start haproxy
# brew install certbot
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "cygwin" # POSIX compatibility layer and Linux environment emulation for Windows
elif [[ "$OSTYPE" == "msys" ]]; then
echo "msys" # Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "bsd" # ...
else
echo "wtf" # Unknown.
fi
git stash
git pull
git submodule update --init --recursive --remote
cd flamebucketmanager || exit 1
git stash
git pull
cargo build -r
if ! test -f "./target/release/manage_relay_users"; then
echo "failed to compile"
exit 1
fi
echo "relay manager has compiled successfully"
cd ../nostr-rs-relay || exit 1
git stash
git pull
cargo build -r
if ! test -f "./target/release/nostr-rs-relay"; then
echo "failed to compile"
exit 1
fi
echo "relay has compiled successfully"
rm config.toml
cp ../config.toml .
echo "done"
echo "now run ./start.sh"