adding info about basic auth
This commit is contained in:
parent
ebf1d675f1
commit
e08e8f6f93
@ -23,9 +23,9 @@ Structure:
|
|||||||
|
|
||||||
3) Edit .env
|
3) Edit .env
|
||||||
```
|
```
|
||||||
TOKEN = token
|
TOKEN = (Discord Token)
|
||||||
INTERNAL_IP =
|
INTERNAL_IP = (The Internal IP Address of the Server running Serge)
|
||||||
PUBLIC_URL =
|
PUBLIC_URL = (The public URL of your Serge install)
|
||||||
```
|
```
|
||||||
|
|
||||||
4) Go to Handler -- > index.js and change "GUIDIDHERE" to your Discord Server's Guild ID
|
4) Go to Handler -- > index.js and change "GUIDIDHERE" to your Discord Server's Guild ID
|
||||||
|
@ -6,6 +6,9 @@ const readFile = util.promisify(jsonfile.readFile);
|
|||||||
let sessionID;
|
let sessionID;
|
||||||
let isProcessing = false; // Semaphore variable
|
let isProcessing = false; // Semaphore variable
|
||||||
|
|
||||||
|
// TODO: Chose an http client and stick with it.
|
||||||
|
// Axios Vs Unirest - TBD
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'chat',
|
name: 'chat',
|
||||||
description: 'Chat with Alpaca using rAI',
|
description: 'Chat with Alpaca using rAI',
|
||||||
|
@ -9,6 +9,9 @@ module.exports = {
|
|||||||
run: async (client, interaction) => {
|
run: async (client, interaction) => {
|
||||||
const file = './cache/' + interaction.user.id
|
const file = './cache/' + interaction.user.id
|
||||||
|
|
||||||
|
// The Auth stuff here is internal to my set up only and may be removed if you use this bot.
|
||||||
|
// My chat GUI for Serge is locked down by basic auth in apache to safe guard from
|
||||||
|
// Users issuing mulitple jobs at a time until there is some built in way to do so.
|
||||||
unirest
|
unirest
|
||||||
.post(`https://${process.env.PUBLIC_URL}/api/chat`)
|
.post(`https://${process.env.PUBLIC_URL}/api/chat`)
|
||||||
.headers({ 'Accept': 'application/json', 'Content-Type': 'application/json' })
|
.headers({ 'Accept': 'application/json', 'Content-Type': 'application/json' })
|
||||||
|
@ -30,6 +30,10 @@ module.exports = {
|
|||||||
'authority': process.env.PUBLIC_URL,
|
'authority': process.env.PUBLIC_URL,
|
||||||
'accept': 'text/event-stream',
|
'accept': 'text/event-stream',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The Auth stuff here is internal to my set up only and may be removed if you use this bot.
|
||||||
|
// My chat GUI for Serge is locked down by basic auth in apache to safe guard from
|
||||||
|
// Users issuing mulitple jobs at a time until there is some built in way to do so.
|
||||||
const response = await axios.get(`http://${process.env.INTERNAL_IP}:8008/api/chat/${sessionID}`, {
|
const response = await axios.get(`http://${process.env.INTERNAL_IP}:8008/api/chat/${sessionID}`, {
|
||||||
headers,
|
headers,
|
||||||
auth: {
|
auth: {
|
||||||
|
Loading…
Reference in New Issue
Block a user