Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Systems Frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
155
Issues
155
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Motion Bank
Applications
Systems Frontend
Commits
b21af278
Commit
b21af278
authored
Oct 16, 2019
by
Anton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default env file to configure app externally at runtime
parent
f17d734c
Pipeline
#16887
passed with stage
in 1 minute and 17 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
13 deletions
+35
-13
CHANGELOG.md
CHANGELOG.md
+2
-0
src-electron/main-process/auth-service-electron.js
src-electron/main-process/auth-service-electron.js
+8
-8
src/App.vue
src/App.vue
+4
-1
src/index.template.html
src/index.template.html
+1
-0
src/plugins/auth.js
src/plugins/auth.js
+4
-4
src/statics/env.js
src/statics/env.js
+16
-0
No files found.
CHANGELOG.md
View file @
b21af278
...
@@ -29,6 +29,8 @@ under `media/create` (playback possible using forked
...
@@ -29,6 +29,8 @@ under `media/create` (playback possible using forked
[
vue-video-player
](
https://github.com/dasantonym/vue-video-player
)
)
[
vue-video-player
](
https://github.com/dasantonym/vue-video-player
)
)
-
Export timelines as CSV
-
Export timelines as CSV
-
Mobile compatiblity for MoSys Editor
-
Mobile compatiblity for MoSys Editor
-
The file
`statics/env.js`
can be overwritten to configure
the frontend at runtime
### Changed
### Changed
...
...
src-electron/main-process/auth-service-electron.js
View file @
b21af278
...
@@ -13,11 +13,11 @@ const
...
@@ -13,11 +13,11 @@ const
keytarAccount
=
os
.
userInfo
().
username
keytarAccount
=
os
.
userInfo
().
username
function
getAuthenticationURL
()
{
function
getAuthenticationURL
()
{
return
'
https://
'
+
process
.
env
.
AUTH0_DOMAIN
+
'
/authorize?
'
+
return
'
https://
'
+
(
window
.
AUTH0_DOMAIN
||
process
.
env
.
AUTH0_DOMAIN
)
+
'
/authorize?
'
+
'
audience=
'
+
process
.
env
.
AUTH0_AUDIENCE
+
'
&
'
+
'
audience=
'
+
(
window
.
AUTH0_AUDIENCE
||
process
.
env
.
AUTH0_AUDIENCE
)
+
'
&
'
+
'
scope=openid profile offline_access&
'
+
'
scope=openid profile offline_access&
'
+
'
response_type=code&
'
+
'
response_type=code&
'
+
'
client_id=
'
+
process
.
env
.
AUTH0_CLIENT_ID
+
'
&
'
+
'
client_id=
'
+
(
window
.
AUTH0_CLIENT_ID
||
process
.
env
.
AUTH0_CLIENT_ID
)
+
'
&
'
+
'
redirect_uri=
'
+
redirectUri
'
redirect_uri=
'
+
redirectUri
}
}
...
@@ -25,9 +25,9 @@ async function refreshTokens () {
...
@@ -25,9 +25,9 @@ async function refreshTokens () {
const
refreshToken
=
await
keytar
.
getPassword
(
keytarService
,
keytarAccount
)
const
refreshToken
=
await
keytar
.
getPassword
(
keytarService
,
keytarAccount
)
if
(
!
refreshToken
)
return
throw
new
Error
(
'
No refresh token found
'
)
if
(
!
refreshToken
)
return
throw
new
Error
(
'
No refresh token found
'
)
const
result
=
await
axios
.
post
(
`https://
${
process
.
env
.
AUTH0_DOMAIN
}
/oauth/token`
,
{
const
result
=
await
axios
.
post
(
`https://
${
window
.
AUTH0_DOMAIN
||
process
.
env
.
AUTH0_DOMAIN
}
/oauth/token`
,
{
grant_type
:
'
refresh_token
'
,
grant_type
:
'
refresh_token
'
,
client_id
:
process
.
env
.
AUTH0_CLIENT_ID
,
client_id
:
window
.
AUTH0_CLIENT_ID
||
process
.
env
.
AUTH0_CLIENT_ID
,
refresh_token
:
refreshToken
refresh_token
:
refreshToken
},
{
},
{
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
...
@@ -43,12 +43,12 @@ async function loadTokens (callbackURL) {
...
@@ -43,12 +43,12 @@ async function loadTokens (callbackURL) {
const
exchangeOptions
=
{
const
exchangeOptions
=
{
'
grant_type
'
:
'
authorization_code
'
,
'
grant_type
'
:
'
authorization_code
'
,
'
client_id
'
:
process
.
env
.
AUTH0_CLIENT_ID
,
'
client_id
'
:
window
.
AUTH0_CLIENT_ID
||
process
.
env
.
AUTH0_CLIENT_ID
,
'
code
'
:
query
.
code
,
'
code
'
:
query
.
code
,
'
redirect_uri
'
:
redirectUri
'
redirect_uri
'
:
redirectUri
}
}
const
result
=
await
axios
.
post
(
`https://
${
process
.
env
.
AUTH0_DOMAIN
}
/oauth/token`
,
exchangeOptions
,
{
const
result
=
await
axios
.
post
(
`https://
${
window
.
AUTH0_DOMAIN
||
process
.
env
.
AUTH0_DOMAIN
}
/oauth/token`
,
exchangeOptions
,
{
headers
:
{
headers
:
{
'
Content-Type
'
:
'
application/json
'
'
Content-Type
'
:
'
application/json
'
}
}
...
@@ -66,7 +66,7 @@ async function logout () {
...
@@ -66,7 +66,7 @@ async function logout () {
}
}
function
getLogOutUrl
()
{
function
getLogOutUrl
()
{
return
`https://
${
process
.
env
.
AUTH0_DOMAIN
}
/v2/logout`
return
`https://
${
window
.
AUTH0_DOMAIN
||
process
.
env
.
AUTH0_DOMAIN
}
/v2/logout`
}
}
export
{
export
{
...
...
src/App.vue
View file @
b21af278
...
@@ -9,7 +9,10 @@
...
@@ -9,7 +9,10 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'
App
'
name
:
'
App
'
,
mounted
()
{
console
.
log
(
window
.
TRANSCODER_HOST
)
}
}
}
</
script
>
</
script
>
...
...
src/index.template.html
View file @
b21af278
...
@@ -21,5 +21,6 @@
...
@@ -21,5 +21,6 @@
<div
id=
"q-app"
></div>
<div
id=
"q-app"
></div>
<!-- built files will be auto injected here -->
<!-- built files will be auto injected here -->
<script
src=
"statics/env.js"
language=
"JavaScript"
></script>
</body>
</body>
</html>
</html>
src/plugins/auth.js
View file @
b21af278
...
@@ -8,10 +8,10 @@ export default ({ Vue }) => {
...
@@ -8,10 +8,10 @@ export default ({ Vue }) => {
}
}
else
{
else
{
authService
=
new
AuthService
({
authService
=
new
AuthService
({
domain
:
process
.
env
.
AUTH0_DOMAIN
,
domain
:
window
.
AUTH0_DOMAIN
||
process
.
env
.
AUTH0_DOMAIN
,
clientID
:
process
.
env
.
AUTH0_CLIENT_ID
,
clientID
:
window
.
AUTH0_CLIENT_ID
||
process
.
env
.
AUTH0_CLIENT_ID
,
redirectUri
:
process
.
env
.
AUTH0_REDIRECT_URL
||
`
${
document
.
location
.
origin
}
/users/callback`
,
redirectUri
:
`
${
document
.
location
.
origin
}
/users/callback`
,
audience
:
process
.
env
.
AUTH0_AUDIENCE
,
audience
:
window
.
AUTH0_AUDIENCE
||
process
.
env
.
AUTH0_AUDIENCE
,
scope
:
'
openid profile read write
'
,
scope
:
'
openid profile read write
'
,
responseType
:
'
token id_token
'
responseType
:
'
token id_token
'
})
})
...
...
src/statics/env.js
0 → 100644
View file @
b21af278
Object
.
assign
(
window
,
{
//
// HOST CONFIG
//
API_HOST
:
'
https://api.motionbank.org
'
,
TRANSCODER_HOST
:
'
https://transcoder.motionbank.org
'
,
SOCKETS_HOST
:
'
https://sockets.motionbank.org
'
,
STORAGE_HOST
:
'
https://storage.motionbank.org
'
,
PACKAGER_HOST
:
'
https://packager.motionbank.org
'
,
//
// AUTH
//
AUTH0_CLIENT_ID
:
'
80t5TRU9MVhGDVnZ522CvX4hutBxDB6U
'
,
AUTH0_DOMAIN
:
'
auth.motionbank.org
'
,
AUTH0_AUDIENCE
:
'
https://api.motionbank.org
'
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment