Skip to content

Commit 9850d68

Browse files
authored
Merge pull request #52 from geniusdynamics/dynamic
feat: added upgrade guide
2 parents 6af7daf + 50b041f commit 9850d68

File tree

1 file changed

+150
-74
lines changed

1 file changed

+150
-74
lines changed

UPGRADE.md

Lines changed: 150 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,121 @@
1-
# Upgrade to V4
1+
# Upgrade Guide: V3 to V4
22

33
## Overview
44

5-
In the new ns8-erpnext we build docker at runtime where you pass in the apps.json you need to build your app.
5+
The V4 release introduces a runtime Docker image building approach, allowing you to customize your ERPNext installation with custom apps defined via `apps.json` configuration.
66

7-
## Architecture
7+
## What's New in V4
88

9-
The module uses a runtime Docker image building approach where:
9+
- **Runtime Docker Building**: Images are built on-demand based on your `apps.json` configuration
10+
- **Custom App Support**: Add any Frappe/ERPNext compatible apps from Git repositories
11+
- **Podman Integration**: Container management via Podman
12+
- **Flexible Configuration**: JSON-based app management through the Settings UI
1013

11-
- Custom apps are defined via JSON configuration
12-
- Docker images are built on-demand based on the apps.json configuration
13-
- Podman is used for container management
14+
---
1415

15-
## Configuration Settings UI
16+
## Configuration Reference
1617

17-
The Settings page (`ui/src/views/Settings.vue`) provides the following configuration options:
18+
### Settings UI Location
1819

19-
### 1. FQDN (Fully Qualified Domain Name)
20+
Access configuration at: `ui/src/views/Settings.vue`
2021

21-
- **Field**: Host/URL input
22-
- **Purpose**: Set the URL where ERPNext will be accessible
23-
- **Example**: `erpnext.example.org`
24-
- **Validation**: Required field
22+
### Configuration Options
2523

26-
### 2. TLS/SSL Configuration
24+
#### 1. Fully Qualified Domain Name (FQDN)
2725

28-
- **Let's Encrypt**: Toggle to enable automatic SSL certificate generation
29-
- **HTTP to HTTPS Redirect**: Toggle to force HTTPS redirects (enabled by default)
26+
| Field | Details |
27+
|-------|---------|
28+
| **Input Type** | Host/URL |
29+
| **Purpose** | Define the URL where ERPNext will be accessible |
30+
| **Example** | `erpnext.example.org` |
31+
| **Validation** | Required |
3032

31-
### 3. Frappe Version Selection
33+
#### 2. TLS/SSL Configuration
3234

33-
- **Options**:
34-
- `version-15` (default)
35-
- `version-16`
36-
- **Purpose**: Select the Frappe framework version to use
35+
| Option | Description |
36+
|--------|-------------|
37+
| **Let's Encrypt** | Enable automatic SSL certificate generation |
38+
| **HTTP to HTTPS Redirect** | Force HTTPS redirects (enabled by default) |
3739

38-
### 4. App Management
40+
#### 3. Frappe Version Selection
3941

40-
#### Adding Custom Apps
42+
Available versions:
43+
- `version-15` (default)
44+
- `version-16`
4145

42-
Apps can be added via the UI modal with the following fields:
46+
#### 4. App Management
4347

44-
- **App Name** (required): The application identifier
45-
- **Repository URL** (required): Git repository URL for the app
46-
- **Branch**: Git branch to use (defaults to "main")
47-
- **Labels**: Comma-separated labels for the app
48+
##### Adding Custom Apps
4849

49-
#### App Management Features
50+
Apps can be added via the UI modal with these fields:
5051

51-
- **Add App via Form**: Opens a modal to add new apps
52+
| Field | Required | Description |
53+
|-------|----------|-------------|
54+
| **App Name** | Yes | Application identifier |
55+
| **Repository URL** | Yes | Git repository URL |
56+
| **Branch** | No | Git branch (defaults to `main`) |
57+
| **Labels** | No | Comma-separated labels |
58+
59+
##### App Management Features
60+
61+
- **Add App**: Opens modal to add new apps
5262
- **Edit App**: Modify existing app details
53-
- **Remove App**: Delete apps from the configuration
54-
- **Copy JSON**: Copy the current apps.json to clipboard
55-
- **JSON Editor**: Advanced users can directly edit the apps.json in the accordion section
63+
- **Remove App**: Delete apps from configuration
64+
- **Copy JSON**: Copy current `apps.json` to clipboard
65+
- **JSON Editor**: Direct `apps.json` editing (advanced users)
5666

57-
#### Apps Display
67+
##### Apps Display
5868

5969
Apps are displayed in a structured list showing:
60-
6170
- App Name
62-
- URL
71+
- Repository URL
6372
- Branch
6473
- Labels
65-
- Actions (Edit/Remove buttons)
74+
- Actions (Edit/Remove)
75+
76+
#### 5. ERPNext Modules Selection
6677

67-
### 5. ERPNext Modules Selection
78+
- **Component**: Multi-select dropdown
79+
- **Options**: Dynamically populated from `apps.json`
80+
- **Persistence**: Previously selected modules are restored on load
81+
- **Auto-filter**: Modules from removed apps are automatically deselected
6882

69-
- **Multi-select component** showing available modules
70-
- **Dynamic population**: Options are generated from the apps.json configuration
71-
- **Pre-selected values**: Previously selected modules are restored when loading configuration
72-
- **Filtering**: When apps are removed, their modules are automatically deselected
83+
#### 6. Podman Images (Advanced)
7384

