pkp/docker-ojs

ojs-cli-install not working

Closed this issue · 1 comments

When running "ojs-cli-install" helper as follows:

docker exec -it ojs_app_journalname /usr/local/bin/ojs-cli-install 

The script complains due SSL certificat issue (don't like it to be self-signed).

[OJS CLI Install] First time running this container, preparing...
[OJS CLI Install] Calling the install using pre-defined variables...
curl: (60) SSL certificate problem: self-signed certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
[OJS CLI Install] DONE!

Solution
Not everybody will be able or like to run containers with a certificate so easiest solution is letting curl ignore the certificate issuewith -k or --ignore params.

The "--ignore" flag (better than -k because it's more clear) was tested as follows.

SERVERNAME="foo.net" && \
OJS_DB_HOST="db" && \
OJS_DB_PASSWORD="ojsPwd" && \
OJS_DB_USER=ojs && \
OJS_DB_NAME=ojs && \
echo "OJS_DB_NAME: $OJS_DB_NAME" && \
curl --ignore "https://${SERVERNAME}/index/install/install" --data "installing=0&adminUsername=admin&adminPassword=admin&adminPassword2=admin&adminEmail=admin%40${SERVERNAME}.org&locale=en_US&additionalLocales%5B%5D=en_US&clientCharset=utf-8&connectionCharset=utf8&databaseCharset=utf8&filesDir=%2Fvar%2Fwww%2Ffiles&databaseDriver=mysqli&databaseHost=${OJS_DB_HOST}&databaseUsername=${OJS_DB_USER}&databasePassword=${OJS_DB_PASSWORD}&databaseName=${OJS_DB_NAME}&oaiRepositoryId=${SERVERNAME}&enableBeacon=0" --compressed

The solution works fine and was already included as a bugfix for next release, but the script assumes a lot of variables (locale, charsets, beacon...) that could not be overwritten. It could be fixed after install with ojs-variable but it's better to avoid harcoding them and set a default value.

If got time I will fill a new issue to take care of this.