mirror of
https://github.com/jakejarvis/mastodon-installer.git
synced 2025-04-28 04:00:29 -04:00
install proper version of certbot
This commit is contained in:
parent
ae00e299d5
commit
85c1d27fd5
23
install.sh
23
install.sh
@ -93,8 +93,9 @@ sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
|
|||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
sendmail \
|
sendmail \
|
||||||
nginx \
|
nginx \
|
||||||
certbot \
|
python3 \
|
||||||
python3-certbot-nginx \
|
python3-venv \
|
||||||
|
libaugeas0
|
||||||
|
|
||||||
# setup yarn
|
# setup yarn
|
||||||
sudo npm install --global yarn
|
sudo npm install --global yarn
|
||||||
@ -176,15 +177,29 @@ sudo -u mastodon RAILS_ENV=production "$RBENV_ROOT/shims/bundle" exec rails db:s
|
|||||||
# manually precompile assets
|
# manually precompile assets
|
||||||
sudo -u mastodon RAILS_ENV=production "$RBENV_ROOT/shims/bundle" exec rails assets:precompile
|
sudo -u mastodon RAILS_ENV=production "$RBENV_ROOT/shims/bundle" exec rails assets:precompile
|
||||||
|
|
||||||
|
# install latest certbot
|
||||||
|
# https://certbot.eff.org/instructions?ws=nginx&os=pip
|
||||||
|
sudo python3 -m venv /opt/certbot/
|
||||||
|
sudo /opt/certbot/bin/pip install --upgrade pip
|
||||||
|
sudo /opt/certbot/bin/pip install certbot certbot-nginx
|
||||||
|
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
|
||||||
|
|
||||||
# order an ssl certificate from LE
|
# order an ssl certificate from LE
|
||||||
sudo certbot certonly --nginx -d "$MASTODON_DOMAIN" -m "$MASTODON_ADMIN_EMAIL"
|
sudo certbot certonly \
|
||||||
|
--non-interactive \
|
||||||
|
--agree-tos \
|
||||||
|
--no-eff-email \
|
||||||
|
--email "$MASTODON_ADMIN_EMAIL" \
|
||||||
|
--domains "$MASTODON_DOMAIN" \
|
||||||
|
--nginx
|
||||||
|
|
||||||
# configure nginx
|
# configure nginx
|
||||||
|
sudo sed -i /etc/nginx/nginx.conf -e "s/user www-data;/user mastodon;/g"
|
||||||
sudo cp "$MASTODON_ROOT/live/dist/nginx.conf" "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf"
|
sudo cp "$MASTODON_ROOT/live/dist/nginx.conf" "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf"
|
||||||
sudo sed -i "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf" -e "s/example.com/$MASTODON_DOMAIN/g"
|
sudo sed -i "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf" -e "s/example.com/$MASTODON_DOMAIN/g"
|
||||||
sudo sed -i "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf" -e "/ssl_certificate/s/^ #//"
|
sudo sed -i "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf" -e "/ssl_certificate/s/^ #//"
|
||||||
sudo ln -s "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf" "/etc/nginx/sites-enabled/$MASTODON_DOMAIN.conf"
|
sudo ln -s "/etc/nginx/sites-available/$MASTODON_DOMAIN.conf" "/etc/nginx/sites-enabled/$MASTODON_DOMAIN.conf"
|
||||||
sudo sed -i /etc/nginx/nginx.conf -e "s/user www-data;/user mastodon;/g"
|
sudo rm /etc/nginx/sites-enabled/default
|
||||||
sudo systemctl restart nginx
|
sudo systemctl restart nginx
|
||||||
|
|
||||||
# configure mastodon systemd services
|
# configure mastodon systemd services
|
||||||
|
Loading…
x
Reference in New Issue
Block a user