Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Hargrave authored and Andrew Hargrave committed Feb 20, 2020
2 parents 83cd922 + 4f0b155 commit 44dfcff
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 30 deletions.
37 changes: 12 additions & 25 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ APP_ENV=local
APP_KEY=base64:Ul3UJpD9XUMg+zJbMwCKBDZdIEURPg2d014JJz1GaSg=
APP_DEBUG=true
APP_URL=http://keyshare.local
APP_DEMO_MODE=false

AUTO_APPROVE_USERS=1
STEAM_LOGIN=0

LOG_CHANNEL=stack
BROADCAST_DRIVER=log
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=120
TELESCOPE_ENABLED=false

STEAM_LOGIN=0
STEAM_KEY=
STEAM_SECRET=
STEAM_REDIRECT_URI=http://keyshare.local/login/steam/callback

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
Expand All @@ -17,20 +24,10 @@ DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

STEAM_KEY=
STEAM_SECRET=
STEAM_REDIRECT_URI

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
Expand All @@ -39,17 +36,7 @@ MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_NAME=

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

TELESCOPE_ENABLED=true

162 changes: 162 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Configuration

## About

All system settings are stored in the .env file, this guide will go through any of the settings, and explain how they are configured.

Please keep in mind that settings are cached, and any time you update them, you should update the cache:
`php artisan optimize`

## Config

### APP_NAME

The name of the site, can be any string. Should be in single quotes if there is a space in it.

### APP_ENV

Should not change, laravel default setting.

### APP_KEY

Generated using
`php artisan key:generate`

Should not be changed manually, but must not be null.

### APP_DEBUG

Enhanced debugging. Recommended to be false for live environments.

### APP_URL

The full URL of the site, for example https://360nohope.co.uk

### APP_DEMO_MODE

Enabled demo mode, which does a nightly data refresh. This should almost always be false.

### AUTO_APPROVE_USERS

A boolean value, this controls if users need approval to sign in, we recommend setting to 0.

### LOG_CHANNEL

Configures how keyshare logs it's config. Can be configured to any [laravel supported logging driver](https://laravel.com/docs/6.x/logging)

### CACHE_DRIVER

This should always be Redis. We recommend installing redis in our install guide.

### QUEUE_CONNECTION=redis

Not currently in use

### BROADCAST_DRIVER

Not currently in use

### SESSION_DRIVER

