Commit Graph

154 Commits

Author SHA1 Message Date
Girish Ramakrishnan 9a22ba3af7 Add repair route
this is specifically for the case where some task failed and user
wants to get it back.
2019-09-19 23:13:44 -07:00
Girish Ramakrishnan 00f949f156 Add overwriteDns arg to install & clone
this is useful in e2e
2019-09-16 09:31:34 -07:00
Girish Ramakrishnan 9f0d1b515c Add param to overwrite DNS 2019-09-10 15:41:32 -07:00
Girish Ramakrishnan 3e2189aeed Remove obsolete configure route 2019-09-09 22:08:08 -07:00
Girish Ramakrishnan 6f53723169 test data dir migration 2019-09-09 21:25:39 -07:00
Girish Ramakrishnan 5f9b2f1159 Add env and debug mode tests 2019-09-09 15:46:29 -07:00
Girish Ramakrishnan 801ca7eda1 Break down the configure route 2019-09-09 14:35:52 -07:00
Girish Ramakrishnan e117ee2bef Cleanup app error codes
1. The error classes (like AppsError) now take a 3rd argument details.
We can attach anything in this 3rd argument and this gets sent in the
REST response as well.

2. The HttpError class is now HttpError(statusCode, errorOrMessage). If
it's an error object, it will take the message and other things which
were attached above from it and send them across. Previously, we used to
mark this case an internal error all the time.

3. AppsError only has generic codes now. The UI code then simply checks
for additional information that we attached to show errors. For example,
BAD_FIELD will have a field: 'xx' indicating which field is at fault.
ALREADY_EXISTS has information on which domain or port caused a problem.
The advantage here is we can drop all these error codes that are
specific to each model code.

4. Maybe some day, we can remove all these error classes and have only
one generic class. AppsError right now is pretty generic already. We can
use that error code everywhere... No need to translate errors also
everywhere.

5. Finally, in the router code, I have this function toHttpError (in
apps.js) which is also so much cleaner than what we have now. We keep
writing the same stuff over and over.
2019-09-03 10:39:02 -07:00
Girish Ramakrishnan a2f8203a42 Add location conflict error code 2019-09-02 12:42:28 -07:00
Girish Ramakrishnan 6668bb3e8a Handle BAD_STATE as well 2019-09-02 12:17:48 -07:00
Girish Ramakrishnan d59c1f53b9 apps: add detail to http error messages 2019-09-01 18:35:06 -07:00
Girish Ramakrishnan f3008064e4 Fix installation states
App operations can only be done in 'installed' or 'error' state.
If some other operation is in progress, you have to cancel it first.

