Merge pull request #1041 from owncloud/rename-ocis-phoenix

This commit is contained in:
Lukas Hirt
2020-12-13 20:04:43 +01:00
committed by GitHub
82 changed files with 1760 additions and 1767 deletions

View File

@@ -4,7 +4,7 @@ config = {
'glauth':'',
'konnectd':'',
'ocis': '',
'ocis-phoenix':'',
'web':'',
'ocis-pkg':'',
'ocs':'',
'proxy':'',
@@ -21,8 +21,8 @@ config = {
'numberOfParts': 10
},
'uiTests': {
'phoenixBranch': 'master',
'phoenixCommit': '262cec1536156dae3281099aca2fde0febeec6e5',
'webBranch': 'master',
'webCommit': '1b7963eeb52999629682ccef6bff713c0df1729b',
'suites': {
'webUIBasic': [
'webUILogin',
@@ -224,8 +224,8 @@ def testPipelines(ctx):
pipelines.append(coreApiTests(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], runPart, config['apiTests']['numberOfParts'], 'owncloud'))
pipelines.append(coreApiTests(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], runPart, config['apiTests']['numberOfParts'], 'ocis'))
pipelines += uiTests(ctx, config['uiTests']['phoenixBranch'], config['uiTests']['phoenixCommit'])
pipelines.append(accountsUITests(ctx, config['uiTests']['phoenixBranch'], config['uiTests']['phoenixCommit']))
pipelines += uiTests(ctx, config['uiTests']['webBranch'], config['uiTests']['webCommit'])
pipelines.append(accountsUITests(ctx, config['uiTests']['webBranch'], config['uiTests']['webCommit']))
return pipelines
def testOcisModule(ctx, module):
@@ -589,11 +589,11 @@ def benchmark(ctx):
},
}
def uiTests(ctx, phoenixBranch, phoenixCommit):
def uiTests(ctx, webBranch, webCommit):
suiteNames = config['uiTests']['suites'].keys()
return [uiTestPipeline(ctx, suiteName, phoenixBranch, phoenixCommit) for suiteName in suiteNames]
return [uiTestPipeline(ctx, suiteName, webBranch, webCommit) for suiteName in suiteNames]
def uiTestPipeline(ctx, suiteName, phoenixBranch = 'master', phoenixCommit = '', storage = 'owncloud', accounts_hash_difficulty = 4):
def uiTestPipeline(ctx, suiteName, webBranch = 'master', webCommit = '', storage = 'owncloud', accounts_hash_difficulty = 4):
suites = config['uiTests']['suites']
paths = ""
suite = suites[suiteName]
@@ -624,7 +624,7 @@ def uiTestPipeline(ctx, suiteName, phoenixBranch = 'master', phoenixCommit = '',
'RUN_ON_OCIS': 'true',
'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/ocis/owncloud/data',
'OCIS_SKELETON_DIR': '/srv/app/testing/data/webUISkeleton',
'PHOENIX_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'WEB_UI_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'TEST_TAGS': 'not @skipOnOCIS and not @skip',
'LOCAL_UPLOAD_DIR': '/uploads',
'NODE_TLS_REJECT_UNAUTHORIZED': 0,
@@ -632,12 +632,12 @@ def uiTestPipeline(ctx, suiteName, phoenixBranch = 'master', phoenixCommit = '',
},
'commands': [
'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/testing',
'git clone -b %s --single-branch --no-tags https://github.com/owncloud/phoenix.git /srv/app/phoenix' % (phoenixBranch),
'cp -r /srv/app/phoenix/tests/acceptance/filesForUpload/* /uploads',
'cd /srv/app/phoenix',
'git clone -b %s --single-branch --no-tags https://github.com/owncloud/web.git /srv/app/web' % (webBranch),
'cp -r /srv/app/web/tests/acceptance/filesForUpload/* /uploads',
'cd /srv/app/web',
] + ([
'git checkout %s' % (phoenixCommit)
] if phoenixCommit != '' else []) + [
'git checkout %s' % (webCommit)
] if webCommit != '' else []) + [
'yarn install-all',
'yarn run acceptance-tests-drone'
],
@@ -674,7 +674,7 @@ def uiTestPipeline(ctx, suiteName, phoenixBranch = 'master', phoenixCommit = '',
},
}
def accountsUITests(ctx, phoenixBranch, phoenixCommit, storage = 'owncloud', accounts_hash_difficulty = 4):
def accountsUITests(ctx, webBranch, webCommit, storage = 'owncloud', accounts_hash_difficulty = 4):
return {
'kind': 'pipeline',
'type': 'docker',
@@ -696,21 +696,21 @@ def accountsUITests(ctx, phoenixBranch, phoenixCommit, storage = 'owncloud', acc
'RUN_ON_OCIS': 'true',
'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/ocis/owncloud/data',
'OCIS_SKELETON_DIR': '/srv/app/testing/data/webUISkeleton',
'PHOENIX_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'WEB_UI_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'TEST_TAGS': 'not @skipOnOCIS and not @skip',
'LOCAL_UPLOAD_DIR': '/uploads',
'NODE_TLS_REJECT_UNAUTHORIZED': 0,
'PHOENIX_PATH': '/srv/app/phoenix',
'WEB_PATH': '/srv/app/web',
'FEATURE_PATH': '/drone/src/accounts/ui/tests/acceptance/features',
},
'commands': [
'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/testing',
'git clone -b %s --single-branch --no-tags https://github.com/owncloud/phoenix.git /srv/app/phoenix' % (phoenixBranch),
'cp -r /srv/app/phoenix/tests/acceptance/filesForUpload/* /uploads',
'cd /srv/app/phoenix',
'git clone -b %s --single-branch --no-tags https://github.com/owncloud/web.git /srv/app/web' % (webBranch),
'cp -r /srv/app/web/tests/acceptance/filesForUpload/* /uploads',
'cd /srv/app/web',
] + ([
'git checkout %s' % (phoenixCommit)
] if phoenixCommit != '' else []) + [
'git checkout %s' % (webCommit)
] if webCommit != '' else []) + [
'yarn install-all',
'cd /drone/src/accounts',
'yarn install --all',
@@ -1534,7 +1534,7 @@ def ocisServer(storage, accounts_hash_difficulty = 4):
'STORAGE_FRONTEND_PUBLIC_URL': 'https://ocis-server:9200',
'STORAGE_SHARING_USER_JSON_FILE': '/srv/app/tmp/ocis/shares.json',
'PROXY_ENABLE_BASIC_AUTH': True,
'PHOENIX_WEB_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'WEB_UI_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'KONNECTD_IDENTIFIER_REGISTRATION_CONF': '/drone/src/tests/config/drone/identifier-registration.yml',
'KONNECTD_ISS': 'https://ocis-server:9200',
'KONNECTD_TLS': 'true',

View File

@@ -1,10 +1,10 @@
const path = require('path')
const PHOENIX_PATH = process.env.PHOENIX_PATH
const WEB_PATH = process.env.WEB_PATH
const config = require(path.join(PHOENIX_PATH, 'nightwatch.conf.js'))
const config = require(path.join(WEB_PATH, 'nightwatch.conf.js'))
config.page_objects_path = [PHOENIX_PATH + '/tests/acceptance/pageObjects', 'ui/tests/acceptance/pageobjects']
config.custom_commands_path = PHOENIX_PATH + '/tests/acceptance/customCommands'
config.page_objects_path = [WEB_PATH + '/tests/acceptance/pageObjects', 'ui/tests/acceptance/pageobjects']
config.custom_commands_path = WEB_PATH + '/tests/acceptance/customCommands'
module.exports = {
...config

View File

@@ -21,7 +21,7 @@ import { mapGetters } from 'vuex'
export default {
/**
* FIXME: this component has been copied over from phoenix. It should be moved over to ODS, then we can reuse it in
* FIXME: this component has been copied over from ownCloud Web. It should be moved over to ODS, then we can reuse it in
* this extension.
*/
name: 'Avatar',

View File

@@ -1,8 +1,8 @@
#!/bin/bash
if [ -z "$PHOENIX_PATH" ]
if [ -z "$WEB_PATH" ]
then
echo "PHOENIX_PATH env variable is not set, cannot find files for tests infrastructure"
echo "WEB_PATH env variable is not set, cannot find files for tests infrastructure"
exit 1
fi
@@ -12,9 +12,9 @@ then
exit 1
fi
if [ -z "$PHOENIX_CONFIG" ]
if [ -z "$WEB_UI_CONFIG" ]
then
echo "PHOENIX_CONFIG env variable is not set, cannot find phoenix config file"
echo "WEB_UI_CONFIG env variable is not set, cannot find web config file"
exit 1
fi
@@ -46,7 +46,7 @@ clean_up() {
trap clean_up SIGHUP SIGINT SIGTERM EXIT
cp -r "$PHOENIX_PATH"/tests ./"$testFolder"
cp -r "$WEB_PATH"/tests ./"$testFolder"
export SERVER_HOST=${SERVER_HOST:-https://localhost:9200}
export BACKEND_HOST=${BACKEND_HOST:-https://localhost:9200}

View File

@@ -2,7 +2,7 @@
# OpenID Connect client registry.
clients:
- id: phoenix
- id: web
name: OCIS
application_type: web
insecure: yes

View File

@@ -79,11 +79,11 @@ services:
PROXY_OIDC_INSECURE: "${INSECURE:-false}"
PROXY_OIDC_ISSUER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
PROXY_TLS: "false"
# phoenix config
PHOENIX_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-ocis.owncloud.test}
PHOENIX_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/.well-known/openid-configuration
PHOENIX_WEB_CONFIG_APPS: files,draw-io,markdown-editor,media-viewer
PHOENIX_WEB_CONFIG_SERVER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
# web config
WEB_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-ocis.owncloud.test}
WEB_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/.well-known/openid-configuration
WEB_UI_CONFIG_APPS: files,draw-io,markdown-editor,media-viewer
WEB_UI_CONFIG_SERVER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
# storage config
STORAGE_DATAGATEWAY_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/data
STORAGE_FRONTEND_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/

View File

@@ -15,7 +15,7 @@ TRAEFIK_ACME_MAIL=
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=
# owncloud Web openid connect client id. Defaults to "ocis-phoenix"
# owncloud Web openid connect client id. Defaults to "web"
OCIS_OIDC_CLIENT_ID=
### Keycloak ###

View File

@@ -53,12 +53,12 @@ services:
PROXY_OIDC_INSECURE: "${INSECURE:-false}"
PROXY_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-master}
PROXY_TLS: "false"
# phoenix config
PHOENIX_OIDC_AUTHORITY: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-master}
PHOENIX_OIDC_CLIENT_ID: ${OCIS_OIDC_CLIENT_ID:-ocis-phoenix}
PHOENIX_OIDC_METADATA_URL: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-master}/.well-known/openid-configuration
PHOENIX_WEB_CONFIG_APPS: files,draw-io,markdown-editor,media-viewer
PHOENIX_WEB_CONFIG_SERVER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
# ownCloud Web config
WEB_OIDC_AUTHORITY: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-master}
WEB_OIDC_CLIENT_ID: ${OCIS_OIDC_CLIENT_ID:-web}
WEB_OIDC_METADATA_URL: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-master}/.well-known/openid-configuration
WEB_UI_CONFIG_APPS: files,draw-io,markdown-editor,media-viewer
WEB_UI_CONFIG_SERVER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
# storage config
STORAGE_DATAGATEWAY_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/data
STORAGE_FRONTEND_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/

