Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow manual authorization #227

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ $ pnpm run pm2:start
$ pnpm run pm2:kill
```

Please refer to the [PM2 Documentation](https://pm2.keymetrics.io/docs/usage/quick-start/) for more configuration options and information about PM2.
Please refer to the [PM2 documentation](https://pm2.keymetrics.io/docs/usage/quick-start/) for more configuration options and information about PM2.

## Contributing

Expand Down
5 changes: 2 additions & 3 deletions src/util/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import logger from 'consola';
import { config } from 'dotenv';
import { z } from 'zod';

config();

const BOOLEAN_SCHEMA = z
.string()
.toLowerCase()
Expand All @@ -15,7 +13,7 @@ const SNOWFLAKE_SCHEMA = z.coerce.string().regex(/^\d*$/gm);
const envSchema = z
.object({
MINECRAFT_EMAIL: z.string().email(),
MINECRAFT_PASSWORD: z.string().min(1),
MINECRAFT_PASSWORD: z.string(), // no minimum length allows for manual authorization - dotenv populates an empty string by default
HYPIXEL_API_KEY: z.string().min(1),
MINECRAFT_CHAT_SEPARATOR: z.string().trim().min(1),
USE_PROFANITY_FILTER: BOOLEAN_SCHEMA,
Expand All @@ -40,6 +38,7 @@ const envSchema = z
path: ['REMINDER_MESSAGE'],
});

config();
const env = envSchema.safeParse(process.env);

if (!env.success) {
Expand Down