Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs Ubuntu Upgrade #415

Merged
33 commits merged into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
68b159c
feat: remove cove proxy
Mar 10, 2023
2df32fe
feat: update docs server to ubuntu 22
Mar 10, 2023
5327a25
fix: set userdir permissions
Mar 10, 2023
bc240ef
feat: proxy elasticsearch requests via apache
Mar 10, 2023
9ce62f4
docs: record ocp07 host
Mar 10, 2023
f9676c1
feat: update rkhunter for ubuntu 22
Mar 13, 2023
394cd65
docs: update elasticsearch path
Mar 13, 2023
9ff0ef7
refactor: remove jinja newlines
Mar 13, 2023
6ad46e0
feat: remove legacy proxy settings
Mar 13, 2023
f4ce9c5
feat: add search ES path
Mar 13, 2023
ab480d8
feat: remove local specific access
Mar 13, 2023
158814c
fix: new apt-key location on ubuntu 22
Mar 13, 2023
e336664
feat: configure ES for proxied connections
Mar 17, 2023
e451533
feat: elasticsearch version 8
Mar 17, 2023
481db4c
Update salt/elasticsearch/init.sls
Mar 17, 2023
9b208d5
Update salt/elasticsearch/init.sls
Mar 17, 2023
230ee67
feat: use new ES endpoint
Mar 21, 2023
0a74147
feat: remove cors configuration
Mar 21, 2023
ee7f96f
feat: Config readonlyrest access via pillar
Mar 21, 2023
02fcab9
feat: simplify and configure for ES 8
Mar 21, 2023
f4f9fab
Update pillar/docs.sls
Mar 21, 2023
d8aa3a7
feat: Add ocpadmin ror user
Mar 21, 2023
afaf371
Update salt/elasticsearch/files/config/readonlyrest-docs.yml
Apr 6, 2023
6179526
Update salt/docs/init.sls
Apr 6, 2023
884dde0
docs: remove public access
Apr 6, 2023
15020ca
refactor: clear readonlyrest permission names
Apr 6, 2023
e8699f5
feat: remove elasticsearch public access
Apr 6, 2023
9748344
docs: add readonly rest configuration guide
Apr 6, 2023
d2a3e1d
feat: remove legacy elasticsearch variables
Apr 6, 2023
99e924c
docs: Restore ReadOnlyREST section
jpmckinney Apr 6, 2023
c7e5a12
feat: set web dir permissions
Apr 13, 2023
4d5f352
feat: remove admin_ips variable
Apr 13, 2023
ab9b891
docs: Explain why Apache (and world) needs access to user directory
jpmckinney Apr 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deploy-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ if [ "$RELEASE" != "true" ]; then

# Index the build directory.
ocdsindex sphinx build/ https://standard.open-contracting.org/"$PREFIX""$PATH_PREFIX""$REF"/ > documents.json
ocdsindex index https://standard.open-contracting.org:9200 documents.json
ocdsindex index https://standard.open-contracting.org/search documents.json
if [ "$REF" == "$VERSION" ]; then
ocdsindex sphinx build/ https://standard.open-contracting.org/"$PREFIX""$PATH_PREFIX"latest/ > documents.json
ocdsindex index https://standard.open-contracting.org:9200 documents.json
ocdsindex index https://standard.open-contracting.org/search documents.json
fi

if [ "$PRODUCTION" == "true" ]; then
Expand Down
3 changes: 0 additions & 3 deletions pillar/docs.sls
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ apache:
servername: standard.open-contracting.org

elasticsearch:
public_access: False
# Allow OCDS documentation and GitHub Actions.
allowed_origins: "*"
# This is to inform the installation of ReadOnlyREST – not to control the version of Elasticsearch to install.
version: 8.6.2
plugins:
Expand Down
14 changes: 12 additions & 2 deletions salt/elasticsearch/files/config/readonlyrest-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ readonlyrest:
access_control_rules:
- name: Allow manage admin access over localhost
This conversation was marked as resolved.
Show resolved Hide resolved
This conversation was marked as resolved.
Show resolved Hide resolved
groups:
- manage
x_forwarded_for: ["127.0.0.0/8", "178.79.135.174/32"]
- ocpadmin
x_forwarded_for:
- "127.0.0.0/8"
- "{{ pillar.network.ipv4 }}"
{%- if "ipv6" in pillar.network %}
- "{{ pillar.network.ipv6 }}"
{%- endif %}
This conversation was marked as resolved.
Show resolved Hide resolved
{%- if "admin_ips" in pillar.elasticsearch %}
{%- for ip in pillar.elasticsearch.admin_ips %}
- "{{ ip }}"
{%- endfor %}
{%- endif %}
This conversation was marked as resolved.
Show resolved Hide resolved
- name: Allow the public group to search indices created by OCDS Index
groups:
- public
Expand Down
44 changes: 13 additions & 31 deletions salt/elasticsearch/init.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% from 'lib.sls' import set_firewall, unset_firewall%}
{% from 'lib.sls' import set_firewall, unset_firewall %}

{% if pillar.elasticsearch.get('public_access') %}
{{ set_firewall("PUBLIC_ELASTICSEARCH") }}
Expand Down Expand Up @@ -41,56 +41,38 @@ set jvm maximum heap size:
- watch_in:
- service: elasticsearch

{% if pillar.elasticsearch.get('public_access') %}
/etc/elasticsearch/elasticsearch.yml:
file.keyvalue:
- name: /etc/elasticsearch/elasticsearch.yml
- key_values:
# https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-network.html
{% if pillar.elasticsearch.get('public_access') %}
network.bind_host: 0.0.0.0
network.publish_host: _local_
- separator: ': '
- append_if_not_found: True
- watch_in:
- service: elasticsearch
{% else %}
/etc/elasticsearch/elasticsearch.yml:
file.keyvalue:
- name: /etc/elasticsearch/elasticsearch.yml
- key_values:
# https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-network.html
{% else %}
http.host: 127.0.0.1
network.bind_host: 127.0.0.1
{% endif %}
network.publish_host: _local_
- separator: ': '
- append_if_not_found: True
- watch_in:
- service: elasticsearch
{% endif %}

ElasticSearch Global Config:
file.keyvalue:
- name: /etc/elasticsearch/elasticsearch.yml
- key_values:
# https://www.elastic.co/guide/en/elasticsearch/reference/7.10/query-dsl.html
search.allow_expensive_queries: 'false'
# https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-scripting-security.html
script.allowed_types: inline
script.allowed_contexts: ingest
# https://www.elastic.co/guide/en/elasticsearch/reference/7.10/bootstrap-checks.html
discovery.type: single-node
# {% if 'allowed_origins' in pillar.elasticsearch %}
# # https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-http.html
# http.cors.enabled: 'true'
# http.cors.allow-origin: "'{{ pillar.elasticsearch.allowed_origins }}'"
# http.cors.allow-methods: OPTIONS, GET, POST
# http.cors.allow-headers: X-Requested-With, Content-Type, Content-Length, Authorization
# {% endif %}
- separator: ': '
- append_if_not_found: True
- watch_in:
- service: elasticsearch

{# Prevent Elasticsearch from starting in the case of misconfiguration. #}
/etc/elasticsearch/elasticsearch.yml disable cluster mode:
jpmckinney marked this conversation as resolved.
Show resolved Hide resolved
file.comment:
- name: /etc/elasticsearch/elasticsearch.yml
- regex: "^cluster.initial_master_nodes:"
- backup: False
- ignore_missing: True

{# Prevent ElasticSearch from starting in the case of misconfiguration. #}
/etc/elasticsearch/jvm.options.d/bootstrap-checks.options:
file.managed:
- name: /etc/elasticsearch/jvm.options.d/bootstrap-checks.options
Expand Down
2 changes: 2 additions & 0 deletions salt/elasticsearch/plugins/readonlyrest.sls
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ readonlyrest-install:
readonlyrest.force_load_from_file: 'true'
# https://github.com/beshu-tech/readonlyrest-docs/blob/master/elasticsearch.md#5-disable-x-pack-security-module
xpack.security.enabled: 'false'
xpack.security.transport.ssl.enabled: 'false'
xpack.security.http.ssl.enabled: 'false'
- separator: ': '
- append_if_not_found: True
- require:
Expand Down