Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM php:7.2-apache

ENV APACHE_DOCUMENT_ROOT /srv/www/christianflatshare.org
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

RUN apt-get update && \
apt-get install -y \
zlib1g-dev\
libxml2-dev

RUN docker-php-ext-install mysqli mbstring zip xml pdo_mysql

COPY . /srv/www/christianflatshare.org

VOLUME [ "/srv/www/christianflatshare.org" ]

RUN chown -R www-data:www-data /srv/www/christianflatshare.org

EXPOSE 80
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ CFS has been open sourced under the GPLv3 to allow paritpation from the technica

There is a list of projects maintained in [Github](https://github.com/ChristianFlatshare/ChristianFlatshare/projects "CFS projects")

## Run with Docker
The simplest way to run and edit this project is using [docker]('https://www.docker.com/')

With docker installed, all you have to do is run `docker-compose up`.

The site will be served on localhost port 80

Any changes to the files should show up instantly! (as long as you remember to save them!)

## Installation

### 1. Add the document root to your Apache2 config:
VirtualHost ServerName christianflatshare.org

Document root /srv/www/christianflatshare.org


Expand Down
68 changes: 68 additions & 0 deletions cache/templates/13/94/71877fd64564fa40efbd66290d06.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

/* loginOrRegister.twig */
class __TwigTemplate_139471877fd64564fa40efbd66290d06 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);

$this->parent = false;

$this->blocks = array(
);
}

protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo "<div class=\"mb20\">
<div id=\"change-country\">
<a href=\"countries.php\" class=\"flag\"><img src=\"/images/mid-flags/";
// line 3
echo twig_escape_filter($this->env, twig_upper_filter($this->env, $this->getAttribute((isset($context["country"]) ? $context["country"] : null), "iso")), "html", null, true);
echo ".png\" class=\"mid-flag\" /></a>
<p class=\"country\"><strong>";
// line 4
echo twig_escape_filter($this->env, $this->getAttribute((isset($context["country"]) ? $context["country"] : null), "name"), "html", null, true);
echo "</strong></p>
<p><a href=\"countries.php\">Change</a></p>
</div>
</div>
<div><a href=\"register.php\" id=\"post-advert\">Post an Advert</a></div>
<div id=\"loginContainer\" class=\"mb20\">
<div class=\"box_grey mb10\">
\t<div class=\"tr\"><span class=\"l\"></span><span class=\"r\"></span></div>
\t<div class=\"mr\">
\t <h2 class=\"m0 login-title\">Member Login</h2>
";
// line 14
echo (isset($context["loginForm"]) ? $context["loginForm"] : null);
echo "
<a href=\"";
// line 15
echo twig_escape_filter($this->env, (isset($context["FacebookLoginURL"]) ? $context["FacebookLoginURL"] : null), "html", null, true);
echo "\" class=\"fb-login\">Login with Facebook</a>
\t</div>
\t<div class=\"br\"><span class=\"l\"></span><span class=\"r\"></span></div>
</div>
<p class=\"m0\"></p>
</div>
<p class=\"mt0 mb10\" align=\"justify\">Christian Flatshare is <b>free</b> to join and to use.</p>";
}

public function getTemplateName()
{
return "loginOrRegister.twig";
}

public function isTraitable()
{
return false;
}

public function getDebugInfo()
{
return array ( 44 => 15, 40 => 14, 23 => 3, 84 => 46, 80 => 44, 76 => 42, 74 => 41, 63 => 32, 55 => 26, 47 => 20, 45 => 19, 27 => 4, 22 => 2, 19 => 1,);
}
}
103 changes: 103 additions & 0 deletions cache/templates/42/bd/703cf8c7800a9e8768fc09381eca.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?php

/* header.twig */
class __TwigTemplate_42bd703cf8c7800a9e8768fc09381eca extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);

$this->parent = false;

$this->blocks = array(
);
}

protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo "<div id=\"logoContainer\">
\t<div id=\"logo\"><a href=\"";
// line 2
echo twig_escape_filter($this->env, (isset($context["homeURL"]) ? $context["homeURL"] : null), "html", null, true);
echo "\"><img src=\"images/logo.gif\" alt=\"Christian Flatshare logo (click to return to home page)\" width=\"462\" height=\"71\" border=\"0\" /></a></div>
\t<div id=\"iconCanvas\">
\t\t<a href=\"";
// line 4
echo twig_escape_filter($this->env, (isset($context["homeURL"]) ? $context["homeURL"] : null), "html", null, true);
echo "\">
\t\t\t<img src=\"images/icon-1-over.gif\" width=\"80\" height=\"60\" border=\"0\" class=\"iconOver\" />
\t\t\t<img src=\"images/icon-1.gif\" width=\"80\" height=\"60\" border=\"0\" />
\t\t\t<div class=\"iconText\">Home page</div>
\t\t</a>
\t\t<a href=\"countries.php\">
\t\t\t<img src=\"images/icon-2-over.gif\" width=\"80\" height=\"60\" border=\"0\" class=\"iconOver\" />
\t\t\t<img src=\"images/icon-2.gif\" width=\"80\" height=\"60\" border=\"0\" />
\t\t\t<div class=\"iconText\">Countries</div>
\t\t</a>
\t\t<a href=\"contact-us.php\">
\t\t\t<img src=\"images/icon-3-over.gif\" width=\"80\" height=\"60\" border=\"0\" class=\"iconOver\" />
\t\t\t<img src=\"images/icon-3.gif\" width=\"80\" height=\"60\" border=\"0\" />
\t\t\t<div class=\"iconText\">Contact us</div>
\t\t</a>
";
// line 19
if (((isset($context["loggedIn"]) ? $context["loggedIn"] : null) == false)) {
// line 20
echo " \t\t<a href=\"login.php\">
\t\t\t<img src=\"images/icon-4-over.gif\" width=\"80\" height=\"60\" border=\"0\" class=\"iconOver\" />
\t\t\t<img src=\"images/icon-4.gif\" width=\"80\" height=\"60\" border=\"0\" />
\t\t\t<div class=\"iconText\">Register / Login</div>
\t\t</a>
";
} else {
// line 26
echo " \t\t<a href=\"your-account-manage-posts.php\">
\t\t\t<img src=\"images/icon-my-ads-over.gif\" width=\"80\" height=\"60\" border=\"0\" class=\"iconOver\" />
\t\t\t<img src=\"images/icon-my-ads.gif\" width=\"80\" height=\"60\" border=\"0\" />
\t\t\t<div class=\"iconText\">Your ads</div>
\t\t</a>
\t ";
}
// line 32
echo "\t</div>\t\t\t\t\t\t\t\t\t
</div>
<a name=\"m\"></a>\t\t
<div class=\"redMenu\">
\t<ul>
\t\t<li><a href=\"about-us.php\">about Christian Flatshare</a></li>
\t\t<li><a href=\"what-is-a-christian.php\">what is a Christian?</a></li>
\t\t<li><a href=\"stories.php\">CFS Stories</a></li>
\t\t<li><a href=\"use-cfs-in-your-church.php\">use CFS in YOUR church</a></li>
";
// line 41
if (((isset($context["country"]) ? $context["country"] : null) == "GB")) {
// line 42
echo "\t\t <li><a href=\"churches-using-cfs.php?area=Greater%20London#directory\">churches using CFS</a></li>
";
} else {
// line 44
echo " <li><a href=\"churches-using-cfs-intl.php\">churches using CFS</a></li>
";
}
// line 46
echo "\t\t<li class=\"noSeparator\"><a href=\"frequently-asked-questions.php\">Frequently Asked Questions</a></li>
\t</ul>
</div>";
}

public function getTemplateName()
{
return "header.twig";
}

public function isTraitable()
{
return false;
}

public function getDebugInfo()
{
return array ( 84 => 46, 80 => 44, 76 => 42, 74 => 41, 63 => 32, 55 => 26, 47 => 20, 45 => 19, 27 => 4, 22 => 2, 19 => 1,);
}
}
33 changes: 33 additions & 0 deletions cache/templates/fe/68/3c163cf0b5ec38cfae8100cb5885.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/* superheader.twig */
class __TwigTemplate_fe683c163cf0b5ec38cfae8100cb5885 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);

$this->parent = false;

$this->blocks = array(
);
}

protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo "<div id=\"header\">
<div class=\"inner\"></div>
</div>";
}

public function getTemplateName()
{
return "superheader.twig";
}

public function getDebugInfo()
{
return array ( 84 => 46, 80 => 44, 76 => 42, 74 => 41, 63 => 32, 55 => 26, 47 => 20, 45 => 19, 27 => 4, 22 => 2, 19 => 1,);
}
}
6 changes: 6 additions & 0 deletions database/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mysql:5.6

COPY . .
RUN zcat ./db_user.sql.gz > /docker-entrypoint-initdb.d/db_user.sql

EXPOSE 3306
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '2'
services:
php:
build:
dockerfile: 'Dockerfile'
context: '.'
volumes:
- .:/srv/www/christianflatshare.org
ports:
- '80:80'
depends_on:
- db
environment:
DB_NAME: cfs
DB_USER_NAME: db_user
DB_PASSWORD: account_password
DB_HOST: db

db:
build:
dockerfile: 'Dockerfile'
context: 'database'
environment:
MYSQL_ROOT_PASSWORD: pwd
MYSQL_DATABASE: cfs
MYSQL_USER: db_user
MYSQL_PASSWORD: account_password
ports:
- '3306:3306'
8 changes: 4 additions & 4 deletions includes/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
define ('SERVER_ENVIRONMENT', 'PRODUCTION');

// DB constants
define('DB_HOST','localhost');
define('DB_USER_NAME','db_user');
define('DB_PASSWORD','account_password');
define('DB_NAME','cfs');
define('DB_HOST', $_ENV["DB_HOST"]);
define('DB_USER_NAME',$_ENV["DB_USER_NAME"]);
define('DB_PASSWORD',$_ENV["DB_PASSWORD"]);
define('DB_NAME',$_ENV["DB_NAME"]);

// SITE contants
define('SITE','www.christianflatshare.org/');
Expand Down