Repository navigation
Commit 7abe3a1
committed
Ship the admin panel with the build, where the host actually serves from
niteshacars.in/admin returned the site's own "page not found" while the
panel sat perfectly well in the repository. The reason took all day to find
and is embarrassing in hindsight: Hostinger deploys this repository by
running npm run build and serving my-app/dist. dist is the document root.
Anything outside it does not exist as far as the web is concerned.
Everything built today -- the FTPS pipeline, the config.php generator, the
panel-finding search -- wrote to a folder nobody serves. The site has been
deploying automatically from main the whole time. The Deployments panel said
so plainly and I inferred from file listings instead.
copy-admin-panel.mjs copies the panel into dist/admin after the Vite build,
so /admin ships with the site and deploys the same automatic way. Vite would
copy public/ verbatim and that would have been less code, but burying a PHP
application inside the website's asset folder is a surprise to whoever reads
the tree next.
config.php is never copied, and config() had to change to match. It looked
in one fixed place, beside the panel -- which is inside dist, recreated from
scratch on every deploy, so the database password would need re-uploading
after every push. It now also searches upward for a nitesha-config/
directory. Outside the document root, that survives deploys and cannot be
fetched over HTTP even if a rule is wrong, which is where a database
password belongs. The old path is still checked first, so an install that
predates this is untouched.
Six cases covered against real layouts: config above dist, several levels
up, beside the panel, beside winning over the outward search, absent
entirely, and beyond the search depth so it gives up rather than walking to
the filesystem root.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0128YzbhrfGdegUSc9RrARRf1 parent b766777 commit 7abe3a1
3 files changed
Lines changed: 107 additions & 3 deletions
File tree
- my-app
- scripts
- public_html/admin.niteshacars.in/admin/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
18 | 70 | | |
19 | 71 | | |
20 | 72 | | |
| |||
24 | 76 | | |
25 | 77 | | |
26 | 78 | | |
27 | | - | |
28 | | - | |
| 79 | + | |
| 80 | + | |
29 | 81 | | |
30 | 82 | | |
31 | 83 | | |
| |||
0 commit comments