mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
Merge pull request #4840 from nextcloud/enh/4793/print-warning
nextcloud: print warning if login as root into container
This commit is contained in:
commit
d19e2aa52d
2 changed files with 6 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ COPY --chmod=775 *.sh /
|
||||||
COPY --chmod=774 upgrade.exclude /upgrade.exclude
|
COPY --chmod=774 upgrade.exclude /upgrade.exclude
|
||||||
COPY config/*.php /
|
COPY config/*.php /
|
||||||
COPY supervisord.conf /supervisord.conf
|
COPY supervisord.conf /supervisord.conf
|
||||||
|
COPY root.motd /root.motd
|
||||||
|
|
||||||
VOLUME /mnt/ncdata
|
VOLUME /mnt/ncdata
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
|
|
@ -256,6 +257,7 @@ RUN set -ex; \
|
||||||
mkdir -p /nc-updater; \
|
mkdir -p /nc-updater; \
|
||||||
chown -R www-data:www-data /nc-updater; \
|
chown -R www-data:www-data /nc-updater; \
|
||||||
chmod -R 770 /nc-updater; \
|
chmod -R 770 /nc-updater; \
|
||||||
|
echo "[ -n \"$TERM\" ] && cat /root.motd" >> /root/.bashrc; \
|
||||||
\
|
\
|
||||||
# Give root a random password
|
# Give root a random password
|
||||||
echo "root:$(openssl rand -base64 12)" | chpasswd
|
echo "root:$(openssl rand -base64 12)" | chpasswd
|
||||||
|
|
|
||||||
4
Containers/nextcloud/root.motd
Normal file
4
Containers/nextcloud/root.motd
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
Warning: You have logged in into the Nextcloud container as root user.
|
||||||
|
See https://github.com/nextcloud/all-in-one#how-to-run-occ-commands if you want to run occ commands.
|
||||||
|
Apart from that, you can use 'sudo -u www-data -E php occ <your-command>' in order to run occ commands.
|
||||||
|
Of course <your-command> needs to be substituted with the command that you want to use.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue