mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-28 23:12:32 +03:00
chore(constants&environement): remove textile env constants
This commit is contained in:
parent
2616efce4b
commit
10d0d4eb81
@ -193,7 +193,7 @@ export const theme = {
|
||||
};
|
||||
|
||||
export const gateways = {
|
||||
ipfs: "https://slate.textile.io/ipfs",
|
||||
ipfs: "https://gateway.estuary.tech/gw/ipfs",
|
||||
};
|
||||
|
||||
export const hostname = "https://slate.host";
|
||||
@ -239,12 +239,6 @@ export const grids = {
|
||||
export const profileDefaultPicture =
|
||||
"https://slate.textile.io/ipfs/bafkreick3nscgixwfpq736forz7kzxvvhuej6kszevpsgmcubyhsx2pf7i";
|
||||
|
||||
export const textile = {
|
||||
threadName: "buckets",
|
||||
mainBucket: "data",
|
||||
dealsBucket: "stage-deal",
|
||||
};
|
||||
|
||||
export const extensionLink = {
|
||||
chrome: "https://chrome.google.com/webstore/detail/slate/gloembacbehhbfbkcfjmloikeeaebnoc",
|
||||
firefox: "https://addons.mozilla.org/en-US/firefox/addon/slate-for-firefox",
|
||||
|
@ -24,13 +24,6 @@ export const error = {
|
||||
"We ran into issues while replicating your files for archiving",
|
||||
SERVER_ARCHIVE_DEAL_FAILED: "The storage deal wasn't successful",
|
||||
|
||||
//Bucket remove
|
||||
SERVER_BUCKET_REMOVE_NO_CID:
|
||||
"We ran into issues while removing a file. There was no file specified",
|
||||
SERVER_BUCKET_REMOVE_BUCKET_NOT_FOUND: "We couldn't locate your files to delete",
|
||||
SERVER_BUCKET_REMOVE_NO_BUCKET_ITEMS: "We couldn't locate your files to delete",
|
||||
SERVER_BUCKET_REMOVE_NO_MATCHING_CID: "There were no matching files found",
|
||||
SERVER_BUCKET_REMOVE_FAILED: "We were not able to delete that file",
|
||||
|
||||
//Link create
|
||||
SERVER_CREATE_LINK_DUPLICATE: "You've already saved this link",
|
||||
@ -130,8 +123,6 @@ export const error = {
|
||||
SERVER_CREATE_USER_INVALID_USERNAME: "Please choose a valid username",
|
||||
SERVER_CREATE_USER_INVALID_PASSWORD: "Please choose a valid password",
|
||||
SERVER_CREATE_USER_INVALID_EMAIL: "Please choose a valid email",
|
||||
SERVER_CREATE_USER_BUCKET_INIT_FAILURE:
|
||||
"We're having trouble setting up your storage, please try again later",
|
||||
SERVER_CREATE_USER_FAILED:
|
||||
"We're having trouble creating your account right now. Please try again later",
|
||||
|
||||
@ -210,7 +201,7 @@ export const error = {
|
||||
//Get deals
|
||||
SERVER_FILECOIN_NETWORK_DEALS_ERROR:
|
||||
"We're having trouble fetching your deal information right now",
|
||||
SERVER_FILECOIN_NETWORK_ERROR: "We're having trouble fetching your storage information right now",
|
||||
// SERVER_FILECOIN_NETWORK_ERROR: "We're having trouble fetching your storage information right now",
|
||||
|
||||
//Sign in
|
||||
SIGN_UP_RATE_LIMITED: "Too many signup attempts. Please try again in 10 minutes",
|
||||
|
@ -1,25 +1,11 @@
|
||||
export const POLLING_RATE = 5000;
|
||||
export const MAX_BUCKET_COUNT = 100;
|
||||
export const POWERGATE_HOST = "https://grpcweb.slate.textile.io";
|
||||
export const IPFS_GATEWAY_URL = "https://slate.textile.io/ipfs";
|
||||
export const FILE_STORAGE_URL = "./public/static/files/";
|
||||
export const GITHUB_URL = "https://github.com/filecoin-project/slate";
|
||||
export const ANALYTICS_URL = "https://slate-stats-dev.azurewebsites.net/";
|
||||
|
||||
// NOTE(toast): 30 GB from jim/martina/ignacio
|
||||
export const TEXTILE_ACCOUNT_BYTE_LIMIT = 1073741824 * 30;
|
||||
|
||||
// NOTE(jim): 30 GB - minus .textileseed
|
||||
export const TEXTILE_BUCKET_LIMIT = TEXTILE_ACCOUNT_BYTE_LIMIT - 234;
|
||||
|
||||
// NOTE(jim): 100mb
|
||||
export const MIN_ARCHIVE_SIZE_BYTES = 104857600;
|
||||
export const ACCOUNT_BYTE_LIMIT = 1073741824 * 30;
|
||||
|
||||
// NOTE(amine): 15 minutes
|
||||
export const TOKEN_EXPIRATION_TIME = 2 * 60 * 60 * 1000;
|
||||
|
||||
export const textile = {
|
||||
threadName: "buckets",
|
||||
mainBucket: "data",
|
||||
dealsBucket: "stage-deal",
|
||||
};
|
||||
|
@ -25,15 +25,9 @@ export const LOCAL_PASSWORD_SECRET = `$2b$${LOCAL_PASSWORD_ROUNDS}$${process.env
|
||||
// NOTE(jim): Custom avatars
|
||||
export const AVATAR_SLATE_ID = process.env.AVATAR_SLATE_ID;
|
||||
|
||||
// NOTE(jim): Textile secrets
|
||||
export const TEXTILE_HUB_KEY = process.env.TEXTILE_HUB_KEY;
|
||||
export const TEXTILE_HUB_SECRET = process.env.TEXTILE_HUB_SECRET;
|
||||
export const TEXTILE_HUB_STAGING_HOST = process.env.TEXTILE_HUB_STAGING_HOST;
|
||||
|
||||
// NOTE(jim): Slack updates
|
||||
export const SOCIAL_SLACK_WEBHOOK_KEY = process.env.SOCIAL_SLACK_WEBHOOK_KEY;
|
||||
export const SUPPORT_SLACK_WEBHOOK_KEY = process.env.SUPPORT_SLACK_WEBHOOK_KEY;
|
||||
export const TEXTILE_SLACK_WEBHOOK_KEY = process.env.TEXTILE_SLACK_WEBHOOK_KEY;
|
||||
|
||||
// NOTE(jim): External servers
|
||||
export const URI_SHOVEL = process.env.NEXT_PUBLIC_URI_SHOVEL;
|
||||
|
@ -215,7 +215,7 @@ export const getById = async ({ id }) => {
|
||||
...user,
|
||||
stats: {
|
||||
bytes,
|
||||
maximumBytes: Constants.TEXTILE_ACCOUNT_BYTE_LIMIT,
|
||||
maximumBytes: Constants.ACCOUNT_BYTE_LIMIT,
|
||||
imageBytes,
|
||||
videoBytes,
|
||||
audioBytes,
|
||||
|
@ -8,10 +8,6 @@ import { IncomingWebhook } from "@slack/webhook";
|
||||
const url = `https://hooks.slack.com/services/${Environment.SOCIAL_SLACK_WEBHOOK_KEY}`;
|
||||
const webhook = new IncomingWebhook(url);
|
||||
|
||||
// NOTE(jim): #fil-slate-textile-api
|
||||
const textileURL = `https://hooks.slack.com/services/${Environment.TEXTILE_SLACK_WEBHOOK_KEY}`;
|
||||
const textileWebhook = new IncomingWebhook(textileURL);
|
||||
|
||||
export const sendSlackMessage = (message) => {
|
||||
if (Strings.isEmpty(Environment.SOCIAL_SLACK_WEBHOOK_KEY)) {
|
||||
return;
|
||||
@ -23,29 +19,3 @@ export const sendSlackMessage = (message) => {
|
||||
Logging.error("SLACK_MESSAGE_FAILURE", message);
|
||||
}
|
||||
};
|
||||
|
||||
export const sendTextileSlackMessage = ({
|
||||
user = { username: "UNDEFINED" },
|
||||
message,
|
||||
functionName,
|
||||
code,
|
||||
file,
|
||||
}) => {
|
||||
if (Strings.isEmpty(Environment.TEXTILE_SLACK_WEBHOOK_KEY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const userProfileURL = `https://slate.host/${user.username}`;
|
||||
const userURL = `<${userProfileURL}|${user.username}>`;
|
||||
const source = `${Environment.SOURCE}`;
|
||||
const fileURL = `https://github.com/filecoin-project/slate/blob/main/${file}`;
|
||||
const slackFileURL = `<${fileURL}|${file}>`;
|
||||
|
||||
try {
|
||||
textileWebhook.send({
|
||||
text: `*Source code —* ${slackFileURL} \n*Source client —* ${source} \n*Callsite —* \`${functionName}\`\n*User —* ${userURL}\n\n> ${message}\n\n*Textile error code —* ${code}`,
|
||||
});
|
||||
} catch (e) {
|
||||
Logging.error("SLACK_MESSAGE_FAILURE", message);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user