Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
docker-elk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段孔乐
docker-elk
Commits
63076528
Unverified
Commit
63076528
authored
Feb 27, 2020
by
Antoine Cotten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
travis: Use non-default passwords
parent
d743e6e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
.travis.yml
.travis.yml
+4
-3
elasticsearch-setup-passwords.exp
.travis/elasticsearch-setup-passwords.exp
+1
-1
run-tests.sh
.travis/run-tests.sh
+7
-7
No files found.
.travis.yml
View file @
63076528
...
@@ -18,9 +18,10 @@ before_script:
...
@@ -18,9 +18,10 @@ before_script:
# Build images
# Build images
-
docker-compose build
-
docker-compose build
# Use built-in users
# Use built-in users with passwords set by 'elasticsearch-setup-passwords.exp'
-
sed -i 's/\(elasticsearch.username:\) elastic/\1 kibana/g' kibana/config/kibana.yml
-
sed -i -e 's/\(elasticsearch.username:\) elastic/\1 kibana/g' -e 's/\(elasticsearch.password:\) changeme/\1 testpasswd/g' kibana/config/kibana.yml
-
sed -i 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' logstash/config/logstash.yml
-
sed -i -e 's/\(xpack.monitoring.elasticsearch.username:\) elastic/\1 logstash_system/g' -e 's/\(xpack.monitoring.elasticsearch.password:\) changeme/\1 testpasswd/g' logstash/config/logstash.yml
-
sed -i 's/\(password =>\) "changeme"/\1 "testpasswd"/g' logstash/pipeline/logstash.conf
script
:
script
:
# Compose
# Compose
...
...
.travis/elasticsearch-setup-passwords.exp
View file @
63076528
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# List of expected users with dummy password
# List of expected users with dummy password
set user "(elastic|apm_system|kibana|logstash_system|beats_system|remote_monitoring_user)"
set user "(elastic|apm_system|kibana|logstash_system|beats_system|remote_monitoring_user)"
set password "
changeme
"
set password "
testpasswd
"
# Find elasticsearch container id
# Find elasticsearch container id
set MODE [lindex $argv 0]
set MODE [lindex $argv 0]
...
...
.travis/run-tests.sh
View file @
63076528
...
@@ -58,10 +58,10 @@ if [ "$#" -ge 1 ]; then
...
@@ -58,10 +58,10 @@ if [ "$#" -ge 1 ]; then
fi
fi
log
'Waiting for Elasticsearch readiness'
log
'Waiting for Elasticsearch readiness'
poll_ready elasticsearch
'http://localhost:9200/'
'elastic:
changeme
'
poll_ready elasticsearch
'http://localhost:9200/'
'elastic:
testpasswd
'
log
'Waiting for Kibana readiness'
log
'Waiting for Kibana readiness'
poll_ready kibana
'http://localhost:5601/api/status'
'kibana:
changeme
'
poll_ready kibana
'http://localhost:5601/api/status'
'kibana:
testpasswd
'
log
'Waiting for Logstash readiness'
log
'Waiting for Logstash readiness'
poll_ready logstash
'http://localhost:9600/_node/pipelines/main?pretty'
poll_ready logstash
'http://localhost:9600/_node/pipelines/main?pretty'
...
@@ -72,11 +72,11 @@ curl -X POST -D- 'http://localhost:5601/api/saved_objects/index-pattern' \
...
@@ -72,11 +72,11 @@ curl -X POST -D- 'http://localhost:5601/api/saved_objects/index-pattern' \
-s
-w
'\n'
\
-s
-w
'\n'
\
-H
'Content-Type: application/json'
\
-H
'Content-Type: application/json'
\
-H
"kbn-version:
${
ELK_VERSION
}
"
\
-H
"kbn-version:
${
ELK_VERSION
}
"
\
-u
elastic:
changeme
\
-u
elastic:
testpasswd
\
-d
'{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}'
-d
'{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}'
log
'Searching index pattern via Kibana API'
log
'Searching index pattern via Kibana API'
response
=
"
$(
curl
'http://localhost:5601/api/saved_objects/_find?type=index-pattern'
-s
-u
elastic:
changeme
)
"
response
=
"
$(
curl
'http://localhost:5601/api/saved_objects/_find?type=index-pattern'
-s
-u
elastic:
testpasswd
)
"
echo
"
$response
"
echo
"
$response
"
count
=
"
$(
jq
-rn
--argjson
data
"
${
response
}
"
'$data.total'
)
"
count
=
"
$(
jq
-rn
--argjson
data
"
${
response
}
"
'$data.total'
)
"
if
[[
$count
-ne
1
]]
;
then
if
[[
$count
-ne
1
]]
;
then
...
@@ -85,14 +85,14 @@ if [[ $count -ne 1 ]]; then
...
@@ -85,14 +85,14 @@ if [[ $count -ne 1 ]]; then
fi
fi
log
'Sending message to Logstash TCP input'
log
'Sending message to Logstash TCP input'
echo
'dockerelk'
| nc localhost 5000
echo
'dockerelk'
| nc
-q0
localhost 5000
sleep
1
sleep
1
curl
-X
POST
'http://localhost:9200/_refresh'
-u
elastic:
changeme
\
curl
-X
POST
'http://localhost:9200/_refresh'
-u
elastic:
testpasswd
\
-s
-w
'\n'
-s
-w
'\n'
log
'Searching message in Elasticsearch'
log
'Searching message in Elasticsearch'
response
=
"
$(
curl
'http://localhost:9200/_count?q=message:dockerelk&pretty'
-s
-u
elastic:
changeme
)
"
response
=
"
$(
curl
'http://localhost:9200/_count?q=message:dockerelk&pretty'
-s
-u
elastic:
testpasswd
)
"
echo
"
$response
"
echo
"
$response
"
count
=
"
$(
jq
-rn
--argjson
data
"
${
response
}
"
'$data.count'
)
"
count
=
"
$(
jq
-rn
--argjson
data
"
${
response
}
"
'$data.count'
)
"
if
[[
$count
-ne
1
]]
;
then
if
[[
$count
-ne
1
]]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment