This guide will help you set up and run your own copy of CodeX Media.
Also you can read VPS setting up example page.
Make sure you have installed Docker and docker-compose.
Clone the repository
git clone https://github.com/codex-team/codex.media
Initialize project
cd codex.media
./bin/init.sh
You may want to know what this script does. Here is a source code with comments.
Site will be run on 8880
port by default in the localhost loop.
http://localhost:8880/ — main site
http://localhost:8880/phpmyadmin — phpMyAdmin panel
There are two environment files:
.env
— vars for dockerwww/.env
— vars for project
Open them and read comments for correct setting up.
Config files are located at www/application/config/
directory.
You need to create application for auth in these social networks.
TBA
TBA
Go to https://developer.twitter.com/en/apps.
Create a new application by pressing button "Create an app".
Fill up required fields.
Enter correct Callbacks URL
for your site.
https://your-domain.com/auth/tw
In the tab 'Keys and tokens' you will find Consumer API keys:
API key: LzEFP.................E5u4
API secret key: ZqYORi..................................mRR5
Use them in social.php
config file.
CodeX Media uses a Sendgrid as a mailing service.
-
Register a new account and choose free plan (40000 emails per month)
Enter a name for a new key then press «Create Key»
Copy this key and paste to email.php
config file.
You can fill up senderName
and senderEmail
.
If you want to enable auto posting news to VK community page, then follow this guide. You need to have rights to post anything to the community's wall as that community.
Shortly you need to register a new Standalone application, give it rights to post to walls from your name and get an access_token
. Then you need to get group_id
— a page's identifier (integer number below zero).
Then you'll be able to enable or disable posting news to community's wall.
In phpMyAdmin choose codexmedia
database and open table Users
. Find row with for your user and change role
value from 1
to 3
.
Changes will be applied in 5 minutes because of caching to reduce the database load. You can also clear cache yourself by restarting Memcached container.
Read: Creating and restoring backups
To upgrade the project on your server follow the deploy steps on releases page.
Usually you just need to pull changes and rebuild static files:
# Pull changes
git pull
# Install new node.js dependencies
docker-compose exec php yarn
# Build static files
docker-compose exec php yarn build
You may need update the composer packages:
docker-compose exec php composer install
But sometimes you also need to rebuild the containers:
# Stop containers
./bin/docker/down.sh
# Pull changes
git pull
# Build containers
./bin/docker/build.sh
# Run containers
./bin/docker/up.sh
# Install new node.js dependencies
docker-compose exec php yarn
# Build static files
docker-compose exec php yarn build
You may need to apply mysql database migrations from ./www/migrations
directory.
If you need to run updates via Minion use docker exec command with a target task name:
docker-compose exec php ./minion 06fixmissingfieldsintabletool