Commit Graph

119 Commits

Author SHA1 Message Date
Girish Ramakrishnan d8225ad653 Make tasks indexed by id instead of type
The caas migrate logic is broken at this point until it uses new
task framework
2018-12-08 19:41:53 -08:00
Girish Ramakrishnan 3bad9e523c Add option to toggle app automatic updates 2018-12-07 10:02:11 -08:00
Girish Ramakrishnan dfa61f1b2d rework how app mailboxes are allocated
Our current setup had a mailbox allocated for an app during app
install (into the mailboxes table). This has many issues:

* When set to a custom mailbox location, there was no way to access
  this mailbox even via IMAP. Even when using app credentials, we
  cannot use IMAP since the ldap logic was testing on the addon type
  (most of our apps only use sendmail addon and thus cannot recvmail).

* The mailboxes table was being used to add hidden 'app' type entries.
  This made it very hard for the user to understand why a mailbox conflicts.
  For example, if you set an app to use custom mailbox 'blog', this is
  hidden from all views.

The solution is to let an app send email as whatever mailbox name is
allocated to it (which we now track in the apps table. the default is in the
db already so that REST response contains it). When not using
Cloudron email, it will just send mail as that mailbox and the auth
checks the "app password" in the addons table. Any replies to that
mailbox will end up in the domain's mail server (not our problem).

When using cloudron email, the app can send mail like above. Any responses
will not end anywhere and bounce since there is no 'mailbox'. This is the
expected behavior. If user wants to access this mailbox name, he can
create a concrete mailbox and set himself as owner OR set this as
an alias.

For apps using the recvmail addon, the workflow is to actually create
a mailbox at some point. Currently, we have no UI for this 'flow'.
It's fine because we have only meemo using it.

Intuitive much!
2018-12-06 22:13:32 -08:00
Girish Ramakrishnan 41b0c3242e Make function name clearer 2018-12-06 12:47:50 -08:00
Johannes Zellner 54c96d98d1 Remove all individual test timeouts and ignore timeouts toplevel 2018-12-03 12:24:04 +01: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 e49b57294d Give optional name for tokens 2018-08-27 14:59:52 -07:00
Girish Ramakrishnan 60984d18dd Add type field to port bindings table
Part of #504
2018-08-12 22:32:36 -07:00
Girish Ramakrishnan df1dc80fc1 Change the internal portBindings representation
Part of #504
2018-08-12 22:32:31 -07:00
Girish Ramakrishnan 78a2176d1d Make admin simply a boolean instead of group
This simplifies a lot of logic. Keeping an admin group has no benefit
2018-07-26 22:29:57 -07:00
Girish Ramakrishnan b4d5def56d Revert role support 2018-07-26 13:23:06 -07:00
Johannes Zellner 7b540a1d2d Fixup database tests 2018-06-30 14:12:35 +02:00
Johannes Zellner 163563f400 Remove now unused dnsRecordId 2018-06-29 23:14:06 +02:00
Girish Ramakrishnan dfa318e898 Add ownerId for apps
This tracks who installed the app.
2018-06-28 14:13:12 -07:00
Girish Ramakrishnan 02c0137dc1 Add a timestamp column to apps table
this field can be used in UI to see if more detailed app information
has to be fetched (since it calls the list apps REST API periodically)
2018-06-26 18:16:39 -07:00
Girish Ramakrishnan 7f3114e67d Rename to get/setMembership (to indicate IDs and not group objects 2018-06-18 13:57:17 -07:00
Girish Ramakrishnan 898cbd01b3 tokens table always has canonical scope 2018-06-17 23:11:36 -07:00
Girish Ramakrishnan 02d5d2f808 Add API to add and update the group roles 2018-06-15 00:28:27 -07:00
Girish Ramakrishnan a77d45f5de Add rolesJson to groups table
This will contain the roles ('role definition') of a group of
users. We will internally map these to our API scopes.
2018-06-14 22:54:52 -07:00
Girish Ramakrishnan eb566d28e7 Remove groupdb._addDefaultGroups
Putting this in db code causes issues when we merge in the
accesscontrol/roles variables (groupdb needs to source those
variables)
2018-06-14 21:56:34 -07:00
Girish Ramakrishnan 32e6b9024c Add email query param to reset code path
This reduces any attack surface
2018-06-12 17:56:41 -07:00
Girish Ramakrishnan 6534297a5d Remove hat module
It's not been updated for 6 years!
2018-06-11 12:38:29 -07:00
Girish Ramakrishnan 4356df3676 bump timeout 2018-05-07 16:28:11 -07:00
Johannes Zellner 38668937ad Fixup database tests 2018-04-25 17:03:16 +02:00
Girish Ramakrishnan b6335a327c Rename TYPE_* to OWNER_TYPE_* 2018-04-07 18:33:30 -07:00
Girish Ramakrishnan 2c8fa01d6d mail: split the functions to add list and mailbox 2018-04-05 15:01:28 -07:00
Girish Ramakrishnan aac914182f remove options from database.initialize 2018-03-22 20:34:49 -07:00
Girish Ramakrishnan 26d4a11c44 cleanup eventlog more aggressively
Those login entries are really adding up on old cloudrons
2018-03-22 20:31:32 -07:00
Johannes Zellner 8340f77e20 Fixup the database tests 2018-03-05 17:17:01 +01:00
Girish Ramakrishnan baf5cae58a Fix tests 2018-02-11 00:04:41 -08:00
Johannes Zellner e710a210fd Fixup the unit tests 2018-02-08 09:00:31 +01:00
Johannes Zellner d1ef35ae1d Fixup all the tests to use domain tlsConfig 2018-01-31 18:09:38 +01:00
Johannes Zellner 7e378b426e Fixup the database tests 2018-01-26 18:32:13 +01:00
Girish Ramakrishnan 6fdb093595 add and remove maildb entries when domain is created and removed 2018-01-21 20:33:21 -08:00
Johannes Zellner 48d557b242 Replace alternateEmail with fallbackEmail 2018-01-21 14:50:24 +01:00
Girish Ramakrishnan 04868f0983 maildb tests 2018-01-20 23:52:16 -08:00
Girish Ramakrishnan 8da04f6f51 make domaindb.update take object 2018-01-20 10:24:11 -08:00
Girish Ramakrishnan 0eaea12818 make domaindb.add take an object 2018-01-20 10:17:01 -08:00
Girish Ramakrishnan 2ac12de204 Add domains.provider 2018-01-09 15:32:49 -08:00
Girish Ramakrishnan 373c003223 provider is always set in domain config 2018-01-09 14:25:58 -08:00
Girish Ramakrishnan 68d4e70823 Add config._reset to tests 2017-11-27 15:27:54 -08:00
Girish Ramakrishnan efe75f0c4e make tests finish
database.uninitialize must be called to drop the connection
2017-11-27 11:57:09 -08:00
Girish Ramakrishnan ca5b69a07d Fix db export/import 2017-11-24 15:31:06 -08:00
Girish Ramakrishnan b507ccaa33 Add database.importFileFile
Part of #439
2017-11-22 23:08:59 -08:00
Johannes Zellner de44796b6f Handle errors if domain is still used on deletion attempt 2017-11-20 20:01:50 +01:00
Johannes Zellner 53e3626e51 More test fixes for config database and settings 2017-11-20 20:01:50 +01:00
Johannes Zellner 6e07a4ec08 Fixup database tests 2017-11-20 20:01:50 +01:00
Johannes Zellner 9155f49d4c Add domaindb logic 2017-11-20 19:59:26 +01:00
Girish Ramakrishnan 917122c812 display last updated in app info 2017-11-19 13:20:20 -08:00
Girish Ramakrishnan 360fa058ea store format information for restoring
fixes #483
2017-11-16 15:01:27 -08:00