Dokku

eLAND installs on a VPS with Dokku.

See the Dokku installation guide.

  • Install Dokku on a VPS with a fresh Ubuntu 16.04,

  • Domains: don't set a global domain, but set a domain for the app with a wildchart

(all dokku commands are on the server)

dokku domains:set app-name *.my-domain.com
  • Create app, install postgres and redis plugins and bind them to the app (see Dokku guide).

  • install the nl language pack if not present (for translating dates)

sudo apt-get install language-pack-nl
  • Configure nginx to allow bigger uploads (for documents)
    sudo su - dokku
    mkdir /home/dokku/appname/nginx.conf.d/
    echo 'client_max_body_size 10M;' > /home/dokku/appname/nginx.conf.d/upload.conf
    exit
    sudo service nginx reload
    

DNS

A CNAME record with wildcard should point to the Dokku app url.

Match subdomains and database schemas (groups)

Set a config var for each subdomain to the name of the schema in the database

dokku config:set appname SCHEMA_FLUPKE___AND___SABRINA=flupkesabrina

Above example couples domain flupke-and-sabrina.my-domain.com to database schema flupkesabrina.

The environment variable SCHEMA_domain: couples a subdomain to a schema

  • Dots in subdomain are replaced by double underscore __
  • Hyphens in domain are replaced by triple underscore _
  • all characters should be uppercase in the environment variable.

Set the overall domain with:

dokku config:set appname OVERALL_DOMAIN=my-domain.com

AWS S3

Create a IAM user on AWS with access only to S3. Then create 2 buckets in your region for images and documents See file include/default.php for which libraries are to be uploaded. The buckets should have the same name as the url.

dokku config:set S3_IMG=img.letsa.net S3_DOC=doc.letsa.net
dokku config:set AWS_ACCESS_KEY_ID=aaa AWS_SECRET_ACCESS_KEY=bbb

Create CNAME records to these buckets

img.letsa.net CNAME record for img.letsa.net.s3-eu-central-1.amazonaws.com

See the AWS S3 docs

You need to set up CORS configuration on bucket S3_RES for the fonts of footable 2.0.3 to load.

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>Authorization</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

Email

SMTP mailserver (e.i. Amazon Simple Email Service)

  • SMTP_HOST
  • SMTP_PORT
  • SMTP_PASSWORD
  • SMTP_USERNAME

From mail addresses

  • MAIL_FROM_ADDRESS: a mail address when a reply-to address has been set.
  • MAIL_NOREPLY_ADDRESS: a notification mail you can not reply to
  • MAIL_HOSTER_ADDRESS: used for the request-hosting form.
  • MAIL_NOTIFY_ADDRESS: mail system notifications.

Mail is sent only from MAIL_FROM_ADDRESS and MAIL_NOREPLY_ADDRESS. These addresses should be set up for DKIM in the mailserver.

Request hosting form

The Domain of a request-hosting form can be set with:

  • HOSTING_FORM_domain=1

Redirects

  • REDIRECT_fromdomain=to.domain.net

domain of the hosting form and redirects is formatted the same way as the schema subdomains.

  • Dots are replaced by double underscore __
  • Hyphens are replaced by triple underscore _
  • all characters should be uppercase in the environment variable.

Other environment vars

  • TIMEZONE: defaults to 'Europe/Brussels'
  • MASTER_PASSWORD: sha512 encoded password for 'master' -> gives admin access to all letsgroups.

Postgres

See [https://github.com/dokku/dokku-postgres]

Redis

See [https://github.com/dokku/dokku-redis]

results matching ""

    No results matching ""