View | Details | Raw Unified | Return to bug 20428
Collapse All | Expand All

(-)a/Koha/UploadedFile.pm (-1 / +4 lines)
Lines 168-174 Returns root directory for temporary storage Link Here
168
168
169
sub temporary_directory {
169
sub temporary_directory {
170
    my ( $class ) = @_;
170
    my ( $class ) = @_;
171
    return C4::Context->config('upload_tmp_path') || File::Spec->tmpdir;
171
    my $temporary_directory = ( C4::Context->config('tmp_path') )
172
            ? C4::Context->config('tmp_path') . '/uploads'
173
            : File::Spec->tmpdir;
174
    return $temporary_directory;
172
}
175
}
173
176
174
=head3 _type
177
=head3 _type
(-)a/about.pl (-3 / +4 lines)
Lines 24-29 use Modern::Perl; Link Here
24
24
25
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
26
use DateTime::TimeZone;
26
use DateTime::TimeZone;
27
use File::Spec;
27
use List::MoreUtils qw/ any /;
28
use List::MoreUtils qw/ any /;
28
use LWP::Simple;
29
use LWP::Simple;
29
use Module::Load::Conditional qw(can_load);
30
use Module::Load::Conditional qw(can_load);
Lines 261-270 if ( ! defined C4::Context->config('upload_path') ) { Link Here
261
    }
262
    }
262
}
263
}
263
264
264
if ( ! defined C4::Context->config('upload_tmp_path') ) {
265
if ( ! defined C4::Context->config('tmp_path') ) {
265
    push @xml_config_warnings, {
266
    push @xml_config_warnings, {
266
        error                    => 'uploadtmppath_entry_missing',
267
        error             => 'tmp_path_entry_missing',
267
        effective_upload_tmp_dir => Koha::UploadedFile->temporary_directory
268
        effective_tmp_dir => File::Spec->tmpdir
268
    }
269
    }
269
}
270
}
270
271
(-)a/debian/docs/koha-create.xml (-4 / +4 lines)
Lines 42-48 Link Here
42
      <arg><option>--template-cache-dir</option> directory</arg>
42
      <arg><option>--template-cache-dir</option> directory</arg>
43
      <arg><option>--timezone</option> time/zone</arg>
43
      <arg><option>--timezone</option> time/zone</arg>
44
      <arg><option>--upload-path</option> directory</arg>
44
      <arg><option>--upload-path</option> directory</arg>
45
      <arg><option>--upload-tmp-path</option> directory</arg>
45
      <arg><option>--tmp-path</option> directory</arg>
46
      <arg><option>--letsencrypt</option></arg>
46
      <arg><option>--letsencrypt</option></arg>
47
      <arg><option>--help</option>|<option>-h</option></arg>
47
      <arg><option>--help</option>|<option>-h</option></arg>
48
48
Lines 203-212 Link Here
203
    </varlistentry>
203
    </varlistentry>
204
204
205
    <varlistentry>
205
    <varlistentry>
206
      <term><option>--upload-tmp-path</option></term>
206
      <term><option>--tmp-path</option></term>
207
      <listitem>
207
      <listitem>
208
        <para>Specify a <option>directory</option> for storing the temporarily uploaded files of the instance.
208
        <para>Specify a <option>directory</option> for storing the temporary files. For example temporarily
209
              It defaults to <filename>/var/lib/koha/instance/uploads_tmp</filename>.</para>
209
              uploaded files of the instance. It defaults to <filename>/var/lib/koha/instance/tmp</filename>.</para>
210
      </listitem>
210
      </listitem>
211
    </varlistentry>
211
    </varlistentry>
212
212
(-)a/debian/scripts/koha-create (-17 / +17 lines)
Lines 74-81 Options: Link Here
74
  --timezone time/zone      Specify a timezone. e.g. America/Argentina
74
  --timezone time/zone      Specify a timezone. e.g. America/Argentina
75
  --upload-path dir         Set a user defined upload_path. It defaults to
75
  --upload-path dir         Set a user defined upload_path. It defaults to
