Initial version
This commit is contained in:
commit
3c25b0a6af
4
.gemini/settings.json
Normal file
4
.gemini/settings.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"contextFileName": ["GEMINI.md"],
|
||||||
|
"telemetry": { "enabled": true, "target": "otlp" }
|
||||||
|
}
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
*/node_modules/
|
||||||
|
*/build/
|
||||||
18
.htaccess
Normal file
18
.htaccess
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
DirectoryIndex index.php index.html
|
||||||
|
Options -Indexes
|
||||||
|
Options -MultiViews
|
||||||
|
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# 0) Serve existing files/directories as-is
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
|
RewriteRule ^ - [L]
|
||||||
|
|
||||||
|
# 1) Internal map: /page or /page/ -> /page.php (if such PHP file exists)
|
||||||
|
RewriteCond %{REQUEST_FILENAME}.php -f
|
||||||
|
RewriteRule ^(.+?)/?$ $1.php [L]
|
||||||
|
|
||||||
|
# 2) Optional: strip trailing slash for non-directories (keeps .php links working)
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule ^(.+)/$ $1 [R=301,L]
|
||||||
0
.perm_test_apache
Normal file
0
.perm_test_apache
Normal file
0
.perm_test_exec
Normal file
0
.perm_test_exec
Normal file
155
GEMINI.md
Normal file
155
GEMINI.md
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
Here’s a drop-in **`gemini.md`** for the LAMP golden machine. Put it in the project root (i.e., `WORKSPACE_ROOT`, which is also the Apache DocumentRoot). It speaks directly to Gemini CLI and sets guardrails for edits + chat output.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# Gemini — Working Instructions (Flatlogic LAMP VM)
|
||||||
|
|
||||||
|
You are **Gemini CLI** running inside a **Flatlogic Dev VM** on the **LAMP golden image**.
|
||||||
|
Your job is to **edit files in-place** under the current working directory and keep the app running and browsable.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Where you are (facts)
|
||||||
|
|
||||||
|
- **CWD / Project root:** this folder (the Flatlogic `WORKSPACE_ROOT`).
|
||||||
|
- It is also the **Apache DocumentRoot**.
|
||||||
|
- `index.php` lives here and is served as `/`.
|
||||||
|
- **Stack:** Apache 2.4+ and PHP 8.x (classic LAMP). No framework by default.
|
||||||
|
- **Network:** The VM exposes HTTP(S) via a **Cloudflare Tunnel**. Locally it’s served on `http://localhost:80`.
|
||||||
|
- **Privileges:** You are a regular user. Do **not** attempt system package changes or service reconfiguration.
|
||||||
|
- **VCS:** A Git repo may be present. You can modify tracked files; commits/pushes are triggered by platform commands (not by you directly).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## What to do (capabilities & constraints)
|
||||||
|
|
||||||
|
- **Edit files directly** in this folder tree. Prefer small, safe changes.
|
||||||
|
- **Stay within the project root.** Do not write outside this directory.
|
||||||
|
- **Do not change Apache/system configs** or assume root access.
|
||||||
|
- **Keep the app immediately browsable.** After changes, `/` must still load without PHP errors.
|
||||||
|
- **No database is guaranteed.** If you need persistence, propose **file-based** storage first. If MySQL is explicitly requested later, ask for credentials.
|
||||||
|
- **Composer/frameworks:** Avoid adding unless asked. Stick to vanilla PHP unless requirements say otherwise.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How Flatlogic Chat sees you
|
||||||
|
|
||||||
|
- Your **stdout/stderr is streamed** to a human via Flatlogic Cloud.
|
||||||
|
- Keep output **concise and actionable**:
|
||||||
|
1. Start with a one-line **Plan**.
|
||||||
|
2. Perform changes (write files).
|
||||||
|
3. Print a **Summary** of what changed.
|
||||||
|
4. End with **Next** (a yes/no or options).
|
||||||
|
- If an operation fails, print a short **Error** line and what you’ll try next.
|
||||||
|
|
||||||
|
**Output template (guideline):**
|
||||||
|
```
|
||||||
|
|
||||||
|
Plan: <1–2 short bullets>
|
||||||
|
|
||||||
|
Changed:
|
||||||
|
|
||||||
|
* <path>: <very short description>
|
||||||
|
* <path>: <very short description>
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
* <any caveat or test instruction>
|
||||||
|
|
||||||
|
Next: <question or options>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
> You generally do **not** need to print full file contents. When useful, show **small excerpts only**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## File editing rules (PHP)
|
||||||
|
|
||||||
|
- **index.php must keep working.** If you introduce new includes, ensure relative paths exist.
|
||||||
|
- **Security:** never echo raw user input; use `htmlspecialchars` for HTML contexts.
|
||||||
|
- **Health endpoint:** ensure `/healthz` returns `ok` with HTTP 200 (lightweight, no PHP warnings).
|
||||||
|
- Implement as `healthz.php` or route via `index.php`—your choice, but keep it simple.
|
||||||
|
- **Configuration:** if you create config, use a single `config.php` loaded by `index.php`.
|
||||||
|
- **Error handling:** avoid `display_errors` changes. Use defensive checks and small try/catch blocks.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Testing after changes
|
||||||
|
|
||||||
|
- Print a quick checklist the human can run:
|
||||||
|
- “Open `/`—should show …”
|
||||||
|
- “Open `/healthz`—should return ‘ok’”
|
||||||
|
- Mention any new endpoints you add.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Git & deploy (how your work is shipped)
|
||||||
|
|
||||||
|
- The platform will run `git pull`, `git commit_push`, and `server.restart` when appropriate.
|
||||||
|
- **You don’t run git here.** Just make sure your changes are saved to disk.
|
||||||
|
|
||||||
|
**Commit message convention** (for your summaries so humans can reuse):
|
||||||
|
- `feat: ...` user-visible features
|
||||||
|
- `fix: ...` bug fix
|
||||||
|
- `chore: ...` small housekeeping
|
||||||
|
- `docs: ...` text-only updates
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Do not do
|
||||||
|
|
||||||
|
- Don’t install system packages or restart Apache yourself.
|
||||||
|
- Don’t write outside the project root.
|
||||||
|
- Don’t introduce heavy dependencies without asking.
|
||||||
|
- Don’t leak secrets or create random credentials.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Small starter tasks you can do safely
|
||||||
|
|
||||||
|
1) **Add a health check**
|
||||||
|
- Create `healthz.php` with plain `ok`.
|
||||||
|
- Optionally link from `index.php` footer for quick access.
|
||||||
|
|
||||||
|
2) **Improve the landing page**
|
||||||
|
- In `index.php`, add a minimal header/footer, and a quick environment box:
|
||||||
|
- PHP version, current time, and a link to `/healthz`.
|
||||||
|
|
||||||
|
3) **Basic contact form (no DB)**
|
||||||
|
- Add `contact.php` with a POST form and server-side validation.
|
||||||
|
- On submit, write a sanitized line to `data/contact.log` (create folder if missing).
|
||||||
|
|
||||||
|
(Only perform these if asked; otherwise wait for explicit prompts.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Example: Health check (what good output looks like)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Plan: add /healthz endpoint and link it from index.php
|
||||||
|
|
||||||
|
Changed:
|
||||||
|
|
||||||
|
* healthz.php: returns 'ok' with HTTP 200
|
||||||
|
* index.php: footer link to /healthz
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
* Tested locally via PHP include; endpoint is static and safe.
|
||||||
|
|
||||||
|
Next: Proceed to add a minimal env box on the homepage?
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Telemetry note
|
||||||
|
|
||||||
|
- Your token usage and latencies are measured. Keep prompts/responses compact.
|
||||||
|
- Prefer **editing files** over dumping large code blocks into chat.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**That’s it.** Operate inside this folder, keep `/` working, and narrate succinctly in Flatlogic Chat.
|
||||||
|
```
|
||||||
115
index.php
Normal file
115
index.php
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
@ini_set('display_errors', '1');
|
||||||
|
@error_reporting(E_ALL);
|
||||||
|
@date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
$phpVersion = PHP_VERSION;
|
||||||
|
$now = date('Y-m-d H:i:s');
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>New Style</title>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-color-start: #ffecd2;
|
||||||
|
--bg-color-end: #fcb69f;
|
||||||
|
--text-color: #333333;
|
||||||
|
--card-bg-color: rgba(255, 255, 255, 0.5);
|
||||||
|
--card-border-color: rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||||
|
color: var(--text-color);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
body::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(0,0,0,0.05)"/></svg>');
|
||||||
|
animation: bg-pan 20s linear infinite;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
@keyframes bg-pan {
|
||||||
|
0% { background-position: 0% 0%; }
|
||||||
|
100% { background-position: 100% 100%; }
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg-color);
|
||||||
|
border: 1px solid var(--card-border-color);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 2rem;
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
-webkit-backdrop-filter: blur(20px);
|
||||||
|
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
animation: float 6s ease-in-out infinite, fadeIn 1s ease-out forwards;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
letter-spacing: -1px;
|
||||||
|
animation: fadeIn 1.5s ease-out forwards;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
animation: fadeIn 2s ease-out forwards;
|
||||||
|
}
|
||||||
|
@keyframes float {
|
||||||
|
0% { transform: translateY(0px); }
|
||||||
|
50% { transform: translateY(-10px); }
|
||||||
|
100% { transform: translateY(0px); }
|
||||||
|
}
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from { opacity: 0; transform: translateY(10px); }
|
||||||
|
to { opacity: 1; transform: translateY(0); }
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
|
}
|
||||||
|
footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<div class="card">
|
||||||
|
<h1>Welcome!</h1>
|
||||||
|
<p>Your project is ready to conquer the peaks.</p>
|
||||||
|
<p>PHP version: <code><?= htmlspecialchars($phpVersion) ?></code></p>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user