Skip to content

Commit

Permalink
Add CirrusSearch maintenance scripts (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
naresh-kumar-babu authored Jul 5, 2024
1 parent b5fb4b1 commit 07e785b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ COPY --from=source $MW_HOME $MW_HOME
COPY --from=source $MW_ORIGIN_FILES $MW_ORIGIN_FILES

# Default values
ENV MW_ENABLE_JOB_RUNNER=true \
ENV MW_AUTOUPDATE=true \
MW_MAINTENANCE_UPDATE=0 \
MW_MAINTENANCE_CIRRUSSEARCH_UPDATECONFIG=2 \
MW_MAINTENANCE_CIRRUSSEARCH_FORCEINDEX=2 \
MW_ENABLE_JOB_RUNNER=true \
MW_JOB_RUNNER_PAUSE=2 \
MW_JOB_RUNNER_MEMORY_LIMIT=512M \
MW_ENABLE_TRANSCODER=true \
Expand Down
8 changes: 8 additions & 0 deletions _sources/scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ get_hostname_with_port() {
echo "$1:${port:-$2}"
}

get_mediawiki_cirrus_search_server() {
server=$(get_mediawiki_variable wgCirrusSearchServers first)
if [ -z "$server" ]; then
server=$(php /getMediawikiSettings.php --variable=wgCirrusSearchClusters --variableArrayIndex="[\"default\",0]" --format=string)
fi
get_hostname_with_port "$server" 9200
}

make_dir_writable() {
find "$@" '(' -type f -o -type d ')' \
-not '(' '(' -user "$WWW_USER" -perm -u=w ')' -o \
Expand Down

0 comments on commit 07e785b

Please sign in to comment.