mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-10 18:29:58 +00:00
5.3.1: tiny fixes
- fixed backdrop on press for "copy url" button in mobile "how to save?" popup - added ability to disable cors via env file
This commit is contained in:
parent
cf6dcfe7a6
commit
307da3dce4
3 changed files with 7 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "cobalt",
|
"name": "cobalt",
|
||||||
"description": "save what you love",
|
"description": "save what you love",
|
||||||
"version": "5.3",
|
"version": "5.3.1",
|
||||||
"author": "wukko",
|
"author": "wukko",
|
||||||
"exports": "./src/cobalt.js",
|
"exports": "./src/cobalt.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"esbuild": "^0.14.51",
|
"esbuild": "^0.14.51",
|
||||||
"express": "^4.17.1",
|
"express": "^4.18.1",
|
||||||
"express-rate-limit": "^6.3.0",
|
"express-rate-limit": "^6.3.0",
|
||||||
"ffmpeg-static": "^5.1.0",
|
"ffmpeg-static": "^5.1.0",
|
||||||
"got": "^12.1.0",
|
"got": "^12.1.0",
|
||||||
|
|
|
@ -26,8 +26,9 @@ const commitHash = shortCommit();
|
||||||
const branch = getCurrentBranch();
|
const branch = getCurrentBranch();
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
const corsConfig = process.env.cors === '0' ? { origin: process.env.selfURL, optionsSuccessStatus: 200 } : {};
|
||||||
|
|
||||||
app.disable('x-powered-by');
|
app.disable('x-powered-by');
|
||||||
app.use('/api/:type', cors())
|
|
||||||
|
|
||||||
if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt && process.env.port) {
|
if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt && process.env.port) {
|
||||||
const apiLimiter = rateLimit({
|
const apiLimiter = rateLimit({
|
||||||
|
@ -55,6 +56,7 @@ if (fs.existsSync('./.env') && process.env.selfURL && process.env.streamSalt &&
|
||||||
|
|
||||||
await buildFront(commitHash, branch);
|
await buildFront(commitHash, branch);
|
||||||
|
|
||||||
|
app.use('/api/:type', cors(corsConfig));
|
||||||
app.use('/api/json', apiLimiter);
|
app.use('/api/json', apiLimiter);
|
||||||
app.use('/api/stream', apiLimiterStream);
|
app.use('/api/stream', apiLimiterStream);
|
||||||
app.use('/api/onDemand', apiLimiter);
|
app.use('/api/onDemand', apiLimiter);
|
||||||
|
|
|
@ -147,9 +147,9 @@ button:active,
|
||||||
background: var(--accent-press);
|
background: var(--accent-press);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.desktop .switch.text-backdrop:hover,
|
.switch.text-backdrop:hover,
|
||||||
.switch.text-backdrop:active,
|
.switch.text-backdrop:active,
|
||||||
.desktop .text-to-copy.text-backdrop:hover,
|
.text-to-copy.text-backdrop:hover,
|
||||||
.text-to-copy.text-backdrop:active {
|
.text-to-copy.text-backdrop:active {
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
color: var(--background);
|
color: var(--background);
|
||||||
|
|
Loading…
Reference in a new issue