diff --git a/docs/references/manifest.md b/docs/references/manifest.md index 55664eab9..a7da4de54 100644 --- a/docs/references/manifest.md +++ b/docs/references/manifest.md @@ -150,20 +150,6 @@ Example: "description:": "file://DESCRIPTION.md" ``` -## developmentMode - -Type: boolean - -Required: no - -Setting `developmentMode` to true disables readonly rootfs and the default memory limit. In addition, -the application *pauses* on start and can be started manually using `cloudron exec`. Note that you -cannot submit an app to the store with this field turned on. - -This mode can be used to identify the files being modified by your application - often required to -debug situations where your app does not run on a readonly rootfs. Run your app using `cloudron exec` -and use `find / -mmin -30` to find file that have been changed or created in the last 30 minutes. - ## healthCheckPath Type: url path diff --git a/docs/tutorials/packaging.md b/docs/tutorials/packaging.md index 479ca41d1..22ddb55bc 100644 --- a/docs/tutorials/packaging.md +++ b/docs/tutorials/packaging.md @@ -271,14 +271,18 @@ You can also execute arbitrary commands: $ cloudron exec env # display the env variables that your app is running with ``` -### DevelopmentMode +### Debugging -When debugging complex startup scripts, one can specify `"developmentMode": true,` in the CloudronManifest.json. -This will ignore the `RUN` command, specified in the Dockerfile and allows the developer to interactively test -the startup scripts using `cloudron exec`. +An app can be placed in `debug` mode by passing `--debug` to `cloudron install` or `cloudron configure`. +Doing so, runs the app in a non-readonly rootfs and unlimited memory. By default, this will also ignore +the `RUN` command specified in the Dockerfile. The developer can then interactively test the app and +startup scripts using `cloudron exec`. -**Note:** that an app running in this mode has full read/write access to the filesystem and all memory limits are lifted. +This mode can be used to identify the files being modified by your application - often required to +debug situations where your app does not run on a readonly rootfs. Run your app using `cloudron exec` +and use `find / -mmin -30` to find file that have been changed or created in the last 30 minutes. +You can turn off debugging mode using `cloudron configure --no-debug`. # Addons diff --git a/src/appdb.js b/src/appdb.js index f5c8b46f6..c5801bc06 100644 --- a/src/appdb.js +++ b/src/appdb.js @@ -302,6 +302,9 @@ function updateWithConstraints(id, app, constraints, callback) { } else if (p === 'accessRestriction') { fields.push('accessRestrictionJson = ?'); values.push(JSON.stringify(app[p])); + } else if (p === 'debugMode') { + fields.push('debugModeJson = ?'); + values.push(JSON.stringify(app[p])); } else if (p !== 'portBindings') { fields.push(p + ' = ?'); values.push(app[p]); diff --git a/src/apphealthmonitor.js b/src/apphealthmonitor.js index 9311689e5..dd6be6451 100644 --- a/src/apphealthmonitor.js +++ b/src/apphealthmonitor.js @@ -50,7 +50,7 @@ function setHealth(app, health, callback) { debugApp(app, 'marking as unhealthy since not seen for more than %s minutes', UNHEALTHY_THRESHOLD/(60 * 1000)); - if (app.developmentMode) mailer.appDied(app); // do not send mails for dev apps + if (app.debugMode) mailer.appDied(app); // do not send mails for dev apps gHealthInfo[app.id].emailSent = true; } else { debugApp(app, 'waiting for sometime to update the app health'); @@ -166,7 +166,7 @@ function processDockerEvents() { debug('OOM Context: %s', context); // do not send mails for dev apps - if ((!app || !app.developmentMode) && (now - lastOomMailTime > OOM_MAIL_LIMIT)) { + if ((!app || !app.debugMode) && (now - lastOomMailTime > OOM_MAIL_LIMIT)) { mailer.oomEvent(program, context); // app can be null if it's an addon crash lastOomMailTime = now; }