Import museum

This commit is contained in:
Neeraj Gupta 2024-03-01 13:37:01 +05:30
parent e9d76688ce
commit 531bb344fe
377 changed files with 37454 additions and 0 deletions

32
server/.air.toml Normal file
View file

@ -0,0 +1,32 @@
root = "."
tmp_dir = "tmp"
[build]
bin = "./tmp/main"
cmd = "go build -o ./tmp ./cmd/museum/main.go"
delay = 1000
exclude_dir = ["assets", "tmp", "vendor"]
exclude_file = []
exclude_regex = []
exclude_unchanged = false
follow_symlink = false
full_bin = "./tmp/main"
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
kill_delay = "0s"
log = "build-errors.log"
send_interrupt = false
stop_on_error = true
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
time = false
[misc]
clean_on_exit = false

1
server/.dockerignore Normal file
View file

@ -0,0 +1 @@
.git

View file

@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
### Problem Statement
### Proposed Solution
### Caveats

View file

@ -0,0 +1,3 @@
## Description
## Test Plan

28
server/.github/workflows/dev-ci.yml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Dev CI
on:
workflow_dispatch:
# Enable manual run
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v4.2.0
jobs:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out code
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & Push
with:
image: ente/museum-dev
registry: rg.fr-par.scw.cloud
enableBuildKit: true
buildArgs: GIT_COMMIT=${GITHUB_SHA}
tags: ${GITHUB_SHA}, latest
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

21
server/.github/workflows/pr.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: Code quality
on:
# Enable manual run
workflow_dispatch:
# Run on every push; this also covers pull requests
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- run: sudo apt-get update && sudo apt-get install libsodium-dev
- run:
"./scripts/lint.sh"
# - run: "go test ./..."

28
server/.github/workflows/prod-ci.yml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Prod CI
on:
workflow_dispatch:
# Enable manual run
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v4.2.0
jobs:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out code
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & Push
with:
image: ente/museum-prod
registry: rg.fr-par.scw.cloud
enableBuildKit: true
buildArgs: GIT_COMMIT=${GITHUB_SHA}
tags: ${GITHUB_SHA}, latest
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

