diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..53630e18 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 0092448f..0d80629b 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,7 @@ cython_debug/ .idea/ env + +*/wordpress-plugin +*/wordpress-theme +*/__MACOSX diff --git a/example/.env.example b/example/.env.example new file mode 100644 index 00000000..9fcbb6e9 --- /dev/null +++ b/example/.env.example @@ -0,0 +1,4 @@ +MYSQL_DATABASE=wordpress +MYSQL_USER=wp_user +MYSQL_PASSWORD=wp_password +MYSQL_ROOT_PASSWORD=root_password \ No newline at end of file diff --git a/example/README.md b/example/README.md index 1ecd9122..790f8209 100644 --- a/example/README.md +++ b/example/README.md @@ -16,4 +16,31 @@ Run the stack sudo docker-compose up ```` -Point your web browser to `http://.....` to start your EUDI Wallet authentication to a Wordpress demo site. +Point your web browser to `http://localhost:8080` to start your EUDI Wallet authentication to a Wordpress demo site. + + +## First Installation + +Follow the on-screen instructions to complete the WordPress installation. +1. You will be prompted to enter some basic information to complete the initial configuration of your WordPress site. This includes: + * Site Title: Enter a title for your WordPress site. + * Username: Choose a username for your administrator account. + * Password: Choose a strong password for your administrator account. + * Your Email: Enter an email address where you can receive notifications from your WordPress site. + * Search Engine Visibility: Choose whether or not you want search engines to index your site. +2. Click on the “Install WordPress” button to complete the initial configuration. + +## Installing the ItaliaWP2 Theme + +1. Log in to the WordPress dashboard at http://localhost:8080/wp-admin (replace 8080 with the port specified in the docker-compose.yml file) using your administrator credentials. +2. In the sidebar, go to “Appearance” > “Themes” and activate the ItaliaWP2 theme that you just installed. + +After following these steps, your WordPress instance should be up and running with the ItaliaWP2 theme installed and activated. + +## Installing the OneLogin SAML SSO plugin + +1. Log in to the WordPress dashboard at http://localhost:8080/wp-admin (replace 8080 with the port specified in the docker-compose.yml file) using your administrator credentials. +2. Under [plugins](http://localhost:8080/wp-admin/plugins.php), activate the plugin OneLogin SAML SSO. +3. Configure the plugin OneLogin SAML SSO in the [settings tab](http://localhost:8080/wp-admin/options-general.php?page=onelogin_saml_configuration). + +To configure a generic SAML connection, you will need to enter appropriate values in OneLogin SAML SSO plugin settings. These include Identity Provider URL, Assertion Consumer Service URL, Single Logout Service URL, and other parameters specific to your SAML configuration. diff --git a/example/docker-compose.yml b/example/docker-compose.yml new file mode 100644 index 00000000..a2b1aae8 --- /dev/null +++ b/example/docker-compose.yml @@ -0,0 +1,59 @@ +version: '3.1' + +services: + database: + mem_limit: 2048m + image: mariadb:10.6.4-focal + restart: unless-stopped + ports: + - 3306:3306 + env_file: .env + environment: + MYSQL_DATABASE: '${MYSQL_DATABASE}' + MYSQL_USER: '${MYSQL_USER}' + MYSQL_PASSWORD: '${MYSQL_PASSWORD}' + MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}' + volumes: + - db-data:/var/lib/mysql + networks: + - wordpress-network + + phpmyadmin: + depends_on: + - database + image: arm64v8/phpmyadmin:5.2.1-apache + restart: unless-stopped + ports: + - 8081:80 + env_file: .env + environment: + PMA_HOST: database + MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}' + networks: + - wordpress-network + + wordpress: + depends_on: + - database + image: wordpress:5.4.0-apache + restart: unless-stopped + ports: + - 8080:80 + env_file: .env + environment: + WORDPRESS_DB_HOST: database:3306 + WORDPRESS_DB_NAME: '${MYSQL_DATABASE}' + WORDPRESS_DB_USER: '${MYSQL_USER}' + WORDPRESS_DB_PASSWORD: '${MYSQL_PASSWORD}' + volumes: + - ./wordpress-plugin/onelogin-saml-sso/:/var/www/html/wp-content/plugins/onelogin-saml-sso/ + - ./wordpress-theme/italiawp2/:/var/www/html/wp-content/themes/italiawp2/ + networks: + - wordpress-network + +volumes: + db-data: + +networks: + wordpress-network: + driver: bridge \ No newline at end of file diff --git a/example/docker-prepare.sh b/example/docker-prepare.sh new file mode 100755 index 00000000..334dcadf --- /dev/null +++ b/example/docker-prepare.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +plugin_url="https://downloads.wordpress.org/plugin/onelogin-saml-sso.zip" +theme_url="https://raw.githubusercontent.com/italia/design-wordpress-theme-italiaWP2/master/italiawp2.zip" +plugin_folder="./wordpress-plugin" +theme_folder="./wordpress-theme" + +mkdir -p $plugin_folder +mkdir -p $theme_folder + +#download and unzip of plugin +curl -O $plugin_url +unzip onelogin-saml-sso.zip +rm onelogin-saml-sso.zip + +# Move the content of the subfolder to the specified folder +mv onelogin-saml-sso $plugin_folder + +# Remove the empty folder +rmdir onelogin-saml-sso/onelogin-saml-sso +rmdir onelogin-saml-sso + +#download and unzip of theme +curl -O $theme_url +unzip italiawp2.zip +rm italiawp2.zip + +# Move the unzipped content to the specified folder +mv italiawp2 $theme_folder \ No newline at end of file