Repository for the anykey.org v2.0 website which includes the relaunched GLHF pledge and custom moderation system.
The app currently runs on Ruby 2.6.3, Rails 6.0.0.rc1, MySQL, and Redis. It is recommended that you use asdf to install and manage your rubies.
Follow these general steps to set up your local development environment from scratch.
1. Fork & clone this repo
git clone git@github.com:<username>/anykey.git
2. Install MySQL 8 (app database)
/usr/local/mysql/bin
(or equivalent) to your path3. Install Redis (cache database)
mkdir redis && cd redis
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
4. Install ImageMagick (image processing software)
brew install imagemagick
convert -version
tp ensure crucial ImageMagick command has been installed5. Install asdf (Ruby version manager)
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
asdf --version
to confirm it returns infoecho "legacy_version_file = yes" >> ~/.asdfrc
6. Install Ruby 2.6.3 via asdf
brew install openssl readline
brew install ruby-build
brew install shared-mime-info
asdf plugin add ruby
asdf list all ruby
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
export RUBY_CFLAGS="-Wno-error=implicit-function-declaration"
asdf install ruby 2.6.3
asdf global ruby 2.6.3
(creates ~/.tool-versions)asdf local ruby 2.6.3
(create .tool-versions file in repo)cd anykey
then ruby -v
to check your version7. Install essential gems
echo "gem: --no-document" >> ~/.gemrc
gem install rails --version 6.0.0.rc1
gem install mysql2
-- --with-opt-dir="$(brew --prefix openssl@1.1)"
flag on M1 Macsbundle install
8. Configure database environment variables
.env
to your app's root directoryMYSQL_USERNAME=XXX
MYSQL_PASSWORD=YYY
MYSQL_SOCKET=/tmp/mysql.sock # For Mac
MYSQL_SOCKET=/var/run/mysqld/mysqld.sock # For Windows
9. Configure Amazon S3 bucket
.env
file:AWS_BUCKET=bucket-name
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=YYY
AWS_REGION=region-name
10. Create database in MySQL
rake db:create
mysql -u root -p
and CREATE DATABASE anykey_development;
11. Seed database and run migrations
rake db:seed
rake db:migrate
12. Confirm app runs
redis-server
rackup
The AnyKey app uses several external services:
In order to test all of the features in your development environment you will have to add additional credentials to your .env
file. These credentials are only available to trusted collaborators and can be obtained from the repository manager.
Note that the TWITCH_REDIRECT_URL
must be set in both the external Twitch app and the local development environment. A separate Twitch app should be created by the developer for local testing purposes.
SENDGRID_USERNAME=XXX
SENDGRID_PASSWORD=YYY
SENDGRID_DOMAIN=anykey.org
TWITCH_AUTH_BASE_URL=https://id.twitch.tv
TWITCH_API_BASE_URL=https://api.twitch.tv/helix
TWITCH_PLEDGE_BASE_URL=https://api.twitch.tv/ent/chat/badges/pledge
TWITCH_CLIENT_ID=XXX
TWITCH_CLIENT_SECRET=YYY
TWITCH_PLEDGE_SECRET=ZZZ
TWITCH_REDIRECT_URL=http://localhost:9292/pledge
Copyright 2019-2022, AnyKey
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses.