Skip to content

Commit bdd92e8

Browse files
authored
nats (#239)
* nats * cdn
1 parent 8c407ab commit bdd92e8

File tree

8 files changed

+394
-29
lines changed

8 files changed

+394
-29
lines changed

apps/docs/content/features/cdn.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,17 @@ Zerops provides multiple ways to manage and purge cached content before its norm
192192
```sh
193193
# Purge all content for a domain
194194
zsc cdn purge example.com
195-
196-
# Purge specific path
197-
zsc cdn purge example.com /images/
195+
# Purge all content (wildcard)
196+
zsc cdn purge example.com "/*"
197+
# Purge specific file
198+
zsc cdn purge example.com "/path/to/my-file$"
198199
```
199200

201+
:::important
202+
- This command must be executed in any container within the project that has the CDN-enabled domain active
203+
- Currently only works for [Static Mode](#static-mode) CDN
204+
:::
205+
200206
- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference). Here are ready-to-use curl examples for quickly purging content in your scripts:
201207

202208
```sh

apps/docs/content/homepage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export const databases = [
4949
{ name: "Typesense", link: "/typesense/overview", icon: <Icons.typesense/> },
5050
{ name: "Meilisearch", link: "/meilisearch/overview", icon: <Icons.meilisearch/> },
5151
{ name: "Qdrant", link: "/qdrant/overview", icon: <Icons.qdrant/> },
52+
{ name: "NATS", link: "/nats/overview", icon: <Icons.nats/> },
5253
{ name: "KeyDB", link: "/keydb/overview", icon: <Icons.keydb/> },
5354
{ name: "Kafka", icon: <Icons.kafka/> },
54-
{ name: "NATS", icon: <Icons.nats/> },
5555
]
5656

5757
export const storages = [

apps/docs/content/nats/overview.mdx

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: NATS
3+
desc: Production-ready NATS messaging system on Zerops platform with automated scaling and enterprise reliability. Deploy, manage, and scale with zero infrastructure hassle.
4+
---
5+
6+
import UnorderedList from '@site/src/components/UnorderedList';
7+
import UnorderedCodeList from '@site/src/components/UnorderedCodeList';
8+
import data from '@site/static/data.json';
9+
10+
Zerops provides a fully managed [NATS](https://nats.io/) messaging system with automated scaling and zero infrastructure overhead, letting developers focus entirely on development.
11+
12+
## Supported Versions
13+
14+
Currently supported NATS version:
15+
<UnorderedList data={data.nats.readable}/>
16+
17+
Import configuration version:
18+
<UnorderedCodeList data={data.nats.import}/>
19+
20+
## Service Configuration
21+
22+
Our NATS implementation features optimized default settings designed for common use cases.
23+
24+
**Key configuration aspects** include:
25+
- Standard protocol port `4222` for client connections
26+
- HTTP monitoring interface `8222` for management
27+
- Secure authentication with automatically generated credentials
28+
- Optimized settings for performance and reliability
29+
30+
### JetStream Configuration
31+
32+
The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads:
33+
- **Memory store**: Up to 40GB for high-performance message caching
34+
- **File store**: Up to 250GB for persistent storage
35+
- **Regular sync intervals**: Ensures data durability and consistency
36+
:::note
37+
In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
38+
:::
39+
40+
This configuration provides a robust foundation for message persistence while balancing performance and reliability.
41+
42+
#### Disabling JetStream
43+
44+
If you don't need message persistence, you can disable JetStream by setting the `JET_STREAM_ENABLED` environment variable to `0` in your service configuration. This can be done:
45+
46+
- During service creation through the [import configuration](/references/import)
47+
- In the Zerops GUI under service environment variables
48+
- Via the [Zerops API](/references/api) when creating a new service
49+
50+
:::tip
51+
Disabling JetStream may reduce resource usage when persistence isn't required for your application.
52+
:::
53+
54+
### Deployment Modes
55+
56+
:::warning
57+
Deployment mode is selected during service creation and cannot be changed later.
58+
:::
59+
60+
#### Non-HA Mode
61+
- Suitable for development and testing
62+
- Data persistence not guaranteed during node failures
63+
- Lower resource requirements
64+
65+
#### HA Mode
66+
- Creates a multi-node NATS cluster
67+
- Configures routes between cluster nodes automatically
68+
- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability
69+
- Provides improved reliability compared to non-HA deployments
70+
71+
### Authentication Management
72+
73+
Authentication credentials are automatically generated and managed by the platform. The system creates a default user (`zerops`) with a secure 16-character password. You can access these credentials through:
74+
- The service access details in the Zerops GUI
75+
- Environment variables in your service configuration:
76+
- `user` - Username for authentication (default: "zerops")
77+
- `password` - Generated secure password
78+
- `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}`
79+
80+
## Health Monitoring
81+
82+
Zerops continuously monitors your NATS service health using built-in health checks:
83+
84+
- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222
85+
- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected
86+
87+
### Health Status
88+
89+
You can check the health status of your NATS service:
90+
91+
1. Through the Zerops GUI dashboard
92+
2. By accessing the management interface at port `8222`
93+
94+
## Backup and Recovery
95+
96+
Zerops provides built-in backup functionality for your NATS JetStream data, ensuring your message streams and configurations can be safely preserved and restored when needed.
97+
98+
### Backup Process
99+
100+
Backups are created in `.tar.gz` format using the `nats` backup command. They are saved to local disk, compressed, streamed to backup storage, and then deleted locally.
101+
102+
For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
103+
104+
## Support
105+
106+
For advanced configurations or custom requirements:
107+
- Join our [Discord community](https://discord.gg/zerops)
108+
- Contact support via [email](mailto:support@zerops.io)

apps/docs/content/references/zsc.mdx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,20 @@ zsc cdn [command]
9797

9898
#### Examples
9999
```sh
100-
# Purge CDN cache for a specific domain
100+
# Purge all CDN cache for a specific domain
101101
zsc cdn purge example.com
102-
103-
# Purge CDN cache for a specific path on a domain
104-
zsc cdn purge example.com /images/
102+
# Purge all content using wildcard pattern
103+
zsc cdn purge example.com "/*"
104+
# Purge CDN cache for a specific file (note the $ suffix)
105+
zsc cdn purge example.com "/path/to/my-file$"
106+
# Purge CDN cache for a specific directory
107+
zsc cdn purge example.com "/images/"
105108
```
106109

110+
:::important
111+
- This command must be executed in any container within the project that has the CDN-enabled domain active
112+
- Currently, the purge command only works for the [Static Mode](/features/cdn#static-mode) CDN
113+
:::
107114
---
108115

109116
### shared-storage

apps/docs/sidebars.js

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,15 @@ module.exports = {
407407
},
408408
className: "homepage-sidebar-item service-sidebar-item",
409409
},
410+
{
411+
type: "ref",
412+
id: "nats/overview",
413+
label: "NATS",
414+
customProps: {
415+
sidebar_icon: "nats",
416+
},
417+
className: "homepage-sidebar-item service-sidebar-item",
418+
},
410419
{
411420
type: 'ref',
412421
id: 'keydb/overview',
@@ -424,15 +433,6 @@ module.exports = {
424433
// sidebar_icon: "kafka",
425434
// },
426435
// className: "homepage-sidebar-item service-sidebar-item",
427-
// },
428-
// {
429-
// type: "ref",
430-
// id: "nats/overview",
431-
// label: "NATS",
432-
// customProps: {
433-
// sidebar_icon: "nats",
434-
// },
435-
// className: "homepage-sidebar-item service-sidebar-item",
436436
// },
437437
],
438438
},
@@ -2274,6 +2274,26 @@ module.exports = {
22742274
},
22752275
},
22762276
],
2277+
nats: [
2278+
{
2279+
type: 'ref',
2280+
id: 'homepage',
2281+
label: 'Back to home',
2282+
customProps: {
2283+
sidebar_is_back_link: true,
2284+
sidebar_icon: 'back-arrow',
2285+
},
2286+
},
2287+
{
2288+
type: 'doc',
2289+
id: 'nats/overview',
2290+
label: 'Zerops NATS Service',
2291+
customProps: {
2292+
sidebar_is_title: true,
2293+
sidebar_icon: 'nats',
2294+
},
2295+
},
2296+
],
22772297
// rabbitmq: [
22782298
// {
22792299
// type: "ref",

apps/docs/static/llms-full.txt

Lines changed: 123 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12533,11 +12533,17 @@ Zerops provides multiple ways to manage and purge cached content before its norm
1253312533
```sh
1253412534
# Purge all content for a domain
1253512535
zsc cdn purge example.com
12536-
12537-
# Purge specific path
12538-
zsc cdn purge example.com /images/
12536+
# Purge all content (wildcard)
12537+
zsc cdn purge example.com "/*"
12538+
# Purge specific file
12539+
zsc cdn purge example.com "/path/to/my-file$"
1253912540
```
1254012541

12542+
:::important
12543+
- This command must be executed in any container within the project that has the CDN-enabled domain active
12544+
- Currently only works for [Static Mode](#static-mode) CDN
12545+
:::
12546+
1254112547
- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference). Here are ready-to-use curl examples for quickly purging content in your scripts:
1254212548

1254312549
```sh
@@ -22625,9 +22631,9 @@ export const databases = [
2262522631
{ name: "Typesense", link: "/typesense/overview", icon: <Icons.typesense/> },
2262622632
{ name: "Meilisearch", link: "/meilisearch/overview", icon: <Icons.meilisearch/> },
2262722633
{ name: "Qdrant", link: "/qdrant/overview", icon: <Icons.qdrant/> },
22634+
{ name: "NATS", link: "/nats/overview", icon: <Icons.nats/> },
2262822635
{ name: "KeyDB", link: "/keydb/overview", icon: <Icons.keydb/> },
2262922636
{ name: "Kafka", icon: <Icons.kafka/> },
22630-
{ name: "NATS", icon: <Icons.nats/> },
2263122637
]
2263222638

