65 lines
1.7 KiB
Bash
65 lines
1.7 KiB
Bash
#!/bin/bash
|
|
|
|
# Copyright 2025-2026 Thomas Hintz
|
|
|
|
# This file is part of Nassella.
|
|
|
|
# Nassella is free software: you can redistribute it and/or modify it under the
|
|
# terms of the GNU Affero General Public License as published by the Free
|
|
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
# later version.
|
|
|
|
# Nassella is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with Nassella. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
set -e
|
|
|
|
echo "Waiting for db..."
|
|
|
|
until wp db check --allow-root
|
|
do
|
|
sleep 5
|
|
done
|
|
|
|
echo "db ready"
|
|
|
|
if ! wp core is-installed --allow-root
|
|
then
|
|
echo "installing wp"
|
|
|
|
wp core install \
|
|
--url="$WP_URL" \
|
|
--title="$WP_TITLE" \
|
|
--admin_user="$WP_ADMIN_USER" \
|
|
--admin_password="$WP_ADMIN_PASSWORD" \
|
|
--admin_email="$WP_ADMIN_EMAIL" \
|
|
--skip-email \
|
|
--allow-root
|
|
fi
|
|
|
|
echo "installing plugins"
|
|
|
|
if ! wp plugin is-installed daggerhart-openid-connect-generic
|
|
then
|
|
wp plugin install daggerhart-openid-connect-generic \
|
|
--activate \
|
|
--allow-root
|
|
fi
|
|
|
|
if ! wp plugin is-active daggerhart-openid-connect-generic
|
|
then
|
|
wp plugin activate daggerhart-openid-connect-generic
|
|
fi
|
|
|
|
echo "plugins installed. configuring plugins"
|
|
|
|
# after installing the plugs we can then use the plugin's CLI
|
|
# to configure the plugin
|
|
wp option update openid_connect_generic_settings 'the settings' # TODO lookup
|
|
# or
|
|
wp option patch update ...
|