diff --git a/seahub/base/context_processors.py b/seahub/base/context_processors.py index 9042416af5f..836f08cc638 100644 --- a/seahub/base/context_processors.py +++ b/seahub/base/context_processors.py @@ -24,7 +24,7 @@ MEDIA_ROOT, SHOW_LOGOUT_ICON, CUSTOM_LOGO_PATH, CUSTOM_FAVICON_PATH, \ ENABLE_SEAFILE_DOCS, LOGIN_BG_IMAGE_PATH, \ CUSTOM_LOGIN_BG_PATH, ENABLE_SHARE_LINK_REPORT_ABUSE, \ - PRIVACY_POLICY_LINK, TERMS_OF_SERVICE_LINK, ENABLE_SEADOC, \ + ENABLE_PRIVACY_POLICY, ENABLE_TERMS_OF_SERVICE, ENABLE_SEADOC, \ ENABLE_SEATABLE_INTEGRATION from seahub.organizations.models import OrgAdminSettings @@ -35,7 +35,7 @@ from seahub.avatar.templatetags.avatar_tags import api_avatar_url -from seahub.utils import HAS_FILE_SEARCH, EVENTS_ENABLED, is_pro_version, ENABLE_REPO_AUTO_DEL, \ +from seahub.utils import EVENTS_ENABLED, is_pro_version, ENABLE_REPO_AUTO_DEL, \ IS_DB_SQLITE3, HAS_FILE_SEARCH, HAS_FILE_SEASEARCH try: @@ -166,8 +166,8 @@ def base(request): 'service_url': get_service_url().rstrip('/'), 'enable_file_scan': ENABLE_FILE_SCAN, 'avatar_url': avatar_url if avatar_url else '', - 'privacy_policy_link': PRIVACY_POLICY_LINK, - 'terms_of_service_link': TERMS_OF_SERVICE_LINK, + 'enable_privacy_policy': ENABLE_PRIVACY_POLICY, + 'enable_terms_of_service': ENABLE_TERMS_OF_SERVICE, 'side_nav_footer_custom_html': SIDE_NAV_FOOTER_CUSTOM_HTML, 'about_dialog_custom_html': ABOUT_DIALOG_CUSTOM_HTML, 'enable_repo_auto_del': ENABLE_REPO_AUTO_DEL, diff --git a/seahub/privacy_policy/__init__.py b/seahub/privacy_policy/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seahub/privacy_policy/templates/privacy-policy/privacy-policy.html b/seahub/privacy_policy/templates/privacy-policy/privacy-policy.html new file mode 100644 index 00000000000..6279ebe7b4b --- /dev/null +++ b/seahub/privacy_policy/templates/privacy-policy/privacy-policy.html @@ -0,0 +1,81 @@ + + + + + + Privacy Policy + + + +

Privacy Policy

+

Welcome to our website. We value your privacy and are committed to protecting your personal information. Please read this Privacy Policy carefully to understand how we collect, use, disclose, and safeguard your information.

+ +

1. Information We Collect

+

We may collect and process the following types of personal information:

+ + +

2. How We Use Information

+

We may use your personal information for the following purposes:

+ + +

3. Disclosure of Information

+

We do not sell or rent your personal information to third parties. We may disclose your information in the following situations:

+ + +

4. Protection of Information

+

We implement appropriate technical and organizational measures to protect your personal information from unauthorized access, use, alteration, and disclosure.

+ +

5. Your Rights

+

Depending on the applicable privacy laws, you may have the following rights:

+ + +

6. Changes to Privacy Policy

+

We may update this Privacy Policy from time to time. Any changes will be posted on this page with an updated revision date.

+ +

7. Contact Us

+

If you have any questions or concerns about our Privacy Policy, please contact us at:

+

Email: privacy@example.com

+

Phone: 123-456-7890

+ +

Last updated: August 6, 2024

