Turn smilodon environment into a script
This commit is contained in:
parent
3e7ab9a472
commit
8e3a997fcb
|
@ -328,6 +328,19 @@ function install_smilodon {
|
|||
SMILODON_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)$(create_password 30)"
|
||||
fi
|
||||
|
||||
echo '#!/bin/bash' > ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "cd ${SMILODON_PATH}" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "export smilodon_domain_name=$SMILODON_ONION_HOSTNAME" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "export secret_key='$SMILODON_SECRET_KEY'" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "export mongodb_username='smilodon'" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "export mongodb_password='$SMILODON_ADMIN_PASSWORD'" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "export smilodon_admin_address=$MY_EMAIL_ADDRESS" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "export MAIL_SERVER='localhost'" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "export MAIL_PORT=25" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
echo "${SMILODON_PATH}/run_smilodon.sh" >> ${SMILODON_PATH}/run_smilodon.sh
|
||||
chmod +x ${SMILODON_PATH}/run_smilodon.sh
|
||||
chown smilodon:smilodon ${SMILODON_PATH}/run_smilodon.sh
|
||||
|
||||
echo '[Unit]' > /etc/systemd/system/smilodon.service
|
||||
echo 'Description=Smilodon ActivityPub messenger' >> /etc/systemd/system/smilodon.service
|
||||
echo 'After=network.target mongodb.service' >> /etc/systemd/system/smilodon.service
|
||||
|
@ -337,14 +350,9 @@ function install_smilodon {
|
|||
echo 'User=smilodon' >> /etc/systemd/system/smilodon.service
|
||||
echo 'Group=smilodon' >> /etc/systemd/system/smilodon.service
|
||||
echo "WorkingDirectory=${SMILODON_PATH}/" >> /etc/systemd/system/smilodon.service
|
||||
echo "ExecStart=/usr/bin/python3 run.py" >> /etc/systemd/system/smilodon.service
|
||||
echo "Environment=smilodon_domain_name=$SMILODON_ONION_HOSTNAME" >> /etc/systemd/system/smilodon.service
|
||||
echo "Environment=secret_key='$SMILODON_SECRET_KEY'" >> /etc/systemd/system/smilodon.service
|
||||
echo "Environment=mongodb_username='smilodon'" >> /etc/systemd/system/smilodon.service
|
||||
echo "Environment=mongodb_password='$SMILODON_ADMIN_PASSWORD'" >> /etc/systemd/system/smilodon.service
|
||||
echo "Environment=smilodon_admin_address=$MY_EMAIL_ADDRESS" >> /etc/systemd/system/smilodon.service
|
||||
echo "Environment=MAIL_SERVER='localhost'" >> /etc/systemd/system/smilodon.service
|
||||
echo "Environment=MAIL_PORT=25" >> /etc/systemd/system/smilodon.service
|
||||
echo "ExecStart=${SMILODON_PATH}/run_smilodon.sh" >> /etc/systemd/system/smilodon.service
|
||||
echo 'Restart=on-failure' >> /etc/systemd/system/smilodon.service
|
||||
echo 'RestartSec=10' >> /etc/systemd/system/smilodon.service
|
||||
echo '' >> /etc/systemd/system/smilodon.service
|
||||
echo '[Install]' >> /etc/systemd/system/smilodon.service
|
||||
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/smilodon.service
|
||||
|
|
Loading…
Reference in New Issue