Skip to content

Commit 3056ff5

Browse files
committed
updated maps configuration
1 parent a83d785 commit 3056ff5

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
lines changed
68.9 KB
Loading
50.5 KB
Loading
55.5 KB
Loading

docs/configuration/plugins.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@ Typically, plugins do not necessitate additional configuration. However, there a
5050

5151
### Map Plugin
5252

53-
The Map plugin exclusively supports the Google Maps Platform. To enable access to Google Maps data, two <a href="https://developers.google.com/maps/documentation/javascript/get-api-key?hl=en">Google API Keys</a> are required.
53+
The Map plugin works exclusively with the Google Maps Platform. To enable it, you need two <a href="https://developers.google.com/maps/documentation/javascript/get-api-key?hl=en">Google API keys</a>, each with different permissions:
5454

55-
![Create Google Maps API key](../assets/images/google-maps-api.png)
55+
- Geocoding API
56+
- Maps Javascript API
5657

57-
Generate two API keys and append the following lines to the configuration file `dtable_web_settings.py`.
58+
Using two separate keys is recommended for security and cost control. While technically the same key could be used for both, separating them ensures that your Geocoding API key (which is expensive) is not exposed to end users.
5859

5960
```bash
60-
DTABLE_GOOGLE_MAP_KEY = '<replace with your Google Maps API Key>'
61-
SERVER_GOOGLE_MAP_KEY = '<replace with your Google Maps API Key>'
61+
DTABLE_GOOGLE_MAP_KEY = '<your Maps JavaScript API key here>'
62+
SERVER_GOOGLE_MAP_KEY = '<your Geocoding API key here>'
6263
```
6364

64-
!!! warning "Required scope of the API keys"
65+
![Create two API keys for Google Maps](../assets/images/maps-requires-two-google-keys.png)
66+
67+
!!! danger "Required scope of the API keys"
6568

6669
To safeguard your Google API Keys from abuse, restrict their usage. However, even with restrictions in place, abuse remains a risk—especially since `DTABLE_GOOGLE_MAP_KEY` must be included in your source code and is therefore publicly accessible. Additionally, heavy use of the maps plugin may increase your Google billing, so monitor your spending closely.
6770

@@ -70,9 +73,25 @@ SERVER_GOOGLE_MAP_KEY = '<replace with your Google Maps API Key>'
7073
| `DTABLE_GOOGLE_MAP_KEY` | Restrict to your Server URL,<br>like `https://cloud.seatable.io` | Maps Javascript API |
7174
| `SERVER_GOOGLE_MAP_KEY` | **No website restriction** | Geocoding API |
7275

73-
Remember to [restart the SeaTable Service](../maintenance/restart-seatable.md) to apply the changes from the updated configuration file.
7476

75-
![The required API key permissions](../assets/images/maps-plugin-api-keys.png)
77+
#### `SERVER_GOOGLE_MAP_KEY`
78+
79+
- Used for **server-side requests** (Geocoding API).
80+
- **Do not** restrict it to a website (since requests originate from the server).
81+
- Restrict it instead by **API usage** → only allow the *Geocoding API*.
82+
83+
![Permissions for SERVER_GOOGLE_MAP_KEY](../assets/images/maps-server-key.png)
84+
85+
#### `DTABLE_GOOGLE_MAP_KEY`
86+
87+
- Used for **client-side requests** (Maps JavaScript API).
88+
- This key must be embedded in the frontend and will therefore be **publicly visible**.
89+
- Restrict it to your **SeaTable server’s domain** (HTTP referrers).
90+
- Allow usage only for the *Maps JavaScript API*.
91+
92+
![Permissions for DTABLE_GOOGLE_MAP_KEY](../assets/images/maps-dtable-key.png)
93+
94+
Remember to [restart the SeaTable Service](../maintenance/restart-seatable.md) to apply the changes from the updated configuration file.
7695

7796
### Whiteboard Plugin
7897

docs/upgrade/extra-upgrade-notice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Of course, you can skip this script and make the changes manually. The following
139139

140140
??? info "Maps Plugin utilizes two API Keys"
141141

142-
The Google Maps Plugin now uses two separate Google API keys instead of one. Please refer to the [documentation for further details](../configuration/plugins.md).
142+
The Google Maps Plugin now uses two separate Google API keys instead of one. Please refer to the [documentation for further details](../configuration/plugins.md#map-plugin).
143143

144144
## 5.2
145145

0 commit comments

Comments
 (0)