mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Merge branch 'develop' into feature/custom-tf-model-127
This commit is contained in:
commit
b4ac12c301
161 changed files with 3447 additions and 2448 deletions
33
scripts/dist/add-swap.sh
vendored
Executable file
33
scripts/dist/add-swap.sh
vendored
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Adds a persistent swap file with a default size of 16G if swap space has not yet been configured.
|
||||
# bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/add-swap.sh)
|
||||
|
||||
# Show usage information if first argument is --help, and if not executed as root.
|
||||
if [[ $(id -u) != "0" ]] || [[ ${1} == "--help" ]]; then
|
||||
echo "Adds a persistent swap file with a default size of 16G if swap space has not yet been configured."
|
||||
echo "Usage: run \"${0##*/} [size]\" as root" 1>&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if swap is already configured.
|
||||
if [[ $(swapon --show) ]]; then
|
||||
echo "Swap space has already been configured:"
|
||||
swapon --show
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# Add swap as requested, 16G by default.
|
||||
SWAP_SIZE=${2:-16G}
|
||||
|
||||
fallocate -l "${SWAP_SIZE}" /swapfile
|
||||
chmod 600 /swapfile
|
||||
mkswap /swapfile
|
||||
swapon /swapfile
|
||||
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
|
||||
|
||||
# Check if swap was added successfully.
|
||||
echo "A persistent /swapfile with a size of ${SWAP_SIZE} was added:"
|
||||
swapon --show
|
||||
3
scripts/dist/install-admin-tools.sh
vendored
3
scripts/dist/install-admin-tools.sh
vendored
|
|
@ -30,5 +30,8 @@ GOBIN="/usr/local/bin" go install github.com/dustinkirkland/golang-petname/cmd/p
|
|||
echo "Installing doctl for using the DigitalOcean API...."
|
||||
GOBIN="/usr/local/bin" go install github.com/digitalocean/doctl/cmd/doctl@latest
|
||||
|
||||
echo "Installing Kustomize for Kubernetes configuration management...."
|
||||
GOBIN="/usr/local/bin" go install sigs.k8s.io/kustomize/kustomize/v5@latest
|
||||
|
||||
# Create a symbolic link for "duf" so that it is used instead of the original "df".
|
||||
ln -sf /usr/local/bin/duf /usr/local/bin/df
|
||||
Loading…
Add table
Add a link
Reference in a new issue