View File

@@ -2,7 +2,7 @@
# OpenID Connect client registry.
clients:
- id: phoenix
- id: web
name: OCIS
application_type: web
insecure: yes

View File

@@ -58,11 +58,11 @@ services:
PROXY_OIDC_INSECURE: "${INSECURE:-false}"
PROXY_OIDC_ISSUER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
PROXY_TLS: "false"
# phoenix config
PHOENIX_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-ocis.owncloud.test}
PHOENIX_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/.well-known/openid-configuration
PHOENIX_WEB_CONFIG_APPS: files,draw-io,markdown-editor,media-viewer
PHOENIX_WEB_CONFIG_SERVER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
# web config
WEB_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-ocis.owncloud.test}
WEB_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/.well-known/openid-configuration
WEB_UI_CONFIG_APPS: files,draw-io,markdown-editor,media-viewer
WEB_UI_CONFIG_SERVER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
# storage config
STORAGE_DATAGATEWAY_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/data
STORAGE_FRONTEND_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/

View File

@@ -50,7 +50,7 @@ function getConfigFromEnv() {
'dbpassword' => getenv('OWNCLOUD_DB_PASSWORD'),
'dbtableprefix' => getenv('OWNCLOUD_DB_PREFIX'),
'phoenix.baseUrl' => getenv('OCIS_DOMAIN'),
'web.baseUrl' => getenv('OCIS_DOMAIN'),
'cors.allowed-domains' => [getenv('OCIS_DOMAIN')],
'log_type' => 'owncloud',

View File

@@ -5,7 +5,7 @@
"openIdConnect": {
"metadata_url": "https://ocis.owncloud.test/.well-known/openid-configuration",
"authority": "https://ocis.owncloud.test",
"client_id": "phoenix",
"client_id": "web",
"response_type": "code",
"scope": "openid profile email"
},

View File

@@ -1,7 +1,7 @@
---
# OpenID Connect client registry.
clients:
- id: phoenix
- id: web
name: OCIS
application_type: web
insecure: yes

View File

@@ -97,7 +97,7 @@ services:
# graph
GRAPH_OIDC_ENDPOINT: https://${OC10_DOMAIN:-oc10.owncloud.test}/apps/graphapi/v1.0
# web ui
PHOENIX_WEB_CONFIG: "/config/config.json"
WEB_UI_CONFIG: "/config/config.json"
# storage - although not used, yet
STORAGE_OIDC_ISSUER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
STORAGE_OIDC_INSECURE: "${INSECURE:-false}"

View File

@@ -3,7 +3,7 @@ config-docs-generate:
make -C ../glauth config-docs-generate
make -C ../konnectd config-docs-generate
make -C ../ocis config-docs-generate
make -C ../ocis-phoenix config-docs-generate
make -C ../web config-docs-generate
make -C ../ocis-pkg config-docs-generate
make -C ../ocs config-docs-generate
make -C ../proxy config-docs-generate

View File

@@ -11,7 +11,7 @@ Welcome to our developer documentation. Here you can find developer documentatio
- [oCIS](https://owncloud.github.io/ocis/) server
- oCIS extensions
- Clients, like:
- [Phoenix](https://github.com/owncloud/phoenix) - the new web frontend for oCIS and ownCloud
- [ownCloud Web](https://github.com/owncloud/web) - the new web frontend for oCIS and ownCloud
- [ownCloud Android app](https://github.com/owncloud/android)
- [ownCloud iOS app](https://github.com/owncloud/ios-app)
- [ownCloud Desktop Syncing Client](https://github.com/owncloud/client)

View File

@@ -1,13 +0,0 @@
---
title: "ownCloud Web"
date: 2018-05-02T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/extensions/ocis-phoenix
geekdocFilePath: _index.md
geekdocCollapseSection: true
---
Note: Work in progress to rename Phoenix to ownCloud Web.
This service embeds [Phoenix](https://github.com/owncloud/phoenix) to provide a UI for ownCloud Infinite Scale.

View File

@@ -15,7 +15,7 @@ for other extensions to register new settings within oCIS. It is responsible for
settings values as well.
For ease of use, this extension provides an ocis-web extension which allows users to change their settings values.
Please refer to the [ocis-web extension docs]({{< relref "../../ocis/development/extensions/#external-phoenix-apps" >}})
Please refer to the [ocis-web extension docs]({{< relref "../../ocis/development/extensions/#external-ownCloud-Web-apps" >}})
for running ocis-web extensions.
{{< mermaid class="text-center">}}

View File

@@ -0,0 +1,10 @@
---
title: "ownCloud Web"
date: 2018-05-02T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/extensions/web
geekdocFilePath: _index.md
---
This service embeds [ownCloud Web](https://github.com/owncloud/web) to provide a UI for ownCloud Infinite Scale.

View File

@@ -2,7 +2,7 @@
title: "Releasing"
weight: 40
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/extensions/ocis-phoenix
geekdocEditPath: edit/master/docs/extensions/web
geekdocFilePath: releasing.md
---
@@ -10,29 +10,29 @@ geekdocFilePath: releasing.md
## Releasing
The next generation Web Frontend is shipped as an oCIS Extension. The `ocis-phoenix` extension is also embedded in the single binary and part of the `ocis server` command.
The next generation Web Frontend is shipped as an oCIS Extension. The `ocis-web` extension is also embedded in the single binary and part of the `ocis server` command.
To update this package within all the deliveries, we need to update the package in the following chain from the bottom to the top.
### Package Hierarchy
- [ocis](https://githug.com/owncloud/ocis)
- [ocis-phoenix](https://github.com/owncloud/ocis-phoenix)
- [ocis-pkg](https://github.com/owncloud/ocis-pkg)
- [phoenix](https://github.com/owncloud/phoenix)
- [ocis-web](https://github.com/owncloud/ocis/tree/master/web)
- [ocis-pkg](https://github.com/owncloud/ocis/tree/master/ocis-pkg)
- [ownCloud Web](https://github.com/owncloud/web)
#### Prerequisites
Before updating the assets, make sure that [Phoenix](https://github.com/owncloud/phoenix) has been released first
Before updating the assets, make sure that [ownCloud Web](https://github.com/owncloud/web) has been released first
and take note of its release tag name.
#### Updating ocis-phoenix
#### Updating ocis-web
1. Create a branch `release-$version`. in <https://github.com/owncloud/ocis-phoenix>
1. Create a branch `release-$version`. in <https://github.com/owncloud/ocis>
2. Create a Folder in `changelog` for the release version and date `mkdir $major.$minor.$patchVersion_YYYY-MM-DD`.
3. Move all changelog items from the `changelog/unreleased/` folder to the `$major.$minor.$patchVersion_YYYY-MM-DD` folder.
4. Update the go module `ocis-pkg` to the latest version <https://blog.golang.org/using-go-modules> .
5. Update the phoenix asset by adjusting the value of `PHOENIX_ASSETS_VERSION` at the top of the Makefile and specify the tag name of the latest [Phoenix release](https://github.com/owncloud/phoenix/tags).
5. Update the ownCloud Web asset by adjusting the value of `WEB_ASSETS_VERSION` at the top of the Makefile and specify the tag name of the latest [ownCloud Web release](https://github.com/owncloud/web/tags).
6. Run `make clean generate`.
7. Create a changelog item for the update in the `changelog/$major.$minor.$patchVersion_YYYY-MM-DD` folder.
8. Commit your changes.
@@ -41,7 +41,3 @@ and take note of its release tag name.
11. Use `v$major.$minor.$patch` as a tag (the `v` prefix is important) and publish it.
12. The tag and the Release artifacts will be created automatically.
#### Next steps
Next steps is usually updating the ocis-phoenix version in the [ocis](https://githug.com/owncloud/ocis) repository.

View File

@@ -24,7 +24,7 @@ We run a huge [test suite](https://github.com/owncloud/core/tree/master/tests),
{{< mermaid class="text-center">}}
graph TD
proxy -->
konnectd & ocis-phoenix & thumbnails & ocs & webdav & storage & accounts & store & settings
konnectd & web & thumbnails & ocs & webdav & storage & accounts & store & settings
konnectd --> glauth

View File

@@ -29,7 +29,7 @@ Let us assume `your-host` is your remote domain name or IP adress. Add your host
```yaml {linenos=table,hl_lines=["15-17",21]}
# OpenID Connect client registry.
clients:
- id: phoenix
- id: web
name: ownCloud web app
application_type: web
insecure: yes
@@ -60,9 +60,9 @@ You need to configure `your-host` in some services to provide the needed public
PROXY_HTTP_ADDR=0.0.0.0:9200 \
KONNECTD_ISS=https://your-server:9200 \
REVA_OIDC_ISSUER=https://your-server:9200 \
PHOENIX_OIDC_AUTHORITY=https://your-server:9200 \
PHOENIX_WEB_CONFIG_SERVER=https://your-server:9200 \
PHOENIX_OIDC_METADATA_URL=https://your-server:9200/.well-known/openid-configuration \
WEB_OIDC_AUTHORITY=https://your-server:9200 \
WEB_UI_CONFIG_SERVER=https://your-server:9200 \
WEB_OIDC_METADATA_URL=https://your-server:9200/.well-known/openid-configuration \
REVA_DATAGATEWAY_URL=https://your-server:9200/data \
REVA_FRONTEND_URL=https://your-server:9200 \
PROXY_TRANSPORT_TLS_KEY=./certs/your-host.key \

View File

@@ -103,26 +103,26 @@ $ ldapsearch -x -H ldap://localhost:9125 -b dc=example,dc=com -D "cn=admin,dc=ex
> Note: This is currently a readonly implementation and minimal to the usecase of authenticating users with konnectd.
### Start ocis-phoenix
### Start ocis-web
#### Get it!
In an `ocis` folder
```
$ git clone git@github.com:owncloud/ocis-phoenix.git
$ cd ocis-phoenix
$ git clone git@github.com:owncloud/ocis.git
$ cd web
$ make
```
This should give you a `bin/ocis-phoenix` binary. Try listing the help with `bin/ocis-phoenix --help`.
This should give you a `bin/web` binary. Try listing the help with `bin/web --help`.
#### Run it!
Point `ocis-phoenix` to your owncloud domain and tell it where to find the openid connect issuing authority:
Point `ocis-web` to your owncloud domain and tell it where to find the openid connect issuing authority:
```console
$ bin/ocis-phoenix server --web-config-server https://cloud.example.com --oidc-authority https://192.168.1.100:9130 --oidc-metadata-url https://192.168.1.100:9130/.well-known/openid-configuration --oidc-client-id ocis
$ bin/web server --web-config-server https://cloud.example.com --oidc-authority https://192.168.1.100:9130 --oidc-metadata-url https://192.168.1.100:9130/.well-known/openid-configuration --oidc-client-id ocis
```
`ocis-phoenix` needs to know
`ocis-web` needs to know
- `--web-config-server https://cloud.example.com` is ownCloud url with webdav and ocs endpoints (oc10 or ocis)
- `--oidc-authority https://192.168.1.100:9130` the openid connect issuing authority, in our case `oidc-konnectd`, running on port 9130
- `--oidc-metadata-url https://192.168.1.100:9130/.well-known/openid-configuration` the openid connect configuration endpoint, typically the issuer host with `.well-known/openid-configuration`, but there are cases when another endpoint is used, eg. ping identity provides multiple endpoints to separate domains
@@ -179,11 +179,11 @@ clients:
You will need the `insecure: yes` if you are using self signed certificates.
Replace `cloud.example.com` in the redirect URI with your ownCloud 10 host and port.
Replace `localhost:9100` in the redirect URIs with your the `ocis-phoenix` host and port.
Replace `localhost:9100` in the redirect URIs with your `ocis-web` host and port.
#### Run it!
You can now bring up `ocis-connectd` with:
You can now bring up `ocis-konnectd` with:
```console
$ bin/ocis-konnectd server --iss https://192.168.1.100:9130 --identifier-registration-conf assets/identifier-registration.yaml --signing-kid gen1-2020-02-27
```
@@ -243,7 +243,7 @@ $CONFIG = [
In the above configuration replace
- `provider-url` with the URL to your `ocis-konnectd` issuer
- `https://cloud.example.com` with the URL to your ownCloud 10 instance
- `http://localhost:9100` with the URL to your phoenix instance
- `http://localhost:9100` with the URL to your ownCloud Web instance
> Note: By default the openidconnect app will use the email of the user to match the user from the oidc userinfo endpoint with the ownCloud account. So make sure your users have a unique primary email.
@@ -251,4 +251,4 @@ In the above configuration replace
Aside from the above todos these are the next stepo
- tie it all together behind `ocis-proxy`
- create an `ocis bridge` command that runs all the ocis services in one step with a properly preconfigured `ocis-konnectd` `identifier-registration.yaml` file for `phoenix` and the owncloud 10 `openidconnect` app, as well as a randomized `--signing-kid`.
- create an `ocis bridge` command that runs all the ocis services in one step with a properly preconfigured `ocis-konnectd` `identifier-registration.yaml` file for `ownCloud Web` and the owncloud 10 `openidconnect` app, as well as a randomized `--signing-kid`.

View File

@@ -66,7 +66,7 @@ See also [example server setup]({{< ref "preparing_server.md" >}})
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=
# ownCloud Web openid connect client id. Defaults to "ocis-phoenix"
# ownCloud Web openid connect client id. Defaults to "ocis-web"
OCIS_OIDC_CLIENT_ID=
### Keycloak ###
@@ -107,7 +107,7 @@ See also [example server setup]({{< ref "preparing_server.md" >}})
`docker-compose up -d`
* Visit the Keycloak administration console on your configured domain. Go to clients settings and add a client. The client id is `ocis-phoenix` or the one you changed it to. The client protocol is openid-connect. The root url for the client is the url you selected for oCIS. Then save the client.
* Visit the Keycloak administration console on your configured domain. Go to clients settings and add a client. The client id is `ocis-web` or the one you changed it to. The client protocol is openid-connect. The root url for the client is the url you selected for oCIS. Then save the client.
* You may also add users to Keycloak
@@ -130,7 +130,7 @@ After that you're ready to start the application stack:
`docker-compose up -d`
Open https://keycloak.owncloud.test in your browser and accept the invalid certificate warning.
Go to clients settings and add a client. The client id is `ocis-phoenix` or the one you changed it to. The client protocol is openid-connect. THe root url for the client is `https://ocis.owncloud.test`. Then save the client.
Go to clients settings and add a client. The client id is `ocis-web` or the one you changed it to. The client protocol is openid-connect. THe root url for the client is `https://ocis.owncloud.test`. Then save the client.
* You may also add users to Keycloak

View File

@@ -13,7 +13,7 @@ geekdocFilePath: debugging.md
As a single binary for easy deployment running `ocis server` just forks itself to start all the services, which makes debugging those processes a little harder.
Ultimately, we want to be able to stop a single service using eg. `ocis kill phoenix` so that you can start the service you want to debug in debug mode. We need to [change the way we fork processes](https://github.com/owncloud/ocis/issues/77) though, otherwise the runtime will automatically restart a service if killed.
Ultimately, we want to be able to stop a single service using eg. `ocis kill web` so that you can start the service you want to debug in debug mode. We need to [change the way we fork processes](https://github.com/owncloud/ocis/issues/77) though, otherwise the runtime will automatically restart a service if killed.
### Start ocis
@@ -46,7 +46,7 @@ Run the debug binary with `OCIS_LOG_LEVEL=debug bin/ocis-debug server` and then
12981 pts/1 Sl 0:00 bin/ocis-debug web
12993 pts/1 Sl 0:00 bin/ocis-debug api
12998 pts/1 Sl 0:00 bin/ocis-debug registry
13004 pts/1 Sl 0:00 bin/ocis-debug phoenix
13004 pts/1 Sl 0:00 bin/ocis-debug web
13015 pts/1 Sl 0:00 bin/ocis-debug reva-auth-basic
```
@@ -83,7 +83,7 @@ bin/ocis --log-level=$LOG_LEVEL graph &
#bin/ocis --log-level=$LOG_LEVEL hello &
bin/ocis --log-level=$LOG_LEVEL konnectd &
#bin/ocis --log-level=$LOG_LEVEL ocs &
bin/ocis --log-level=$LOG_LEVEL phoenix &
bin/ocis --log-level=$LOG_LEVEL web &
bin/ocis --log-level=$LOG_LEVEL reva-auth-basic &
bin/ocis --log-level=$LOG_LEVEL reva-auth-bearer &
bin/ocis --log-level=$LOG_LEVEL reva-frontend &
@@ -125,7 +125,7 @@ bin/ocis --log-level=$LOG_LEVEL proxy &
12981 pts/1 Sl 0:00 bin/ocis-debug web
12993 pts/1 Sl 0:00 bin/ocis-debug api
12998 pts/1 Sl 0:00 bin/ocis-debug registry
13004 pts/1 Sl 0:00 bin/ocis-debug phoenix
13004 pts/1 Sl 0:00 bin/ocis-debug web
13015 pts/1 Sl 0:00 bin/ocis-debug reva-auth-basic
```
@@ -144,7 +144,7 @@ We recommend you collect all related information in a single file or in a github
> Error while sharing.
> error sending a grpc stat request
This popped up when I tried to add `marie` as a collaborator in phoenix. That triggers a request to the server which I copied as curl. We can strip a lot of headers and the gist of it is:
This popped up when I tried to add `marie` as a collaborator in ownCloud Web. That triggers a request to the server which I copied as curl. We can strip a lot of headers and the gist of it is:
```console
# curl 'https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares' -d 'shareType=0&shareWith=marie&path=%2FNeuer+Ordner&permissions=1' -u einstein:relativity -k -v | xmllint -format -

View File

@@ -26,8 +26,8 @@ cd ocis
TAGS=simple make generate build
```
*Q: Can you specify which version of phoenix to use?*
*A: No, the phoenix that is used is compiled into the [assets of ocis-phoenix](https://github.com/owncloud/ocis-phoenix/blob/master/pkg/assets/embed.go) which is currently not automatically updated. We'll see how to use a custom phoenix later.*
*Q: Can you specify which version of ownCloud Web to use?*
*A: No, the ownCloud Web that is used is compiled into the [assets of ocis-web](https://github.com/owncloud/ocis/blob/master/web/pkg/assets/embed.go) which is currently not automatically updated. We'll see how to use a custom ownCloud Web later.*
`bin/ocis server`
@@ -84,7 +84,7 @@ In order to be able to manage the processes ourselves we need to start them inde
```
bin/ocis micro &
bin/ocis phoenix &
bin/ocis web &
bin/ocis hello &
bin/ocis reva &
```
@@ -96,13 +96,13 @@ cd ../ocis-hello
bin/ocis-hello server
```
## Hacking phoenix (and ocis-phoenix)
## Hacking ownCloud Web (and ocis-web)
Following https://github.com/owncloud/phoenix we are going to build the current phoenix
Following https://github.com/owncloud/web we are going to build the current ownCloud Web
```
git clone https://github.com/owncloud/phoenix.git
cd phoenix
git clone https://github.com/owncloud/web.git
cd web
yarn install
yarn dist
@@ -110,25 +110,25 @@ yarn dist
We can tell ocis to use the compiled assets:
Kill `ocis phoenix`, then use the compiled assets when starting phoenix.
Kill `ocis web`, then use the compiled assets when starting ownCloud Web.
```console
cd ../ocis
PHOENIX_ASSET_PATH="`pwd`/../phoenix/dist" bin/ocis phoenix
WEB_ASSET_PATH="`pwd`/../web/dist" bin/ocis web
```
## The ownCloud design system
The [ownCloud design system](https://owncloud.design/) contains a set of ownCloud vue components for phoenix or your own ocis extensions. Please use it for a consistent look and feel.
The [ownCloud design system](https://owncloud.design/) contains a set of ownCloud vue components for ownCloud Web or your own ocis extensions. Please use it for a consistent look and feel.
## External phoenix apps
## External ownCloud Web apps
This is what hello is: copy and extend!
1. Phoenix is configured using the config.json which is served by the phoenix service (either `bin/ocis phoenix` or `bin/ocis-phoenix server`)
1. ownCloud Web is configured using the config.json which is served by the ocis-web service (either `bin/ocis web` or `bin/web server`)
2. point ocis phoenix to the web config which you extended with an external app:
`PHOENIX_WEB_CONFIG="`pwd`/../phoenix/config.json" PHOENIX_ASSET_PATH="`pwd`/../phoenix/dist" bin/ocis phoenix`
2. point ocis-web to the web config which you extended with an external app:
`WEB_UI_CONFIG="`pwd`/../web/config.json" ASSET_PATH="`pwd`/../web/dist" bin/ocis web`
```json
{
@@ -138,7 +138,7 @@ This is what hello is: copy and extend!
"openIdConnect": {
"metadata_url": "http://localhost:9140/.well-known/openid-configuration",
"authority": "http://localhost:9140",
"client_id": "phoenix",
"client_id": "web",
"response_type": "code",
"scope": "openid profile email"
},
@@ -163,15 +163,15 @@ This is what hello is: copy and extend!
}
```
## Phoenix extension points
## ownCloud Web extension points
{{< hint info >}}
For an up to date list check out [the phoenix documentation](https://github.com/owncloud/phoenix/issues/2423).
For an up to date list check out [the ownCloud Web documentation](https://github.com/owncloud/web/issues/2423).
{{< /hint >}}
Several ones available:
### Phoenix core
### ownCloud Web
- App switcher (defined in config.json)
- App container (loads UI of your extension)
@@ -226,7 +226,7 @@ Long answer: micro and ocis-hello follow a protocol driven development:
- ocis uses go-micro, which provides http and grpc gateways
- the gateways and protocols are optional
- owncloud and kopano are looking into a [MS graph](https://developer.microsoft.com/de-de/graph) like api to handle phoenix requests.
- owncloud and kopano are looking into a [MS graph](https://developer.microsoft.com/de-de/graph) like api to handle ownCloud Web requests.
- they might be about user, contacrs, calendars ... which is covered by the graph api
- we want to integrate with eg. kopano and provide a commen api (file sync and share is covered as well)

View File

@@ -78,12 +78,12 @@ ocis list
To stop a particular extension:
{{< highlight txt >}}
ocis server kill phoenix
ocis server kill web
{{< / highlight >}}
To start a particular extension:
{{< highlight txt >}}
ocis server run phoenix
ocis server run web
{{< / highlight >}}
The version command prints the version of your installed oCIS.

View File

@@ -1,22 +0,0 @@
image: owncloud/ocis-phoenix:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: owncloud/ocis-phoenix:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
- image: owncloud/ocis-phoenix:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
variant: v8
os: linux
- image: owncloud/ocis-phoenix:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
variant: v6
os: linux

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
# backend
-r '^(cmd|pkg)/.*\.go$' -R '^node_modules/' -s -- sh -c 'make bin/ocis-phoenix-debug && bin/ocis-phoenix-debug --log-level debug server --debug-pprof --debug-zpages --asset-path assets/'

View File

@@ -33,9 +33,9 @@ services:
OCIS_DOMAIN: ${OCIS_DOMAIN:-localhost}
PROXY_OIDC_ISSUER: https://${OCIS_DOMAIN:-localhost}:9200
KONNECTD_ISS: https://${OCIS_DOMAIN:-localhost}:9200
PHOENIX_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-localhost}:9200
PHOENIX_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-localhost}:9200/.well-known/openid-configuration
PHOENIX_WEB_CONFIG_SERVER: https://${OCIS_DOMAIN:-localhost}:9200
WEB_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-localhost}:9200
WEB_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-localhost}:9200/.well-known/openid-configuration
WEB_UI_CONFIG_SERVER: https://${OCIS_DOMAIN:-localhost}:9200
STORAGE_OIDC_ISSUER: https://${OCIS_DOMAIN:-localhost}:9200
STORAGE_LDAP_IDP: https://${OCIS_DOMAIN:-localhost}:9200
# make home and users storages use eos

View File

@@ -24,7 +24,7 @@ services:
- ../accounts:/accounts
- ../glauth:/glauth
- ../konnectd:/konnectd
- ../ocis-phoenix:/ocis-phoenix
- ../web:/web
- ../ocis-pkg:/ocis-pkg
- ../ocs:/ocs
- ../proxy:/proxy
@@ -41,9 +41,9 @@ services:
OCIS_DOMAIN: ${OCIS_DOMAIN:-localhost}
PROXY_OIDC_ISSUER: https://${OCIS_DOMAIN:-localhost}:9200
KONNECTD_ISS: https://${OCIS_DOMAIN:-localhost}:9200
PHOENIX_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-localhost}:9200
PHOENIX_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-localhost}:9200/.well-known/openid-configuration
PHOENIX_WEB_CONFIG_SERVER: https://${OCIS_DOMAIN:-localhost}:9200
WEB_OIDC_AUTHORITY: https://${OCIS_DOMAIN:-localhost}:9200
WEB_OIDC_METADATA_URL: https://${OCIS_DOMAIN:-localhost}:9200/.well-known/openid-configuration
WEB_UI_CONFIG_SERVER: https://${OCIS_DOMAIN:-localhost}:9200
STORAGE_OIDC_ISSUER: https://${OCIS_DOMAIN:-localhost}:9200
STORAGE_LDAP_IDP: https://${OCIS_DOMAIN:-localhost}:9200
# TODO make id the default in ocis-storage

View File

@@ -21,7 +21,7 @@ require (
github.com/owncloud/ocis/accounts v0.5.3-0.20201103104733-ff2c41028d9b
github.com/owncloud/ocis/glauth v0.0.0-00010101000000-000000000000
github.com/owncloud/ocis/konnectd v0.0.0-00010101000000-000000000000
github.com/owncloud/ocis/ocis-phoenix v0.0.0-00010101000000-000000000000
github.com/owncloud/ocis/web v0.0.0-00010101000000-000000000000
github.com/owncloud/ocis/ocis-pkg v0.1.0
github.com/owncloud/ocis/ocs v0.0.0-00010101000000-000000000000
github.com/owncloud/ocis/onlyoffice v0.0.0-00010101000000-000000000000
@@ -42,7 +42,7 @@ replace (
github.com/owncloud/ocis/accounts => ../accounts
github.com/owncloud/ocis/glauth => ../glauth
github.com/owncloud/ocis/konnectd => ../konnectd
github.com/owncloud/ocis/ocis-phoenix => ../ocis-phoenix
github.com/owncloud/ocis/web => ../web
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
github.com/owncloud/ocis/ocs => ../ocs
github.com/owncloud/ocis/onlyoffice => ../onlyoffice

View File

@@ -1,57 +0,0 @@
package command
import (
"strings"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-phoenix/pkg/command"
"github.com/owncloud/ocis/ocis-phoenix/pkg/flagset"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
)
// PhoenixCommand is the entrypoint for the phoenix command.
func PhoenixCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "phoenix",
Usage: "Start phoenix server",
Category: "Extensions",
Flags: flagset.ServerWithConfig(cfg.Phoenix),
Before: func(c *cli.Context) error {
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
cfg.Phoenix.Phoenix.Config.Apps = c.StringSlice("web-config-app")
return nil
},
Action: func(c *cli.Context) error {
phoenixCommand := command.Server(configurePhoenix(cfg).Phoenix)
if err := phoenixCommand.Before(c); err != nil {
return err
}
return cli.HandleAction(phoenixCommand.Action, c)
},
}
}
func configurePhoenix(cfg *config.Config) *config.Config {
cfg.Phoenix.Log.Level = cfg.Log.Level
cfg.Phoenix.Log.Pretty = cfg.Log.Pretty
cfg.Phoenix.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Phoenix.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Phoenix.Tracing.Type = cfg.Tracing.Type
cfg.Phoenix.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Phoenix.Tracing.Collector = cfg.Tracing.Collector
}
return cfg
}
func init() {
register.AddCommand(PhoenixCommand)
}

57
ocis/pkg/command/web.go Normal file
View File

@@ -0,0 +1,57 @@
package command
import (
"strings"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis/pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/owncloud/ocis/web/pkg/command"
"github.com/owncloud/ocis/web/pkg/flagset"
)
// WebCommand is the entrypoint for the web command.
func WebCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "web",
Usage: "Start web server",
Category: "Extensions",
Flags: flagset.ServerWithConfig(cfg.Web),
Before: func(c *cli.Context) error {
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
cfg.Web.Web.Config.Apps = c.StringSlice("web-config-app")
return nil
},
Action: func(c *cli.Context) error {
webCommand := command.Server(configureWeb(cfg).Web)
if err := webCommand.Before(c); err != nil {
return err
}
return cli.HandleAction(webCommand.Action, c)
},
}
}
func configureWeb(cfg *config.Config) *config.Config {
cfg.Web.Log.Level = cfg.Log.Level
cfg.Web.Log.Pretty = cfg.Log.Pretty
cfg.Web.Log.Color = cfg.Log.Color
if cfg.Tracing.Enabled {
cfg.Web.Tracing.Enabled = cfg.Tracing.Enabled
cfg.Web.Tracing.Type = cfg.Tracing.Type
cfg.Web.Tracing.Endpoint = cfg.Tracing.Endpoint
cfg.Web.Tracing.Collector = cfg.Tracing.Collector
}
return cfg
}
func init() {
register.AddCommand(WebCommand)
}

View File

@@ -7,7 +7,6 @@ import (
accounts "github.com/owncloud/ocis/accounts/pkg/config"
glauth "github.com/owncloud/ocis/glauth/pkg/config"
konnectd "github.com/owncloud/ocis/konnectd/pkg/config"
phoenix "github.com/owncloud/ocis/ocis-phoenix/pkg/config"
ocs "github.com/owncloud/ocis/ocs/pkg/config"
onlyoffice "github.com/owncloud/ocis/onlyoffice/pkg/config"
proxy "github.com/owncloud/ocis/proxy/pkg/config"
@@ -15,6 +14,7 @@ import (
storage "github.com/owncloud/ocis/storage/pkg/config"
store "github.com/owncloud/ocis/store/pkg/config"
thumbnails "github.com/owncloud/ocis/thumbnails/pkg/config"
web "github.com/owncloud/ocis/web/pkg/config"
webdav "github.com/owncloud/ocis/webdav/pkg/config"
pman "github.com/refs/pman/pkg/config"
)
@@ -78,7 +78,7 @@ type Config struct {
Konnectd *konnectd.Config
OCS *ocs.Config
Onlyoffice *onlyoffice.Config
Phoenix *phoenix.Config
Web *web.Config
Proxy *proxy.Config
Settings *settings.Config
Storage *storage.Config
@@ -99,7 +99,7 @@ func New() *Config {
Konnectd: konnectd.New(),
OCS: ocs.New(),
Onlyoffice: onlyoffice.New(),
Phoenix: phoenix.New(),
Web: web.New(),
Proxy: proxy.New(),
Settings: settings.New(),
Storage: storage.New(),

View File

@@ -37,7 +37,6 @@ var (
"konnectd",
"ocs",
"onlyoffice",
"phoenix",
"proxy",
"settings",
"store",
@@ -51,6 +50,7 @@ var (
"storage-metadata",
"storage-public-link",
"thumbnails",
"web",
"webdav",
//"graph",
//"graph-explorer",

View File

@@ -1,9 +1,9 @@
const path = require('path')
const PHOENIX_PATH = process.env.PHOENIX_PATH
const WEB_PATH = process.env.WEB_PATH
const TEST_INFRA_DIRECTORY = process.env.TEST_INFRA_DIRECTORY
const OCIS_SETTINGS_STORE = process.env.OCIS_SETTINGS_STORE || './ocis-settings-store'
const config = require(path.join(PHOENIX_PATH, 'nightwatch.conf.js'))
const config = require(path.join(WEB_PATH, 'nightwatch.conf.js'))
config.page_objects_path = [TEST_INFRA_DIRECTORY + '/acceptance/pageObjects', 'ui/tests/acceptance/pageobjects']
config.custom_commands_path = TEST_INFRA_DIRECTORY + '/acceptance/customCommands'

View File

@@ -2,7 +2,7 @@
# OpenID Connect client registry.
clients:
- id: phoenix
- id: web
name: OCIS
application_type: web
insecure: yes

View File

@@ -5,7 +5,7 @@
"openIdConnect": {
"metadata_url": "https://ocis-server:9200/.well-known/openid-configuration",
"authority": "https://ocis-server:9200",
"client_id": "phoenix",
"client_id": "web",
"response_type": "code",
"scope": "openid profile email"
},

View File

@@ -1,8 +1,8 @@
#!/bin/bash
if [ -z "$PHOENIX_PATH" ]
if [ -z "$WEB_PATH" ]
then
echo "PHOENIX_PATH env variable is not set, cannot find files for tests infrastructure"
echo "WEB_PATH env variable is not set, cannot find files for tests infrastructure"
exit 1
fi
@@ -12,9 +12,9 @@ then
exit 1
fi
if [ -z "$PHOENIX_CONFIG" ]
if [ -z "$WEB_UI_CONFIG" ]
then
echo "PHOENIX_CONFIG env variable is not set, cannot find phoenix config file"
echo "WEB_UI_CONFIG env variable is not set, cannot find ownCloud Web config file"
exit 1
fi
@@ -46,7 +46,7 @@ clean_up() {
trap clean_up SIGHUP SIGINT SIGTERM EXIT
cp -r "$PHOENIX_PATH/tests" "./$testFolder"
cp -r "$WEB_PATH/tests" "./$testFolder"
export NODE_TLS_REJECT_UNAUTHORIZED='0'
export SERVER_HOST=${SERVER_HOST:-https://localhost:9200}

View File

@@ -2,7 +2,7 @@
# OpenID Connect client registry.
clients:
- id: phoenix
- id: web
name: OCIS
application_type: web
insecure: yes

View File

@@ -5,7 +5,7 @@
"openIdConnect": {
"metadata_url": "https://ocis-server:9200/.well-known/openid-configuration",
"authority": "https://ocis-server:9200",
"client_id": "phoenix",
"client_id": "web",
"response_type": "code",
"scope": "openid profile email"
},

View File

@@ -81,7 +81,7 @@ class OIDCProvider implements types.AuthProvider {
params: [this.account.login, this.account.password, '1'],
hello: {
scope: 'openid profile email',
client_id: 'phoenix',
client_id: 'web',
redirect_uri: this.redirectUri,
flow: 'oidc',
},
@@ -106,7 +106,7 @@ class OIDCProvider implements types.AuthProvider {
private getCode(continueURI: string): string {
const authorizeUri = `${continueURI}?${queryString.stringify({
client_id: 'phoenix',
client_id: 'web',
prompt: 'none',
redirect_uri: this.redirectUri,
response_mode: 'query',
@@ -128,7 +128,7 @@ class OIDCProvider implements types.AuthProvider {
private getToken(code: string): types.Token {
const tokenResponse = http.post(this.tokenUrl, {
client_id: 'phoenix',
client_id: 'web',
code,
redirect_uri: this.redirectUri,
grant_type: 'authorization_code',

View File

@@ -1,9 +1,9 @@
SHELL := bash
NAME := ocis-phoenix
NAME := web
IMPORT := github.com/owncloud/ocis/$(NAME)
BIN := bin
DIST := dist
PHOENIX_ASSETS_VERSION = v0.29.0
WEB_ASSETS_VERSION = v1.0.0-beta1
ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
@@ -180,4 +180,4 @@ watch:
.PHONY: pull-assets
pull-assets:
rm -Rf assets && mkdir assets/ && curl -slL -o- https://github.com/owncloud/phoenix/releases/download/$(PHOENIX_ASSETS_VERSION)/phoenix.tar.gz | tar xvzf - -C assets/
rm -Rf assets && mkdir assets/ && curl -slL -o- https://github.com/owncloud/web/releases/download/$(WEB_ASSETS_VERSION)/web.tar.gz | tar xvzf - -C assets/

View File

@@ -3,7 +3,7 @@ package main
import (
"os"
"github.com/owncloud/ocis/ocis-phoenix/pkg/command"
"github.com/owncloud/ocis/web/pkg/command"
)
func main() {

View File

@@ -13,7 +13,7 @@
"type": "jaeger",
"endpoint": "localhost:6831",
"collector": "http://localhost:14268/api/traces",
"service": "phoenix"
"service": "web"
},
"asset": {
"path": ""

View File

@@ -13,7 +13,7 @@ tracing:
type: jaeger
endpoint: localhost:6831
collector: http://localhost:14268/api/traces
service: phoenix
service: web
asset:
path:

View File

@@ -7,13 +7,13 @@ RUN apk update && \
echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
org.label-schema.name="oCIS Phoenix" \
org.label-schema.name="oCIS Web" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"
EXPOSE 9100 9104
ENTRYPOINT ["/usr/bin/ocis-phoenix"]
ENTRYPOINT ["/usr/bin/web"]
CMD ["server"]
COPY bin/ocis-phoenix /usr/bin/ocis-phoenix
COPY bin/web /usr/bin/web

View File

@@ -7,13 +7,13 @@ RUN apk update && \
echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
org.label-schema.name="oCIS Phoenix" \
org.label-schema.name="oCIS Web" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"
EXPOSE 9100 9104
ENTRYPOINT ["/usr/bin/ocis-phoenix"]
ENTRYPOINT ["/usr/bin/web"]
CMD ["server"]
COPY bin/ocis-phoenix /usr/bin/ocis-phoenix
COPY bin/web /usr/bin/web

View File

@@ -7,13 +7,13 @@ RUN apk update && \
echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
org.label-schema.name="oCIS Phoenix" \
org.label-schema.name="oCIS Web" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"
EXPOSE 9100 9104
ENTRYPOINT ["/usr/bin/ocis-phoenix"]
ENTRYPOINT ["/usr/bin/web"]
CMD ["server"]
COPY bin/ocis-phoenix /usr/bin/ocis-phoenix
COPY bin/web /usr/bin/web

22
web/docker/manifest.tmpl Normal file
View File

@@ -0,0 +1,22 @@
image: owncloud/ocis-web:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: owncloud/ocis-web:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
- image: owncloud/ocis-web:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
variant: v8
os: linux
- image: owncloud/ocis-web:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
variant: v6
os: linux

View File

@@ -1,4 +1,4 @@
module github.com/owncloud/ocis/ocis-phoenix
module github.com/owncloud/ocis/web
go 1.13

View File

@@ -5,8 +5,8 @@ import (
"os"
"path"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/web/pkg/config"
)
//go:generate go run github.com/UnnoTed/fileb0x embed.yml

1398
web/pkg/assets/embed.go Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,8 @@
package assets
import (
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/web/pkg/config"
)
// Option defines a single option function.

View File

@@ -5,8 +5,8 @@ import (
"net/http"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-phoenix/pkg/flagset"
"github.com/owncloud/ocis/web/pkg/config"
"github.com/owncloud/ocis/web/pkg/flagset"
)
// Health is the entrypoint for the health command.

View File

@@ -5,21 +5,21 @@ import (
"strings"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-phoenix/pkg/flagset"
"github.com/owncloud/ocis/ocis-phoenix/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/web/pkg/config"
"github.com/owncloud/ocis/web/pkg/flagset"
"github.com/owncloud/ocis/web/pkg/version"
"github.com/spf13/viper"
)
// Execute is the entry point for the ocis-phoenix command.
// Execute is the entry point for the web command.
func Execute() error {
cfg := config.New()
app := &cli.App{
Name: "ocis-phoenix",
Name: "web",
Version: version.String,
Usage: "Serve Phoenix for oCIS",
Usage: "Serve ownCloud Web for oCIS",
Compiled: version.Compiled(),
Authors: []*cli.Author{
@@ -53,7 +53,7 @@ func Execute() error {
// NewLogger initializes a service-specific logger instance.
func NewLogger(cfg *config.Config) log.Logger {
return log.NewLogger(
log.Name("phoenix"),
log.Name("web"),
log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color),
@@ -65,13 +65,13 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
logger := NewLogger(cfg)
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.SetEnvPrefix("PHOENIX")
viper.SetEnvPrefix("WEB")
viper.AutomaticEnv()
if c.IsSet("config-file") {
viper.SetConfigFile(c.String("config-file"))
} else {
viper.SetConfigName("phoenix")
viper.SetConfigName("web")
viper.AddConfigPath("/etc/ocis")
viper.AddConfigPath("$HOME/.ocis")

View File

@@ -16,11 +16,11 @@ import (
"github.com/oklog/run"
openzipkin "github.com/openzipkin/zipkin-go"
zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-phoenix/pkg/flagset"
"github.com/owncloud/ocis/ocis-phoenix/pkg/metrics"
"github.com/owncloud/ocis/ocis-phoenix/pkg/server/debug"
"github.com/owncloud/ocis/ocis-phoenix/pkg/server/http"
"github.com/owncloud/ocis/web/pkg/config"
"github.com/owncloud/ocis/web/pkg/flagset"
"github.com/owncloud/ocis/web/pkg/metrics"
"github.com/owncloud/ocis/web/pkg/server/debug"
"github.com/owncloud/ocis/web/pkg/server/http"
"go.opencensus.io/stats/view"
"go.opencensus.io/trace"
)
@@ -36,7 +36,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
cfg.Phoenix.Config.Apps = c.StringSlice("web-config-app")
cfg.Web.Config.Apps = c.StringSlice("web-config-app")
return ParseConfig(c, cfg)
},
@@ -136,7 +136,7 @@ func Server(cfg *config.Config) *cli.Command {
logger.Err(err).Msg("error opening config file")
return err
}
json.Unmarshal(contents, &cfg.Phoenix.Config)
json.Unmarshal(contents, &cfg.Web.Config)
}
var (

View File

@@ -37,8 +37,8 @@ type Asset struct {
Path string
}
// PhoenixConfig defines the available phoenix configuration for a dynamically rendered config.json.
type PhoenixConfig struct {
// WebConfig defines the available web configuration for a dynamically rendered config.json.
type WebConfig struct {
Server string `json:"server,omitempty"`
Theme string `json:"theme,omitempty"`
Version string `json:"version,omitempty"` // TODO what is version used for?
@@ -57,7 +57,7 @@ type OIDC struct {
Scope string `json:"scope,omitempty"`
}
// ExternalApp defines an external phoenix app.
// ExternalApp defines an external web app.
// {
// "name": "hello",
// "path": "http://localhost:9105/hello.js",
@@ -72,15 +72,15 @@ type ExternalApp struct {
Config map[string]interface{} `json:"config,omitempty"`
}
// ExternalAppConfig defines an external phoenix app configuration.
// ExternalAppConfig defines an external web app configuration.
type ExternalAppConfig struct {
URL string `json:"url,omitempty"`
}
// Phoenix defines the available phoenix configuration.
type Phoenix struct {
// Web defines the available web configuration.
type Web struct {
Path string
Config PhoenixConfig
Config WebConfig
}
// Config combines all available configuration parts.
@@ -92,7 +92,7 @@ type Config struct {
Tracing Tracing
Asset Asset
OIDC OIDC
Phoenix Phoenix
Web Web
}
// New initializes a new configuration with or without defaults.

View File

@@ -2,7 +2,7 @@ package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/web/pkg/config"
)
// RootWithConfig applies cfg to the root flagset
@@ -12,21 +12,21 @@ func RootWithConfig(cfg *config.Config) []cli.Flag {
Name: "log-level",
Value: "info",
Usage: "Set logging level",
EnvVars: []string{"PHOENIX_LOG_LEVEL"},
EnvVars: []string{"WEB_LOG_LEVEL"},
Destination: &cfg.Log.Level,
},
&cli.BoolFlag{
Name: "log-pretty",
Value: true,
Usage: "Enable pretty logging",
EnvVars: []string{"PHOENIX_LOG_PRETTY"},
EnvVars: []string{"WEB_LOG_PRETTY"},
Destination: &cfg.Log.Pretty,
},
&cli.BoolFlag{
Name: "log-color",
Value: true,
Usage: "Enable colored logging",
EnvVars: []string{"PHOENIX_LOG_COLOR"},
EnvVars: []string{"WEB_LOG_COLOR"},
Destination: &cfg.Log.Color,
},
}
@@ -39,7 +39,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9104",
Usage: "Address to debug endpoint",
EnvVars: []string{"PHOENIX_DEBUG_ADDR"},
EnvVars: []string{"WEB_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
}
@@ -52,172 +52,172 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
Name: "config-file",
Value: "",
Usage: "Path to config file",
EnvVars: []string{"PHOENIX_CONFIG_FILE"},
EnvVars: []string{"WEB_CONFIG_FILE"},
Destination: &cfg.File,
},
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",
EnvVars: []string{"PHOENIX_TRACING_ENABLED"},
EnvVars: []string{"WEB_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
&cli.StringFlag{
Name: "tracing-type",
Value: "jaeger",
Usage: "Tracing backend type",
EnvVars: []string{"PHOENIX_TRACING_TYPE"},
EnvVars: []string{"WEB_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: "",
Usage: "Endpoint for the agent",
EnvVars: []string{"PHOENIX_TRACING_ENDPOINT"},
EnvVars: []string{"WEB_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: "",
Usage: "Endpoint for the collector",
EnvVars: []string{"PHOENIX_TRACING_COLLECTOR"},
EnvVars: []string{"WEB_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
Name: "tracing-service",
Value: "phoenix",
Value: "web",
Usage: "Service name for tracing",
EnvVars: []string{"PHOENIX_TRACING_SERVICE"},
EnvVars: []string{"WEB_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
&cli.StringFlag{
Name: "debug-addr",
Value: "0.0.0.0:9104",
Usage: "Address to bind debug server",
EnvVars: []string{"PHOENIX_DEBUG_ADDR"},
EnvVars: []string{"WEB_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
&cli.StringFlag{
Name: "debug-token",
Value: "",
Usage: "Token to grant metrics access",
EnvVars: []string{"PHOENIX_DEBUG_TOKEN"},
EnvVars: []string{"WEB_DEBUG_TOKEN"},
Destination: &cfg.Debug.Token,
},
&cli.BoolFlag{
Name: "debug-pprof",
Usage: "Enable pprof debugging",
EnvVars: []string{"PHOENIX_DEBUG_PPROF"},
EnvVars: []string{"WEB_DEBUG_PPROF"},
Destination: &cfg.Debug.Pprof,
},
&cli.BoolFlag{
Name: "debug-zpages",
Usage: "Enable zpages debugging",
EnvVars: []string{"PHOENIX_DEBUG_ZPAGES"},
EnvVars: []string{"WEB_DEBUG_ZPAGES"},
Destination: &cfg.Debug.Zpages,
},
&cli.StringFlag{
Name: "http-addr",
Value: "0.0.0.0:9100",
Usage: "Address to bind http server",
EnvVars: []string{"PHOENIX_HTTP_ADDR"},
EnvVars: []string{"WEB_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
&cli.StringFlag{
Name: "http-root",
Value: "/",
Usage: "Root path of http server",
EnvVars: []string{"PHOENIX_HTTP_ROOT"},
EnvVars: []string{"WEB_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
&cli.StringFlag{
Name: "http-namespace",
Value: "com.owncloud.web",
Usage: "Set the base namespace for the http namespace",
EnvVars: []string{"PHOENIX_NAMESPACE"},
EnvVars: []string{"WEB_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
&cli.IntFlag{
Name: "http-cache-ttl",
Value: 604800, // 7 days
Usage: "Set the static assets caching duration in seconds",
EnvVars: []string{"PHOENIX_CACHE_TTL"},
EnvVars: []string{"WEB_CACHE_TTL"},
Destination: &cfg.HTTP.CacheTTL,
},
&cli.StringFlag{
Name: "asset-path",
Value: "",
Usage: "Path to custom assets",
EnvVars: []string{"PHOENIX_ASSET_PATH"},
EnvVars: []string{"WEB_ASSET_PATH"},
Destination: &cfg.Asset.Path,
},
&cli.StringFlag{
Name: "web-config",
Value: "",
Usage: "Path to phoenix config",
EnvVars: []string{"PHOENIX_WEB_CONFIG"},
Destination: &cfg.Phoenix.Path,
Usage: "Path to web config",
EnvVars: []string{"WEB_UI_CONFIG"},
Destination: &cfg.Web.Path,
},
&cli.StringFlag{
Name: "web-config-server",
Value: "https://localhost:9200",
Usage: "Server URL",
EnvVars: []string{"PHOENIX_WEB_CONFIG_SERVER"},
Destination: &cfg.Phoenix.Config.Server,
EnvVars: []string{"WEB_UI_CONFIG_SERVER"},
Destination: &cfg.Web.Config.Server,
},
&cli.StringFlag{
Name: "web-config-theme",
Value: "owncloud",
Usage: "Theme",
EnvVars: []string{"PHOENIX_WEB_CONFIG_THEME"},
Destination: &cfg.Phoenix.Config.Theme,
EnvVars: []string{"WEB_UI_CONFIG_THEME"},
Destination: &cfg.Web.Config.Theme,
},
&cli.StringFlag{
Name: "web-config-version",
Value: "0.1.0",
Usage: "Version",
EnvVars: []string{"PHOENIX_WEB_CONFIG_VERSION"},
Destination: &cfg.Phoenix.Config.Version,
EnvVars: []string{"WEB_UI_CONFIG_VERSION"},
Destination: &cfg.Web.Config.Version,
},
&cli.StringSliceFlag{
Name: "web-config-app",
Value: cli.NewStringSlice("files", "media-viewer"),
Usage: `--web-config-app files [--web-config-app draw-io]`,
EnvVars: []string{"PHOENIX_WEB_CONFIG_APPS"},
EnvVars: []string{"WEB_UI_CONFIG_APPS"},
},
&cli.StringFlag{
Name: "oidc-metadata-url",
Value: "https://localhost:9200/.well-known/openid-configuration",
Usage: "OpenID Connect metadata URL",
EnvVars: []string{"PHOENIX_OIDC_METADATA_URL"},
Destination: &cfg.Phoenix.Config.OpenIDConnect.MetadataURL,
EnvVars: []string{"WEB_OIDC_METADATA_URL"},
Destination: &cfg.Web.Config.OpenIDConnect.MetadataURL,
},
&cli.StringFlag{
Name: "oidc-authority",
Value: "https://localhost:9200",
Usage: "OpenID Connect authority", // TODO rename to Issuer
EnvVars: []string{"PHOENIX_OIDC_AUTHORITY"},
Destination: &cfg.Phoenix.Config.OpenIDConnect.Authority,
EnvVars: []string{"WEB_OIDC_AUTHORITY"},
Destination: &cfg.Web.Config.OpenIDConnect.Authority,
},
&cli.StringFlag{
Name: "oidc-client-id",
Value: "phoenix",
Value: "web",
Usage: "OpenID Connect client ID",
EnvVars: []string{"PHOENIX_OIDC_CLIENT_ID"},
Destination: &cfg.Phoenix.Config.OpenIDConnect.ClientID,
EnvVars: []string{"WEB_OIDC_CLIENT_ID"},
Destination: &cfg.Web.Config.OpenIDConnect.ClientID,
},
&cli.StringFlag{
Name: "oidc-response-type",
Value: "code",
Usage: "OpenID Connect response type",
EnvVars: []string{"PHOENIX_OIDC_RESPONSE_TYPE"},
Destination: &cfg.Phoenix.Config.OpenIDConnect.ResponseType,
EnvVars: []string{"WEB_OIDC_RESPONSE_TYPE"},
Destination: &cfg.Web.Config.OpenIDConnect.ResponseType,
},
&cli.StringFlag{
Name: "oidc-scope",
Value: "openid profile email",
Usage: "OpenID Connect scope",
EnvVars: []string{"PHOENIX_OIDC_SCOPE"},
Destination: &cfg.Phoenix.Config.OpenIDConnect.Scope,
EnvVars: []string{"WEB_OIDC_SCOPE"},
Destination: &cfg.Web.Config.OpenIDConnect.Scope,
},
}
}

View File

@@ -5,7 +5,7 @@ var (
Namespace = "ocis"
// Subsystem defines the subsystem for the defines metrics.
Subsystem = "phoenix"
Subsystem = "web"
)
// Metrics defines the available metrics of this service.

View File

@@ -3,8 +3,8 @@ package debug
import (
"context"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/web/pkg/config"
)
// Option defines a single option function.

View File

@@ -4,9 +4,9 @@ import (
"io"
"net/http"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-phoenix/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/service/debug"
"github.com/owncloud/ocis/web/pkg/config"
"github.com/owncloud/ocis/web/pkg/version"
)
// Server initializes the debug service and server.
@@ -15,7 +15,7 @@ func Server(opts ...Option) (*http.Server, error) {
return debug.NewService(
debug.Logger(options.Logger),
debug.Name("phoenix"),
debug.Name("web"),
debug.Version(version.String),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),

View File

@@ -4,9 +4,9 @@ import (
"context"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-phoenix/pkg/metrics"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/web/pkg/config"
"github.com/owncloud/ocis/web/pkg/metrics"
)
// Option defines a single option function.

View File

@@ -1,11 +1,11 @@
package http
import (
phoenixmid "github.com/owncloud/ocis/ocis-phoenix/pkg/middleware"
svc "github.com/owncloud/ocis/ocis-phoenix/pkg/service/v0"
"github.com/owncloud/ocis/ocis-phoenix/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/middleware"
"github.com/owncloud/ocis/ocis-pkg/service/http"
webmid "github.com/owncloud/ocis/web/pkg/middleware"
svc "github.com/owncloud/ocis/web/pkg/service/v0"
"github.com/owncloud/ocis/web/pkg/version"
)
// Server initializes the http service and server.
@@ -15,7 +15,7 @@ func Server(opts ...Option) (http.Service, error) {
service := http.NewService(
http.Logger(options.Logger),
http.Namespace(options.Namespace),
http.Name("phoenix"),
http.Name("web"),
http.Version(version.String),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
@@ -31,9 +31,9 @@ func Server(opts ...Option) (http.Service, error) {
middleware.NoCache,
middleware.Cors,
middleware.Secure,
phoenixmid.SilentRefresh,
webmid.SilentRefresh,
middleware.Version(
"phoenix",
"web",
version.String,
),
middleware.Logger(

View File

@@ -3,7 +3,7 @@ package svc
import (
"net/http"
"github.com/owncloud/ocis/ocis-phoenix/pkg/metrics"
"github.com/owncloud/ocis/web/pkg/metrics"
)
// NewInstrument returns a service that instruments metrics.

View File

@@ -3,8 +3,8 @@ package svc
import (
"net/http"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/web/pkg/config"
)
// Option defines a single option function.

View File

@@ -11,9 +11,9 @@ import (
"time"
"github.com/go-chi/chi"
"github.com/owncloud/ocis/ocis-phoenix/pkg/assets"
"github.com/owncloud/ocis/ocis-phoenix/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/web/pkg/assets"
"github.com/owncloud/ocis/web/pkg/config"
)
var (
@@ -34,7 +34,7 @@ func NewService(opts ...Option) Service {
m := chi.NewMux()
m.Use(options.Middleware...)
svc := Phoenix{
svc := Web{
logger: options.Logger,
config: options.Config,
mux: m,
@@ -48,31 +48,31 @@ func NewService(opts ...Option) Service {
return svc
}
// Phoenix defines implements the business logic for Service.
type Phoenix struct {
// Web defines implements the business logic for Service.
type Web struct {
logger log.Logger
config *config.Config
mux *chi.Mux
}
// ServeHTTP implements the Service interface.
func (p Phoenix) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (p Web) ServeHTTP(w http.ResponseWriter, r *http.Request) {
p.mux.ServeHTTP(w, r)
}
func (p Phoenix) getPayload() (payload []byte, err error) {
func (p Web) getPayload() (payload []byte, err error) {
if p.config.Phoenix.Path == "" {
if p.config.Web.Path == "" {
// render dynamically using config
// provide default ocis-web options
if p.config.Phoenix.Config.Options == nil {
p.config.Phoenix.Config.Options = make(map[string]interface{})
p.config.Phoenix.Config.Options["hideSearchBar"] = true
if p.config.Web.Config.Options == nil {
p.config.Web.Config.Options = make(map[string]interface{})
p.config.Web.Config.Options["hideSearchBar"] = true
}
if p.config.Phoenix.Config.ExternalApps == nil {
p.config.Phoenix.Config.ExternalApps = []config.ExternalApp{
if p.config.Web.Config.ExternalApps == nil {
p.config.Web.Config.ExternalApps = []config.ExternalApp{
{
ID: "settings",
Path: "/settings.js",
@@ -86,34 +86,34 @@ func (p Phoenix) getPayload() (payload []byte, err error) {
// make apps render as empty array if it is empty
// TODO remove once https://github.com/golang/go/issues/27589 is fixed
if len(p.config.Phoenix.Config.Apps) == 0 {
p.config.Phoenix.Config.Apps = make([]string, 0)
if len(p.config.Web.Config.Apps) == 0 {
p.config.Web.Config.Apps = make([]string, 0)
}
return json.Marshal(p.config.Phoenix.Config)
return json.Marshal(p.config.Web.Config)
}
// try loading from file
if _, err = os.Stat(p.config.Phoenix.Path); os.IsNotExist(err) {
if _, err = os.Stat(p.config.Web.Path); os.IsNotExist(err) {
p.logger.Fatal().
Err(err).
Str("config", p.config.Phoenix.Path).
Msg("phoenix config doesn't exist")
Str("config", p.config.Web.Path).
Msg("web config doesn't exist")
}
payload, err = ioutil.ReadFile(p.config.Phoenix.Path)
payload, err = ioutil.ReadFile(p.config.Web.Path)
if err != nil {
p.logger.Fatal().
Err(err).
Str("config", p.config.Phoenix.Path).
Str("config", p.config.Web.Path).
Msg("failed to read custom config")
}
return
}
// Config implements the Service interface.
func (p Phoenix) Config(w http.ResponseWriter, r *http.Request) {
func (p Web) Config(w http.ResponseWriter, r *http.Request) {
payload, err := p.getPayload()
if err != nil {
@@ -127,7 +127,7 @@ func (p Phoenix) Config(w http.ResponseWriter, r *http.Request) {
}
// Static simply serves all static files.
func (p Phoenix) Static(ttl int) http.HandlerFunc {
func (p Web) Static(ttl int) http.HandlerFunc {
rootWithSlash := p.config.HTTP.Root
if !strings.HasSuffix(rootWithSlash, "/") {

2
web/reflex.conf Normal file
View File

@@ -0,0 +1,2 @@
# backend
-r '^(cmd|pkg)/.*\.go$' -R '^node_modules/' -s -- sh -c 'make bin/web-debug && bin/web-debug --log-level debug server --debug-pprof --debug-zpages --asset-path assets/'

View File

@@ -3,7 +3,7 @@ title: "Configuration"
date: "{{ date "2006-01-02T15:04:05-0700" now }}"
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/phoenix/templates
geekdocEditPath: edit/master/web/templates
geekdocFilePath: CONFIGURATION.tmpl
---
{{- define "options"}}
@@ -33,7 +33,7 @@ $HOME/.ocis
./config
```
For this configuration to be picked up, have a look at your extension `root` command and look for which default config name it has assigned. *i.e: ocis-phoenix reads `phoenix.json | yaml | toml ...`*.
For this configuration to be picked up, have a look at your extension `root` command and look for which default config name it has assigned. *i.e: ocis-web reads `web.json | yaml | toml ...`*.
So far we support the file formats `JSON` and `YAML`, if you want to get a full example configuration just take a look at [our repository](https://github.com/owncloud/ocis/tree/master/config), there you can always see the latest configuration format. These example configurations include all available options and the default values. The configuration file will be automatically loaded if it's placed at `/etc/ocis/ocis.yml`, `${HOME}/.ocis/ocis.yml` or `$(pwd)/config/ocis.yml`.
@@ -48,12 +48,12 @@ If you prefer to configure the service with commandline flags you can see the av
{{ $options := .Options -}}
{{ range $com := .Commands }}{{ with (list $options $com) -}}
{{ $c := last . -}}
{{ if eq $c.Name "phoenix" -}}
{{ if eq $c.Name "web" -}}
## Root Command
{{ $c.Usage }}
Usage: `phoenix [global options] command [command options] [arguments...]`
Usage: `web [global options] command [command options] [arguments...]`
{{ template "options" . -}}
## Sub Commands
@@ -62,12 +62,12 @@ Usage: `phoenix [global options] command [command options] [arguments...]`
{{ end -}}
{{- range $com := .Commands }}{{ with (list $options $com) -}}
{{- $c := last . }}
{{- if ne $c.Name "phoenix" -}}
### phoenix {{ $c.Name }}
{{- if ne $c.Name "web" -}}
### web {{ $c.Name }}
{{ $c.Usage }}
Usage: `phoenix {{ $c.Name }} [command options] [arguments...]`
Usage: `web {{ $c.Name }} [command options] [arguments...]`
{{ template "options" . }}
{{- end -}}
{{- end -}}