Skip to content

Latest commit

 

History

History
234 lines (163 loc) · 6.9 KB

README.md

File metadata and controls

234 lines (163 loc) · 6.9 KB

CrispCMS - The new ToS;DR Frontpage

Welcome to the official repository for our frontpage, [tosdr.org](https://tosdr.org/). This is a redo of our previous frontpage, which used JS.

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

  1. Requirements
  2. Installation
  1. Configuring Crisp
  1. Plugins

Requirements

You will need these requirements to run your instance of Crisp.

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.

Additional instructions for server setup can be found here.

Apache vs Nginx

For testing we recommend using apache, however we use nginx on our production servers to combat the high volume

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 / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass https://$VLAN_CONN_DC_14/api/;
    }

    listen 80;
}

Apache

Apache only requires mod rewrite and headers to be enabled as everything is handled by the htaccess files.

PHP-7.4

This one is quite self explainatory.

Apache

  • To install on Debian-based Distros, run:
$ sudo apt-get update
$ sudo apt-get install apache2 php7.4 libapache2-mod-php     # Comes with Apache libraries for PHP.
$ sudo apt-get install php7.4-apcu php7.4-cli php7.4-curl php7.4-gd php7.4-gmp php7.4-intl php7.4-json php7.4-mbstring php7.4-pgsql php7.4-redis php7.4-xml php7.4-zip # The dependencies

Nginx

  • To install on Debian-based Distros, run:
$ sudo apt-get update
$ sudo apt install php7.4-fpm nginx
$ sudo apt-get install php7.4-apcu php7.4-cli php7.4-curl php7.4-gd php7.4-gmp php7.4-intl php7.4-json php7.4-mbstring php7.4-pgsql php7.4-redis php7.4-xml php7.4-zip # The dependencies

See Nginx configuration above on how to connect to your FPM socket.

This is used to install required dependencies from composer.json.

Shell Access

You'll need it to install plugins or setup cron jobs.

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

Updating Submodules

To update the submodules in this repository, simply run these commands in order:

$ git submodule update --init --recursive
$ git submodule foreach --recursive git fetch
$ git submodule foreach git merge origin master

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

This will create all necessary tables, aswell as install plugins and themes.

And so your instance is ready to run now!

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