Skip to content

Commit

Permalink
docker: fix persist ncp-web password
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Jun 19, 2018
1 parent 683cbc8 commit c727d65
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

[v0.57.6](https://github.com/nextcloud/nextcloudpi/commit/8ab0187) (2018-06-19) fix mysqld service named mysql
[v0.57.7](https://github.com/nextcloud/nextcloudpi/commit/619812c) (2018-06-19) docker: fix persist ncp-web password

[v0.57.5](https://github.com/nextcloud/nextcloudpi/commit/e75b574) (2018-06-18) fix nextcloud-domain running before default GW is ready
[v0.57.6 ](https://github.com/nextcloud/nextcloudpi/commit/9d0d3b3) (2018-06-19) fix mysqld service named mysql

[v0.57.5 ](https://github.com/nextcloud/nextcloudpi/commit/e75b574) (2018-06-18) fix nextcloud-domain running before default GW is ready

[v0.57.4 ](https://github.com/nextcloud/nextcloudpi/commit/ce2d38c) (2018-06-18) letsencrypt: install from debian package

Expand Down
1 change: 0 additions & 1 deletion docker-common/nextcloudpi/000ncp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ source /usr/local/etc/library.sh
persistent_cfg /usr/local/etc/ncp-config.d /data/ncp
persistent_cfg /etc/services-enabled.d
persistent_cfg /etc/letsencrypt/live # persist SSL certificates
# TODO
persistent_cfg /etc/shadow # persist ncp-web password

exit 0
2 changes: 1 addition & 1 deletion etc/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function persistent_cfg()
local DST="${2:-/data/etc/$( basename "$SRC" )}"
test -e /changelog.md && return # trick to disable in dev docker
mkdir -p "$( dirname "$DST" )"
test -d "$DST" || {
test -e "$DST" || {
echo "Making $SRC persistent ..."
mv "$SRC" "$DST"
}
Expand Down
9 changes: 9 additions & 0 deletions etc/ncp-config.d/nc-passwd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ DESCRIPTION="Change password for the NextCloudPi Panel"

configure()
{
# update password
echo -e "$PASSWORD_\n$CONFIRM_" | passwd ncp &>/dev/null && \
echo "password updated successfully" || \
{ echo "passwords do not match"; return 1; }

# persist ncp-web password in docker container
[[ -f /.docker-image ]] && {
mv /etc/shadow /data/etc/shadow
ln -s /data/etc/shadow /etc/shadow
}

# activate NCP
a2ensite ncp nextcloud
a2dissite ncp-activation
bash -c "sleep 1.5 && service apache2 reload" &>/dev/null &
Expand Down

0 comments on commit c727d65

Please sign in to comment.