Skip to content

Commit

Permalink
ncp-web: use random passwords for NC and ncp-web
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Apr 1, 2018
1 parent f31caf4 commit 925c6fe
Show file tree
Hide file tree
Showing 16 changed files with 584 additions and 10 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

[v0.53.7](https://github.com/nextcloud/nextcloudpi/commit/a574460) (2018-03-29) ncp-web: use random passwords for NC and ncp-web

[v0.53.6 ](https://github.com/nextcloud/nextcloudpi/commit/151160b) (2018-03-27) samba: dont force NAME_REGEX for username

[v0.53.5](https://github.com/nextcloud/nextcloudpi/commit/ae5ad77) (2018-03-20) NFS: check user and group existence
[v0.53.5 ](https://github.com/nextcloud/nextcloudpi/commit/ae5ad77) (2018-03-20) NFS: check user and group existence

[v0.53.4 ](https://github.com/nextcloud/nextcloudpi/commit/5192766) (2018-03-18) nc-ramlogs: fix enabled by default upon installoation

Expand Down
48 changes: 48 additions & 0 deletions etc/nextcloudpi-config.d/nc-admin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

# Change password for the Nextcloud admin user
#
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
#
# Usage:
#
# ./installer.sh nc-admin.sh <IP> (<img>)
#
# See installer.sh instructions for details
# More at: https://ownyourbits.com
#

USER_=ncp
PASSWORD_=ownyourbits
CONFIRM_=ownyourbits

DESCRIPTION="Change password for the Nextcloud admin user"

configure()
{
[[ "$PASSWORD_" == "$CONFIRM_" ]] || { echo "passwords do not match"; return 1; }

OC_PASS="$PASSWORD_" \
sudo -E -u www-data php /var/www/nextcloud/occ \
user:resetpassword --password-from-env "$USER_"
}

install() { :; }

# License
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA
1 change: 0 additions & 1 deletion etc/nextcloudpi-config.d/nc-nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ EOF
</Directory>
</IfModule>
EOF
a2ensite nextcloud

cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
<VirtualHost _default_:80>
Expand Down
6 changes: 4 additions & 2 deletions etc/nextcloudpi-config.d/nc-passwd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ CONFIRM_=ownyourbits

DESCRIPTION="Change password for the NextCloudPi Panel"

configure()
configure()
{
echo -e "$PASSWORD_\n$CONFIRM_" | passwd ncp &>/dev/null && \
echo "password updated successfully" || \
{ echo "passwords do not match"; return 1; }
a2ensite ncp nextcloud
a2dissite ncp-activation
bash -c "sleep 1.5 && service apache2 reload" &>/dev/null &
}

install() { :; }
Expand All @@ -43,4 +46,3 @@ install() { :; }
# along with this script; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA

7 changes: 6 additions & 1 deletion etc/nextcloudpi-config.d/nc-webui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
# More at: https://ownyourbits.com
#

ACTIVE_=yes
ACTIVE_=no
LANGUAGE_=[_auto_,en,de]
DESCRIPTION="Enable or disable the NCP web interface"

is_active()
{
a2query -s ncp &>/dev/null
}

configure()
{
if [[ $ACTIVE_ != "yes" ]]; then
Expand Down
233 changes: 233 additions & 0 deletions ncp-web/activate/CSS.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
/*
* NextcloudPlus Web Panel style sheets. Based on official Nextcloud 12 datasheets
*
* Copyleft 2018 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
* GPL licensed (see end of file) * Use at your own risk!
*
* More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
*/


html,body {
height:100%
}
article,aside,dialog,figure,footer,header,hgroup,nav,section {
display:block
}
body {
text-align: center;
line-height:1.5
}
a {
border:0;
color:#fff;
text-decoration:none;
cursor:pointer
}
a * {
cursor:pointer
}
select,.button span,label {
cursor:pointer
}
body {
background-image: url(../img/background.png);
background-color:#0082c9;
font-weight:400;
line-height:1.6em;
font-family:'Open Sans', Frutiger, Calibri, 'Myriad Pro', Myriad, sans-serif;
color:#fff;
height:auto
}
#nojavascript {
position:fixed;
top:0;
bottom:0;
height:100%;
width:100%;
z-index:9000;
text-align:center;
background-color:rgba(0, 0, 0, 0.5);
color:#fff;
line-height:125%;
font-size:24px
}
#nojavascript div {
display:block;
position:relative;
width:50%;
top:35%;
margin:0px auto
}
#nojavascript a {
color:#fff;
border-bottom:2px dotted #fff
}
#nojavascript a:hover,#nojavascript a:focus {
color:#dbdbdb
}
::-webkit-scrollbar {
width:5px
}
::-webkit-scrollbar-track-piece {
background-color:transparent
}
::-webkit-scrollbar-thumb {
background:#dbdbdb;
border-radius:3px
}
select,button,input,textarea {
width: 3em;
min-height:32px;
box-sizing:border-box;
text-align: center;
}
select,button,.button,input:not([type='range']),textarea,#quota,.pager li a {
margin:3px 3px 3px 0;
padding:7px 6px;
font-size:13px;
background-color:#fff;
color:#545454;
border:1px solid #dbdbdb;
outline:none;
border-radius:3px;
}
select:not(:disabled):not(.primary),button:not(:disabled):not(.primary),.button:not(:disabled):not(.primary),input:not([type='range']):not(:disabled):not(.primary),textarea:not(:disabled):not(.primary),#quota:not(:disabled):not(.primary),.pager li a:not(:disabled):not(.primary) {
}
select:not(:disabled):not(.primary):not(#quota):hover,button:not(:disabled):not(.primary):not(#quota):hover,.button:not(:disabled):not(.primary):not(#quota):hover,input:not([type='range']):not(:disabled):not(.primary):not(#quota):hover,textarea:not(:disabled):not(.primary):not(#quota):hover,#quota:not(:disabled):not(.primary):not(#quota):hover,.pager li a:not(:disabled):not(.primary):not(#quota):hover,select:not(:disabled):not(.primary):focus,button:not(:disabled):not(.primary):focus,.button:not(:disabled):not(.primary):focus,input:not([type='range']):not(:disabled):not(.primary):focus,textarea:not(:disabled):not(.primary):focus,#quota:not(:disabled):not(.primary):focus,.pager li a:not(:disabled):not(.primary):focus,select:not(:disabled):not(.primary).active,button:not(:disabled):not(.primary).active,.button:not(:disabled):not(.primary).active,input:not([type='range']):not(:disabled):not(.primary).active,textarea:not(:disabled):not(.primary).active,#quota:not(:disabled):not(.primary).active,.pager li a:not(:disabled):not(.primary).active {
border-color:#0082c9;
outline:none
}
select:not(:disabled):not(.primary):active,button:not(:disabled):not(.primary):active,.button:not(:disabled):not(.primary):active,input:not([type='range']):not(:disabled):not(.primary):active,textarea:not(:disabled):not(.primary):active,#quota:not(:disabled):not(.primary):active,.pager li a:not(:disabled):not(.primary):active {
outline:none;
background-color:#fff
}
select:disabled,button:disabled,.button:disabled,input:not([type='range']):disabled,textarea:disabled,#quota:disabled,.pager li a:disabled {
background-color:#ebebeb;
color:rgba(0, 0, 0, 0.4);
cursor:default;
opacity:0.5
}
select.primary,button.primary,.button.primary,input:not([type='range']).primary,textarea.primary,#quota.primary,.pager li a.primary {
border:1px solid #0082c9;
background-color:rgba(0, 130, 201, .7);
color:#fff;
cursor:pointer
}
select.primary:not(:disabled):hover,button.primary:not(:disabled):hover,.button.primary:not(:disabled):hover,input:not([type='range']).primary:not(:disabled):hover,textarea.primary:not(:disabled):hover,#quota.primary:not(:disabled):hover,.pager li a.primary:not(:disabled):hover,select.primary:not(:disabled):focus,button.primary:not(:disabled):focus,.button.primary:not(:disabled):focus,input:not([type='range']).primary:not(:disabled):focus,textarea.primary:not(:disabled):focus,#quota.primary:not(:disabled):focus,.pager li a.primary:not(:disabled):focus {
background-color:rgba(0, 130, 201, .85)
}
select.primary:not(:disabled):active,button.primary:not(:disabled):active,.button.primary:not(:disabled):active,input:not([type='range']).primary:not(:disabled):active,textarea.primary:not(:disabled):active,#quota.primary:not(:disabled):active,.pager li a.primary:not(:disabled):active {
background-color:rgba(0, 130, 201, .7)
}
select.primary:disabled,button.primary:disabled,.button.primary:disabled,input:not([type='range']).primary:disabled,textarea.primary:disabled,#quota.primary:disabled,.pager li a.primary:disabled {
background-color:rgba(0, 130, 201, .7);
color:#bababa
}
input {
}
input:not([type='radio']):not([type='checkbox']):not([type='range']):not([type='submit']):not([type='button']):not([type='reset']):not([type='color']):not([type='file']):not([type='image']) {
-webkit-appearance:textfield;
-moz-appearance:textfield
}
select,button,.button,input[type='button'],input[type='submit'],input[type='reset'] {
padding:6px 12px;
width:auto;
min-height:34px;
cursor:pointer;
box-sizing:border-box;
background-color:#f7f7f7
}
button,.button,input[type='button'],input[type='submit'],input[type='reset'] {
font-weight:bold;
}
button::-moz-focus-inner,.button::-moz-focus-inner,input[type='button']::-moz-focus-inner,input[type='submit']::-moz-focus-inner,input[type='reset']::-moz-focus-inner {
border:0
}
button,.button {
}
button > span[class^='icon-'],.button > span[class^='icon-'],button > span[class*=' icon-'],.button > span[class*=' icon-'] {
display:inline-block;
vertical-align:text-bottom;
opacity:0.5
}
textarea {
color:#545454;
cursor:text;
font-family:inherit;
height:auto
}
textarea:not(:disabled):active,textarea:not(:disabled):hover,textarea:not(:disabled):focus {
border-color:#dbdbdb !important;
background-color:#fff !important
}
select {
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
background:url('../../../core/css/../img/actions/triangle-s.svg') no-repeat right 4px center;
background-color:inherit;
outline:0;
padding-right:24px !important
}
button img,.button img {
cursor:pointer
}
input[type='checkbox'].radio,input[type='radio'].radio,input[type='checkbox'].checkbox,input[type='radio'].checkbox {
position:absolute;
left:-10000px;
top:auto;
width:1px;
height:1px;
overflow:hidden
}
#header {
color: white;
}
h2 {
font-size:20px;
font-weight:300;
margin-bottom:12px;
line-height:140%
}
h3 {
font-size:15px;
font-weight:300;
margin:12px 0
}
em {
font-style:normal;
-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)';
opacity:0.5
}
dl {
padding:12px 0
}
dt,dd {
display:inline-block;
padding:12px;
padding-left:0
}
dt {
width:130px;
white-space:nowrap;
text-align:right
}
kbd {
padding:4px 10px;
border:1px solid #ccc;
box-shadow:0 1px 0 rgba(0, 0, 0, .2);
border-radius:3px;
display:inline-block;
white-space:nowrap
}

hr { border: solid 1px white; }

#ncp-logo { margin-top: 24px; }

#loading-gif { display: none; }

#ncp-pwd,#nc-pwd{ width:30em; }

img { vertical-align: middle; }
Loading

0 comments on commit 925c6fe

Please sign in to comment.