Skip to content

Commit b9d5156

Browse files
KastanDaylmarini
andauthored
Added Apple Silicon install docs (#339)
* fixed yaml codeblock HTML render * fix typo * major copy improvements, added Apple Silicon install instructions * added instructions on how to contribute docs * added ui tabs for AppleSilicon-specific instructions * fixed bullet points not rendering * added dynamic builds of docs for faster authoring * typo fix * consolidate 'Customizing' page, remove 'Dev env' page * minor requirements.txt order change, easy for conda users Co-authored-by: Luigi Marini <[email protected]>
1 parent 7f2b302 commit b9d5156

File tree

9 files changed

+598
-429
lines changed

9 files changed

+598
-429
lines changed

CHANGELOG.md

Lines changed: 187 additions & 68 deletions
Large diffs are not rendered by default.

doc/src/sphinx/admin/customizing.rst

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,73 @@
11
.. _customization:
22

3-
******
4-
Customization
5-
******
3+
********************************
4+
Customizing
5+
********************************
6+
7+
The default configuration
8+
==========================
9+
10+
.. warning::
11+
Do **not** make changes to the original files in ``/conf``. Instead, create a ``/custom`` folder shown below.
12+
13+
The default configuration is fine for simple testing, but if you would like to modify any of the settings, you can find
14+
all the configuration files under the ``/conf`` directory. The following files are of particular importance:
15+
16+
- ``/conf/application.conf`` includes all the basic configuration entries. For example the MongoDB credentials for
17+
deployments where MongoDB has non default configuration.
18+
- ``/conf/play.plugins`` is used to turn on and off specific functionality in the system. Plugins specific to Clowder are
19+
available under ``/app/services``.
20+
- ``/conf/securesocial.conf`` includes configuration settings for email functionality when signup as well as ways to
21+
configure the different identity providers (for example Twitter or Facebook). More information can be found on the
22+
`securesocial <http://securesocial.ws/>`_ website.
23+
24+
25+
How to customize Clowder
26+
============================
27+
28+
To customize Clowder, create a folder called ``custom`` inside the Clowder folder (``clowder/custom``).
29+
Add the following. Modifications included in these files will overwrite defaults in ``/conf/application.conf`` and ``/conf/play.plugins``.
30+
31+
.. code:: bash
32+
33+
cd clowder
34+
mkdir custom
35+
touch custom/application.conf custom/play.plugins
36+
37+
38+
If you are working on the source code this folder is excluded from git so you can use that also to customize your development environment, and not accidentally commit changes to either ``play.plugins`` or ``application.conf``. If you make any changes to the files in the custom folder you will need to `restart the application` (both in production and development).
639

7-
To customize Clowder you can put all configuration changes in a folder called custom inside the Clowder folder. If you are working on the source code this folder is excluded from git so you can use that also to customize your development environment, and not accidentally commit changes to either play.plugins or application.conf. If you make any changes to the files in the custom folder you will need to restart the application (both in production and development).
840

941
play.plugins
10-
============
42+
--------------
1143

12-
The play.plugins file is used to enable plugins. You can only enable plugins, you can not disable plugins. This is one of the reasons why we minimize the number plugins that are enabled by default. For example most instances at NCSA will have the following plugins enabled.
44+
The ``/custom/play.plugins`` file describes all the `additional` plugins that should be enabled. **This file can only add additional plugins,
45+
and is not capable of turning off any of the default ones enabled in** ``/conf/play.plugins``.
46+
For example the following ``play.plugins`` file will enable some additional plugins:
1347

1448
.. code-block:: properties
1549
:caption: play.plugins
1650
1751
9992:services.RabbitmqPlugin
52+
10002:securesocial.core.providers.GoogleProvider
1853
11002:services.ElasticsearchPlugin
1954
55+
2056
custom.conf
21-
===========
57+
--------------
58+
59+
``/custom/custom.conf`` is used to override any of the defaults in the ``application.conf`` or any included conf files (such as ``securesocial.conf``). Common changes we do is to modify Clowder to use a directory on disk to store all blobs instead of storing them in mongo. Following is an example that we use for some of the instances we have at NCSA.
60+
61+
- **One change every instance of Clowder should do is to modify the commKey and application.secret.**
62+
2263

23-
The custom.conf file is used to override any of the changes in the application.conf or any included conf files (such as securesocial.conf). One change every instance of Clowder should do is to modify the commKey and application.secret. Common changes we do is to modify Clowder to use a directory on disk to store all blobs instead of storing them in mongo. Following is an example that we use for some of the instances we have at NCSA.
2464

2565
.. code-block:: properties
2666
:caption: custom.conf
2767
28-
# security options
29-
application.secret="1234567890123456789012345678901234567890"
30-
commKey=notreallyit
68+
# security options -- should be changed!
69+
application.secret="some magic string"
70+
commKey=magickey
3171
3272
# email when new user tries to sign up
3373
smtp.from="[email protected]"
@@ -36,7 +76,7 @@ The custom.conf file is used to override any of the changes in the application.c
3676
# URL to mongo
3777
mongodbURI = "mongodb://mongo1:27017,mongo2:27017,mongo3:27017/server1?replicaSet=CLOWDER"
3878
39-
# where to store the blobs
79+
# where to store the blobs (highly recommended)
4080
service.byteStorage=services.filesystem.DiskByteStorageService
4181
medici2.diskStorage.path="/home/clowder/data"
4282
@@ -52,7 +92,9 @@ The custom.conf file is used to override any of the changes in the application.c
5292
elasticsearchSettings.serverPort=9300
5393
5494
# securesocial customization
95+
# set this to true if using https
5596
securesocial.ssl=true
97+
# this will make the default timeout be 8 hours
5698
securesocial.cookie.idleTimeoutInMinutes=480
5799
58100
# twitter setup
@@ -62,17 +104,24 @@ The custom.conf file is used to override any of the changes in the application.c
62104
securesocial.twitter.consumerKey="key"
63105
securesocial.twitter.consumerSecret="secret"
64106
107+
# google setup
108+
securesocial.google.authorizationUrl="https://accounts.google.com/o/oauth2/auth"
109+
securesocial.google.accessTokenUrl="https://accounts.google.com/o/oauth2/token"
110+
securesocial.google.clientId="magic"
111+
securesocial.google.clientSecret="magic"
112+
securesocial.google.scope="https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"
113+
65114
# enable cache
66115
ehcacheplugin = enabled
67116
68117
69118
messages.XY
70-
===========
119+
---------------------
71120

72121
This allows to translate or customize certain aspects of Clowder. All messages in Clowder are in english and are as messages.default. Unfortunately it is not possible to use messages.default to use for translations since it falls back to those embedded in the Clowder jar files. To update the messages in english, you can use messages.en. The default is for Clowder to only know about english, this can be changed in your custom.conf with ``application.langs="nl"``.
73122

74123
Customizing Web UI
75-
==================
124+
---------------------
76125

77126
The ``public`` folder is place where you can place customizations for previews, as well as new stylesheets. To add a new stylesheet you should place it in the public/stylesheets/themes/ folder. The name should be <something>.min.css or <something>.css. The user will at this point see in their customization settings the option to select <something> as their new theme to be used.
78127

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Changelog
2+
***********
3+
4+
.. To read our changelog.md file, this plugin converts markdown to .rst formatting (`pip install m2r2`)
5+
6+
.. mdinclude:: changelog.md

doc/src/sphinx/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3232
# ones.
3333
extensions = [
34+
"sphinx_rtd_theme", "sphinx_design", "m2r2"
3435
]
3536

3637
# Add any paths that contain templates here, relative to this directory.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
.. index:: How to Contribute Documentation
2+
3+
How to Contribute Documentation
4+
=====================================
5+
6+
Documentation is stored in ``doc/src/sphinx``.
7+
8+
Dependencies are stored in ``doc/src/sphinx/requirements.txt``.
9+
10+
11+
12+
13+
.. tab-set::
14+
15+
.. tab-item:: conda
16+
17+
Create a virtual environment for documentation:
18+
19+
.. code:: bash
20+
21+
conda create -n clowder_docs python=3.8 -y
22+
conda activate clowder_docs
23+
24+
Now we must edit the `requirements.txt` file to be compatible with Conda. These packages are not available on conda-forge.
25+
26+
Comment out the top three lines like so:
27+
28+
.. code:: properties
29+
30+
# -i https://pypi.org/simple/
31+
# sphinx-rtd-theme==0.5.0
32+
# sphinx_design==0.0.13
33+
...
34+
35+
Install the dependencies. It's always better to run all conda commands before installing pip packages.
36+
37+
.. code:: bash
38+
39+
conda install --file requirements.txt -y
40+
pip install sphinx-rtd-theme==0.5.0 sphinx_design==0.0.13
41+
42+
.. tab-item:: pyenv
43+
44+
Create a virtual environment for documentation:
45+
46+
.. code:: bash
47+
48+
pyenv install 3.7.12 # or any 3.{7,8,9}
49+
pyenv virtualenv 3.7.12 clowder_docs
50+
51+
# make virtual environemnt auto-activate
52+
cd doc/src/sphinx
53+
pyenv local clowder_docs
54+
55+
Install doc dependencies:
56+
57+
.. code:: bash
58+
59+
pip install -r requirements.txt
60+
61+
Now, build HTML docs for viewing:
62+
63+
.. code:: bash
64+
65+
# run from doc/src/sphinx
66+
sphinx-autobuild . _build/html
67+
68+
Open http://127.0.0.1:8000 in your browser. Saved changes will be auto-updated in the browser.
69+
70+
71+
.. dropdown:: (Optional alternative) Static builds
72+
73+
If you do not want dynamic builds, you can statically generate the HTML this way.
74+
75+
.. code:: bash
76+
77+
cd doc/src/sphinx
78+
make html
79+
80+
View docs by opening ``index.html`` in the browser
81+
``clowder/doc/src/sphinx/_build/html/index.html``
82+
83+
84+
85+
⭐ If you experience *any* trouble, come ask us on `Slack here <https://join.slack.com/t/clowder-software/shared_invite/enQtMzQzOTg0Nzk3OTUzLTYwZDlkZDI0NGI4YmI0ZjE5MTZiYmZhZTIyNWE1YzM0NWMwMzIxODNhZTA1Y2E3MTQzOTg1YThiNzkwOWQwYWE>`_! ⭐
86+
87+
.. note::
88+
89+
To see how to install Clowder, please see :ref:`installing_clowder`.

doc/src/sphinx/develop/setup_dev.rst

Lines changed: 0 additions & 73 deletions
This file was deleted.

doc/src/sphinx/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Contents
3636
:caption: General
3737

3838
overview
39-
changelog
39+
changelog_md_to_rst
4040
license
4141

4242
.. toctree::
@@ -59,9 +59,10 @@ Contents
5959
:caption: Development
6060

6161
develop/architecture
62-
develop/setup_dev
6362
develop/extractors
6463
develop/previewers
64+
develop/contribute_docs
65+
.. not included: publishing_data
6566

6667
.. toctree::
6768
:maxdepth: 1

doc/src/sphinx/requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
-i https://pypi.org/simple/
2+
sphinx-rtd-theme==0.5.0
3+
sphinx_design==0.0.13
24
alabaster==0.7.12
35
babel==2.9.1
46
certifi==2021.5.30
57
chardet==4.0.0
68
commonmark==0.9.1
7-
docutils==0.17.1
9+
docutils==0.16
810
idna==2.10
911
imagesize==1.2.0
1012
jinja2==3.0.1
@@ -16,7 +18,6 @@ pytz==2021.1
1618
recommonmark==0.6.0
1719
requests==2.25.1
1820
snowballstemmer==2.1.0
19-
sphinx-rtd-theme==0.5.0
2021
sphinx==3.1.2
2122
sphinxcontrib-applehelp==1.0.2
2223
sphinxcontrib-devhelp==1.0.2
@@ -25,3 +26,4 @@ sphinxcontrib-jsmath==1.0.1
2526
sphinxcontrib-qthelp==1.0.3
2627
sphinxcontrib-serializinghtml==1.1.5
2728
urllib3==1.26.5
29+
m2r2==0.3.2

0 commit comments

Comments
 (0)