Skip to content

Commit

Permalink
arm64: Check for arch and warn admin in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkara authored and timar committed Sep 8, 2020
1 parent ac36c16 commit 2853189
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
1 change: 0 additions & 1 deletion build-nextcloud-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ chmod a+x "${app_name}/collabora/Collabora_Online.AppImage"
HASH=`./${app_name}/collabora/Collabora_Online.AppImage --version-hash`
echo "HASH: $HASH"
sed "s/%LOOLWSD_VERSION_HASH%/$HASH/g" ../proxy.php > ${app_name}/proxy.php
cp ../proxy.php > ${app_name}/proxy.php

# check if we are building for arm64
if [[ "$APPIMAGE_URL" =~ "arm64" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ public function getForm()
$isEnabled = 'no';
$absoluteUrl = '/';
$absoluteUrlAdmin = '/';
$absoluteUrlAppInstall = '/';
$appArch = 'x86_64';

$urlGenerator = \OC::$server->getURLGenerator();
$absoluteUrl = $urlGenerator->getAbsoluteURL('/settings/apps/app-bundles/richdocuments');
$absoluteUrlAdmin = $urlGenerator->getAbsoluteURL('/settings/admin/richdocuments');
$absoluteUrlAppInstall = $urlGenerator->getAbsoluteURL('/settings/apps/app-bundles/richdocumentscode');

if ($this->getSection() == 'richdocumentscode_arm64') {
$appArch = 'aarch64';
}

if (\OC::$server->getAppManager()->isEnabledForUser('richdocuments')) {
$isEnabled = 'yes';
Expand All @@ -42,7 +49,9 @@ public function getForm()
$parameters = [
'richdocumentsEnabled' => $isEnabled,
'richdocumentsURL' => $absoluteUrl,
'richdocumentsAdminURL' => $absoluteUrlAdmin
'richdocumentsAdminURL' => $absoluteUrlAdmin,
'appArch' => $appArch,
'appInstallUrl' => $absoluteUrlAppInstall
];

return new TemplateResponse('richdocumentscode', 'admin', $parameters);
Expand Down
20 changes: 19 additions & 1 deletion templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,25 @@

<div id="CODE-settings" class="section">
<h2>Collabora Online - Built-in CODE Server</h2>
<?php if ($_['richdocumentsEnabled'] === 'yes'): ?>
<?php if ($_['appArch'] === 'x86_64' && php_uname('m') === 'aarch64'): ?>
<div id="richdocumentscode-arm64-needed">
<p><?php p($l->t('Your system is ARM64, but you have installed the x86_64 version of the app. Please remove this, and;')); ?>
<u><a href="<?php echo($_['appInstallUrl']) ?>">
<?php p($l->t('Install the correct version from the Nextcloud App Store.')); ?>
</a>
</u>
</p>
</div>
<?php elseif ($_['appArch'] === 'aarch64' && php_uname('m') === 'x86_64'): ?>
<div id="richdocumentscode-arm64-needed">
<p><?php p($l->t('Your system is x86_64, but you have installed the ARM64 version of the app. Please remove this, and;')); ?>
<u><a href="<?php echo($_['appInstallUrl']) ?>">
<?php p($l->t('Install the correct version from the Nextcloud App Store.')); ?>
</a>
</u>
</p>
</div>
<?php elseif ($_['richdocumentsEnabled'] === 'yes'): ?>
<div id="richdocuments-Enabled">
<p><?php p($l->t('You have the Collabora Online app enabled. For further information and configuration, please check:')); ?>
<u><a href="<?php
Expand Down

0 comments on commit 2853189

Please sign in to comment.