Skip to content

Commit

Permalink
OPSEXP-2830: always escape % (also fixes consecutive %) (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz authored Sep 16, 2024
1 parent 32a946c commit f468c13
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ BindsTo=alfresco-content-monitored-startup.service

[Service]
{% if repo_keystore | default({}) | dict2items | length > 0 -%}
Environment="JAVA_OPTS=-Dssl-keystore.password='{{ repo_keystore.pass | default('') }}'"
Environment="JAVA_OPTS=-Dssl-keystore.password='{{ repo_keystore.pass | default('') | replace('%', '%%') }}'"
{%- endif %}
4 changes: 2 additions & 2 deletions roles/search_enterprise/templates/elasticsearch-cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Environment=ALFRESCO_ACCEPTED_CONTENT_MEDIA_TYPES_CACHE_BASE_URL=http://{{ trout
Environment=ELASTICSEARCH_INDEXNAME=alfresco
Environment=SPRING_ACTIVEMQ_BROKERURL=failover:({{ activemq_transport }}://{{ activemq_host }}:{{ ports_cfg.activemq[activemq_protocol] }})
Environment=SPRING_ACTIVEMQ_USER={{ activemq_username }}
Environment=SPRING_ACTIVEMQ_PASSWORD={{ activemq_password | regex_replace(search_enterprise_unit_specifier_regex, '%%\1') }}
Environment=SPRING_ACTIVEMQ_PASSWORD={{ activemq_password | replace('%', '%%') }}
Environment=SPRING_ELASTICSEARCH_REST_URIS={{ elasticsearch_protocol }}://{{ elasticsearch_host }}:{{ ports_cfg.elasticsearch.http }}
Environment=SPRING_ELASTICSEARCH_REST_USERNAME={{ elasticsearch_username }}
Environment=SPRING_ELASTICSEARCH_REST_PASSWORD={{ elasticsearch_password | regex_replace(search_enterprise_unit_specifier_regex, '%%\1') }}
Environment=SPRING_ELASTICSEARCH_REST_PASSWORD={{ elasticsearch_password | replace('%', '%%') }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ User={{ username }}

Environment=SPRING_DATASOURCE_URL={{ repo_db_url if repo_db_url else 'jdbc:postgresql://' + db_host + ':' + ports_cfg.postgres.sql | string + '/' + repo_db_name }}
Environment=SPRING_DATASOURCE_USERNAME={{ repo_db_username }}
Environment=SPRING_DATASOURCE_PASSWORD={{ repo_db_password | regex_replace(search_enterprise_unit_specifier_regex, '%%\1') }}
Environment=SPRING_DATASOURCE_PASSWORD={{ repo_db_password | replace('%', '%%') }}

ExecStart={{ java_home }}/bin/java -jar {{ search_enterprise_binaries_dir }}/alfresco-elasticsearch-reindexing-{{ search_enterprise.version }}-app.jar {{ search_enterprise_reindex_options }}

Expand Down
2 changes: 0 additions & 2 deletions roles/search_enterprise/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
search_enterprise_binaries_dir: "{{ binaries_folder }}/enterprise-search-{{ search_enterprise.version }}"
search_enterprise_config_dir: "{{ config_folder }}/enterprise-search"
search_enterprise_data_dir: "{{ data_folder }}/enterprise-search"
# System list of uint specifiers https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Specifiers
search_enterprise_unit_specifier_regex: '%([aAbBCdDEfgGhHiIjJlLmMnNopPqsStTuUvVwWyY%]|$)'

0 comments on commit f468c13

Please sign in to comment.