Skip to content

Commit 75a5bb9

Browse files
committed
text improvements
1 parent 1e30dde commit 75a5bb9

File tree

3 files changed

+6
-209
lines changed

3 files changed

+6
-209
lines changed

intro/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Listed below are all the changes to the SeaTable API. Each date corresponds to a
2222
>
2323
> You can get more information from this [blog article](https://seatable.com/api-gateway-version-5-3/).
2424
25-
No further changes were made to the API documentation.
25+
No further changes were made to the API documentation with v5.3.
2626

2727
## Version 5.2 (25.02.2025)
2828

intro/limits.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ Meaning that if you reach the rate limit for one base, you still could make requ
2424
>
2525
> Currently, the same limits apply to all SeaTable Cloud customers. In the future, SeaTable might adjust the rate limits to balance for demand and reliability. SeaTable may also introduce distinct rate limits for teams with different pricing plans.
2626
27-
> ❗ Important Update: API Endpoint Changes
28-
>
29-
> In version 5.2, the `/dtable-server` and `/dtable-db` endpoints will be deprecated and then removed in version 5.3. All functions will be transitioned to `/api-gateway` endpoints. Please update your custom integrations and scripts accordingly to ensure continued functionality. More information will be provided with the release notes of SeaTable version 5.2.
30-
3127
### Retrieve current rate limit usage
3228

33-
The new `/api-gateway` endpoints return the current API rate limit usage through `x-ratelimit` headers. These headers provide the minute limit, the current usage, and the next reset time as a Unix timestamp in seconds. Below is an example of the returned headers:
29+
The `/api-gateway` endpoints return the current API rate limit usage through `x-ratelimit` headers. These headers provide the minute limit, the current usage, and the next reset time as a Unix timestamp in seconds. Below is an example of the returned headers:
3430

3531
```
3632
x-ratelimit-limit: 500

intro/requirement-self-hosted.md

Lines changed: 4 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -37,184 +37,13 @@ After the first login you can start right away to start with your first API requ
3737

3838
## Try It! with SeaTable Server
3939

40-
If you are running your own [SeaTable server](https://seatable.com/on-premises/), you will need to change your nginx configuration so that the **Try It!** function works with your server and that you can easily copy and paste the generated API requests without authorization errors. Please replace your existing nginx configuration at `/opt/seatable/seatable-data/seatable/conf/nginx.conf` with the following setup.
40+
If you are running your own [SeaTable server](https://seatable.com/on-premises/), the **Try It!** feature works seamlessly with your server, allowing you to easily copy and paste the generated API requests without encountering authorization errors.
4141

42-
Of course you have to replace `{your.seatable.server}` with the public URL of your server and then reload the updated nginx configuration inside the SeaTable docker container with `nginx -s reload`. For more details about this command and the SeaTable docker container, check the [admin manual](https://admin.seatable.com).
42+
### Technical background: Enable CORS to allow requests from api.seatable.com
4343

44-
```bash nginx configuration (4.0 and newer)
45-
log_format seatableformat '\$http_x_forwarded_for \$remote_addr [\$time_local] "\$request" \$status \$body_bytes_sent "\$http_referer" "\$http_user_agent" \$upstream_response_time';
44+
This section is for those interested in the technical details behind why api.seatable.com can send requests to your SeaTable server. To enable this functionality, CORS (Cross-Origin Resource Sharing) must be configured to allow requests from api.seatable.com.
4645

47-
upstream dtable_servers {
48-
server 127.0.0.1:5000;
49-
keepalive 15;
50-
}
51-
52-
server {
53-
listen 80;
54-
server_name {your.seatable.server};
55-
56-
# CORS seetings to allow API from readme.com
57-
proxy_hide_header 'Access-Control-Allow-Origin';
58-
add_header 'Access-Control-Allow-Origin' '*' always;
59-
add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS' always;
60-
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept, authorization, token, deviceType, x-seafile-otp' always;
61-
if ($request_method = 'OPTIONS') {
62-
return 204;
63-
}
64-
65-
location / {
66-
proxy_pass http://127.0.0.1:8000;
67-
proxy_set_header Host $host;
68-
proxy_set_header X-Real-IP $remote_addr;
69-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
70-
proxy_set_header X-Forwarded-Host $server_name;
71-
proxy_read_timeout 1200s;
72-
client_max_body_size 0;
73-
access_log /opt/nginx-logs/dtable-web.access.log seatableformat;
74-
error_log /opt/nginx-logs/dtable-web.error.log;
75-
}
76-
...
77-
}
78-
```
79-
80-
```bash nginx configuration (before 4.0)
81-
# rewrite "bearer token" to "Token token"
82-
map "$http_authorization" $authorization {
83-
~*^Bearer(\s*)(?<token>(.*))$ "Token $token";
84-
default $http_authorization;
85-
}
86-
87-
log_format seatableformat '\$http_x_forwarded_for \$remote_addr [\$time_local] "\$request" \$status \$body_bytes_sent "\$http_referer" "\$http_user_agent" \$upstream_response_time';
88-
89-
upstream dtable_servers {
90-
server 127.0.0.1:5000;
91-
keepalive 15;
92-
}
93-
94-
server {
95-
listen 80;
96-
server_name {your.seatable.server};
97-
98-
# rewrite to https
99-
location / {
100-
rewrite ^ https://$http_host$request_uri? permanent;
101-
}
102-
# for letsencrypt
103-
location ^~ /.well-known/acme-challenge/ {
104-
alias /var/www/challenges/;
105-
try_files $uri =404;
106-
}
107-
}
108-
109-
server {
110-
server_name {your.seatable.server};
111-
listen 443 ssl;
112-
ssl_certificate /opt/ssl/{your.seatable.server}.crt;
113-
ssl_certificate_key /opt/ssl/{your.seatable.server}.key;
114-
115-
# SSL Hardening
116-
ssl_protocols TLSv1.2 TLSv1.3;
117-
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
118-
ssl_prefer_server_ciphers on;
119-
ssl_ecdh_curve secp384r1;
120-
121-
ssl_session_timeout 10m;
122-
ssl_session_cache shared:SSL:10m;
123-
ssl_session_tickets off;
124-
125-
# general proxy_settings
126-
proxy_set_header X-Forwarded-For $remote_addr;
127-
128-
# CORS seetings to allow API from readme.com
129-
proxy_hide_header 'Access-Control-Allow-Origin';
130-
add_header 'Access-Control-Allow-Origin' '*' always;
131-
add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS' always;
132-
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept, authorization, token, deviceType, x-seafile-otp' always;
133-
if ($request_method = 'OPTIONS') {
134-
return 204;
135-
}
136-
137-
location / {
138-
proxy_set_header Authorization $authorization;
139-
proxy_pass http://127.0.0.1:8000;
140-
proxy_set_header Host $host;
141-
proxy_set_header X-Real-IP $remote_addr;
142-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
143-
proxy_set_header X-Forwarded-Host $server_name;
144-
proxy_read_timeout 1200s;
145-
client_max_body_size 0;
146-
access_log /opt/nginx-logs/dtable-web.access.log seatableformat;
147-
error_log /opt/nginx-logs/dtable-web.error.log;
148-
}
149-
150-
location /seafhttp {
151-
proxy_set_header Authorization $authorization;
152-
rewrite ^/seafhttp(.*)$ $1 break;
153-
proxy_pass http://127.0.0.1:8082;
154-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
155-
proxy_request_buffering off;
156-
proxy_connect_timeout 36000s;
157-
proxy_read_timeout 36000s;
158-
proxy_send_timeout 36000s;
159-
send_timeout 36000s;
160-
client_max_body_size 0;
161-
access_log /opt/nginx-logs/seafhttp.access.log seatableformat;
162-
error_log /opt/nginx-logs/seafhttp.error.log;
163-
}
164-
165-
location /media {
166-
root /opt/seatable/seatable-server-latest/dtable-web;
167-
}
168-
169-
location /socket.io {
170-
proxy_pass http://dtable_servers;
171-
proxy_http_version 1.1;
172-
proxy_set_header Upgrade $http_upgrade;
173-
proxy_set_header Connection 'upgrade';
174-
proxy_redirect off;
175-
proxy_buffers 8 32k;
176-
proxy_buffer_size 64k;
177-
proxy_set_header X-Real-IP $remote_addr;
178-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
179-
proxy_set_header Host $http_host;
180-
proxy_set_header X-NginX-Proxy true;
181-
access_log /opt/nginx-logs/socket-io.access.log seatableformat;
182-
error_log /opt/nginx-logs/socket-io.error.log;
183-
}
184-
185-
location /dtable-server {
186-
proxy_set_header Authorization $authorization;
187-
rewrite ^/dtable-server/(.*)$ /$1 break;
188-
proxy_pass http://dtable_servers;
189-
proxy_redirect off;
190-
proxy_set_header Host $host;
191-
proxy_set_header X-Real-IP $remote_addr;
192-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
193-
proxy_set_header X-Forwarded-Host $server_name;
194-
proxy_set_header X-Forwarded-Proto $scheme;
195-
client_max_body_size 50m;
196-
access_log /opt/nginx-logs/dtable-server.access.log seatableformat;
197-
error_log /opt/nginx-logs/dtable-server.error.log;
198-
}
199-
200-
location /dtable-db/ {
201-
proxy_set_header Authorization $authorization;
202-
proxy_pass http://127.0.0.1:7777/;
203-
proxy_redirect off;
204-
proxy_set_header Host $host;
205-
proxy_set_header X-Real-IP $remote_addr;
206-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
207-
proxy_set_header X-Forwarded-Host $server_name;
208-
proxy_set_header X-Forwarded-Proto $scheme;
209-
access_log /opt/nginx-logs/dtable-db.access.log seatableformat;
210-
error_log /opt/nginx-logs/dtable-db.error.log;
211-
}
212-
}
213-
```
214-
215-
### Enable CORS to allow requests from api.seatable.com
216-
217-
CORS is the abbreviation for [Cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), which is a security mechanism to prevent request from another domain to your server. If you don't allow CORS request for api.seatable.com, the **Try It!** button will not work. After the click you will see a rotating circle on the button and error messages in your browser console.
46+
`CORS` is the abbreviation for [Cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), which is a security mechanism to prevent request from another domain to your server. If you don't allow CORS request for api.seatable.com, the **Try It!** button will not work. After the click you will see a rotating circle on the button and error messages in your browser console.
21847

21948
![Try It! with CORS error](https://seatable.com/openapi/readme-com-cors-access-control.png)
22049

@@ -235,31 +64,3 @@ if ($request_method = 'OPTIONS') {
23564
>
23665
> A common error with `add_header` is that these values are not inherited. I.e. in the `location ...` blocks no `add_header` may occur, because otherwise the previously set headers are not taken over.
23766
238-
## Rewrite of the authorization header (only necessary for SeaTable <4.0)
239-
240-
Before Version 4.0 SeaTable uses an authorization header that does not comply with the OpenAPI standard. This API reference generates API requests with an authorization header like `authorization: Bearer xxx` but SeaTable requires headers like `authorization: Token xxx`. The following part of the nginx configuration rewrites the header. With Version 4.0 SeaTable will also accept [Bearer Authentication](https://swagger.io/docs/specification/authentication/bearer-authentication/) and this part is not necessary any more.
241-
242-
```
243-
map "$http_authorization" $authorization {
244-
~*^Bearer(\s*)(?<token>(.*))$ "Token $token";
245-
default $http_authorization;
246-
}
247-
location / {
248-
proxy_set_header Authorization $authorization;
249-
...
250-
}
251-
location /seafhttp {
252-
proxy_set_header Authorization $authorization;
253-
...
254-
}
255-
location /dtable-server {
256-
proxy_set_header Authorization $authorization;
257-
...
258-
}
259-
location /dtable-db/ {
260-
proxy_set_header Authorization $authorization;
261-
...
262-
}
263-
```
264-
265-
###

0 commit comments

Comments
 (0)