Frontpage
Frontpage copied to clipboard
Dynamic ToS;DR CMS, used in our frontpage
CrispCMS - The new ToS;DR Frontpage
Code Freeze in Place until other major work is done (API, Browser Extensions, etc.)
If you wish to contribute, please check our Code of Conduct before anything else.
This readme is still a Work in Progress, but should cover basic requirements to install.
Table of Contents
- Requirements
- Installation
- Composer Dependencies
- Configuring Crisp
- Running Database Migrations
- Plugins
Requirements
You will need these requirements to run your instance of Crisp.
Redis Server
This is used to cache Phoenix requests.
Postgres
This is used for running the Crisp database.
- To install on Debian-based Distros, run:
$ sudo apt-get update
$ sudo apt-get install postgresql # Accept the installation.
Apache vs Nginx
Apache is no longer supported. Use NGINX instead.
Nginx
Frontpage config:
server {
server_name tosdr.org;
root PATH_TO_YOUR_GITHUB_REPO;
index index.php index.html index.htm;
location ~ /\. {
deny all;
}
location / {
try_files $uri /index.php?route=$uri$is_args$args;
if ($request_uri ~ ^/(.*)\.html$) {
return 302 /$1;
}
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
listen 80 default_server;
}
API Config:
server {
server_name api.tosdr.org;
location ~ /\. {
deny all;
}
location / {
try_files $uri /index.php?route=$uri$is_args$args;
if ($request_uri ~ ^/(.*)\.html$) {
return 302 /$1;
}
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param IS_API_ENDPOINT true
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
listen 80;
}
PHP-8.0
This one is quite self explainatory.
Nginx
- To install on Debian-based Distros, run:
$ sudo apt-get update
$ sudo apt install php8.0-fpm nginx
$ sudo apt-get install php8.0-{apcu,cli,curl,gd,gmp,intl,json,mbstring,pgsql,redis,xml,zip} # The dependencies
See Nginx configuration above on how to connect to your FPM socket.
Composer
This is used to install required dependencies from composer.json
.
- To install on Debian-based distros, follow this tutorial.
Shell Access
You'll need it to install plugins or setup cron jobs.
Phoenix
We recommend running your own Phoenix instance during development so you have control over the API and you don't get ratelimited. Check its repository for more info.
Discourse Plugins
Crisp is also responsible for webhooks on our forum to, for example, detect if and/or when a service has been added on Phoenix. (This is entirely optional)
Installation
To install Crisp please make sure you have installed all the requirements mentioned prior.
Run the following commands on your terminal:
$ git clone --recursive https://github.com/tosdr/CrispCMS.git
$ cd CrispCMS
And you're ready to set it up!
Installing Composer Dependencies
From the repository root, execute the following command:
$ composer install
If no errors are returned, you're good to go!
Configuring Crisp
From the repository root, copy .env.example
to .env
:
$ cp .env.example .env
Then edit it accordingly.
-
The
$GITHUB_TOKEN
variable is required for private repos to access metadata. More Info
And you're set!
Running Database Migrations
The database needs to be setup after the initial clone. To do this, run this command from the root of this repository:
$ php bin/cli.php migrate
$ php bin/cli.php theme install crisp
$ php bin/cli.php plugin install management
This will create all necessary tables, as well as install plugins and themes.
Now your instance is ready to run!
Plugins
Crisp has a plugin system integrated. More info about development can be found within this topic on our forum:
https://forum.tosdr.org/t/374