diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2023-09-01 14:34:53 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2023-09-01 14:34:53 -0300 |
commit | f8b0494a27f37233546fc558d6fe6bebdd0654a3 (patch) | |
tree | 4f03b7780cdd52cc5cdf548c6452bbcb40627beb /scripts/provision | |
download | copyfarai-f8b0494a27f37233546fc558d6fe6bebdd0654a3.tar.gz copyfarai-f8b0494a27f37233546fc558d6fe6bebdd0654a3.tar.bz2 |
Initial import
Diffstat (limited to 'scripts/provision')
-rwxr-xr-x | scripts/provision | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/provision b/scripts/provision new file mode 100755 index 0000000..2bd7dbd --- /dev/null +++ b/scripts/provision @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Provisioner +# + +# Parameters +DIRNAME="`dirname $0`" + +# Basic dependencies +DEPENDENCIES="mkdocs apache2 python3-pip pandoc pandoc-citeproc" + +# PyPI dependencies +DEPENDENCIES_PIP="mkdocs-bibtex mkdocs-material mkdocs-awesome-pages-plugin mkdocs-static-i18n" + +# Ensure an up-to-date system +sudo apt-get update && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean + +# Install dependencies +sudo apt install -y $DEPENDENCIES + +# Install python dependencies +pip3 install $DEPENDENCIES_PIP + +# Configure virtual host for the local service +cat <<-EOF | sudo tee /etc/apache2/sites-available/local.conf > /dev/null +<VirtualHost *:80> + ServerName estudo.local + DocumentRoot "/srv/shared/site" + + <Directory /srv/shared/site> + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + </Directory> +</VirtualHost> +EOF + +# Enable virtual host +sudo a2ensite local +sudo systemctl reload apache2 + +# Configure PATH +mkdir -p ~/.custom +echo 'export PATH=$PATH:/srv/shared/scripts' > ~/.custom/profile |