Setup deployment for Khufu

This commit is contained in:
Dunemask 2021-08-06 19:56:59 -06:00
parent 5d35d66713
commit 9bed3908d3
10 changed files with 101 additions and 39 deletions

View file

@ -6,7 +6,7 @@ import "react-toastify/dist/ReactToastify.css";
import Stash from "./Stash";
//Constants
const token =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1dWlkIjoiYmVjYWNjNjdhNmRjLTBlN2QtMDBlNi1jYmVhLWVhZGNlYmUxIiwiaWF0IjoxNjI3MTcxMDU1LCJleHAiOjE2Mjk3NjMwNTV9.zqiHrYnJlB7ozwjMnpgVUsBAt9vfLHLICFgWB0MguLA";
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxMDhiMjI1ODBmYWEwMDAxMzQwZDdjMiIsImVtYWlsIjoiZHVuZXFhK3VzZXJAZ21haWwuY29tIiwiaXAiOiI6OmZmZmY6MTkyLjE2OC4yMjQuMSIsImlhdCI6MTYyNzk1OTg0NSwiZXhwIjoxNjMwNTUxODQ1fQ.mGybyFVxGzQ0cSIU4oE-RQpkQM45kIGHVFNAQmwsvvk";
localStorage.setItem("authToken", token);
class App extends React.Component {
render() {

View file

@ -6,10 +6,10 @@ import { toast } from "react-toastify";
import Stashbar from "./stash/Stashbar";
import StashUpload from "./stash/StashUpload";
import StashContextMenu from "./stash/StashContextMenu";
import { serverUrls, serverAddress } from "./stash/api.json";
import { serverUrls} from "./stash/api.json";
import "./stash/scss/Stash.scss";
//Constants
const filesUrl = `${serverAddress}/${serverUrls.GET.filesUrl}`;
const filesUrl = `${serverUrls.GET.filesUrl}`;
//Class
const getConfig = () => ({
headers: {

23
src/setupProxy.js Normal file
View file

@ -0,0 +1,23 @@
const { createProxyMiddleware } = require("http-proxy-middleware");
const cairoUrl =
process.env.CAIRO_URL || "http://cairo.dunestorm.net:52000";
const nubianUrl =
process.env.NUBIAN_URL || "http://nubian.dunestorm.net:52001";
module.exports = (app) => {
// Cairo Proxy
app.use(
"/api/cairo",
createProxyMiddleware({
target: cairoUrl,
// logLevel: "silent",
})
);
// Nubian Proxy
app.use(
"/api/nubian",
createProxyMiddleware({
target: nubianUrl,
// logLevel: "silent",
})
);
};

View file

@ -12,11 +12,11 @@ import {
} from "@fortawesome/free-solid-svg-icons";
//Local Imports
import "./scss/stash/StashContextMenu.scss";
import { serverUrls, serverAddress } from "./api.json";
import { serverUrls } from "./api.json";
//Constants
const downloadUrl = `${serverAddress}/${serverUrls.POST.downloadUrl}`;
const deleteUrl = `${serverAddress}/${serverUrls.POST.deleteUrl}`;
const publicUrl = `${serverAddress}/${serverUrls.POST.publicUrl}`;
const downloadUrl = `${serverUrls.POST.downloadUrl}`;
const deleteUrl = `${serverUrls.POST.deleteUrl}`;
const publicUrl = `${serverUrls.POST.publicUrl}`;
function getConfig() {
var authToken = localStorage.getItem("authToken");

View file

@ -6,8 +6,8 @@ import { toast } from "react-toastify";
import StashDropzone from "./StashDropzone";
import StashUploadDialog from "./uploader/StashUploadDialog";
//Constants
import { serverUrls, serverFields, serverAddress } from "./api.json";
const uploadUrl = `${serverAddress}/${serverUrls.POST.uploadUrl}`;
import { serverUrls, serverFields } from "./api.json";
const uploadUrl = `${serverUrls.POST.uploadUrl}`;
const uploadField = serverFields.uploadField;
const cancelMessage = "User Canceled";
const successClearTime = 200;

View file

@ -1,16 +1,14 @@
{
"serverAddress": "http://nubian.dunestorm.net:52001",
"serverUrls": {
"POST": {
"uploadUrl": "api/stash/upload",
"downloadUrl": "api/stash/download",
"deleteUrl": "api/stash/delete",
"publicUrl": "api/stash/public"
"uploadUrl": "/api/nubian/stash/upload",
"downloadUrl": "/api/nubian/stash/download",
"deleteUrl": "/api/nubian/stash/delete",
"publicUrl": "/api/nubian/stash/public"
},
"GET": {
"filesUrl": "api/stash/files",
"rawUrl": "api/stash/raw",
"avatar": "api/user/avatar"
"filesUrl": "/api/nubian/stash/files",
"rawUrl": "/api/nubian/stash/raw"
}
},
"serverFields": {