74-
### 6. Podman Images (Advanced)
85+
| Feature | Description |
86+
|---------|-------------|
87+
| **View** | List all built images with Repository, Tag, ID, Created, Size |
88+
| **Refresh** | Update the images list |
89+
| **Purpose** | Monitor built Docker images |
7590

76-
- **View**: Lists all built Podman images with details (Repository, Tag, ID, Created, Size)
77-
- **Refresh**: Button to refresh the images list
78-
- **Purpose**: Monitor built Docker images
91+
---
7992

8093
## Data Flow
8194

82-
1. **Configuration Loading** (`getConfiguration`):
83-
- Fetches current configuration from backend
84-
- Decodes base64 appJson
85-
- Restores selected modules
86-
- Populates all form fields
95+
### 1. Configuration Loading (`getConfiguration`)
96+
97+
1. Fetches current configuration from backend
98+
2. Decodes base64-encoded `appJson`
99+
3. Restores selected modules
100+
4. Populates all form fields
101+
102+
### 2. App JSON Processing
103+
104+
1. Stored as base64-encoded string in backend
105+
2. Parsed into structured list for UI display
106+
3. Generates multi-select options
107+
4. Filters selected modules to include only valid apps
87108

88-
2. **App JSON Processing**:
89-
- Stored as base64 encoded string in backend
90-
- Parsed into structured list for display
91-
- Used to generate multi-select options
92-
- Filters selected modules to only include valid apps
109+
### 3. Configuration Saving (`configureModule`)
93110

94-
3. **Configuration Saving** (`configureModule`):
95-
- Validates host field
96-
- Encodes appJson to base64
97-
- Sends all configuration data to backend
98-
- Triggers module reconfiguration
111+
1. Validates host field
112+
2. Encodes `appJson` to base64
113+
3. Sends configuration data to backend
114+
4. Triggers module reconfiguration
99115

100-
## JSON Format
116+
---
117+
118+
## JSON Format Specification
101119

102120
The `app_json` field expects an array of app objects:
103121

@@ -107,22 +125,80 @@ The `app_json` field expects an array of app objects:
107125
"app_name": "my-custom-app",
108126
"url": "https://github.com/user/repo",
109127
"branch": "main",
110-
"labels": "production,custom"
128+
"labels": "production"
111129
}
112130
]
113131
```
114132

133+
### Field Descriptions
134+
135+
| Field | Type | Required | Description |
136+
|-------|------|----------|-------------|
137+
| `app_name` | String | Yes | Unique application identifier |
138+
| `url` | String | Yes | Git repository URL |
139+
| `branch` | String | No | Git branch name (default: `main`) |
140+
| `labels` | String | No | Comma-separated labels |
141+
142+
---
143+
144+
## Upgrade Instructions: V3 to V4
145+
146+
### Pre-Upgrade Checklist
147+
148+
1. **Document Current Apps**: Note all currently installed apps and their versions
149+
2. **Gather Repository Information**: Collect GitHub URLs and installation names for each app
150+
3. **Verify Frappe Version Compatibility**: Ensure apps support your target Frappe version
151+
152+
### Upgrade Steps
153+
154+
1. **Add Your Apps**: Use either the UI form or direct JSON input
155+
156+
Example configuration:
157+
```json
158+
[
159+
{
160+
"app_name": "your-app-name",
161+
"url": "https://github.com/user/repo",
162+
"branch": "main",
163+
"labels": "production"
164+
}
165+
]
166+
```
167+
168+
2. **Select Frappe Version**: Choose either `version-15` or `version-16`
169+
170+
3. **Save Configuration**: Submit the configuration to trigger the build
171+
172+
---
173+
115174
## Important Notes
116175

117-
1. **App Name Consistency**: The multi-select uses `app_name` or `name` field to match selected modules with available options
118-
2. **Base64 Encoding**: The appJson is base64 encoded when sent to the backend
119-
3. **Validation**: Apps must have at least an app_name and URL
120-
4. **Podman Integration**: The module interfaces with Podman for container management
121-
5. **Dynamic Options**: The ERPNext Modules multi-select options are dynamically generated from the apps.json
176+
### App Management
177+
178+
- The multi-select uses `app_name` or `name` field to match selected modules with available options
179+
- `appJson` is base64-encoded when transmitted to the backend
180+
- Apps must have at least `app_name` and `url` defined
181+
- Module options are dynamically generated from `apps.json`
182+
183+
### Version Compatibility
184+
185+
- **Critical**: Install apps with the same Frappe version they require
186+
- Version mismatch will cause build failures even if the image builds successfully
187+
188+
### Data Integrity
189+
190+
- Always validate `apps.json` is valid JSON before saving
191+
- Selected modules are filtered to only include existing apps
192+
- Podman images are specific to configured apps and Frappe version
193+
- Install all previously used apps to avoid data inconsistency issues
194+
195+
---
122196

123-
**NOTE**
197+
## Troubleshooting
124198

125-
- Always ensure apps.json is valid JSON before saving
126-
- Selected modules are filtered to only include apps that exist in the configuration
127-
- Podman images are specific to the configured apps and Frappe version
128-
- Make sure you install the apps that were previously installed to avoid installtion issues
199+
| Issue | Solution |
200+
|-------|----------|
201+
| Build failures | Verify Frappe version compatibility for all apps |
202+
| Missing modules | Check that all previously installed apps are included in `apps.json` |
203+
| Invalid JSON | Validate `apps.json` syntax before saving |
204+
| Image not found | Refresh Podman images list in Advanced settings |

0 commit comments

Comments
 (0)