Comments (5)
Since this codebase is being used by beginners, I think we can create a script to help users fill in the .env
from discord-js-bot.
How about we use uuid for that?
from discord-js-bot.
Something like this would be sufficient i think
const { v4 } = require('uuid')
app.use(
session({
secret: v4(),
cookie: { maxAge: 336 * 60 * 60 * 1000 },
...// other options
)
from discord-js-bot.
i dont think we need to introduce a whole dependency for this, just use node:crypto
,
import { randomBytes } from "node:crypto";
session({
secret: process.env.SESSION_PASSWORD ?? randomBytes(32).toString("hex"),
...
});
downside to this and the uuid approach is that upon reboot, the session secret will be different, thus invalidating all existing sessions. Prefilling the .env
works fine for all non-docker users.
alternatively, we can just update the readme to include instructions on how to generate a random secret, such as running head /dev/urandom | tr -dc A-Za-z0-9 | head -c32
or link some website.
from discord-js-bot.
But won’t generating a random one and not the value be a problem?
I believe the session won’t be persisted after restart
from discord-js-bot.
Related Issues (20)
- Recording command! HOT 1
- Flip text takes incorrect input
- Meme Command Not Working!
- Thumbnail does not provided to embed HOT 4
- Duplicated welcome messages HOT 1
- Token Error HOT 2
- Lavalink Problem HOT 3
- Bot invite command HOT 1
- meme command HOT 1
- Embed command (/embed) HOT 3
- Only using dashboard set welcome message or can able to ping the user
- Embed/ticket custom emoji
- Make it so that when someone opens a ticket via the cat it creates the ticket in specific catagorie HOT 1
- song cmd HOT 1
- issues HOT 1
- adding a homepage
- Changes in tickets system
- Bot not workinh HOT 1
- Dashboard not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-js-bot.