What you are looking for, is a copyleft license. It simply means that source code of modifications to a copyleft licensed software by a licensee, must be made available to users and recipients of the software.
There are various copyleft licenses including GPL, AGPL, LGPL, EPL2 and MPL2. Some of these are strong copyleft licenses and some are weak copyleft licenses.
Since it's a web application, both your points are addressed by AGPL, the strongest copyleft license that I am aware of.
With AGPL, even web users of your web application (or modified versions of it by licensees) are entitled to receive the source code, based on the conditions of the AGPL. Modified versions of the source code cannot be closed, for as long as they are either distributed or hosted on a server.
Also, please read the GNU AGPL Wikipedia page.
"Why the Affero GPL" explains it:
The GNU Affero General Public License is a modified version of the
ordinary GNU GPL version 3. It has one added requirement: if you run a
modified program on a server and let other users communicate with it
there, your server must also allow them to download the source code
corresponding to the modified version running there.
The purpose of the GNU Affero GPL is to prevent a problem that affects
developers of free programs that are often used on servers.
Suppose you develop and release a free program under the ordinary GNU
GPL. If developer D modifies the program and releases it, the GPL
requires him to distribute his version under the GPL too. Thus, if you
get a copy of his version, you are free to incorporate some or all of
his changes into your own version.
But suppose the program is mainly useful on servers. When D modifies
the program, he might very likely run it on his own server and never
release copies. Then you would never get a copy of the source code of
his version, so you would never have the chance to include his changes
in your version. You may not like that outcome.
Using the GNU Affero GPL avoids that outcome. If D runs his version on
a server that everyone can use, you too can use it. Assuming he has
followed the license requirement to let the server's users download
the source code of his version, you can do so, and then you can
incorporate his changes into your version. (If he hasn't followed it,
you have your lawyer complain to him.)