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

Ft/navigation header setup #4

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
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: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
WORDPRESS_DB_HOST=host.docker.internal:3307
WORDPRESS_DB_USER=dbuser
WORDPRESS_DB_PASSWORD=dbpassword
WORDPRESS_DB_NAME=dbname
WORDPRESS_TABLE_PREFIX=wp_
WP_DEBUG=true
SITE_URL=http://localhost:8080

22 changes: 7 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,9 @@ wp-content/mu-plugins/wpe-wp-sign-on-plugin*
/xmlrpc.php
/wp-admin
/wp-includes
/wp-content/themes/twentyten
/wp-content/themes/boss
/wp-content/themes/boss-child
/wp-content/themes/twentyeleven
/wp-content/themes/twentytwelve
/wp-content/themes/twentythirteen
/wp-content/themes/twentyfourteen
/wp-content/themes/twentyfifteen
/wp-content/themes/twentysixteen
/wp-content/themes/twentyseventeen
/wp-content/themes/twentyeighteen
/wp-content/themes/twentynineteen
/wp-content/themes/twentytwenty
/wp-content/plugins/akismet*
/wp-content/themes/*
!/wp-content/themes/academyAfrica
!/wp-content/themes/hello-elementor
/wp-content/plugins/*
!/wp-content/plugins/index.php
/wp-content/mu-plugins
Expand All @@ -84,6 +73,7 @@ apple-touch-icon.png
favicon.ico
wpe-deploy-status-academyafrica
robots.txt
wordpress

# large/disallowed file types
# a CDN should be used for these
Expand Down Expand Up @@ -118,4 +108,6 @@ robots.txt
*.asx
*.asf
*.wmv
*.avi
*.avi

.env
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
### Repository Setup Guide

1. **Add SSH Key to WP Engine**

To get started, add your SSH key to WP Engine. For more information, refer to the [WP Engine SSH Gateway Documentation](https://wpengine.com/support/ssh-gateway/).

2. **Create a Working Directory and Clone the Repository**

Create a working directory and clone this repository into it.

3. **Download and Restore Backups from WP Engine**

Download and restore the latest backups from WP Engine using the instructions provided in the [WP Engine Restore Documentation](https://wpengine.com/support/restore/). Unzip the backups into your working directory.

4. **Access the Remote Database Using SSH**

Use SSH and local port forwarding to access the remote database. Here's an example command:

```bash
ssh -L 3307:127.0.0.1:3306 -i ~/.ssh/wpengine_ed25519 -o IdentitiesOnly=yes [email protected]
```

For more details, refer to the [WP Engine Remote Database Access Guide](https://wpengine.com/support/setting-remote-database-access/).

5. **Update Environment Variables**

Update the environment variables in the `.env` file using the database credentials from WP Engine. You can find the credentials with the following command once you have SSH access to the remote database:

```bash
grep WPENGINE_SESSION_DB_PASSWORD ./sites/environmentname/_wpeprivate/config.json
```

To access the admin dashboard from localhost, add the following to `wp-config.php` in the `wordpress` directory after the `WP_DEBUG` line:

```php
define( 'WP_SITEURL', 'http://localhost:8080' );
define( 'WP_HOME', 'http://localhost:8080' );
```

6. **Start Containers**

Run the following command to start the containers using Docker Compose:

```bash
docker-compose up -d
```

7. **Access the Site**

You can now access the site at [http://localhost:8080](http://localhost:8080).
49 changes: 49 additions & 0 deletions contrib/docker-compose/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
server {
listen 80;
listen [::]:80;

server_name localhost;
## Your only path reference.
root /var/www/html;

index index.php;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location / {
# include the "?$args" part so non-default permalinks doesn't break when using query string
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini\
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass wordpress:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_read_timeout 600;
}
client_max_body_size 100M;

location ~ /\.ht {
deny all;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
3 changes: 3 additions & 0 deletions contrib/docker-compose/php/uploads.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 600
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.9'

services:
wordpress:
image: wordpress:6.3.2
restart: unless-stopped
env_file: .env
ports:
- 8080:80
environment:
WORDPRESS_CONFIG_EXTRA: |
define( 'WP_SITEURL', '${SITE_URL}' );
define( 'WP_HOME', '${SITE_URL}' );
define( 'WP_DEBUG', ${WP_DEBUG} );
volumes:
- ./wordpress:/var/www/html
- ./wp-content/themes:/var/www/html/wp-content/themes
- ./wp-content/plugins:/var/www/html/wp-content/plugins
- ./contrib/docker-compose/php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"content":[{"id":"3a592e3f","settings":{"flex_direction":"row","flex_gap":{"unit":"px","size":0,"column":"0","row":"0"},"background_background":"classic","__globals__":{"background_color":"globals\/colors?id=ba19cf4"},"content_width":"full","min_height":{"unit":"px","size":92,"sizes":[]},"flex_justify_content":"center","flex_align_items":"center","flex_wrap":"nowrap","padding":{"unit":"px","top":"0","right":"60","bottom":"0","left":"60","isLinked":false},"width_tablet_extra":{"unit":"%","size":"","sizes":[]},"width_tablet":{"unit":"%","size":"","sizes":[]},"width_mobile":{"unit":"%","size":"","sizes":[]},"padding_mobile":{"unit":"px","top":"0","right":"024","bottom":"0","left":"24","isLinked":false}},"elements":[{"id":"6725b161","settings":{"flex_direction":"row","content_width":"full","width":{"unit":"%","size":20},"flex_justify_content":"center","flex_align_items":"center","_flex_size":"none","_element_width":"initial","width_tablet_extra":{"unit":"%","size":80,"sizes":[]},"width_tablet":{"unit":"%","size":"","sizes":[]},"width_mobile":{"unit":"%","size":80,"sizes":[]}},"elements":[{"id":"14e6a510","settings":{"__dynamic__":{"image":"[elementor-tag id=\"\" name=\"site-logo\" settings=\"%7B%7D\"]"},"image_size":"custom","image_custom_dimension":{"width":"35","height":"35"}},"elements":[],"isInner":false,"widgetType":"theme-site-logo","elType":"widget"},{"id":"6c89f1a","settings":{"__dynamic__":{"title":"[elementor-tag id=\"\" name=\"site-title\" settings=\"%7B%22before%22%3A%22%22%2C%22after%22%3A%22%22%2C%22fallback%22%3A%22%22%7D\"]","link":"[elementor-tag id=\"\" name=\"site-url\" settings=\"%7B%7D\"]"},"title":"Add Your Heading Text Here","title_color":"#FFFFFF","typography_typography":"custom","typography_font_family":"Open Sans","typography_font_size":{"unit":"px","size":18,"sizes":[]},"typography_font_weight":"600","typography_font_style":"normal","typography_line_height":{"unit":"px","size":28,"sizes":[]},"typography_font_size_mobile":{"unit":"px","size":13.5,"sizes":[]},"typography_line_height_mobile":{"unit":"px","size":"","sizes":[]}},"elements":[],"isInner":false,"widgetType":"theme-site-title","elType":"widget"}],"isInner":true,"elType":"container"},{"id":"60c04b3b","settings":{"flex_direction":"row","content_width":"full","width":{"unit":"%","size":25},"flex_justify_content":"flex-end","flex_align_items":"center","_flex_size":"grow","width_tablet_extra":{"unit":"%","size":10,"sizes":[]},"width_tablet":{"unit":"%","size":"","sizes":[]},"width_mobile":{"unit":"%","size":10,"sizes":[]},"flex_justify_content_widescreen":"flex-end","_flex_align_self_widescreen":"center","_flex_align_self_mobile":"center","_flex_size_widescreen":"grow"},"elements":[{"id":"71f2bcaf","settings":{"selected_icon":{"value":"fas fa-search","library":"fa-solid"},"primary_color":"#FFFFFF","hover_primary_color":"#FFFFFF","size":{"unit":"px","size":24,"sizes":[]},"_flex_align_self":"center","_flex_order":"end","hide_widescreen":"hidden-widescreen","hide_desktop":"hidden-desktop","hide_laptop":"hidden-laptop","align_mobile":"center","_flex_align_self_widescreen":"flex-end","_flex_align_self_mobile":"flex-end"},"elements":[],"isInner":false,"widgetType":"icon","elType":"widget"},{"id":"7f9c050a","settings":{"placeholder":"Search Courses","button_text":"Search","size":{"unit":"px","size":40,"sizes":[]},"input_typography_typography":"custom","input_typography_font_family":"Open Sans","input_typography_font_size":{"unit":"px","size":14,"sizes":[]},"input_typography_font_weight":"400","input_typography_text_transform":"none","input_typography_font_style":"italic","input_typography_line_height":{"unit":"px","size":18,"sizes":[]},"icon_size":{"unit":"px","size":16,"sizes":[]},"_flex_size":"grow","__globals__":{"button_text_color":"globals\/colors?id=ba19cf4","button_background_color":"globals\/colors?id=fc1e4c6","input_text_color":"globals\/colors?id=bc80d88"},"border_radius":{"unit":"px","size":0,"sizes":[]},"hide_tablet_extra":"hidden-tablet_extra","hide_tablet":"hidden-tablet","hide_mobile":"hidden-mobile"},"elements":[],"isInner":false,"widgetType":"search-form","elType":"widget"}],"isInner":true,"elType":"container"},{"id":"168a8fd","settings":{"flex_direction":"row","content_width":"full","width":{"unit":"%","size":55},"flex_justify_content":"space-between","flex_align_items":"center","_flex_size":"grow","_element_width":"initial","_flex_order_tablet_extra":"start","width_tablet_extra":{"unit":"%","size":10,"sizes":[]},"width_tablet":{"unit":"%","size":"","sizes":[]},"width_mobile":{"unit":"%","size":10,"sizes":[]}},"elements":[{"id":"10dc7bab","settings":{"menu":"navigation","align_items":"right","pointer":"none","submenu_icon":{"value":"fas fa-angle-down","library":"fa-solid"},"menu_typography_typography":"custom","menu_typography_font_family":"Open Sans","menu_typography_font_size":{"unit":"px","size":18,"sizes":[]},"menu_typography_font_weight":"600","menu_typography_line_height":{"unit":"px","size":21.6,"sizes":[]},"__globals__":{"color_menu_item":"globals\/colors?id=5b9c1e6","toggle_background_color":"globals\/colors?id=ba19cf4","background_color_dropdown_item":"","color_dropdown_item_hover":"globals\/colors?id=ba19cf4","background_color_dropdown_item_hover":"globals\/colors?id=aa6a735","color_dropdown_item":"globals\/colors?id=ba19cf4","dropdown_divider_color":"globals\/colors?id=ba19cf4","dropdown_border_color":"globals\/colors?id=ba19cf4","toggle_background_color_hover":"globals\/colors?id=ba19cf4","background_color_dropdown_item_active":"globals\/colors?id=aa6a735","color_dropdown_item_active":"globals\/colors?id=ba19cf4"},"full_width":"stretch","_flex_size":"grow","toggle_align":"left","dropdown":"tablet_extra","color_menu_item":"#F7F9FD","dropdown_typography_typography":"custom","dropdown_typography_font_family":"Open Sans","dropdown_typography_font_size_tablet_extra":{"unit":"px","size":16,"sizes":[]},"dropdown_typography_font_weight":"400","dropdown_typography_text_transform":"uppercase","dropdown_typography_font_style":"normal","dropdown_typography_letter_spacing_tablet_extra":{"unit":"px","size":1.6,"sizes":[]},"dropdown_border_border":"solid","padding_horizontal_dropdown_item_tablet_extra":{"unit":"px","size":20,"sizes":[]},"padding_vertical_dropdown_item_tablet_extra":{"unit":"px","size":20,"sizes":[]},"dropdown_divider_border":"solid","dropdown_divider_width":{"unit":"px","size":1,"sizes":[]},"dropdown_top_distance_tablet_extra":{"unit":"px","size":28,"sizes":[]},"toggle_color":"#FFFFFF","toggle_size_tablet_extra":{"unit":"px","size":24,"sizes":[]},"color_dropdown_item_hover":"#0C1A81","dropdown_typography_font_size":{"unit":"px","size":13,"sizes":[]},"dropdown_border_width":{"unit":"px","top":"1","right":"1","bottom":"1","left":"1","isLinked":true},"toggle_background_color":"#0C1A81","custom_css":"nav ul.elementor-nav-menu li.sign-in.menu-item {\n background-color: #fff;\n}\n\nnav ul.elementor-nav-menu li.sign-in.menu-item a.elementor-item.elementor-item-anchor {\n color: #0C1A81;\n font-family: Open Sans;\n font-size: 16px;\n font-style: normal;\n font-weight: 800;\n line-height: 19px;\n letter-spacing: 1.6px;\n text-transform: uppercase;\n}\n\n\nnav ul.elementor-nav-menu li.language-link.menu-item a i {\n font-size:24px !important;\n}\n\nnav ul.elementor-nav-menu li.user-profile.menu-item a i {\n font-size:24px !important;\n}\n\n@media all and (max-width: 1152px) {\n nav ul.elementor-nav-menu {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n }\n\n nav ul.elementor-nav-menu li.sign-in.menu-item {\n order: -1;\n background-color: #EFF0FD;\n }\n\n nav ul.elementor-nav-menu li.user-profile.menu-item {\n order: -1;\n }\n\n nav ul.elementor-nav-menu li.sign-in.menu-item a.elementor-item.elementor-item-anchor {\n color: #0C1A81;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu {\n background-color: #fff;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item {\n display: flex;\n align-items: center;\n align-self: stretch;\n background: #0C1A81;\n box-shadow: 0px 1px 0px 0px #E2E8F0;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item:not(:last-child) {\n border-bottom: 1.5px solid #fff;\n }\n\n nav.elementor-nav-menu--dropdown ul.elementor-nav-menu li.menu-item a.elementor-item {\n color: #fff;\n font-family: Open Sans;\n font-size: 16px;\n font-style: normal;\n font-weight: 800;\n line-height: 19px;\n letter-spacing: 1.6px;\n text-transform: uppercase;\n width: 100%;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item.menu-item-has-children {\n display: flex;\n flex-direction: column;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item.menu-item-has-children a {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item.menu-item-has-children a.highlighted {\n background-color: #0C1A81;\n color: #fff;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item.menu-item-has-children ul {\n width: 100% !important;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item.menu-item-has-children ul li {\n background-color: #fff;\n }\n\n nav.elementor-nav-menu--dropdown.elementor-nav-menu__container ul.elementor-nav-menu li.menu-item.menu-item-has-children ul li:not(:last-child) {\n border-bottom: 2px solid #0C1A81;\n }\n}","toggle_color_hover":"#FFFFFF","color_dropdown_item":"#0C1A81","dropdown_border_color":"#0C1A81","dropdown_divider_color":"#0C1A81","toggle_background_color_hover":"#0C1A81","background_color_dropdown_item":"#FFFFFF","menu_id":12859},"elements":[],"isInner":false,"widgetType":"nav-menu","elType":"widget"}],"isInner":true,"elType":"container"}],"isInner":false,"elType":"container"}],"page_settings":[],"version":"0.4","title":"Top Header","type":"header"}