owncloud-ansible/owncloud

Phoenix frontend deployment

PVince81 opened this issue · 1 comments

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)

Install as an app

* enable Phoenix as an app

* some config tweaks needed, see below (to be confirmed)

Don't think this is possible. We need to create a new role for phoenix deployment.