-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra] system wide installation script
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
|
||
## | ||
# Dependencies | ||
# - systemd | ||
echo '# Boruta server setup' | ||
echo '## install dependencies' | ||
apt-get -q update | ||
apt-get -q install -y libssl-dev wget vim postgresql postgresql-client | ||
|
||
echo '## install boruta' | ||
cd /opt | ||
wget -q https://github.com/malach-it/boruta-server/releases/download/0.2.0/boruta.tar.gz | ||
tar xf boruta.tar.gz | ||
|
||
wget -q -O /opt/boruta/.env.production https://raw.githubusercontent.com/malach-it/boruta-server/0.2.0/.env.example | ||
vim /opt/boruta/.env.production | ||
|
||
cat > /etc/systemd/system/boruta.service <<- EOF | ||
[Unit] | ||
Description=Boruta server | ||
After=network.target | ||
[Service] | ||
Type=simple | ||
User=root | ||
WorkingDirectory=/opt/boruta | ||
EnvironmentFile=/opt/boruta/.env.production | ||
ExecStartPre=-su -w POSTGRES_USER,POSTGRES_PASSWORD - postgres -c "psql -c \"CREATE USER \${POSTGRES_USER} WITH CREATEDB PASSWORD '\${POSTGRES_PASSWORD}'\"" | ||
ExecStartPre=/opt/boruta/bin/boruta eval "Boruta.Release.setup()" | ||
ExecStart=/opt/boruta/bin/boruta start | ||
Restart=on-failure | ||
[Install] | ||
WantedBy=multi-user.target | ||
EOF | ||
chmod +x /etc/systemd/system/boruta.service | ||
|
||
|
||
echo '## Enable boruta service' | ||
systemctl daemon-reload | ||
systemctl enable boruta | ||
systemctl start boruta | ||
|
||
exit 0 |