# Bookstack

Self hosted Wiki

# Recover admin login

Fucked up with your login? Can't get your password/username working?

First, you will need to find out where your "artisan" file is. Weather its installed locally or in a docker container or anywhere else, find where its installed then, look for the file. Could be in /app/www area. So try there first.

Once you find it, get into the root folder that the artisan file is located. In my cases, its in /app/www. Then run:

```bash
php artisan bookstack:create-admin --email="you@idiot.com" --name="shit4brains" --password="yournewpassword"
```

Output should be something like:  
<span style="color:rgb(22,145,121);">Admin account with email "you@idiot.com" successfully created!</span>

You should now have access to your bookstack again.

Now, don't do that again.

# Using Email

In the root folder, look for the .env file. I found mine here

`/directory/bookstack/config/www/.env`

Edit that file and change the email server info to match your credentials.

```bash
# Mail system to use
# Can be 'smtp' or 'sendmail'
MAIL_DRIVER=smtp

# Mail sender details
MAIL_FROM_NAME="BookStack"
MAIL_FROM=bookstack@danicus.net

# SMTP mail options
# These settings can be checked using the "Send a Test Email"
# feature found in the "Settings > Maintenance" area of the system.
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=bookstack@danicus.net
MAIL_PASSWORD=apassward #Google requires a token for this to work
MAIL_ENCRYPTION=null
```

Google users will need to get a auth code (2 step auth code/token) in order for the password to work.