-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
169 lines (129 loc) · 5.02 KB
/
config.js
File metadata and controls
169 lines (129 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// The environment the site is running in
export const environment = process.env.REACT_APP_NODE_ENV || "development";
// Is the site running in production?
export const isProd = environment === "production";
// Is the site running in a pull request?
export const isPr = process.env.REACT_APP_IS_PULL_REQUEST === "true";
// Is the site running on Render?
export const isRender = process.env.REACT_APP_RENDER === "true";
// Stripe products, manually generated
export const products = !isProd
? ["prod_O1IwO8cwxTjNGp", "prod_OMyHdTn6MkfMGr"]
: ["prod_O98lNwyT3aRI9u", "prod_OMyEM1HJ6vRmUf"];
// The git commit of the running site
export const release = process.env.REACT_APP_RENDER_GIT_COMMIT || "development";
// Server port
export const port = Number(process.env.REACT_APP_PORT) || 3000;
// IP address to listen on
export const bindAddress = isRender ? "0.0.0.0" : "127.0.0.1";
// Hostname on Render
const renderHostname = isPr
? process.env.REACT_APP_RENDER_EXTERNAL_HOSTNAME
: process.env.REACT_APP_HOSTNAME;
// Website hostname + port
export const host = isRender ? renderHostname : `localhost:${port}`;
export const ipfsGateway = process.env.REACT_APP_IPFSGATEWAY;
export const blockExplorer = isProd
? "https://polygonscan.com"
: "https://mumbai.polygonscan.com";
export const ipfsViewer = "https://ipfs.io/ipfs/";
// Website protocol
export const protocol = isRender ? "https" : "http";
// Website origin (scheme + hostname + port)
export const origin = `${protocol}://${host}`;
const wsProtocol = isRender ? "wss" : "ws";
// Websocket origin (scheme + hostname + port)
export const wsOrigin = `${wsProtocol}://${host}`;
// Websocket URL
export const wsUrl = `${wsOrigin}/websocket`;
// Title of the site
export const siteTitle = "Ambr";
export const tagline = "Share ideas worth protecting.";
// Description of the site
export const siteDescription =
"Ambr stands as the only file transfer that puts you, the creator, in control of the work you're sharing. Every shared file through Ambr is equipped with a tamper-proof, time-stamped digital fingerprint of the work, along with who you shared it with, securely tied to you. Ambr strengthens your undeniable claim to creative ownership and entitlement to your work's value.";
// Twitter username of the site
export const socialHandle = "ambrlink";
export const siteTwitterUrl = `https://twitter.com/${socialHandle}`;
// Discord invite link for the site
export const siteDiscord = "https://discord.gg/VuPEbumVWg";
// Site logo
export const siteLogo = `${origin}/images/logo-80x80.png`;
// Default image to represent site on social networks
export const siteSocialImage = `/images/social-share-home.png`; //${origin}
// Root path of project
export const rootPath = process.cwd();
/* // Maximum room size displayed to user
export const maxRoomSizeGb = 10;
// Maximum cloud room size displayed to user
export const maxRoomCloudSizeGb = 5;
// Maximum room size in bytes
export const maxRoomSize = maxRoomSizeGb * 1e9;
// Maximum room size in bytes for cloud upload
export const maxRoomCloudSize = maxRoomCloudSizeGb * 1e9 * 1.1; */
// Maximum room size displayed to user
export const maxRoomSizeMb = 100;
// Maximum cloud room size displayed to user
export const maxRoomCloudSizeMb = 100;
// Maximum room size in bytes
export const maxRoomSize = maxRoomSizeMb * 1e6;
// Maximum room size in bytes for cloud upload
export const maxRoomCloudSize = maxRoomCloudSizeMb * 1e6;
// Room lifetime by default
export const defaultRoomLifetimeSeconds = 72 * 3600; // One day
export const defaultRoomLifetimeMs = 259200000; // One day
// Maximum downloads per room by default
export const defaultMaxRoomDownloads = 100;
// Values for lifetime (72 hours), but could add others into array if valuble to users
// e.g. for security, only allow download window of 1 hour.
export const roomLifetimeValues = [72].map((h) => h * 3600);
// Values for max downloads
export const maxRoomDownloadsValues = [1, 5, 10, 20, 50, 100];
// Time between each uploader ping
export const uploaderPingIntervalSeconds = 30;
// WebRTC configuration
export const rtcConfig = {
iceServers: [
{
urls: ["stun:relay.ambr.app:443"],
},
{
urls: [
"turn:relay.ambr.app:443?transport=udp",
"turn:relay.ambr.app:443?transport=tcp",
"turns:relay.ambr.app:443?transport=tcp",
],
username: "relay.ambr.app",
credential: "tears-whiplash-overall-diction",
},
],
sdpSemantics: "unified-plan",
bundlePolicy: "max-bundle",
iceCandidatePoolsize: 1,
};
// Backblaze B2 bucket information
let b2Config;
if (isRender) {
if (isProd) {
// The service name is a unique slug per PR
b2Config = {
bucketName: "ambr-prod",
bucketId: "4a5eff4831157c208f270d1b",
pathPrefix: null,
};
} else {
b2Config = {
bucketName: "ambr-dev",
bucketId: "aa3eff1811a5ec608f070d1b",
pathPrefix: null,
};
}
} else {
// dev/ci environments
b2Config = {
bucketName: "ambr-dev",
bucketId: "aa3eff1811a5ec608f070d1b",
pathPrefix: null,
};
}
export { b2Config };