Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/private/App/AppStore/Bundles/HubBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ public function getName() {
}

public function getAppIdentifiers() {
return [
$hubApps = [
'spreed',
'contacts',
'calendar',
'mail',
'richdocumentscode',
'richdocuments',
];

$architecture = php_uname('m');
if (PHP_OS_FAMILY === 'Linux' && in_array($architecture, ['x86_64', 'aarch64'])) {
$hubApps[] = 'richdocuments';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collabora itself does not run on 32 bit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does but without the code builtin server it does not make much sense to install it automatically

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some chat with @juliushaertl: This is on purpose because the hub bundle only makes sense to install rich documents by default if on one of those platforms where also the built in version of the server runs. Thus this is correct.

$hubApps[] = 'richdocumentscode' . ($architecture === 'aarch64' ? '_arm64' : '');
}

return $hubApps;
}
}
24 changes: 24 additions & 0 deletions lib/private/App/DependencyAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function analyze(array $app, bool $ignoreMax = false) {
}

return array_merge(
$this->analyzeArchitecture($dependencies),
$this->analyzePhpVersion($dependencies),
$this->analyzeDatabases($dependencies),
$this->analyzeCommands($dependencies),
Expand Down Expand Up @@ -174,6 +175,29 @@ private function analyzePhpVersion(array $dependencies) {
return $missing;
}

private function analyzeArchitecture(array $dependencies) {
$missing = [];
if (!isset($dependencies['architecture'])) {
return $missing;
}

$supportedArchitectures = $dependencies['architecture'];
if (empty($supportedArchitectures)) {
return $missing;
}
if (!is_array($supportedArchitectures)) {
$supportedArchitectures = [$supportedArchitectures];
}
$supportedArchitectures = array_map(function ($architecture) {
return $this->getValue($architecture);
}, $supportedArchitectures);
$currentArchitecture = $this->platform->getArchitecture();
if (!in_array($currentArchitecture, $supportedArchitectures, true)) {
$missing[] = (string)$this->l->t('The following architectures are supported: %s', [implode(', ', $supportedArchitectures)]);
}
return $missing;
}

/**
* @param array $dependencies
* @return array
Expand Down
4 changes: 4 additions & 0 deletions lib/private/App/Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ public function getLibraryVersion($name) {
$repo = new PlatformRepository();
return $repo->findLibrary($name);
}

public function getArchitecture(): string {
return php_uname('m');
}
}
2 changes: 1 addition & 1 deletion lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public static function updateHtaccess() {
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocm-provider/";
$content .= "\n RewriteCond %{REQUEST_URI} !^/\\.well-known/(acme-challenge|pki-validation)/.*";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/richdocumentscode/proxy.php$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/richdocumentscode(_arm64)?/proxy.php$";
$content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]";
$content .= "\n RewriteBase " . $rewriteBase;
$content .= "\n <IfModule mod_env.c>";
Expand Down
15 changes: 15 additions & 0 deletions resources/app-info.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
<xs:selector xpath="dependencies/database"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniqueArchitecture">
<xs:selector xpath="dependencies/architecture"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniqueLib">
<xs:selector xpath="dependencies/lib"/>
<xs:field xpath="."/>
Expand Down Expand Up @@ -552,6 +556,8 @@
maxOccurs="1"/>
<xs:element name="nextcloud" type="nextcloud" minOccurs="1"
maxOccurs="1"/>
<xs:element name="architecture" type="architecture" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

Expand Down Expand Up @@ -613,6 +619,15 @@
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="architecture">
<xs:restriction base="xs:string">
<xs:enumeration value="x86"/>
<xs:enumeration value="x86_64"/>
<xs:enumeration value="aarch"/>
<xs:enumeration value="aarch64"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="repair-steps">
<xs:sequence>
<xs:element name="pre-migration" type="steps" minOccurs="0"
Expand Down