From 7c6f96d6ba3744461f4d336d5bc0e961403431c5 Mon Sep 17 00:00:00 2001 From: Evan Walsh Date: Fri, 1 Feb 2019 19:37:21 -0500 Subject: [PATCH] Init --- Dockerfile | 7 +++++++ README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ config.ini | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 config.ini diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a242ed8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM writeas/writefreely + +COPY config.ini . + +EXPOSE 8080 + +CMD ["bin/writefreely"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc3682e --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# [WriteFreely](https://writefreely.org/) + [Dokku](http://dokku.viewdocs.io/dokku/) + +## Pre-requisites + +1. You must have [Dokku](http://dokku.viewdocs.io/dokku/) installed on your server already for these steps to work. +2. You must download the files contained in this repo (`Dockerfile` and `config.ini`) and have them in a folder on your local computer. +3. You must edit the [config.ini you downloaded to match the settings you'd like](https://github.com/writefreely/documentation/blob/master/admin/config.md). + +## Installation + +First, connect to your server via SSH and create the `writefreely` app. + +``` +dokku apps:create writefreely +``` + +Then, setup the directories for WriteFreely's data so it won't be wiped each time you re-deploy. + +``` +mkdir -p /var/lib/dokku/data/storage/writefreely/{db,keys} +chown daemon:daemon /var/lib/dokku/data/storage/writefreely/* +dokku storage:mount writefreely /var/lib/dokku/data/storage/writefreely/keys:/go/keys +dokku storage:mount writefreely /var/lib/dokku/data/storage/writefreely/db:/go/db +dokku proxy:ports-set writefreely http:80:8080 +``` + +Next, open the folder the files you downloaded from this repo are in. Initialize a git repo in it. + +``` +git init +git add --all +git commit -m "Init" +git remote add dokku dokku@[YOUR SERVER'S IP OR URL]:writefreely +git push dokku master +``` + +This deploy will fail. You can then initialize WriteFreely's database and keys. + +``` +dokku run writefreely bin/writefreely --init-db +dokku run writefreely bin/writefreely --gen-keys +``` + +Finally, you can rebuild the app and it'll run as expected. + +``` +dokku ps:rebuild writefreely +``` diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..d19e279 --- /dev/null +++ b/config.ini @@ -0,0 +1,37 @@ +[server] +hidden_host = +port = 8080 +bind = 0.0.0.0 +tls_cert_path = +tls_key_path = +templates_parent_dir = +static_parent_dir = +pages_parent_dir = +keys_parent_dir = + +[database] +type = sqlite3 +filename = db/writefreely.db +username = +password = +database = +host = localhost +port = 3306 + +[app] +site_name = Write Freely +site_description = +host = http://writefreely.example.com +theme = write +disable_js = false +webfonts = true +single_user = false +open_registration = true +min_username_len = 3 +max_blogs = 3 +federation = true +public_stats = true +private = false +local_timeline = true +user_invites = user +