2263322639
export const storages = [
@@ -28155,6 +28161,108 @@ For advanced configurations or custom requirements:
2815528161

2815628162

2815728163

28164+
Zerops provides a fully managed [NATS](https://nats.io/) messaging system with automated scaling and zero infrastructure overhead, letting developers focus entirely on development.
28165+
28166+
## Supported Versions
28167+
28168+
Currently supported NATS version:
28169+
<UnorderedList data={data.nats.readable}/>
28170+
28171+
Import configuration version:
28172+
<UnorderedCodeList data={data.nats.import}/>
28173+
28174+
## Service Configuration
28175+
28176+
Our NATS implementation features optimized default settings designed for common use cases.
28177+
28178+
**Key configuration aspects** include:
28179+
- Standard protocol port `4222` for client connections
28180+
- HTTP monitoring interface `8222` for management
28181+
- Secure authentication with automatically generated credentials
28182+
- Optimized settings for performance and reliability
28183+
28184+
### JetStream Configuration
28185+
28186+
The service includes [JetStream](https://docs.nats.io/nats-concepts/jetstream) functionality **enabled by default**, providing persistent storage capabilities for your messaging workloads:
28187+
- **Memory store**: Up to 40GB for high-performance message caching
28188+
- **File store**: Up to 250GB for persistent storage
28189+
- **Regular sync intervals**: Ensures data durability and consistency
28190+
:::note
28191+
In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
28192+
:::
28193+
28194+
This configuration provides a robust foundation for message persistence while balancing performance and reliability.
28195+
28196+
#### Disabling JetStream
28197+
28198+
If you don't need message persistence, you can disable JetStream by setting the `JET_STREAM_ENABLED` environment variable to `0` in your service configuration. This can be done:
28199+
28200+
- During service creation through the [import configuration](/references/import)
28201+
- In the Zerops GUI under service environment variables
28202+
- Via the [Zerops API](/references/api) when creating a new service
28203+
28204+
:::tip
28205+
Disabling JetStream may reduce resource usage when persistence isn't required for your application.
28206+
:::
28207+
28208+
### Deployment Modes
28209+
28210+
:::warning
28211+
Deployment mode is selected during service creation and cannot be changed later.
28212+
:::
28213+
28214+
#### Non-HA Mode
28215+
- Suitable for development and testing
28216+
- Data persistence not guaranteed during node failures
28217+
- Lower resource requirements
28218+
28219+
#### HA Mode
28220+
- Creates a multi-node NATS cluster
28221+
- Configures routes between cluster nodes automatically
28222+
- Implements [NATS clustering](https://docs.nats.io/running-a-nats-service/configuration/clustering) for high availability
28223+
- Provides improved reliability compared to non-HA deployments
28224+
28225+
### Authentication Management
28226+
28227+
Authentication credentials are automatically generated and managed by the platform. The system creates a default user (`zerops`) with a secure 16-character password. You can access these credentials through:
28228+
- The service access details in the Zerops GUI
28229+
- Environment variables in your service configuration:
28230+
- `user` - Username for authentication (default: "zerops")
28231+
- `password` - Generated secure password
28232+
- `connectionString` - Complete connection string in the format `nats://${dbUser}:${dbPassword}@${hostname}:${port}`
28233+
28234+
## Health Monitoring
28235+
28236+
Zerops continuously monitors your NATS service health using built-in health checks:
28237+
28238+
- **HTTP Health Check**: The system checks the `/healthz` endpoint at port 8222
28239+
- **Self-Healing**: The platform automatically recovers unhealthy nodes when issues are detected
28240+
28241+
### Health Status
28242+
28243+
You can check the health status of your NATS service:
28244+
28245+
1. Through the Zerops GUI dashboard
28246+
2. By accessing the management interface at port `8222`
28247+
28248+
## Backup and Recovery
28249+
28250+
Zerops provides built-in backup functionality for your NATS JetStream data, ensuring your message streams and configurations can be safely preserved and restored when needed.
28251+
28252+
### Backup Process
28253+
28254+
Backups are created in `.tar.gz` format using the `nats` backup command. They are saved to local disk, compressed, streamed to backup storage, and then deleted locally.
28255+
28256+
For general information about backup frequency and storage limits, see our [Backup documentation](/features/backup).
28257+
28258+
## Support
28259+
28260+
For advanced configurations or custom requirements:
28261+
- Join our [Discord community](https://discord.gg/zerops)
28262+
- Contact support via [email](mailto:support@zerops.io)
28263+
28264+
28265+
2815828266
<FAQ>
2815928267
<FAQItem question="How do I enable SEO optimization with prerender.io?">
2816028268
Zerops provides built-in prerender.io support. Simply set the `PRERENDER_TOKEN` environment variable with your prerender.io service token. See our [prerender.io documentation](/nginx/how-to/env-variables#prerenderio-support) for details.
@@ -46019,13 +46127,20 @@ zsc cdn [command]
4601946127

4602046128
#### Examples
4602146129
```sh
46022-
# Purge CDN cache for a specific domain
46130+
# Purge all CDN cache for a specific domain
4602346131
zsc cdn purge example.com
46024-
46025-
# Purge CDN cache for a specific path on a domain
46026-
zsc cdn purge example.com /images/
46132+
# Purge all content using wildcard pattern
46133+
zsc cdn purge example.com "/*"
46134+
# Purge CDN cache for a specific file (note the $ suffix)
46135+
zsc cdn purge example.com "/path/to/my-file$"
46136+
# Purge CDN cache for a specific directory
46137+
zsc cdn purge example.com "/images/"
4602746138
```
4602846139

46140+
:::important
46141+
- This command must be executed in any container within the project that has the CDN-enabled domain active
46142+
- Currently, the purge command only works for the [Static Mode](/features/cdn#static-mode) CDN
46143+
:::
4602946144
---
4603046145

4603146146
### shared-storage

0 commit comments

Comments
 (0)