OpenDAoC Account Manager allows you to link your OpenDAoC account to your Discord for easy password recovery.
To set up the OpenDAoC Account Manager, copy .env.example
to .env
and adjust the options:
-
General Settings:
SERVER_NAME
: Name of your server (e.g., "OpenDAoC").SITE_TITLE
: Title of your site.SITE_DESCRIPTION
: Description of your site.SITE_FOOTER
: Footer of your site.LOGO_PATH
: Path to your logo file (relative to the public directory).
-
Theme Settings:
THEME_FOREGROUND
: Foreground color in RGB format.THEME_BACKGROUND_LIGHT
: Light background color in RGB format for the top of the gradient.THEME_BACKGROUND_DARK
: Dark background color in RGB format for the bottom of the gradient.
-
Toast Notifications Settings:
TOAST_DURATION
: Duration of the toast notification in seconds.
-
Database Settings:
DATABASE_HOST
: Database host.DATABASE_USER
: Database user.DATABASE_PASSWORD
: Database password.DATABASE_NAME
: Database name.
-
Password Settings:
MIN_PASSWORD_LENGTH
: Minimum password length.MAX_PASSWORD_LENGTH
: Maximum password length.
-
Discord Settings:
DISCORD_CLIENT_ID
: Discord client ID.DISCORD_CLIENT_SECRET
: Discord client secret.
-
Next Auth Settings
NEXTAUTH_SECRET
: Used for encryption. Ensure it's random. Generated withopenssl rand -hex 16
NEXTAUTH_URL
: : URL of your site (e.g., "https://account.opendaoc.com").
Make sure to replace the example values with your actual configurations.
Apart from the obvious like Node.js and access to the server database, you will need to create a Discord application and enable the OAuth2 API.
- Go to the Discord Developer Portal and create a new application.
- Go to the OAuth2 tab and add a redirect URL. This should be the URL of your site with
/api/auth/callback/discord
appended to it (e.g.,https://account.opendaoc.com/api/auth/callback/discord
). - In the OAuth2 tab, copy the
client ID
andclient secret
and add them to your.env
file.
- Clone the repository or download the latest release
- Install dependencies with
npm install
oryarn install
orpnpm install
- Copy
.env.example
to.env.local
and adjust the values - Run the development server with
npm run dev
oryarn dev
orpnpm dev
Open http://localhost:3000
with your browser to see the result.
A Docker image is available at on the GitHub Registry and can be pulled with:
docker pull ghcr.io/opendaoc/opendaoc-accountmanager:latest
Alternatively, can build the image yourself with the provided Dockerfile
.
An example docker-compose.yml
is available in the repository.
Remember to reverse proxy the container with a web server like Nginx or Caddy.
To inject env vars to Next.js applications we need to replace them using the entrypoint.sh
script.
If your not using the provided docker-compose.yml
, make sure to set the environment variables.
For more details on Next.js, the framework used in this project:
Next.js Documentation - learn about Next.js features and API.
Learn Next.js - an interactive Next.js tutorial.