Skip to content
Closed
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
10 changes: 10 additions & 0 deletions lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function getForm(): TemplateResponse {
'web_server' => strtolower($_SERVER['SERVER_SOFTWARE']),
'os_family' => PHP_VERSION_ID >= 70200 ? PHP_OS_FAMILY : PHP_OS,
'platform' => php_uname('m'),
'is_snap' => $this->isSnapInstallation(),
'fonts' => $this->fontService->getFontFileNames(),
'esignature_base_url' => $this->config->getAppValue('richdocuments', 'esignature_base_url'),
'esignature_client_id' => $this->config->getAppValue('richdocuments', 'esignature_client_id'),
Expand All @@ -77,4 +78,13 @@ public function getSection(): string {
public function getPriority(): int {
return 0;
}

private function isSnapInstallation(): bool {
$snap = getenv('SNAP');
if ($snap !== false && $snap !== '') {
return true;
}

return str_starts_with((string)$this->config->getSystemValue('datadirectory', ''), '/var/snap/nextcloud/');
}
}
13 changes: 12 additions & 1 deletion src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
</p>
<p class="option-inline-emphasized">
{{ t('richdocuments', 'If the installation from the App Store fails, you can still do that manually using this command:') }}
<tt>php -d memory_limit=512M occ app:install {{ CODEAppID }}</tt>
<tt>{{ CODEInstallCommand }}</tt>
</p>
</div>
</div>
Expand Down Expand Up @@ -491,6 +491,7 @@ export default {
errorMessage: null,
hostErrors: [window.location.host === 'localhost' || window.location.host === '127.0.0.1', window.location.protocol !== 'https:', false],
demoServers: null,
isSnap: false,
CODEInstalled: 'richdocumentscode' in OC.appswebroots,
CODECompatible: true,
CODEAppID: 'richdocumentscode',
Expand Down Expand Up @@ -572,6 +573,15 @@ export default {
callbackUrl() {
return this.settings.wopi_callback_url ? this.settings.wopi_callback_url : getCallbackBaseUrl()
},
CODEInstallCommand() {
return this.isSnap ? this.snapCODEInstallCommand : this.manualCODEInstallCommand
},
manualCODEInstallCommand() {
return `php -d memory_limit=512M occ app:install ${this.CODEAppID}`
},
snapCODEInstallCommand() {
return `sudo nextcloud.occ app:install ${this.CODEAppID}`
},
},
watch: {
'settings.public_wopi_url'(newVal, oldVal) {
Expand Down Expand Up @@ -623,6 +633,7 @@ export default {
this.uiVisible.external_apps = !!(this.settings.external_apps && this.settings.external_apps !== '')

this.demoServers = this.initial.demo_servers
this.isSnap = this.initial.is_snap === true

if (this.initial.web_server && this.initial.web_server.length > 0) {
this.isNginx = this.initial.web_server.indexOf('nginx') !== -1
Expand Down