Skip to content

Commit

Permalink
Bug 17336: Add api_secret_passphrase entry in packages setup
Browse files Browse the repository at this point in the history
Bug 13799 introduced the api_secret_passphrase on source installs, but missed to do so on packages.

This patch introduces the entry on the template koha-conf-site.xml.in file, and
patches koha-create so it generates a randomized string (64 chars) to put in it.

To test:
- Apply the patch
- Grab the new template file:
  $ sudo cp kohaclone/debian/templates/koha-conf-site.xml.in \
            /etc/koha
- Create a new instance:
  $ kohaclone/debian/scripts/koha-create --create-db blah
=> SUCCESS: The script runs fine, /etc/koha/sites/blah/koha-conf.xml
   contains the api_secret_passphrase entry.
- Sign off :-D

Signed-off-by: Josef Moravec <[email protected]>

Signed-off-by: Kyle M Hall <[email protected]>

Signed-off-by: Kyle M Hall <[email protected]>
  • Loading branch information
tomascohen authored and kylemhall committed Sep 25, 2016
1 parent ea5ec8c commit 242722e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion debian/scripts/koha-create
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ generate_config_file() {
-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" \
Expand Down Expand Up @@ -403,7 +404,8 @@ DEFAULT_MEMCACHED_PREFIX="koha_"
UPLOAD_PATH_BASE="/var/lib/koha"
UPLOAD_DIR="uploads"
UPLOAD_PATH=""
# Generate a randomizaed API secret
API_SECRET="$(pwgen -s 64 1)"
# SRU server variables
ENABLE_SRU="no"
SRU_SERVER_PORT=""
Expand Down
5 changes: 4 additions & 1 deletion debian/templates/koha-conf-site.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ __END_SRU_PUBLICSERVER__
<memcached_servers>__MEMCACHED_SERVERS__</memcached_servers>
<memcached_namespace>__MEMCACHED_NAMESPACE__</memcached_namespace>

<!-- true type font mapping accoding to type from $font_types in C4/Creators/Lib.pm -->
<!-- Secret passphrase used by Mojolicious for signed cookies -->
<api_secret_passphrase>__API_SECRET__</api_secret_passphrase>

<!-- true type font mapping accoding to type from $font_types in C4/Creators/Lib.pm -->
<ttf>
<font type="TR" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf</font>
<font type="TB" >/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif-Bold.ttf</font>
Expand Down

0 comments on commit 242722e

Please sign in to comment.