Skip to content

Commit

Permalink
Merge pull request #7 from crestAT/development
Browse files Browse the repository at this point in the history
v0.3.2
  • Loading branch information
crestAT authored Aug 25, 2017
2 parents fe917ab + cddb202 commit d06728f
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 11 deletions.
Binary file modified owncloud/locale-owncloud/ca/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/de/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/el/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/es/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/fr/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/it/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file not shown.
Binary file modified owncloud/locale-owncloud/nl/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/ro/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/ru/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/sv/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/tr/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/uk/LC_MESSAGES/nas4free.mo
Binary file not shown.
Binary file modified owncloud/locale-owncloud/zh_CN/LC_MESSAGES/nas4free.mo
Binary file not shown.
32 changes: 28 additions & 4 deletions owncloud/owncloud-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function change_perms($dir) {
fwrite($backup_script, "date > {$configuration['rootfolder']}/{$configuration['application']}-backup-date.txt"."\n");
fclose($backup_script);
chmod("{$configuration['rootfolder']}/{$configuration['application']}-backup.sh", 0755);
$savemsg .= "<br />".sprintf(gettext("Command for cron backup usage: %s"), "{$configuration['rootfolder']}/{$configuration['application']}-backup.sh");
$savemsg .= "<br />".sprintf(gettext("Command for cron backup usage: %s"), "{$configuration['rootfolder']}/{$configuration['application']}-backup.sh").".<br />";

$restore_script = fopen("{$configuration['rootfolder']}/{$configuration['application']}-restore.sh", "w");
fwrite($restore_script, "#!/bin/sh"."\n# WARNING: THIS IS AN AUTOMATICALLY CREATED SCRIPT, DO NOT CHANGE THE CONTENT!\n");
Expand Down Expand Up @@ -282,6 +282,19 @@ function change_perms($dir) {
$savemsg .= sprintf(gettext("%s started, output goes to %s"), gettext('Restore'), gettext('Diagnostics')." > ".gettext('Log')." > ".gettext('RSYNC - Client'));
}

if (isset($_POST['tune_cache']) && $_POST['tune_cache']) {
$return_val = mwexec("cat {$configuration['storage_path']}/config/config.php | grep memcache.local");
if ($return_val != 0) {
include("{$configuration['storage_path']}/config/config.php");
$CONFIG['memcache.local'] = '\OC\Memcache\APCu';
$patch = "<?php\n".'$CONFIG = '.var_export($CONFIG, true).";\n";
mwexec("/usr/local/bin/sudo -u {$configuration['webuser']} /usr/local/bin/php {$configuration['storage_path']}/occ maintenance:mode --no-warnings --on", true);
file_put_contents("{$configuration['storage_path']}/config/config.php", $patch);
mwexec("/usr/local/bin/sudo -u {$configuration['webuser']} /usr/local/bin/php {$configuration['storage_path']}/occ maintenance:mode --no-warnings --off", true);
}
$savemsg .= gettext("APCu memcache is now activated.")."<br />";
}

// initialize params for first run
$configuration['application'] = !empty($configuration['application']) ? $configuration['application'] : "OwnCloud";
$configuration['OwnCloud']['storage_path'] = !empty($configuration['OwnCloud']['storage_path']) ? $configuration['OwnCloud']['storage_path'] : str_replace("//", "/", $config['websrv']['documentroot']."/owncloud");
Expand All @@ -308,6 +321,10 @@ function change_perms($dir) {
$input_errors[] = sprintf(gettext("For security reasons this folder should NOT be set to a directory below %s!"), $config['websrv']['documentroot']);
$input_errors[] = sprintf(gettext("It is strongly recommended to remove and repeat the %s installation!"), gettext($configuration['application']));
}
$return_val = mwexec("cat {$configuration['storage_path']}/config/config.php | grep memcache.local");
if ($return_val != 0) {
$savemsg .= sprintf(gettext("No memory cache has been configured for %s. Use %s to activate the APCu memcache."), gettext($configuration['application']), gettext("Tune Cache"));
}
}

