Commit graph

151 commits

Author SHA1 Message Date
Neeraj Gupta
04df64de05
[server] Improvate req validation on file createOrUpdate (#1485)
## Description
During the testing of copyFile functionality, I ran into issues where
files were created without all attributes (esp File EncryptedKey & Nonce
for thumbnail and file decryption).
This change

## Tests
Tested regular file upload, unable to test update as Photos app on
simulator is not showing save option. I don't expect it to break.
2024-04-19 12:11:57 +05:30
Manav Rathi
74b9a2a408
[server] Specify a default for apps.public-albums
local.yaml is only loaded in the local environment, and will not be used in
production. To avoid specifying it in both production and local configurations,
use it as a default specified in the code instead (that's the pattern we're
using in other places too from what I remember, maybe we should refactor that
too, but that's a bigger task not tied to this change).

**Tested by**

On a local dev cluster
- Not specifying anything and ensuring that the default is picked
- Specifying an override in museum.yaml and verifying that is used instead
2024-04-16 09:19:13 +05:30
Neeraj Gupta
c73dc36a8c
[Server] Fix data cleanup pipeline for recovered account (#1410)
## Description
For accounts that were recovered post deletion (within x days), we were
not removing the entry from data_cleanup cron.

The data_clean up cron anyways verify that the account is indeed deleted
before proceeding with deletion, so it was not causing any harm, but the
cron was logging error.

## Tests

- [x] Verify that data clean up entry is removed if the account is
recovered
- [x] Verify that for existing data_cleanup entry for already recovered
account, the entry is deleted from cron.
2024-04-15 10:09:29 +05:30
Neeraj Gupta
8ed2c7cff9
[server] Pick base publicHost url from config (#1443)
## Description

## Tests
Ran locally with the config in local.yaml and verified that it's
modified as well when I had put localhost:3002 in the museum.yaml config
2024-04-15 09:56:21 +05:30
Neeraj Gupta
a9072d7dcb [server] Add todo 2024-04-12 13:16:55 +05:30
Neeraj Gupta
830483ca68 [server] Remove existing scheduledDelete entries if account is recovered 2024-04-11 11:03:57 +05:30
Neeraj Gupta
02e8861e96 [server] Remove entry from data cleanup on account recovery 2024-04-11 10:54:38 +05:30
Neeraj Gupta
339d728774 [server] Handle no user err gracefully 2024-04-11 10:29:39 +05:30
Neeraj Gupta
fa195af971 [server]Change log level to warning 2024-04-11 10:26:19 +05:30
Neeraj Gupta
ed69de9875 [server]Log invalid password at warn level 2024-04-11 10:21:56 +05:30
Neeraj Gupta
46188313ad Minor refactor 2024-04-09 11:20:45 +05:30
Neeraj Gupta
73eacfb30d [server] Use correct app while updating ott table 2024-04-09 11:14:44 +05:30
Neeraj Gupta
6bf22fa864 [server] Fix unique constraint for ott for multiple apps 2024-04-09 11:07:59 +05:30
vishnukvmd
c32badc82c [server] Delete the subscriber on listmonk when needed 2024-04-05 17:12:06 +05:30
Manav Rathi
74decc32de
[server] Allow a configurable sslmode
Tested

- Existing defaults remain unchanged
- Setting db.sslmode = require in museum.yaml is honoured (in the docker compose environment, that causes the db connection to fail as expected)
2024-04-05 11:52:22 +05:30
Manav Rathi
b6177a5bc3
Listmonk mailing list control (#1289)
## Description
Add listmonk mailing list subscribe and unsubscribe

## Tests
Tested getSubscriberID, unsubscribe, and subscribe using a locally
running listmonk server with different parameters.
- [x] A new subscriber is created and added to the listmonk campaign
mailing list on listmonkSubscribe() for the given list IDs
- [x] Subscriber is removed from listmonk campaign mailing list on
listmonkUnsubscribe() for the given list IDs
- [x] The old email address is unsubscribed, and the new email is
subscribed when a user updates the email
2024-04-04 17:21:55 +05:30
Manav Rathi
407eca5414
[server] nginx configuration improvements
- Use keepalives
- Update deprecated http2 syntax
- Document how to check config

Refs:
- https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/#no-keepalives
- https://github.com/nginxinc/kubernetes-ingress/issues/4237
- https://stackoverflow.com/questions/65944578/how-to-get-nginx-running-in-docker-to-reload-nginx-conf-configuration
2024-04-04 12:36:39 +05:30
Vishal
d8190926fd Change if-else 2024-04-04 11:24:13 +05:30
Vishal
92715b658c Change API parameter 2024-04-03 19:24:12 +05:30
Vishal
2ddf4c897c Rectify if else 2024-04-03 18:25:41 +05:30
Vishal
ffefae89a6 Redefine struct 2024-04-03 17:50:53 +05:30
Vishal
39ec761949 fix warnings 2024-04-03 12:57:37 +05:30
Vishal
01f842c445 Rearrange methods 2024-04-03 12:41:18 +05:30
Neeraj Gupta
2fe703df92
[server] Increase embedding fetch limit (#1300)
## Description

Also use different semaphore than existing diff API

## Tests
2024-04-03 12:38:34 +05:30
Vishal
18c48c7e0a Fix typo in comment 2024-04-03 11:14:55 +05:30
Manav Rathi
885308471f
[server] Add a notice that minio is only for getting started
From our Discord, someone commented

> if minio's cautions about Single-Node, Single-Drive are to be taken seriously:
>
> "SNSD deployments use a zero-parity erasure coded backend that provides no
  added reliability or availability beyond what the underlying storage volume
  implements. These deployments are best suited for local testing and
  evaluation, or for small-scale data workloads that do not have availability or
  performance requirements."

MinIO was never meant as a production replacement, it was only to make it easy
for people to get started. So add a notice in the docs re this.
2024-04-03 10:01:48 +05:30
Neeraj Gupta
85778bcdaa [server] Fix handling of redundant auth update 2024-04-03 07:05:03 +05:30
Vishal
b8100b1273 rename functions 2024-04-02 17:45:30 +05:30
Vishal
a5fcbbf901 add listmonk mailing list control (subscribe/usubscribe) 2024-04-02 17:36:53 +05:30
Neeraj Gupta
25cedd5e2f
[server] Gracefully handle stale collection entry (#1260)
## Description

## Tests
2024-03-30 15:24:52 +05:30
Neeraj Gupta
f6dca2dfc9
[server] Drop locationTag table and related code (#1245)
## Description

## Tests
2024-03-29 16:25:39 +05:30
Neeraj Gupta
ef250acad9
[server] Add person EntityType (#1246)
## Description

## Tests
2024-03-29 16:12:59 +05:30
Neeraj Gupta
459c4515a0 [server] Drop locationTag table and related code 2024-03-29 16:08:28 +05:30
Manav Rathi
54d93647ef
Add SMTP for sending emails (#1228)
## Tests
Tested for templated mails in user.go, userauth.go, stripe.go,
public_collection.go, playstore.go, admin.go, email_notification.go

Screenshots for all the templates -
[https://drive.google.com/drive/folders/1f7BjM5MHicRUbr5jlCe2-4MGz7s1moLw?usp=sharing](url)
2024-03-29 09:22:40 +05:30
Vishal
d5f0334a34 Remove isEnabled from config 2024-03-28 17:44:08 +05:30
Vishal
1f75633c5c Private method to bottom of the file 2024-03-28 15:03:27 +05:30
Manav Rathi
2b379640ca
Allow billing plans to be mounted into the Docker container if needed 2024-03-28 13:07:43 +05:30
Vishal
cc3376154f Change name 2024-03-27 22:39:12 +05:30
Vishal
a7692b7d2e Update if else 2024-03-27 21:40:40 +05:30
Vishal
9893e3f305 Add Amazon SES for sending mails 2024-03-27 19:58:27 +05:30
Vishnu Mohandas
eef33e9c0c
[mobile][web] Redirect to payment portal if subscription is past due (#1222)
## Description

When a customer whose Stripe subscription is past due (within the 30 day
window after expiry time and has not been cancelled) clicks on the
subscription modal, take them to the payment portal to complete the
subscription.

## Tests

- [x] Tested web
- [x] Tested mobile
2024-03-27 16:29:58 +05:30
vishnukvmd
44403c94c2 Cancel SEPA subscriptions when payments fail 2024-03-27 16:20:58 +05:30
Vishnu Mohandas
0c400db649
[server] Fix Stripe related issues (#1152)
## Description

### Stripe
- Settings have been modified to "Cancel" the subscription if all
attempts to charge an invoice fails. The previous configuration was to
set the subscription to "Past Due".

### Museum
- Updated our Stripe workflow to use `PaymentBehaviorAllowIncomplete` in
case of SEPA payments
- Fixed the issue caused by us spawning unnecessary subscriptions when a
customer tried to renew their expired subscription
- Removed the email that was being sent out when a Stripe subscription
expired. We will have to run our own cron to send a notification and
perform necessary clean up. When payments fail, we will still send a
notification to intimate the customer that their account is on hold.

### Mobile
- Fixed the dialogs and error messages on the payment page

## Tests
The following cases were tested for SEPA, Credit Cards, and Credit Cards
with 3DS.
- [x] Purchase
  - [x] Success
  - [x] Failure
- [x] Renewal
  - [x] Success
  - [x] Failure
- [x] Upgrades
  - [x] Success
  - [x] Failure
- [x] Cancellation
- [x] Resumption post recovery

## Note

These changes are likely to break in the event of some corner cases we
haven't thought of. But this will land us in a state that is better than
where we are right now in terms of collecting payments for expired
subscriptions and those via SEPA.
2024-03-27 14:43:36 +05:30
vishnukvmd
25a054287a Prevent duplicate emails for SEPA 2024-03-27 14:22:30 +05:30
Manav Rathi
e803b7f053
Document in main README 2024-03-27 13:44:24 +05:30
Manav Rathi
4a4a6ba44a
Give an example of the pull command 2024-03-27 13:04:28 +05:30
Manav Rathi
cb45a070be
Tweaks 2024-03-27 12:58:17 +05:30
Manav Rathi
4ba76e4aa2
Tweaks 2024-03-27 12:46:08 +05:30
Manav Rathi
7c0f41166c
Add a first cut of the publish script 2024-03-27 12:42:29 +05:30
Manav Rathi
b31332ff30
Outline the plan 2024-03-27 12:42:26 +05:30