Skip to content

Commit addd3dd

Browse files
committed
Add UptimeRobot status page integration configuration and documentation
Adds configuration properties for the UptimeRobot status page integration that automatically displays service status banners in the frontend. Changes: - Add uptime_robot_status_page_url and uptime_robot_api_key properties to application.properties.EXAMPLE - Create comprehensive UptimeRobot-Integration.md documentation - Update application.properties-Reference.md with UptimeRobot section Configuration: Both properties are required to enable the integration: - uptime_robot_status_page_url: URL of the UptimeRobot status page - uptime_robot_api_key: API key for the event feed endpoint Documentation covers: - Setup and configuration instructions - How to obtain API key from UptimeRobot - Event filtering and display logic - Banner styling based on severity - Troubleshooting common issues - Security considerations - Architecture overview Related frontend PR: cBioPortal/cbioportal-frontend#5282
1 parent a947c3b commit addd3dd

3 files changed

Lines changed: 231 additions & 0 deletions

File tree

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# UptimeRobot Status Page Integration
2+
3+
## Overview
4+
5+
The UptimeRobot integration automatically displays service status banners at the top of your cBioPortal instance when incidents, maintenance, or other events are detected from your UptimeRobot status page.
6+
7+
## Features
8+
9+
- **Automatic Event Detection**: Fetches active events from UptimeRobot's event feed API
10+
- **Smart Filtering**: Only displays ongoing events (status = 2) within their time window
11+
- **Severity-Based Styling**: Banner colors adapt based on event severity
12+
- **Status Page Link**: Each banner includes a link to the full status page
13+
- **User Control**: Users can dismiss banners (dismissed state stored in browser localStorage)
14+
- **Priority Display**: Status events appear before static portal messages
15+
16+
## Configuration
17+
18+
### Requirements
19+
20+
Both configuration properties must be set to enable the integration:
21+
22+
```properties
23+
uptime_robot_status_page_url=https://status.cbioportal.org
24+
uptime_robot_api_key=YOUR_API_KEY_HERE
25+
```
26+
27+
Add these to your `application.properties` file.
28+
29+
### Getting Your UptimeRobot API Key
30+
31+
1. Log in to your [UptimeRobot account](https://uptimerobot.com/)
32+
2. Navigate to "Status Pages"
33+
3. Open your status page settings
34+
4. Look for the "Event Feed" or "API" section
35+
5. Copy the API key (e.g., `RlrzpsmAn`)
36+
6. Note your status page URL (e.g., `https://status.cbioportal.org`)
37+
38+
### Testing the Configuration
39+
40+
You can test your API endpoint manually:
41+
42+
```bash
43+
curl https://status.cbioportal.org/api/getEventFeed/YOUR_API_KEY
44+
```
45+
46+
You should receive a JSON response containing event data.
47+
48+
## How It Works
49+
50+
### Event Fetching
51+
52+
When a user loads the portal, the frontend automatically fetches events from:
53+
54+
```
55+
{status_page_url}/api/getEventFeed/{api_key}
56+
```
57+
58+
### Event Filtering
59+
60+
Only events matching ALL of the following criteria are displayed:
61+
62+
1. **Active Status**: `event.status === 2` (ongoing event)
63+
2. **Started**: Current time >= event start time
64+
3. **Not Ended**: Current time < event end time (if specified)
65+
66+
### Banner Display
67+
68+
Banners appear at the very top of the page with:
69+
- **Event title** in bold
70+
- **Event description** (if available)
71+
- **"View status page"** link to the full status page
72+
- **Close button** (×) to dismiss
73+
74+
### Banner Colors
75+
76+
Banner background colors are determined by the event's severity icon:
77+
78+
| Icon Type | Color | Use Case |
79+
|-----------|-------|----------|
80+
| `alert-triangle`, `alert-octagon` | Red (#d9534f) | Critical incidents, outages |
81+
| `alert-circle` | Orange (#f0ad4e) | Warnings, degraded performance |
82+
| `info` | Blue (#5bc0de) | Informational notices |
83+
| `check-circle` | Green (#5cb85c) | Resolved issues, all clear |
84+
| (default) | Orange (#f0ad4e) | Unspecified severity |
85+
86+
## Example Event
87+
88+
An UptimeRobot event like this:
89+
90+
```json
91+
{
92+
"type": "announcement",
93+
"id": 34971,
94+
"title": "AWS Downtime",
95+
"description": "Various services are affected due to AWS downtime",
96+
"status": 2,
97+
"icon": "alert-triangle",
98+
"timestamp": 1760958000,
99+
"endDateGMT": "Oct 21, 2025 11:00"
100+
}
101+
```
102+
103+
Will be displayed as a red banner:
104+
105+
```
106+
┌─────────────────────────────────────────────────────────────┐
107+
│ AWS Downtime: Various services are affected due to AWS │
108+
│ downtime View status page [×] │
109+
└─────────────────────────────────────────────────────────────┘
110+
```
111+
112+
## User Experience
113+
114+
### Banner Dismissal
115+
116+
Users can dismiss banners by clicking the × button. Dismissal is tracked per-event using browser localStorage with the key format:
117+
118+
```
119+
portalMessageKey-uptime-robot-{event.id}
120+
```
121+
122+
Once dismissed, the banner won't reappear unless:
123+
- The user clears their browser localStorage
124+
- A new event with a different ID is created
125+
126+
### Multiple Providers
127+
128+
The integration uses a provider pattern that allows for easy addition of other status page services (e.g., StatusPage.io, Atlassian Status). Status provider messages take priority over static portal announcements.
129+
130+
## Troubleshooting
131+
132+
### Banners Not Appearing
133+
134+
1. **Verify Configuration**:
135+
- Check both `uptime_robot_status_page_url` and `uptime_robot_api_key` are set
136+
- Ensure there are no trailing slashes in the URL
137+
- Confirm the API key is correct
138+
139+
2. **Check Browser Console**:
140+
- Look for network errors fetching the event feed
141+
- Check for CORS issues (status page must allow your domain)
142+
- Verify JavaScript console for error messages
143+
144+
3. **Verify Event Status**:
145+
- Events must have `status: 2` (active)
146+
- Event must be within its time window
147+
- Check if event was previously dismissed (clear localStorage to test)
148+
149+
### CORS Issues
150+
151+
If you see CORS (Cross-Origin Resource Sharing) errors in the browser console:
152+
153+
- **Option 1**: Configure CORS headers on your UptimeRobot status page (if supported)
154+
- **Option 2**: Add a proxy endpoint in your cBioPortal backend to fetch events server-side
155+
156+
### Debugging
157+
158+
Enable browser console logging to see:
159+
- Network requests to the UptimeRobot API
160+
- Fetched event data
161+
- Filter results (which events are active)
162+
- Any error messages
163+
164+
## Security Considerations
165+
166+
- The API key is exposed to the frontend and included in browser requests
167+
- Use UptimeRobot's public status page API key (not your account API key)
168+
- The API key only allows reading public event data
169+
- No sensitive portal data is sent to UptimeRobot
170+
171+
## Architecture
172+
173+
The integration is implemented using a provider pattern for extensibility:
174+
175+
```
176+
Frontend (React):
177+
src/shared/lib/statusProviders/
178+
├── IStatusProvider.ts (interface)
179+
├── UptimeRobotStatusProvider.tsx (implementation)
180+
├── uptimeRobot.ts (API functions)
181+
└── index.ts (provider registry)
182+
```
183+
184+
This architecture makes it easy to add additional status page integrations without modifying core application code.
185+
186+
## Disabling the Integration
187+
188+
To disable the integration, simply remove or comment out both configuration properties:
189+
190+
```properties
191+
# uptime_robot_status_page_url=https://status.cbioportal.org
192+
# uptime_robot_api_key=YOUR_API_KEY_HERE
193+
```
194+
195+
The integration will automatically disable if either property is missing.
196+
197+
## Further Information
198+
199+
- [UptimeRobot Documentation](https://uptimerobot.com/api/)
200+
- [UptimeRobot Status Pages](https://uptimerobot.com/statusPages)
201+
- [cBioPortal Customization Guide](./Customizing-your-instance-of-cBioPortal.md)

docs/deployment/customization/application.properties-Reference.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,3 +821,27 @@ Custom Buttons can be defined which will conditionally appear in all group compa
821821
```
822822
download_custom_buttons_json=classpath:custom_buttons/download_custom_button_avm.json
823823
```
824+
825+
## UptimeRobot Status Page Integration
826+
827+
Display automatic service status banners when incidents or maintenance are detected from UptimeRobot.
828+
829+
### Properties
830+
831+
```properties
832+
uptime_robot_status_page_url=https://status.cbioportal.org
833+
uptime_robot_api_key=RlrzpsmAn
834+
```
835+
836+
Both properties are required to enable the integration. When configured, the portal will automatically fetch and display active events as banners at the top of the page.
837+
838+
### Features
839+
840+
- Automatically fetches events from UptimeRobot event feed API
841+
- Only displays active/ongoing events (status = 2) within their time window
842+
- Banner color adapts based on event severity (red/orange/blue/green)
843+
- Includes link to full status page for more details
844+
- Users can dismiss banners (stored in browser localStorage)
845+
- Status provider messages have priority over static portal messages
846+
847+
See [UptimeRobot Integration](./UptimeRobot-Integration.md) for detailed setup instructions and troubleshooting.

src/main/resources/application.properties.EXAMPLE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ skin.study_view.link_text=To build your own case set, try out our enhanced Study
136136
## setting controlling whether Download tabs and download/copy-to-clipboard controls should be shown
137137
# skin.hide_download_controls=false
138138

139+
## UptimeRobot Status Page Integration
140+
## Automatically displays service status banners for ongoing events from UptimeRobot
141+
## Both properties are required to enable the integration
142+
# uptime_robot_status_page_url=https://status.cbioportal.org
143+
# uptime_robot_api_key=YOUR_API_KEY_HERE
144+
139145
## enable and set this property to specify a study group to be used to identify public studies for which no specific authorization entries are needed in the `authorities` table
140146
# always_show_study_group=
141147

0 commit comments

Comments
 (0)