Skip to content
Snippets Groups Projects
Unverified Commit 79e1b977 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Differentiate ETHERPAD_URL and ETHERPAD_API_URL

parent 74df4611
Branches
No related tags found
No related merge requests found
......@@ -378,7 +378,7 @@ def check_printing(PRINTING_SERVER, PRINTING_USER, PRINTING_PRINTERS):
printer, value, name, available_options[name]))
def check_etherpad(ETHERPAD_URL, ETHERPAD_APIKEY, EMPTY_ETHERPAD):
def check_etherpad(ETHERPAD_URL, ETHERPAD_API_URL, ETHERPAD_APIKEY, EMPTY_ETHERPAD):
import requests
try:
answer = requests.get(ETHERPAD_URL)
......@@ -824,6 +824,12 @@ CONFIG_SECTIONS = [
description=(
"URL of the etherpad installation. "
"Do not include the '/p'!")),
ConfigEntry(
name="ETHERPAD_API_URL",
default="https://example.com/etherpad/api",
required=False, internal=True, no_sane_default=True,
description=("URL of the etherpad API. "
"Usually ETHERPAD_URL + /api")),
ConfigEntry(
name="ETHERPAD_APIKEY",
default="abc123",
......
......@@ -139,8 +139,12 @@ def get_etherpad_url(pad):
def get_etherpad_api_url():
try:
return config.ETHERPAD_API_URL
except AttributeError:
return "{}/api".format(config.ETHERPAD_URL)
def get_etherpad_api_client():
return EtherpadClient(base_url=get_etherpad_api_url(), api_version="1.2.14", base_params=dict(apikey=config.ETHERPAD_APIKEY))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment