Skip to content

Commit

Permalink
docker: adapt wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Jun 19, 2018
1 parent 1af50d7 commit 3ee6409
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

[v0.57.7](https://github.com/nextcloud/nextcloudpi/commit/619812c) (2018-06-19) docker: fix persist ncp-web password
[v0.57.8](https://github.com/nextcloud/nextcloudpi/commit/61360da) (2018-06-19) docker: adapt wizard

[v0.57.7](https://github.com/nextcloud/nextcloudpi/commit/98c99e3) (2018-06-19) docker: fix persist ncp-web password

[v0.57.6 ](https://github.com/nextcloud/nextcloudpi/commit/9d0d3b3) (2018-06-19) fix mysqld service named mysql

Expand Down
3 changes: 0 additions & 3 deletions docker-armhf/nextcloudpi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ sed -i 's|/media/USBdrive|/data/backups|' ncp-config.d/nc-backup.sh; \
rm /usr/local/etc/ncp.sh; \
rm /.ncp-image; \

# remove wizard for now
rm -r /var/www/ncp-web/wizard; \

# cleanup all NCP extras
source /usr/local/etc/library.sh; \
cd /usr/local/etc/ncp-config.d/; \
Expand Down
3 changes: 0 additions & 3 deletions docker/nextcloudpi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ sed -i 's|/media/USBdrive|/data/backups|' ncp-config.d/nc-backup.sh; \
rm /usr/local/etc/ncp.sh; \
rm /.ncp-image; \

# remove wizard for now
rm -r /var/www/ncp-web/wizard; \

# cleanup all NCP extras
source /usr/local/etc/library.sh; \
cd /usr/local/etc/ncp-config.d/; \
Expand Down
13 changes: 6 additions & 7 deletions ncp-web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,12 @@
</div>
</a>
<?php
if ( !file_exists( '/.docker-image' ) )
echo <<<HTML
<div id="poweroff">
<div id="expand">
<div class="icon-power-white"></div>
</div>
</div>
echo <<<HTML
<div id="poweroff">
<div id="expand">
<div class="icon-power-white"></div>
</div>
</div>
HTML;
?>
</div>
Expand Down
17 changes: 11 additions & 6 deletions ncp-web/wizard/JS/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/*global $, jQuery, alert*/
$(document).ready(function(){

var in_docker = $('#in-docker');

function addNotification( txt, tclass )
{
// limit to 9 notifications
Expand Down Expand Up @@ -185,12 +187,15 @@ $(document).ready(function(){

// Enable external access step
$('#enable-external').on('click', function(){
launch_action( 'fail2ban',
{ "ACTIVE":"yes" },
function ( data ){
nextOnSuccess( data, function(){ show_with_animation( 'forward-ports-pane' ) } );
}
);
if ( !in_docker )
launch_action( 'fail2ban',
{ "ACTIVE":"yes" },
function ( data ){
nextOnSuccess( data, function(){ show_with_animation( 'forward-ports-pane' ) } );
}
);
else
show_with_animation( 'forward-ports-pane' );
});

// Skip external access step
Expand Down
11 changes: 11 additions & 0 deletions ncp-web/wizard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
<div id="rootwizard">
<ul id="ncp-nav">
<li><a href="#tab1" data-toggle="tab">Welcome</a></li>
<?php
// Skip USB section in docker container
if ( !file_exists( '/.docker-image' ) )
echo <<<HTML
<li><a href="#tab2" data-toggle="tab">USB Configuration</a></li>
HTML
?>
<li><a href="#tab3" data-toggle="tab">External access</a></li>
<li><a href="#tab4" data-toggle="tab">Finish</a></li>
</ul>
Expand Down Expand Up @@ -208,8 +214,13 @@
<div id="notifications"></div>

<?php
// CSRF protection
include ('../csrf.php');
echo '<input type="hidden" id="csrf-token" name="csrf-token" value="' . getCSRFToken() . '"/>';

// Mark the wizard as "in docker"
if ( file_exists( '/.docker-image' ) )
echo '<input type="hidden" id="in-docker" name="in-docker" value=""/>';
?>

<script src="JS/jquery-latest.js"></script>
Expand Down

0 comments on commit 3ee6409

Please sign in to comment.