nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.55k stars 4.08k forks source link

Add `autoconfig.php` support to `occ maintenance:install` #8524

Open jficz opened 6 years ago

jficz commented 6 years ago

Currently,

occ maintenance:install

does not make use of autoconfig.php. Instead, all parameters must be specified on command line. It would be nice if occ install behaviour was consistent with "first visit" installation and used autoconfig.php if it is available, not to mention security implications (such as not needing to specify password on command line).

NextCloud version 13.0.0

-cM.

rodrigoaguilera commented 6 years ago

What I currently do is using wget to make a "first visit" so nextcloud gets installed

jalcine commented 6 years ago

Ha, for the longest, I thought I was doing something wrong.

Using the prodding of the server works for now, but running maintenance:install to handle autoconfig.php would allow for a truly automated install imo.

oucil commented 4 years ago

I'm using the same method as @rodrigoaguilera, though using Ansible to request the web facing page while utilizing the autoconfig.php. Just wondering if there has been any progress on this as we're in need of this capability... I see some mentions but it's obviously still open. It's also two years old and several versions have since passed so was hoping it's just undocumented?

joshtrichards commented 6 months ago

If someone wishes to work on this, here are some hints.

The web installer uses autoconfig.php here:

https://github.com/nextcloud/server/blob/6fc2c47a268aca6c3b17fa90cbb155827bf36e80/core/Controller/SetupController.php#L124-L144

occ maintenance:install would need support added to load from the autoconfig.php rather than the command line here:

https://github.com/nextcloud/server/blob/6fc2c47a268aca6c3b17fa90cbb155827bf36e80/core/Command/Maintenance/Install.php

Kixunil commented 4 months ago

FYI with autoconfig.php you can simply run index.php from CLI to get the same behavior as running occ maintenance:install.