76
                            /var/lib/koha/<instance>/uploads
76
                            /var/lib/koha/<instance>/uploads
77
  --upload-tmp-path dir     Set a user defined upload_tmp_path. It defaults to
77
  --tmp-path dir            Set a user defined tmp_path. It defaults to
78
                            /var/lib/koha/<instance>/uploads_tmp
78
                            /var/lib/koha/<instance>/tmp
79
  --letsencrypt             Set up a https-only site with letsencrypt certificates
79
  --letsencrypt             Set up a https-only site with letsencrypt certificates
80
  --help,-h                 Show this help.
80
  --help,-h                 Show this help.
81
81
Lines 120-126 generate_config_file() { Link Here
120
        -e "s#__TEMPLATE_CACHE_DIR__#$TEMPLATE_CACHE_DIR#g" \
120
        -e "s#__TEMPLATE_CACHE_DIR__#$TEMPLATE_CACHE_DIR#g" \
121
        -e "s#__TIMEZONE__#$TIMEZONE#g" \
121
        -e "s#__TIMEZONE__#$TIMEZONE#g" \
122
        -e "s#__UPLOAD_PATH__#$UPLOAD_PATH#g" \
122
        -e "s#__UPLOAD_PATH__#$UPLOAD_PATH#g" \
123
        -e "s#__UPLOAD_TMP_PATH__#$UPLOAD_TMP_PATH#g" \
123
        -e "s#__TMP_PATH__#$TMP_PATH#g" \
124
        -e "s/__LOG_DIR__/\/var\/log\/koha\/$name/g" \
124
        -e "s/__LOG_DIR__/\/var\/log\/koha\/$name/g" \
125
        -e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \
125
        -e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \
126
        -e "s/__MEMCACHED_NAMESPACE__/$MEMCACHED_NAMESPACE/g" \
126
        -e "s/__MEMCACHED_NAMESPACE__/$MEMCACHED_NAMESPACE/g" \
Lines 328-345 set_upload_path() Link Here
328
    if [ "$CLO_UPLOAD_PATH" != "" ]; then
328
    if [ "$CLO_UPLOAD_PATH" != "" ]; then
329
        UPLOAD_PATH=$CLO_UPLOAD_PATH
329
        UPLOAD_PATH=$CLO_UPLOAD_PATH
330
    else
330
    else
331
        UPLOAD_PATH="$UPLOAD_PATH_BASE/$instance/$UPLOAD_DIR"
331
        UPLOAD_PATH="$INSTANCE_PATH_BASE/$instance/$UPLOAD_DIR"
332
    fi
332
    fi
333
}
333
}
334
334
335
set_upload_tmp_path()
335
set_tmp_path()
336
{
336
{
337
    local instance="$1"
337
    local instance="$1"
338
338
339
    if [ "$CLO_UPLOAD_TMP_PATH" != "" ]; then
339
    if [ "$CLO_TMP_PATH" != "" ]; then
340
        UPLOAD_TMP_PATH=$CLO_UPLOAD_TMP_PATH
340
        TMP_PATH=$CLO_TMP_PATH
341
    else
341
    else
342
        UPLOAD_TMP_PATH="$UPLOAD_PATH_BASE/$instance/$UPLOAD_TMP_DIR"
342
        TMP_PATH="$INSTANCE_PATH_BASE/$instance/$TMP_DIR"
343
    fi
343
    fi
344
}
344
}
345
345
Lines 425-439 MEMCACHED_PREFIX="" Link Here
425
# hardcoded memcached defaults
425
# hardcoded memcached defaults
426
DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211"
426
DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211"
427
DEFAULT_MEMCACHED_PREFIX="koha_"
427
DEFAULT_MEMCACHED_PREFIX="koha_"
428
# hardcoded upload_path
428
# hardcoded instance base path
429
UPLOAD_PATH_BASE="/var/lib/koha"
429
INSTANCE_PATH_BASE="/var/lib/koha"
430
UPLOAD_DIR="uploads"
430
UPLOAD_DIR="uploads"
431
UPLOAD_PATH=""
431
UPLOAD_PATH=""
432
# timezone defaults to empty
432
# timezone defaults to empty
433
TIMEZONE=""
433
TIMEZONE=""
434
# hardcoded upload_tmp_path
434
# hardcoded upload_tmp_path
435
UPLOAD_TMP_DIR="uploads_tmp"
435
TMP_DIR="tmp"
436
UPLOAD_TMP_PATH=""
436
TMP_PATH=""
437
# cache base dir
437
# cache base dir
438
CACHE_DIR_BASE="/var/cache/koha"
438
CACHE_DIR_BASE="/var/cache/koha"
439
# Generate a randomizaed API secret
439
# Generate a randomizaed API secret
Lines 464-470 fi Link Here
464
464
465
[ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" )
465
[ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" )
466
466
467
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:,upload-tmp-path:,letsencrypt, \
467
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, \
468
     -n "$0" -- "$@"`
468
     -n "$0" -- "$@"`
469
469
470
# Note the quotes around `$TEMP': they are essential!
470
# Note the quotes around `$TEMP': they are essential!
Lines 480-486 CLO_AUTHORITIES_INDEXING_MODE="" Link Here
480
CLO_MEMCACHED_SERVERS=""
480
CLO_MEMCACHED_SERVERS=""
481
CLO_MEMCACHED_PREFIX=""
481
CLO_MEMCACHED_PREFIX=""
482
CLO_UPLOAD_PATH=""
482
CLO_UPLOAD_PATH=""
483
CLO_UPLOAD_TMP_PATH=""
483
CLO_TMP_PATH=""
484
CLO_LETSENCRYPT=""
484
CLO_LETSENCRYPT=""
485
CLO_TEMPLATE_CACHE_DIR=""
485
CLO_TEMPLATE_CACHE_DIR=""
486
CLO_TIMEZONE=""
486
CLO_TIMEZONE=""
Lines 529-536 while true ; do Link Here
529
            CLO_TIMEZONE="$2" ; shift 2 ;;
529
            CLO_TIMEZONE="$2" ; shift 2 ;;
530
        --upload-path)
530
        --upload-path)
