Skip to content

dotmanish/community-platform

 
 

Repository files navigation

DuckDuckGo - Community Platform

New documentation in work! Please only try if you know what you do

REQUIREMENTS

Requires perl 5.14.2 (or higher) and:

apt-get install cpanm build-essential libgd2-xpm-dev libssl-dev git wget libxml2-dev imagemagick perl-doc postgresql libpq-dev

(This requires PostgreSQL for the recommended setup.) The above uses apt-get for Debian-based distributions including Ubuntu. If you're using a different distribution, the command may differ.

You'll next need to make sure you install Dist::Zilla module:

cpanm -i Dist::Zilla

INSTALLATION

After checking out, you require to install the requirements. You must have installed Dist::Zilla, then you can do the following to install the base Perl requirements (run this in the source root with dist.ini file):

dzil authordeps --missing | cpanm
dzil listdeps --missing | grep -v abstract | cpanm

If you're doing this on a fresh Perl install, this may take a while to install.

Additionally, you require to install DDGC deps from duckpan:

duckpan DDGC::Static

To start, you must once initialize the base database. The default is to use SQLite if no Database configuration environment variables are found, but it is strongly recommended to use Postgresql. To do this, make sure you set the following 3 environment variables before proceeding further (and these variables need to be set permanently post this, so you need to put them in bashrc or correspdonding initialization scripts for your shell):

(Use your preferred database name / user / password values)

DDGC_DB_DSN='dbi:Pg:database=ddgc'
DDGC_DB_USER='ddgc'
DDGC_DB_PASSWORD='yourdbpass'

Note: Do ensure that the user ('ddgc' in above example) has the 'createdb' permission. To do this, login to psql as a superuser and run:

ALTER USER ddgc CREATEDB

Now, run the script to initialize the base database:

script/ddgc_deploy_dev.pl

Do note that the script will complain if you already have an existing database at the target location. If this happens, you would need to use use the --kill switch to reset it:

script/ddgc_deploy_dev.pl --kill

For the flags to work you need to generate the sprites used for the flags. This process has to be repeated everytime the country flags are changing.

script/ddgc_generate_flag_sprites.pl

DEVELOPING

You can start the web server, if you are inside the repository with:

script/ddgc_web_server.pl -r -d

If you want to do any of the above activities with intense debug logging you can use the following ENV variables before the command, like in this example:

DBIC_TRACE_PROFILE=console DBIC_TRACE=1 script/ddgc_web_server.pl -r -d

The -r switch assures that it reloads itself, if some of the codefiles are changed. For changes on templates he will not restart. (If you work on the blog you sadly have to restart by hand if you change the data file).

The -d switch sets the web server into debugging mode. This activates a side bar with additional request informations, and also shows you much more informations on the terminal. If you don't want those, you can just deactivate it. For work on HTML/CSS or the blog it might disturb.

ACCOUNTS

We prepared some accounts for testing in the default setup, those can all be accessed with random passwords (yes, you can't test wrong password yet, sorry).

The following account exist:

* testone An admin, who is native german, but also speaks english.

* testtwo A normal user who speaks spanish, with public profile.

* testthree A translation_manager who speaks english, arabic and german.

* testfour An admin, who speaks german, spain and english.

* testfive A normal user without public profile, who speaks russian and english.

* Additionally there exist test1 till test100 all without any setup.

About

DuckDuckGo Community Platform

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Perl 55.0%
  • JavaScript 26.4%
  • CSS 18.1%
  • Other 0.5%