Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 zeabur template for Typesense #18

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions zeabur-typesense.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
name: Typesense
spec:
description: Fast, open source, typo-tolerant search engine
icon: "https://typesense.org/docs/images/typesense_logo.svg"
services:
- name: typesense
icon: https://typesense.org/docs/images/typesense_logo.svg
template: PREBUILT_V2
spec:
source:
image: typesense/typesense:27.1
ports:
- id: web
port: 8108
type: HTTP
volumes:
- id: data
dir: /data
env:
TYPESENSE_API_KEY:
default: ""
expose: false
TYPESENSE_DATA_DIR:
default: /data
expose: false
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Security concern: Default API key configuration.

While the environment variables are correctly defined, there's a potential security risk with the TYPESENSE_API_KEY configuration.

Setting the API key to an empty string by default could lead to an insecure deployment if not properly configured by the user. Consider the following improvements:

  1. Remove the default value for TYPESENSE_API_KEY, forcing the user to provide one.
  2. Add a comment or documentation explaining the importance of setting a strong API key.
  3. Optionally, generate a random default API key.

Example:

TYPESENSE_API_KEY:
  # No default value, must be provided by the user
  expose: false
  description: "Set a strong API key for Typesense (required)"

configs: []
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider adding useful configurations.

The empty configs array might be a missed opportunity to provide additional configuration options for Typesense.

Consider adding some common Typesense configurations, such as:

  • TYPESENSE_ENABLE_CORS (boolean)
  • TYPESENSE_THREAD_POOL_SIZE (integer)
  • TYPESENSE_HEALTHY_READ_LAG (integer)

Example:

configs:
  - name: TYPESENSE_ENABLE_CORS
    type: boolean
    default: false
    description: "Enable CORS for Typesense API"
  - name: TYPESENSE_THREAD_POOL_SIZE
    type: integer
    default: 4
    description: "Number of threads used for search operations"

Loading