Skip to content

Commit

Permalink
Update Privacy Policy + Legal Tweaks (#790) (Fixes #789)
Browse files Browse the repository at this point in the history
* Update the privacy policy and add documentation on how to do so. (Fixes #789)

* Add anchor underlining, and ids for headers on both privacy and terms.
  • Loading branch information
MelissaAutumn authored Dec 11, 2024
1 parent b09e318 commit e660fb2
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 68 deletions.
4 changes: 2 additions & 2 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ REDIS_USE_CLUSTER
# In minutes, the time a cached remote event will expire at.
REDIS_EVENT_EXPIRE_TIME=15

TBA_PRIVACY_POLICY_URL=
TBA_TERMS_OF_USE_URL=
TBA_PRIVACY_POLICY_LOCATION=../legal/services-privacy-policy.md
TBA_TERMS_OF_USE_LOCATION=https://raw.githubusercontent.com/mozilla/legal-docs/main/{locale}/websites_tou.md

POSTHOG_HOST=https://us.i.posthog.com
POSTHOG_PROJECT_KEY=
Expand Down
21 changes: 16 additions & 5 deletions backend/src/appointment/commands/download_legal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,44 @@
import markdown


def open_or_get(path: str):
if path.startswith('http'):
return requests.get(path).text

# Otherwise it's a path
with open(path, 'r') as fh:
return fh.read()


def run():
"""Helper function to update privacy and terms.
Please check to ensure you're not getting a 404 before committing lol.
"""
print('Downloading the latest legal documents...')

extensions = ['markdown.extensions.attr_list']
# Attr_List: In-case remote markdown has attributes
# TOC: For ids on headers
extensions = ['markdown.extensions.attr_list', 'markdown.extensions.toc']
# Only english for now. There's no german TB privacy policy?
locales = ['en']

for locale in locales:
privacy_policy = os.getenv('TBA_PRIVACY_POLICY_URL').format(locale=locale)
terms_of_use = os.getenv('TBA_TERMS_OF_USE_URL').format(locale=locale)
privacy_policy = os.getenv('TBA_PRIVACY_POLICY_LOCATION').format(locale=locale)
terms_of_use = os.getenv('TBA_TERMS_OF_USE_LOCATION').format(locale=locale)

os.makedirs(f'{os.path.dirname(__file__)}/../tmp/legal/{locale}', exist_ok=True)

if privacy_policy:
print('Privacy policy url found.')
contents = requests.get(privacy_policy).text
contents = open_or_get(privacy_policy)
html = markupsafe.Markup(markdown.markdown(contents, extensions=extensions))

with open(f'{os.path.dirname(__file__)}/../tmp/legal/{locale}/privacy.html', 'w') as fh:
fh.write(html)

if terms_of_use:
print('Terms of use url found.')
contents = requests.get(terms_of_use).text
contents = open_or_get(terms_of_use)
html = markupsafe.Markup(markdown.markdown(contents, extensions=extensions))

with open(f'{os.path.dirname(__file__)}/../tmp/legal/{locale}/terms.html', 'w') as fh:
Expand Down
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This place holds all additional technical documentation for Thunderbird Appointment.

## Documents
* [Updating Legal](./updating-legal.rst)

## API endpoints

After starting the backend container, you can find the API documentation here: <http://localhost:8090/docs>
Expand Down
33 changes: 33 additions & 0 deletions docs/updating-legal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--------------
Updating Legal
--------------

Legal documents are not hand-built but transformed from markdown to html via a backend command. Originally this was to automatically grab the latest privacy policy and terms of service documents from Mozilla's legal repository.

Requirements
------------

* Ensure you have both ``TBA_PRIVACY_POLICY_LOCATION`` and ``TBA_TERMS_OF_USE_LOCATION`` set in your .env or system environment.
* Ensure you have the backend setup as per the backend's readme file.

Updating Local Legal Markdown
-----------------------------

If you're tasked with updating a legal document that's not on a remote server you'll need to download the Google Document as a markdown file and place it in `appointment/legal`. If the file is not already hooked up with one of the two env variables above please do so.


Downloading And Rendering The Latest Documents
----------------------------------------------

Run the following command from the backend folder:

.. code-block:: shell
run-command main download-legal
This will download / render the markdown files to html and place them in ``appointment/backend/tmp/legal/en/*.html``.

Updating The Frontend Legal Html Files
--------------------------------------

Once you've downloaded and rendered the markdown files to html you can copy the files directly to the frontend's legal assest folder located in: `appointment/frontend/src/assets/legal/en`.
74 changes: 29 additions & 45 deletions frontend/src/assets/legal/en/privacy.html

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions frontend/src/assets/legal/en/terms.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h1>Websites &amp; Communications Terms of Use</h1>
<h1 id="websites-communications-terms-of-use">Websites &amp; Communications Terms of Use</h1>
<p>June 23, 2016</p>
<h3>Terms of Use</h3>
<h4>1. Introduction</h4>
<h3 id="terms-of-use">Terms of Use</h3>
<h4 id="1-introduction">1. Introduction</h4>
<p>Please read the terms of this entire document  (“Terms”) carefully because it explains your rights and responsibilities when you visit any of Mozilla’s websites (“Websites”), or related feeds, social media, newsletters, source code repositories, and emails (together with Websites, these are collectively referred to as “Communications”). By accessing or signing up to receive Communications, you agree to be bound by these Terms.</p>
<p>Our Websites include multiple domains such as mozilla.org, mozillians.org, firefox.com, mozillafestival.org, openstandard.com, openbadges.org and webmaker.org. You may also recognize our Websites by nicknames such as Bugzilla@Mozilla, BMO, MozWiki, MoPad, MozReps, MDN, Marketplace, One and Done, SUMO, and AMO.
Some of our Websites connect you with links, apps or add-ons that are provided by other parties and are subject to separate Terms.</p>
<h4>2. Account Registration</h4>
<h4 id="2-account-registration">2. Account Registration</h4>
<p>Some Websites require you to register for an account in order to access additional features of a Website or another Mozilla service. If applicable, additional terms will be presented to you. You are responsible for all activities under your account.</p>
<p>Some Websites allow you to create a username during registration. Your use of a username must comply with our <a href="https://www.mozilla.org/about/legal/acceptable-use/">Acceptable Use Policy</a>. </p>
<h4>3. Content Licensing</h4>
<h4 id="3-content-licensing">3. Content Licensing</h4>
<p>Our Communications include content such as articles, images, photographs, comments, software code, audio and video clips, and other materials (collectively, “Content”).  Content is authored by Mozilla, contributors to Mozilla projects, and other sources. </p>
<p>Content authored by Mozilla is generally made available for public sharing and reuse through open licenses such as Creative Commons (for expressive material) or the Mozilla Public License (for software code).  In most cases we ask Mozilla contributors to release Content under open licenses. </p>
<p>Some Content in our Communications is acquired from sources that prohibit further use of their Content without advance permission.  Where possible, the Content or Website footer will display a notice with the applicable license. You agree to abide by such notices.  Note the following specifics:</p>
Expand All @@ -17,7 +17,7 @@ <h4>3. Content Licensing</h4>
<li>Some Content contains trademarks, trade dress, logos and brand assets of Mozilla and other parties (“Trademarks”).  Except for a few limited circumstances, Trademarks cannot be used without advance written permission of the owner of the Trademark.  <a href="https://www.mozilla.org/foundation/trademarks/policy/">Learn more on Mozilla trademarks.</a></li>
<li>Software used by our Websites is licensed under the MPL or similarly permissive open source licenses. For more information on the specific license, please see the applicable source code or GitHub repository. </li>
</ul>
<h4>4. Content Submissions</h4>
<h4 id="4-content-submissions">4. Content Submissions</h4>
<p>You may contribute Content when interacting with our Communications, including but not limited to commenting on an article, blogging, contributing code, or contributing graphics or written material (each a “Submission”). Unless your Submission is made under a separate agreement with Mozilla, in which case that agreement will govern, then</p>
<p>For Submissions to Mozilla's open source projects:</p>
<ul>
Expand All @@ -32,28 +32,28 @@ <h4>4. Content Submissions</h4>
<li>You represent and warrant that you have the rights necessary to grant the rights granted herein, and further, that the uses contemplated under these Terms will not infringe the proprietary or intellectual property rights of any third party.</li>
<li>You understand and agree that Mozilla reserves the right, at its discretion, to review, modify, or remove any Submission that it deems is objectionable or in violation of these Terms.</li>
</ul>
<h4>5. Privacy Policy &amp; Cookies</h4>
<h4 id="5-privacy-policy-cookies">5. Privacy Policy &amp; Cookies</h4>
<p>The <a href="https://www.mozilla.org/privacy/websites/">Mozilla Websites, Communications &amp; Cookies Privacy Notice</a> describes how we handle information that we receive from you in connection with our Communications. The Privacy Notice explains, for example, that we place certain cookies on our Websites and how you can opt-out.</p>
<h4>6. Communications and Events</h4>
<h4 id="6-communications-and-events">6. Communications and Events</h4>
<p>If you subscribe to receive our newsletters or register for an account in connection with any of our Websites, you may receive transactional emails from us in connection with your account (for example, legal, privacy, and security updates).</p>
<p>Some of our Websites have online tools that allow you to send emails to others. For example, you can invite your contacts to events on Mozillians.  You agree not to misuse others’ email addresses (for example, by spamming them). </p>
<p>Other Websites, like MozReps, provide tools that enable users to arrange physical events for anyone to attend. Please exercise caution and good judgment when attending events.</p>
<h4>7. Notice of Claimed Infringement</h4>
<h4 id="7-notice-of-claimed-infringement">7. Notice of Claimed Infringement</h4>
<p>For more information on how to report claims of copyright or trademark infringement, please see: <a href="https://www.mozilla.org/about/legal/report-infringement/">https://www.mozilla.org/about/legal/report-infringement/</a>.</p>
<h4>8. Term; Termination</h4>
<h4 id="8-term-termination">8. Term; Termination</h4>
<p>These Terms will continue to apply until ended by either you or Mozilla. You can choose to end them at any time for any reason by discontinuing your use of our Communications and, if applicable, deleting your account.</p>
<p>We may suspend or terminate your access to our Communications at any time for any reason, including, but not limited to, if we reasonably believe: (i) you have violated these Terms, our Acceptable Use Policy, or other relevant policy; (ii) you create risk or possible legal exposure for us; or (iii) our provision of the Communications to you is no longer commercially viable.</p>
<p>In all such cases, these Terms shall terminate, except that the following sections shall continue to apply: Indemnification, Disclaimer; Limitation of Liability, Miscellaneous.</p>
<h4>9. Indemnification</h4>
<h4 id="9-indemnification">9. Indemnification</h4>
<p>You agree to defend, indemnify and hold harmless Mozilla, its contractors, contributors, licensors, and partners; and the respective directors, officers, employees and agents of the foregoing ("Indemnified Parties") from and against any and all third party claims and expenses, including attorneys' fees, arising out of or related to your use of our Communications (including, but not limited to, from your Submissions or from your violation of any these Terms).</p>
<h4>10. Disclaimer; Limitation of Liability</h4>
<h4 id="10-disclaimer-limitation-of-liability">10. Disclaimer; Limitation of Liability</h4>
<p>THE COMMUNICATIONS ARE PROVIDED "AS IS" WITH ALL FAULTS. TO THE EXTENT PERMITTED BY LAW, MOZILLA AND THE INDEMNIFIED PARTIES HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE COMMUNICATIONS ARE FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, AND NON-INFRINGING. YOU BEAR THE ENTIRE RISK AS TO USING THE COMMUNICATIONS FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE COMMUNICATIONS, INCLUDING WITHOUT LIMITATION THE RISK THAT YOUR HARDWARE, SOFTWARE, OR CONTENT IS DELETED OR CORRUPTED, THAT SOMEONE ELSE GAINS UNAUTHORIZED ACCESS TO YOUR INFORMATION, OR THAT ANOTHER USER MISUSES OR MISAPPROPRIATES YOUR SUBMISSION. THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.</p>
<p>EXCEPT AS REQUIRED BY LAW, MOZILLA AND THE INDEMNIFIED PARTIES WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY RELATING TO THESE TERMS OR THE USE OF OR INABILITY TO USE THE COMMUNICATIONS, INCLUDING WITHOUT LIMITATION DIRECT AND INDIRECT DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE THEORY (CONTRACT, TORT, OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED. THE COLLECTIVE LIABILITY OF MOZILLA AND THE INDEMNIFIED PARTIES UNDER THIS AGREEMENT WILL NOT EXCEED $500 (FIVE HUNDRED DOLLARS). SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL, OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.</p>
<h4>11. Modifications to these Terms</h4>
<h4 id="11-modifications-to-these-terms">11. Modifications to these Terms</h4>
<p>We may update these Terms from time to time to address a new feature of the Communications or to clarify a provision. The updated Terms will be posted online. If the changes are substantive, we will announce the update through our usual channels for such announcements such as blog posts, banners, emails, or forums. Your continued use of our Communications after the effective date of such changes constitutes your acceptance of such changes. To make your review more convenient, we will post an effective date at the top of this page.</p>
<h4>12. Miscellaneous</h4>
<h4 id="12-miscellaneous">12. Miscellaneous</h4>
<p>These Terms constitute the entire agreement between you and Mozilla concerning our Communications and supersede any prior versions of these Terms. The Communications and these Terms are governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions. All claims and disputes arising out of the Communications or these Terms shall be brought exclusively in the courts of Santa Clara County, California, and you consent to personal jurisdiction in those courts. If any portion of these Terms is held to be invalid or unenforceable, the remaining portions will remain in full force and effect. In the event of a conflict between a translated version of these Terms and the English language version, the English language version shall control. In the event of a conflict between these Terms and relevant additional terms, the additional terms shall control.</p>
<h4>13. Contact Us</h4>
<h4 id="13-contact-us">13. Contact Us</h4>
<p>Mozilla <br />
Attn: Mozilla – Legal Notices<br />
149 New Montgomery St.<br />
Expand All @@ -62,4 +62,4 @@ <h4>13. Contact Us</h4>
USA<br />
Telephone: 650-903-0800<br />
Fax: 650-903-0875<br />
Legal-notices at mozilla.com</p>
Legal-notices at mozilla.com</p>
3 changes: 3 additions & 0 deletions frontend/src/views/LegalView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ onMounted(async () => {
p:first-of-type {
@apply font-semibold;
}
a {
@apply underline;
}
}
</style>
Loading

0 comments on commit e660fb2

Please sign in to comment.