From 58e4a6dcaa9736a0e9029ee18e236b71ffa8755b Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Tue, 22 May 2018 11:04:03 +0200 Subject: [PATCH 1/2] Add Friendica docs --- friendica/README-short.txt | 1 + friendica/content.md | 157 +++++++++++++++++++++++++++++++++++++ friendica/github-repo | 1 + friendica/license.md | 1 + friendica/logo.png | Bin 0 -> 6453 bytes friendica/maintainer.md | 1 + 6 files changed, 161 insertions(+) create mode 100644 friendica/README-short.txt create mode 100644 friendica/content.md create mode 100644 friendica/github-repo create mode 100644 friendica/license.md create mode 100644 friendica/logo.png create mode 100644 friendica/maintainer.md diff --git a/friendica/README-short.txt b/friendica/README-short.txt new file mode 100644 index 000000000000..4dd8c56efe00 --- /dev/null +++ b/friendica/README-short.txt @@ -0,0 +1 @@ +Welcome to the free social web. diff --git a/friendica/content.md b/friendica/content.md new file mode 100644 index 000000000000..bdb9eac96696 --- /dev/null +++ b/friendica/content.md @@ -0,0 +1,157 @@ +# Docker Image for Friendica +[![Build Status Travis](https://travis-ci.org/friendica/docker.svg?branch=master)](https://travis-ci.org/friendica/docker) + +This repository holds the official Docker Image for [Friendica](https://friendi.ca) + +# What is Friendica? + +Friendica is a decentralised communications platform that integrates social communication. +Our platform links to independent social projects and corporate services. + +![logo](https://cdn.rawgit.com/nupplaphil/friendica-docker/c59f235f/friendica.svg) + +# How to use this image +The images are designed to be used in a micro-service environment. +There are two types of the image you can choose from. + +The `apache` tag contains a full Friendica installation including an apache web server. +It is designed to be easy to use and gets you running pretty fast. +This is also the default for the `latest` tag and version tags that are not further specified. + +The second option is a `fpm` container. +It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Friendica server. +To use this image it must be combined with any Webserver that can proxy the http requests to the FastCGI-port of the container. + +## Using the apache image +You need at least one other mariadb/mysql-container to link it to Friendica. + +The apache image contains a webserver and exposes port 80. +To start the container type: +```console +$ docker run -d -p 8080:80 --link some-mysql:mysql friendica +``` + +Now you can access the Friendica installation wizard at http://localhost:8080/ from your host system. + +## Using the fpm image +To use the fpm image you need an additional web server that can proxy http-request to the fpm-port of the container. +For fpm connection this container exposes port 9000. +In most cases you might want use another container or your host as proxy. +If you use your host you can address your Friendica container directly on port 9000. +If you use another container, make sure that you add them to the same docker network (via `docker run --network ...` or a `docker-compose` file). +In both cases you don't want to map the fpm port to you host. + +```console +$ docker run -d friendica:fpm +``` + +As the fastCGI-Process is not capable of serving static files (style sheets, images, ...) the webserver needs access to these files. +This can be achieved with the `volumes-from` option. +You can find more information in the docker-compose section. + +## Using the cron job + +There are three options to enable the cron-job for Friendica: +- Using the default Image and activate the cron-job (see [Installation](https://friendi.ca/resources/installation/), sector `Activating scheduled tasks`) +- Using the default image (apache, fpm, fpm-alpine) and creating **two** container (one for cron and one for the main app) +- Using one of the additional, prepared [`cron dockerfiles`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/cron) + +## Using sendmail for E-Mail support + +You have to set the `--hostname/-h` parameter correctly to make the `mail()` command use the right domainname of it's e-mail. +Currently, the command `sendmail` will be used for the `mail()` support of Friendica. + +Be aware that in production environment, you normally have an external MTA (or a SmartHost) for correctly signing and routing your e-mails. +See the Dockerfiles at [`smtp`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/smtp) for examples how to configure it. + +### `apache` and `fpm` image +`sendmail` is used as a SMTP MTA for standalone usage and it works out-of-the-box. + +### `fpm-alpine` image +For alpine, there is no "standalone" mail-service available. +Therefore you **have** to setup a SMTP MTA. + +## Using an external database +By default the `latest` container uses a local MySQL-Database for data storage, but the Friendica setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB database. +You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. + +## Persistent data +The Friendica installation and all data beyond what lives in the database (file uploads, etc) is stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. +The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. +That means your data is saved even if the container crashes, is stopped or deleted. + +To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder. +To achieve this you need one volume for your database container and Friendica. + +Friendica: +- `/var/www/html/` folder where all Friendica data lives +```console +$ docker run -d \ +-v friendica-vol-1:/var/www/html \ +friendica +``` + +Database: +- `/var/lib/mysql` MySQL / MariaDB Data +```console +$ docker run -d \ +-v mysql-vol-1:/var/lib/mysql \ +mariadb +``` + +## Auto configuration via environment variables +The Friendica image supports auto configuration via environment variables. +You can preconfigure everything that is asked on the install page on first run. + +- `AUTOINSTALL` if `true`, the automatic configuration will start (Default: `false`) + +__MYSQL/MariaDB__: +- `MYSQL_USERNAME` Username for the database user using mysql / mariadb. +- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb. +- `MYSQL_DATABASE` Name of the database using mysql / mariadb. +- `MYSQL_HOST` Hostname of the database server using mysql / mariadb. +- `MYSQL_PORT` Port of the database server using mysql / mariadb. + +You can also predefine the following `.htconfig.php` values: +- `MAILNAME` E-Mail address of the administrator +- `TZ` The default localization of the Friendica server +- `LANGUAGE` The default language of the Friendica server +- `SITENAME` The default name of the Friendica server + +## Updating Friendica + +There are differences between the [stable](https://github.com/friendica/docker/tree/master/stable/) and the [develop](https://github.com/friendica/docker/tree/master/develop/) branches. + +They have both in common that normally we do not automatically overwrite your working directory with the new version. +Instead you need to explicit run `friendica update` for the node for updating files&database. + +## Updating stable +You have to pull the latest image from the hub (`docker pull friendica`). + +## Updating develop +You don't need to pull the image for each commit in [friendica](https://github.com/friendica/friendica/). +Instead you can just update your node with executing `friendica update` on the node. +Example: +```console +$ docker exec -ti friendica_running_node friendica update +``` +It will clone the latest Friendica version and copy it to your working directory. + +# The `friendica` CLI + +To make the usage of the Docker images smooth, we created a little CLI. +It wraps the common commands for Friendica and adds new commands. + +You can call it with +```console +$ docker exec -ti friendica_running_node friendica +``` + +Commands: +- `console` Executes an command in the Friendica console (`bin/console.php` wrapper) +- `composer` Executes the composer.phar executable for Friendica (`bin/composer.phar` wrapper) +- `install` Installs Friendica on a empty environment (gets called automatically during first start) +- `update` Updates Friendica on a **existing** environment + +# Questions / Issues +If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/friendica/docker) and write an issue. \ No newline at end of file diff --git a/friendica/github-repo b/friendica/github-repo new file mode 100644 index 000000000000..488349611464 --- /dev/null +++ b/friendica/github-repo @@ -0,0 +1 @@ +https://github.com/friendica/docker diff --git a/friendica/license.md b/friendica/license.md new file mode 100644 index 000000000000..f93b63648837 --- /dev/null +++ b/friendica/license.md @@ -0,0 +1 @@ +View [license information](https://github.com/friendica/docker/blob/master/LICENSE) for the software contained in this image. diff --git a/friendica/logo.png b/friendica/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d2792ab54ebeb1b34dcb18e3c6b35d9b568743ec GIT binary patch literal 6453 zcmbVxg;UjE(D(Nik|J;kkxuC@X}AbTNQajc=@yWNONemklm;oKyXztX(jwhRhqN@p z<8R*g4|wL8J-a(+cV=gI&zYV1%tmOaD-z&R;sO9bpsa+@`lnI=ve;2IRDvAi;{y)lX|D5>Gg5#oO=mr4vIR7z7b$@jZ04TmIBV={F=Jt&P z`n{XmxWoFB|TL?OVzk1;E1CA~WRKA3m zUM~U7#LUvmpBJ7RX``zeDig%~Do)FgoXbEDoD!`_)LEfZLxcJd1Dt#c(p!hI*~XE1F!~o{pN%?VUL(jZcV) z;Qug>UJWTNc@$qALp^Xx&#Oq}36F?8WnwEq=f_ITadL9rZY1lQTwSfjh#!3Z5CzOP zIQkBc2Hu?pQsQHgM_?CwRFe_IVj8gH*Da1h|z%VK!E0jfvx+g>cJc;qH!1DtTEe^$SXOExTP z69{Ul1E@LIH56Q*h}lHNuf-yhk?R4pVY)wT0qVZY* zy)iuB%@X&NvWjxWum)L7;c-hj<0@8gP<4Kq696YgfF$I6KSGY4YO!EG+>bG0t}Xa{ zm*!;?qhY+D%E-rZNx`bb%-hoS1bE29%2xOw<E?`_Q%67cyCM6}s#3_o%0$+#p zZ%|i;NMDng8$Kl@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57GO&dE`)$JdWJv29d!ziAxMwTnrFg|rpNE^ z4H59k5jDTx5!+erVacmp5tfC)<=-Mmg!TGAwY2S0)Mwip+`c;qX`IEOtYRtH2ya%V z6)FCPss2f|=?$J3jl*scjrCu?Vn3HYQN!F|zi(dDPpFK_`!Y(jtQsZBtg3r2jLz#Q z31A?m&r=$3_{4sE%rmsMS;@WPxg;3f*lA9=l{3jfEaAO0aoC-a|J9+Nd7aYyl~zy% z$@c-y2aLzP7<&JYrKumsHbtUDgxZFGKAjhU;BW90q%Jaoi~RAk=fdu^=i?6MOe}5x zzDB$eK@BtTe}3kpj;Yxq>T~r2^&bLea0M;BJgQK-2ti2EXXrm5?|K`C%}PaL-W^X2 z_?K0a1DFn2&;EUDC{sl#m9r?QJ-QNCn5It&(M+QFYe)cl3-bK4=U1sPak#La7?Zm# z?a)^f7jxR7J4to&nG^M8$Po(>AJwUSu_Xx|njubt1|!dKG7#(`M3lnE>|OTaAwgpL zbe&}2MC}XvhBj3e#h3ybrK>ezi=Z`W;BtIpsV(p2i&fFEe#NvU*opuULri2ZsFk97 z3Ss!}rFz=e^YN@LBGE_ASyynG8mIsrfgd&?G=);!g;4tpUtfi3vs)-2$K~yv zKKVW@XbWj7uD>S$GOAM$h#0^nI^6FG<}SHyJ&4#W8Y~jw$clOiy4;U=-9V|=buN|2 zWSC<)YYP*5_`X=e=sl1PscN@J|G%|?p6nfM{D#Rt(B*9MZ_xoLE2twX Date: Tue, 22 May 2018 12:12:08 +0200 Subject: [PATCH 2/2] fixed `contend.md` (markdownfmt checks) --- friendica/content.md | 138 ++++++++++++++++++++----------------------- 1 file changed, 64 insertions(+), 74 deletions(-) diff --git a/friendica/content.md b/friendica/content.md index bdb9eac96696..aee2921c26d3 100644 --- a/friendica/content.md +++ b/friendica/content.md @@ -1,32 +1,21 @@ -# Docker Image for Friendica -[![Build Status Travis](https://travis-ci.org/friendica/docker.svg?branch=master)](https://travis-ci.org/friendica/docker) - -This repository holds the official Docker Image for [Friendica](https://friendi.ca) - # What is Friendica? -Friendica is a decentralised communications platform that integrates social communication. -Our platform links to independent social projects and corporate services. +Friendica is a decentralised communications platform that integrates social communication. Our platform links to independent social projects and corporate services. ![logo](https://cdn.rawgit.com/nupplaphil/friendica-docker/c59f235f/friendica.svg) # How to use this image -The images are designed to be used in a micro-service environment. -There are two types of the image you can choose from. -The `apache` tag contains a full Friendica installation including an apache web server. -It is designed to be easy to use and gets you running pretty fast. -This is also the default for the `latest` tag and version tags that are not further specified. +The `apache` tag contains a full Friendica installation including an apache web server. It is designed to be easy to use and gets you running pretty fast. This is also the default for the `latest` tag and version tags that are not further specified. -The second option is a `fpm` container. -It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Friendica server. -To use this image it must be combined with any Webserver that can proxy the http requests to the FastCGI-port of the container. +The second option is a `fpm` container. It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Friendica server. To use this image it must be combined with any Webserver that can proxy the http requests to the FastCGI-port of the container. ## Using the apache image + You need at least one other mariadb/mysql-container to link it to Friendica. -The apache image contains a webserver and exposes port 80. -To start the container type: +The apache image contains a webserver and exposes port 80. To start the container type: + ```console $ docker run -d -p 8080:80 --link some-mysql:mysql friendica ``` @@ -34,124 +23,125 @@ $ docker run -d -p 8080:80 --link some-mysql:mysql friendica Now you can access the Friendica installation wizard at http://localhost:8080/ from your host system. ## Using the fpm image -To use the fpm image you need an additional web server that can proxy http-request to the fpm-port of the container. -For fpm connection this container exposes port 9000. -In most cases you might want use another container or your host as proxy. -If you use your host you can address your Friendica container directly on port 9000. -If you use another container, make sure that you add them to the same docker network (via `docker run --network ...` or a `docker-compose` file). -In both cases you don't want to map the fpm port to you host. + +To use the fpm image you need an additional web server that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases you might want use another container or your host as proxy. If you use your host you can address your Friendica container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via `docker run --network ...` or a `docker-compose` file). In both cases you don't want to map the fpm port to you host. ```console $ docker run -d friendica:fpm ``` -As the fastCGI-Process is not capable of serving static files (style sheets, images, ...) the webserver needs access to these files. -This can be achieved with the `volumes-from` option. -You can find more information in the docker-compose section. +As the fastCGI-Process is not capable of serving static files (style sheets, images, ...) the webserver needs access to these files. This can be achieved with the `volumes-from` option. You can find more information in the docker-compose section. ## Using the cron job There are three options to enable the cron-job for Friendica: -- Using the default Image and activate the cron-job (see [Installation](https://friendi.ca/resources/installation/), sector `Activating scheduled tasks`) -- Using the default image (apache, fpm, fpm-alpine) and creating **two** container (one for cron and one for the main app) -- Using one of the additional, prepared [`cron dockerfiles`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/cron) + +- Using the default Image and activate the cron-job (see [Installation](https://friendi.ca/resources/installation/), sector `Activating scheduled tasks`) +- Using the default image (apache, fpm, fpm-alpine) and creating **two** container (one for cron and one for the main app) +- Using one of the additional, prepared [`cron dockerfiles`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/cron) ## Using sendmail for E-Mail support -You have to set the `--hostname/-h` parameter correctly to make the `mail()` command use the right domainname of it's e-mail. -Currently, the command `sendmail` will be used for the `mail()` support of Friendica. +You have to set the `--hostname/-h` parameter correctly to make the `mail()` command use the right domainname of it's e-mail. Currently, the command `sendmail` will be used for the `mail()` support of Friendica. -Be aware that in production environment, you normally have an external MTA (or a SmartHost) for correctly signing and routing your e-mails. -See the Dockerfiles at [`smtp`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/smtp) for examples how to configure it. +Be aware that in production environment, you normally have an external MTA (or a SmartHost) for correctly signing and routing your e-mails. See the Dockerfiles at [`smtp`](https://github.com/friendica/docker/tree/master/.examples/dockerfiles/smtp) for examples how to configure it. ### `apache` and `fpm` image + `sendmail` is used as a SMTP MTA for standalone usage and it works out-of-the-box. ### `fpm-alpine` image -For alpine, there is no "standalone" mail-service available. -Therefore you **have** to setup a SMTP MTA. + +For alpine, there is no "standalone" mail-service available. Therefore you **have** to setup a SMTP MTA. ## Using an external database -By default the `latest` container uses a local MySQL-Database for data storage, but the Friendica setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB database. -You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. + +By default the `latest` container uses a local MySQL-Database for data storage, but the Friendica setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB database. You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. ## Persistent data -The Friendica installation and all data beyond what lives in the database (file uploads, etc) is stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. -The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. -That means your data is saved even if the container crashes, is stopped or deleted. -To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder. -To achieve this you need one volume for your database container and Friendica. +The Friendica installation and all data beyond what lives in the database (file uploads, etc) is stored in the [unnamed docker volume](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume) volume `/var/www/html`. The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. That means your data is saved even if the container crashes, is stopped or deleted. + +To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder. To achieve this you need one volume for your database container and Friendica. Friendica: -- `/var/www/html/` folder where all Friendica data lives + +- `/var/www/html/` folder where all Friendica data lives + ```console $ docker run -d \ --v friendica-vol-1:/var/www/html \ -friendica + -v friendica-vol-1:/var/www/html \ + friendica ``` Database: -- `/var/lib/mysql` MySQL / MariaDB Data + +- `/var/lib/mysql` MySQL / MariaDB Data + ```console $ docker run -d \ --v mysql-vol-1:/var/lib/mysql \ -mariadb + -v mysql-vol-1:/var/lib/mysql \ + mariadb ``` ## Auto configuration via environment variables -The Friendica image supports auto configuration via environment variables. -You can preconfigure everything that is asked on the install page on first run. -- `AUTOINSTALL` if `true`, the automatic configuration will start (Default: `false`) +The Friendica image supports auto configuration via environment variables. You can preconfigure everything that is asked on the install page on first run. + +- `AUTOINSTALL` if `true`, the automatic configuration will start (Default: `false`) -__MYSQL/MariaDB__: -- `MYSQL_USERNAME` Username for the database user using mysql / mariadb. -- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb. -- `MYSQL_DATABASE` Name of the database using mysql / mariadb. -- `MYSQL_HOST` Hostname of the database server using mysql / mariadb. -- `MYSQL_PORT` Port of the database server using mysql / mariadb. +**MYSQL/MariaDB**: + +- `MYSQL_USERNAME` Username for the database user using mysql / mariadb. +- `MYSQL_PASSWORD` Password for the database user using mysql / mariadb. +- `MYSQL_DATABASE` Name of the database using mysql / mariadb. +- `MYSQL_HOST` Hostname of the database server using mysql / mariadb. +- `MYSQL_PORT` Port of the database server using mysql / mariadb. You can also predefine the following `.htconfig.php` values: -- `MAILNAME` E-Mail address of the administrator -- `TZ` The default localization of the Friendica server -- `LANGUAGE` The default language of the Friendica server -- `SITENAME` The default name of the Friendica server + +- `MAILNAME` E-Mail address of the administrator +- `TZ` The default localization of the Friendica server +- `LANGUAGE` The default language of the Friendica server +- `SITENAME` The default name of the Friendica server ## Updating Friendica There are differences between the [stable](https://github.com/friendica/docker/tree/master/stable/) and the [develop](https://github.com/friendica/docker/tree/master/develop/) branches. -They have both in common that normally we do not automatically overwrite your working directory with the new version. -Instead you need to explicit run `friendica update` for the node for updating files&database. +They have both in common that normally we do not automatically overwrite your working directory with the new version. Instead you need to explicit run `friendica update` for the node for updating files&database. + +## Updating stable -## Updating stable You have to pull the latest image from the hub (`docker pull friendica`). ## Updating develop -You don't need to pull the image for each commit in [friendica](https://github.com/friendica/friendica/). -Instead you can just update your node with executing `friendica update` on the node. -Example: + +You don't need to pull the image for each commit in [friendica](https://github.com/friendica/friendica/). Instead you can just update your node with executing `friendica update` on the node. Example: + ```console $ docker exec -ti friendica_running_node friendica update ``` + It will clone the latest Friendica version and copy it to your working directory. # The `friendica` CLI -To make the usage of the Docker images smooth, we created a little CLI. -It wraps the common commands for Friendica and adds new commands. +To make the usage of the Docker images smooth, we created a little CLI. It wraps the common commands for Friendica and adds new commands. You can call it with + ```console $ docker exec -ti friendica_running_node friendica ``` Commands: -- `console` Executes an command in the Friendica console (`bin/console.php` wrapper) -- `composer` Executes the composer.phar executable for Friendica (`bin/composer.phar` wrapper) -- `install` Installs Friendica on a empty environment (gets called automatically during first start) -- `update` Updates Friendica on a **existing** environment + +- `console` Executes an command in the Friendica console (`bin/console.php` wrapper) +- `composer` Executes the composer.phar executable for Friendica (`bin/composer.phar` wrapper) +- `install` Installs Friendica on a empty environment (gets called automatically during first start) +- `update` Updates Friendica on a **existing** environment # Questions / Issues -If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/friendica/docker) and write an issue. \ No newline at end of file + +If you got any questions or problems using the image, please visit our [Github Repository](https://github.com/friendica/docker) and write an issue.