How sessions will be stored, we support all [laravel supported session drivers](https://laravel.com/docs/6.x/session). Redis is recommended.

### SESSION_LIFETIME

How long sessions last, recommended is 120 minutes.

### TELESCOPE_ENABLED

Enables laravel telescope, should be false for Live.

### STEAM_LOGIN

This enables steam login, however it requires the steam URLs and key to be set.

### STEAM_KEY

You need to generate a [steam api key](https://steamcommunity.com/dev/apikey) and insert the key here.

### STEAM_SECRET

The same as the Steam Key.

### STEAM_REDIRECT_URI

This is the URL the site redirects to. it should be the full site name, with /login/steam/callback on the end. For example:
`STEAM_REDIRECT_URI=https://360nohope.co.uk/login/steam/callback`

## Database Connections

We support any [laravel supported DB driver](https://laravel.com/docs/6.x/database). We recommend MySQL.

### DB_CONNECTION

Driver Name, as in the above laravel guide.

### DB_HOST

DB Server Name

### DB_PORT

DB Port

### DB_DATABASE

Database Name

### DB_USERNAME

Database username

### DB_PASSWORD

Database password

## Redis

This will not need changing if you have installed locally, but you will need to update the following strings if you are hosting redis elsewhere:

### REDIS_HOST

Hostname of redis server

### REDIS_PASSWORD

Redis server password, if configured

### REDIS_PORT

Port for redis

## Email

In order to use password resets, you should set up an SMTP server, the following details should be provided from your email provider. You can set up [Gmail](https://stackoverflow.com/questions/32515245/how-to-to-send-mail-using-gmail-in-laravel-5-1)

### MAIL_DRIVER

Should always be SMTP for live

### MAIL_HOST

Provided by your SMTP provider

### MAIL_PORT

Provided by your SMTP provider

### MAIL_USERNAME

Provided by your SMTP provider

### MAIL_PASSWORD

Provided by your SMTP provider

### MAIL_ENCRYPTION

Provided by your SMTP provider

### MAIL_FROM_NAME

The name of the sender when emails are received (Normally the site name)
96 changes: 95 additions & 1 deletion docs/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1 +1,95 @@
##To Be Added
# Installation

Currently the installation guide is only for Ubuntu Server. These can be adapted to use equivilent settings. We will be using Apache, but this can be replace by Nginx. You can use any SQL database supported by laravel, but here we will be using MySQL.

We recommend that you read the [Laravel Deployment Docs](https://laravel.com/docs/6.x/deployment) before proceeding

## Requirements

You require PHP7+, MySQL (Or an Alternative DB Server supported by laravel), A Web Server (We will be using Apache), Composer and Redis.

`sudo apt get install apache2 mysql-server php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php composer redis-server`

This guide assumes that you have already created the MySQL database.

## Install

### Keyshare

Clone laravel into a web folder, for example (/var/www/keyhsare):
`cd /var/www`

You can transfer the files one of two ways, cloing the repository, or downloading the latest release and copying the folder to the server. here we will be using git to clone the repository.

Install git:
`sudo apt get install git`

Clone the git repository:
`git clone github.com/andy3471/keyshare.git`

Go Into Directory (Or open folder in VS Code, and use terminal -> new terminal):
`cd keyshare`

Install Composer Dependancies:
`composer install --optimize-autoloader --no-dev`

Copy .env.example File:
`cp .env.example .env`

You will need to edit the .env file to set your connection string settings:
`nano .env`

Enter the DB username, password and server that you have set up. If you have redis installed externally, you'll need to set up the connection to redis here too. Please see the [Configuration Guide](docs/CONFIG.md) to set up your settings, such as the Steam Login.

Make the storage folder

Create Storage link:
`php artisan storage:link`

Build the database:
`php artisan migrate`

Generate Key:
`php artisan key:generate`

Cache the settings:
`php artisan optimize`

### Configure Apache

You'll need to configure Apache (or alternative) to use the Public directory. To do so, you'll need to either create a new site, or edit the default one in Apache. In this guide we'll edit the default.

`cd /etc/apache2/sites-available`

edit the default site file:
`sudo nano 000-default.conf`

Set the document root to the public folder created above, for example:
`DocumentRoot /var/www/keyshare/public`

Restart Apache
`sudo service apache2 restart`

## Config

The site should now work. Any issues then please feel free to raise an issue on [GitHub](https://github.com/andy3471/keyshare/issues/new/choose). Please see the [Configuration Guide](docs/CONFIG.md) to set up your settings, such as the Steam Login.

# Updating

## About

We recommend you take a full back up of the site files and the database before running an update.

## Update

This guide assumes you are using git for version management. If you have manually downloaded the files on the initial install, then you can download the new release from github manually again, and overwrite the files. In our case, we will pull the latest version:
`cd /var/www/keyshare`
`git pull`

We then need to update the database:
`php artisan migrate`

We should then clear the cache, and cache any new settings:
`php artisan optimize`

The upgrade should now be complete
6 changes: 2 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Currently, keyshare can be self hosted for one group. Users can sign in with a l
![ScreenShot](https://raw.github.com/andy3471/keyshare/master/docs/img/keyshare-gamelist.jpg)
[Try Out the Demo](https://keyshare.andyh.app)


## Technologies

Built on the Laravel PHP Framework, with Vue JS.
Expand All @@ -16,12 +15,11 @@ All development environments are running MySQL, Redis and Nginx. Laravel offers

## Install

[Install Guide (To Do)](docs/INSTALL.md)
[Configuration (To Do)](docs/CONFIG.md)
[Install Guide](docs/INSTALL.md)
[Configuration](docs/CONFIG.md)

## Contributing

[Setting up a dev environment](docs/DEVENVIRONMENT.md)
[Debugging](docs/DEBUG.md)
[Running Tests (To Do)](docs/TESTS.md)
[Contribution guidelines](docs/CONTRIBUTING.md)

0 comments on commit 44dfcff

Please sign in to comment.