Accounts.json will now be saved in the accounts directory

This commit is contained in:
Jannover5000r 2025-11-14 08:44:40 +01:00
parent c29389e8f2
commit 74297067d8
3 changed files with 3 additions and 3 deletions

2
.gitignore vendored
View file

@ -6,7 +6,7 @@ teachers.json
login.json
timetable*.json
timetableFilled*.json
accounts.json
accounts/
login_*.json
AGENTS.md
untislogger

View file

@ -39,7 +39,7 @@ type UserState struct {
var (
userStates = make(map[string]*UserState) // userID -> state
stateMutex sync.Mutex // protect userStates
accountsFile = "accounts.json"
accountsFile = "accounts/accounts.json"
)
var encryptionKey []byte

View file

@ -21,7 +21,7 @@
# This is a discord application intended for self hosting. You will need to add an application in the [disord developer website](https://discord.com/developers/applications) for this bot mainly with the read messages and write messages privelege as well as send privat messages for the account handling. If you give it administrator permissions you dont have to worry further but this could present you with a security risk if my github account gets compromised and a malicious update to the script gets pushed which you than use since the bot got access to your whole server
# I also recommend to use a tool like [coolify](https://coolify.io/) to host the bot. Make sure to add the Env's and add **accounts.json** to persistant storage
# I also recommend to use a tool like [coolify](https://coolify.io/) to host the bot. Make sure to add the Env's and add the **accounts/** folder to persistent storage
### This bot is self hosted and will run correctly when doing "go run . " in the root folder of the project. **Before usage add the .env file with the Credentials as mentioned above.** When you run the Program for the first time, all important files will be created automatically and the bot is ready to go. The user added via the fields UNTIS_USER and UNTIS_PASSWORD in the .env will be the one where the Webhook is sourced from and the other users will be send a DM after adding their account with the command. Add the Discord Webhook via the DISCORD_WEBHOOK_URL point in the .env and will send the messages for the timetable in there