Skip to content

Phoenix frontend deployment #16

@PVince81

Description

@PVince81

We should provide a way to setup the new (Phoenix frontend)[https://github.com/owncloud/phoenix].

The way I see it this should be a different role, as this can also be run on a different machine.

There are at least three ways to deploy Phoenix:

Install as an app

  • enable Phoenix as an app
  • some config tweaks needed, see below (to be confirmed)

Install on the same host

  • have the web server serve the Phoenix files (JS bundle + config.json)
  • might require config tweaks, see below

Install Phoenix on a separate host

  • setup ownCloud with oauth2 app enabled
  • adjust config.php settings, especially CORS (see script below)
  • Phoenix needs a web server to serve the main JS bundle and config.json, there are no server side logic.
    • should we use Apache there ?
    • or use ocis-phoenix directly as go binary?

Here is my local script to automatically setup OC for Phoenix development:

#!/bin/bash

OCDIR="/srv/www/htdocs/owncloud"
DATADIR="$OCDIR/data"
OCC="sudo -uwwwrun ./occ"

HOSTNAME=phoenixhost.local
PHOENIX_HOSTNAME=$HOSTNAME:8300

PHOENIX_CLIENTID=***REMOVED***
PHOENIX_CLIENTSECRET=***REMOVED***

cd "$OCDIR"

echo Setting up ownCloud for host name "$HOSTNAME" to connect with Phoenix on "${PHOENIX_HOSTNAME}"

$OCC config:system:set overwrite.cli.url --value="['http://$HOSTNAME/owncloud']"

$OCC config:system:set trusted_domains --type=json --value="[\"${HOSTNAME}\"]"
$OCC config:system:set cors.allowed-domains --type=json --value="[\"http://${PHOENIX_HOSTNAME}\", \"http://localhost:9876\"]"
$OCC config:system:set dav.enable.tech_preview --type=boolean --value=true
$OCC config:system:set phoenix.baseUrl --type=string --value="http://${PHOENIX_HOSTNAME}"

$OCC app:enable oauth2

$OCC oauth2:add-client "Phoenix" "${PHOENIX_CLIENTID}" "${PHOENIX_CLIENTSECRET}" "http://${PHOENIX_HOSTNAME}/oidc-callback.html" 

echo Please copy the OAuth2 client id into Phoenix\'s config.json: "$PHOENIX_CLIENTID"

To get an oauth2 secret, I had to first do the oauth2 pairing manually, then I looked up the client id and secret in the database to reuse in this script.

On the Phoenix side, config.json:

{
  "server" : "http://phoenixhost.local/owncloud/",
  "theme": "owncloud",
  "version": "0.1.0",
  "auth": {
    "clientId": "***REMOVED**",
    "url": "http://phoenixhost.local/owncloud/index.php/apps/oauth2/api/v1/token",
    "authUrl": "http://phoenixhost.local/owncloud/index.php/apps/oauth2/authorize"
  },
  "apps" : ["files"]
}

Connecting to OCIS

  • ability to connect Phoenix to an ocis-backend instead of regular ownCloud

Other

  • Optionally/Later: Phoenix should also be deployable with OpenIDConnect (I have no experience there)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions