Skip to content

Commit 8bbcac8

Browse files
committed
Add remote node feature
1 parent a3bda7b commit 8bbcac8

25 files changed

+449
-65
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Dagu is a powerful Cron alternative that comes with a Web UI. It allows you to d
6363
- [3. Edit the DAG](#3-edit-the-dag)
6464
- [4. Execute the DAG](#4-execute-the-dag)
6565
- [**CLI**](#cli)
66+
- [**Remote Node Management support**](#remote-node-management-support)
67+
- [Configuration](#configuration)
6668
- [**Localized Documentation**](#localized-documentation)
6769
- [**Documentation**](#documentation)
6870
- [**Running as a daemon**](#running-as-a-daemon)
@@ -92,6 +94,10 @@ Dagu is a powerful Cron alternative that comes with a Web UI. It allows you to d
9294
- Sending emails
9395
- Running jq command
9496
- Executing remote commands via SSH
97+
- Remote Node support for managing multiple Dagu instances:
98+
- Monitor DAGs across different environments
99+
- Switch between nodes through UI dropdown
100+
- Centralized management interface
95101
- Email notification
96102
- Scheduling with Cron expressions
97103
- REST API Interface
@@ -253,6 +259,29 @@ dagu scheduler [--dags=<path to directory>]
253259
dagu version
254260
```
255261

262+
## **Remote Node Management support**
263+
264+
Dagu supports managing multiple Dagu servers from a single UI through its remote node feature. This allows you to:
265+
266+
- Monitor and manage DAGs across different environments (dev, staging, prod)
267+
- Access multiple Dagu instances from a centralized UI
268+
- Switch between nodes easily through the UI dropdown
269+
270+
See [Remote Node Configuration](https://dagu.readthedocs.io/en/latest/config_remote.html) for more details.
271+
272+
### Configuration
273+
274+
Remote nodes can be configured by creating `admin.yaml` in `$HOME/.config/dagu/`:
275+
276+
```yaml
277+
# admin.yaml
278+
remoteNodes:
279+
- name: "prod" # Name of the remote node
280+
apiBaseUrl: "https://prod.example.com/api/v1" # Base URL of the remote node API
281+
- name: "staging"
282+
apiBaseUrl: "https://staging.example.com/api/v1"
283+
```
284+
256285
## **Localized Documentation**
257286

258287
- [中文文档 (Chinese Documentation)](https://dagu.readthedocs.io/zh)
@@ -289,6 +318,7 @@ dagu version
289318
- [JSON Processing](https://dagu.readthedocs.io/en/latest/examples.html#querying-json-data-with-jq)
290319
- [Email](https://dagu.readthedocs.io/en/latest/examples.html#sending-email)
291320
- [Configurations](https://dagu.readthedocs.io/en/latest/config.html)
321+
- [Remote Node](https://dagu.readthedocs.io/en/latest/config_remote.html)
292322
- [Scheduler](https://dagu.readthedocs.io/en/latest/scheduler.html)
293323
- [Docker Compose](https://dagu.readthedocs.io/en/latest/docker-compose.html)
294324
- [REST API Documentation](https://app.swaggerhub.com/apis/YOHAMTA_1/dagu)

docs/source/config_remote.rst

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. _Remote Node Configuration:
2+
3+
Remote Node
4+
===========
5+
6+
.. contents::
7+
:local:
8+
9+
Introduction
10+
-------------
11+
Dagu UI can be configured to connect to remote nodes, allowing management of DAGs across different environments from a single interface.
12+
13+
How to configure
14+
----------------
15+
Create ``admin.yaml`` in ``$HOME/.config/dagu/`` to configure remote nodes. Example configuration:
16+
17+
.. code-block:: yaml
18+
19+
# Remote Node Configuration
20+
remoteNodes:
21+
- name: "dev" # name of the remote node
22+
apiBaseUrl: "http://localhost:8080/api/v1" # Base API URL of the remote node it must end with /api/v1
23+
24+
# Authentication settings for the remote node
25+
# Basic authentication
26+
isBasicAuth: true # Enable basic auth (optional)
27+
basicAuthUsername: "admin" # Basic auth username (optional)
28+
basicAuthPassword: "secret" # Basic auth password (optional)
29+
30+
# api token authentication
31+
isAuthToken: true # Enable API token (optional)
32+
authToken: "your-secret-token" # API token value (optional)
33+
34+
Using Remote Nodes
35+
-----------------
36+
Once configured, remote nodes can be selected from the dropdown menu in the top right corner of the UI. This allows you to:
37+
38+
- Switch between different environments
39+
- View and manage DAGs on remote nodes
40+
- Monitor execution status across nodes
41+
42+
The UI will maintain all functionality while operating on the selected remote node.

docs/source/index.rst

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ Quick Start
4444
:ref:`Configuration Options`
4545
Configuration options.
4646

47+
:ref:`Remote Node Configuration`
48+
Remote Node Configuration.
49+
4750
.. toctree::
4851
:caption: Installation
4952
:hidden:
@@ -75,6 +78,7 @@ Quick Start
7578
:hidden:
7679

7780
config
81+
config_remote
7882
scheduler
7983
auth
8084
email

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/dagu-org/dagu
22

3-
go 1.22.5
3+
go 1.23
44

55
require (
66
github.com/adrg/xdg v0.5.0

internal/config/config.go

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232

3333
// Config represents the configuration for the server.
3434
type Config struct {
35+
RemoteNodes []RemoteNode // Remote node API URLs (e.g., http://localhost:8080/api/v1)
3536
Host string // Server host
3637
Port int // Server port
3738
DAGs string // Location of DAG files
@@ -62,6 +63,18 @@ type Config struct {
6263
MaxDashboardPageLimit int // The default page limit for the dashboard
6364
}
6465

66+
// RemoteNode is the configuration for a remote host that can be proxied by the server.
67+
// This is useful for fetching data from a remote host and displaying it on the server.
68+
type RemoteNode struct {
69+
Name string // Name of the remote host
70+
APIBaseURL string // Base URL for the remote host API (e.g., http://localhost:9090/api/v1)
71+
IsBasicAuth bool // Enable basic auth
72+
BasicAuthUsername string // Basic auth username
73+
BasicAuthPassword string // Basic auth password
74+
IsAuthToken bool // Enable auth token for API
75+
AuthToken string // Auth token for API
76+
}
77+
6578
type TLS struct {
6679
CertFile string
6780
KeyFile string

0 commit comments

Comments
 (0)