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
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions zeabur/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Zeabur

## Typesense Template

```sh
npx zeabur template update -c FTAONK -f typesense-template.yaml
```

docs:

- https://zeabur.com/docs/template/template-in-code
Comment on lines +9 to +11
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Format the documentation link as a proper Markdown link

The documentation link is useful, but it's currently formatted as a bare URL. To improve readability and follow Markdown best practices, consider formatting it as a proper Markdown link with descriptive text.

Here's a suggested revision:

-docs:
-
-- https://zeabur.com/docs/template/template-in-code
+## Documentation
+
+- [Zeabur Template in Code Documentation](https://zeabur.com/docs/template/template-in-code)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docs:
- https://zeabur.com/docs/template/template-in-code
## Documentation
- [Zeabur Template in Code Documentation](https://zeabur.com/docs/template/template-in-code)
🧰 Tools
🪛 Markdownlint

11-11: null
Bare URL used

(MD034, no-bare-urls)

30 changes: 30 additions & 0 deletions zeabur/typesense-template.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: "xyz"
expose: false
TYPESENSE_DATA_DIR:
default: /data
expose: false
configs: []
Comment on lines +23 to +30
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: Remove the default API key.

The environment variables are correctly set and not exposed, which is good for security. However, there's a significant security risk in the current configuration.

The default value "xyz" for TYPESENSE_API_KEY is insecure. Hardcoding API keys, even as defaults, can lead to accidental exposure of the key if not changed during deployment.

Consider the following improvements:

  1. Remove the default value for TYPESENSE_API_KEY.
  2. Add a comment instructing users to set a strong, unique API key during deployment.
  3. Optionally, implement a mechanism to generate a random API key if none is provided.

Here's an example of how you might modify the TYPESENSE_API_KEY configuration:

TYPESENSE_API_KEY:
  # Uncomment and set a strong, unique API key during deployment
  # default: ""
  expose: false

Additionally, consider adding a validation step in your deployment process to ensure a proper API key is set before the service starts.

Loading