Prepared for Garden
This commit is contained in:
parent
96ebe71cb6
commit
4bfe7bebc2
9 changed files with 45 additions and 67 deletions
|
@ -33,7 +33,7 @@ class Stash extends React.Component {
|
|||
.catch((error) => {
|
||||
if (error.response && error.response.status === 401)
|
||||
return window.location.replace(
|
||||
`${process.env.REACT_APP_CAIRO_PUBLIC_URL}${api.cairo.urls.login}?redirectUri=${window.location.href}`
|
||||
`${process.env.REACT_APP_CAIRO_URL}/authenticate?redirectUri=${window.location.href}`
|
||||
);
|
||||
console.error("Auth server not up/configured properly!");
|
||||
});
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
"api": {
|
||||
"cairo": {
|
||||
"urls": {
|
||||
"verify": "/cairo/api/user/data",
|
||||
"login": "/cairo/login"
|
||||
"verify": "api/cairo/user/info",
|
||||
"login": "cairo/login"
|
||||
}
|
||||
},
|
||||
"nubian": {
|
||||
"urls": {
|
||||
"files": "/nubian/api/stash/files",
|
||||
"upload": "/nubian/api/stash/upload",
|
||||
"download": "/nubian/api/stash/download",
|
||||
"delete": "/nubian/api/stash/delete",
|
||||
"public": "/nubian/api/stash/public"
|
||||
"files": "api/nubian/stash/files",
|
||||
"upload": "api/nubian/stash/upload",
|
||||
"download": "api/nubian/stash/download",
|
||||
"delete": "api/nubian/stash/delete",
|
||||
"public": "api/nubian/stash/public"
|
||||
},
|
||||
"misc": {
|
||||
"uploadField": "user-selected-file"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const { createProxyMiddleware } = require("http-proxy-middleware");
|
||||
const cairoUrl = process.env.REACT_APP_CAIRO_PUBLIC_URL;
|
||||
const nubianUrl = process.env.NUBIAN_INTERNAL_URL;
|
||||
const cairoUrl = process.env.CAIRO_PROXY_URL ?? "http://localhost:52002";
|
||||
const nubianUrl = process.env.NUBIAN_PROXY_URL ?? "http://localhost:52002";
|
||||
module.exports = (app) => {
|
||||
// Cairo Proxy
|
||||
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
||||
app.use("/nubian", createProxyMiddleware({ target: nubianUrl }));
|
||||
app.use("/api/cairo", createProxyMiddleware({ target: cairoUrl }));
|
||||
app.use("/api/nubian", createProxyMiddleware({ target: nubianUrl }));
|
||||
};
|
||||
|
|
|
@ -101,7 +101,9 @@ export default class StashContextMenu extends React.Component {
|
|||
const selectedBoxes = this.props.getSelectedBoxes();
|
||||
if (selectedBoxes.length !== 1)
|
||||
return toast.error("Only one file can be selected!");
|
||||
const url = `${window.location.origin}${process.env.PUBLIC_URL}${downloadUrl}?target=${selectedBoxes[0]}`;
|
||||
if (window.location.protocol !== "https:")
|
||||
return toast.error("Cannot clipboard without https!");
|
||||
const url = `${window.location.origin}/${downloadUrl}?target=${selectedBoxes[0]}`;
|
||||
navigator.clipboard.writeText(url);
|
||||
toast.success("Link successfully copied!");
|
||||
}
|
||||
|
|
Reference in a new issue