chore: Support multiple term types
This commit is contained in:
@@ -69,7 +69,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Seed database with terms signature
|
- name: Seed database with terms signature
|
||||||
run: |
|
run: |
|
||||||
TERMS_SIGNATURE=$(sha256sum terms/en-US.md | awk '{print $1}')
|
TERMS_SIGNATURE=$(sha256sum terms/self-hosted/en-US.md | awk '{print $1}')
|
||||||
PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U $POSTGRES_USERNAME -d $POSTGRES_DATABASE -c "UPDATE user_account SET terms_signature = '$TERMS_SIGNATURE';"
|
PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U $POSTGRES_USERNAME -d $POSTGRES_DATABASE -c "UPDATE user_account SET terms_signature = '$TERMS_SIGNATURE';"
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ services:
|
|||||||
# - MAX_UPLOAD_FILE_SIZE=
|
# - MAX_UPLOAD_FILE_SIZE=
|
||||||
# - TOKEN_EXPIRES_IN=365 # In days
|
# - TOKEN_EXPIRES_IN=365 # In days
|
||||||
|
|
||||||
|
# - STORAGE_LIMIT=
|
||||||
|
# - ACTIVE_USERS_LIMIT=
|
||||||
|
|
||||||
# related: https://github.com/knex/knex/issues/2354
|
# related: https://github.com/knex/knex/issues/2354
|
||||||
# As knex does not pass query parameters from the connection string,
|
# As knex does not pass query parameters from the connection string,
|
||||||
# we have to use environment variables in order to pass the desired values, e.g.
|
# we have to use environment variables in order to pass the desired values, e.g.
|
||||||
@@ -40,12 +43,6 @@ services:
|
|||||||
# - DEFAULT_ADMIN_NAME=Demo Demo
|
# - DEFAULT_ADMIN_NAME=Demo Demo
|
||||||
# - DEFAULT_ADMIN_USERNAME=demo
|
# - DEFAULT_ADMIN_USERNAME=demo
|
||||||
|
|
||||||
# - INTERNAL_ACCESS_TOKEN=
|
|
||||||
# - STORAGE_LIMIT=
|
|
||||||
# - ACTIVE_USERS_LIMIT=
|
|
||||||
# - CUSTOMER_PANEL_URL=
|
|
||||||
# - DEMO_MODE=true
|
|
||||||
|
|
||||||
# Set to true to show more detailed authentication error messages.
|
# Set to true to show more detailed authentication error messages.
|
||||||
# It should not be enabled without a rate limiter for security reasons.
|
# It should not be enabled without a rate limiter for security reasons.
|
||||||
# - SHOW_DETAILED_AUTH_ERRORS=false
|
# - SHOW_DETAILED_AUTH_ERRORS=false
|
||||||
|
|||||||
+3
-6
@@ -31,6 +31,9 @@ services:
|
|||||||
# - MAX_UPLOAD_FILE_SIZE=
|
# - MAX_UPLOAD_FILE_SIZE=
|
||||||
# - TOKEN_EXPIRES_IN=365 # In days
|
# - TOKEN_EXPIRES_IN=365 # In days
|
||||||
|
|
||||||
|
# - STORAGE_LIMIT=
|
||||||
|
# - ACTIVE_USERS_LIMIT=
|
||||||
|
|
||||||
# related: https://github.com/knex/knex/issues/2354
|
# related: https://github.com/knex/knex/issues/2354
|
||||||
# As knex does not pass query parameters from the connection string,
|
# As knex does not pass query parameters from the connection string,
|
||||||
# we have to use environment variables in order to pass the desired values, e.g.
|
# we have to use environment variables in order to pass the desired values, e.g.
|
||||||
@@ -51,12 +54,6 @@ services:
|
|||||||
# - DEFAULT_ADMIN_NAME=Demo Demo
|
# - DEFAULT_ADMIN_NAME=Demo Demo
|
||||||
# - DEFAULT_ADMIN_USERNAME=demo
|
# - DEFAULT_ADMIN_USERNAME=demo
|
||||||
|
|
||||||
# - INTERNAL_ACCESS_TOKEN=
|
|
||||||
# - STORAGE_LIMIT=
|
|
||||||
# - ACTIVE_USERS_LIMIT=
|
|
||||||
# - CUSTOMER_PANEL_URL=
|
|
||||||
# - DEMO_MODE=true
|
|
||||||
|
|
||||||
# Set to true to show more detailed authentication error messages.
|
# Set to true to show more detailed authentication error messages.
|
||||||
# It should not be enabled without a rate limiter for security reasons.
|
# It should not be enabled without a rate limiter for security reasons.
|
||||||
# - SHOW_DETAILED_AUTH_ERRORS=false
|
# - SHOW_DETAILED_AUTH_ERRORS=false
|
||||||
|
|||||||
+3
-6
@@ -13,6 +13,9 @@ SECRET_KEY=notsecretkey
|
|||||||
# MAX_UPLOAD_FILE_SIZE=
|
# MAX_UPLOAD_FILE_SIZE=
|
||||||
# TOKEN_EXPIRES_IN=365 # In days
|
# TOKEN_EXPIRES_IN=365 # In days
|
||||||
|
|
||||||
|
# STORAGE_LIMIT=
|
||||||
|
# ACTIVE_USERS_LIMIT=
|
||||||
|
|
||||||
# related: https://github.com/knex/knex/issues/2354
|
# related: https://github.com/knex/knex/issues/2354
|
||||||
# As knex does not pass query parameters from the connection string,
|
# As knex does not pass query parameters from the connection string,
|
||||||
# we have to use environment variables in order to pass the desired values, e.g.
|
# we have to use environment variables in order to pass the desired values, e.g.
|
||||||
@@ -31,12 +34,6 @@ SECRET_KEY=notsecretkey
|
|||||||
# DEFAULT_ADMIN_NAME=Demo Demo
|
# DEFAULT_ADMIN_NAME=Demo Demo
|
||||||
# DEFAULT_ADMIN_USERNAME=demo
|
# DEFAULT_ADMIN_USERNAME=demo
|
||||||
|
|
||||||
# INTERNAL_ACCESS_TOKEN=
|
|
||||||
# STORAGE_LIMIT=
|
|
||||||
# ACTIVE_USERS_LIMIT=
|
|
||||||
# CUSTOMER_PANEL_URL=
|
|
||||||
# DEMO_MODE=true
|
|
||||||
|
|
||||||
# Set to true to show more detailed authentication error messages.
|
# Set to true to show more detailed authentication error messages.
|
||||||
# It should not be enabled without a rate limiter for security reasons.
|
# It should not be enabled without a rate limiter for security reasons.
|
||||||
# SHOW_DETAILED_AUTH_ERRORS=false
|
# SHOW_DETAILED_AUTH_ERRORS=false
|
||||||
|
|||||||
@@ -18,7 +18,10 @@ const LANGUAGES = ['de-DE', 'en-US'];
|
|||||||
const DEFAULT_LANGUAGE = 'en-US';
|
const DEFAULT_LANGUAGE = 'en-US';
|
||||||
|
|
||||||
const getContent = (language = DEFAULT_LANGUAGE) =>
|
const getContent = (language = DEFAULT_LANGUAGE) =>
|
||||||
fsPromises.readFile(`${sails.config.appPath}/terms/${language}.md`, 'utf8');
|
fsPromises.readFile(
|
||||||
|
`${sails.config.appPath}/terms/${sails.config.custom.termsType}/${language}.md`,
|
||||||
|
'utf8',
|
||||||
|
);
|
||||||
|
|
||||||
const hashContent = (content) => crypto.createHash('sha256').update(content).digest('hex');
|
const hashContent = (content) => crypto.createHash('sha256').update(content).digest('hex');
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -47,6 +47,9 @@ module.exports.custom = {
|
|||||||
maxUploadFileSize: envToBytes(process.env.MAX_UPLOAD_FILE_SIZE),
|
maxUploadFileSize: envToBytes(process.env.MAX_UPLOAD_FILE_SIZE),
|
||||||
tokenExpiresIn: (parseInt(process.env.TOKEN_EXPIRES_IN, 10) || 365) * 24 * 60 * 60,
|
tokenExpiresIn: (parseInt(process.env.TOKEN_EXPIRES_IN, 10) || 365) * 24 * 60 * 60,
|
||||||
|
|
||||||
|
storageLimit: envToBytes(process.env.STORAGE_LIMIT),
|
||||||
|
activeUsersLimit: envToNumber(process.env.ACTIVE_USERS_LIMIT),
|
||||||
|
|
||||||
// Location to receive uploaded files in. Default (non-string value) is a Sails-specific location.
|
// Location to receive uploaded files in. Default (non-string value) is a Sails-specific location.
|
||||||
uploadsTempPath: null,
|
uploadsTempPath: null,
|
||||||
uploadsBasePath: path.join(sails.config.appPath, 'data'),
|
uploadsBasePath: path.join(sails.config.appPath, 'data'),
|
||||||
@@ -59,12 +62,6 @@ module.exports.custom = {
|
|||||||
defaultAdminEmail:
|
defaultAdminEmail:
|
||||||
process.env.DEFAULT_ADMIN_EMAIL && process.env.DEFAULT_ADMIN_EMAIL.toLowerCase(),
|
process.env.DEFAULT_ADMIN_EMAIL && process.env.DEFAULT_ADMIN_EMAIL.toLowerCase(),
|
||||||
|
|
||||||
internalAccessToken: process.env.INTERNAL_ACCESS_TOKEN,
|
|
||||||
storageLimit: envToBytes(process.env.STORAGE_LIMIT),
|
|
||||||
activeUsersLimit: envToNumber(process.env.ACTIVE_USERS_LIMIT),
|
|
||||||
customerPanelUrl: process.env.CUSTOMER_PANEL_URL,
|
|
||||||
demoMode: process.env.DEMO_MODE === 'true',
|
|
||||||
|
|
||||||
showDetailedAuthErrors: process.env.SHOW_DETAILED_AUTH_ERRORS === 'true',
|
showDetailedAuthErrors: process.env.SHOW_DETAILED_AUTH_ERRORS === 'true',
|
||||||
outgoingProxy: process.env.OUTGOING_PROXY,
|
outgoingProxy: process.env.OUTGOING_PROXY,
|
||||||
|
|
||||||
@@ -112,4 +109,11 @@ module.exports.custom = {
|
|||||||
smtpFrom: process.env.SMTP_FROM,
|
smtpFrom: process.env.SMTP_FROM,
|
||||||
|
|
||||||
gravatarBaseUrl: process.env.GRAVATAR_BASE_URL,
|
gravatarBaseUrl: process.env.GRAVATAR_BASE_URL,
|
||||||
|
|
||||||
|
/* Internal */
|
||||||
|
|
||||||
|
internalAccessToken: process.env.INTERNAL_ACCESS_TOKEN,
|
||||||
|
termsType: process.env.TERMS_TYPE || 'self-hosted',
|
||||||
|
customerPanelUrl: process.env.CUSTOMER_PANEL_URL,
|
||||||
|
demoMode: process.env.DEMO_MODE === 'true',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# Beispiel-Nutzungsbedingungen
|
||||||
|
_Nicht rechtsverbindlich. Dies ist ein Platzhaltertext nur zu Testzwecken._
|
||||||
|
|
||||||
|
_Letzte Aktualisierung: 14. August 2025_
|
||||||
|
|
||||||
|
Willkommen bei ExampleCorp! Diese Beispiel-Nutzungsbedingungen ("Bedingungen") dienen ausschließlich der Demonstration und dem Testen in Ihrer Anwendung. Sie sind **rechtlich nicht gültig**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Einführung
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu mauris at est lacinia gravida. Nulla facilisi.
|
||||||
|
|
||||||
|
## 2. Teilnahmeberechtigung
|
||||||
|
Benutzer müssen mindestens 18 Jahre alt sein, um diesen Dienst zu nutzen. Sed vulputate sapien eu varius efficitur.
|
||||||
|
|
||||||
|
## 3. Pflichten der Benutzer
|
||||||
|
Durch die Nutzung der Plattform stimmen Sie zu:
|
||||||
|
- Genaue Informationen bereitzustellen.
|
||||||
|
- Keine illegalen Aktivitäten durchzuführen.
|
||||||
|
- Andere Benutzer zu respektieren.
|
||||||
|
|
||||||
|
## 4. Verbotene Aktivitäten
|
||||||
|
Nicht erlaubt:
|
||||||
|
1. Andere belästigen.
|
||||||
|
2. Schadcode hochladen.
|
||||||
|
3. Sicherheitsmaßnahmen umgehen.
|
||||||
|
|
||||||
|
## 5. Änderungen
|
||||||
|
Diese Beispiel-Bedingungen können jederzeit zu Testzwecken geändert werden.
|
||||||
|
|
||||||
|
## 6. Kontakt
|
||||||
|
Bei Fragen zu diesen Beispiel-Bedingungen wenden Sie sich bitte an `placeholder@example.com`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Ende des Beispiels**
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# Example Terms of Service
|
||||||
|
_Not legally binding. This is placeholder text for testing purposes only._
|
||||||
|
|
||||||
|
_Last updated: August 14, 2025_
|
||||||
|
|
||||||
|
Welcome to ExampleCorp! These Example Terms of Service ("Terms") are provided solely for demonstration and testing purposes in your application. They are **not legally valid**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Introduction
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu mauris at est lacinia gravida. Nulla facilisi.
|
||||||
|
|
||||||
|
## 2. Eligibility
|
||||||
|
Users must be at least 18 years old to use this service. Sed vulputate sapien eu varius efficitur.
|
||||||
|
|
||||||
|
## 3. User Responsibilities
|
||||||
|
By using the platform, you agree to:
|
||||||
|
- Provide accurate information.
|
||||||
|
- Avoid illegal activities.
|
||||||
|
- Respect other users.
|
||||||
|
|
||||||
|
## 4. Prohibited Activities
|
||||||
|
Do not:
|
||||||
|
1. Harass others.
|
||||||
|
2. Upload harmful code.
|
||||||
|
3. Attempt to bypass security.
|
||||||
|
|
||||||
|
## 5. Modifications
|
||||||
|
These example Terms may change at any time for testing purposes.
|
||||||
|
|
||||||
|
## 6. Contact
|
||||||
|
For questions about these example Terms, please contact `placeholder@example.com`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**End of Example**
|
||||||
Reference in New Issue
Block a user