X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=debian%2Fscripts%2Fkoha-create;h=b90e7d4e236ae54870ed1fe7c599a9a1f334cc6d;hb=7b1e8c59fe0edc2faab878c6bd9d45de9f720e81;hp=dd5908cdd4204271ab24ae08cb9bad94b54248c0;hpb=bee097b39b4f87d7708cbc7bebc46902705f2f64;p=koha-ffzg.git diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index dd5908cdd4..b90e7d4e23 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -52,15 +52,14 @@ Options: --marcflavor flavor Set the MARC flavor. Valid values are marc21 (default), normarc and unimarc. --zebralang lang Choose the primary language for Zebra indexing. Valid - values are cs, en (default), es, fr, gr, nb, ru and uk. - --auth-idx idx_mode Set the indexing mode for authority records. Valid - values are dom (default) and grs1. - --biblio-idx idx_mode Set the indexing mode for bibliographic records. - Valid values are dom (default) and grs1. + values are cs, el, en (default), es, fr, nb, ru and uk. + --elasticsearch-server s Enforce the use of the specified Elasticsearch server(s) + (default: localhost:9200). --memcached-servers str Set a comma-separated list of host:port memcached servers. --memcached-prefix str Set the desired prefix for the instance memcached namespace. - --enable-sru Enable the Z39.50/SRU server (default: disabled). - --sru-port Specifiy a TCP port number for the Z39.50/SRU server + --enable-sru Enable the Z39.50/SRU server in Zebra search engine + (default: disabled). + --sru-port Specify a TCP port number for Zebra's Z39.50/SRU server to listen on. (default: 7090). --defaultsql some.sql Specify a default SQL file to be loaded on the DB. --configfile cfg_file Specify an alternate config file for reading default values. @@ -102,17 +101,12 @@ generate_config_file() { -e "s/__SRU_BIBLIOS_PORT__/$SRU_SERVER_PORT/g" \ -e "s/__START_SRU_PUBLICSERVER__/$START_SRU_PUBLICSERVER/g" \ -e "s/__END_SRU_PUBLICSERVER__/$END_SRU_PUBLICSERVER/g" \ - -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \ - -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \ - -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \ - -e "s/__END_BIBLIOS_RETRIEVAL_INFO__/`echo $END_BIBLIOS_RETRIEVAL_INFO`/g" \ - -e "s/__START_AUTHORITIES_RETRIEVAL_INFO__/`echo $START_AUTHORITIES_RETRIEVAL_INFO`/g" \ - -e "s/__END_AUTHORITIES_RETRIEVAL_INFO__/`echo $END_AUTHORITIES_RETRIEVAL_INFO`/g" \ -e "s/__API_SECRET__/$API_SECRET/g" \ -e "s/__DB_NAME__/$mysqldb/g" \ -e "s/__DB_HOST__/$mysqlhost/g" \ -e "s/__DB_USER__/$mysqluser/g" \ -e "s/__DB_PASS__/$mysqlpwd/g" \ + -e "s/__ELASTICSEARCH_SERVER__/${ELASTICSEARCH_SERVER}/g" \ -e "s/__UNIXUSER__/$username/g" \ -e "s/__UNIXGROUP__/$username/g" \ -e "s#__TEMPLATE_CACHE_DIR__#$TEMPLATE_CACHE_DIR#g" \ @@ -157,16 +151,16 @@ check_apache_config() { # Check that mpm_itk is installed and enabled - if ! /usr/sbin/apachectl -M 2> /dev/null | grep -q 'mpm_itk'; then + if ! /usr/sbin/apachectl -M | grep -q 'mpm_itk'; then # Check Apache version APACHE_DISABLE_MPM_MSG="" if /usr/sbin/apache2ctl -v | grep -q "Server version: Apache/2.4"; then # mpm_event or mpm_worker need to be disabled first. mpm_itk depends # on mpm_prefork, which is enabled if needed. See # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734865 - if /usr/sbin/apachectl -M 2> /dev/null | grep -q 'mpm_event'; then + if /usr/sbin/apachectl -M | grep -q 'mpm_event'; then APACHE_DISABLE_MPM_MSG=" sudo a2dismod mpm_event ;" - elif /usr/sbin/apachectl -M 2> /dev/null | grep -q 'mpm_worker'; then + elif /usr/sbin/apachectl -M | grep -q 'mpm_worker'; then APACHE_DISABLE_MPM_MSG=" sudo a2dismod mpm_worker ;" # else mpm_prefork: a2enmod mpm_itk works fi @@ -185,7 +179,7 @@ EOM fi # Check that mod_rewrite is installed and enabled. - if ! /usr/sbin/apachectl -M 2> /dev/null | grep -q 'rewrite_module'; then + if ! /usr/sbin/apachectl -M | grep -q 'rewrite_module'; then cat 1>&2 < /dev/null | grep -q 'cgi_module'; then + if ! /usr/sbin/apachectl -M | grep -q 'cgi_module'; then cat 1>&2 << EOM Koha requires mod_cgi to be enabled within Apache in order to run. Typically this can be enabled with: @@ -210,7 +204,7 @@ EOM # Check that mod_ssl is installed and enabled. if [ "$CLO_LETSENCRYPT" = "yes" ]; then - if ! /usr/sbin/apachectl -M 2> /dev/null | grep -q 'ssl_module'; then + if ! /usr/sbin/apachectl -M | grep -q 'ssl_module'; then cat 1>&2 <\n - \n - -EOF` - - END_BIBLIOS_RETRIEVAL_INFO=`cat <\n - <\/xi:fallback>\n - <\/xi:include> -EOF` - ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg" -} - - -set_authorities_indexing_mode() -{ - local marc_format=$1 - - START_AUTHORITIES_RETRIEVAL_INFO=`cat <\n - \n - -EOF` - - END_AUTHORITIES_RETRIEVAL_INFO=`cat <\n - <\/xi:fallback>\n - <\/xi:include>\n -EOF` - ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg" -} - - set_memcached() { local instance="$1" @@ -390,6 +344,8 @@ PASSWDFILE="/etc/koha/passwd" USE_MEMCACHED="yes" MEMCACHED_SERVERS="" MEMCACHED_PREFIX="" +# elasticsearch config +ELASTICSEARCH_SERVER="localhost:9200" # hardcoded memcached defaults DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211" DEFAULT_MEMCACHED_PREFIX="koha_" @@ -414,11 +370,6 @@ DEFAULT_SRU_SERVER_PORT="7090" START_SRU_PUBLICSERVER="" -START_BIBLIOS_RETRIEVAL_INFO="" -END_BIBLIOS_RETRIEVAL_INFO="" -START_AUTHORITIES_RETRIEVAL_INFO="" -END_AUTHORITIES_RETRIEVAL_INFO="" - APACHE_CONFIGFILE="" if [ -e /etc/koha/koha-sites.conf ] @@ -428,7 +379,7 @@ fi [ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" ) -TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,tmp-path:,letsencrypt, \ +TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,elasticsearch-server:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,tmp-path:,letsencrypt, \ -n "$0" -- "$@"` # Note the quotes around `$TEMP': they are essential! @@ -441,6 +392,7 @@ CLO_DEFAULTSQL="" CLO_ADMINUSER="" CLO_MEMCACHED_SERVERS="" CLO_MEMCACHED_PREFIX="" +CLO_ELASTICSEARCH_SERVER="" CLO_UPLOAD_PATH="" CLO_TMP_PATH="" CLO_LETSENCRYPT="" @@ -461,6 +413,8 @@ while true ; do CLO_MEMCACHED_SERVERS="$2" ; shift 2 ;; --memcached-prefix) CLO_MEMCACHED_PREFIX="$2" ; shift 2;; + --elasticsearch-server) + CLO_ELASTICSEARCH_SERVER="$2" ; shift 2 ;; -m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; -l|--zebralang) @@ -537,18 +491,14 @@ if [ "$CLO_TIMEZONE" != "" ]; then TIMEZONE=$CLO_TIMEZONE fi -if [ "$CLO_BIBLIOS_INDEXING_MODE" != "" ]; then - BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE +if [ "${CLO_ELASTICSEARCH_SERVER}" != "" ]; then + ELASTICSEARCH_SERVER="${CLO_ELASTICSEARCH_SERVER}" fi -set_biblios_indexing_mode $ZEBRA_MARC_FORMAT - if [ "$ENABLE_SRU" != "no" ]; then enable_sru_server fi -set_authorities_indexing_mode $ZEBRA_MARC_FORMAT - [ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) name="$1" @@ -569,7 +519,13 @@ NO_DB die; fi -set_memcached $name +if [ "$USE_MEMCACHED" = "no" ]; then + MEMCACHED_SERVERS="" + MEMCACHED_NAMESPACE="" + MEMCACHED_PREFIX="" +else + set_memcached $name +fi # Set template cache dir if [ "$CLO_TEMPLATE_CACHE_DIR" != "" ]; then @@ -636,7 +592,8 @@ if [ "$op" = create ] || [ "$op" = request ] || [ "$op" = use ] then if [ "$mysqlpwd" = "" ] then - mysqlpwd="$(pwgen -s 16 1)" + mysqlpwd="$(pwgen -s 15 1)" + mysqlpwd="$mysqlpwd@" fi else mysqlpwd="$(getinstancemysqlpassword $name)" @@ -680,8 +637,6 @@ then mysql $MYSQL_OPTIONS <