+ + diff --git a/seahub/privacy_policy/urls.py b/seahub/privacy_policy/urls.py new file mode 100644 index 00000000000..5c918476424 --- /dev/null +++ b/seahub/privacy_policy/urls.py @@ -0,0 +1,7 @@ +# Copyright (c) 2012-2016 Seafile Ltd. +from django.urls import path +from django.views.generic import TemplateView + +urlpatterns = [ + path('', TemplateView.as_view(template_name="privacy-policy/privacy-policy.html")), +] diff --git a/seahub/settings.py b/seahub/settings.py index a3e6e9d0c42..f7398aa0a90 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -255,6 +255,8 @@ 'seahub.profile', 'seahub.share', 'seahub.help', + 'seahub.privacy_policy', + 'seahub.terms_of_service', 'seahub.thumbnail', 'seahub.password_session', 'seahub.admin_log', @@ -629,9 +631,8 @@ def genpassword(): # show 'log out' icon in top-bar or not. SHOW_LOGOUT_ICON = False -# privacy policy link and service link -PRIVACY_POLICY_LINK = '' -TERMS_OF_SERVICE_LINK = '' +ENABLE_PRIVACY_POLICY = False +ENABLE_TERMS_OF_SERVICE = False FILE_CONVERTER_SERVER_URL = 'http://127.0.0.1:8888' diff --git a/seahub/templates/snippets/policy_service_link.html b/seahub/templates/snippets/policy_service_link.html index d782b6d1f43..58b35b46b7c 100644 --- a/seahub/templates/snippets/policy_service_link.html +++ b/seahub/templates/snippets/policy_service_link.html @@ -1,14 +1,14 @@ {% load i18n %} -{% if privacy_policy_link or terms_of_service_link %} +{% if enable_privacy_policy or enable_terms_of_service %} {% endif %} diff --git a/seahub/terms_of_service/__init__.py b/seahub/terms_of_service/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seahub/terms_of_service/templates/terms-of-service/terms-of-service.html b/seahub/terms_of_service/templates/terms-of-service/terms-of-service.html new file mode 100644 index 00000000000..fdaf4181222 --- /dev/null +++ b/seahub/terms_of_service/templates/terms-of-service/terms-of-service.html @@ -0,0 +1,59 @@ + + + + + + Terms of Service + + + +

Terms of Service

+

Welcome to our website. By accessing or using our website, you agree to be bound by these Terms of Service. Please read them carefully.

+ +

1. Acceptance of Terms

+

By using our website, you accept and agree to comply with these Terms of Service. If you do not agree with these terms, you must not use our website.

+ +

2. Changes to Terms

+

We reserve the right to modify these Terms of Service at any time. Any changes will be effective immediately upon posting on this page. Your continued use of the website after any changes signifies your acceptance of the new terms.

+ +

3. Use of the Website

+

You agree to use our website only for lawful purposes and in a way that does not infringe the rights of, restrict, or inhibit anyone else's use and enjoyment of the website. Prohibited behavior includes harassing or causing distress or inconvenience to any other user, transmitting obscene or offensive content, or disrupting the normal flow of dialogue within our website.

+ +

4. Intellectual Property

+

All content on this website, including but not limited to text, graphics, logos, icons, images, and software, is the property of our website or its content suppliers and is protected by international copyright laws. You may not reproduce, distribute, or create derivative works from any content on this website without our prior written permission.

+ +

5. User Content

+

You are responsible for any content you post on our website. By submitting content, you grant us a non-exclusive, worldwide, royalty-free license to use, reproduce, modify, and distribute your content in any media. You agree not to post any content that is illegal, harmful, threatening, abusive, defamatory, vulgar, obscene, invasive of another's privacy, or otherwise objectionable.

+ +

6. Termination

+

We reserve the right to terminate or suspend your access to our website at any time, without notice, for conduct that we believe violates these Terms of Service or is harmful to other users of the website, us, or third parties, or for any other reason.

+ +

7. Disclaimers and Limitation of Liability

+

Our website is provided "as is" and "as available" without any warranties of any kind, either express or implied. We do not guarantee that our website will be available at all times or that it will be free from errors or viruses. In no event shall we be liable for any damages arising out of your use of the website.

+ +

8. Governing Law

+

These Terms of Service shall be governed by and construed in accordance with the laws of [Your Country/State], without regard to its conflict of law principles. Any legal actions arising out of or relating to these terms shall be filed exclusively in the courts located in [Your Jurisdiction].

+ +

9. Contact Us

+

If you have any questions or concerns about these Terms of Service, please contact us at:

+

Email: support@example.com

+

Phone: 123-456-7890

+ +

Last updated: August 6, 2024

+ + diff --git a/seahub/terms_of_service/urls.py b/seahub/terms_of_service/urls.py new file mode 100644 index 00000000000..46ab97be10e --- /dev/null +++ b/seahub/terms_of_service/urls.py @@ -0,0 +1,7 @@ +# Copyright (c) 2012-2016 Seafile Ltd. +from django.urls import path +from django.views.generic import TemplateView + +urlpatterns = [ + path('', TemplateView.as_view(template_name="terms-of-service/terms-of-service.html")), +] diff --git a/seahub/urls.py b/seahub/urls.py index 47216cfb670..ee28cadef2f 100644 --- a/seahub/urls.py +++ b/seahub/urls.py @@ -733,6 +733,8 @@ path('profile/', include('seahub.profile.urls')), path('share/', include('seahub.share.urls')), path('help/', include('seahub.help.urls')), + path('privacy-policy/', include('seahub.privacy_policy.urls')), + path('terms-of-service/', include('seahub.terms_of_service.urls')), path('captcha/', include('captcha.urls')), path('thumbnail/', include('seahub.thumbnail.urls')), path('inst/', include(('seahub.institutions.urls', 'institutions'), namespace='institutions')),