-
Notifications
You must be signed in to change notification settings - Fork 9
Development Instructions (Ubuntu)
Get the repository.
git clone https://github.com/kyzn/PRC && cd PRC
Install dependencies.
sudo apt-get install memcached sqlite3 libssl-dev zlib1g-dev
# Get latest perl version via perlbrew
\curl -L https://install.perlbrew.pl | bash
perlbrew install -j 4 stable
perlbrew switch $(perlbrew list)
perlbrew install-cpanm
# Install CPAN deps
cpanm Carton Starman App::Sqitch DBD::SQLite DDP LWP::Protocol::https JSON::XS
carton install
If you have an existing prc.db
, bring it to sqitch/
folder. Otherwise, build from scratch: Leave it in sqitch/
folder.
cd sqitch && sqitch deploy db:sqlite:prc.db
You will need a couple of secrets for some functions to work.
To make GitHub authentication work, you need to set up a GitHub app for Dev purposes.
- Go to https://github.com/settings/applications/new to create a new GitHub OAuth app.
- If you previously created an app, you should see it in https://github.com/settings/developers
- Make sure the callback url points to localhost (as in:
http://localhost:3000/callback
) - Note your
Client ID
andClient Secret
.
If you want to see emails working, you need a SendGrid API key.
These are 128 bit keys that are used to encrypt unsubscribe links in emails. If you are not going to test emails it's not required. Otherwise just put 32 a
s.
At the root of the project, create a secrets.yml
file and put your secrets there. It should look like below:
Create a secrets.yml
file at the root folder of the project that looks like below. CLIENT_ID and CLIENT_SECRET are for the GitHub app. ENC_KEY and HMAC_KEY are 128 bit keys, anything goes. SG_API_KEY is sendgrid key to test sending emails, it's not required otherwise.
CLIENT_ID: ....
CLIENT_SECRET: ....
ENC_KEY: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
HMAC_KEY: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SG_API_KEY: ....
Run memcached
service memcached start
Then run the app locally:
DBIC_TRACE=1 carton exec script/prc_server.pl -r -d