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

Missing dashboard message #2714

Merged
merged 5 commits into from
Jun 18, 2024
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ permalink: /docs/en-US/changelog/

## 3.14 ( 2024 TBA )

### Enhancements

* VVV now shows a missing dashboard page with help when `www/default/index.php` is accidentally deleted instead of a HTTP forbidden error ( #2714 )

### Bug Fixes

* VVV will check if Docker is installed before defaulting to it on Arm64/Apple Silicon ( #2715 )
Expand Down
9 changes: 8 additions & 1 deletion provision/core/nginx/config/sites/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ server {
root /usr/share/nginx/html;
}

location = /nodashboard.html {
ssi on;
internal;
auth_basic off;
root /usr/share/nginx/html;
}

include /etc/nginx/custom-dashboard-extensions/*.conf;

location / {
index index.php;
index index.php /nodashboard.html;
try_files $uri $uri/ /index.php$is_args$args;
}

Expand Down
88 changes: 88 additions & 0 deletions provision/core/nginx/default-pages/nodashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dashboard file missings</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html, body {
height: 100%;
}
body {
width: 90%;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
background-color: #2b303b;
display: flex;
justify-content: center;
align-items: center;
align-content : center;
color: #c0c5ce;
height:100%;
}
pre, code {
background: #2b303b;
border-radius: 4px;
border: 1px solid #4f5b66;
}
code {
color: #a3be8c;
padding: .1em .2em;
}
main {
display: flex;
border-radius: 4px;
padding: 1.5em;
box-sizing: border-box;
margin: 1em 20px;
max-width: 800px;
}
.right {
align-self: center;
font-size:120px;
padding-left:60px;
}
h1 {
color:white;
}
a {
color: #ebcb8b;
background: #ebcb8b11;
}
a:hover {
background: #ebcb8b;
color: #ebcb8b11;
}
a:focus, a:active {
color: magenta;
}
@media only screen and (max-width: 601px) {
main {
flex-direction: column;
margin: 1em 0;
padding: 0;
}
.right {
order: 0;
padding-left: 0;
}
.left {
order: 1;
}
}
</style>
</head>
<body>
<main>
<div class="left">
<h1>The Dashboard Loader file is missing!</h1>
<p>It looks like <code>www/default/index.php</code> is missing!</p>
<p>This file and the <code>www/default</code> folder are needed for dashboard and other parts of VVV to function. This includes tools such as xdebug info/phpmyadmin/etc.</p>
<p><strong>You can fix this and restore the <code>www/default</code> folder with <code>git checkout www/default</code>.</strong></p>
</div>
<div class="right">
🚩
</div>
</main>
</body>
</html>
5 changes: 5 additions & 0 deletions provision/provision-dashboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ REPO=$1
BRANCH=${2:-master}
DIR="/srv/www/default/dashboard"

if [[ ! -f /srv/www/default/index.php ]]; then
vvv_warn " ! The dashboard loader index.hp file is missing!"
vvv_warn " Without this neither the default or custom dashboard will load, and you will get a HTTP 401 forbidden message. If you deleted your www folder, restore the www/default folder to fix this, 'git checkout www/default' might fix this for you."
fi

if [[ false != "dashboard" && false != "${REPO}" ]]; then
noroot mkdir -p "${DIR}"
# Clone or pull the resources repository
Expand Down
Loading