Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install plugins automatically #64

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ Container images are configured using parameters passed at runtime (such as thos

| Parameter | Function |
| :-----------------------------------: | ---------------------------------------------------------------- |
| `-p 80` | Http webUI. |
| `-p 80` | Http webUI |
| `-e DUID=1000` | for UserID - see below for explanation |
| `-e DGID=1000` | for GroupID - see below for explanation |
| `-e TZ-e GRAV_MULTISITE=subdirectory` | Deploy a Grav multisite (subdirectory) installation. |
| `-e ROBOTS_DISALLOW=false` | Replace default /robots.txt file with one discouraging indexers. |
| `-e TZ=America/Los_Angeles` | Set your timezone |
| `-e GRAV_MULTISITE=subdirectory` | Deploy a Grav multisite (subdirectory) installation |
| `-e GRAV_PLUGINS=devtools,precache` | Install extra plugins automaticall (must be comma separated) |
| `-e ROBOTS_DISALLOW=false` | Replace default /robots.txt file with one discouraging indexers |
| `-v /var/www/backup` | Contains your location for Grav backups |
| `-v /var/www/logs` | Contains your location for your Grav log files |
| `-v /var/www/user` | Contains your Grav content |
Expand Down
9 changes: 9 additions & 0 deletions root/init-admin
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,18 @@ case $GRAV_MULTISITE in
mkdir -p /var/www/grav/user/sites
;;
*)
echo "Multisite not enabled, continuing"
;;
esac

# install plugins
if [[ "${GRAV_PLUGINS}x" != "x" ]]; then
IFS=',' read -ra plugins <<< "$GRAV_PLUGINS"
for plugin in "${plugins[@]}"; do
bin/gpm install -n "${plugin}"
done
fi

# allow specifying a custom client_max_body_size for nginx
if [[ -n $NGINX_CLIENT_MAX_BODY_SIZE ]]; then
sed -i.bak "s/client_max_body_size .*;/client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE};/g" /etc/nginx/nginx.conf
Expand Down
8 changes: 8 additions & 0 deletions root/init-core
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ case $GRAV_MULTISITE in
;;
esac

# install plugins
if [[ "${GRAV_PLUGINS}x" != "x" ]]; then
IFS=',' read -ra plugins <<< "$GRAV_PLUGINS"
for plugin in "${plugins[@]}"; do
bin/gpm install -n "${plugin}"
done
fi

# allow specifying a custom client_max_body_size for nginx
if [[ -n $NGINX_CLIENT_MAX_BODY_SIZE ]]; then
sed -i.bak "s/client_max_body_size .*;/client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE};/g" /etc/nginx/nginx.conf
Expand Down