TDD: 1, Me: 0
This commit is contained in:
35
setup.sh
Normal file
35
setup.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
mkdir -p certs
|
||||
|
||||
openssl genrsa -out certs/mycert.key 2048
|
||||
|
||||
openssl req -new -key certs/mycert.key -out certs/mycert.csr -subj "/C=/ST=/L=/O=/OU=/CN=/emailAddress="
|
||||
|
||||
openssl x509 -req -days 365 -in certs/mycert.csr -signkey certs/mycert.key -out certs/mycert.crt
|
||||
|
||||
LOCATION="$(pwd)"
|
||||
|
||||
cat << EOF > /etc/systemd/system/wolServer.service
|
||||
[Unit]
|
||||
Description=wol-server
|
||||
After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=%n
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=$LOCATION/app
|
||||
EnvironmentFile=$LOCATION/app/.env
|
||||
ExecStart=gunicorn -c $LOCATION/gunicorn_config.py
|
||||
LimitNOFILE=20000
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now wolServer.service
|
||||
Reference in New Issue
Block a user