-
Notifications
You must be signed in to change notification settings - Fork 28
/
setup.sh
177 lines (159 loc) · 5.96 KB
/
setup.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#! /bin/bash
# Setup script for PAKURI
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
LIGHTBLUE='\033[0;36m'
NC='\033[0m'
echo -e "${GREEN}"
echo -e " ██▓███ ▄▄▄ ██ ▄█▀ █ ██ ██▀███ ██▓"
echo -e "▓██░ ██▒ ▒████▄ ██▄█▒ ██ ▓██▒ ▓██ ▒ ██▒ ▓██▒"
echo -e "▓██░ ██▓▒ ▒██ ▀█▄ ▓███▄░ ▓██ ▒██░ ▓██ ░▄█ ▒ ▒██▒"
echo -e "▒██▄█▓▒ ▒ ░██▄▄▄▄██ ▓██ █▄ ▓▓█ ░██░ ▒██▀▀█▄ ░██░"
echo -e "▒██▒ ░ ░ ██▓ ▓█ ▓██▒ ██▓ ▒██▒ █▄ ██▓ ▒▒█████▓ ██▓ ░██▓ ▒██▒ ██▓ ░██░"
echo -e "▒▓▒░ ░ ░ ▒▓▒ ▒▒ ▓▒█░ ▒▓▒ ▒ ▒▒ ▓▒ ▒▓▒ ░▒▓▒ ▒ ▒ ▒▓▒ ░ ▒▓ ░▒▓░ ▒▓▒ ░▓ "
echo -e "░▒ ░ ░▒ ▒ ▒▒ ░ ░▒ ░ ░▒ ▒░ ░▒ ░░▒░ ░ ░ ░▒ ░▒ ░ ▒░ ░▒ ▒ ░"
echo -e "░░ ░ ░ ▒ ░ ░ ░░ ░ ░ ░░░ ░ ░ ░ ░░ ░ ░ ▒ ░"
echo -e " ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ "
echo -e " ░ ░ ░ ░ ░ "
echo -e "#########################################################################"
echo -e "Starting installation of PAKURI."
echo -e "#########################################################################"
echo -e "${NC}"
if [ -f ~/.tmux.conf ]; then
cat tmux.conf >>~/.tmux.conf
else
cp tmux.conf ~/.tmux.conf
fi
echo -e "${YELLOW}"
echo -e "Installing package dependencies."
echo -e "${NC}"
sudo apt update
declare -a modules=("dnsrecon" "impacket-scripts" "sslyze" "sslscan" "onesixtyone" "brutespray" "dialog"
"ike-scan" "smbclient" "enum4linux" "nikto" "seclists" "xmlstarlet" "xclip" "gobuster")
for cmd in ${modules[@]}; do
echo $str
if command -v $cmd >/dev/null; then
echo "$cmd installed"
else
sudo apt install $cmd -y
fi
done
# docker
sudo systemctl start docker.service
mkdir docker && cd docker
# codimd
# https://github.com/hackmdio/codimd.git
mkdir codimd
cd codimd/
cat >docker-compose.yml <<EOI
version: "3"
services:
database:
image: postgres:11.6-alpine
environment:
- POSTGRES_USER=codimd
- POSTGRES_PASSWORD=codimd_password
- POSTGRES_DB=codimd
volumes:
- "database-data:/var/lib/postgresql/data"
restart: always
codimd:
image: nabo.codimd.dev/hackmdio/hackmd:2.2.0
environment:
- CMD_DB_URL=postgres://codimd:codimd_password@database/codimd
- CMD_USECDN=false
depends_on:
- database
ports:
- "3000:3000"
volumes:
- upload-data:/home/hackmd/app/public/uploads
restart: always
volumes:
database-data: {}
upload-data: {}
EOI
sudo docker-compose up -d
cd ..
# Mattermost
git clone https://github.com/mattermost/mattermost-docker.git
cd mattermost-docker/
cat >docker-compose.yml <<EOI
version: "3"
services:
db:
build: db
read_only: true
restart: unless-stopped
volumes:
- ./volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_USER=mmuser
- POSTGRES_PASSWORD=mmuser_password
- POSTGRES_DB=mattermost
app:
build:
context: app
args:
- edition=team
restart: unless-stopped
volumes:
- ./volumes/app/mattermost/config:/mattermost/config:rw
- ./volumes/app/mattermost/data:/mattermost/data:rw
- ./volumes/app/mattermost/logs:/mattermost/logs:rw
- ./volumes/app/mattermost/plugins:/mattermost/plugins:rw
- ./volumes/app/mattermost/client-plugins:/mattermost/client/plugins:rw
- /etc/localtime:/etc/localtime:ro
environment:
- MM_USERNAME=mmuser
- MM_PASSWORD=mmuser_password
- MM_DBNAME=mattermost
- MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mmuser_password@db:5432/mattermost?sslmode=disable&connect_timeout=10
web:
build: web
ports:
- "9080:80"
- "9443:443"
read_only: true
restart: unless-stopped
volumes:
- ./volumes/web/cert:/cert:ro
- /etc/localtime:/etc/localtime:ro
EOI
mkdir -p ./volumes/app/mattermost/{data,logs,config,plugins,client-plugins}
sudo chown -R 2000:2000 ./volumes/app/mattermost/
sudo docker-compose up -d
cd ..
# minio
mkdir minio
cd minio
cat >docker-compose.yml <<EOI
version: '3'
services:
minio:
image: minio/minio:latest
ports:
- 19000:9000
volumes:
- ./data/minio/data:/export
- ./data/minio/config:/root/.minio
environment:
MINIO_ACCESS_KEY: PAKURI_MINIO
MINIO_SECRET_KEY: pakuri_secret
command: server /export
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc config host add myminio http://minio:9000 PAKURI_MINIO pakuri_secret) do echo '...waiting...' && sleep 1> /usr/bin/mc mb myminio/mybucket;
/usr/bin/mc policy download myminio/mybucket;
exit 0;
"
EOI
sudo docker-compose up -d
cd ..