Skip to content
20 changes: 13 additions & 7 deletions server/cmd/museum/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import (
"database/sql"
b64 "encoding/base64"
"fmt"
"github.com/ente-io/museum/pkg/controller/collections"
publicCtrl "github.com/ente-io/museum/pkg/controller/public"
"github.com/ente-io/museum/pkg/repo/public"
"net/http"
"os"
"os/signal"
Expand All @@ -17,6 +14,10 @@ import (
"syscall"
"time"

"github.com/ente-io/museum/pkg/controller/collections"
publicCtrl "github.com/ente-io/museum/pkg/controller/public"
"github.com/ente-io/museum/pkg/repo/public"

"github.com/ente-io/museum/ente/base"
"github.com/ente-io/museum/pkg/controller/emergency"
"github.com/ente-io/museum/pkg/controller/file_copy"
Expand Down Expand Up @@ -213,16 +214,17 @@ func main() {
stripeClients := billing.GetStripeClients()
commonBillController := commonbilling.NewController(emailNotificationCtrl, storagBonusRepo, userRepo, usageRepo, billingRepo)
appStoreController := controller.NewAppStoreController(defaultPlan,
billingRepo, fileRepo, userRepo, commonBillController)
billingRepo, fileRepo, userRepo, notificationHistoryRepo, commonBillController)
remoteStoreController := &remoteStoreCtrl.Controller{Repo: remoteStoreRepository}
playStoreController := controller.NewPlayStoreController(defaultPlan,
billingRepo, fileRepo, userRepo, storagBonusRepo, commonBillController)
billingRepo, fileRepo, userRepo, notificationHistoryRepo, storagBonusRepo, commonBillController)
stripeController := controller.NewStripeController(plans, stripeClients,
billingRepo, fileRepo, userRepo, storagBonusRepo, discordController, emailNotificationCtrl, offerController, commonBillController)
billingRepo, fileRepo, userRepo, storagBonusRepo, notificationHistoryRepo, discordController, emailNotificationCtrl, offerController, commonBillController)
billingController := controller.NewBillingController(plans,
appStoreController, playStoreController, stripeController,
discordController, emailNotificationCtrl,
billingRepo, userRepo, usageRepo, storagBonusRepo, commonBillController)
remoteStoreController := &remoteStoreCtrl.Controller{Repo: remoteStoreRepository, BillingCtrl: billingController}
remoteStoreController = &remoteStoreCtrl.Controller{Repo: remoteStoreRepository, BillingCtrl: billingController}

pushController := controller.NewPushController(pushRepo, taskLockingRepo, hostName)
mailingListsController := controller.NewMailingListsController()
Expand Down Expand Up @@ -1038,6 +1040,10 @@ func setupAndStartCrons(userAuthRepo *repo.UserAuthRepository, collectionLinkRep
emailNotificationCtrl.NudgePaidSubscriberForFamily()
})

scheduleAndRun(c, "@every 6h", func() {
emailNotificationCtrl.SendStorageLimitExceedingMails()
})

schedule(c, "@every 1m", func() {
pushController.SendPushes()
})
Expand Down
2 changes: 1 addition & 1 deletion server/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
sh -c '
#!/bin/sh

while ! mc config host add h0 http://minio:3200 changeme changeme1234 2>/dev/null
while ! mc alias set h0 http://minio:3200 changeme changeme1234 2>/dev/null
do
echo "Waiting for minio..."
sleep 0.5
Expand Down
2 changes: 2 additions & 0 deletions server/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ente-io/ente/main/server/q
> chmod +x quickstart.sh
> ./quickstart.sh


Which will prompt to start the Docker compose cluster.
After the Docker compose cluster starts, you can open Ente web app at
http://localhost:3000.

Expand Down
141 changes: 141 additions & 0 deletions server/mail-templates/storage_limit_exceeding_free.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<!DOCTYPE html>
<html>
<meta content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,
minimum-scale=1" />
<style>
body {
background-color: #f0f1f3;
font-family: "Helvetica Neue", "Segoe UI", Helvetica, sans-serif;
font-size: 16px;
line-height: 27px;
margin: 0;
color: #444;
}

pre {
background: #f4f4f4f4;
padding: 2px;
}

table {
width: 100%;
border: 1px solid #ddd;
}

table td {
border-color: #ddd;
padding: 5px;
}

.wrap {
background-color: #fff;
padding: 30px;
max-width: 525px;
margin: 0 auto;
border-radius: 5px;
}

.button {
background: #0055d4;
border-radius: 3px;
text-decoration: none !important;
color: #fff !important;
font-weight: bold;
padding: 10px 30px;
display: inline-block;
}

.button:hover {
background: #111;
}

.footer {
text-align: center;
font-size: 12px;
color: #888;
}

.footer a {
color: #888;
margin-right: 5px;
}

.gutter {
padding: 30px;
}

img {
max-width: 100%;
height: auto;
}

a {
color: #0055d4;
}

a:hover {
color: #111;
}

@media screen and (max-width: 600px) {
.wrap {
max-width: auto;
}

.gutter {
padding: 10px;
}
}

.footer-icons {
padding: 4px !important;
width: 24px !important;
}
</style>

<body>
<div class="gutter" style="padding: 4px">&nbsp;</div>
<div class="wrap" style=" background-color: rgb(255, 255, 255); padding: 2px
30px 30px 30px; max-width: 525px; margin: 0 auto; border-radius: 5px;
font-size: 16px; " >
<p>Hi there,</p>

<p>You have used 95% of your available storage on Ente Photos. All your photos on Ente will continue to remain safe and accessible. However, new photos will not be backed up after you get to 100%.</p>

<p>Please upgrade your plan so that all the new photos you take can be backed up. Once you upgrade, you will be able to access family plans, photo and album sharing, and all your photos will have triple backups.
You can also use our referral program to get more storage at no additional cost.</p>

<p>For any help, please reach out to <a href="mailto:[email protected]">[email protected]</a> or reply to this email.</p>
</div>
<br />
<div class="footer" style="text-align: center; font-size: 12px; color:
rgb(136, 136, 136)" >
<div>
<a href="https://ente.io" target="_blank" ><img
src="https://email-assets.ente.io/ente-green.png" style="width: 100px;
padding: 24px" title="Ente" alt="Ente" /></a>
</div>
<div>
<a href="https://fosstodon.org/@ente" target="_blank" ><img
src="https://email-assets.ente.io/mastodon-icon.png"
class="footer-icons" style="width: 24px; padding: 4px" title="Mastodon"
alt="Mastodon" /></a>
<a href="https://twitter.com/enteio" target="_blank" ><img
src="https://email-assets.ente.io/twitter-icon.png" class="footer-icons"
style="width: 24px; padding: 4px" title="Twitter" alt="Twitter" /></a>
<a href="https://discord.ente.io" target="_blank" ><img
src="https://email-assets.ente.io/discord-icon.png" class="footer-icons"
style="width: 24px; padding: 4px" title="Discord" alt="Discord" /></a>
<a href="https://github.com/ente-io" target="_blank" ><img
src="https://email-assets.ente.io/github-icon.png" class="footer-icons"
style="width: 24px; padding: 4px" title="GitHub" alt="GitHub" /></a>
</div>
<p>
Ente Technologies, Inc.
<br /> 1111B S Governors Ave 6032 Dover, DE 19904
</p>
<br />
</div>
</body>
</html>
140 changes: 140 additions & 0 deletions server/mail-templates/storage_limit_exceeding_paid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!DOCTYPE html>
<html>
<meta content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,
minimum-scale=1" />
<style>
body {
background-color: #f0f1f3;
font-family: "Helvetica Neue", "Segoe UI", Helvetica, sans-serif;
font-size: 16px;
line-height: 27px;
margin: 0;
color: #444;
}

pre {
background: #f4f4f4f4;
padding: 2px;
}

table {
width: 100%;
border: 1px solid #ddd;
}

table td {
border-color: #ddd;
padding: 5px;
}

.wrap {
background-color: #fff;
padding: 30px;
max-width: 525px;
margin: 0 auto;
border-radius: 5px;
}

.button {
background: #0055d4;
border-radius: 3px;
text-decoration: none !important;
color: #fff !important;
font-weight: bold;
padding: 10px 30px;
display: inline-block;
}

.button:hover {
background: #111;
}

.footer {
text-align: center;
font-size: 12px;
color: #888;
}

.footer a {
color: #888;
margin-right: 5px;
}

.gutter {
padding: 30px;
}

img {
max-width: 100%;
height: auto;
}

a {
color: #0055d4;
}

a:hover {
color: #111;
}

@media screen and (max-width: 600px) {
.wrap {
max-width: auto;
}

.gutter {
padding: 10px;
}
}

.footer-icons {
padding: 4px !important;
width: 24px !important;
}
</style>

<body>
<div class="gutter" style="padding: 4px">&nbsp;</div>
<div class="wrap" style=" background-color: rgb(255, 255, 255); padding: 2px
30px 30px 30px; max-width: 525px; margin: 0 auto; border-radius: 5px;
font-size: 16px; " >
<p>Hi there,</p>

<p>You have used 95% of your available storage on Ente Photos. All your photos on Ente will continue to remain safe and accessible. However, new photos will not be backed up after you get to 100%.</p>

<p>Please upgrade your plan so that all the new photos you take can be backed up. You can also use our referral program to get more storage at no additional cost.</p>

<p>For any help, please reach out to <a href="mailto:[email protected]">[email protected]</a> or reply to this email.</p>
</div>
<br />
<div class="footer" style="text-align: center; font-size: 12px; color:
rgb(136, 136, 136)" >
<div>
<a href="https://ente.io" target="_blank" ><img
src="https://email-assets.ente.io/ente-green.png" style="width: 100px;
padding: 24px" title="Ente" alt="Ente" /></a>
</div>
<div>
<a href="https://fosstodon.org/@ente" target="_blank" ><img
src="https://email-assets.ente.io/mastodon-icon.png"
class="footer-icons" style="width: 24px; padding: 4px" title="Mastodon"
alt="Mastodon" /></a>
<a href="https://twitter.com/enteio" target="_blank" ><img
src="https://email-assets.ente.io/twitter-icon.png" class="footer-icons"
style="width: 24px; padding: 4px" title="Twitter" alt="Twitter" /></a>
<a href="https://discord.ente.io" target="_blank" ><img
src="https://email-assets.ente.io/discord-icon.png" class="footer-icons"
style="width: 24px; padding: 4px" title="Discord" alt="Discord" /></a>
<a href="https://github.com/ente-io" target="_blank" ><img
src="https://email-assets.ente.io/github-icon.png" class="footer-icons"
style="width: 24px; padding: 4px" title="GitHub" alt="GitHub" /></a>
</div>
<p>
Ente Technologies, Inc.
<br /> 1111B S Governors Ave 6032 Dover, DE 19904
</p>
<br />
</div>
</body>
</html>
Loading