531
            CLO_UPLOAD_PATH="$2" ; shift 2 ;;
531
            CLO_UPLOAD_PATH="$2" ; shift 2 ;;
532
        --upload-tmp-path)
532
        --tmp-path)
533
            CLO_UPLOAD_TMP_PATH="$2" ; shift 2 ;;
533
            CLO_TMP_PATH="$2" ; shift 2 ;;
534
        --letsencrypt)
534
        --letsencrypt)
535
            CLO_LETSENCRYPT="yes" ; shift ;;
535
            CLO_LETSENCRYPT="yes" ; shift ;;
536
        -h|--help)
536
        -h|--help)
Lines 600-606 set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT Link Here
600
name="$1"
600
name="$1"
601
601
602
set_upload_path $name
602
set_upload_path $name
603
set_upload_tmp_path $name
603
set_tmp_path $name
604
604
605
if [ "$op" = use ] && [ "$CLO_DATABASE" = "" ] &&
605
if [ "$op" = use ] && [ "$CLO_DATABASE" = "" ] &&
606
   ( [ ! -f "$PASSWDFILE" ] || [ ! `cat $PASSWDFILE | grep "^$name:"` ] )
606
   ( [ ! -f "$PASSWDFILE" ] || [ ! `cat $PASSWDFILE | grep "^$name:"` ] )
(-)a/debian/scripts/koha-create-dirs (-1 / +2 lines)
Lines 55-61 do Link Here
55
    userdir "$name" "/var/lib/koha/$name/biblios/tmp"
55
    userdir "$name" "/var/lib/koha/$name/biblios/tmp"
56
    userdir "$name" "/var/lib/koha/$name/plugins"
56
    userdir "$name" "/var/lib/koha/$name/plugins"
57
    userdir "$name" "/var/lib/koha/$name/uploads"
57
    userdir "$name" "/var/lib/koha/$name/uploads"
