Skip to content

Commit e7ee485

Browse files
committed
Merge branch 'release/v3.4.1'
2 parents f427f9f + a24f722 commit e7ee485

32 files changed

+444
-216
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN apk add --no-cache bash \
1818
# reqs layer
1919
ADD requirements.txt .
2020
RUN pip3 install -U -r requirements.txt
21-
RUN pip3 install gunicorn
21+
RUN pip3 install gunicorn==19.7.1
2222

2323
# Bundle app source
2424
ADD . /src

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ For **full** installation and configuration instructions, see [Getting Started](
3939

4040
1. Download or clone the repository.
4141
2. Open terminal and point to root of repository. Type: ``pip install -r requirements.txt``
42-
3. Run server with: `` python application.py ``. Alternatively: ``./manage.py runserver``
42+
3. Run server with: `` python3 application.py ``. Alternatively: ``./manage.py runserver``
4343
4. Access HQ with: `` http://localhost:5000 ``
4444

4545
For further installation and configuration help, please read the docs: [ElasticHQ Documentation](http://docs.elastichq.org)

deployment/supervisord.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ nodaemon=true
33

44
[program:gunicorn]
55
command=/usr/local/bin/gunicorn application:application -w 1 --worker-class eventlet --config /src/gunicorn.conf --log-config /src/logging.conf --bind 0.0.0.0:5000
6-
directory=/src
6+
directory=/src
7+
stdout_logfile=/var/log/supervisor/stdout.log
8+
stderr_logfile=/var/log/supervisor/stderr.log
27 Bytes
Binary file not shown.

docs/.doctrees/environment.pickle

-6.9 KB
Binary file not shown.

docs/.doctrees/faq.doctree

-39 Bytes
Binary file not shown.

docs/.doctrees/index.doctree

-72 Bytes
Binary file not shown.

docs/.doctrees/installation.doctree

14 KB
Binary file not shown.

docs/.doctrees/rest-api.doctree

3.69 KB
Binary file not shown.
-12 Bytes
Binary file not shown.

docs/.doctrees/user-guide.doctree

0 Bytes
Binary file not shown.

docs/_sources/installation.txt

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Install ElasticHQ
2626

2727
1. Download or clone the repository https://github.com/ElasticHQ/elasticsearch-HQ
2828
2. Navigate to the root of the repository: ``pip install -r requirements.txt``
29-
3. Start the server: ``python application.py``
29+
3. Start the server: ``python3 application.py``
3030
4. Point your browser to: http://localhost:5000
3131

3232
.. note:: Alternatively, you can start the server with ``python manage.py runserver``
@@ -76,14 +76,16 @@ Command line Parameters
7676

7777
The ``application.py`` start script takes parameters passed in as arguments from the command line:
7878

79-
=========== ========================= ====================================================================
80-
Arg Default Value Definition
81-
=========== ========================= ====================================================================
82-
``--host`` 127.0.0.1 Host the HQ server should be reachable on.
83-
``--port`` 5000 Port to reach HQ server.
84-
``--debug`` False If True, exposes debug data to UI and causes reload on code changes.
85-
``--url`` ``http://localhost:9200`` Default URL displayed on the initial connection screen.
86-
=========== ========================= ====================================================================
79+
================ ========================= ====================================================================
80+
Arg Default Value Definition
81+
================ ========================= ====================================================================
82+
``--host`` 127.0.0.1 Host the HQ server should be reachable on.
83+
``--port`` 5000 Port to reach HQ server.
84+
``--debug`` False If True, exposes debug data to UI and causes reload on code changes.
85+
``--url`` ``http://localhost:9200`` Default URL displayed on the initial connection screen.
86+
``--enable-ssl`` False If flag is passed, assumes ssl cert will be used.
87+
``--ca-certs`` /path/to/your/ca.crt Path to your CA Certificate. Required if enable-ssl is passed.
88+
================ ========================= ====================================================================
8789

8890
.. _environment variables:
8991

@@ -94,6 +96,8 @@ Environment Variables
9496
Arg Default Value Definition
9597
================== ========================= ====================================================================
9698
``HQ_DEFAULT_URL`` ``http://localhost:9200`` Default URL displayed on the initial connection screen.
99+
``HQ_ENABLE_SSL`` False If flag is passed, assumes ssl cert will be used.
100+
``HQ_CA_CERTS`` /path/to/your/ca.crt Path to your CA Certificate. Required if enable-ssl is passed.
97101
================== ========================= ====================================================================
98102

99103

@@ -106,13 +110,52 @@ Advanced users that want to have control over the logging output, can adjust it
106110

107111
Docker users will find the logfile location under ``/src/application.log``
108112

113+
Connecting with SSL
114+
^^^^^^^^^^^^^^^^^^^
115+
116+
Thanks to a community contribution, SSL Cert support has been added: `SSL Support <https://github.com/ElasticHQ/elasticsearch-HQ/issues/376>`_.
117+
118+
Enable SSL Cert support by starting HQ as so:
119+
120+
``python -m application --enable-ssl --ca-certs /path/to/your/ca.crt``
121+
122+
109123
Database
110124
^^^^^^^^
111125

112126
ElasticHQ ships with SQLLite integration to store clusters you have connected to and other meta information. This database is kept under the root directory as ``elastichq.db``.
113127

114128
.. note:: In the event you want to start with a clean slate, simply delete the ``elastichq.db`` file. ElasticHQ will recreate it at next startup.
115129

130+
External Configuration
131+
^^^^^^^^^^^^^^^^^^^^^^
132+
133+
External configuration files are supported for those wanting to preserve their user-specified settings between upgrades.
134+
135+
On startup, HQ checks the following locations for a file named ``settings.json``:
136+
137+
* `/etc/elastic-hq/settings.json`
138+
* `~/settings.json`
139+
* CURRENT WORKING DIRECTORY + ``/settings.json``
140+
* CURRENT WORKING DIRECTORY + ``/elastichq/settings.json``
141+
* CURRENT WORKING DIRECTORY + ``/config/settings.json``
142+
143+
Current supported parameters are:
144+
145+
=========================== ====================================================================
146+
Key Definition
147+
=========================== ====================================================================
148+
``SQLALCHEMY_DATABASE_URI`` Location and Name of ElasticHQ database file.
149+
=========================== ====================================================================
150+
151+
The settings file should be in standard JSON:
152+
153+
.. code-block:: json
154+
155+
{
156+
"SQLALCHEMY_DATABASE_URI" : "sqlite:////SOME/PATH/TO/DB_NAME.db"
157+
}
158+
116159
Upgrading
117160
---------
118161

@@ -184,7 +227,7 @@ Failure in connecting initially to an Elasticsearch cluster, can happen for seve
184227
.. _xpack integration:
185228

186229
X-Pack Integration
187-
~~~~~~~~~~~~~~~~~~
230+
^^^^^^^^^^^^^^^^^^
188231

189232
X-Pack is configured with authentication. To connect, you must pass along the username and password in the connection URL
190233
using the format ``http://USERNAME:PASSWORD@DOMAIN:PORT``
@@ -201,6 +244,32 @@ In the base installation, the logs are available under the ``/install/path/appli
201244

202245
For docker images, the application logging can be found under ``/src/application.log``.
203246

247+
.. _ssl_trouble:
248+
249+
SSL Cert not working
250+
^^^^^^^^^^^^^^^^^^^^
251+
252+
**NOTE: Your CA file must be the same signer of your Elasticsearch node, for HQ to connect as a trusted source.**
253+
254+
Verify that the certificate works by connecting directly from the HQ instance to the ES node in question, using the cert:
255+
256+
``curl -u admin:password --ca-certs /path/to/ca.crt https://localhost:9200/_cluster/settings?pretty``
257+
258+
Preserving Database across Docker container restarts
259+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
260+
261+
The following code block originated as an issue (https://github.com/ElasticHQ/elasticsearch-HQ/issues/409) for those wanting to preserve the HQ SQLLite DB between container restarts.
262+
263+
.. code-block:: bash
264+
265+
docker run --detach
266+
--restart=always
267+
--net host
268+
--volume elastichq:/src/db
269+
--name elastichq
270+
elastichq/elasticsearch-hq
271+
sh -x -c 'sed -i -r -e "s/_sqlalchemy_database_uri =.*/_sqlalchemy_database_uri = "sqlite:///" + os.path.join(BASEPATH, "db" , "elastichq.db")/" /src/elastichq/config/settings.py && exec supervisord -c /etc/supervisor/supervisord.conf'
272+
204273
License
205274
-------
206275

0 commit comments

Comments
 (0)