get_process_info();
Expand Down Expand Up @@ -431,22 +448,29 @@ function change_application() {
<div id="remarks">
<?php html_remark("note", gettext("Note"), gettext("The values for <b>upload_max_filesize</b> and <b>post_max_size</b> will be set to 2 GB!")."<br />".
sprintf(gettext("Use the %s WebGUI > 'Administration' to change values and to update the application."), $configuration['application'])."<br /><b>".
sprintf(gettext("Always perform a %s before an application update!"), gettext("Backup"))."</b>");?>
sprintf(gettext("Always perform a %s prior to an application update!"), gettext("Backup"))."</b>");?>
</div>
<div id="submit">
<input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>"/>
<?php if ($configuration['enable']):?>
<?php if (!is_file("{$configuration['storage_path']}/version.php")):?>
<input name="install" type="submit" class="formbtn" value="<?=gettext("Install");?>" onclick="return confirm('<?=gettext("Ready to install?");?>')" />
<?php else:?>
<input name="remove" type="submit" class="formbtn" title="<?=gettext("Remove")." ".sprintf(gettext("the %s and the %s!"), gettext("Document Root"), gettext("Data Folder"));?>"
value="<?=gettext("Remove");?>" onclick="return confirm('<?=sprintf(gettext("The %s (%s) and the %s (%s) will be removed, all data will be deleted. Ready to proceed?"), gettext("Document Root"), gettext($configuration['storage_path']), gettext("Data Folder"), gettext($configuration['download_path']));?>')" />
<input name="remove" type="submit" class="formbtn" title="<?=gettext("Remove")." ".sprintf(gettext("the %s application. The %s and the %s will be deleted!"), $configuration['application'], gettext("Document Root"), gettext("Data Folder"));?>"
value="<?=gettext("Remove");?>" onclick="return confirm('<?=sprintf(gettext("The application will be removed, all data in the %s (%s) and the %s (%s) will be deleted. Ready to proceed?"), gettext("Document Root"), gettext($configuration['storage_path']), gettext("Data Folder"), gettext($configuration['download_path']));?>')" />
<input name="backup" type="submit" class="formbtn" title="<?=gettext("Backup")." ".sprintf(gettext("the %s and the %s!"), gettext("Document Root"), gettext("Data Folder"));?>"
value="<?=gettext("Backup");?>" onclick="return confirm('<?=sprintf(gettext("The %s (%s) and the %s (%s) will be backuped. Ready to proceed?"), gettext("Document Root"), gettext($configuration['storage_path']), gettext("Data Folder"), gettext($configuration['download_path']));?>')" />
<input name="restore" type="submit" class="formbtn" title="<?=gettext("Restore")." ".sprintf(gettext("the %s and the %s!"), gettext("Document Root"), gettext("Data Folder"));?>"
value="<?=gettext("Restore");?>" onclick="return confirm('<?=sprintf(gettext("The %s (%s) and the %s (%s) will be restored, the current installation will be overwritten with the backup from %s. Ready to proceed?"), gettext("Document Root"), gettext($configuration['storage_path']), gettext("Data Folder"), gettext($configuration['download_path']), exec("cat {$configuration['rootfolder']}/{$configuration['application']}-backup-date.txt"));?>')" />
<input name="restore_userdata" type="submit" class="formbtn" title="<?=gettext("Restore Userdata")." ".sprintf(gettext("to a manually installed/updated %s installation!"), $configuration['application']);?>"
value="<?=gettext("Restore Userdata");?>" onclick="return confirm('<?=gettext("Restore Userdata")." ".sprintf(gettext("to a manually installed/updated %s installation!"), $configuration['application']);?>')" />
<?php if (($configuration['enable']) && (is_file("{$configuration['storage_path']}/config/config.php"))):?>
<?php $return_val = mwexec("cat {$configuration['storage_path']}/config/config.php | grep memcache.local");
if ($return_val != 0):?>
<input name="tune_cache" type="submit" class="formbtn" title="<?=gettext("Tune Cache")." ".gettext("to activate the APCu memcache");?>"
value="<?=gettext("Tune Cache");?>" onclick="return confirm('<?=gettext("Tune Cache")." ".gettext("to activate the APCu memcache")."?";?>')" />
<?php endif;?>
<?php endif;?>
<?php endif;?>
<?php endif;?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion owncloud/owncloud-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$version = "v0.3.1"; // extension version
$version = "v0.3.2"; // extension version
$appname = "NextOwnCloud"; // extension name
$config_name = "owncloud";