58
    userdir "$name" "/var/lib/koha/$name/uploads_tmp"
58
    userdir "$name" "/var/lib/koha/$name/tmp"
59
    userdir "$name" "/var/lib/koha/$name/tmp/uploads"
59
    userdir "$name" "/var/lock/koha/$name"
60
    userdir "$name" "/var/lock/koha/$name"
60
    userdir "$name" "/var/lock/koha/$name/authorities"
61
    userdir "$name" "/var/lock/koha/$name/authorities"
61
    userdir "$name" "/var/lock/koha/$name/biblios"
62
    userdir "$name" "/var/lock/koha/$name/biblios"
(-)a/debian/templates/koha-conf-site.xml.in (-1 / +1 lines)
Lines 261-267 __END_SRU_PUBLICSERVER__ Link Here
261
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
261
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
262
 <enable_plugins>0</enable_plugins>
262
 <enable_plugins>0</enable_plugins>
263
 <upload_path>__UPLOAD_PATH__</upload_path>
263
 <upload_path>__UPLOAD_PATH__</upload_path>
264
 <upload_tmp_path>__UPLOAD_TMP_PATH__</upload_tmp_path>
264
 <tmp_path>__TMP_PATH__</tmp_path>
265
 <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>
265
 <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir>
266
 <opacdir>/usr/share/koha/opac/cgi-bin/opac</opacdir>
266
 <opacdir>/usr/share/koha/opac/cgi-bin/opac</opacdir>
267
 <opachtdocs>/usr/share/koha/opac/htdocs/opac-tmpl</opachtdocs>
267
 <opachtdocs>/usr/share/koha/opac/htdocs/opac-tmpl</opachtdocs>
(-)a/etc/koha-conf.xml (-1 / +1 lines)
Lines 93-99 __PAZPAR2_TOGGLE_XML_POST__ Link Here
93
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
93
 <pluginsdir>__PLUGINS_DIR__</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
94
 <enable_plugins>0</enable_plugins>
94
 <enable_plugins>0</enable_plugins>
95
 <upload_path></upload_path>
95
 <upload_path></upload_path>
96
 <upload_tmp_path></upload_tmp_path>
96
 <tmp_path></tmp_path>
97
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
97
 <intranetdir>__INTRANET_CGI_DIR__</intranetdir>
98
 <opacdir>__OPAC_CGI_DIR__/opac</opacdir>
98
 <opacdir>__OPAC_CGI_DIR__/opac</opacdir>
99
 <opachtdocs>__OPAC_TMPL_DIR__</opachtdocs>
99
 <opachtdocs>__OPAC_TMPL_DIR__</opachtdocs>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-5 / +4 lines)
Lines 414-425 Link Here
414
                        Also note that you need to properly set the OPACBaseURL preference for the file upload plugin to work.
414
                        Also note that you need to properly set the OPACBaseURL preference for the file upload plugin to work.
415
                    </td>
415
                    </td>
416
                </tr>
416
                </tr>
417
                [% ELSIF config_entry.error == 'uploadtmppath_entry_missing' %]
417
                [% ELSIF config_entry.error == 'tmp_path_entry_missing' %]
418
                <tr>
418
                <tr>
419
                    <th scope="row"><b>Warning</b></th>
419
                    <th scope="row"><b>Warning</b></th>
420
                    <td>You are missing the &lt;upload_tmp_path&gt; entry in your koha-conf.xml file. Please
420
                    <td>You are missing the &lt;tmp_path&gt; entry in your koha-conf.xml file. Please
421
                        add it, pointing to the configured temporary file upload directory for your Koha instance.
421
                        add it, pointing to the configured temporary directory for your Koha instance.
422
                        The effective temporary file upload directory is '[% config_entry.effective_upload_tmp_dir %]'
422
                        The effective temporary directory is '[% config_entry.effective_tmp_dir %]'.
423
                    </td>
423
                    </td>
424
                </tr>
424
                </tr>
425
                [% END %]
425
                [% END %]
426
- 

Return to bug 20428