-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#7 resolved
- Loading branch information
Showing
13 changed files
with
94 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CLIENT_ID=dc330d7fe9904f7dfcd8 | ||
CLIENT_SECRET=838495f0bc343f514832b019f4610a5ecf32922b | ||
CLIENT_ID= "" | ||
CLIENT_SECRET="" | ||
VUE_APP_CLIENT_ID=$CLIENT_ID | ||
VUE_APP_CLIENT_SECRET=$CLIENT_SECRET | ||
CALL_BACK=http://localhost:8080/callback | ||
VUE_APP_CALL_BACK=$CALL_BACK | ||
CALL_BACK="" | ||
VUE_APP_CALL_BACK=$CALL_BACK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ pnpm-debug.log* | |
*.sw? | ||
|
||
#Electron-builder output | ||
/dist_electron | ||
/dist_electron | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
FROM node:latest as builder | ||
ARG VUE_APP_PUBLIC_PATH="" | ||
ENV VUE_APP_PUBLIC_PATH=$VUE_APP_PUBLIC_PATH | ||
WORKDIR /usr/app | ||
COPY . . | ||
#RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local | ||
RUN npm i --legacy-peer-deps && npm run build | ||
RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local | ||
This comment has been minimized.
Sorry, something went wrong. |
||
RUN echo "VUE_APP_CLIENT_SECRET=$CLIENT_SECRET" >.env.development.local | ||
RUN echo "VUE_APP_CALL_BACK=$CALL_BACK" >.env.development.local | ||
RUN npm install --legacy-peer-deps --force && npm run build | ||
|
||
|
||
FROM nginx:alpine | ||
|
||
WORKDIR /etc/nginx | ||
COPY 40-create-ghcred.sh /docker-entrypoint.d | ||
COPY ngnix.conf /etc/nginx/nginx.d/default.conf | ||
COPY --from=builder /usr/app/dist/ /usr/share/nginx/html/ | ||
COPY --from=builder /usr/app/dist/ /usr/share/nginx/html/test/ | ||
This comment has been minimized.
Sorry, something went wrong.
peterstadler
Member
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
server { | ||
listen 80 | ||
# declare token is "" (empty str) for original request without args,because $is_args concat any var will be `?` | ||
set $token ""; | ||
# if the request has args update token to "&" | ||
# request without args doesn't make sense in this case | ||
if ($is_args) { | ||
set $token "&"; | ||
} | ||
# file created on container start from env vars (40-create-ghcred.sh) | ||
include "/GH_OAUTH_CLIENT.conf"; | ||
# reverse proxy to github access_token | ||
# set rule to /auth explicitly | ||
location = /auth { | ||
set $args "${args}${token}client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}"; | ||
proxy_pass https://github.com/login/oauth/access_token$is_args$args; | ||
proxy_set_header accept "application/json"; | ||
} | ||
# default rule to access app | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
listen 80; | ||
|
||
# declare token is "" (empty str) for original request without args,because $is_args concat any var will be `?` | ||
set $token ""; | ||
# if the request has args update token to "&" | ||
# request without args doesn't make sense in this case | ||
if ($is_args) { | ||
set $token "&"; | ||
} | ||
# file created on container start from env vars (40-create-ghcred.sh) | ||
include "/GH_OAUTH_CLIENT.conf"; | ||
# reverse proxy to github access_token | ||
# set rule to /auth explicitly | ||
location = /auth { | ||
set $args "${args}${token}client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}"; | ||
proxy_pass https://github.com/login/oauth/access_token$is_args$args; | ||
proxy_set_header accept "application/json"; | ||
} | ||
|
||
# Serve Vue.js application from VUE_APP_PUBLIC_PATH | ||
location / { | ||
alias /usr/share/nginx/html$VUE_APP_PUBLIC_PATH; | ||
This comment has been minimized.
Sorry, something went wrong.
peterstadler
Member
|
||
try_files $uri $uri/ $VUE_APP_PUBLIC_PATH/index.html; | ||
} | ||
|
||
# Redirect requests without trailing slash to include it | ||
location ~ ^(.*)/$ { | ||
return 301 $1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* global __webpack_public_path__:writable */ | ||
/* exported __webpack_public_path__ */ | ||
__webpack_public_path__ = window.PUBLIC_PATH,process.env.PUBLIC_PATH; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
module.exports = { | ||
publicPath: process.env.NODE_ENV === 'production' | ||
? process.env.VUE_APP_PUBLIC_PATH | ||
: '/' | ||
} |
I think. that should not be necessary since Vue should pick up the value from either the environment or a local .env file. This seems to be redundant