Update README.md with updated setup instructions

This commit is contained in:
Christopher Cookman 2025-02-11 08:49:28 -07:00
parent 09b4eeabd6
commit a4f4b17198
2 changed files with 28 additions and 58 deletions

View file

@ -5,7 +5,6 @@ FREEPBX_CLIENT_SECRET=your_freepbx_client_secret
DB_HOST=your_db_host DB_HOST=your_db_host
DB_USER=your_db_user DB_USER=your_db_user
DB_PASS=your_db_password DB_PASS=your_db_password
DB_NAME=your_db_name
DISCORD_TOKEN=your_discord_token DISCORD_TOKEN=your_discord_token
OWNER_ID=your_owner_id OWNER_ID=your_owner_id
EXTENSION_ROLE_ID=your_extension_role_id EXTENSION_ROLE_ID=your_extension_role_id

View file

@ -33,63 +33,34 @@ To set up the config file, follow the steps below:
npm install --save npm install --save
``` ```
3. Create a new file named `config.json` in the root directory of the project and fill it with the following content: 3. Copy `.env.example` to `.env`
```json
{ 4. Configure the `.env` file with the following options:
"ntfyUrl": "ntfy-url",
"freepbx": { PBX_HOSTNAME: This is the hostname or IP address of your PBX (Private Branch Exchange) server. It is used to connect to the PBX system. This value is whats sent to the end users via the bot. Can be whatever and won't affect the functionality of the bot.
"server": "sip-server-ip",
"url": "pbx-api-url", FREEPBX_URL: Base URL for the API of your PBX. i.e. `https://pbx.example.com`
"clientid": "gql-client-id",
"allowedscopes": "gql", FREEPBX_CLIENT_ID: This is the client ID used for authenticating with the FreePBX API. It is part of the OAuth2 authentication process.
"secret": "gql-secret",
"startExt": 1000 FREEPBX_CLIENT_SECRET: This is the client secret used along with the client ID for authenticating with the FreePBX API.
},
"discord": { DB_HOST: This is the hostname or IP address of your database server. It is used to connect to the database. If running on your PBX, set to `127.0.0.1`
"token": "bot-token",
"guildId": "guild-id", DB_USER: This is the username used to authenticate with the database.
"roleId": "user-role",
"logId": "log-channel", DB_PASS: This is the password used to authenticate with the database.
"extList": "extension-list-channel",
"developers": [ DISCORD_TOKEN: This is the token for your Discord bot. It is used to authenticate the bot with the Discord API.
"your-user-id"
] OWNER_ID: This is the Discord user ID of the bot owner. It can be used to grant special permissions or access to the bot owner.
},
"mariadb": { EXTENSION_ROLE_ID: Discord role ID of the role to give PBX users when they make their extension.
"host": "db-hostname0here",
"user": "bot", DISCORD_GUILD: This is the Discord server (guild) ID where the bot will operate. This is used to determine if extensions are orphaned, so make sure it's set correctly.
"password": "bot",
"database": "asterisk", These environment variables are used to configure your application and provide necessary credentials and settings for connecting to various services. Make sure to keep this information secure and do not share it publicly.
"connectionLimit": 5
},
"cdrdb": {
"host": "db-hostname-here",
"user": "bot",
"password": "bot",
"database": "asteriskcdrdb",
"connectionLimit": 5
},
"status": {
"interval": 60,
"url": "uptime-kuma-link"
}
}
```
4. Replace the placeholders with your own values:
- `ntfyUrl`: The URL of the NTFY server.
- `sip-server-ip`: The IP address of the SIP server.
- `pbx-api-url`: The URL of the FreePBX API.
- `gql-client-id`: The client ID for the GraphQL API.
- `gql-secret`: The secret for the GraphQL API.
- `bot-token`: The token of the Discord bot.
- `guild-id`: The ID of the Discord guild.
- `user-role`: The ID of the role that users must have to use the bot.
- `log-channel`: The ID of the channel where logs will be sent.
- `extension-list-channel`: The ID of the channel where the extension list will be sent.
- `your-user-id`: Your Discord user ID.
- `db-hostname-here`: The hostname of the MariaDB server.
- Use `mysql -u root -p -e "CREATE USER 'bot'@'localhost' IDENTIFIED BY 'bot';"` to create a new user. Change `localhost` to the IP of the server running the bot if you aren't running the bot on the PBX server.
- `uptime-kuma-link`: The URL of the Uptime Kuma instance.
5. Run the bot: 5. Run the bot:
```shell ```shell
node . node .