Trim server, bugs and thoughts

Make instance

The script is suppose to change owner of all files to something like apache/apache but it doesnt do it for the vendor folder and also the db/local.php file.
Sometimes the install fails with no errors message. Seems it didnt run sh setup.sh properly. (related to at least 15.0, see below)
Maybe make the installation more verbose? If something goes wrong we would see it.

I get this when running sh setup.sh (on tiki 15.0/15.1/15.2)

Installing sam152/javascript-equal-height-responsive-rows (1.0.0): Downloading (100%)

The checksum verification of the file failed (downloaded from https://composer.tiki.org/dist/sam152-javascript-equal-height-responsive-rows-1.0.0.zip)

Might be why the instance doesn't end properly...
Tiki 15.3+/16.x is ok

@Benoit: We had several problems with this for a while ( ex.: https://tiki.org/forumthread57445 ). It's all solved in recent versions.I think that is same behavior than if someone installs manually. Can you confirm? And if so, we have a dilemma. Should we exclude from TRIM the versions that we know can't install cleanly?

Make check

The docs says that "Upon first run, the check will ask where it should fetch the hashes from." Didnt happen for me. Happens sometimes but not all the time.
For the new files, see make update below.

@Benoit: ok, please retest after Ricardo fixes make update and make upgrade

Make update

Not sure what this is suppose to do. Lets say the instance is 16.0 and i do the update. Shouldnt it update to the latest 16x (which is 16.2) ? because right now it stays at 16.0.
The instance creates db/local.php and maintenance.php after installation so it will show up in the list of 'new files found on remote host' after the update. Should those be excluded? It will ask about those files everytime we do an update (if we skip).
If we quit (crtl-c) the script after choosing the instance, it will stay in maintenance mode.
Not sure if the automatic update worked. It seems to be setup so all instances are updated even if we choose one.
@Benoit: I asked Ricardo to take a look

Make upgrade

The doc says that a downgrade is not possible so it would be best if the user doesnt see them in the list.
After the upgrade it check for new files and ends up showing all tiki files. 3000+ :-)
If we quit (crtl-c) the script after choosing the instance, it will stay in maintenance mode.

I get this message on every choice

PHP Notice:  Undefined offset: 0 in /root/trimthatbeard/scripts/update.php on line 60

@Benoit: I asked Ricardo to take a look

Make convert

Didnt test since i dont see any cvs to install.
@Benoit: I asked Fabio to retire this feature

Make fix

Works fine but permissions defaults to apache/apache which may not be ideal.
@Benoit: That is what Darryl (core dev of ClearOS) picked: https://sourceforge.net/p/tikiwiki/code/62734/ so it must good. But now it needs to be ported to https://sourceforge.net/p/tikiwiki/code/HEAD/tree/trunk/setup.sh

Make access

This doesn't do anything on a local instance so it should remove those instances from the choices.
@Benoit: I think it should move you to the proper directory. Agreed?

Make watch

Will know at midnight if it did something..

Make backup

Normal backup: All good.
Automatic backup: Only backup the first instance, not the others. Each instance backup happens 2h after the previous one.
@benoit: are you sure? I got it to set each 24 hours, as per docs. See below

[root@mern ~]# crontab -l
0 0 * * * /usr/bin/php -d memory_limit=256M /root/trim/scripts/backup.php all

Make restore

All good. But maybe output if there is no blank instance.
@Benoit: So something like: "There is no blank instance to restore to, so exiting" ?

Make delete

All good.

Make enablewww

The script states that...

Permissions on the data folder will be changed to allow the web server to
access the files.

For example, if your web root is /var/www
* A link will be created from /var/www/webtrim ===> /root/trimthatbeard/www
* TRIM web administration will be accessible from:
* You must have write access in /var/www

Symbolic link wasnt created and for that reason access to http://url/webtrim is not possible.

@Benoit: ok, we will revisit when we add your nice Bootstrap interface

Make viewdb

All good.

Make profile

It asks for the instance to apply a profile but it doesnt list those instances like for the other commands.
After choosing the tiki profile repository, it just prompts for a profile. Its a little confusing of what exactly the script wants. Maybe show a list of profiles?

Make report

Didnt test.

Make copysshkey

Same as make profile, It asks for the instance to copy the SSH key but it doesnt list the instances.
Not sure where it suppose to copy the key to or if it did anything at all.

Make detect

All good.

Make clean

All good.

Make debug

Generates an error

Could not open input file: scripts/debug.php

That file doesnt exist.

@Benoit: ok, I asked Fabio to fix

Make clone

All good. But maybe output if there is no blank instance.

I think the biggest need for the command line version of the server is to make it more verbose. Some commands doesn't output anything so we don't know if it was a success or not . Same thing if there are errors except when its an error generated by PHP or the OS. Commands where i wrote 'all good' means that it 'seems' to work correctly to my best of my sysadmin knowledge :O)

@ Benoit: I transferred your comment to https://dev.tiki.org/TRIM+Revamp

Sometimes the list of instances disappears like if we use make delete. Not sure what is causing it.