Docker: Add enable_firewall.sh script to cloud config

This commit is contained in:
Michael Mayer 2021-08-05 23:47:47 +02:00
parent e643bdb26b
commit fe8599961d
2 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Install ufw package if needed:
apt-get update && apt-get install -y --no-install-recommends ufw && apt-get autoclean && apt-get autoremove
# Basic ufw firewall setup allowing ssh, http, and https:
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow http
ufw allow https
ufw --force enable

11
docker/examples/cloud/install_photoprism.sh Normal file → Executable file
View file

@ -11,7 +11,16 @@
# #
# cd /var/lib/cloud/scripts/per-instance # cd /var/lib/cloud/scripts/per-instance
# curl -fsSL https://dl.photoprism.org/docker/cloud/install_photoprism.sh > install_photoprism.sh # curl -fsSL https://dl.photoprism.org/docker/cloud/install_photoprism.sh > install_photoprism.sh
# chmod 700 install_photoprism.sh # curl -fsSL https://dl.photoprism.org/docker/cloud/enable_firewall.sh > enable_firewall.sh
# chmod 700 install_photoprism.sh enable_firewall.sh
# ./enable_firewall.sh
#
# Installing the ufw firewall as shown above is optional but recommended.
#
# When building a reusable image for DigitalOcean, you also need to run the following scripts:
#
# bash <(curl -s https://raw.githubusercontent.com/digitalocean/marketplace-partners/master/scripts/90-cleanup.sh)
# bash <(curl -s https://raw.githubusercontent.com/digitalocean/marketplace-partners/master/scripts/99-img-check.sh)
# #
# Enjoy! # Enjoy!