modified plugin OpenID Connect Generic
version 3.10.0
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
# Activate the plugin.
|
||||
cd "/app"
|
||||
echo "Activating plugin..."
|
||||
if ! wp plugin is-active daggerhart-openid-connect-generic 2>/dev/null; then
|
||||
wp plugin activate daggerhart-openid-connect-generic --quiet
|
||||
fi
|
||||
|
||||
echo "Done!"
|
@ -0,0 +1,57 @@
|
||||
// For format details, https://containers.dev/implementors/json_reference/.
|
||||
{
|
||||
"name": "WordPress Development Environment",
|
||||
"dockerComposeFile": "../docker-compose.yml",
|
||||
"service": "app",
|
||||
"mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"],
|
||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": ["ms-azuretools.vscode-docker"]
|
||||
}
|
||||
},
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {
|
||||
"./local-features/welcome-message": "latest"
|
||||
},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [8080, 8081, 8026, 3306],
|
||||
|
||||
// Maps a port number, "host:port" value, range, or regular expression to a set of default options. See port attributes for available options
|
||||
"portsAttributes": {
|
||||
"8080": {
|
||||
"label": "WordPress Development/Testing Site"
|
||||
},
|
||||
"8081": {
|
||||
"label": "phpMyAdmin"
|
||||
},
|
||||
"8026": {
|
||||
"label": "MailHog"
|
||||
},
|
||||
"3306": {
|
||||
"label": "MariaDB"
|
||||
}
|
||||
},
|
||||
|
||||
// Use `onCreateCommand` to run commands as part of the container creation.
|
||||
//"onCreateCommand": "chmod +x .devcontainer/install.sh && .devcontainer/install.sh",
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "chmod +x .devcontainer/setup.sh && .devcontainer/setup.sh",
|
||||
|
||||
// Use 'postStartCommand' to run commands after the container has started.
|
||||
"postStartCommand": "chmod +x .devcontainer/activate.sh && .devcontainer/activate.sh",
|
||||
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "wp_php",
|
||||
|
||||
// A set of name-value pairs that sets or overrides environment variables for the devcontainer.json supporting service / tool (or sub-processes like terminals) but not the container as a whole.
|
||||
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" }
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "welcome-message",
|
||||
"name": "Install the First Start Welcome Message",
|
||||
"install": {
|
||||
"app": "",
|
||||
"file": "install.sh"
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Copy the welcome message
|
||||
if [ ! -f /usr/local/etc/vscode-dev-containers/first-run-notice.txt ]; then
|
||||
echo "Installing First Run Notice..."
|
||||
echo -e "👋 Welcome to \"OpenID Connect for WP Development\" in Dev Containers!\n\n🛠️ Your environment is fully setup with all the required software.\n\n🚀 To get started, wait for the \"postCreateCommand\" to finish setting things up, then open the portforwarded URL and append '/wp/wp-admin'. Login to the WordPress Dashboard using \`admin/password\` for the credentials.\n" | sudo tee /usr/local/etc/vscode-dev-containers/first-run-notice.txt
|
||||
fi
|
||||
|
||||
echo "Done!"
|
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
# true is shell command and always return 0
|
||||
# false always return 1
|
||||
if [ -z "${CODESPACES}" ] ; then
|
||||
SITE_HOST="http://localhost:8080"
|
||||
else
|
||||
SITE_HOST="https://${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
|
||||
fi
|
||||
|
||||
PLUGIN_DIR=/workspaces/openid-connect-generic
|
||||
|
||||
# Attempt to make ipv4 traffic have a higher priority than ipv6.
|
||||
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
|
||||
|
||||
# Install Composer dependencies.
|
||||
cd "${PLUGIN_DIR}"
|
||||
echo "Installing Composer dependencies..."
|
||||
COMPOSER_NO_INTERACTION=1 COMPOSER_ALLOW_XDEBUG=0 COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --quiet
|
||||
|
||||
# Install NPM dependencies.
|
||||
cd "${PLUGIN_DIR}"
|
||||
if [ ! -d "node_modules" ]; then
|
||||
echo "Installing NPM dependencies..."
|
||||
npm ci
|
||||
fi
|
||||
|
||||
# Setup the WordPress environment.
|
||||
cd "/app"
|
||||
if ! wp core is-installed 2>/dev/null; then
|
||||
echo "Setting up WordPress at $SITE_HOST"
|
||||
wp core install --url="$SITE_HOST" --title="OpenID Connect Development" --admin_user="admin" --admin_email="admin@example.com" --admin_password="password" --skip-email --quiet
|
||||
fi
|
||||
|
||||
echo "Done!"
|
Reference in New Issue
Block a user