This commit is contained in:
Bill Burke 2016-05-04 11:10:24 -04:00
commit c590d9ad49
4 changed files with 241 additions and 0 deletions

10
README.adoc Executable file
View file

@ -0,0 +1,10 @@
{{book.project.name}} Server Installation and Configuration Guide
======================
image:images/keycloak_logo.png[alt="Keycloak"]
*{{book.project.name}}* _Documentation_ for {{book.project.version}}
http://www.keycloak.org

49
SUMMARY.adoc Executable file
View file

@ -0,0 +1,49 @@
= {{book.title}}
. link:topics/overview.adoc[Overview]
.. link:topics/overview/recommended-reading.adoc[Recommended Reading]
. link:topics/installation.adoc[Installation]
.. link:topics/installation/system-requirements.adoc[System Requirements]
{% if book.community %}
.. link:topics/installation/distribution-files-community.adoc[Installing Distribution Files]
{% endif %}
{% if book.product %}
.. link:topics/installation/distribution-files-product.adoc[Installing Distribution Files]
{% endif %}
.. link:topics/installation/directory-structure.adoc[Distribution Directory Structure]
. link:topics/operating-mode.adoc[Choosing an Operating Mode]
.. link:topics/operating-mode/standalone.adoc[Standalone Mode]
.. link:topics/operating-mode/standalone-ha.adoc[Standalone Clustered Mode]
.. link:topics/operating-mode/domain.adoc[Domain Clustered Mode]
. link:topics/manage.adoc[Managing Config at Runtime]
. link:topics/database.adoc[Relational Database Setup]
.. link:topics/database/checklist.adoc[Setup Checklist]
.. link:topics/database/jdbc.adoc[JDBC Setup]
.. link:topics/database/datasource.adoc[Datasource Setup]
.. link:topics/database/hibernate.adoc[Hibernate Configuration]
{% if book.community %}
. link:topics/mongo.adoc[Mongo DB Setup]
{% endif %}
. link:topics/network.adoc[Network Setup]
.. link:topics/network/bind-address.adoc[Bind Addresses]
.. link:topics/network/ports.adoc[Socket Port Bindings]
.. link:topics/network/https.adoc[HTTPS/SSL Setup]
.. link:topics/network/outgoing.adoc[Outgoing HTTP Requests]
. link:topics/clustering.adoc[Clustering]
.. link:topics/clustering/recommended.adoc[Recommended Network Architecture]
.. link:topics/clustering/example.adoc[Cluster Example]
.. link:topics/clustering/load-balancer.adoc[Setting Up a Load Balancer]
.. link:topics/clustering/multicast.adoc[Multicast Network Setup]
.. link:topics/clustering/serialized.adoc[Serialized Cluster Startup]
.. link:topics/clustering/booting.adoc[Booting the Cluster]
.. link:topics/clustering/troubleshooting.adoc[Trouble Shooting]
. link:topics/cache.adoc[Server Cache Configuration]
.. link:topics/cache/eviction.adoc[Eviction Policy and Max Entries]
.. link:topics/cache/replication.adoc[Replication and Failover]
.. link:topics/cache/disable.adoc[Disabling Caching]
.. link:topics/cache/clear.adoc[Clearing Caches at Runtime]
{% if book.community %}
. link:topics/proxy.adoc[Keycloak Security Proxy]
{% endif %}

76
book.json Executable file
View file

@ -0,0 +1,76 @@
{
"gitbook": "2.x.x",
"structure": {
"readme": "README.adoc"
},
"plugins": [
"toggle-chapters",
"ungrey",
"splitter"
],
"variables": {
"title": "Keycloak Installation and Configuration Guide",
"community": true,
"product": false,
"images": "keycloak-images",
"appserver": {
"name": "Wildfly",
"version": "10",
"admindoc": {
"name": "JBoss EAP Administration and Configuration Guide",
"link": "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/"
},
"datasource": {
"name": "JBoss EAP Administration and Configuration Guide",
"link": "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/chap-Datasource_Management.html"
},
"network": {
"name": "JBoss EAP Administration and Configuration Guide",
"link": "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/chap-Network_and_Port_Configuration.html#Configure_interfaces"
},
"socket": {
"name": "JBoss EAP Administration and Configuration Guide",
"link": "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Socket_Binding_Groups.html"
},
"loadbalancer": {
"name": "JBoss EAP Administration and Configuration Guide",
"link": "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Web_HTTP_Connectors_and_HTTP_Clustering.html"
},
"jgroups": {
"name": "JBoss EAP Administration and Configuration Guide",
"link": "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-JGroups.html"
}
},
"caching": {
"name": "JBoss Data Grid",
"version": "???",
"admindoc": {
"name": "JBoss Data Grid Administration and Configuration Guide",
"link": "https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Data_Grid/6.6/html/Administration_and_Configuration_Guide/index.html",
"eviction": "https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Data_Grid/7.0/html/Administration_and_Configuration_Guide/sect-Eviction_Strategies.html"
}
},
"jpa": {
"name": "Hibernate",
"version": "???",
"admindoc": {
"name": "JBoss Development Guide",
"link": "https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Development_Guide/sect-Java_Persistence_API_JPA.html#sect-Configuration2"
}
},
"developerguide": {
"name": "Keycloak Server Developer Guide",
"link": "https://keycloak.gitbooks.io/server-developer-guide/content/"
},
"adminguide": {
"name": "Keycloak Adminstration Guide",
"link": "https://keycloak.gitbooks.io/server-adminstration-guide/content/"
},
"project": {
"name": "Keycloak",
"version": "1.9.3.Final-SNAPSHOT"
}
}
}

106
gitlab-conversion.py Executable file
View file

@ -0,0 +1,106 @@
import sys, os, re, json, shutil, errno
def transform(root, f, targetdir):
full = os.path.join(root, f)
input = open(full, 'r').read()
dir = os.path.join(targetdir, root)
if not os.path.exists(dir):
os.makedirs(dir)
output = open(os.path.join(dir, f), 'w')
input = applyTransformation(input)
output.write(input)
def applyTransformation(input):
for variable in re.findall(r"\{\{(.*?)\}\}", input):
tmp = variable.replace('.', '_')
input = input.replace(variable, tmp)
input = input.replace('{{', '{').replace('}}', '}')
input = re.sub(r"<<fake.+#", "<<", input)
for variable in re.findall(r"[ ]*{% if (.*?) %}", input):
tmp = variable.replace('.', '_')
input = input.replace(variable, tmp)
exp = re.compile("[ ]*{% if (.*?) %}(.*?)[ ]*{% endif %}", re.DOTALL)
input = re.sub(exp, "ifeval::[{\g<1>}==true]\g<2>endif::[]", input)
input = re.sub(r"image:(\.\./)*", "image:", input)
return input
indir = 'topics'
targetdir = 'target'
if len(sys.argv) > 1:
targetdir = sys.argv[1]
shutil.rmtree(os.path.join(targetdir, 'images'))
shutil.rmtree(os.path.join(targetdir, 'keycloak-images'))
shutil.rmtree(os.path.join(targetdir, 'rhsso-images'))
shutil.copytree('images',os.path.join(targetdir, 'images'))
shutil.copytree('keycloak-images',os.path.join(targetdir, 'keycloak-images'))
shutil.copytree('rhsso-images',os.path.join(targetdir, 'rhsso-images'))
tmp = os.path.join(targetdir, 'topics')
if not os.path.exists(tmp):
os.makedirs(tmp)
# transform files
for root, dirs, filenames in os.walk(indir):
for f in filenames:
transform(root,f,targetdir)
# Create master.doc includes
input = open('SUMMARY.adoc', 'r').read()
output = open(os.path.join(targetdir, 'master.adoc'), 'w')
output.write("""
:toc:
:toclevels: 3
:numbered:
include::document-attributes.adoc[]
""")
input = re.sub(r"[ ]*\.+\s*link:(.*)\[(.*)\]", "include::\g<1>[]", input)
input = applyTransformation(input)
output.write(input)
# parse book.json file and create document attributes
with open('book.json') as data_file:
data = json.load(data_file)
variables = data['variables']
def makeAttributes(variables, variable, list):
for i in variables.keys():
if variable is None:
tmp = i
else:
tmp = variable + '_' + i
if isinstance(variables[i],dict):
makeAttributes(variables[i], tmp, list)
elif isinstance(variables[i],bool):
boolval = 'false'
if variables[i]:
boolval = 'true'
list.append({tmp: boolval})
else:
list.append({tmp: str(variables[i])})
attributeList = []
makeAttributes(variables, None, attributeList)
output = open(os.path.join(targetdir, 'document-attributes.adoc'), 'w')
for attribute in attributeList:
for k in attribute.keys():
output.write(':book_' + k + ": " + attribute[k] + "\n")
print "Transformation complete!"