10
server/.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
data/**
.DS_Store
Photos.code-workspace
logs/**
.idea/**
.vscode/**
tmp/**
museum.yaml
bin/**
data/

26
server/Dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM golang:1.20-alpine3.17 as builder
RUN apk add --no-cache gcc musl-dev git build-base pkgconfig libsodium-dev
ENV GOOS=linux
WORKDIR /etc/ente/
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -o museum cmd/museum/main.go
FROM alpine:3.17
RUN apk add libsodium-dev
COPY --from=builder /etc/ente/museum .
COPY configurations configurations
COPY migrations migrations
COPY mail-templates mail-templates
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
CMD ["./museum"]

661
server/LICENSE Normal file
View file

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

121
server/README.md Normal file
View file

@ -0,0 +1,121 @@
# Museum
API server for [ente.io](https://ente.io)
![Museum's role in Ente's architecture](scripts/images/museum.png)
We named our server _museum_ because for us and our customers, personal photos
are worth more than any other piece of art.
Both Ente Photos and Ente Auth use the same server (intentionally). This allows
users to use the same credentials to store different types of end-to-end
encrypted data without needing to create new accounts. We plan on building more
apps using the same server  this is easy, because the server is already data
agnostic (since the data is end-to-end encrypted).
## Getting started
Start a local cluster
docker compose up --build
And that's it!
You can now make API requests to localhost, for example
curl http://localhost:8080/ping
Let's try changing the message to get the hang of things. Open `healthcheck.go`,
change `"pong"` to `"kong"`, stop the currently running cluster (`Ctrl-c`), and
then rerun it
docker compose up --build
And ping again
curl http://localhost:8080/ping
This time you'll see the updated message.
For more details about how to get museum up and running, see
[RUNNING.md](/RUNNING.md).
## Architecture
With the mechanics of running museum out of the way, let us revisit the diagram
we saw earlier.
It is a long term goal of ours to make museum redundant. The beauty of an
end-to-end encrypted architecture is that the service provider has no special
conceptual role. The user has full ownership of the data at all points, and
using suitably advanced clients the cloud storage and replication can be
abstracted away, or be handled in a completely decentralized manner.
Until we get there, museum serves as an assistant for various housekeeping
chores.
* Clients ([mobile](../mobile), [web](../web) and [desktop](../desktop)) connect
to museum on the user's behalf. Museum then proxies data access (after adding
yet another layer of authentication on top of the user's master password),
performs billing related functions, and triggers replication of encrypted user
data.
* The end-to-end encrypted cryptography that powers all this is [documented
here](https://ente.io/architecture)
* Details about the 3 (yes 3!) clouds where the encrypted data and database are
replicated to are [documented here](https://ente.io/reliability)
Museum's architecture is generic enough to support arbitrary end-to-end
encrypted storage. While we're currently focusing on building a great photo
storage and sharing experience, that's not a limit. For example, we already use
museum to also provide an [end-to-end encrypted open source 2FA app with cloud
backups](../auth).
## Self hosting
Museum is a single self-contained Docker image that is easy to self-host.
When we write code for museum, the guiding light is simplicity and robustness.
But this also extends to how we approach hosting. Museum is a single statically
compiled binary that can be put anywhere and directly run.
And it is built with containerization in mind - both during development and
deployment. Just use the provided Dockerfile, configure to taste and you're off
to the races.
> [!CAUTION]
>
> We don't publish any official docker images (yet). For self-hosters, the
> recommendation is to build your own image using the provided `Dockerfile`.
Everything that you might needed to run museum is all in here, since this is the
setup we ourselves use in production.
> [!TIP]
>
> On our production servers, we wrap museum in a [systemd
> service](scripts/museum.service). Our production machines are vanilla Ubuntu
> images, with Docker and Promtail installed. We then plonk in this systemd
> service, and use `systemctl start|stop|status museum` to herd it around.
Some people new to Docker/Go/Postgres might have general questions though.
Unfortunately, because of limited engineering bandwidth **we will currently not be
able to prioritize support queries related to self hosting**, and we request you
to please not open issues around self hosting for the time being (feel free to
create discussions though). The best way to summarize the status of self hosting
is  **everything you need is here, but it is perhaps not readily documented, or
flexible enough.**
That said, we hope community members help each other out, e.g. in this
repository's [Discussions](https://github.com/ente-io/ente/discussions), or on
[our Discord](https://discord.gg/z2YVKkycX3). And whenever time permits, we will
try to clarify, and also document such FAQs. Please feel free to open
documentation PRs around this too.
## Thanks ❤️
We've had great fun with this combination (Golang + Postgres + Docker), and we
hope you also have fun tinkering with it too. A big thank you to all the people who've
put in decades of work behind these great technologies. Truly, on the shoulders
of giants we stand.

185
server/RUNNING.md Normal file
View file

@ -0,0 +1,185 @@
# Running Museum
You can run a Docker compose cluster containing museum and the essential
auxiliary services it requires (database and object storage). This is the
easiest and simplest way to get started, and also provides an isolated
environment that doesn't clutter your machine.
You can also run museum directly on your machine if you wish - it is a single
static go binary.
This document describes both these approaches, and also outlines configuration.
- [Running using Docker](#docker)
- [Running without Docker](#without-docker)
- [Configuration](#configuration)
## Docker
Start the cluster
docker compose up --build
Once the cluster has started, you should be able to do call museum
curl http://localhost:8080/ping
Or connect from the [web app](../web)
NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 yarn dev
Or connect from the [mobile app](../mobile)
flutter run --dart-define=endpoint=http://localhost:8080
Or interact with the other services in the cluster, e.g. connect to the DB
docker compose exec postgres env PGPASSWORD=pgpass psql -U pguser -d ente_db
Or interact with the MinIO S3 API
AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=testtest \
aws s3 --endpoint-url http://localhost:3200 ls s3://test
Or open the MinIO dashboard at <http://localhost:3201> (user: test/password: testtest).
> [!NOTE]
>
> If something seems amiss, ensure that Docker has read access to the parent
> folder so that it can access credentials.yaml and other local files. On macOS,
> you can do this by going to System Settings > Security & Privacy > Files and
> Folders > Docker.
### Cleanup
Persistent data is stored in Docker volumes and will persist across container
restarts. The volume can be saved / inspected using the `docker volumes`
command.
To remove stopped containers, use `docker compose rm`. To also remove volumes,
use `docker compose down -v`.
### Multiple clusters
You can spin up independent clusters, each with its own volumes, by using the
`-p` Docker Compose flag to specify different project names for each one.
### Pruning images
Each time museum gets rebuilt from source, a new image gets created but the old
one is retained as a dangling image. You can use `docker image prune --force`,
or `docker system prune` if that's fine with you, to remove these.
## Without Docker
The museum binary can be run by using `go run cmd/museum/main.go`. But first,
you'll need to prepare your machine for development. Here we give the steps,
with examples that work for macOS (please adapt to your OS).
### Install [Go](https://golang.org/dl/)
```sh
brew tap homebrew/core
brew upgrade
brew install go
```
### Install other packages
```sh
brew install postgresql@12
brew install libsodium
brew install pkg-config
```
> [!NOTE]
>
> Here we install same major version of Postgres as our production database to
> avoid surprises, but if you're using a newer Postgres that should work fine
> too.
On M1 macs, we additionally need to link the postgres keg.
```
brew link postgresql@12
```
### Init Postgres database
Homebrew already creates a default database cluster for us, but if needed, it
can also be done with the following commands:
```sh
sudo mkdir -p /usr/local/var/postgres
sudo chmod 775 /usr/local/var/postgres
sudo chown $(whoami) /usr/local/var/postgres
initdb /usr/local/var/postgres
```
On M1 macs, the path to the database cluster is
`/opt/homebrew/var/postgresql@12` (instead of `/usr/local/var/postgres`).
### Start Postgres
```sh
pg_ctl -D /usr/local/var/postgres -l logfile start
```
### Create user
```sh
createuser -s postgres
```
## Start museum
```sh
export ENTE_DB_USER=postgres
go run cmd/museum/main.go
```
For live reloads, install [air](https://github.com/cosmtrek/air#installation).
Then you can just call `air` after declaring the required environment variables.
For example,
```sh
ENTE_DB_USER=ente_user
air
```
## Testing
Set up a local database for testing. This is not required for running the server.
Create a test database with the following name and credentials:
```sql
$ psql -U postgres
CREATE DATABASE ente_test_db;
CREATE USER test_user WITH PASSWORD 'test_pass';
GRANT ALL PRIVILEGES ON DATABASE ente_test_db TO test_user;
```
For running the tests, you can use the following command:
```sh
ENV="test" go test -v ./pkg/...
go clean -testcache && ENV="test" go test -v ./pkg/...
```
## Configuration
Now that you have museum running (either inside Docker or standalone), we can
talk about configuring it.
By default, museum runs in the "local" configuration using values specified in
`local.yaml`.
To override these values, you can create a file named `museum.yaml` in the
current directory. This path is git-ignored for convenience. Note that if you
run the Docker compose cluster without creating this file, Docker will create an
empty directory named `museum.yaml` which you can `rmdir` if you need to provide
a config file later on.
The keys and values supported by this configuration file are documented in
[configurations/local.yaml](configurations/local.yaml).

44
server/SECURITY.md Normal file
View file

@ -0,0 +1,44 @@
ente believes that working with security researchers across the globe is crucial to keeping our
users safe. If you believe you've found a security issue in our product or service, we encourage you to
notify us (security@ente.io). We welcome working with you to resolve the issue promptly. Thanks in advance!
# Disclosure Policy
- Let us know as soon as possible upon discovery of a potential security issue, and we'll make every
effort to quickly resolve the issue.
- Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a
third-party. We may publicly disclose the issue before resolving it, if appropriate.
- Make a good faith effort to avoid privacy violations, destruction of data, and interruption or
degradation of our service. Only interact with accounts you own or with explicit permission of the
account holder.
- If you would like to encrypt your report, please use the PGP key with long ID
`E273695C0403F34F74171932DF6DDDE98EBD2394` (available in the public keyserver pool).
# In-scope
- Security issues in any current release of ente. This includes the web app, desktop app,
and mobile apps (iOS and Android). Product downloads are available at https://ente.io. Source
code is available at https://github.com/ente-io.
# Exclusions
The following bug classes are out-of scope:
- Bugs that are already reported on any of ente's issue trackers (https://github.com/ente-io),
or that we already know of. Note that some of our issue tracking is private.
- Issues in an upstream software dependency (ex: Flutter, Next.js etc) which are already reported to the upstream maintainer.
- Attacks requiring physical access to a user's device.
- Self-XSS
- Issues related to software or protocols not under ente's control
- Vulnerabilities in outdated versions of ente
- Missing security best practices that do not directly lead to a vulnerability
- Issues that do not have any impact on the general public
While researching, we'd like to ask you to refrain from:
- Denial of service
- Spamming
- Social engineering (including phishing) of ente staff or contractors
- Any physical attempts against ente property or data centers
Thank you for helping keep ente and our users safe!

962
server/cmd/museum/main.go Normal file
View file

@ -0,0 +1,962 @@
package main
import (
"context"
"database/sql"
b64 "encoding/base64"
"fmt"
"net/http"
"os"
"os/signal"
"path"
"runtime"
"strings"
"syscall"
"time"
"github.com/ente-io/museum/pkg/controller/cast"
"github.com/ente-io/museum/pkg/controller/commonbilling"
cache2 "github.com/ente-io/museum/ente/cache"
"github.com/ente-io/museum/pkg/controller/discord"
"github.com/ente-io/museum/pkg/controller/offer"
"github.com/ente-io/museum/pkg/controller/usercache"
"github.com/GoKillers/libsodium-go/sodium"
"github.com/dlmiddlecote/sqlstats"
"github.com/ente-io/museum/ente/jwt"
"github.com/ente-io/museum/pkg/api"
"github.com/ente-io/museum/pkg/controller"
"github.com/ente-io/museum/pkg/controller/access"
authenticatorCtrl "github.com/ente-io/museum/pkg/controller/authenticator"
dataCleanupCtrl "github.com/ente-io/museum/pkg/controller/data_cleanup"
"github.com/ente-io/museum/pkg/controller/email"
embeddingCtrl "github.com/ente-io/museum/pkg/controller/embedding"
"github.com/ente-io/museum/pkg/controller/family"
kexCtrl "github.com/ente-io/museum/pkg/controller/kex"
"github.com/ente-io/museum/pkg/controller/locationtag"
"github.com/ente-io/museum/pkg/controller/lock"
remoteStoreCtrl "github.com/ente-io/museum/pkg/controller/remotestore"
"github.com/ente-io/museum/pkg/controller/storagebonus"
"github.com/ente-io/museum/pkg/controller/user"
userEntityCtrl "github.com/ente-io/museum/pkg/controller/userentity"
"github.com/ente-io/museum/pkg/middleware"
"github.com/ente-io/museum/pkg/repo"
authenticatorRepo "github.com/ente-io/museum/pkg/repo/authenticator"
castRepo "github.com/ente-io/museum/pkg/repo/cast"
"github.com/ente-io/museum/pkg/repo/datacleanup"
"github.com/ente-io/museum/pkg/repo/embedding"
"github.com/ente-io/museum/pkg/repo/kex"
locationtagRepo "github.com/ente-io/museum/pkg/repo/locationtag"
"github.com/ente-io/museum/pkg/repo/passkey"
"github.com/ente-io/museum/pkg/repo/remotestore"
storageBonusRepo "github.com/ente-io/museum/pkg/repo/storagebonus"
userEntityRepo "github.com/ente-io/museum/pkg/repo/userentity"
"github.com/ente-io/museum/pkg/utils/billing"
"github.com/ente-io/museum/pkg/utils/config"
"github.com/ente-io/museum/pkg/utils/s3config"
timeUtil "github.com/ente-io/museum/pkg/utils/time"
"github.com/gin-contrib/gzip"
"github.com/gin-contrib/requestid"
"github.com/gin-contrib/timeout"
"github.com/gin-gonic/gin"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/lib/pq"
"github.com/patrickmn/go-cache"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
ginprometheus "github.com/zsais/go-gin-prometheus"
"gopkg.in/natefinch/lumberjack.v2"
)
func main() {
environment := os.Getenv("ENVIRONMENT")
if environment == "" {
environment = "local"
}
err := config.ConfigureViper(environment)
if err != nil {
panic(err)
}
setupLogger(environment)
log.Infof("Booting up %s server with commit #%s", environment, os.Getenv("GIT_COMMIT"))
secretEncryptionKey := viper.GetString("key.encryption")
hashingKey := viper.GetString("key.hash")
jwtSecret := viper.GetString("jwt.secret")
secretEncryptionKeyBytes, err := b64.StdEncoding.DecodeString(secretEncryptionKey)
if err != nil {
log.Fatal("Could not decode email-encryption-key", err)
}
hashingKeyBytes, err := b64.StdEncoding.DecodeString(hashingKey)
if err != nil {
log.Fatal("Could not decode email-hash-key", err)
}
jwtSecretBytes, err := b64.URLEncoding.DecodeString(jwtSecret)
if err != nil {
log.Fatal("Could not decode jwt-secret ", err)
}
db := setupDatabase()
defer db.Close()
sodium.Init()
hostName, err := os.Hostname()
if err != nil {
log.Fatal("Could not get host name", err)
}
var latencyLogger = promauto.NewHistogramVec(prometheus.HistogramOpts{
Name: "museum_method_latency",
Help: "The amount of time each method is taking to respond",
Buckets: []float64{10, 50, 100, 200, 500, 1000, 10000, 30000, 60000, 120000, 600000},
}, []string{"method"})
s3Config := s3config.NewS3Config()
passkeysRepo, err := passkey.NewRepository(db)
if err != nil {
panic(err)
}
storagBonusRepo := &storageBonusRepo.Repository{DB: db}
castDb := castRepo.Repository{DB: db}
userRepo := &repo.UserRepository{DB: db, SecretEncryptionKey: secretEncryptionKeyBytes, HashingKey: hashingKeyBytes, StorageBonusRepo: storagBonusRepo, PasskeysRepository: passkeysRepo}
twoFactorRepo := &repo.TwoFactorRepository{DB: db, SecretEncryptionKey: secretEncryptionKeyBytes}
userAuthRepo := &repo.UserAuthRepository{DB: db}
billingRepo := &repo.BillingRepository{DB: db}
userEntityRepo := &userEntityRepo.Repository{DB: db}
locationTagRepository := &locationtagRepo.Repository{DB: db}
authRepo := &authenticatorRepo.Repository{DB: db}
remoteStoreRepository := &remotestore.Repository{DB: db}
dataCleanupRepository := &datacleanup.Repository{DB: db}
taskLockingRepo := &repo.TaskLockRepository{DB: db}
notificationHistoryRepo := &repo.NotificationHistoryRepository{DB: db}
queueRepo := &repo.QueueRepository{DB: db}
objectRepo := &repo.ObjectRepository{DB: db, QueueRepo: queueRepo}
objectCleanupRepo := &repo.ObjectCleanupRepository{DB: db}
objectCopiesRepo := &repo.ObjectCopiesRepository{DB: db}
usageRepo := &repo.UsageRepository{DB: db, UserRepo: userRepo}
fileRepo := &repo.FileRepository{DB: db, S3Config: s3Config, QueueRepo: queueRepo,
ObjectRepo: objectRepo, ObjectCleanupRepo: objectCleanupRepo,
ObjectCopiesRepo: objectCopiesRepo, UsageRepo: usageRepo}
familyRepo := &repo.FamilyRepository{DB: db}
trashRepo := &repo.TrashRepository{DB: db, ObjectRepo: objectRepo, FileRepo: fileRepo, QueueRepo: queueRepo}
publicCollectionRepo := &repo.PublicCollectionRepository{DB: db}
collectionRepo := &repo.CollectionRepository{DB: db, FileRepo: fileRepo, PublicCollectionRepo: publicCollectionRepo,
TrashRepo: trashRepo, SecretEncryptionKey: secretEncryptionKeyBytes, QueueRepo: queueRepo, LatencyLogger: latencyLogger}
pushRepo := &repo.PushTokenRepository{DB: db}
kexRepo := &kex.Repository{
DB: db,
}
embeddingRepo := &embedding.Repository{DB: db}
authCache := cache.New(1*time.Minute, 15*time.Minute)
accessTokenCache := cache.New(1*time.Minute, 15*time.Minute)
discordController := discord.NewDiscordController(userRepo, hostName, environment)
rateLimiter := middleware.NewRateLimitMiddleware(discordController)
lockController := &lock.LockController{
TaskLockingRepo: taskLockingRepo,
HostName: hostName,
}
emailNotificationCtrl := &email.EmailNotificationController{
UserRepo: userRepo,
LockController: lockController,
NotificationHistoryRepo: notificationHistoryRepo,
}
userCache := cache2.NewUserCache()
userCacheCtrl := &usercache.Controller{UserCache: userCache, FileRepo: fileRepo, StoreBonusRepo: storagBonusRepo}
offerController := offer.NewOfferController(*userRepo, discordController, storagBonusRepo, userCacheCtrl)
plans := billing.GetPlans()
defaultPlan := billing.GetDefaultPlans(plans)
stripeClients := billing.GetStripeClients()
commonBillController := commonbilling.NewController(storagBonusRepo, userRepo, usageRepo)
appStoreController := controller.NewAppStoreController(defaultPlan,
billingRepo, fileRepo, userRepo, commonBillController)
playStoreController := controller.NewPlayStoreController(defaultPlan,
billingRepo, fileRepo, userRepo, storagBonusRepo, commonBillController)
stripeController := controller.NewStripeController(plans, stripeClients,
billingRepo, fileRepo, userRepo, storagBonusRepo, discordController, emailNotificationCtrl, offerController, commonBillController)
billingController := controller.NewBillingController(plans,
appStoreController, playStoreController, stripeController,
discordController, emailNotificationCtrl,
billingRepo, userRepo, usageRepo, storagBonusRepo, commonBillController)
pushController := controller.NewPushController(pushRepo, taskLockingRepo, hostName)
mailingListsController := controller.NewMailingListsController()
storageBonusCtrl := &storagebonus.Controller{
UserRepo: userRepo,
StorageBonus: storagBonusRepo,
LockController: lockController,
CronRunning: false,
EmailNotificationController: emailNotificationCtrl,
}
objectController := &controller.ObjectController{
S3Config: s3Config,
ObjectRepo: objectRepo,
QueueRepo: queueRepo,
LockController: lockController,
}
objectCleanupController := controller.NewObjectCleanupController(
objectCleanupRepo,
objectRepo,
lockController,
objectController,
s3Config,
)
usageController := &controller.UsageController{
BillingCtrl: billingController,
StorageBonusCtrl: storageBonusCtrl,
UserCacheCtrl: userCacheCtrl,
UsageRepo: usageRepo,
UserRepo: userRepo,
FamilyRepo: familyRepo,
FileRepo: fileRepo,
}
fileController := &controller.FileController{
FileRepo: fileRepo,
ObjectRepo: objectRepo,
ObjectCleanupRepo: objectCleanupRepo,
TrashRepository: trashRepo,
UserRepo: userRepo,
UsageCtrl: usageController,
CollectionRepo: collectionRepo,
TaskLockingRepo: taskLockingRepo,
QueueRepo: queueRepo,
ObjectCleanupCtrl: objectCleanupController,
LockController: lockController,
EmailNotificationCtrl: emailNotificationCtrl,
S3Config: s3Config,
HostName: hostName,
}
replicationController3 := &controller.ReplicationController3{
S3Config: s3Config,
ObjectRepo: objectRepo,
ObjectCopiesRepo: objectCopiesRepo,
DiscordController: discordController,
}
trashController := &controller.TrashController{
TrashRepo: trashRepo,
FileRepo: fileRepo,
CollectionRepo: collectionRepo,
QueueRepo: queueRepo,
TaskLockRepo: taskLockingRepo,
HostName: hostName,
}
familyController := &family.Controller{
FamilyRepo: familyRepo,
BillingCtrl: billingController,
UserRepo: userRepo,
UserCacheCtrl: userCacheCtrl,
}
publicCollectionCtrl := &controller.PublicCollectionController{
FileController: fileController,
EmailNotificationCtrl: emailNotificationCtrl,
PublicCollectionRepo: publicCollectionRepo,
CollectionRepo: collectionRepo,
UserRepo: userRepo,
JwtSecret: jwtSecretBytes,
}
accessCtrl := access.NewAccessController(collectionRepo, fileRepo)
collectionController := &controller.CollectionController{
CollectionRepo: collectionRepo,
AccessCtrl: accessCtrl,
PublicCollectionCtrl: publicCollectionCtrl,
UserRepo: userRepo,
FileRepo: fileRepo,
CastRepo: &castDb,
BillingCtrl: billingController,
QueueRepo: queueRepo,
TaskRepo: taskLockingRepo,
LatencyLogger: latencyLogger,
}
kexCtrl := &kexCtrl.Controller{
Repo: kexRepo,
}
userController := user.NewUserController(
userRepo,
usageRepo,
userAuthRepo,
twoFactorRepo,
passkeysRepo,
storagBonusRepo,
fileRepo,
collectionController,
collectionRepo,
dataCleanupRepository,
billingRepo,
secretEncryptionKeyBytes,
hashingKeyBytes,
authCache,
jwtSecretBytes,
billingController,
familyController,
discordController,
mailingListsController,
pushController,
userCache,
userCacheCtrl,
)
passkeyCtrl := &controller.PasskeyController{
Repo: passkeysRepo,
UserRepo: userRepo,
}
authMiddleware := middleware.AuthMiddleware{UserAuthRepo: userAuthRepo, Cache: authCache, UserController: userController}
accessTokenMiddleware := middleware.AccessTokenMiddleware{
PublicCollectionRepo: publicCollectionRepo,
PublicCollectionCtrl: publicCollectionCtrl,
CollectionRepo: collectionRepo,
Cache: accessTokenCache,
BillingCtrl: billingController,
DiscordController: discordController,
}
if environment != "local" {
gin.SetMode(gin.ReleaseMode)
}
server := gin.New()
p := ginprometheus.NewPrometheus("museum")
p.ReqCntURLLabelMappingFn = urlSanitizer
p.Use(server)
// note: the recover middleware must be in the last
server.Use(requestid.New(), middleware.Logger(urlSanitizer), cors(), gzip.Gzip(gzip.DefaultCompression), middleware.PanicRecover())
publicAPI := server.Group("/")
publicAPI.Use(rateLimiter.APIRateLimitMiddleware(urlSanitizer))
privateAPI := server.Group("/")
privateAPI.Use(authMiddleware.TokenAuthMiddleware(nil), rateLimiter.APIRateLimitForUserMiddleware(urlSanitizer))
adminAPI := server.Group("/admin")
adminAPI.Use(authMiddleware.TokenAuthMiddleware(nil), authMiddleware.AdminAuthMiddleware())
paymentJwtAuthAPI := server.Group("/")
paymentJwtAuthAPI.Use(authMiddleware.TokenAuthMiddleware(jwt.PAYMENT.Ptr()))
familiesJwtAuthAPI := server.Group("/")
//The middleware order matters. First, the userID must be set in the context, so that we can apply limit for user.
familiesJwtAuthAPI.Use(authMiddleware.TokenAuthMiddleware(jwt.FAMILIES.Ptr()), rateLimiter.APIRateLimitForUserMiddleware(urlSanitizer))
publicCollectionAPI := server.Group("/public-collection")
publicCollectionAPI.Use(accessTokenMiddleware.AccessTokenAuthMiddleware(urlSanitizer))
healthCheckHandler := &api.HealthCheckHandler{
DB: db,
}
publicAPI.GET("/ping", timeout.New(
timeout.WithTimeout(5*time.Second),
timeout.WithHandler(healthCheckHandler.Ping),
timeout.WithResponse(timeOutResponse),
))
publicAPI.GET("/fire/db-m-ping", timeout.New(
timeout.WithTimeout(5*time.Second),
timeout.WithHandler(healthCheckHandler.PingDBStats),
timeout.WithResponse(timeOutResponse),
))
fileHandler := &api.FileHandler{
Controller: fileController,
}
privateAPI.GET("/files/upload-urls", fileHandler.GetUploadURLs)
privateAPI.GET("/files/multipart-upload-urls", fileHandler.GetMultipartUploadURLs)
privateAPI.GET("/files/download/:fileID", fileHandler.Get)
privateAPI.GET("/files/download/v2/:fileID", fileHandler.Get)
privateAPI.GET("/files/preview/:fileID", fileHandler.GetThumbnail)
privateAPI.GET("/files/preview/v2/:fileID", fileHandler.GetThumbnail)
privateAPI.POST("/files", fileHandler.CreateOrUpdate)
privateAPI.PUT("/files/update", fileHandler.Update)
privateAPI.POST("/files/trash", fileHandler.Trash)
privateAPI.POST("/files/size", fileHandler.GetSize)
privateAPI.POST("/files/info", fileHandler.GetInfo)
privateAPI.GET("/files/duplicates", fileHandler.GetDuplicates)
privateAPI.GET("/files/large-thumbnails", fileHandler.GetLargeThumbnailFiles)
privateAPI.PUT("/files/thumbnail", fileHandler.UpdateThumbnail)
privateAPI.PUT("/files/magic-metadata", fileHandler.UpdateMagicMetadata)
privateAPI.PUT("/files/public-magic-metadata", fileHandler.UpdatePublicMagicMetadata)
publicAPI.GET("/files/count", fileHandler.GetTotalFileCount)
kexHandler := &api.KexHandler{
Controller: kexCtrl,
}
publicAPI.GET("/kex/get", kexHandler.GetKey)
publicAPI.PUT("/kex/add", kexHandler.AddKey)
trashHandler := &api.TrashHandler{
Controller: trashController,
}
privateAPI.GET("/trash/diff", trashHandler.GetDiff)
privateAPI.GET("/trash/v2/diff", trashHandler.GetDiffV2)
privateAPI.POST("/trash/delete", trashHandler.Delete)
privateAPI.POST("/trash/empty", trashHandler.Empty)
userHandler := &api.UserHandler{
UserController: userController,
}
publicAPI.POST("/users/ott", userHandler.SendOTT)
publicAPI.POST("/users/verify-email", userHandler.VerifyEmail)
publicAPI.POST("/users/two-factor/verify", userHandler.VerifyTwoFactor)
publicAPI.GET("/users/two-factor/recover", userHandler.RecoverTwoFactor)
publicAPI.POST("/users/two-factor/remove", userHandler.RemoveTwoFactor)
publicAPI.POST("/users/two-factor/passkeys/begin", userHandler.BeginPasskeyAuthenticationCeremony)
publicAPI.POST("/users/two-factor/passkeys/finish", userHandler.FinishPasskeyAuthenticationCeremony)
privateAPI.GET("/users/two-factor/status", userHandler.GetTwoFactorStatus)
privateAPI.POST("/users/two-factor/setup", userHandler.SetupTwoFactor)
privateAPI.POST("/users/two-factor/enable", userHandler.EnableTwoFactor)
privateAPI.POST("/users/two-factor/disable", userHandler.DisableTwoFactor)
privateAPI.PUT("/users/attributes", userHandler.SetAttributes)
privateAPI.PUT("/users/email-mfa", userHandler.UpdateEmailMFA)
privateAPI.PUT("/users/keys", userHandler.UpdateKeys)
privateAPI.POST("/users/srp/setup", userHandler.SetupSRP)
privateAPI.POST("/users/srp/complete", userHandler.CompleteSRPSetup)
privateAPI.POST("/users/srp/update", userHandler.UpdateSrpAndKeyAttributes)
publicAPI.GET("/users/srp/attributes", userHandler.GetSRPAttributes)
publicAPI.POST("/users/srp/verify-session", userHandler.VerifySRPSession)
publicAPI.POST("/users/srp/create-session", userHandler.CreateSRPSession)
privateAPI.PUT("/users/recovery-key", userHandler.SetRecoveryKey)
privateAPI.GET("/users/public-key", userHandler.GetPublicKey)
privateAPI.GET("/users/feedback", userHandler.GetRoadmapURL)
privateAPI.GET("/users/roadmap", userHandler.GetRoadmapURL)
privateAPI.GET("/users/roadmap/v2", userHandler.GetRoadmapURLV2)
privateAPI.GET("/users/session-validity/v2", userHandler.GetSessionValidityV2)
privateAPI.POST("/users/event", userHandler.ReportEvent)
privateAPI.POST("/users/logout", userHandler.Logout)
privateAPI.GET("/users/payment-token", userHandler.GetPaymentToken)
privateAPI.GET("/users/families-token", userHandler.GetFamiliesToken)
privateAPI.GET("/users/accounts-token", userHandler.GetAccountsToken)
privateAPI.GET("/users/details", userHandler.GetDetails)
privateAPI.GET("/users/details/v2", userHandler.GetDetailsV2)
privateAPI.POST("/users/change-email", userHandler.ChangeEmail)
privateAPI.GET("/users/sessions", userHandler.GetActiveSessions)
privateAPI.DELETE("/users/session", userHandler.TerminateSession)
privateAPI.GET("/users/delete-challenge", userHandler.GetDeleteChallenge)
privateAPI.DELETE("/users/delete", userHandler.DeleteUser)
accountsJwtAuthAPI := server.Group("/")
accountsJwtAuthAPI.Use(authMiddleware.TokenAuthMiddleware(jwt.ACCOUNTS.Ptr()), rateLimiter.APIRateLimitForUserMiddleware(urlSanitizer))
passkeysHandler := &api.PasskeyHandler{
Controller: passkeyCtrl,
}
accountsJwtAuthAPI.GET("/passkeys", passkeysHandler.GetPasskeys)
accountsJwtAuthAPI.PATCH("/passkeys/:passkeyID", passkeysHandler.RenamePasskey)
accountsJwtAuthAPI.DELETE("/passkeys/:passkeyID", passkeysHandler.DeletePasskey)
accountsJwtAuthAPI.GET("/passkeys/registration/begin", passkeysHandler.BeginRegistration)
accountsJwtAuthAPI.POST("/passkeys/registration/finish", passkeysHandler.FinishRegistration)
collectionHandler := &api.CollectionHandler{
Controller: collectionController,
}
privateAPI.POST("/collections", collectionHandler.Create)
privateAPI.GET("/collections/:collectionID", collectionHandler.GetCollectionByID)
//lint:ignore SA1019 Deprecated API will be removed in the future
privateAPI.GET("/collections", collectionHandler.Get)
privateAPI.GET("/collections/v2", collectionHandler.GetV2)
privateAPI.POST("/collections/share", collectionHandler.Share)
privateAPI.POST("/collections/share-url", collectionHandler.ShareURL)
privateAPI.PUT("/collections/share-url", collectionHandler.UpdateShareURL)
privateAPI.DELETE("/collections/share-url/:collectionID", collectionHandler.UnShareURL)
privateAPI.POST("/collections/unshare", collectionHandler.UnShare)
privateAPI.POST("/collections/leave/:collectionID", collectionHandler.Leave)
privateAPI.POST("/collections/add-files", collectionHandler.AddFiles)
privateAPI.POST("/collections/move-files", collectionHandler.MoveFiles)
privateAPI.POST("/collections/restore-files", collectionHandler.RestoreFiles)
privateAPI.POST("/collections/v3/remove-files", collectionHandler.RemoveFilesV3)
privateAPI.GET("/collections/v2/diff", collectionHandler.GetDiffV2)
privateAPI.GET("/collections/file", collectionHandler.GetFile)
privateAPI.GET("/collections/sharees", collectionHandler.GetSharees)
privateAPI.DELETE("/collections/v2/:collectionID", collectionHandler.Trash)
privateAPI.DELETE("/collections/v3/:collectionID", collectionHandler.TrashV3)
privateAPI.POST("/collections/rename", collectionHandler.Rename)
privateAPI.PUT("/collections/magic-metadata", collectionHandler.PrivateMagicMetadataUpdate)
privateAPI.PUT("/collections/public-magic-metadata", collectionHandler.PublicMagicMetadataUpdate)
privateAPI.PUT("/collections/sharee-magic-metadata", collectionHandler.ShareeMagicMetadataUpdate)
publicCollectionHandler := &api.PublicCollectionHandler{
Controller: publicCollectionCtrl,
FileCtrl: fileController,
CollectionCtrl: collectionController,
StorageBonusController: storageBonusCtrl,
}
publicCollectionAPI.GET("/files/preview/:fileID", publicCollectionHandler.GetThumbnail)
publicCollectionAPI.GET("/files/download/:fileID", publicCollectionHandler.GetFile)
publicCollectionAPI.GET("/diff", publicCollectionHandler.GetDiff)
publicCollectionAPI.GET("/info", publicCollectionHandler.GetCollection)
publicCollectionAPI.GET("/upload-urls", publicCollectionHandler.GetUploadUrls)
publicCollectionAPI.GET("/multipart-upload-urls", publicCollectionHandler.GetMultipartUploadURLs)
publicCollectionAPI.POST("/file", publicCollectionHandler.CreateFile)
publicCollectionAPI.POST("/verify-password", publicCollectionHandler.VerifyPassword)
publicCollectionAPI.POST("/report-abuse", publicCollectionHandler.ReportAbuse)
castAPI := server.Group("/cast")
castCtrl := cast.NewController(&castDb, accessCtrl)
castMiddleware := middleware.CastMiddleware{CastCtrl: castCtrl, Cache: authCache}
castAPI.Use(castMiddleware.CastAuthMiddleware())
castHandler := &api.CastHandler{
CollectionCtrl: collectionController,
FileCtrl: fileController,
Ctrl: castCtrl,
}
publicAPI.POST("/cast/device-info/", castHandler.RegisterDevice)
privateAPI.GET("/cast/device-info/:deviceCode", castHandler.GetDeviceInfo)
publicAPI.GET("/cast/cast-data/:deviceCode", castHandler.GetCastData)
privateAPI.POST("/cast/cast-data/", castHandler.InsertCastData)
privateAPI.DELETE("/cast/revoke-all-tokens/", castHandler.RevokeAllToken)
castAPI.GET("/files/preview/:fileID", castHandler.GetThumbnail)
castAPI.GET("/files/download/:fileID", castHandler.GetFile)
castAPI.GET("/diff", castHandler.GetDiff)
castAPI.GET("/info", castHandler.GetCollection)
familyHandler := &api.FamilyHandler{
Controller: familyController,
}
publicAPI.GET("/family/invite-info/:token", familyHandler.GetInviteInfo)
publicAPI.POST("/family/accept-invite", familyHandler.AcceptInvite)
privateAPI.DELETE("/family/leave", familyHandler.Leave) // native/web app
familiesJwtAuthAPI.POST("/family/create", familyHandler.CreateFamily)
familiesJwtAuthAPI.POST("/family/add-member", familyHandler.InviteMember)
familiesJwtAuthAPI.GET("/family/members", familyHandler.FetchMembers)
familiesJwtAuthAPI.DELETE("/family/remove-member/:id", familyHandler.RemoveMember)
familiesJwtAuthAPI.DELETE("/family/revoke-invite/:id", familyHandler.RevokeInvite)
billingHandler := &api.BillingHandler{
Controller: billingController,
AppStoreController: appStoreController,
PlayStoreController: playStoreController,
StripeController: stripeController,
}
publicAPI.GET("/billing/plans/v2", billingHandler.GetPlansV2)
privateAPI.GET("/billing/user-plans", billingHandler.GetUserPlans)
privateAPI.GET("/billing/usage", billingHandler.GetUsage)
privateAPI.GET("/billing/subscription", billingHandler.GetSubscription)
privateAPI.POST("/billing/verify-subscription", billingHandler.VerifySubscription)
publicAPI.POST("/billing/notify/android", billingHandler.AndroidNotificationHandler)
publicAPI.POST("/billing/notify/ios", billingHandler.IOSNotificationHandler)
publicAPI.POST("/billing/notify/stripe", billingHandler.StripeINNotificationHandler)
// after the StripeIN customers are completely migrated, we can change notify/stripe/us to notify/stripe and deprecate this endpoint
publicAPI.POST("/billing/notify/stripe/us", billingHandler.StripeUSNotificationHandler)
privateAPI.GET("/billing/stripe/customer-portal", billingHandler.GetStripeCustomerPortal)
privateAPI.POST("/billing/stripe/cancel-subscription", billingHandler.StripeCancelSubscription)
privateAPI.POST("/billing/stripe/activate-subscription", billingHandler.StripeActivateSubscription)
paymentJwtAuthAPI.GET("/billing/stripe-account-country", billingHandler.GetStripeAccountCountry)
paymentJwtAuthAPI.GET("/billing/stripe/checkout-session", billingHandler.GetCheckoutSession)
paymentJwtAuthAPI.POST("/billing/stripe/update-subscription", billingHandler.StripeUpdateSubscription)
storageBonusHandler := &api.StorageBonusHandler{
Controller: storageBonusCtrl,
}
privateAPI.GET("/storage-bonus/details", storageBonusHandler.GetStorageBonusDetails)
privateAPI.GET("/storage-bonus/referral-view", storageBonusHandler.GetReferralView)
privateAPI.POST("/storage-bonus/referral-claim", storageBonusHandler.ClaimReferral)
adminHandler := &api.AdminHandler{
UserRepo: userRepo,
CollectionRepo: collectionRepo,
UserAuthRepo: userAuthRepo,
UserController: userController,
FamilyController: familyController,
FileRepo: fileRepo,
StorageBonusRepo: storagBonusRepo,
BillingRepo: billingRepo,
BillingController: billingController,
ObjectCleanupController: objectCleanupController,
MailingListsController: mailingListsController,
DiscordController: discordController,
HashingKey: hashingKeyBytes,
PasskeyController: passkeyCtrl,
}
adminAPI.POST("/mail", adminHandler.SendMail)
adminAPI.POST("/mail/subscribe", adminHandler.SubscribeMail)
adminAPI.POST("/mail/unsubscribe", adminHandler.UnsubscribeMail)
adminAPI.GET("/users", adminHandler.GetUsers)
adminAPI.GET("/user", adminHandler.GetUser)
adminAPI.POST("/user/disable-2fa", adminHandler.DisableTwoFactor)
adminAPI.POST("/user/disable-passkeys", adminHandler.RemovePasskeys)
adminAPI.POST("/user/close-family", adminHandler.CloseFamily)
adminAPI.DELETE("/user/delete", adminHandler.DeleteUser)
adminAPI.POST("/user/recover", adminHandler.RecoverAccount)
adminAPI.GET("/email-hash", adminHandler.GetEmailHash)
adminAPI.POST("/emails-from-hashes", adminHandler.GetEmailsFromHashes)
adminAPI.PUT("/user/subscription", adminHandler.UpdateSubscription)
adminAPI.POST("/user/bf-2013", adminHandler.UpdateBFDeal)
adminAPI.POST("/job/clear-orphan-objects", adminHandler.ClearOrphanObjects)
userEntityController := &userEntityCtrl.Controller{Repo: userEntityRepo}
userEntityHandler := &api.UserEntityHandler{Controller: userEntityController}
privateAPI.POST("/user-entity/key", userEntityHandler.CreateKey)
privateAPI.GET("/user-entity/key", userEntityHandler.GetKey)
privateAPI.POST("/user-entity/entity", userEntityHandler.CreateEntity)
privateAPI.PUT("/user-entity/entity", userEntityHandler.UpdateEntity)
privateAPI.DELETE("/user-entity/entity", userEntityHandler.DeleteEntity)
privateAPI.GET("/user-entity/entity/diff", userEntityHandler.GetDiff)
locationTagController := &locationtag.Controller{Repo: locationTagRepository}
locationTagHandler := &api.LocationTagHandler{Controller: locationTagController}
privateAPI.POST("/locationtag/create", locationTagHandler.Create)
privateAPI.POST("/locationtag/update", locationTagHandler.Update)
privateAPI.DELETE("/locationtag/delete", locationTagHandler.Delete)
privateAPI.GET("/locationtag/diff", locationTagHandler.GetDiff)
authenticatorController := &authenticatorCtrl.Controller{Repo: authRepo}
authenticatorHandler := &api.AuthenticatorHandler{Controller: authenticatorController}
privateAPI.POST("/authenticator/key", authenticatorHandler.CreateKey)
privateAPI.GET("/authenticator/key", authenticatorHandler.GetKey)
privateAPI.POST("/authenticator/entity", authenticatorHandler.CreateEntity)
privateAPI.PUT("/authenticator/entity", authenticatorHandler.UpdateEntity)
privateAPI.DELETE("/authenticator/entity", authenticatorHandler.DeleteEntity)
privateAPI.GET("/authenticator/entity/diff", authenticatorHandler.GetDiff)
remoteStoreController := &remoteStoreCtrl.Controller{Repo: remoteStoreRepository}
dataCleanupController := &dataCleanupCtrl.DeleteUserCleanupController{
Repo: dataCleanupRepository,
UserRepo: userRepo,
CollectionRepo: collectionRepo,
TaskLockRepo: taskLockingRepo,
TrashRepo: trashRepo,
UsageRepo: usageRepo,
HostName: hostName,
}
remoteStoreHandler := &api.RemoteStoreHandler{Controller: remoteStoreController}
privateAPI.POST("/remote-store/update", remoteStoreHandler.InsertOrUpdate)
privateAPI.GET("/remote-store", remoteStoreHandler.GetKey)
pushHandler := &api.PushHandler{PushController: pushController}
privateAPI.POST("/push/token", pushHandler.AddToken)
embeddingController := &embeddingCtrl.Controller{Repo: embeddingRepo, AccessCtrl: accessCtrl, ObjectCleanupController: objectCleanupController, S3Config: s3Config, FileRepo: fileRepo, CollectionRepo: collectionRepo, QueueRepo: queueRepo, TaskLockingRepo: taskLockingRepo, HostName: hostName}
embeddingHandler := &api.EmbeddingHandler{Controller: embeddingController}
privateAPI.PUT("/embeddings", embeddingHandler.InsertOrUpdate)
privateAPI.GET("/embeddings/diff", embeddingHandler.GetDiff)
privateAPI.DELETE("/embeddings", embeddingHandler.DeleteAll)
offerHandler := &api.OfferHandler{Controller: offerController}
publicAPI.GET("/offers/black-friday", offerHandler.GetBlackFridayOffers)
setKnownAPIs(server.Routes())
setupAndStartBackgroundJobs(objectCleanupController, replicationController3)
setupAndStartCrons(
userAuthRepo, publicCollectionRepo, twoFactorRepo, passkeysRepo, fileController, taskLockingRepo, emailNotificationCtrl,
trashController, pushController, objectController, dataCleanupController, storageBonusCtrl,
embeddingController, healthCheckHandler, kexCtrl, castDb)
// Create a new collector, the name will be used as a label on the metrics
collector := sqlstats.NewStatsCollector("prod_db", db)
// Register it with Prometheus
prometheus.MustRegister(collector)
http.Handle("/metrics", promhttp.Handler())
go http.ListenAndServe(":2112", nil)
go runServer(environment, server)
discordController.NotifyStartup()
log.Println("We have lift-off.")
quit := make(chan os.Signal, 1)
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
<-quit
log.Println("Shutting down server...")
discordController.NotifyShutdown()
}
func runServer(environment string, server *gin.Engine) {
if environment == "local" {
server.Run(":8080")
} else {
certPath, err := config.CredentialFilePath("tls.cert")
if err != nil {
log.Fatal(err)
}
keyPath, err := config.CredentialFilePath("tls.key")
if err != nil {
log.Fatal(err)
}
log.Fatal(server.RunTLS(":443", certPath, keyPath))
}
}
func setupLogger(environment string) {
log.SetReportCaller(true)
callerPrettyfier := func(f *runtime.Frame) (string, string) {
s := strings.Split(f.Function, ".")
funcName := s[len(s)-1]
return funcName, fmt.Sprintf("%s:%d", path.Base(f.File), f.Line)
}
logFile := viper.GetString("log-file")
if environment == "local" && logFile == "" {
log.SetFormatter(&log.TextFormatter{
CallerPrettyfier: callerPrettyfier,
DisableQuote: true,
ForceColors: true,
})
} else {
log.SetFormatter(&log.JSONFormatter{
CallerPrettyfier: callerPrettyfier,
PrettyPrint: false,
})
log.SetOutput(&lumberjack.Logger{
Filename: logFile,
MaxSize: 100,
MaxAge: 30,
Compress: true,
})
}
}
func setupDatabase() *sql.DB {
log.Println("Setting up db")
db, err := sql.Open("postgres", config.GetPGInfo())
if err != nil {
log.Panic(err)
panic(err)
}
log.Println("Connected to DB")
err = db.Ping()
if err != nil {
panic(err)
}
log.Println("Pinged DB")
driver, _ := postgres.WithInstance(db, &postgres.Config{})
m, err := migrate.NewWithDatabaseInstance(
"file://migrations", "postgres", driver)
if err != nil {
log.Panic(err)
panic(err)
}
log.Println("Loaded migration scripts")
if err := m.Up(); err != nil && err != migrate.ErrNoChange {
log.Panic(err)
panic(err)
}
db.SetMaxIdleConns(6)
db.SetMaxOpenConns(30)
log.Println("Database was configured successfully.")
return db
}
func setupAndStartBackgroundJobs(
objectCleanupController *controller.ObjectCleanupController,
replicationController3 *controller.ReplicationController3,
) {
isReplicationEnabled := viper.GetBool("replication.enabled")
if isReplicationEnabled {
err := replicationController3.StartReplication()
if err != nil {
log.Warnf("Could not start replication v3: %s", err)
}
} else {
log.Info("Skipping Replication as replication is disabled")
}
objectCleanupController.StartRemovingUnreportedObjects()
objectCleanupController.StartClearingOrphanObjects()
}
func setupAndStartCrons(userAuthRepo *repo.UserAuthRepository, publicCollectionRepo *repo.PublicCollectionRepository,
twoFactorRepo *repo.TwoFactorRepository, passkeysRepo *passkey.Repository, fileController *controller.FileController,
taskRepo *repo.TaskLockRepository, emailNotificationCtrl *email.EmailNotificationController,
trashController *controller.TrashController, pushController *controller.PushController,
objectController *controller.ObjectController,
dataCleanupCtrl *dataCleanupCtrl.DeleteUserCleanupController,
storageBonusCtrl *storagebonus.Controller,
embeddingCtrl *embeddingCtrl.Controller,
healthCheckHandler *api.HealthCheckHandler,
kexCtrl *kexCtrl.Controller,
castDb castRepo.Repository) {
shouldSkipCron := viper.GetBool("jobs.cron.skip")
if shouldSkipCron {
log.Info("Skipping cron jobs")
return
}
c := cron.New()
schedule(c, "@every 1m", func() {
_ = userAuthRepo.RemoveExpiredOTTs()
})
schedule(c, "@every 24h", func() {
_ = userAuthRepo.RemoveDeletedTokens(timeUtil.MicrosecondBeforeDays(30))
_ = castDb.DeleteOldCodes(context.Background(), timeUtil.MicrosecondBeforeDays(1))
_ = publicCollectionRepo.CleanupAccessHistory(context.Background())
})
schedule(c, "@every 1m", func() {
_ = twoFactorRepo.RemoveExpiredTwoFactorSessions()
})
schedule(c, "@every 1m", func() {
_ = twoFactorRepo.RemoveExpiredTempTwoFactorSecrets()
})
schedule(c, "@every 1m", func() {
_ = passkeysRepo.RemoveExpiredPasskeySessions()
})
schedule(c, "@every 1m", func() {
healthCheckHandler.PerformHealthCheck()
})
scheduleAndRun(c, "@every 60m", func() {
err := taskRepo.CleanupExpiredLocks()
if err != nil {
log.Printf("Error while cleaning up lock table, %s", err)
}
})
schedule(c, "@every 193s", func() {
fileController.CleanupDeletedFiles()
})
schedule(c, "@every 101s", func() {
embeddingCtrl.CleanupDeletedEmbeddings()
})
schedule(c, "@every 120s", func() {
trashController.DropFileMetadataCron()
})
schedule(c, "@every 2m", func() {
objectController.RemoveComplianceHolds()
})
schedule(c, "@every 1m", func() {
trashController.CleanupTrashedCollections()
})
// 101s to avoid running too many cron at same time
schedule(c, "@every 101s", func() {
trashController.DeleteAgedTrashedFiles()
})
schedule(c, "@every 63s", func() {
storageBonusCtrl.PaymentUpgradeOrDowngradeCron()
})
// 67s to avoid running too many cron at same time
schedule(c, "@every 67s", func() {
trashController.ProcessEmptyTrashRequests()
})
schedule(c, "@every 30m", func() {
dataCleanupCtrl.DeleteDataCron()
})
schedule(c, "@every 24h", func() {
emailNotificationCtrl.SendStorageLimitExceededMails()
})
schedule(c, "@every 1m", func() {
pushController.SendPushes()
})
schedule(c, "@every 24h", func() {
pushController.ClearExpiredTokens()
})
scheduleAndRun(c, "@every 60m", func() {
kexCtrl.DeleteOldKeys()
})
c.Start()
}
func cors() gin.HandlerFunc {
return func(c *gin.Context) {
c.Writer.Header().Set("Access-Control-Allow-Origin", c.GetHeader("Origin"))
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, X-Auth-Token, X-Auth-Access-Token, X-Cast-Access-Token, X-Auth-Access-Token-JWT, X-Client-Package, X-Client-Version, Authorization, accept, origin, Cache-Control, X-Requested-With, upgrade-insecure-requests")
c.Writer.Header().Set("Access-Control-Expose-Headers", "X-Request-Id")
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT, PATCH, DELETE")
c.Writer.Header().Set("Access-Control-Max-Age", "1728000")
if c.Request.Method == http.MethodOptions {
c.AbortWithStatus(http.StatusNoContent)
return
}
c.Next()
}
}
var knownAPIs = make(map[string]bool)
func urlSanitizer(c *gin.Context) string {
if c.Request.Method == http.MethodOptions {
return "/options"
}
u := *c.Request.URL
u.RawQuery = ""
uri := u.RequestURI()
for _, p := range c.Params {
uri = strings.Replace(uri, p.Value, fmt.Sprintf(":%s", p.Key), 1)
}
if !knownAPIs[uri] {
log.Warn("Unknown API: " + uri)
return "/unknown-api"
}
return uri
}
func timeOutResponse(c *gin.Context) {
c.JSON(http.StatusRequestTimeout, gin.H{"handler": true})
}
func setKnownAPIs(routes []gin.RouteInfo) {
for _, route := range routes {
knownAPIs[route.Path] = true
}
}
// Schedule a cron job
func schedule(c *cron.Cron, spec string, cmd func()) (cron.EntryID, error) {
return c.AddFunc(spec, cmd)
}
// Schedule a cron job, and run it once immediately too.
func scheduleAndRun(c *cron.Cron, spec string, cmd func()) (cron.EntryID, error) {
go cmd()
return schedule(c, spec, cmd)
}

93
server/compose.yaml Normal file
View file

@ -0,0 +1,93 @@
services:
museum:
build:
context: .
args:
GIT_COMMIT: development-cluster
ports:
- 8080:8080 # API
- 2112:2112 # Prometheus metrics
depends_on:
postgres:
condition: service_healthy
environment:
# Pass-in the config to connect to the DB and MinIO
ENTE_CREDENTIALS_FILE: /credentials.yaml
volumes:
- custom-logs:/var/logs
- ./museum.yaml:/museum.yaml:ro
- ./scripts/compose/credentials.yaml:/credentials.yaml:ro
networks:
- internal
# Resolve "localhost:3200" in the museum container to the minio container.
socat:
image: alpine/socat
network_mode: service:museum
depends_on:
- museum
command: "TCP-LISTEN:3200,fork,reuseaddr TCP:minio:3200"
postgres:
image: postgres:12
ports:
- 5432:5432
environment:
POSTGRES_USER: pguser
POSTGRES_PASSWORD: pgpass
POSTGRES_DB: ente_db
# Wait for postgres to be accept connections before starting museum.
healthcheck:
test:
[
"CMD",
"pg_isready",
"-q",
"-d",
"ente_db",
"-U",
"pguser"
]
interval: 1s
timeout: 5s
retries: 20
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- internal
minio:
image: minio/minio
# Use different ports than the minio defaults to avoid conflicting
# with the ports used by Prometheus.
ports:
- 3200:3200 # API
- 3201:3201 # Console
environment:
MINIO_ROOT_USER: test
MINIO_ROOT_PASSWORD: testtest
command: server /data --address ":3200" --console-address ":3201"
volumes:
- minio-data:/data
networks:
- internal
minio-provision:
image: minio/mc
depends_on:
- minio
volumes:
- ./scripts/compose/minio-provision.sh:/provision.sh:ro
- minio-data:/data
networks:
- internal
entrypoint: sh /provision.sh
volumes:
custom-logs:
postgres-data:
minio-data:
networks:
internal:

View file

@ -0,0 +1,264 @@
# Configuring museum
# ------------------
#
# 1. If the environment variable `ENVIRONMENT` is specified, then it is used to
# load one of the files from the `configurations/` directory. If not present,
# then by default `local.yaml` (this file) will get loaded.
#
# 2. Then, museum will look for a file named `museum.yaml` in the current
# working directory. If found, this file will also be loaded, and entries
# specified therein will override the defaults specified here.
#
# 3. If the "credentials-file" config option is set, then museum will also load
# that and merge it in.
#
# 4. Config can be overridden with via environment variables (details below).
#
# Environment variables
# ---------------------
#
# All configuration options can be overridden via environment variables. The
# environment variable should have the prefix "ENTE_", and any nesting should be
# replaced by underscores.
#
# For example, the nested string "db.user" in the config file can alternatively
# be specified (or be overridden) by setting an environment variable named
# ENTE_DB_USER.
#
#
# Empty strings
# -------------
#
# The empty string indicates missing values (to match go convention).
#
# This also means that to override a value that is specified in local.yaml in a
# subsequently loaded config file, you should specify the key as an empty string
# (`key: ""`) instead of leaving it unset.
#
# ---
# If this option is specified, then it is loaded and gets merged-in over the
# defaults present in default.yaml. This provides a way to inject credentials
# and other overrides.
#
# The default is to look for a file named credentials.yaml in the CWD.
#credentials-file: credentials.yaml
# Some credentials (e.g. the TLS cert) are cumbersome to provide inline in the
# YAML configuration file, thus these are loaded at runtime from separate files.
#
# This is the directory where museum should look for them.
#
# Currently, the following files are loaded (if needed)
#
# - credentials/{tls.cert,tls.key}
# - credentials/pst-service-account.json
# - credentials/fcm-service-account.json
#
# The default is to look for a these files in a directory named credentials
# under the CWD.
#credentials-dir: credentials
# By default, museum logs to stdout when running locally. Specify this path to
# get it to log to a file instead.
#
# It must be specified if running in a non-local environment.
log-file: ""
# Database connection parameters
db:
host: localhost
port: 5432
name: ente_db
# These can be specified here, or alternatively provided via the environment
# as ENTE_DB_USER and ENTE_DB_PASSWORD.
user:
password:
# Map of data centers
#
# Each data center also specifies which bucket in that provider should be used.
s3:
# Override the primary and secondary hot storage. The commented out values
# are the defaults.
#
#hot_storage:
# primary: b2-eu-cen
# secondary: wasabi-eu-central-2-v3
b2-eu-cen:
key:
secret:
endpoint:
region:
bucket:
wasabi-eu-central-2-v3:
key:
secret:
endpoint:
region:
bucket:
# If enabled, this causes us to opt the object out of the compliance
# lock when the object is deleted. See "Wasabi Compliance".
#
# Currently this flag is only honoured for the Wasabi v3 bucket.
compliance: true
scw-eu-fr-v3:
key:
secret:
endpoint:
region:
bucket:
# If true, enable some workarounds to allow us to use a local minio instance
# for object storage.
#
# 1. Disable SSL.
#
# 2. Use "path" style S3 URLs where the bucket is part of the URL path, e.g.
# http://localhost:3200/b2-eu-cen. By default the bucket name is part of
# the (sub)domain, e.g. http://b2-eu-cen.localhost:3200/ and cannot be
# resolved when running locally.
#
# 3. Directly download the file during replication instead of going via the
# Cloudflare worker.
#
# 4. Do not specify storage classes when uploading objects (since minio does
# not support them, specifically it doesn't support GLACIER).
#
#are_local_buckets: true
# Key used for encrypting customer emails before storing them in DB
#
# To make it easy to get started, some randomly generated values are provided
# here. But if you're really going to be using museum, please generate new keys.
# You can use `go run tools/gen-random-keys/main.go` for that.
key:
encryption: yvmG/RnzKrbCb9L3mgsmoxXr9H7i2Z4qlbT0mL3ln4w=
hash: KXYiG07wC7GIgvCSdg+WmyWdXDAn6XKYJtp/wkEU7x573+byBRAYtpTP0wwvi8i/4l37uicX1dVTUzwH3sLZyw==
# JWT secrets
#
# To make it easy to get started, a randomly generated values is provided here.
# But if you're really going to be using museum, please generate new keys. You
# can use `go run tools/gen-random-keys/main.go` for that.
jwt:
secret: i2DecQmfGreG6q1vBj5tCokhlN41gcfS2cjOs9Po-u8=
# Zoho Zeptomail config (optional)
# Use case: Sending emails
transmail:
# Transmail token
# Mail agent: dev
key:
# Apple config (optional)
# Use case: In-app purchases
apple:
# Secret used when communicating with Apple for validating IAP receipts.
shared-secret:
# Stripe config (optional)
# Use case: Payments
stripe:
us:
key:
webhook-secret:
in:
key:
webhook-secret:
whitelisted-redirect-urls: []
path:
success: ?status=success&session_id={CHECKOUT_SESSION_ID}
cancel: ?status=fail&reason=canceled
# Passkey support (WIP)
webauthn:
rpid: "example.com"
rporigins:
- "https://example.com:3005"
# Roadmap SSO (optional)
#
# Allow the user to sign into an hosted roadmap service using their ente.io
# credentials. Here we can can configure the URL prefix and service levels
# credentials for SSO.
roadmap:
# The prefix of the URL the user should be redirected to
url-prefix:
# This secret can be obtained from the roadmap dashboard
sso-secret:
# Discord config (optional)
# Use case: Devops
discord:
bot:
cha-ching:
token:
channel:
mona-lisa:
token:
channel:
# Zoho Campaigns config (optional)
# Use case: Sending emails
zoho:
client-id:
client-secret:
refresh-token:
list-key:
topic-ids:
# Various low-level configuration options
internal:
# If false (the default), then museum will notify the external world of
# various events. E.g, email users about their storage being full, send
# alerts to Discord, etc.
#
# It can be set to true when running a "read only" instance like a backup
# restoration test, where we want to be able to access data but otherwise
# minimize external side effects.
silent: false
# If provided, this external healthcheck url is periodically pinged.
health-check-url:
# Hardcoded verification codes, useful for logging in when developing.
hardcoded-ott:
emails:
- "example@example.org,123456"
# When running in a local environment, hardcode the verification code to
# 123456 for email addresses ending with @example.org
local-domain-suffix: "@example.org"
local-domain-value: 123456
# List of user IDs that can use the admin API endpoints.
admins: []
# Replication config
#
# If enabled, replicate each file to 2 other data centers after it gets
# successfully uploaded to the primary hot storage.
replication:
enabled: false
# The Cloudflare worker to use to download files from the primary hot
# bucket. Must be specified if replication is enabled.
worker-url:
# Number of go routines to spawn for replication
# This is not related to the worker-url above.
# Optional, default value is indicated here.
worker-count: 6
# Where to store temporary objects during replication v3
# Optional, default value is indicated here.
tmp-storage: tmp/replication
# Configuration for various background / cron jobs.
jobs:
cron:
# Instances run various cleanup, sending emails and other cron jobs. Use
# this flag to disable all these cron jobs.
skip: false
remove-unreported-objects:
# Number of go routines to spawn for object cleanup
# Optional, default value is indicated here.
worker-count: 1
clear-orphan-objects:
# By default, this job is disabled.
enabled: false
# If provided, only objects that begin with this prefix are pruned.
prefix: ""

View file

@ -0,0 +1,6 @@
log-file: /var/logs/museum.log
stripe:
path:
success: ?status=success&session_id={CHECKOUT_SESSION_ID}
cancel: ?status=fail&reason=canceled

38
server/ente/access.go Normal file
View file

@ -0,0 +1,38 @@
package ente
type CollectionParticipantRole string
const (
VIEWER CollectionParticipantRole = "VIEWER"
OWNER CollectionParticipantRole = "OWNER"
COLLABORATOR CollectionParticipantRole = "COLLABORATOR"
UNKNOWN CollectionParticipantRole = "UNKNOWN"
)
func (c *CollectionParticipantRole) CanAdd() bool {
if c == nil {
return false
}
return *c == OWNER || *c == COLLABORATOR
}
// CanRemoveAny indicates if the role allows user to remove files added by others too
func (c *CollectionParticipantRole) CanRemoveAny() bool {
if c == nil {
return false
}
return *c == OWNER
}
func ConvertStringToCollectionParticipantRole(value string) CollectionParticipantRole {
switch value {
case "VIEWER":
return VIEWER
case "OWNER":
return OWNER
case "COLLABORATOR":
return COLLABORATOR
default:
return UNKNOWN
}
}

99
server/ente/admin.go Normal file
View file

@ -0,0 +1,99 @@
package ente
import (
"errors"
"fmt"
)
// GetEmailsFromHashesRequest represents a request to convert hashes
type GetEmailsFromHashesRequest struct {
Hashes []string `json:"hashes"`
}
// Admin API request to disable 2FA for a user account.
//
// This is used when we get a user request to reset their 2FA when they might've
// lost access to their 2FA codes. We verify their identity out of band.
type DisableTwoFactorRequest struct {
UserID int64 `json:"userID" binding:"required"`
}
type AdminOpsForUserRequest struct {
UserID int64 `json:"userID" binding:"required"`
}
// RecoverAccount is used to recover accounts which are in soft-delete state.
type RecoverAccountRequest struct {
UserID int64 `json:"userID" binding:"required"`
EmailID string `json:"emailID" binding:"required"`
}
// UpdateSubscriptionRequest is used to update a user's subscription
type UpdateSubscriptionRequest struct {
AdminID int64 `json:"-"`
UserID int64 `json:"userID" binding:"required"`
Storage int64 `json:"storage" binding:"required"`
PaymentProvider PaymentProvider `json:"paymentProvider"`
TransactionID string `json:"transactionID" binding:"required"`
ProductID string `json:"productID" binding:"required"`
ExpiryTime int64 `json:"expiryTime" binding:"required"`
Attributes SubscriptionAttributes `json:"attributes"`
}
type AddOnAction string
const (
ADD AddOnAction = "ADD"
REMOVE AddOnAction = "REMOVE"
UPDATE AddOnAction = "UPDATE"
)
type UpdateBlackFridayDeal struct {
Action AddOnAction `json:"action" binding:"required"`
UserID int64 `json:"userID" binding:"required"`
Year int `json:"year"`
StorageInGB int64 `json:"storageInGB"`
Testing bool `json:"testing"`
StorageInMB int64 `json:"storageInMB"`
Minute int64 `json:"minute"`
}
func (u UpdateBlackFridayDeal) UpdateLog() string {
if u.Testing {
return fmt.Sprintf("BF_UPDATE_TESTING: %s, storageInMB: %d, minute: %d", u.Action, u.StorageInMB, u.Minute)
} else {
return fmt.Sprintf("BF_UPDATE: %s, storageInGB: %d, year: %d", u.Action, u.StorageInGB, u.Year)
}
}
func (u UpdateBlackFridayDeal) Validate() error {
if u.Action == ADD || u.Action == UPDATE {
if u.Testing {
if u.StorageInMB == 0 && u.Minute == 0 {
return errors.New("invalid input, set in MB and minute for test")
}
} else {
if u.StorageInGB != 100 && u.StorageInGB != 2000 && u.StorageInGB != 500 {
return errors.New("invalid input for deal, only 100, 500, 2000 allowed")
}
if u.Year != 3 && u.Year != 5 {
return errors.New("invalid input for year, only 3 or 5")
}
}
}
return nil
}
// ClearOrphanObjectsRequest is the API request to trigger the process for
// clearing orphan objects in DC.
//
// The optional prefix can be specified to limit the cleanup to objects that
// begin with that prefix.
//
// ForceTaskLock can be used to force the cleanup to start even if there is an
// existing task lock for the clear orphan objects task.
type ClearOrphanObjectsRequest struct {
DC string `json:"dc" binding:"required"`
Prefix string `json:"prefix"`
ForceTaskLock bool `json:"forceTaskLock"`
}

28
server/ente/app.go Normal file
View file

@ -0,0 +1,28 @@
package ente
// PaymentProvider represents the payment provider via which a purchase was made
type App string
const (
Photos App = "photos"
Auth App = "auth"
Locker App = "locker"
)
// Check if the app string is valid
func (a App) IsValid() bool {
switch a {
case Photos, Auth, Locker:
return true
}
return false
}
// IsValidForCollection returns True if the given app type can create collections
func (a App) IsValidForCollection() bool {
switch a {
case Photos, Locker:
return true
}
return false
}

View file

@ -0,0 +1,47 @@
package authenticator
import "github.com/google/uuid"
type Key struct {
UserID int64 `json:"userID" binding:"required"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
Header string `json:"header" binding:"required"`
CreatedAt int64 `json:"createdAt" binding:"required"`
}
// Entity represents a single TOTP Entity
type Entity struct {
ID uuid.UUID `json:"id" binding:"required"`
UserID int64 `json:"userID" binding:"required"`
EncryptedData *string `json:"encryptedData" binding:"required"`
Header *string `json:"header" binding:"required"`
IsDeleted bool `json:"isDeleted" binding:"required"`
CreatedAt int64 `json:"createdAt" binding:"required"`
UpdatedAt int64 `json:"updatedAt" binding:"required"`
}
// CreateKeyRequest represents a request to create totp encryption key for user
type CreateKeyRequest struct {
EncryptedKey string `json:"encryptedKey" binding:"required"`
Header string `json:"header" binding:"required"`
}
// CreateEntityRequest...
type CreateEntityRequest struct {
EncryptedData string `json:"encryptedData" binding:"required"`
Header string `json:"header" binding:"required"`
}
// UpdateEntityRequest...
type UpdateEntityRequest struct {
ID uuid.UUID `json:"id" binding:"required"`
EncryptedData string `json:"encryptedData" binding:"required"`
Header string `json:"header" binding:"required"`
}
// GetEntityDiffRequest...
type GetEntityDiffRequest struct {
// SinceTime *int64. Pointer allows us to pass 0 value otherwise binding fails for zero Value.
SinceTime *int64 `form:"sinceTime" binding:"required"`
Limit int16 `form:"limit" binding:"required"`
}

188
server/ente/billing.go Normal file
View file

@ -0,0 +1,188 @@
package ente
import (
"database/sql/driver"
"encoding/json"
"github.com/ente-io/stacktrace"
"github.com/stripe/stripe-go/v72"
"github.com/stripe/stripe-go/v72/client"
)
const (
// FreePlanStorage is the amount of storage in free plan
FreePlanStorage = 1 * 1024 * 1024 * 1024
// FreePlanProductID is the product ID of free plan
FreePlanProductID = "free"
// FreePlanTransactionID is the dummy transaction ID for the free plan
FreePlanTransactionID = "none"
// TrialPeriodDuration is the duration of the free trial
TrialPeriodDuration = 365
// TrialPeriod is the unit for the duration of the free trial
TrialPeriod = "days"
// PeriodYear is the unit for the duration of the yearly plan
PeriodYear = "year"
// PeriodMonth is the unit for the duration of the monthly plan
PeriodMonth = "month"
Period3Years = "3years"
Period5Years = "5years"
// FamilyPlanProductID is the product ID of family (internal employees & their friends & family) plan
FamilyPlanProductID = "family"
// StripeSignature is the header send by the stripe webhook to verify authenticity
StripeSignature = "Stripe-Signature"
// OnHoldTemplate is the template for the email
// that is to be sent out when an account enters the hold stage
OnHoldTemplate = "on_hold.html"
// AccountOnHoldEmailSubject is the subject of account on hold email
AccountOnHoldEmailSubject = "ente account on hold"
// Template for the email we send out when the user's subscription ends,
// either because the user cancelled their subscription, or because it
// expired.
SubscriptionEndedEmailTemplate = "subscription_ended.html"
// Subject for `SubscriptionEndedEmailTemplate`.
SubscriptionEndedEmailSubject = "Your subscription to ente Photos has ended"
)
// PaymentProvider represents the payment provider via which a purchase was made
type PaymentProvider string
const (
// PlayStore was the payment provider
PlayStore PaymentProvider = "playstore"
// AppStore was the payment provider
AppStore PaymentProvider = "appstore"
// Stripe was the payment provider
Stripe PaymentProvider = "stripe"
// Paypal was the payment provider
Paypal PaymentProvider = "paypal"
// BitPay was the payment provider
BitPay PaymentProvider = "bitpay"
)
type StripeAccountCountry string
type BillingPlansPerCountry map[string][]BillingPlan
type BillingPlansPerAccount map[StripeAccountCountry]BillingPlansPerCountry
type StripeClientPerAccount map[StripeAccountCountry]*client.API
const (
StripeIN StripeAccountCountry = "IN"
StripeUS StripeAccountCountry = "US"
)
const DefaultStripeAccountCountry = StripeUS
// AndroidNotification represents a notification received from PlayStore
type AndroidNotification struct {
Message AndroidNotificationMessage `json:"message"`
Subscription string `json:"subscription"`
}
// AndroidNotificationMessage represents the message within the notification received from
// PlayStore
type AndroidNotificationMessage struct {
Attributes map[string]string `json:"attributes"`
Data string `json:"data"`
MessageID string `json:"messageId"`
}
// BillingPlan represents a billing plan
type BillingPlan struct {
ID string `json:"id"`
AndroidID string `json:"androidID"`
IOSID string `json:"iosID"`
StripeID string `json:"stripeID"`
Storage int64 `json:"storage"`
Price string `json:"price"`
Period string `json:"period"`
}
type FreePlan struct {
Storage int `json:"storage"`
Duration int `json:"duration"`
Period string `json:"period"`
}
// Subscription represents a user's subscription to a billing plan
type Subscription struct {
ID int64 `json:"id"`
UserID int64 `json:"userID"`
// Identifier of the product on respective stores that the user has subscribed to
ProductID string `json:"productID"`
Storage int64 `json:"storage"`
// LinkedPurchaseToken on PlayStore , OriginalTransactionID on AppStore and SubscriptionID on Stripe
OriginalTransactionID string `json:"originalTransactionID"`
ExpiryTime int64 `json:"expiryTime"`
PaymentProvider PaymentProvider `json:"paymentProvider"`
Attributes SubscriptionAttributes `json:"attributes"`
Price string `json:"price"`
Period string `json:"period"`
}
// SubscriptionAttributes represents a subscription's paymentProvider specific attributes
type SubscriptionAttributes struct {
// IsCancelled represents if subscription's renewal have been cancelled
IsCancelled bool `json:"isCancelled,omitempty"`
// CustomerID represents the stripe customerID
CustomerID string `json:"customerID,omitempty"`
// LatestVerificationData is the the latestTransactionReceipt received
LatestVerificationData string `json:"latestVerificationData,omitempty"`
// StripeAccountCountry is the identifier for the account in which the subscription is created.
StripeAccountCountry StripeAccountCountry `json:"stripeAccountCountry,omitempty"`
}
// Value implements the driver.Valuer interface. This method
// simply returns the JSON-encoded representation of the struct.
func (ca SubscriptionAttributes) Value() (driver.Value, error) {
return json.Marshal(ca)
}
// Scan implements the sql.Scanner interface. This method
// simply decodes a JSON-encoded value into the struct fields.
func (ca *SubscriptionAttributes) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return stacktrace.NewError("type assertion to []byte failed")
}
return json.Unmarshal(b, &ca)
}
// SubscriptionVerificationRequest represents a request to verify a subscription done via a paymentProvider
type SubscriptionVerificationRequest struct {
PaymentProvider PaymentProvider `json:"paymentProvider"`
ProductID string `json:"productID"`
VerificationData string `json:"verificationData"`
}
// StripeUpdateRequest represents a request to modify the stripe subscription
type StripeUpdateRequest struct {
ProductID string `json:"productID"`
}
type SubscriptionUpdateResponse struct {
Status string `json:"status"`
ClientSecret string `json:"clientSecret"`
}
type StripeSubscriptionInfo struct {
PlanCountry string
AccountCountry StripeAccountCountry
}
type StripeEventLog struct {
UserID int64
StripeSubscription stripe.Subscription
Event stripe.Event
}

56
server/ente/cache/user_data_cache.go vendored Normal file
View file

@ -0,0 +1,56 @@
package cache
import (
"fmt"
"github.com/ente-io/museum/ente"
"github.com/ente-io/museum/ente/storagebonus"
"sync"
)
// UserCache struct holds can be used to fileCount various entities for user.
type UserCache struct {
mu sync.Mutex
fileCache map[string]int64
bonusCache map[int64]*storagebonus.ActiveStorageBonus
}
// NewUserCache creates a new instance of the UserCache struct.
func NewUserCache() *UserCache {
return &UserCache{
fileCache: make(map[string]int64),
bonusCache: make(map[int64]*storagebonus.ActiveStorageBonus),
}
}
// SetFileCount updates the fileCount with the given userID and fileCount.
func (c *UserCache) SetFileCount(userID, fileCount int64, app ente.App) {
c.mu.Lock()
defer c.mu.Unlock()
c.fileCache[cacheKey(userID, app)] = fileCount
}
func (c *UserCache) SetBonus(userID int64, bonus *storagebonus.ActiveStorageBonus) {
c.mu.Lock()
defer c.mu.Unlock()
c.bonusCache[userID] = bonus
}
func (c *UserCache) GetBonus(userID int64) (*storagebonus.ActiveStorageBonus, bool) {
c.mu.Lock()
defer c.mu.Unlock()
bonus, ok := c.bonusCache[userID]
return bonus, ok
}
// GetFileCount retrieves the file count from the fileCount for the given userID.
// It returns the file count and a boolean indicating if the value was found.
func (c *UserCache) GetFileCount(userID int64, app ente.App) (int64, bool) {
c.mu.Lock()
defer c.mu.Unlock()
count, ok := c.fileCache[cacheKey(userID, app)]
return count, ok
}
func cacheKey(userID int64, app ente.App) string {
return fmt.Sprintf("%d-%s", userID, app)
}

View file

@ -0,0 +1,19 @@
package cast
// CastRequest ..
type CastRequest struct {
CollectionID int64 `json:"collectionID" binding:"required"`
CastToken string `json:"castToken" binding:"required"`
EncPayload string `json:"encPayload" binding:"required"`
DeviceCode string `json:"deviceCode" binding:"required"`
}
type RegisterDeviceRequest struct {
DeviceCode *string `json:"deviceCode"`
PublicKey string `json:"publicKey" binding:"required"`
}
type AuthContext struct {
CollectionID int64
UserID int64
}

147
server/ente/collection.go Normal file
View file

@ -0,0 +1,147 @@
package ente
import (
"database/sql/driver"
"encoding/json"
"github.com/ente-io/stacktrace"
)
var ValidCollectionTypes = []string{"album", "folder", "favorites", "uncategorized"}
// Collection represents a collection
type Collection struct {
ID int64 `json:"id"`
Owner CollectionUser `json:"owner"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
KeyDecryptionNonce string `json:"keyDecryptionNonce,omitempty" binding:"required"`
Name string `json:"name"`
EncryptedName string `json:"encryptedName"`
NameDecryptionNonce string `json:"nameDecryptionNonce"`
Type string `json:"type" binding:"required"`
Attributes CollectionAttributes `json:"attributes,omitempty" binding:"required"`
Sharees []CollectionUser `json:"sharees"`
PublicURLs []PublicURL `json:"publicURLs"`
UpdationTime int64 `json:"updationTime"`
IsDeleted bool `json:"isDeleted,omitempty"`
MagicMetadata *MagicMetadata `json:"magicMetadata,omitempty"`
App string `json:"app"`
PublicMagicMetadata *MagicMetadata `json:"pubMagicMetadata,omitempty"`
// SharedMagicMetadata keeps the metadata of the sharees to store settings like
// if the collection should be shown on timeline or not
SharedMagicMetadata *MagicMetadata `json:"sharedMagicMetadata,omitempty"`
}
// AllowSharing indicates if this particular collection type can be shared
// or not
func (c *Collection) AllowSharing() bool {
if c == nil {
return false
}
if c.Type == "favorites" || c.Type == "uncategorized" {
return false
}
return true
}
// AllowDelete indicates if this particular collection type can be deleted by the user
// or not
func (c *Collection) AllowDelete() bool {
if c == nil {
return false
}
if c.Type == "favorites" || c.Type == "uncategorized" {
return false
}
return true
}
// CollectionUser represents the owner of a collection
type CollectionUser struct {
ID int64 `json:"id"`
Email string `json:"email"`
// Deprecated
Name string `json:"name"`
Role CollectionParticipantRole `json:"role"`
}
// CollectionAttributes represents a collection's attribtues
type CollectionAttributes struct {
EncryptedPath string `json:"encryptedPath,omitempty"`
PathDecryptionNonce string `json:"pathDecryptionNonce,omitempty"`
Version int `json:"version"`
}
// Value implements the driver.Valuer interface. This method
// simply returns the JSON-encoded representation of the struct.
func (ca CollectionAttributes) Value() (driver.Value, error) {
return json.Marshal(ca)
}
// Scan implements the sql.Scanner interface. This method
// simply decodes a JSON-encoded value into the struct fields.
func (ca *CollectionAttributes) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return stacktrace.NewError("type assertion to []byte failed")
}
return json.Unmarshal(b, &ca)
}
// AlterShareRequest represents a share/unshare request
type AlterShareRequest struct {
CollectionID int64 `json:"collectionID" binding:"required"`
Email string `json:"email" binding:"required"`
EncryptedKey string `json:"encryptedKey"`
Role *CollectionParticipantRole `json:"role"`
}
// AddFilesRequest represents a request to add files to a collection
type AddFilesRequest struct {
CollectionID int64 `json:"collectionID" binding:"required"`
Files []CollectionFileItem `json:"files" binding:"required"`
}
// RemoveFilesRequest represents a request to remove files from a collection
type RemoveFilesRequest struct {
CollectionID int64 `json:"collectionID" binding:"required"`
// OtherFileIDs represents the files which don't belong the user trying to remove files
FileIDs []int64 `json:"fileIDs"`
}
// RemoveFilesV3Request represents request payload for v3 version of removing files from collection
// In V3, only those files are allowed to be removed from collection which don't belong to the collection owner.
// If collection owner wants to remove files owned by them, the client should move those files to other collections
// owned by the collection user. Also, See [Collection Delete Versions] for additional context.
type RemoveFilesV3Request struct {
CollectionID int64 `json:"collectionID" binding:"required"`
// OtherFileIDs represents the files which don't belong the user trying to remove files
FileIDs []int64 `json:"fileIDs" binding:"required"`
}
type RenameRequest struct {
CollectionID int64 `json:"collectionID" binding:"required"`
EncryptedName string `json:"encryptedName" binding:"required"`
NameDecryptionNonce string `json:"nameDecryptionNonce" binding:"required"`
}
// UpdateCollectionMagicMetadata payload for updating magic metadata for single file
type UpdateCollectionMagicMetadata struct {
ID int64 `json:"id" binding:"required"`
MagicMetadata MagicMetadata `json:"magicMetadata" binding:"required"`
}
// CollectionFileItem represents a file in an AddFilesRequest and MoveFilesRequest
type CollectionFileItem struct {
ID int64 `json:"id" binding:"required"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
KeyDecryptionNonce string `json:"keyDecryptionNonce" binding:"required"`
}
// MoveFilesRequest represents movement of file between two collections
type MoveFilesRequest struct {
FromCollectionID int64 `json:"fromCollectionID" binding:"required"`
ToCollectionID int64 `json:"toCollectionID" binding:"required"`
Files []CollectionFileItem `json:"files" binding:"required"`
}

View file

@ -0,0 +1,28 @@
package data_cleanup
// Stage represents the action to be taken on the next scheduled run for a particular stage
type Stage string
const (
// Scheduled means user data is scheduled for deletion
Scheduled Stage = "scheduled"
// Collection means trash all collections for the user
Collection Stage = "collection"
// Trash means trigger empty trash for the user
Trash Stage = "trash"
// Storage means check for consumed storage
Storage Stage = "storage"
// Completed means data clean up is done
Completed Stage = "completed"
)
type DataCleanup struct {
UserID int64
Stage Stage
// StageScheduleTime indicates when should we process current stage
StageScheduleTime int64
// StageAttemptCount refers to number of attempts made to execute current stage
StageAttemptCount int
CreatedAt int64
UpdatedAt int64
}

View file

@ -0,0 +1,19 @@
package details
import (
"github.com/ente-io/museum/ente"
"github.com/ente-io/museum/ente/storagebonus"
)
type UserDetailsResponse struct {
Email string `json:"email,omitempty"`
Usage int64 `json:"usage"`
Subscription ente.Subscription `json:"subscription"`
FamilyData *ente.FamilyMemberResponse `json:"familyData,omitempty"`
FileCount *int64 `json:"fileCount,omitempty"`
// Deprecated field. Client doesn't consume this field. We can completely remove it after Aug 2023
SharedCollectionsCount *int64 `json:"sharedCollectionsCount,omitempty"`
StorageBonus int64 `json:"storageBonus"`
ProfileData *ente.ProfileData `json:"profileData"`
BonusData *storagebonus.ActiveStorageBonus `json:"bonusData"`
}

36
server/ente/email.go Normal file
View file

@ -0,0 +1,36 @@
package ente
const (
// TransmailEndPoint is the mailing endpoint of TransMail (now called
// ZeptoMail), Zoho's transactional email service.
TransmailEndPoint = "https://api.transmail.com/v1.1/email"
// BounceAddress is the emailAddress to send bounce messages to
TransmailEndBounceAddress = "bounces@bounce.ente.io"
)
type SendEmailRequest struct {
To []string `json:"to" binding:"required"`
FromName string `json:"fromName" binding:"required"`
FromEmail string `json:"fromEmail" binding:"required"`
Subject string `json:"subject" binding:"required"`
Body string `json:"body" binding:"required"`
}
type Mail struct {
BounceAddress string `json:"bounce_address"`
From EmailAddress `json:"from"`
To []ToEmailAddress `json:"to"`
Bcc []ToEmailAddress `json:"bcc"`
Subject string `json:"subject"`
Htmlbody string `json:"htmlbody"`
InlineImages []map[string]interface{} `json:"inline_images"`
}
type ToEmailAddress struct {
EmailAddress EmailAddress `json:"email_address"`
}
type EmailAddress struct {
Address string `json:"address"`
Name string `json:"name"`
}

37
server/ente/embedding.go Normal file
View file

@ -0,0 +1,37 @@
package ente
type Embedding struct {
FileID int64 `json:"fileID"`
Model string `json:"model"`
EncryptedEmbedding string `json:"encryptedEmbedding"`
DecryptionHeader string `json:"decryptionHeader"`
UpdatedAt int64 `json:"updatedAt"`
}
type InsertOrUpdateEmbeddingRequest struct {
FileID int64 `json:"fileID" binding:"required"`
Model string `json:"model" binding:"required"`
EncryptedEmbedding string `json:"encryptedEmbedding" binding:"required"`
DecryptionHeader string `json:"decryptionHeader" binding:"required"`
}
type GetEmbeddingDiffRequest struct {
Model Model `form:"model"`
// SinceTime *int64. Pointer allows us to pass 0 value otherwise binding fails for zero Value.
SinceTime *int64 `form:"sinceTime" binding:"required"`
Limit int16 `form:"limit" binding:"required"`
}
type Model string
const (
OnnxClip Model = "onnx-clip"
GgmlClip Model = "ggml-clip"
)
type EmbeddingObject struct {
Version int `json:"v"`
EncryptedEmbedding string `json:"embedding"`
DecryptionHeader string `json:"header"`
Client string `json:"client"`
}

253
server/ente/errors.go Normal file
View file

@ -0,0 +1,253 @@
package ente
import (
"errors"
"fmt"
"net/http"
)
// ErrPermissionDenied is returned when a user has insufficient permissions to
// perform an action
var ErrPermissionDenied = errors.New("insufficient permissions to perform this action")
// ErrIncorrectOTT is returned when a user tries to validate an email with an
// incorrect OTT
var ErrIncorrectOTT = errors.New("incorrect OTT")
// ErrExpiredOTT is returned when a user tries to validate an email but there's no active ott
var ErrExpiredOTT = errors.New("no active OTT")
// ErrIncorrectTOTP is returned when a user tries to validate an two factor with an
// incorrect TOTP
var ErrIncorrectTOTP = errors.New("incorrect TOTP")
// ErrNotFound is returned when the requested resource was not found
var ErrNotFound = errors.New("not found")
var ErrFileLimitReached = errors.New("file limit reached")
// ErrBadRequest is returned when a bad request is encountered
var ErrBadRequest = errors.New("bad request")
// ErrTooManyBadRequest is returned when user send many bad requests, especailly for authentication
var ErrTooManyBadRequest = errors.New("too many bad request")
// ErrUnexpectedState is returned when certain assumption/assets fails
var ErrUnexpectedState = errors.New("unexpected state")
// ErrCannotDowngrade is thrown when a user tries to downgrade to a plan whose
// limits are lower than current consumption
var ErrCannotDowngrade = errors.New("usage is greater than selected plan, cannot downgrade")
// ErrCannotSwitchPaymentProvider is thrown when a user attempts to renew a subscription from a different payment provider
var ErrCannotSwitchPaymentProvider = errors.New("cannot switch payment provider")
// ErrNoActiveSubscription is returned when user's doesn't has any active plans
var ErrNoActiveSubscription = errors.New("no Active Subscription")
// ErrStorageLimitExceeded is thrown when user exceed the plan's data Storage limit
var ErrStorageLimitExceeded = errors.New("storage Limit exceeded")
// ErrFileTooLarge thrown when an uploaded file is too large for the storage plan
var ErrFileTooLarge = errors.New("file too large")
// ErrSharingDisabledForFreeAccounts is thrown when free subscription user tries to share files
var ErrSharingDisabledForFreeAccounts = errors.New("sharing Feature is disabled for free accounts")
// ErrDuplicateFileObjectFound is thrown when another file with the same objectKey is detected
var ErrDuplicateFileObjectFound = errors.New("file object already exists")
var ErrFavoriteCollectionAlreadyExist = errors.New("favorites collection already exists")
var ErrUncategorizeCollectionAlreadyExists = errors.New("uncategorized collection already exists")
// ErrDuplicateThumbnailObjectFound is thrown when another thumbnail with the same objectKey is detected
var ErrDuplicateThumbnailObjectFound = errors.New("thumbnail object already exists")
// ErrVersionMismatch is thrown when for versioned updates, client is sending incorrect version to server
var ErrVersionMismatch = errors.New("client version is out of sync")
// ErrCanNotInviteUserWithPaidPlan is thrown when a family admin tries to invite another user with active paid plan
var ErrCanNotInviteUserWithPaidPlan = errors.New("can not invite user with active paid plan")
// ErrBatchSizeTooLarge is thrown when api request batch size is greater than API limit
var ErrBatchSizeTooLarge = errors.New("batch size greater than API limit")
// ErrAuthenticationRequired is thrown when authentication vector is missing
var ErrAuthenticationRequired = errors.New("authentication required")
// ErrInvalidPassword is thrown when incorrect password is provided by user
var ErrInvalidPassword = errors.New("invalid password")
// ErrCanNotInviteUserAlreadyInFamily is thrown when a family admin tries to invite another user with active paid plan
var ErrCanNotInviteUserAlreadyInFamily = errors.New("can not invite user who is already part of a family")
// ErrFamilySizeLimitReached is thrown when a family admin tries to invite more than max allowed members for family plan
var ErrFamilySizeLimitReached = errors.New("can't invite new member, family already at max allowed size")
// ErrUserDeleted is thrown when Get user is called for a deleted account
var ErrUserDeleted = errors.New("user account has been deleted")
// ErrLockUnavailable is thrown when a lock could not be acquired
var ErrLockUnavailable = errors.New("could not acquire lock")
// ErrActiveLinkAlreadyExists is thrown when the collection already has active public link
var ErrActiveLinkAlreadyExists = errors.New("Collection already has active public link")
// ErrNotImplemented indicates that the action that we tried to perform is not
// available at this museum instance. e.g. this could be something that is not
// enabled on this particular instance of museum.
//
// Semantically, it could've been better called as NotAvailable, but
// NotAvailable is meant to be used for temporary errors, whilst we wish to
// indicate that this instance will not serve this request at all.
var ErrNotImplemented = errors.New("not implemented")
var ErrInvalidApp = errors.New("invalid app")
var ErrInvalidName = errors.New("invalid name")
var ErrSubscriptionAlreadyClaimed = ApiError{
Code: SubscriptionAlreadyClaimed,
HttpStatusCode: http.StatusConflict,
Message: "Subscription is already associted with different account",
}
var ErrCollectionNotEmpty = ApiError{
Code: CollectionNotEmpty,
HttpStatusCode: http.StatusConflict,
Message: "The collection is not empty",
}
var ErrFileNotFoundInAlbum = ApiError{
Code: FileNotFoundInAlbum,
HttpStatusCode: http.StatusNotFound,
Message: "File is either deleted or moved to different collection",
}
var ErrPublicCollectDisabled = ApiError{
Code: PublicCollectDisabled,
Message: "User has not enabled public collect for this url",
HttpStatusCode: http.StatusMethodNotAllowed,
}
var ErrNotFoundError = ApiError{
Code: NotFoundError,
Message: "",
HttpStatusCode: http.StatusNotFound,
}
var ErrMaxPasskeysReached = ApiError{
Code: MaxPasskeysReached,
Message: "Max passkeys limit reached",
HttpStatusCode: http.StatusConflict,
}
var ErrCastPermissionDenied = ApiError{
Code: "CAST_PERMISSION_DENIED",
Message: "Permission denied",
HttpStatusCode: http.StatusForbidden,
}
type ErrorCode string
const (
// Standard, generic error codes
BadRequest ErrorCode = "BAD_REQUEST"
CONFLICT ErrorCode = "CONFLICT"
InternalError ErrorCode = "INTERNAL_ERROR"
NotFoundError ErrorCode = "NOT_FOUND"
// Business specific error codes
FamiliySizeLimitExceeded ErrorCode = "FAMILY_SIZE_LIMIT_EXCEEDED"
// Subscription Already Associted with different account
SubscriptionAlreadyClaimed ErrorCode = "SUBSCRIPTION_ALREADY_CLAIMED"
FileNotFoundInAlbum ErrorCode = "FILE_NOT_FOUND_IN_ALBUM"
// PublicCollectDisabled error code indicates that the user has not enabled public collect
PublicCollectDisabled ErrorCode = "PUBLIC_COLLECT_DISABLED"
// CollectionNotEmpty is thrown when user attempts to delete a collection but keep files but all files from that
// collections have been moved yet.
CollectionNotEmpty ErrorCode = "COLLECTION_NOT_EMPTY"
// MaxPasskeysReached is thrown when user attempts to create more than max allowed passkeys
MaxPasskeysReached ErrorCode = "MAX_PASSKEYS_REACHED"
)
type ApiError struct {
// Code will be returned as part of the response body. Clients are expected to rely on this code while handling any error
Code ErrorCode `json:"code"`
// Optional message, which can give additional details about this error. Say for generic 404 error, it can return what entity is not found
// like file/album/user. Client should never consume this message for showing err on screen or any special handling.
Message string `json:"message"`
HttpStatusCode int `json:"-"`
}
func (e *ApiError) NewErr(message string) *ApiError {
return &ApiError{
Code: e.Code,
Message: message,
HttpStatusCode: e.HttpStatusCode,
}
}
func (e *ApiError) Error() string {
return fmt.Sprintf("%s : %s", string(e.Code), e.Message)
}
type ApiErrorParams struct {
HttpStatusCode *int
Code ErrorCode
Message string
}
var badRequestApiError = ApiError{
Code: BadRequest,
HttpStatusCode: http.StatusBadRequest,
Message: "BAD_REQUEST",
}
func NewBadRequestError(params *ApiErrorParams) *ApiError {
if params == nil {
return &badRequestApiError
}
apiError := badRequestApiError
if params.HttpStatusCode != nil {
apiError.HttpStatusCode = *params.HttpStatusCode
}
if params.Message != "" {
apiError.Message = params.Message
}
if params.Code != "" {
apiError.Code = params.Code
}
return &apiError
}
func NewBadRequestWithMessage(message string) *ApiError {
return &ApiError{
Code: BadRequest,
HttpStatusCode: http.StatusBadRequest,
Message: message,
}
}
func NewConflictError(message string) *ApiError {
return &ApiError{
Code: CONFLICT,
HttpStatusCode: http.StatusConflict,
Message: message,
}
}
func NewInternalError(message string) *ApiError {
apiError := ApiError{
Code: InternalError,
HttpStatusCode: http.StatusInternalServerError,
Message: message,
}
return &apiError
}

71
server/ente/family.go Normal file
View file

@ -0,0 +1,71 @@
package ente
import (
"github.com/google/uuid"
)
type MemberStatus string
const (
SELF MemberStatus = "SELF"
CLOSED MemberStatus = "CLOSED"
INVITED MemberStatus = "INVITED"
ACCEPTED MemberStatus = "ACCEPTED"
DECLINED MemberStatus = "DECLINED"
REVOKED MemberStatus = "REVOKED"
REMOVED MemberStatus = "REMOVED"
LEFT MemberStatus = "LEFT"
)
type InviteMemberRequest struct {
Email string `json:"email" binding:"required"`
}
type InviteInfoResponse struct {
ID uuid.UUID `json:"id" binding:"required"`
AdminEmail string `json:"adminEmail" binding:"required"`
}
type AcceptInviteResponse struct {
AdminEmail string `json:"adminEmail" binding:"required"`
Storage int64 `json:"storage" binding:"required"`
ExpiryTime int64 `json:"expiryTime" binding:"required"`
}
type AcceptInviteRequest struct {
Token string `json:"token" binding:"required"`
}
type FamilyMember struct {
ID uuid.UUID `json:"id" binding:"required"`
Email string `json:"email" binding:"required"`
Status MemberStatus `json:"status" binding:"required"`
// This information should not be sent back in the response if the membership status is `INVITED`
Usage int64 `json:"usage"`
IsAdmin bool `json:"isAdmin"`
MemberUserID int64 `json:"-"` // for internal use only, ignore from json response
AdminUserID int64 `json:"-"` // for internal use only, ignore from json response
}
type FamilyMemberResponse struct {
Members []FamilyMember `json:"members" binding:"required"`
// Family admin subscription storage capacity. This excludes add-on and any other bonus storage
Storage int64 `json:"storage" binding:"required"`
// Family admin subscription expiry time
ExpiryTime int64 `json:"expiryTime" binding:"required"`
AdminBonus int64 `json:"adminBonus" binding:"required"`
}
type UserUsageWithSubData struct {
UserID int64
// StorageConsumed by the current member.
// This information should not be sent back in the response if the membership status is `INVITED`
StorageConsumed int64
// ExpiryTime of member's current subscription plan
ExpiryTime int64
// Storage indicates storage capacity based on member's current subscription plan
Storage int64
// Email of the member. It will be populated on need basis
Email *string
}

213
server/ente/file.go Normal file
View file

@ -0,0 +1,213 @@
package ente
import (
"database/sql/driver"
"encoding/json"
"github.com/ente-io/stacktrace"
)
// File represents an encrypted file in the system
type File struct {
ID int64 `json:"id"`
OwnerID int64 `json:"ownerID"`
CollectionID int64 `json:"collectionID"`
CollectionOwnerID *int64 `json:"collectionOwnerID"`
EncryptedKey string `json:"encryptedKey"`
KeyDecryptionNonce string `json:"keyDecryptionNonce"`
File FileAttributes `json:"file" binding:"required"`
Thumbnail FileAttributes `json:"thumbnail" binding:"required"`
Metadata FileAttributes `json:"metadata" binding:"required"`
// IsDeleted is True when the file ID is removed from the CollectionID
IsDeleted bool `json:"isDeleted"`
UpdationTime int64 `json:"updationTime"`
MagicMetadata *MagicMetadata `json:"magicMetadata,omitempty"`
PubicMagicMetadata *MagicMetadata `json:"pubMagicMetadata,omitempty"`
Info *FileInfo `json:"info,omitempty"`
}
// FileInfo has information about storage used by the file & it's metadata(future)
type FileInfo struct {
FileSize int64 `json:"fileSize,omitempty"`
ThumbnailSize int64 `json:"thumbSize,omitempty"`
}
// Value implements the driver.Valuer interface. This method
// simply returns the JSON-encoded representation of the struct.
func (fi FileInfo) Value() (driver.Value, error) {
return json.Marshal(fi)
}
// Scan implements the sql.Scanner interface. This method
// simply decodes a JSON-encoded value into the struct fields.
func (fi *FileInfo) Scan(value interface{}) error {
if value == nil {
return nil
}
b, ok := value.([]byte)
if !ok {
return stacktrace.NewError("type assertion to []byte failed")
}
return json.Unmarshal(b, &fi)
}
// UpdateFileResponse represents a response to the UpdateFileRequest
type UpdateFileResponse struct {
ID int64 `json:"id" binding:"required"`
UpdationTime int64 `json:"updationTime" binding:"required"`
}
// FileIDsRequest represents a request where we just pass fileIDs as payload
type FileIDsRequest struct {
FileIDs []int64 `json:"fileIDs" binding:"required"`
}
type FileInfoResponse struct {
ID int64 `json:"id"`
FileInfo FileInfo `json:"fileInfo"`
}
type FilesInfoResponse struct {
FilesInfo []*FileInfoResponse `json:"filesInfo"`
}
type TrashRequest struct {
OwnerID int64 // ownerID will be set internally via auth header
TrashItems []TrashItemRequest `json:"items" binding:"required"`
}
// TrashItemRequest represents the request payload for deleting one file
type TrashItemRequest struct {
FileID int64 `json:"fileID" binding:"required"`
// collectionID belonging to same owner
CollectionID int64 `json:"collectionID" binding:"required"`
}
// GetSizeRequest represents a request to get the size of files
type GetSizeRequest struct {
FileIDs []int64 `json:"fileIDs" binding:"required"`
}
// FileAttributes represents a file item
type FileAttributes struct {
ObjectKey string `json:"objectKey,omitempty"`
EncryptedData string `json:"encryptedData,omitempty"`
DecryptionHeader string `json:"decryptionHeader" binding:"required"`
Size int64 `json:"size"`
}
type MagicMetadata struct {
Version int `json:"version,omitempty" binding:"required"`
// Count indicates number of keys in the json presentation of magic attributes.
// On edit/update, this number should be >= previous version.
Count int `json:"count,omitempty" binding:"required"`
// Data represents the encrypted blob for jsonEncoded attributes using file key.
Data string `json:"data,omitempty" binding:"required"`
// Header used for decrypting the encrypted attr on the client.
Header string `json:"header,omitempty" binding:"required"`
}
// Value implements the driver.Valuer interface. This method
// simply returns the JSON-encoded representation of the struct.
func (mmd MagicMetadata) Value() (driver.Value, error) {
return json.Marshal(mmd)
}
// Scan implements the sql.Scanner interface. This method
// simply decodes a JSON-encoded value into the struct fields.
func (mmd *MagicMetadata) Scan(value interface{}) error {
if value == nil {
return nil
}
b, ok := value.([]byte)
if !ok {
return stacktrace.NewError("type assertion to []byte failed")
}
return json.Unmarshal(b, &mmd)
}
// UpdateMagicMetadata payload for updating magic metadata for single file
type UpdateMagicMetadata struct {
ID int64 `json:"id" binding:"required"`
MagicMetadata MagicMetadata `json:"magicMetadata" binding:"required"`
}
// UpdateMultipleMagicMetadataRequest request payload for updating magic metadata for list of files
type UpdateMultipleMagicMetadataRequest struct {
MetadataList []UpdateMagicMetadata `json:"metadataList" binding:"required"`
}
// UploadURL represents the upload url for a specific object
type UploadURL struct {
ObjectKey string `json:"objectKey"`
URL string `json:"url"`
}
// MultipartUploadURLs represents the part upload url for a specific object
type MultipartUploadURLs struct {
ObjectKey string `json:"objectKey"`
PartURLs []string `json:"partURLs"`
CompleteURL string `json:"completeURL"`
}
type ObjectType string
const (
FILE ObjectType = "file"
THUMBNAIL ObjectType = "thumbnail"
)
// S3ObjectKey represents the s3 object key and corresponding fileID for it
type S3ObjectKey struct {
FileID int64
ObjectKey string
FileSize int64
Type ObjectType
}
// ObjectCopies represents a row from the object_copies table.
//
// It contains information about which replicas a given object key should be and
// has been replicated to.
type ObjectCopies struct {
ObjectKey string
WantB2 bool
B2 *int64
WantWasabi bool
Wasabi *int64
WantSCW bool
SCW *int64
}
// ObjectState represents details about an object that are needed for
// pre-flights checks during replication.
//
// This information is obtained by joining various tables.
type ObjectState struct {
// true if the file corresponding to this object has been deleted (or cannot
// be found)
IsFileDeleted bool
// true if the owner of the file corresponding to this object has deleted
// their account (or cannot be found).
IsUserDeleted bool
// Size of the object, in bytes.
Size int64
}
// TempObject represents a entry in tempObjects table
type TempObject struct {
ObjectKey string
IsMultipart bool
UploadID string
DataCenter string
}
// DuplicateFiles represents duplicate files
type DuplicateFiles struct {
FileIDs []int64 `json:"fileIDs"`
Size int64 `json:"size"`
}
type UpdateThumbnailRequest struct {
FileID int64 `json:"fileID" binding:"required"`
Thumbnail FileAttributes `json:"thumbnail" binding:"required"`
}

53
server/ente/jwt/jwt.go Normal file
View file

@ -0,0 +1,53 @@
package jwt
import (
"errors"
"github.com/ente-io/museum/pkg/utils/time"
)
type ClaimScope string
const (
PAYMENT ClaimScope = "PAYMENT"
FAMILIES ClaimScope = "FAMILIES"
ACCOUNTS ClaimScope = "ACCOUNTS"
DELETE_ACCOUNT ClaimScope = "DELETE_ACCOUNT"
)
func (c ClaimScope) Ptr() *ClaimScope {
return &c
}
type WebCommonJWTClaim struct {
UserID int64 `json:"userID"`
ExpiryTime int64 `json:"expiryTime"`
ClaimScope *ClaimScope `json:"claimScope"`
}
func (w *WebCommonJWTClaim) GetScope() ClaimScope {
if w.ClaimScope == nil {
return PAYMENT
}
return *w.ClaimScope
}
func (w WebCommonJWTClaim) Valid() error {
if w.ExpiryTime < time.Microseconds() {
return errors.New("token expired")
}
return nil
}
// PublicAlbumPasswordClaim refer to token granted post public album password verification
type PublicAlbumPasswordClaim struct {
PassHash string `json:"passKey"`
ExpiryTime int64 `json:"expiryTime"`
}
func (c PublicAlbumPasswordClaim) Valid() error {
if c.ExpiryTime < time.Microseconds() {
return errors.New("token expired")
}
return nil
}

6
server/ente/kex.go Normal file
View file

@ -0,0 +1,6 @@
package ente
type AddWrappedKeyRequest struct {
WrappedKey string `json:"wrappedKey" binding:"required"`
CustomIdentifier string `json:"customIdentifier"`
}

View file

@ -0,0 +1,59 @@
package ente
import (
"database/sql/driver"
"encoding/json"
"github.com/ente-io/stacktrace"
"github.com/google/uuid"
)
// LocationTag represents a location tag in the system. The location information
// is stored in an encrypted as Attributes
type LocationTag struct {
ID uuid.UUID `json:"id"`
OwnerID int64 `json:"ownerId,omitempty"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
KeyDecryptionNonce string `json:"keyDecryptionNonce" binding:"required"`
Attributes LocationTagAttribute `json:"attributes" binding:"required"`
IsDeleted bool `json:"isDeleted"`
Provider string `json:"provider,omitempty"`
CreatedAt int64 `json:"createdAt,omitempty"` // utc epoch microseconds
UpdatedAt int64 `json:"updatedAt,omitempty"` // utc epoch microseconds
}
// LocationTagAttribute holds encrypted data about user's location tag.
type LocationTagAttribute struct {
Version int `json:"version,omitempty" binding:"required"`
EncryptedData string `json:"encryptedData,omitempty" binding:"required"`
DecryptionNonce string `json:"decryptionNonce,omitempty" binding:"required"`
}
// Value implements the driver.Valuer interface. This method
// simply returns the JSON-encoded representation of the struct.
func (la LocationTagAttribute) Value() (driver.Value, error) {
return json.Marshal(la)
}
// Scan implements the sql.Scanner interface. This method
// simply decodes a JSON-encoded value into the struct fields.
func (la *LocationTagAttribute) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return stacktrace.NewError("type assertion to []byte failed")
}
return json.Unmarshal(b, &la)
}
// DeleteLocationTagRequest is request structure for deleting a location tag
type DeleteLocationTagRequest struct {
ID uuid.UUID `json:"id" binding:"required"`
OwnerID int64 // should be populated from req headers
}
// GetLocationTagDiffRequest is request struct for fetching locationTag changes
type GetLocationTagDiffRequest struct {
// SinceTime *int64. Pointer allows us to pass 0 value otherwise binding fails for zero Value.
SinceTime *int64 `form:"sinceTime" binding:"required"`
Limit int16 `form:"limit" binding:"required"`
OwnerID int64 // should be populated from req headers
}

13
server/ente/offer.go Normal file
View file

@ -0,0 +1,13 @@
package ente
// BlackFridayOffer represents the latest Black Friday Offer
type BlackFridayOffer struct {
ID string `json:"id"`
Storage int64 `json:"storage"`
Price string `json:"price"`
OldPrice string `json:"oldPrice"`
Period string `json:"period"`
PaymentLink string `json:"paymentLink"`
}
type BlackFridayOfferPerCountry map[string][]BlackFridayOffer

14
server/ente/passkey.go Normal file
View file

@ -0,0 +1,14 @@
package ente
import "github.com/google/uuid"
// Passkey is our way of keeping track of user credentials and storing useful info for users.
type Passkey struct {
ID uuid.UUID `json:"id"`
UserID int64 `json:"userID"`
FriendlyName string `json:"friendlyName"`
CreatedAt int64 `json:"createdAt"`
}
var MaxPasskeys = 10

View file

@ -0,0 +1,94 @@
package ente
import (
"encoding/base64"
"encoding/json"
"strings"
"github.com/go-webauthn/webauthn/protocol"
"github.com/go-webauthn/webauthn/webauthn"
"github.com/google/uuid"
)
// PasskeyCredential are the actual WebAuthn credentials we will send back to the user during auth for the browser to check if they have an eligible authenticator.
type PasskeyCredential struct {
PasskeyID uuid.UUID `json:"passkeyID"`
CredentialID string `json:"credentialID"` // string
PublicKey string `json:"publicKey"` // b64 []byte
AttestationType string `json:"attestationType"`
AuthenticatorTransports string `json:"authenticatorTransports"` // comma-separated slice of strings
CredentialFlags string `json:"credentialFlags"` // json encoded struct
Authenticator string `json:"authenticator"` // json encoded struct with b64 []byte for AAGUID
CreatedAt int64 `json:"createdAt"`
}
// de-serialization function into a webauthn.Credential
func (c *PasskeyCredential) WebAuthnCredential() (cred *webauthn.Credential, err error) {
decodedID, err := base64.StdEncoding.DecodeString(c.CredentialID)
if err != nil {
return
}
cred = &webauthn.Credential{
ID: decodedID,
AttestationType: c.AttestationType,
}
transports := []protocol.AuthenticatorTransport{}
transportStrings := strings.Split(c.AuthenticatorTransports, ",")
for _, t := range transportStrings {
transports = append(transports, protocol.AuthenticatorTransport(string(t)))
}
cred.Transport = transports
// decode b64 back to []byte
publicKeyByte, err := base64.StdEncoding.DecodeString(c.PublicKey)
if err != nil {
return
}
cred.PublicKey = publicKeyByte
err = json.Unmarshal(
[]byte(c.CredentialFlags),
&cred.Flags,
)
if err != nil {
return
}
authenticatorMap := map[string]interface{}{}
err = json.Unmarshal(
[]byte(c.Authenticator),
&authenticatorMap,
)
if err != nil {
return
}
// decode the AAGUID base64 back to []byte
aaguidByte, err := base64.StdEncoding.DecodeString(
authenticatorMap["AAGUID"].(string),
)
if err != nil {
return
}
authenticator := webauthn.Authenticator{
AAGUID: aaguidByte,
SignCount: uint32(authenticatorMap["SignCount"].(float64)),
CloneWarning: authenticatorMap["CloneWarning"].(bool),
Attachment: protocol.AuthenticatorAttachment(authenticatorMap["Attachment"].(string)),
}
cred.Authenticator = authenticator
return
}

View file

@ -0,0 +1,148 @@
package ente
import (
"database/sql/driver"
"encoding/json"
"github.com/ente-io/stacktrace"
)
// CreatePublicAccessTokenRequest payload for creating accessToken for public albums
type CreatePublicAccessTokenRequest struct {
CollectionID int64 `json:"collectionID" binding:"required"`
EnableCollect bool `json:"enableCollect"`
ValidTill int64 `json:"validTill"`
DeviceLimit int `json:"deviceLimit"`
}
type UpdatePublicAccessTokenRequest struct {
CollectionID int64 `json:"collectionID" binding:"required"`
ValidTill *int64 `json:"validTill"`
DeviceLimit *int `json:"deviceLimit"`
PassHash *string `json:"passHash"`
Nonce *string `json:"nonce"`
MemLimit *int64 `json:"memLimit"`
OpsLimit *int64 `json:"opsLimit"`
EnableDownload *bool `json:"enableDownload"`
EnableCollect *bool `json:"enableCollect"`
DisablePassword *bool `json:"disablePassword"`
}
type VerifyPasswordRequest struct {
PassHash string `json:"passHash" binding:"required"`
}
type VerifyPasswordResponse struct {
JWTToken string `json:"jwtToken"`
}
// PublicCollectionToken represents row entity for public_collection_token table
type PublicCollectionToken struct {
ID int64
CollectionID int64
Token string
DeviceLimit int
ValidTill int64
IsDisabled bool
PassHash *string
Nonce *string
MemLimit *int64
OpsLimit *int64
EnableDownload bool
EnableCollect bool
}
// PublicURL represents information about non-disabled public url for a collection
type PublicURL struct {
URL string `json:"url"`
DeviceLimit int `json:"deviceLimit"`
ValidTill int64 `json:"validTill"`
EnableDownload bool `json:"enableDownload"`
// Enable collect indicates whether folks can upload files in a publicly shared url
EnableCollect bool `json:"enableCollect"`
PasswordEnabled bool `json:"passwordEnabled"`
// Nonce contains the nonce value for the password if the link is password protected.
Nonce *string `json:"nonce,omitempty"`
MemLimit *int64 `json:"memLimit,omitempty"`
OpsLimit *int64 `json:"opsLimit,omitempty"`
}
type PublicAccessContext struct {
ID int64
IP string
UserAgent string
CollectionID int64
}
// PublicCollectionSummary represents an information about a public collection
type PublicCollectionSummary struct {
ID int64
CollectionID int64
IsDisabled bool
ValidTill int64
DeviceLimit int
CreatedAt int64
UpdatedAt int64
DeviceAccessCount int
// not empty value of passHash indicates that the link is password protected.
PassHash *string
}
type AbuseReportRequest struct {
URL string `json:"url" binding:"required"`
Reason string `json:"reason" binding:"required"`
Details AbuseReportDetails `json:"details" binding:"required"`
}
type AbuseReportDetails struct {
FullName string `json:"fullName" binding:"required"`
Email string `json:"email" binding:"required"`
Signature string `json:"signature" binding:"required"`
Comment string `json:"comment"`
OnBehalfOf string `json:"onBehalfOf"`
JobTitle string `json:"jobTitle"`
Address *ReporterAddress `json:"address"`
}
type ReporterAddress struct {
Stress string `json:"street" binding:"required"`
City string `json:"city" binding:"required"`
State string `json:"state" binding:"required"`
Country string `json:"country" binding:"required"`
PostalCode string `json:"postalCode" binding:"required"`
Phone string `json:"phone" binding:"required"`
}
// Value implements the driver.Valuer interface. This method
// simply returns the JSON-encoded representation of the struct.
func (ca AbuseReportDetails) Value() (driver.Value, error) {
return json.Marshal(ca)
}
// Scan implements the sql.Scanner interface. This method
// simply decodes a JSON-encoded value into the struct fields.
func (ca *AbuseReportDetails) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return stacktrace.NewError("type assertion to []byte failed")
}
return json.Unmarshal(b, &ca)
}
// Value implements the driver.Valuer interface. This method
// simply returns the JSON-encoded representation of the struct.
func (ca ReporterAddress) Value() (driver.Value, error) {
return json.Marshal(ca)
}
// Scan implements the sql.Scanner interface. This method
// simply decodes a JSON-encoded value into the struct fields.
func (ca *ReporterAddress) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return stacktrace.NewError("type assertion to []byte failed")
}
return json.Unmarshal(b, &ca)
}

34
server/ente/push.go Normal file
View file

@ -0,0 +1,34 @@
package ente
import (
"encoding/json"
"time"
)
// PushTokenRequest represents a push token
type PushTokenRequest struct {
FCMToken string `json:"fcmToken" binding:"required"`
APNSToken string `json:"apnsToken"`
LastNotificationTime int64
}
type PushToken struct {
UserID int64 `json:"userID"`
FCMToken string `json:"fcmToken"`
CreatedAt int64 `json:"createdAt"`
LastNotifiedAt int64 `json:"lastNotifiedAt"`
}
func (pt *PushToken) MarshalJSON() ([]byte, error) {
return json.Marshal(&struct {
UserID int64 `json:"userID"`
TrimmedToken string `json:"trimmedToken"`
CreatedAt string `json:"createdAt"`
LastNotifiedAt string `json:"LastNotifiedAt"`
}{
UserID: pt.UserID,
TrimmedToken: pt.FCMToken[0:9],
CreatedAt: time.Unix(pt.CreatedAt/1000000, 0).String(),
LastNotifiedAt: time.Unix(pt.LastNotifiedAt/1000000, 0).String(),
})
}

View file

@ -0,0 +1,15 @@
package ente
type GetValueRequest struct {
Key string `form:"key" binding:"required"`
DefaultValue *string `form:"defaultValue"`
}
type GetValueResponse struct {
Value string `json:"value" binding:"required"`
}
type UpdateKeyValueRequest struct {
Key string `json:"key" binding:"required"`
Value string `json:"value" binding:"required"`
}

100
server/ente/srp.go Normal file
View file

@ -0,0 +1,100 @@
package ente
import (
"github.com/google/uuid"
)
type SetupSRPRequest struct {
SrpUserID uuid.UUID `json:"srpUserID" binding:"required"`
SRPSalt string `json:"srpSalt" binding:"required"`
SRPVerifier string `json:"srpVerifier" binding:"required"`
SRPA string `json:"srpA" binding:"required"`
}
type SetupSRPResponse struct {
SetupID uuid.UUID `json:"setupID" binding:"required"`
SRPB string `json:"srpB" binding:"required"`
}
type CompleteSRPSetupRequest struct {
SetupID uuid.UUID `json:"setupID" binding:"required"`
SRPM1 string `json:"srpM1" binding:"required"`
}
type CompleteSRPSetupResponse struct {
SetupID uuid.UUID `json:"setupID" binding:"required"`
SRPM2 string `json:"srpM2" binding:"required"`
}
// UpdateSRPAndKeysRequest is used to update the SRP attributes (e.g. when user updates his password) and also
// update the keys attributes
type UpdateSRPAndKeysRequest struct {
SetupID uuid.UUID `json:"setupID" binding:"required"`
SRPM1 string `json:"srpM1" binding:"required"`
UpdateAttributes *UpdateKeysRequest `json:"updatedKeyAttr"`
LogOutOtherDevices *bool `json:"logOutOtherDevices"`
}
type UpdateSRPSetupResponse struct {
SetupID uuid.UUID `json:"setupID" binding:"required"`
SRPM2 string `json:"srpM2" binding:"required"`
}
type GetSRPAttributesRequest struct {
Email string `form:"email" binding:"required"`
}
type GetSRPAttributesResponse struct {
SRPUserID string `json:"srpUserID" binding:"required"`
SRPSalt string `json:"srpSalt" binding:"required"`
// MemLimit,OpsLimit,KekSalt are needed to derive the KeyEncryptionKey
// on the client. Client generates the LoginKey from the KeyEncryptionKey
// and treat that as UserInputPassword.
MemLimit int `json:"memLimit" binding:"required"`
OpsLimit int `json:"opsLimit" binding:"required"`
KekSalt string `json:"kekSalt" binding:"required"`
IsEmailMFAEnabled bool `json:"isEmailMFAEnabled" binding:"required"`
}
type CreateSRPSessionRequest struct {
SRPUserID uuid.UUID `json:"srpUserID" binding:"required"`
SRPA string `json:"srpA" binding:"required"`
}
type CreateSRPSessionResponse struct {
SessionID uuid.UUID `json:"sessionID" binding:"required"`
SRPB string `json:"srpB" binding:"required"`
}
type VerifySRPSessionRequest struct {
SessionID uuid.UUID `json:"sessionID" binding:"required"`
SRPUserID uuid.UUID `json:"srpUserID" binding:"required"`
SRPM1 string `json:"srpM1"`
}
// SRPSessionEntity represents a row in the srp_sessions table
type SRPSessionEntity struct {
ID uuid.UUID
SRPUserID uuid.UUID
UserID int64
ServerKey string
SRP_A string
IsVerified bool
AttemptCount int32
}
type SRPAuthEntity struct {
UserID int64
SRPUserID uuid.UUID
Salt string
Verifier string
}
type SRPSetupEntity struct {
ID uuid.UUID
SessionID uuid.UUID
SRPUserID uuid.UUID
UserID int64
Salt string
Verifier string
}

View file

@ -0,0 +1,39 @@
package storagebonus
import (
"net/http"
"github.com/ente-io/museum/ente"
)
const (
invalid ente.ErrorCode = "INVALID_CODE"
codeApplied ente.ErrorCode = "CODE_ALREADY_APPLIED"
codeExists ente.ErrorCode = "CODE_ALREADY_EXISTS"
accountNotEligible ente.ErrorCode = "ACCOUNT_NOT_ELIGIBLE"
)
// InvalidCodeErr is thrown when user gives a code which either doesn't exist or belong to a now deleted user
var InvalidCodeErr = &ente.ApiError{
Code: invalid,
Message: "Invalid code",
HttpStatusCode: http.StatusNotFound,
}
var CodeAlreadyAppliedErr = &ente.ApiError{
Code: codeApplied,
Message: "User has already applied code",
HttpStatusCode: http.StatusConflict,
}
var CanNotApplyCodeErr = &ente.ApiError{
Code: accountNotEligible,
Message: "User is not eligible to apply referral code",
HttpStatusCode: http.StatusBadRequest,
}
var CodeAlreadyExistsErr = &ente.ApiError{
Code: codeExists,
Message: "This code already exists",
HttpStatusCode: http.StatusBadRequest,
}

View file

@ -0,0 +1,54 @@
package storagebonus
// Tracking represents entity used to track various referral history
type Tracking struct {
// UserID of the user who invited the other person
Invitor int64
// UserID of the user who's invited by invitor
Invitee int64
// CreatedAt time when the user applied the code
CreatedAt int64
PlanType PlanType
}
type UserReferralPlanStat struct {
PlanType PlanType `json:"planType"`
TotalCount int `json:"totalCount"`
UpgradedCount int `json:"upgradedCount"`
}
// PlanInfo represents the referral plan metadata
type PlanInfo struct {
// IsEnabled indicates if the referral plan is enabled for given user
IsEnabled bool `json:"isEnabled"`
// Referral plan type
PlanType PlanType `json:"planType"`
// Storage which can be gained on successfully referral
StorageInGB int64 `json:"storageInGB"`
// Max storage which can be claimed by the user
MaxClaimableStorageInGB int64 `json:"maxClaimableStorageInGB"`
}
type GetStorageBonusDetailResponse struct {
ReferralStats []UserReferralPlanStat `json:"referralStats"`
Bonuses []StorageBonus `json:"bonuses"`
RefCount int `json:"refCount"`
RefUpgradeCount int `json:"refUpgradeCount"`
// Indicates if the user applied code during signup
HasAppliedCode bool `json:"hasAppliedCode"`
}
// GetUserReferralView represents the basic view of the user's referral plan
// This is used to show the user's referral details in the UI
type GetUserReferralView struct {
PlanInfo PlanInfo `json:"planInfo"`
Code *string `json:"code"`
// Indicates if the user can apply the referral code.
EnableApplyCode bool `json:"enableApplyCode"`
HasAppliedCode bool `json:"hasAppliedCode"`
// Indicates claimed referral storage
ClaimedStorage int64 `json:"claimedStorage"`
// Indicates if the user is part of a family and is the admin
IsFamilyMember bool `json:"isFamilyMember"`
}

View file

@ -0,0 +1,46 @@
package storagebonus
import (
"fmt"
)
type PlanType string
const (
// TenGbOnUpgrade plan when both the parties get 10 GB surplus storage.
// The invitee gets 10 GB storage on successful signup
// The invitor gets 10 GB storage only after the invitee upgrades to a paid plan
TenGbOnUpgrade PlanType = "10_GB_ON_UPGRADE"
)
// SignUpInviteeBonus returns the storage which can be gained by the invitee on successful signup with a referral code
func (c PlanType) SignUpInviteeBonus() int64 {
switch c {
case TenGbOnUpgrade:
return 10 * 1024 * 1024 * 1024
default:
panic(fmt.Sprintf("SignUpInviteeBonus value not configured for %s", c))
}
}
// SignUpInvitorBonus returns the storage which can be gained by the invitor when some sign ups using their code
func (c PlanType) SignUpInvitorBonus() int64 {
switch c {
case TenGbOnUpgrade:
return 0
default:
// panic if the plan type is not supported
panic("unsupported plan type")
}
}
// InvitorBonusOnInviteeUpgrade returns the storage which can be gained by the invitor when the invitee upgrades to a paid plan
func (c PlanType) InvitorBonusOnInviteeUpgrade() int64 {
switch c {
case TenGbOnUpgrade:
return 10 * 1024 * 1024 * 1024
default:
// panic if the plan type is not supported
panic("unsupported plan type")
}
}

View file

@ -0,0 +1,129 @@
package storagebonus
type BonusType string
const (
// Referral bonus is gained by inviting others
Referral BonusType = "REFERRAL"
// SignUp for applying code shared by others during sign up
// Note: In the future, for surplus types which should be only applied once, we can add unique constraints
SignUp BonusType = "SIGN_UP"
// AddOnSupport is the bonus for users added by the support team
AddOnSupport = "ADD_ON_SUPPORT"
// AddOnBf2023 is the bonus for users who have opted for the Black Friday 2023 offer
AddOnBf2023 = "ADD_ON_BF_2023"
// In the future, we can add various types of bonuses based on different events like Anniversary,
// or finishing tasks like ML indexing, enabling sharing etc etc
)
// PaidAddOnTypes : These add-ons can be purchased by the users and help in the expiry of an account
// as long as the add-on is active.
var PaidAddOnTypes = []BonusType{AddOnSupport, AddOnBf2023}
// ExtendsExpiry returns true if the bonus type extends the expiry of the account.
// By default, all bonuses don't extend expiry.
func (t BonusType) ExtendsExpiry() bool {
switch t {
case AddOnSupport, AddOnBf2023:
return true
case Referral, SignUp:
return false
default:
return false
}
}
// RestrictToDoublingStorage returns true if the bonus type restricts the doubling of storage.
// This indicates, the usable bonus storage should not exceed the current plan storage.
// Note: Current plan storage includes both base subscription and storage bonus that can ExtendsExpiry
func (t BonusType) RestrictToDoublingStorage() bool {
switch t {
case Referral, SignUp:
return true
case AddOnSupport, AddOnBf2023:
return false
default:
return true
}
}
type RevokeReason string
const (
Fraud RevokeReason = "FRAUD"
// Expired is usually used to take away one time bonus.
Expired RevokeReason = "EXPIRED"
// Discontinued Used when storagebonus is taken away before other user deleted their account
// or stopped subscription or user decides to pause subscription after anniversary gift
Discontinued RevokeReason = "DISCONTINUED"
)
type StorageBonus struct {
UserID int64 `json:"-"`
// Amount of storage bonus added to the account
Storage int64 `json:"storage"`
Type BonusType `json:"type"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"-"`
// ValidTill represents the validity of the storage bonus. If it is 0, it is valid forever.
ValidTill int64 `json:"validTill"`
RevokeReason *RevokeReason `json:"-"`
IsRevoked bool `json:"isRevoked"`
}
type ActiveStorageBonus struct {
StorageBonuses []StorageBonus `json:"storageBonuses"`
}
func (a *ActiveStorageBonus) GetMaxExpiry() int64 {
if a == nil {
return 0
}
maxExpiry := int64(0)
for _, bonus := range a.StorageBonuses {
if bonus.Type.ExtendsExpiry() && bonus.ValidTill > maxExpiry {
maxExpiry = bonus.ValidTill
}
}
return maxExpiry
}
func (a *ActiveStorageBonus) GetReferralBonus() int64 {
if a == nil {
return 0
}
referralBonus := int64(0)
for _, bonus := range a.StorageBonuses {
if bonus.Type.RestrictToDoublingStorage() {
referralBonus += bonus.Storage
}
}
return referralBonus
}
func (a *ActiveStorageBonus) GetAddonStorage() int64 {
if a == nil {
return 0
}
addonStorage := int64(0)
for _, bonus := range a.StorageBonuses {
if !bonus.Type.RestrictToDoublingStorage() {
addonStorage += bonus.Storage
}
}
return addonStorage
}
func (a *ActiveStorageBonus) GetUsableBonus(subStorage int64) int64 {
refBonus := a.GetReferralBonus()
totalSubAndAddOnStorage := a.GetAddonStorage() + subStorage
if refBonus > totalSubAndAddOnStorage {
refBonus = totalSubAndAddOnStorage
}
return a.GetAddonStorage() + refBonus
}
type GetBonusResult struct {
StorageBonuses []StorageBonus
}

47
server/ente/trash.go Normal file
View file

@ -0,0 +1,47 @@
package ente
// Trash indicates a trashed file in the system.
type Trash struct {
File File `json:"file"`
IsDeleted bool `json:"isDeleted"`
IsRestored bool `json:"isRestored"`
DeleteBy int64 `json:"deleteBy"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
}
// DeleteTrashFilesRequest represents a request to delete a trashed files
type DeleteTrashFilesRequest struct {
FileIDs []int64 `json:"fileIDs" binding:"required"`
// OwnerID will be set based on the authenticated user
OwnerID int64
}
// EmptyTrashRequest represents a request to empty items from user's trash
type EmptyTrashRequest struct {
// LastUpdatedAt timestamp will be used to delete trashed files with updatedAt timestamp <= LastUpdatedAt
// User's trash will be cleaned up in an async manner. The timestamp is used to ensure that newly trashed files
// are not deleted due to delay in the async operation.
LastUpdatedAt int64 `json:"lastUpdatedAt" binding:"required"`
}
// TrashCollectionV3Request represents the request for trashing/deleting a collection.
// In V3, while trashing/deleting any album, the user can decide to either keep or delete the all files which are
// present in to the trash. When user wants to keep the files, the clients are expected to move all the files from
// the underlying collection to any other collection owned by the user, inlcuding uncategorized.
// Note: Collection Delete Versions for DELETE /collections/V../ endpoint
// V1: All files which exclusively belong to the collections are deleted immediately.
// V2: All files which exclusively belong to the collections are moved to the trash.
// V3: All files which are still present in the collection (irrespective if they blong to another collection) will be moved to trash.
// V3 is introduced to avoid doing this booking on server, where we only delete a file when it's beling removed from the last collection it longs to.
// In theory above logic to delete when it's being removed from last collection sounds good. But,
// in practice it complicates the code (thus reducing its robustness) because of race conditions, and it's
// also hard to communicate it to the user. So, to simplify things, in V3, the files will be only deleted when user tell us to delete them.
type TrashCollectionV3Request struct {
CollectionID int64 `json:"collectionID" form:"collectionID" binding:"required"`
// When KeepFiles is false, then all the files which are present in the collection will be moved to trash.
// When KeepFiles is true, but the underlying collection still contains file, then the API call will fail.
// This is to ensure that before deleting the collection, the client has moved all relevant files to any other
// collection owned by the user, including Uncategorized.
KeepFiles *bool `json:"keepFiles" form:"keepFiles" binding:"required"`
}

213
server/ente/user.go Normal file
View file

@ -0,0 +1,213 @@
package ente
const (
PhotosOTTTemplate = "ott_photos.html"
AuthOTTTemplate = "ott_auth.html"
ChangeEmailOTTTemplate = "ott_change_email.html"
EmailChangedTemplate = "email_changed.html"
EmailChangedSubject = "Email address updated"
// OTTEmailSubject is the subject of the OTT mail
OTTEmailSubject = "ente Verification Code"
ChangeEmailOTTPurpose = "change"
)
// User represents a user in the system
type User struct {
ID int64
Email string `json:"email"`
Name string `json:"name"`
Hash string `json:"hash"`
CreationTime int64 `json:"creationTime"`
FamilyAdminID *int64 `json:"familyAdminID"`
IsTwoFactorEnabled *bool `json:"isTwoFactorEnabled"`
IsEmailMFAEnabled *bool `json:"isEmailMFAEnabled"`
}
// A request to generate and send a verification code (OTT)
type SendOTTRequest struct {
Email string `json:"email"`
Client string `json:"client"`
Purpose string `json:"purpose"`
}
// EmailVerificationRequest represents an email verification request
type EmailVerificationRequest struct {
Email string `json:"email"`
OTT string `json:"ott"`
// Indicates where the source form where the user heard about the service
Source *string `json:"source"`
}
type EmailVerificationResponse struct {
ID int64 `json:"id"`
Token string `json:"token"`
KeyAttributes KeyAttributes `json:"keyAttributes"`
Subscription Subscription `json:"subscription"`
}
// EmailAuthorizationResponse represents the response after user has verified his email,
// if two factor enabled just `TwoFactorSessionID` is sent else the keyAttributes and encryptedToken
type EmailAuthorizationResponse struct {
ID int64 `json:"id"`
KeyAttributes *KeyAttributes `json:"keyAttributes,omitempty"`
EncryptedToken string `json:"encryptedToken,omitempty"`
Token string `json:"token,omitempty"`
PasskeySessionID string `json:"passkeySessionID"`
TwoFactorSessionID string `json:"twoFactorSessionID"`
// SrpM2 is sent only if the user is logging via SRP
// SrpM2 is the SRP M2 value aka the proof that the server has the verifier
SrpM2 *string `json:"srpM2,omitempty"`
}
// KeyAttributes stores the key related attributes for a user
type KeyAttributes struct {
KEKSalt string `json:"kekSalt" binding:"required"`
KEKHash string `json:"kekHash"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
KeyDecryptionNonce string `json:"keyDecryptionNonce" binding:"required"`
PublicKey string `json:"publicKey" binding:"required"`
EncryptedSecretKey string `json:"encryptedSecretKey" binding:"required"`
SecretKeyDecryptionNonce string `json:"secretKeyDecryptionNonce" binding:"required"`
MemLimit int `json:"memLimit" binding:"required"`
OpsLimit int `json:"opsLimit" binding:"required"`
MasterKeyEncryptedWithRecoveryKey string `json:"masterKeyEncryptedWithRecoveryKey"`
MasterKeyDecryptionNonce string `json:"masterKeyDecryptionNonce"`
RecoveryKeyEncryptedWithMasterKey string `json:"recoveryKeyEncryptedWithMasterKey"`
RecoveryKeyDecryptionNonce string `json:"recoveryKeyDecryptionNonce"`
}
// SetUserAttributesRequest represents an incoming request to set UA
type SetUserAttributesRequest struct {
KeyAttributes KeyAttributes `json:"keyAttributes" binding:"required"`
}
// UpdateEmailMFA ..
type UpdateEmailMFA struct {
IsEnabled *bool `json:"isEnabled" binding:"required"`
}
// UpdateKeysRequest represents a request to set user keys
type UpdateKeysRequest struct {
KEKSalt string `json:"kekSalt" binding:"required"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
KeyDecryptionNonce string `json:"keyDecryptionNonce" binding:"required"`
MemLimit int `json:"memLimit" binding:"required"`
OpsLimit int `json:"opsLimit" binding:"required"`
}
type SetRecoveryKeyRequest struct {
MasterKeyEncryptedWithRecoveryKey string `json:"masterKeyEncryptedWithRecoveryKey"`
MasterKeyDecryptionNonce string `json:"masterKeyDecryptionNonce"`
RecoveryKeyEncryptedWithMasterKey string `json:"recoveryKeyEncryptedWithMasterKey"`
RecoveryKeyDecryptionNonce string `json:"recoveryKeyDecryptionNonce"`
}
type EventReportRequest struct {
Event string `json:"event"`
}
type EncryptionResult struct {
Cipher []byte
Nonce []byte
}
type DeleteChallengeResponse struct {
// AllowDelete indicates whether the user is allowed to delete their account via app
AllowDelete bool `json:"allowDelete"`
EncryptedChallenge *string `json:"encryptedChallenge,omitempty"`
}
type DeleteAccountRequest struct {
Challenge string `json:"challenge"`
Feedback *string `json:"feedback"`
ReasonCategory *string `json:"reasonCategory"`
Reason *string `json:"reason"`
}
func (r *DeleteAccountRequest) GetReasonAttr() map[string]string {
result := make(map[string]string)
// Note: mobile client is sending reasonCategory, but web/desktop is sending reason
if r.ReasonCategory != nil {
result["reason"] = *r.ReasonCategory
}
if r.Reason != nil {
result["reason"] = *r.Reason
}
if r.Feedback != nil {
result["feedback"] = *r.Feedback
}
return result
}
type DeleteAccountResponse struct {
IsSubscriptionCancelled bool `json:"isSubscriptionCancelled"`
UserID int64 `json:"userID"`
}
// TwoFactorSecret represents the two factor secret generator value, user enters in his authenticator app
type TwoFactorSecret struct {
SecretCode string `json:"secretCode"`
QRCode string `json:"qrCode"`
}
// TwoFactorEnableRequest represent the user request to enable two factor after initial setup
type TwoFactorEnableRequest struct {
Code string `json:"code"`
EncryptedTwoFactorSecret string `json:"encryptedTwoFactorSecret"`
TwoFactorSecretDecryptionNonce string `json:"twoFactorSecretDecryptionNonce"`
}
// TwoFactorVerificationRequest represents a two factor verification request
type TwoFactorVerificationRequest struct {
SessionID string `json:"sessionID" binding:"required"`
Code string `json:"code" binding:"required"`
}
// TwoFactorBeginAuthenticationCeremonyRequest represents the request to begin the passkey authentication ceremony
type PasskeyTwoFactorBeginAuthenticationCeremonyRequest struct {
SessionID string `json:"sessionID" binding:"required"`
}
type PasskeyTwoFactorFinishAuthenticationCeremonyRequest struct {
SessionID string `form:"sessionID" binding:"required"`
CeremonySessionID string `form:"ceremonySessionID" binding:"required"`
}
// TwoFactorAuthorizationResponse represents the response after two factor authentication
type TwoFactorAuthorizationResponse struct {
ID int64 `json:"id"`
KeyAttributes *KeyAttributes `json:"keyAttributes,omitempty"`
EncryptedToken string `json:"encryptedToken,omitempty"`
}
// TwoFactorRecoveryResponse represents the two factor secret encrypted with user's recovery key sent for user to make removal request
type TwoFactorRecoveryResponse struct {
EncryptedSecret string `json:"encryptedSecret"`
SecretDecryptionNonce string `json:"secretDecryptionNonce"`
}
// TwoFactorRemovalRequest represents the the body of two factor removal request consist of decrypted two factor secret and sessionID
type TwoFactorRemovalRequest struct {
Secret string `json:"secret"`
SessionID string `json:"sessionID"`
}
type ProfileData struct {
// CanDisableEmailMFA is used to decide if client should show disable email MFA option
CanDisableEmailMFA bool `json:"canDisableEmailMFA"`
IsEmailMFAEnabled bool `json:"isEmailMFAEnabled"`
IsTwoFactorEnabled bool `json:"isTwoFactorEnabled"`
}
type Session struct {
Token string `json:"token"`
CreationTime int64 `json:"creationTime"`
IP string `json:"ip"`
UA string `json:"ua"`
PrettyUA string `json:"prettyUA"`
LastUsedTime int64 `json:"lastUsedTime"`
}

View file

@ -0,0 +1,66 @@
package userentity
import (
"github.com/google/uuid"
)
type EntityType string
const (
Location EntityType = "location"
)
type EntityKey struct {
UserID int64 `json:"userID" binding:"required"`
Type EntityType `json:"type" binding:"required"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
Header string `json:"header" binding:"required"`
CreatedAt int64 `json:"createdAt" binding:"required"`
}
// EntityData represents a single UserEntity
type EntityData struct {
ID uuid.UUID `json:"id" binding:"required"`
UserID int64 `json:"userID" binding:"required"`
Type EntityType `json:"type" binding:"required"`
EncryptedData *string `json:"encryptedData" binding:"required"`
Header *string `json:"header" binding:"required"`
IsDeleted bool `json:"isDeleted" binding:"required"`
CreatedAt int64 `json:"createdAt" binding:"required"`
UpdatedAt int64 `json:"updatedAt" binding:"required"`
}
// EntityKeyRequest represents a request to create entity data encryption key for a given EntityType
type EntityKeyRequest struct {
Type EntityType `json:"type" binding:"required"`
EncryptedKey string `json:"encryptedKey" binding:"required"`
Header string `json:"header" binding:"required"`
}
// GetEntityKeyRequest represents a request to get entity key for given EntityType
type GetEntityKeyRequest struct {
Type EntityType `form:"type" binding:"required"`
}
// EntityDataRequest is used to create a new entity data of given EntityType
type EntityDataRequest struct {
Type EntityType `json:"type" binding:"required"`
EncryptedData string `json:"encryptedData" binding:"required"`
Header string `json:"header" binding:"required"`
}
// UpdateEntityDataRequest updates the current entity
type UpdateEntityDataRequest struct {
ID uuid.UUID `json:"id" binding:"required"`
Type EntityType `json:"type" binding:"required"`
EncryptedData string `json:"encryptedData" binding:"required"`
Header string `json:"header" binding:"required"`
}
// GetEntityDiffRequest returns the diff of entities since the given time
type GetEntityDiffRequest struct {
Type EntityType `form:"type" binding:"required"`
// SinceTime *int64. Pointer allows us to pass 0 value otherwise binding fails for zero Value.
SinceTime *int64 `form:"sinceTime" binding:"required"`
Limit int16 `form:"limit" binding:"required"`
}

View file

@ -0,0 +1,63 @@
package ente
import (
"bytes"
"encoding/binary"
"encoding/json"
"time"
"github.com/ente-io/museum/pkg/utils/byteMarshaller"
"github.com/go-webauthn/webauthn/protocol"
"github.com/go-webauthn/webauthn/webauthn"
"github.com/google/uuid"
)
// WebAuthnSession is a protocol level session that stores challenges and other metadata during registration and login ceremonies
type WebAuthnSession struct {
ID uuid.UUID
Challenge string
UserID int64
AllowedCredentialIDs string // [][]byte as b64
ExpiresAt int64
UserVerificationRequirement string
Extensions string // map[string]interface{} as json
CreatedAt int64
}
func (w *WebAuthnSession) SessionData() (session *webauthn.SessionData, err error) {
buf := new(bytes.Buffer)
err = binary.Write(buf, binary.BigEndian, w.UserID)
if err != nil {
return
}
allowedCredentialIDs, err := byteMarshaller.DecodeString(w.AllowedCredentialIDs)
if err != nil {
return
}
extensions := map[string]interface{}{}
err = json.Unmarshal([]byte(w.Extensions), &extensions)
if err != nil {
return
}
session = &webauthn.SessionData{
Challenge: w.Challenge,
UserID: buf.Bytes(),
AllowedCredentialIDs: allowedCredentialIDs,
Expires: time.UnixMicro(w.ExpiresAt),
UserVerification: protocol.UserVerificationRequirement(w.UserVerificationRequirement),
Extensions: extensions,
}
return
}

123
server/go.mod Normal file
View file

@ -0,0 +1,123 @@
module github.com/ente-io/museum
go 1.20
require (
firebase.google.com/go v3.13.0+incompatible
github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb
github.com/avct/uasurfer v0.0.0-20191028135549-26b5daa857f1
github.com/awa/go-iap v1.3.16
github.com/aws/aws-sdk-go v1.34.13
github.com/bwmarrin/discordgo v0.25.0
github.com/dlmiddlecote/sqlstats v1.0.2
github.com/ente-io/stacktrace v0.0.0-20210619050357-0af9fad4639c
github.com/gin-contrib/gzip v0.0.5
github.com/gin-contrib/requestid v0.0.2-0.20210619060739-3f23d9a07dc5
github.com/gin-contrib/timeout v0.0.3
github.com/gin-gonic/gin v1.9.1
github.com/go-playground/validator/v10 v10.14.0
github.com/golang-jwt/jwt v3.2.1+incompatible
github.com/golang-migrate/migrate/v4 v4.12.2
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.4.0
github.com/kong/go-srp v0.0.0-20191210190804-cde1efa3c083
github.com/lib/pq v1.8.0
github.com/lithammer/shortuuid/v3 v3.0.4
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pquerna/otp v1.3.0
github.com/prometheus/client_golang v1.11.1
github.com/prometheus/common v0.26.0
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.6.0
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.8.4
github.com/stripe/stripe-go/v72 v72.37.0
github.com/ua-parser/uap-go v0.0.0-20211112212520-00c877edfe0f
github.com/ulule/limiter/v3 v3.8.0
github.com/zsais/go-gin-prometheus v0.1.0
golang.org/x/crypto v0.17.0
golang.org/x/sync v0.1.0
golang.org/x/text v0.14.0
google.golang.org/api v0.114.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)
require (
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/longrunning v0.4.1 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/fxamacker/cbor/v2 v2.5.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/go-webauthn/x v0.1.5 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
github.com/google/go-tpm v0.9.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/time v0.1.0 // indirect
)
require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go/firestore v1.9.0 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/storage v1.28.1 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-webauthn/webauthn v0.9.4
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.3.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

1097
server/go.sum Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,296 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%" cellspacing="0"
cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22" width="100%"
cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content" valign="top" height="100%"
bgcolor="">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Hey!</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">As requested by you, we've deleted your ente account and scheduled your uploaded data for deletion.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">If you accidentally deleted your account, please contact our support immediately to try and recover your uploaded data before the next scheduled deletion happens.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
Thank you for checking out ente, we hope that you will give us another opportunity in the future!
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="flex: 1">
<a href="https://ente.io" style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">About</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/blog">Blog</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="mailto:support@ente.io">Support</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/community">Community</a>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,296 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%" cellspacing="0"
cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22" width="100%"
cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content" valign="top" height="100%"
bgcolor="">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Hey!</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">As requested by you, we've deleted your ente account and scheduled your uploaded data for deletion. If you have an App Store subscription for ente, please remember to cancel it too.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">If you accidentally deleted your account, please contact our support immediately to try and recover your uploaded data before the next scheduled deletion happens.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
Thank you for checking out ente, we hope that you will give us another opportunity in the future!
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="flex: 1">
<a href="https://ente.io" style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">About</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/blog">Blog</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="mailto:support@ente.io">Support</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/community">Community</a>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,235 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {width: 600px;margin: 0 auto;}
table {border-collapse: collapse;}
table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;}
img {-ms-interpolation-mode: bicubic;}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width:480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6" data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table><tr><td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td role="modules-container" style="padding:0px 0px 0px 0px; color:#000000; text-align:left;" width="100%" bgcolor="#FFFFFF" align="left">
<table class="module preheader preheader-hide" role="module" data-type="preheader" style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text" style="table-layout: fixed;" data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3" data-mc-module-version="2019-10-22" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;" role="module-content" valign="top" height="100%" bgcolor="">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Hey,</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">This is to alert you that your email address has been updated to {{.NewEmail}}.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Please respond if you need any assistance.</span>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">-
team@ente.io</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,301 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: verdana, geneva, sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
padding: 12px;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
padding: 12px;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; color:#000000; background-color:#F3F3F3;">
<div class="webkit">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F3F3F3">
<tr>
<td valign="top" bgcolor="#F3F3F3" width="100%">
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0"
cellspacing="0" border="0">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<!--[if mso]>
<table>
<tr>
<td width="600">
<![endif]-->
<table width="100%" cellpadding="0" cellspacing="0" border="0"
style="width:100%; max-width:600px;" align="center">
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
bgcolor="#F3F3F3" width="100%" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader" border="0" cellpadding="0"
cellspacing="0" width="100%"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</table>
<table class="wrapper" role="module" data-type="image"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="abdf35aa-f410-4f26-b2da-f5ccdd1013ce">
<tbody>
<tr>
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;"
valign="top" align="center">
<img class="max-width" border="0"
style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px;"
width="100" height="100"
alt="Invite accepted"
data-proportionally-constrained="true"
data-responsive="false"
src="cid:header-image">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="54957e21-59e7-463f-aacc-04935cf07867"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:40px 0px 10px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
Hey!<br /><br />
{{.MemberEmailID}} has joined your family on
<b>ente</b>!<br />
<br />
Your storage space will now be shared with
them.<br /> <br />
Please check the <b>ente</b> app to manage
your
family.<br /> <br />
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="spacer"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c07d4662-5bb6-432d-9752-6f806d586662">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;"
role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c6842788-6953-4550-8fa2-2442f3350e82"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
<div>
<div
style="font-family: inherit; text-align: center">
<span
style="font-family: verdana, geneva, sans-serif; font-size: 14px; line-height: 14px; color: #7a7a7a">If
you need support, please respond
to this mail</span>
</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,385 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: verdana, geneva, sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
padding: 12px;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
padding: 12px;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:arial,helvetica,sans-serif; color:#000000; background-color:#F3F3F3;">
<div class="webkit">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F3F3F3">
<tr>
<td valign="top" bgcolor="#F3F3F3" width="100%">
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0"
cellspacing="0" border="0">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table width="100%" cellpadding="0" cellspacing="0" border="0"
style="width:100%; max-width:600px;" align="center">
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
bgcolor="#F3F3F3" width="100%" align="left">
<table class="wrapper" role="module" data-type="image"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="abdf35aa-f410-4f26-b2da-f5ccdd1013ce">
<tbody>
<tr>
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;"
valign="top" align="center">
<img class="max-width" border="0"
style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px;"
width="100" height="100"
alt="Invite to join family"
data-proportionally-constrained="true"
data-responsive="false"
src="cid:header-image">
</td>
</tr>
</tbody>
</table>
<table class="module preheader preheader-hide" role="module"
data-type="preheader" border="0" cellpadding="0"
cellspacing="0" width="100%"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="54957e21-59e7-463f-aacc-04935cf07867"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:40px 0px 10px 0px; line-height:22px; font-family: verdana, geneva, sans-serif; color: #252525;"
height="100%" valign="top" bgcolor=""
role="module-content">
<span
style="white-space: pre-wrap; font-family: verdana, geneva, sans-serif; color: #252525;"></span>
Hey!<br /><br />{{.AdminEmailID}} has
invited
you to be a part of their family on
<b>ente!</b><br /> <br />Please
click the button below to upgrade your
storage
space.
<br /> <br />
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0"
class="module" data-role="module-button"
data-type="button" role="module"
style="table-layout:fixed;" width="100%"
data-muid="d516902a-3db3-4962-91a7-7cff38aa188b">
<tbody>
<tr>
<td align="center" bgcolor="" class="outer-td"
style="padding:0px 0px 0px 0px;">
<table border="0" cellpadding="0"
cellspacing="0" class="wrapper-mobile"
style="text-align:center;">
<tbody>
<tr>
<td align="center"
bgcolor="#37C066"
class="inner-td"
style="border-radius:6px; font-size:16px; text-align:center; background-color:inherit;">
<a href="{{.FamilyInviteLink}}"
style="background-color:#37C066; border:0px solid #333333; border-color:#333333; border-radius:6px; border-width:0px; color:#ffffff; display:inline-block; font-size:18px; font-weight:bold; line-height:normal; padding:12px 40px 12px 40px; text-align:center; text-decoration:none; border-style:solid; font-family:verdana,geneva,sans-serif;"
target="_blank">Accept
Invite</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed; margin-top: 24px;"
data-muid="0923e69a-c776-488d-a47c-485e33ae9bb7"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:0px 0px 18px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
<div>
<div style="font-family: inherit;">
<span
style=" font-family: verdana, geneva, sans-serif; color: #252525;">If
the button is not clickable,
please paste the following link
into your browser</span>
</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0"
class="module" data-role="module-button"
data-type="button" role="module"
style="table-layout:fixed;" width="100%"
data-muid="6f4f8ce8-9d24-4ce9-8ada-43892974bb49">
<tbody>
<tr>
<td align="center" bgcolor="" class="outer-td"
style="padding:0px 0px 0px 0px;">
<table border="0" cellpadding="0"
cellspacing="0" class="wrapper-mobile"
style="text-align:center;">
<tbody>
<tr>
<td align="center"
bgcolor="#DEDEDE"
class="inner-td"
style="border-radius:6px; font-size:16px; text-align:center; background-color:inherit;">
<div style="background-color:#DEDEDE; border:0px solid #333333; border-color:#333333; border-radius:6px; border-width:0px; color:#37C066; display:inline-block; font-weight:normal; letter-spacing:1px; line-height:normal; padding:12px 18px 12px 18px; text-align:center; text-decoration:none; border-style:solid; font-size:14px; font-family:courier, monospace;"
target="_blank">
{{.FamilyInviteLink}}
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="spacer"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c07d4662-5bb6-432d-9752-6f806d586662">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;"
role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c6842788-6953-4550-8fa2-2442f3350e82"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
<div>
<div
style="font-family: inherit; text-align: center">
<span
style="font-family: verdana, geneva, sans-serif; font-size: 14px; line-height: 14px; color: #7a7a7a">If
you need support, please respond
to this mail</span>
</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,302 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: verdana, geneva, sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
padding: 12px;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
padding: 12px;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; color:#000000; background-color:#F3F3F3;">
<div class="webkit">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F3F3F3">
<tr>
<td valign="top" bgcolor="#F3F3F3" width="100%">
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0"
cellspacing="0" border="0">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<!--[if mso]>
<table>
<tr>
<td width="600">
<![endif]-->
<table width="100%" cellpadding="0" cellspacing="0" border="0"
style="width:100%; max-width:600px;" align="center">
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
bgcolor="#F3F3F3" width="100%" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader" border="0" cellpadding="0"
cellspacing="0" width="100%"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</table>
<table class="wrapper" role="module" data-type="image"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="abdf35aa-f410-4f26-b2da-f5ccdd1013ce">
<tbody>
<tr>
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;"
valign="top" align="center">
<img class="max-width" border="0"
style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px;"
width="100" height="100"
alt="Invite to join family"
data-proportionally-constrained="true"
data-responsive="false"
src="cid:header-image">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="54957e21-59e7-463f-aacc-04935cf07867"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:40px 0px 10px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
Hey!<br /><br />
{{.MemberEmailID}} has left your family on
<b>ente</b>!<br />
<br />
Your storage space will no longer be shared
with them.
<br /> <br />
Please check the <b>ente</b> app to manage
your
family.
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="spacer"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c07d4662-5bb6-432d-9752-6f806d586662">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;"
role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c6842788-6953-4550-8fa2-2442f3350e82"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
<div>
<div
style="font-family: inherit; text-align: center">
<span
style="font-family: verdana, geneva, sans-serif; font-size: 14px; line-height: 14px; color: #7a7a7a">If
you need support, please respond
to this mail</span>
</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,300 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: verdana, geneva, sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
padding: 12px;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
padding: 12px;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:arial,helvetica,sans-serif; color:#000000; background-color:#F3F3F3;">
<div class="webkit">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F3F3F3">
<tr>
<td valign="top" bgcolor="#F3F3F3" width="100%">
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0"
cellspacing="0" border="0">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<!--[if mso]>
<table>
<tr>
<td width="600">
<![endif]-->
<table width="100%" cellpadding="0" cellspacing="0" border="0"
style="width:100%; max-width:600px;" align="center">
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
bgcolor="#F3F3F3" width="100%" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader" border="0" cellpadding="0"
cellspacing="0" width="100%"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</table>
<table class="wrapper" role="module" data-type="image"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="abdf35aa-f410-4f26-b2da-f5ccdd1013ce">
<tbody>
<tr>
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;"
valign="top" align="center">
<img class="max-width" border="0"
style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px;"
width="100" height="100"
alt="Invite to join family"
data-proportionally-constrained="true"
data-responsive="false"
src="cid:header-image">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="54957e21-59e7-463f-aacc-04935cf07867"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:40px 0px 10px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
Hey!<br /><br />
You have been removed from
{{.AdminEmailID}}s family on
<b>ente</b>.<br />
<br />
Please upgrade your subscription from the
app to continue using <b>ente</b>.
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="spacer"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c07d4662-5bb6-432d-9752-6f806d586662">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;"
role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
border="0" cellpadding="0" cellspacing="0" width="100%"
style="table-layout: fixed;"
data-muid="c6842788-6953-4550-8fa2-2442f3350e82"
data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
height="100%" valign="top" bgcolor=""
role="module-content">
<div>
<div
style="font-family: inherit; text-align: center">
<span
style="font-family: verdana, geneva, sans-serif; font-size: 14px; line-height: 14px; color: #7a7a7a">If
you need support, please respond
to this mail</span>
</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,299 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%" cellspacing="0"
cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table style="font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Ubuntu, Arial, sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Ubuntu, Arial, sans-serif;" align="left">
<h1 style="margin: 0px; line-height: 140%; text-align: center; word-wrap: break-word; font-weight: normal; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Ubuntu, Arial, sans-serif; font-size: 96px;">
💝
</h1>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22" width="100%"
cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content" valign="top" height="100%"
bgcolor="">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Hey there!</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Someone has added photos to your album.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
Please open your ente app to view them.
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="flex: 1">
<a href="https://ente.io" style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">About</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/blog">Blog</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/community">Community</a>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,347 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%"
cellspacing="0" cellpadding="0" border="0"
align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table
class="module preheader preheader-hide"
role="module" data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module"
data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content"
valign="top" height="100%"
bgcolor="">
<div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Congratulations
on preserving
your first
memory with
ente!</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Did you know that we will be
keeping 3 copies of this memory, at 3 different locations so that they are
as safe as they can be? One of these copies will in fact be preserved in
an underground fallout shelter!</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">While we work our magic,
you can go ahead share your memories with your loved ones.
If they aren't on ente yet,
<a href="https://ente.io/blog/powerful-links/">you can share links</a>.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">That's not all,
if you wish to import more of your photos, we have an awesome
desktop app waiting for you @
<a href="https://ente.io/download/desktop">ente.io/download/desktop</a>.
</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Now as you check out the product,
if there's anything you need help with, just write back and
we'll be there for you!</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">-
team@ente</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="flex: 1">
<a href="https://ente.io" style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">About</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/faq">FAQ</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://twitter.com/enteio">Twitter</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/community">Community</a>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,285 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {width: 600px;margin: 0 auto;}
table {border-collapse: collapse;}
table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;}
img {-ms-interpolation-mode: bicubic;}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: arial, helvetica, sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width:480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:arial,helvetica,sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table><tr><td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%"
cellspacing="0" cellpadding="0" border="0"
align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table
class="module preheader preheader-hide"
role="module" data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module"
data-type="text"
style="table-layout: fixed;"
data-muid="d99f2550-76cb-4ce3-8996-60af64de7b39"
data-mc-module-version="2019-10-22"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content"
valign="top" height="100%"
bgcolor="">
<div>
<div
style="font-family: inherit; text-align: inherit">
Hey,</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
{{.PaymentProvider}}
has informed us that
they were
unable to renew your
ente subscription.
Please update your
payment method
within
{{.PaymentProvider}}
so that your
subscription can be
renewed.</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
If we don't get a
payment confirmation
from
{{.PaymentProvider}}
within the next
30 days, our systems
may remove your
account and all
associated data with
it.</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
If you need support,
please reply to this
email, we're quick
to respond!</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,215 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {width: 600px;margin: 0 auto;}
table {border-collapse: collapse;}
table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;}
img {-ms-interpolation-mode: bicubic;}
</style>
<![endif]-->
<style type="text/css">
body, p, div {
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p { margin: 0; padding: 0; }
table.wrapper {
width:100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width:480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start--><!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6" data-body-style="font-size:14px; font-family:arial,helvetica,sans-serif; color:#000000; background-color:#F3F3F3;">
<div class="webkit">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F3F3F3">
<tr>
<td valign="top" bgcolor="#F3F3F3" width="100%">
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<!--[if mso]>
<center>
<table><tr><td width="600">
<![endif]-->
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; max-width:600px;" align="center">
<tr>
<td role="modules-container" style="padding:0px 0px 0px 0px; color:#000000; text-align:left;" bgcolor="#F3F3F3" width="100%" align="left"><table class="module preheader preheader-hide" role="module" data-type="preheader" border="0" cellpadding="0" cellspacing="0" width="100%" style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</table><table class="module" role="module" data-type="spacer" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="67fb228a-d56f-485b-9a2f-1625892afe34">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;" role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table><table class="wrapper" role="module" data-type="image" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="abdf35aa-f410-4f26-b2da-f5ccdd1013ce">
<tbody>
<tr>
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;" valign="top" align="center">
<img class="max-width" border="0" style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px;" width="100" alt="" data-proportionally-constrained="true" data-responsive="false" src="cid:img-email-verification-header" height="100">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="0923e69a-c776-488d-a47c-485e33ae9bb7" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:40px 0px 18px 0px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content"><div><div style="font-family: inherit; text-align: center"><span style="white-space: pre-wrap; font-family: verdana, geneva, sans-serif; color: #252525;">Paste this code into the app to verify your email address</span></div><div></div></div></td>
</tr>
</tbody>
</table><table border="0" cellpadding="0" cellspacing="0" class="module" data-role="module-button" data-type="button" role="module" style="table-layout:fixed;" width="100%" data-muid="6f4f8ce8-9d24-4ce9-8ada-43892974bb49">
<tbody>
<tr>
<td align="center" bgcolor="" class="outer-td" style="padding:0px 0px 0px 0px;">
<table border="0" cellpadding="0" cellspacing="0" class="wrapper-mobile" style="text-align:center;">
<tbody>
<tr>
<td align="center" bgcolor="#DEDEDE" class="inner-td" style="border-radius:6px; font-size:16px; text-align:center; background-color:inherit;">
<div style="background-color:#DEDEDE; border:0px solid #333333; border-color:#333333; border-radius:6px; border-width:0px; color:purple; display:inline-block; font-weight:normal; letter-spacing:4px; line-height:normal; padding:12px 18px 12px 18px; text-align:center; text-decoration:none; border-style:solid; font-size:24px; font-family:courier, monospace;" target="_blank">{{.VerificationCode}}</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><table class="module" role="module" data-type="spacer" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c07d4662-5bb6-432d-9752-6f806d586662">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;" role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table><table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c6842788-6953-4550-8fa2-2442f3350e82" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content"><div><div style="font-family: inherit; text-align: center"><span style="font-family: verdana, geneva, sans-serif; font-size: 10px; line-height: 14px; color: #7a7a7a">Please respond to this email if you are facing any issues</span></div><div></div></div></td>
</tr>
</tbody>
</table></td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,215 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {width: 600px;margin: 0 auto;}
table {border-collapse: collapse;}
table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;}
img {-ms-interpolation-mode: bicubic;}
</style>
<![endif]-->
<style type="text/css">
body, p, div {
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p { margin: 0; padding: 0; }
table.wrapper {
width:100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width:480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start--><!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6" data-body-style="font-size:14px; font-family:arial,helvetica,sans-serif; color:#000000; background-color:#F3F3F3;">
<div class="webkit">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F3F3F3">
<tr>
<td valign="top" bgcolor="#F3F3F3" width="100%">
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<!--[if mso]>
<center>
<table><tr><td width="600">
<![endif]-->
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; max-width:600px;" align="center">
<tr>
<td role="modules-container" style="padding:0px 0px 0px 0px; color:#000000; text-align:left;" bgcolor="#F3F3F3" width="100%" align="left"><table class="module preheader preheader-hide" role="module" data-type="preheader" border="0" cellpadding="0" cellspacing="0" width="100%" style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</table><table class="module" role="module" data-type="spacer" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="67fb228a-d56f-485b-9a2f-1625892afe34">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;" role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table><table class="wrapper" role="module" data-type="image" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="abdf35aa-f410-4f26-b2da-f5ccdd1013ce">
<tbody>
<tr>
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;" valign="top" align="center">
<img class="max-width" border="0" style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px;" width="100" alt="" data-proportionally-constrained="true" data-responsive="false" src="cid:img-email-verification-header" height="86">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="0923e69a-c776-488d-a47c-485e33ae9bb7" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:40px 0px 18px 0px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content"><div><div style="font-family: inherit; text-align: center"><span style="white-space: pre-wrap; font-family: verdana, geneva, sans-serif; color: #252525;">Enter the following code to update your email address</span></div><div></div></div></td>
</tr>
</tbody>
</table><table border="0" cellpadding="0" cellspacing="0" class="module" data-role="module-button" data-type="button" role="module" style="table-layout:fixed;" width="100%" data-muid="6f4f8ce8-9d24-4ce9-8ada-43892974bb49">
<tbody>
<tr>
<td align="center" bgcolor="" class="outer-td" style="padding:0px 0px 0px 0px;">
<table border="0" cellpadding="0" cellspacing="0" class="wrapper-mobile" style="text-align:center;">
<tbody>
<tr>
<td align="center" bgcolor="#DEDEDE" class="inner-td" style="border-radius:6px; font-size:16px; text-align:center; background-color:inherit;">
<div style="background-color:#DEDEDE; border:0px solid #333333; border-color:#333333; border-radius:6px; border-width:0px; color:#37C066; display:inline-block; font-weight:normal; letter-spacing:4px; line-height:normal; padding:12px 18px 12px 18px; text-align:center; text-decoration:none; border-style:solid; font-size:24px; font-family:courier, monospace;" target="_blank">{{.VerificationCode}}</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><table class="module" role="module" data-type="spacer" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c07d4662-5bb6-432d-9752-6f806d586662">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;" role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table><table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c6842788-6953-4550-8fa2-2442f3350e82" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content"><div><div style="font-family: inherit; text-align: center"><span style="font-family: verdana, geneva, sans-serif; font-size: 10px; line-height: 14px; color: #7a7a7a">Please respond to this email if you are facing any issues</span></div><div></div></div></td>
</tr>
</tbody>
</table></td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,215 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {width: 600px;margin: 0 auto;}
table {border-collapse: collapse;}
table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;}
img {-ms-interpolation-mode: bicubic;}
</style>
<![endif]-->
<style type="text/css">
body, p, div {
font-family: arial,helvetica,sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p { margin: 0; padding: 0; }
table.wrapper {
width:100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width:480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start--><!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6" data-body-style="font-size:14px; font-family:arial,helvetica,sans-serif; color:#000000; background-color:#F3F3F3;">
<div class="webkit">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="wrapper" bgcolor="#F3F3F3">
<tr>
<td valign="top" bgcolor="#F3F3F3" width="100%">
<table width="100%" role="content-container" class="outer" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<!--[if mso]>
<center>
<table><tr><td width="600">
<![endif]-->
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%; max-width:600px;" align="center">
<tr>
<td role="modules-container" style="padding:0px 0px 0px 0px; color:#000000; text-align:left;" bgcolor="#F3F3F3" width="100%" align="left"><table class="module preheader preheader-hide" role="module" data-type="preheader" border="0" cellpadding="0" cellspacing="0" width="100%" style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;">
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</table><table class="module" role="module" data-type="spacer" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="67fb228a-d56f-485b-9a2f-1625892afe34">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;" role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table><table class="wrapper" role="module" data-type="image" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="abdf35aa-f410-4f26-b2da-f5ccdd1013ce">
<tbody>
<tr>
<td style="font-size:6px; line-height:10px; padding:0px 0px 0px 0px;" valign="top" align="center">
<img class="max-width" border="0" style="display:block; color:#000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px;" width="100" alt="" data-proportionally-constrained="true" data-responsive="false" src="cid:img-email-verification-header" height="86">
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="0923e69a-c776-488d-a47c-485e33ae9bb7" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:40px 0px 18px 0px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content"><div><div style="font-family: inherit; text-align: center"><span style="white-space: pre-wrap; font-family: verdana, geneva, sans-serif; color: #252525;">Paste this code into the app to verify your email address</span></div><div></div></div></td>
</tr>
</tbody>
</table><table border="0" cellpadding="0" cellspacing="0" class="module" data-role="module-button" data-type="button" role="module" style="table-layout:fixed;" width="100%" data-muid="6f4f8ce8-9d24-4ce9-8ada-43892974bb49">
<tbody>
<tr>
<td align="center" bgcolor="" class="outer-td" style="padding:0px 0px 0px 0px;">
<table border="0" cellpadding="0" cellspacing="0" class="wrapper-mobile" style="text-align:center;">
<tbody>
<tr>
<td align="center" bgcolor="#DEDEDE" class="inner-td" style="border-radius:6px; font-size:16px; text-align:center; background-color:inherit;">
<div style="background-color:#DEDEDE; border:0px solid #333333; border-color:#333333; border-radius:6px; border-width:0px; color:#37C066; display:inline-block; font-weight:normal; letter-spacing:4px; line-height:normal; padding:12px 18px 12px 18px; text-align:center; text-decoration:none; border-style:solid; font-size:24px; font-family:courier, monospace;" target="_blank">{{.VerificationCode}}</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><table class="module" role="module" data-type="spacer" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c07d4662-5bb6-432d-9752-6f806d586662">
<tbody>
<tr>
<td style="padding:0px 0px 30px 0px;" role="module-content" bgcolor="">
</td>
</tr>
</tbody>
</table><table class="module" role="module" data-type="text" border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed;" data-muid="c6842788-6953-4550-8fa2-2442f3350e82" data-mc-module-version="2019-10-22">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;" height="100%" valign="top" bgcolor="" role="module-content"><div><div style="font-family: inherit; text-align: center"><span style="font-family: verdana, geneva, sans-serif; font-size: 10px; line-height: 14px; color: #7a7a7a">Please respond to this email if you are facing any issues</span></div><div></div></div></td>
</tr>
</tbody>
</table></td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,359 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%"
cellspacing="0" cellpadding="0" border="0"
align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table
class="module preheader preheader-hide"
role="module" data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module"
data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content"
valign="top" height="100%"
bgcolor="">
<div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Hey,</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">This
is to notify
that someone you
shared your
album with
has reported
its contents for
abusing our <a
href="https://ente.io/terms">terms
of
service</a>.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Here
are more details
regarding this
report:
<ul
style="margin-top: 0px;">
<li>Album
Link:
{{.AlbumLink}}
</li>
<li>Reason:
{{.Reason}}
</li>
<li>Comments:
{{.Comments}}
</li>
</ul>
</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">If
there's anything
that you need
help with,
please respond
to this
email.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Thank
you!
</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="display: flex; justify-content: center; align-items: center;">
<div
style="flex: 1">
<a href="https://ente.io"
style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">about</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/blog">blog</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="mailto:support@ente.io">support</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://twitter.com/enteio">twitter</a>
</div>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,353 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%"
cellspacing="0" cellpadding="0" border="0"
align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table
class="module preheader preheader-hide"
role="module" data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module"
data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content"
valign="top" height="100%"
bgcolor="">
<div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Hey,</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">We
have received
too many abuse
reports against
an
album you've
shared over
ente.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">
In an abundance
of caution, we
have temporarily
disabled the
publicly
accessible link
that we were
serving.
</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">In
the meanwhile,
if
you need
support,
please respond
to this
email.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Thank
you!
</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="display: flex; justify-content: center; align-items: center;">
<div
style="flex: 1">
<a href="https://ente.io"
style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">about</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/blog">blog</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="mailto:support@ente.io">support</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://twitter.com/enteio">twitter</a>
</div>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,253 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {width: 600px;margin: 0 auto;}
table {border-collapse: collapse;}
table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;}
img {-ms-interpolation-mode: bicubic;}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width:480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6" data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table><tr><td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td role="modules-container" style="padding:0px 0px 0px 0px; color:#000000; text-align:left;" width="100%" bgcolor="#FFFFFF" align="left">
<table class="module preheader preheader-hide" role="module" data-type="preheader" style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text" style="table-layout: fixed;" data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3" data-mc-module-version="2019-10-22" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;" role="module-content" valign="top" height="100%" bgcolor="">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Hey,</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">This is to let you know that you have used up your storage limit. The files you've uploaded so far will remain accessible, but no new files will be backed up until you upgrade your subscription.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">If you're looking for a safe space to preserve more of your memories, please do upgrade, we would be delighted to serve you!</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">In
case you have
any questions or
feedback, just
write back, we'd
be happy to
help.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">That's
all, we hope you have a memorable day ahead!</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">-
team@ente.io</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,264 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {width: 600px;margin: 0 auto;}
table {border-collapse: collapse;}
table, td {mso-table-lspace: 0pt;mso-table-rspace: 0pt;}
img {-ms-interpolation-mode: bicubic;}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: arial, helvetica, sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width:480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:arial,helvetica,sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table><tr><td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%"
cellspacing="0" cellpadding="0" border="0"
align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table
class="module preheader preheader-hide"
role="module" data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module"
data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content"
valign="top" height="100%"
bgcolor="">
<div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: helvetica, sans-serif">Your subscription to
ente Photos has ended. Thank you for trying out ente.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br></div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: helvetica, sans-serif">If you still have data stored in ente, we encourage you to follow the steps outlined here to export your data: <a href="https://ente.io/faq/migration/out-of-ente">ente.io/faq/migration/out-of-ente</a>.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br></div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: helvetica, sans-serif">If there's anything we could have done better, please let us know by replying to
this email. Your feedback will help us be better by the next time you subscribe!</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br></div>
<div></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,322 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%" cellspacing="0"
cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22" width="100%"
cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content" valign="top" height="100%"
bgcolor="">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Hello!</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">We want to take this opportunity to thank you for subscribing to a paid plan.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
In case you did not know, you can share links to your albums with your loved ones who aren't on ente. You can even let them add photos via these links. All this, end-to-end encrypted, in original quality.
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
You can also use our family plans to share your storage with them, at no extra cost.
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
If at any point you need support, or have feedback to share, please do write to us. We want ente to work well for you.
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
Here's to a beautiful journey together 🥂
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
- team@ente
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="flex: 1">
<a href="https://ente.io" style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">About</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/blog">Blog</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/community">Community</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://shop.ente.io">Shop</a>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,298 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%" cellspacing="0"
cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table class="module preheader preheader-hide" role="module"
data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module" data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22" width="100%"
cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content" valign="top" height="100%"
bgcolor="">
<div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">Congratulations!</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">One of the customers you referred has upgraded to a paid plan, and as a thank you, we have credited 10 GB to your account.</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
Thank you for spreading the word!
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">
- team@ente
</span>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div></div>
<hr>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="flex: 1">
<a href="https://ente.io" style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">About</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/faq">FAQ</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://twitter.com/enteio">Twitter</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/community">Community</a>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,463 @@
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!--<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
body {
width: 600px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
table, td {
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
-ms-interpolation-mode: bicubic;
}
</style>
<![endif]-->
<style type="text/css">
body,
p,
div {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
body {
color: #000000;
}
body a {
color: #1188E6;
text-decoration: none;
}
p {
margin: 0;
padding: 0;
}
table.wrapper {
width: 100% !important;
table-layout: fixed;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
img.max-width {
max-width: 100% !important;
}
.column.of-2 {
width: 50%;
}
.column.of-3 {
width: 33.333%;
}
.column.of-4 {
width: 25%;
}
ul ul ul ul {
list-style-type: disc !important;
}
ol ol {
list-style-type: lower-roman !important;
}
ol ol ol {
list-style-type: lower-latin !important;
}
ol ol ol ol {
list-style-type: decimal !important;
}
@media screen and (max-width: 480px) {
.preheader .rightColumnContent,
.footer .rightColumnContent {
text-align: left !important;
}
.preheader .rightColumnContent div,
.preheader .rightColumnContent span,
.footer .rightColumnContent div,
.footer .rightColumnContent span {
text-align: left !important;
}
.preheader .rightColumnContent,
.preheader .leftColumnContent {
font-size: 80% !important;
padding: 5px 0;
}
table.wrapper-mobile {
width: 100% !important;
table-layout: fixed;
}
img.max-width {
height: auto !important;
max-width: 100% !important;
}
a.bulletproof-button {
display: block !important;
width: auto !important;
font-size: 80%;
padding-left: 0 !important;
padding-right: 0 !important;
}
.columns {
width: 100% !important;
}
.column {
display: block !important;
width: 100% !important;
padding-left: 0 !important;
padding-right: 0 !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.social-icon-column {
display: inline-block !important;
}
}
</style>
<!--user entered Head Start-->
<!--End Head user entered-->
</head>
<body>
<center class="wrapper" data-link-color="#1188E6"
data-body-style="font-size:14px; font-family:'Open Sans', sans-serif; color:#000000; background-color:#FFFFFF;">
<div class="webkit">
<table class="wrapper" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="100%" valign="top" bgcolor="#FFFFFF">
<table role="content-container" class="outer" width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
<tbody>
<tr>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<!--[if mso]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<table style="width:100%; max-width:600px;" width="100%"
cellspacing="0" cellpadding="0" border="0"
align="center">
<tbody>
<tr>
<td role="modules-container"
style="padding:0px 0px 0px 0px; color:#000000; text-align:left;"
width="100%" bgcolor="#FFFFFF" align="left">
<table
class="module preheader preheader-hide"
role="module" data-type="preheader"
style="display: none !important; mso-hide: all; visibility: hidden; opacity: 0; color: transparent; height: 0; width: 0;"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td role="module-content">
<p></p>
</td>
</tr>
</tbody>
</table>
<table class="module" role="module"
data-type="text"
style="table-layout: fixed;"
data-muid="4d38f79c-f345-49d5-81f6-a0feac657ac3"
data-mc-module-version="2019-10-22"
width="100%" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding:18px 0px 18px 0px; line-height:22px; text-align:inherit;"
role="module-content"
valign="top" height="100%"
bgcolor="">
<div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Congratulations
on preserving
your first
memory with
ente!</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Did you know that we will be
keeping 3 copies of this memory, at 3 different locations so that they are
as safe as they can be? One of these copies will in fact be preserved in
an underground fallout shelter!</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">While we work our magic,
you can go ahead share your memories with your loved ones.
If they aren't on ente yet,
<a href="https://ente.io/blog/powerful-links/">you can share links</a>.</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span style="font-family: 'Open Sans', sans-serif">That's not all,
we have beautiful mobile apps (linked below) that backup
the photos you capture, automatically in the background.
</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">Now as you check out the product,
if there's anything you need help with, just write back and
we'll be there for you!</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div
style="font-family: inherit; text-align: inherit">
<span
style="font-family: 'Open Sans', sans-serif">-
team@ente</span>
</div>
<div
style="font-family: inherit; text-align: inherit">
<br>
</div>
<div class="u-row-container" style="padding: 0px;background-color: transparent">
<div class="u-row"
style="Margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding: 0px;background-color: transparent;" align="center">
<table cellpadding="0" cellspacing="0" border="0" style="width:500px;">
<tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]>
<td align="center" width="250"
style="width: 250px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;"
valign="top"><![endif]-->
<div class="u-col u-col-50"
style="max-width: 320px;min-width: 250px;display: table-cell;vertical-align: top;">
<div style="width: 100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div
style="padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation"
cellpadding="0"
cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td class="v-container-padding-padding"
style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;"
align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;"
align="center">
<a href="https://play.google.com/store/apps/details?id=io.ente.photos"
target="_blank">
<img align="center" border="0"
src="https://ente.io/email/images/playstore.png"
alt="Download on PlayStore"
title="Download on PlayStore"
style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 100%;max-width: 230px;"
width="230"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div>
<!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]>
<td align="center" width="250"
style="width: 250px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;"
valign="top"><![endif]-->
<div class="u-col u-col-50"
style="max-width: 320px;min-width: 250px;display: table-cell;vertical-align: top;">
<div style="width: 100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div
style="padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
<!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation"
cellpadding="0"
cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td class="v-container-padding-padding"
style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;"
align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;"
align="center">
<a href="https://apps.apple.com/app/id1542026904"
target="_blank">
<img align="center" border="0"
src="https://ente.io/email/images/appstore.png"
alt="Download on AppStore"
title="Download on AppStore"
style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 100%;max-width: 230px;"
width="230"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!-->
</div>
<!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<hr>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="flex: 1">
<a href="https://ente.io" style="color: black; font-size: 18px; font-weight: bold;">
ente
</a>
</div>
<div>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/about">About</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/faq">FAQ</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://twitter.com/enteio">Twitter</a>
<a style="color: grey; font-size: 14px; margin-left: 12px;"
href="https://ente.io/community">Community</a>
</div>
</div>
<div style="font-family: inherit; text-align: inherit">
<br>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if mso]>
</td>
</tr>
</table>
</center>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</center>
</body>
</html>

View file

@ -0,0 +1,6 @@
ALTER TABLE temp_objects
DROP COLUMN is_multipart,
DROP COLUMN upload_id;
ALTER TABLE temp_objects
RENAME TO temp_object_keys;

View file

@ -0,0 +1,13 @@
ALTER TABLE temp_object_keys
RENAME TO temp_objects;
ALTER TABLE temp_objects
ADD COLUMN is_multipart BOOLEAN,
ADD COLUMN upload_id TEXT;
UPDATE temp_objects SET is_multipart ='f';
ALTER TABLE temp_objects
ALTER COLUMN is_multipart SET NOT NULL,
ALTER COLUMN is_multipart SET DEFAULT FALSE;

View file

@ -0,0 +1 @@
ALTER TABLE key_attributes ALTER COLUMN kek_hash_bytes SET NOT NULL;

View file

@ -0,0 +1 @@
ALTER TABLE key_attributes ALTER COLUMN kek_hash_bytes DROP NOT NULL;

View file

@ -0,0 +1,3 @@
ALTER TABLE key_attributes DROP COLUMN mem_limit;
ALTER TABLE key_attributes DROP COLUMN ops_limit;

View file

@ -0,0 +1,7 @@
ALTER TABLE key_attributes ADD COLUMN mem_limit INTEGER DEFAULT 67108864;
UPDATE key_attributes SET mem_limit = 67108864; -- crypto_pwhash_MEMLIMIT_INTERACTIVE
ALTER TABLE key_attributes ADD COLUMN ops_limit INTEGER DEFAULT 2;
UPDATE key_attributes SET ops_limit = 2; -- crypto_pwhash_OPSLIMIT_INTERACTIVE

View file

@ -0,0 +1,5 @@
ALTER TABLE key_attributes
DROP COLUMN master_key_encrypted_with_recovery_key,
DROP COLUMN master_key_decryption_nonce,
DROP COLUMN recovery_key_encrypted_with_master_key,
DROP COLUMN recovery_key_decryption_nonce;

View file

@ -0,0 +1,5 @@
ALTER TABLE key_attributes
ADD COLUMN master_key_encrypted_with_recovery_key TEXT,
ADD COLUMN master_key_decryption_nonce TEXT,
ADD COLUMN recovery_key_encrypted_with_master_key TEXT,
ADD COLUMN recovery_key_decryption_nonce TEXT;

View file

@ -0,0 +1,3 @@
ALTER TABLE tokens
DROP COLUMN ip,
DROP COLUMN user_agent;

View file

@ -0,0 +1,3 @@
ALTER TABLE tokens
ADD COLUMN ip TEXT,
ADD COLUMN user_agent TEXT;

View file

@ -0,0 +1,5 @@
ALTER TABLE subscriptions
DROP COLUMN attributes,
DROP CONSTRAINT subscription_user_id_unique_constraint_index,
ALTER COLUMN latest_verification_data SET NOT NULL;

View file

@ -0,0 +1,13 @@
ALTER TABLE subscriptions
ADD CONSTRAINT subscription_user_id_unique_constraint_index UNIQUE (user_id),
ADD COLUMN attributes JSONB;
UPDATE subscriptions
SET attributes =
CAST('{"latest_verification_data":"' || latest_verification_data ||'"}'
AS json);
ALTER TABLE subscriptions
ALTER COLUMN attributes SET NOT NULL,
ALTER COLUMN latest_verification_data DROP NOT NULL;

View file

@ -0,0 +1 @@
-- Just for sanity

View file

@ -0,0 +1,11 @@
DELETE FROM file_object_keys
WHERE file_id NOT IN (
SELECT DISTINCT file_id FROM collection_files
WHERE is_deleted=false
);
DELETE FROM thumbnail_object_keys
WHERE file_id NOT IN (
SELECT DISTINCT file_id FROM collection_files
WHERE is_deleted=false
);

View file

@ -0,0 +1 @@
DROP TABLE notification_history;

View file

@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS notification_history (
user_id INTEGER NOT NULL,
template_id TEXT NOT NULL,
sent_time BIGINT NOT NULL,
CONSTRAINT fk_notification_history_user_id
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);

View file

@ -0,0 +1,5 @@
ALTER TABLE file_object_keys
ALTER COLUMN size TYPE INTEGER;
ALTER TABLE thumbnail_object_keys
ALTER COLUMN size TYPE INTEGER;

View file

@ -0,0 +1,5 @@
ALTER TABLE file_object_keys
ALTER COLUMN size TYPE BIGINT;
ALTER TABLE thumbnail_object_keys
ALTER COLUMN size TYPE BIGINT;

View file

@ -0,0 +1,14 @@
ALTER TABLE users
DROP COLUMN encrypted_email,
DROP COLUMN email_decryption_nonce,
DROP COLUMN email_hash;
DROP INDEX users_email_hash_index;
ALTER TABLE users ALTER COLUMN email SET NOT NULL;
ALTER TABLE otts DROP COLUMN email_hash;
ALTER TABLE otts ALTER COLUMN email SET NOT NULL;
DROP INDEX otts_email_hash_index;

View file

@ -0,0 +1,15 @@
ALTER TABLE users
ADD COLUMN encrypted_email BYTEA,
ADD COLUMN email_decryption_nonce BYTEA,
ADD COLUMN email_hash TEXT UNIQUE;
CREATE INDEX IF NOT EXISTS users_email_hash_index ON users(email_hash);
ALTER TABLE users ALTER COLUMN email DROP NOT NULL;
ALTER TABLE otts
ADD COLUMN email_hash TEXT;
ALTER TABLE otts ALTER COLUMN email DROP NOT NULL;
CREATE INDEX IF NOT EXISTS otts_email_hash_index ON otts(email_hash);

View file

@ -0,0 +1,31 @@
DROP TABLE files;
DROP TABLE file_object_keys;
DROP TABLE thumbnail_object_keys;
DROP TABLE temp_object_keys;
DROP TABLE users;
DROP TABLE key_attributes;
DROP TABLE otts;
DROP TABLE tokens;
DROP INDEX users_email_index;
DROP INDEX files_owner_id_index;
DROP INDEX files_updation_time_index;
DROP INDEX tokens_user_id_index;
DROP INDEX collections_owner_id_index;
DROP INDEX collection_shares_to_user_id_index;
DROP INDEX collection_files_collection_id_index;
DROP INDEX collections_favorites_constraint_index;

View file

@ -0,0 +1,155 @@
CREATE TABLE IF NOT EXISTS users (
user_id SERIAL PRIMARY KEY,
email TEXT UNIQUE NOT NULL,
name TEXT,
creation_time BIGINT NOT NULL
);
CREATE TABLE IF NOT EXISTS files (
file_id BIGSERIAL PRIMARY KEY,
owner_id INTEGER NOT NULL,
file_decryption_header TEXT NOT NULL,
thumbnail_decryption_header TEXT NOT NULL,
metadata_decryption_header TEXT NOT NULL,
encrypted_metadata TEXT NOT NULL,
updation_time BIGINT NOT NULL,
CONSTRAINT fk_files_owner_id
FOREIGN KEY(owner_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS file_object_keys (
file_id BIGINT PRIMARY KEY,
object_key TEXT UNIQUE NOT NULL,
size INTEGER NOT NULL,
CONSTRAINT fk_file_object_keys_file_id
FOREIGN KEY(file_id)
REFERENCES files(file_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS thumbnail_object_keys (
file_id BIGINT PRIMARY KEY,
object_key TEXT UNIQUE NOT NULL,
size INTEGER NOT NULL,
CONSTRAINT fk_thumbnail_object_keys_file_id
FOREIGN KEY(file_id)
REFERENCES files(file_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS temp_object_keys (
object_key TEXT PRIMARY KEY NOT NULL,
expiration_time BIGINT NOT NULL
);
CREATE TABLE IF NOT EXISTS otts (
user_id INTEGER NOT NULL,
ott TEXT UNIQUE NOT NULL,
creation_time BIGINT NOT NULL,
expiration_time BIGINT NOT NULL,
CONSTRAINT fk_otts_user_id
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS tokens (
user_id INTEGER NOT NULL,
token TEXT UNIQUE NOT NULL,
creation_time BIGINT NOT NULL,
CONSTRAINT fk_tokens_user_id
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS key_attributes (
user_id INTEGER PRIMARY KEY,
kek_salt TEXT NOT NULL,
kek_hash_bytes BYTEA NOT NULL,
encrypted_key TEXT NOT NULL,
key_decryption_nonce TEXT NOT NULL,
public_key TEXT NOT NULL,
encrypted_secret_key TEXT NOT NULL,
secret_key_decryption_nonce TEXT NOT NULL,
CONSTRAINT fk_key_attributes_user_id
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS collections (
collection_id SERIAL PRIMARY KEY,
owner_id INTEGER NOT NULL,
encrypted_key TEXT NOT NULL,
key_decryption_nonce TEXT NOT NULL,
name TEXT NOT NULL,
type TEXT NOT NULL,
attributes JSONB NOT NULL,
updation_time BIGINT NOT NULL,
is_deleted BOOLEAN DEFAULT FALSE,
CONSTRAINT fk_collections_owner_id
FOREIGN KEY(owner_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS collection_shares (
collection_id INTEGER NOT NULL,
from_user_id INTEGER NOT NULL,
to_user_id INTEGER NOT NULL,
encrypted_key TEXT NOT NULL,
updation_time BIGINT NOT NULL,
is_deleted BOOLEAN DEFAULT FALSE,
UNIQUE(collection_id, from_user_id, to_user_id),
CONSTRAINT fk_collection_shares_collection_id
FOREIGN KEY(collection_id)
REFERENCES collections(collection_id)
ON DELETE CASCADE,
CONSTRAINT fk_collection_shares_from_user_id
FOREIGN KEY(from_user_id)
REFERENCES users(user_id)
ON DELETE CASCADE,
CONSTRAINT fk_collection_shares_to_user_id
FOREIGN KEY(to_user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS collection_files (
file_id BIGINT NOT NULL,
collection_id INTEGER NOT NULL,
encrypted_key TEXT NOT NULL,
key_decryption_nonce TEXT NOT NULL,
is_deleted BOOLEAN DEFAULT FALSE,
updation_time BIGINT NOT NULL,
CONSTRAINT unique_collection_files_cid_fid UNIQUE(collection_id, file_id),
CONSTRAINT fk_collection_files_collection_id
FOREIGN KEY(collection_id)
REFERENCES collections(collection_id)
ON DELETE CASCADE,
CONSTRAINT fk_collection_files_file_id
FOREIGN KEY(file_id)
REFERENCES files(file_id)
ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS users_email_index ON users(email);
CREATE INDEX IF NOT EXISTS files_owner_id_index ON files (owner_id);
CREATE INDEX IF NOT EXISTS files_updation_time_index ON files (updation_time);
CREATE INDEX IF NOT EXISTS otts_user_id_index ON otts (user_id);
CREATE INDEX IF NOT EXISTS tokens_user_id_index ON tokens (user_id);
CREATE INDEX IF NOT EXISTS collections_owner_id_index ON collections (owner_id);
CREATE INDEX IF NOT EXISTS collection_shares_to_user_id_index ON collection_shares (to_user_id);
CREATE INDEX IF NOT EXISTS collection_files_collection_id_index ON collection_files (collection_id);
CREATE UNIQUE INDEX IF NOT EXISTS collections_favorites_constraint_index ON collections (owner_id) WHERE (type = 'favorites');

View file

@ -0,0 +1 @@
-- just from sanity

View file

@ -0,0 +1,19 @@
INSERT INTO usage(user_id,storage_consumed)
SELECT user_id, COALESCE(total_file_size+total_thumbnail_size,0) as storage_consumed FROM
users,
LATERAL (
SELECT SUM(size) AS total_thumbnail_size
FROM thumbnail_object_keys
LEFT JOIN files ON files.file_id = thumbnail_object_keys.file_id
WHERE
owner_id = users.user_id
) query_1,
LATERAL (
SELECT SUM(size) AS total_file_size
FROM file_object_keys
LEFT JOIN files ON files.file_id = file_object_keys.file_id
WHERE
owner_id = users.user_id
) query_2
ON CONFLICT (user_id)
DO UPDATE SET storage_consumed =EXCLUDED.storage_consumed;

View file

@ -0,0 +1,8 @@
ALTER TABLE users DROP COLUMN is_two_factor_enabled;
DROP TABLE two_factor;
DROP TABLE temp_two_factor;
DROP TABLE two_factor_sessions;

View file

@ -0,0 +1,43 @@
ALTER TABLE users ADD COLUMN is_two_factor_enabled boolean;
UPDATE users SET is_two_factor_enabled = 'f';
ALTER TABLE users ALTER COLUMN is_two_factor_enabled SET NOT NULL;
ALTER TABLE users ALTER COLUMN is_two_factor_enabled SET DEFAULT FALSE;
CREATE TABLE IF NOT EXISTS two_factor(
user_id INTEGER NOT NULL UNIQUE,
two_factor_secret_hash TEXT UNIQUE,
encrypted_two_factor_secret BYTEA,
two_factor_secret_decryption_nonce BYTEA,
recovery_encrypted_two_factor_secret TEXT,
recovery_two_factor_secret_decryption_nonce TEXT,
CONSTRAINT fk_two_factor_user_id
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS temp_two_factor(
user_id INTEGER NOT NULL,
two_factor_secret_hash TEXT UNIQUE,
encrypted_two_factor_secret BYTEA,
two_factor_secret_decryption_nonce BYTEA,
creation_time BIGINT NOT NULL,
expiration_time BIGINT NOT NULL,
CONSTRAINT fk_two_factor_user_id
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS two_factor_sessions(
user_id INTEGER NOT NULL,
session_id TEXT UNIQUE NOT NULL,
creation_time BIGINT NOT NULL,
expiration_time BIGINT NOT NULL,
CONSTRAINT fk_sessions_user_id
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);

View file

@ -0,0 +1,2 @@
DROP TRIGGER IF EXISTS update_location_tag_updated_at ON location_tag;
DROP TABLE location_tag;

View file

@ -0,0 +1,38 @@
CREATE OR REPLACE FUNCTION now_utc_micro_seconds() RETURNS BIGINT AS
$$
SELECT CAST(extract(EPOCH from now() at time zone 'utc') * 1000000 as BIGINT) ;
$$ language sql;
-- We can reuse this func to create triggers in other tables.
CREATE OR REPLACE FUNCTION trigger_updated_at_microseconds_column()
RETURNS TRIGGER AS
$$
BEGIN
NEW.updated_at = now_utc_micro_seconds();
RETURN NEW;
END;
$$ language 'plpgsql';
CREATE TABLE IF NOT EXISTS location_tag
(
id uuid PRIMARY KEY NOT NULL,
user_id INTEGER NOT NULL,
provider TEXT NOT NULL DEFAULT 'USER',
is_deleted BOOLEAN NOT NULL DEFAULT FALSE,
created_at bigint NOT NULL DEFAULT now_utc_micro_seconds(),
updated_at bigint NOT NULL DEFAULT now_utc_micro_seconds(),
encrypted_key TEXT NOT NULL,
key_decryption_nonce TEXT NOT NULL,
attributes JSONB NOT NULL,
CONSTRAINT fk_location_tag_user_id
FOREIGN KEY (user_id)
REFERENCES users (user_id)
ON DELETE CASCADE
);
CREATE TRIGGER update_location_tag_updated_at
BEFORE UPDATE
ON location_tag
FOR EACH ROW
EXECUTE PROCEDURE
trigger_updated_at_microseconds_column();

Some files were not shown because too many files have changed in this diff Show more