forked from DHowett/spectre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·74 lines (56 loc) · 1.66 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
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
echo "==BEGIN=="
echo "### DEBUG ONLY, PREFER CONTAINER SOLUTION ###"
function base_install()
{
sudo apt install wget curl git unzip rsync
# INSTALLATION PYGMENTS:
sudo apt install python3 python3-distutils
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
sudo python3 -m pip install -g Pygments
# INSTALLATION NVM --> NODEJS/NPM
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install lts/iron #node v20.10.0 | npm v10.2.3
nvm use lts/iron
nvm alias default lts/iron
# INSTALLATION GO
wget https://go.dev/dl/go1.21.4.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
sudo tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz
echo "#####"
echo "add this 2 lines into bashrc/zshrc/... :"
echo ""
echo "export PATH=$PATH:/usr/local/go/bin"
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"'
echo ""
echo "#####"
}
function dependancy_install()
{
npm install
go get
go install
if [ ! -d logs ]; then
mkdir logs
fi
if [ ! -d data ]; then
mkdir data
fi
if [ ! -f data/expiry.gob ]; then
touch data/expiry.gob
fi
if [ ! -f data/session.key ]; then
touch data/session.key
fi
}
### (UN)COMMENT FOR INSTALL BASE:
base_install
### (UN)COMMENT FOR INSTALL DEPENDANCY:
dependancy_install
go build
echo "# GHOSTBIN LAUNCHED"
./ghostbin -addr="0.0.0.0:8619" -log_dir="logs" -root="data"
echo "===END==="