This guarantees that the old app command got killed.
2019-08-29 10:14:23 -07:00
Girish Ramakrishnan 5952a5c69d Send taskId in the response 2019-08-27 21:35:40 -07:00
Girish Ramakrishnan e7127df30d remove app ownerId
this is unused
2019-07-02 21:23:51 -07:00
Girish Ramakrishnan 23d16b07aa Add API to get original icon 2019-05-21 00:14:54 -07:00
Girish Ramakrishnan 9d2f81d6b9 Remove X-Frame-Options
This option is now obsolete in the standards and browsers are complaining.
This needs to move to be a CSP header but this is hard to do from outside
the app (since it has to be 'merged' with the app's existing CSP).

fixes #596
2019-05-20 10:11:52 -07:00
Girish Ramakrishnan 625127d298 add icon to configure route 2019-05-17 12:50:08 -07:00
Girish Ramakrishnan f24c4d2805 Look for a user set app icon 2019-05-17 10:14:02 -07:00
Girish Ramakrishnan ffe0e6dbbe Fix various error handling
* appstore never returns 403
* change billing_required to plan_limit
2019-05-06 15:36:37 -07:00
Girish Ramakrishnan e553ade936 remove spaces support
this feature is unused for too long now
2019-05-04 18:34:28 -07:00
Girish Ramakrishnan f3910f03ca Enable logStream test
fixes apptask logs in test mode and the id of stream logs
2019-04-24 16:27:00 -07:00
Johannes Zellner e756a442f6 Validate tags in one place only and add tests 2019-04-16 16:36:11 +02:00
Johannes Zellner 332c860e80 If label or tags are present they have to be a specific type 2019-04-16 10:29:44 +02:00
Johannes Zellner 0c8cf9cc0d Fix error messages 2019-04-11 13:35:33 +02:00
Girish Ramakrishnan d752c68790 re-factor all the audit source objects 2019-03-25 15:15:39 -07:00
Girish Ramakrishnan ee76c2c06e Return 403 if totp token is invalid
the ui redirects to login screen otherwise
2019-03-23 14:12:46 -07:00
Girish Ramakrishnan abae4b5106 Add labels and tags 2019-03-22 10:12:48 -07:00
Girish Ramakrishnan aa19cbbfc7 Properly escape filename when downloading files 2019-03-04 13:50:17 -08:00
Girish Ramakrishnan 13c628b58b backups (tgz): work with a layout
this will allow us to place the localstorage directory in an arbitrary
location
2019-01-16 12:52:04 -08:00
Girish Ramakrishnan 810f5e7409 Fix line param parsing
lines is a positive integer or -1 to disable line limiting. The
default value is 10 if no argument is given.

Fixes #604
2019-01-08 13:23:29 -08:00
Girish Ramakrishnan 0266a46b32 Ensure that location and domain are provided together
in our db, {location,domain} is unique. If we replace them one
by one in the database, it will cause conflicts.
2018-12-11 12:10:22 -08:00
Girish Ramakrishnan 3bad9e523c Add option to toggle app automatic updates 2018-12-07 10:02:11 -08:00
Girish Ramakrishnan b8861b9d78 Use debug instead 2018-11-11 21:57:45 -08:00
Girish Ramakrishnan 5bfb253869 Custom env vars for apps
Add a table and the install/configure routes. Initially, I thought
we can just keep the env vars in docker container but that doesn't
work since we create the container only later in apptask. And if the
container gets deleted we lose this information.
2018-10-11 16:17:18 -07:00
Girish Ramakrishnan 88330ab415 Return 424 for external errors 2018-09-07 11:27:19 -07:00
Girish Ramakrishnan 0e3f9c9569 Move verifyAppOwnership to app route 2018-09-06 00:09:42 -07:00
Girish Ramakrishnan 0439bd8869 move addSpacesSuffix to model logic 2018-09-04 16:37:08 -07:00
Girish Ramakrishnan 10b4043358 Add alternateDomains to app install route 2018-09-04 16:27:35 -07:00
Girish Ramakrishnan ac3b0f0082 Add spaces suffix for alternate domains 2018-09-04 14:12:50 -07:00
Girish Ramakrishnan fc3bc48f47 Fix crash when location is not provided 2018-08-30 22:08:48 -07:00
Girish Ramakrishnan 976cf1740e Put edition in status route 2018-08-28 21:43:25 -07:00
Girish Ramakrishnan 22cdd3f55e spaces: add username suffix to location 2018-08-28 20:27:17 -07:00
Girish Ramakrishnan af58e56732 Fix issue where normal users are shown all apps 2018-08-16 20:04:03 -07:00
Johannes Zellner b1b848de21 Support configuring alternateDomains for apps 2018-06-29 23:14:06 +02:00
Girish Ramakrishnan 9978dff627 Add API to set and transfer ownership 2018-06-28 16:48:04 -07:00
Girish Ramakrishnan dfa318e898 Add ownerId for apps
This tracks who installed the app.
2018-06-28 14:13:12 -07:00
Girish Ramakrishnan 6907475f7a Add app management scope
This splits the apps API into those who have just 'read' access
and those who have 'manage' access.
2018-06-26 08:56:30 -07:00
Girish Ramakrishnan 9bf93b026b rename to removeInternalFields 2018-06-25 16:40:16 -07:00
Girish Ramakrishnan bac3ba101e Add mailboxName to app configure route
Fixes #558
2018-05-24 16:26:34 -07:00
Girish Ramakrishnan b1b664ceca Move removeInternalAppFields to model code 2018-04-29 10:47:34 -07:00