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

v1.0.0.rc3 #22

Merged
merged 4 commits into from
Jan 11, 2025
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ docker compose -p wapydev-dev -f docker-compose-dev.yml up -d

`SUBSCRIPTION_JWT_SECRET`: The secret key for the subscription signing. When you run the `setup.sh` script, it will generate a random secret for you.

### Building Docker Image

If you want to build the Docker image locally, you can run the following command:

```
docker build -t wapy.dev -f Dockerfile .
```

Don't forget to update the `docker-compose.yml` file to use the local image.

### Database Backup and Restore

You can backup the database by running the `backup.sh` script.
Expand Down
4 changes: 2 additions & 2 deletions src/components/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ export const siteConfig = {
name: 'Wapy.dev',
description: 'Subscription and Expense Tracker',
keywords: 'subscription, expense, tracker, wapy, meceware',
url: process.env.SITE_URL,
url: process.env.SITE_URL || 'http://localhost:3000',
links: {
github: 'https://github.com/meceware/wapy.dev',
},
author: {
name: 'meceware',
url: 'https://www.meceware.com/',
},
from: 'Wapy.dev - Subscription Manager',
from: 'Wapy.dev Subscription Manager',
subscriptionReminderFrom: `Wapy.dev Subscription Reminder <${process.env.RESEND_FROM}>`,
};
10 changes: 5 additions & 5 deletions src/lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { PrismaAdapter } from '@auth/prisma-adapter';
import { prisma } from '@/lib/prisma';
import { siteConfig } from '@/components/config';

const authURL = new URL(`${process.env.SITE_URL}/api/auth`);
const cookiePrefix = authURL.protocol === 'https:' ? '__Secure-' : '';
const authDomain = authURL.hostname === 'localhost' ? authURL.hostname : `.${authURL.hostname.split('.').slice(-2).join('.')}`;
const authURL = new URL(`${siteConfig.url}/api/auth`);
const cookiePrefix = authURL?.protocol === 'https:' ? '__Secure-' : '';
const authDomain = authURL?.hostname ? (authURL.hostname === 'localhost' ? authURL.hostname : `.${authURL.hostname.split('.').slice(-2).join('.')}`) : '';

const html = ({ url, token }) => {
return `
Expand Down Expand Up @@ -111,10 +111,10 @@ const authConfig = {
html: html({ url, token: otp }),
text: text({ url, token: otp }),
}),
})
});

if (!res.ok)
throw new Error('Resend error: ' + JSON.stringify(await res.json()))
throw new Error('Resend error: ' + JSON.stringify(await res.json()));
},
}),
],
Expand Down
Loading