Repository navigation
Commit b2c4a4d
committed
Stop the installer writing config.php where the next deploy erases it
install.php wrote config.php to __DIR__ . '/config.php', beside the
panel. That is inside the document root, and the document root is rebuilt
from scratch on every deploy -- so the installer's own output was erased
by the next publish and the panel came back saying it had never been set
up. That is not hypothetical: it is what happened, and it took the admin
offline.
config() already looks for nitesha-config/config.php in each directory
above the panel, which is why the working config was moved there by hand.
The installer now writes to that same place, one level above the document
root, so an install survives a deploy without anyone having to know this.
Three cases, all exercised against a real directory layout:
nothing exists yet -> <account>/nitesha-config/config.php
a config already exists -> that one is reused, wherever it is, so a
working install never ends up with two
files and config() picking a coin flip
parent cannot be written -> falls back beside the panel, because a
panel that works until the next deploy
beats a panel that never starts
The environment check was reporting on the wrong directory -- it tested
the panel folder while the file was going somewhere else -- so it now
checks the directory that will actually be written, and says which one
that is and whether a deploy can reach it. The success screen names the
path, and warns when it landed inside the website folder.
storage_path moves above the document root for the same reason. Nothing
reads it today, which is exactly why it would have been found the hard
way later.
The "not set up yet" response is now a page rather than one line of plain
text on a 500. It is the first thing an owner sees after a deploy wipes
the config, and "Not set up yet" reads, at that moment, like the data is
gone. It now says which file is missing, shows the two paths that were
actually searched -- computed, so they cannot drift from the code -- says
plainly that the database is untouched, and links to the installer.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0128YzbhrfGdegUSc9RrARRf1 parent 2cf723f commit b2c4a4d
3 files changed
Lines changed: 147 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
495 | 499 | | |
496 | 500 | | |
497 | 501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 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 | + | |
21 | 64 | | |
22 | 65 | | |
23 | 66 | | |
| |||
39 | 82 | | |
40 | 83 | | |
41 | 84 | | |
42 | | - | |
| 85 | + | |
| 86 | + | |
43 | 87 | | |
44 | | - | |
| 88 | + | |
45 | 89 | | |
46 | 90 | | |
47 | 91 | | |
| |||
158 | 202 | | |
159 | 203 | | |
160 | 204 | | |
161 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
162 | 208 | | |
163 | 209 | | |
164 | 210 | | |
| |||
169 | 215 | | |
170 | 216 | | |
171 | 217 | | |
| 218 | + | |
| 219 | + | |
172 | 220 | | |
173 | 221 | | |
174 | 222 | | |
175 | 223 | | |
176 | | - | |
| 224 | + | |
| 225 | + | |
177 | 226 | | |
178 | 227 | | |
179 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
180 | 235 | | |
181 | 236 | | |
182 | 237 | | |
183 | 238 | | |
184 | 239 | | |
185 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
186 | 248 | | |
187 | 249 | | |
188 | 250 | | |
| |||
192 | 254 | | |
193 | 255 | | |
194 | 256 | | |
195 | | - | |
| 257 | + | |
196 | 258 | | |
197 | | - | |
198 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
199 | 264 | | |
200 | 265 | | |
201 | 266 | | |
| |||
247 | 312 | | |
248 | 313 | | |
249 | 314 | | |
250 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
251 | 324 | | |
252 | 325 | | |
253 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
70 | 128 | | |
71 | 129 | | |
72 | 130 | | |
| |||
78 | 136 | | |
79 | 137 | | |
80 | 138 | | |
81 | | - | |
82 | | - | |
| 139 | + | |
83 | 140 | | |
84 | 141 | | |
85 | 142 | | |
| |||
0 commit comments