Is it possible to pass arguments on tools/install.php?

Hello,
I am trying to build a docker image of ojs, and I want to use the cli tool “tools/install.php”,

Is it possible to pass arguments on the script “tools/install.php” ?

something like :

php tools/install.php --locale=fr_FR --db-host=localhost --db-user=john --db-password=dfkz

I tried “php tools/install.php --help” but it displays no help, it would be great if this command line tool can be run in a script with arguments, in order to do an automatic installation of OJS,

thanks

Hi @pdupond,

Not currently, unfortunately – but for a work-around, you can use curl to submit a POST to the installation form, as the Vagrant scripts used to do: vagrant/ojs.sh at ojs-stable-2_4_8 · pkp/vagrant · GitHub

(That’s for OJS 2.4.x, but it’ll be roughly the same for 3.x.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher

I asked this question because I am trying to use the docker image of OJS made by @lucasdiedrich , and I notice that his ojs-cli-install script doesn’t work, he uses also a curl command, a GET request :

https://github.com/lucasdiedrich/ojs/blob/master/files/usr/local/bin/ojs-cli-install

Do you a see an error in his script ?

Thanks

Hi @pdupond,

I think @marc has worked with this recently – tagging him.

Regards,
Alec Smecher
Public Knowledge Project Team

Hey @pdupond, can you please inform me which version of docker image are you using? its the latest one?

@lucasdiedrich : I use the version ojs-3_1_1-4 (master branch of your github)

your curl command in ojs-cli-install script doesn’t work, probably wrong arguments for the curl command

Thats why i’m asking, because i have just tested using one new docker-compose file and it works like a charm.

Can you provide the full command that you used to run your container?

Just to inform,we’re looking at this at Issue16

Thanks.

1 Like

@lucasdiedrich :
I found the cause of the error, in your curl command the adminEmail parameter is not correct (bad syntax), check here :

&adminEmail=admin%40${SERVERNAME}&locale=en_US

for example if $SERVERNAME=localhost then the email will be : admin@localhost, but the install form (OJS 3.1.1.1-4) will refuse this kind of email address,

because install form will expect this syntax for email address : xxxx@xxxx.xx (for example admin@localhost.fr is correct)

the fix is very simple, just add “.org” in your curl command:

&adminEmail=admin%40${SERVERNAME}.org

or set a fake address :

&adminEmail=admin%40example.org&locale=en_US

1 Like

Thanks for that, but the severname should always be the FQDN name, i think the docs doesn’t make it clear. Thanks a lot for your help, going to see what i’m going to do with that.

1 Like

It’s great when you arrive to an issue and eveything is fixed. :slight_smile:

@asmecher no pressure at all, but the install-cli script (with params) is getting points to be up in the wish list, isn’t it?

I didn’t look into the install.php code, but looks like most of the work is done and we only need to add a few conditions to the script to make it work.

Alec, any indications if “somebody” finds time to do the job?

Cheers,
m.