Expand Down
12 changes: 7 additions & 5 deletions owncloud/owncloud-start.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,21 @@
if (is_link("/usr/local/www/owncloud-update_extension.php")) unlink("/usr/local/www/owncloud-update_extension.php");
if (is_link("/usr/local/www/ext/owncloud")) unlink("/usr/local/www/ext/owncloud");
mwexec("rmdir -p /usr/local/www/ext");
if (is_link("/usr/local/share/certs/ca-root-nss.crt")) unlink("/usr/local/share/certs/ca-root-nss.crt");
mwexec("rmdir -p /usr/local/share/certs");
$return_val = 0;
// create links to extension files
$return_val += mwexec("ln -sw {$rootfolder}/locale-owncloud /usr/local/share/", true);
$return_val += mwexec("ln -sw {$rootfolder}/owncloud-config.php /usr/local/www/owncloud-config.php", true);
$return_val += mwexec("ln -sw {$rootfolder}/owncloud-update_extension.php /usr/local/www/owncloud-update_extension.php", true);
$return_val += mwexec("mkdir -p /usr/local/www/ext", true);
$return_val += mwexec("ln -sw {$rootfolder}/owncloud /usr/local/www/ext/owncloud", true);
$return_val += mwexec("echo upload_tmp_dir = {$config['websrv']['uploaddir']} > /usr/local/etc/php/nextowncloud-php.ini && service websrv restart", true);
// use z-... prefix to override system defaults => opcache.max_accelerated_files=10000 and opcache.revalidate_freq=1
$return_val += mwexec("cp {$rootfolder}/z-nextowncloud-php.ini /usr/local/etc/php/", true);
$return_val += mwexec("echo upload_tmp_dir={$config['websrv']['uploaddir']} >> /usr/local/etc/php/z-nextowncloud-php.ini && service websrv restart", true);
// required for updater to work
$return_val += mwexec("mkdir -p /usr/local/share/certs", true);
$return_val += mwexec("ln -sw /usr/local/etc/ssl/cert.pem /usr/local/share/certs/ca-root-nss.crt", true);
if (!is_file("/usr/local/share/certs/ca-root-nss.crt")) {
$return_val += mwexec("mkdir -p /usr/local/share/certs", true);
$return_val += mwexec("ln -sw /usr/local/etc/ssl/cert.pem /usr/local/share/certs/ca-root-nss.crt", true);
}
if ($return_val == 0) mwexec("logger nextowncloud-extension: GUI loaded");
else mwexec("logger nextowncloud-extension: error(s) during startup, failed with return value = {$return_val}");
?>
9 changes: 9 additions & 0 deletions owncloud/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
Version Date Description
0.3.2 2017.08.24 N: set opcache.max_accelerated_files=10000 and opcache.revalidate_freq=1 to prevent application warnings
N: add button 'Tune Cache' to activate the APCu memcache for Next/ownCloud
F: create link to certificate /usr/local/etc/ssl/cert.pem if not already exists to prevent application updater problems
C: update translations base file on Launchpad
N: Kurdish translation
C: update German translation
C: update Greek translation
C: update Turkish translation

0.3.1 2017.05.10 N: restore only userdata for manually installed/updated applications
C: removed PHP 7.1 warning for ownCloud -> v10.0.0 is now available
C: changed NextCloud download source to 'latest'
Expand Down
2 changes: 1 addition & 1 deletion owncloud/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1
0.3.2
2 changes: 2 additions & 0 deletions owncloud/z-nextowncloud-php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
opcache.max_accelerated_files=10000
opcache.revalidate_freq=1

0 comments on commit d06728f

Please sign in to comment.