Update iredadmin-pro.restful.api.html: mention how to enable/disable restful API, and how to restrict API access to specified IP addresses.
This commit is contained in:
parent
6c40ebfc89
commit
ce6026e570
2
TODO.md
2
TODO.md
|
@ -1 +1,3 @@
|
|||
* Don't store translation files in sub-folders, use name
|
||||
`<lang>-<file-name>.html` instead.
|
||||
* How to block attachment with Amavisd
|
||||
|
|
|
@ -19,6 +19,28 @@ iRedAdmin-Pro RESTful API will return message in JSON format.
|
|||
* At least iRedAdmin-Pro-SQL-2.4.0 or iRedAdmin-Pro-LDAP-2.6.0. Earlier releases
|
||||
didn't offer RESTful API.
|
||||
|
||||
## Enable RESTful API
|
||||
|
||||
RESTful API is disabled by default, to enable it, please add setting below in
|
||||
iRedAdmin-Pro config file `settings.py`:
|
||||
|
||||
```
|
||||
ENABLE_RESTFUL_API = True
|
||||
```
|
||||
|
||||
To restrict API access to few IP addresses, please also add settings below in
|
||||
iRedAdmin-Pro config file:
|
||||
|
||||
```
|
||||
# Enable restriction
|
||||
RESTRICT_API_ACCESS = True
|
||||
|
||||
# List all IP addresses of allowed client for API access.
|
||||
RESTFUL_API_CLIENTS = ['172.16.244.1', ...]
|
||||
```
|
||||
|
||||
Restarting Apache or uwsgi (if you're running Nginx) is required.
|
||||
|
||||
## APIs
|
||||
|
||||
Notes:
|
||||
|
|
|
@ -47,7 +47,7 @@ On RHEL/CentOS/Scientific Linux, hostname is set in two files:
|
|||
HOSTNAME=mx.example.com
|
||||
```
|
||||
|
||||
For RHEL/CentOS/Scientific Linux 7, hostname is defined in /etc/hostname.
|
||||
For RHEL/CentOS/Scientific Linux 7, hostname is defined in `/etc/hostname`.
|
||||
|
||||
```
|
||||
mx.example.com
|
||||
|
|
|
@ -75,7 +75,7 @@ mx.example.com
|
|||
<pre><code>HOSTNAME=mx.example.com
|
||||
</code></pre>
|
||||
|
||||
<p>For RHEL/CentOS/Scientific Linux 7, hostname is defined in /etc/hostname.</p>
|
||||
<p>For RHEL/CentOS/Scientific Linux 7, hostname is defined in <code>/etc/hostname</code>.</p>
|
||||
<pre><code>mx.example.com
|
||||
</code></pre>
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<li><a href="#iredadmin-pro-restful-api">iRedAdmin-Pro: RESTful API</a><ul>
|
||||
<li><a href="#summary">Summary</a></li>
|
||||
<li><a href="#requirements">Requirements</a></li>
|
||||
<li><a href="#enable-restful-api">Enable RESTful API</a></li>
|
||||
<li><a href="#apis">APIs</a><ul>
|
||||
<li><a href="#domain">Domain</a></li>
|
||||
<li><a href="#user">User</a></li>
|
||||
|
@ -49,6 +50,22 @@
|
|||
<li>At least iRedAdmin-Pro-SQL-2.4.0 or iRedAdmin-Pro-LDAP-2.6.0. Earlier releases
|
||||
didn't offer RESTful API.</li>
|
||||
</ul>
|
||||
<h2 id="enable-restful-api">Enable RESTful API</h2>
|
||||
<p>RESTful API is disabled by default, to enable it, please add setting below in
|
||||
iRedAdmin-Pro config file <code>settings.py</code>:</p>
|
||||
<pre><code>ENABLE_RESTFUL_API = True
|
||||
</code></pre>
|
||||
|
||||
<p>To restrict API access to few IP addresses, please also add settings below in
|
||||
iRedAdmin-Pro config file:</p>
|
||||
<pre><code># Enable restriction
|
||||
RESTRICT_API_ACCESS = True
|
||||
|
||||
# List all IP addresses of allowed client for API access.
|
||||
RESTFUL_API_CLIENTS = ['172.16.244.1', ...]
|
||||
</code></pre>
|
||||
|
||||
<p>Restarting Apache or uwsgi (if you're running Nginx) is required.</p>
|
||||
<h2 id="apis">APIs</h2>
|
||||
<p>Notes:</p>
|
||||
<ul>
|
||||
|
|
Loading…
Reference in New Issue