owncloud-archive / vm

Scripts to build an ownCloud community production VM - this was in use until 9.1.x releases. Since 10.0.1 we build appliances with Univention
https://www.univention.de/produkte/univention-app-center/app-katalog/owncloud/
23 stars 14 forks source link

setup-when-admin.sh script breaks login window on reboot #40

Closed JKawohl closed 8 years ago

JKawohl commented 8 years ago

Steps to reproduce: 1.Build new vm.

  1. boot it
  2. do not enter the admin credentials:

shut down and reboot.

Instead of the "normal" login page with the credentials and stuff, there is just a login as admin.... even though no new credentials were entered. Could you take a look @enoch85.

enoch85 commented 8 years ago

I'll have a look later tonight. Strange because it shouldn't change anything if it's not run.

enoch85 commented 8 years ago

@Kawohl How can you be sure that it's that specific script that breaks the login? If it's not run, nothing should change. Maybe the error is in check-init.sh instead.

enoch85 commented 8 years ago

@Kawohl Had a quick look. Maybe this check doesn't work: https://github.com/owncloud/vm/blob/master/vagrant/oc8ce/check-init.sh#L19-L20 and that's why the password is set every time. You could check by commenting out https://github.com/owncloud/vm/blob/master/vagrant/oc8ce/check-init.sh#L22-L42 and add

echo "Password will change" && sleep 10  ## if this is the case, the code is broken.
else "Password will not change" && sleep 10

This is on the second run (reboot)

enoch85 commented 8 years ago

Just tested now, and there seems to be more issues than just this one.

Installed on VBox 5.0 - Ubuntu Mate 15.10 - Vagrant 1.8.0. Build is failing, this needs some love, definitely. As I'm done with my VMs I will have a look when I have some time left over. Added you on Skype @Kawohl so we can chat there. Haven't seen @jnweiger around for a while, is he on vacation?

JKawohl commented 8 years ago

@enoch85 I´ve removed the setup-when-admin script and get the regular login. It takes the credentials from the first boot again.

I think the main problem is right here: https://github.com/owncloud/vm/blob/master/vagrant/oc8ce/setup-when-admin.sh#L44-L56

Would it be better to echo the new credentials in to the init credentials file? So the user has a dropback when he forgets his credentials? Of course that is a security issue. On the other hand it seems that we need a fallback method if somebody forgets his credentials. @jnweiger what do you think?

enoch85 commented 8 years ago

@Kawohl Just tested with a freshly built VM. It works. It's impossible for the password to change if you don't run the script (which is run when you login as admin in Ubuntu shell).

So the script is not the issue, but maybe it shouldn't be run when you login as admin?

And btw, the script is run so that the user can choose his own PW.

JKawohl commented 8 years ago

@enoch85 you're right i am not able to reproduce this anymore!?.... In any case imho we need a fallback method so administrators can login again, even if they forgot their credentials. I suggest we continue the discussion at https://github.com/owncloud/vm/issues/39