aboutsummaryrefslogtreecommitdiffstats
path: root/docker/README.md
diff options
context:
space:
mode:
authorLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-05 19:18:05 +0100
committerLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-07 10:20:38 +0100
commit8337e2632686cf8d0dcf39474019370f7d3dc752 (patch)
tree7adac5b63d03aff8d81ab1250fa54d3007e51b41 /docker/README.md
parentMerge pull request #47 from cromefire/db-path (diff)
downloadferdium-server-8337e2632686cf8d0dcf39474019370f7d3dc752.tar.gz
ferdium-server-8337e2632686cf8d0dcf39474019370f7d3dc752.tar.zst
ferdium-server-8337e2632686cf8d0dcf39474019370f7d3dc752.zip
Moved getferdi/server-docker into getferdi/server repository.
Add sample docker-compose file and update README.md files in root and docker directories.
Diffstat (limited to 'docker/README.md')
-rw-r--r--docker/README.md224
1 files changed, 224 insertions, 0 deletions
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 0000000..8e0da08
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,224 @@
1<p align="center">
2 <img src="./logo.png" alt="" width="300"/>
3</p>
4
5# Ferdi-server-docker
6[Ferdi](https://github.com/getferdi/ferdi) is a hard-fork of [Franz](https://github.com/meetfranz/franz), adding awesome features and removing unwanted ones. Ferdi-server is an unofficial replacement of the Franz server for use with the Ferdi Client.
7
8This is a dockerized version of [Ferdi-server](https://github.com/getferdi/server) running on Alpine Linux and Node.js (v10.16.3).
9
10## Why use a custom Ferdi-server?
11A custom ferdi-server allows you to experience the full potential of the Ferdi client. It allows you to use all Premium features (e.g. Workspaces and custom URL recipes) and [adding your own recipes](#creating-and-using-custom-recipes).
12
13## Features
14- [x] User registration and login
15- [x] Service creation, download, listing and removing
16- [x] Workspace support
17- [x] Functioning service store
18- [x] User dashboard
19- [x] Password recovery
20- [x] Export/import data to other ferdi-servers
21- [ ] Recipe update
22
23## Installation & Setup
24
25Here are some example snippets to help you get started creating a container.
26
27The docker can be run as is, with the default sqlite database, or you can modifying your ENV variables to use an external database (e.g. MYSql, MariaDB, Postgres, etc). After setting up the docker container you will need to create a NGINX reverse proxy to access Ferdi-server outside of your home network.
28
29### docker
30
31Pull the docker image:
32
33 docker pull getferdi/ferdi-server
34
35To create the docker container with the proper parameters:
36
37 docker create \
38 --name=ferdi-server \
39 -e NODE_ENV=development \
40 -e EXTERNAL_DOMAIN=<ferdi-serverdomain> \
41 -e DB_CONNECTION=<database> \
42 -e DB_HOST=<yourdbhost> \
43 -e DB_PORT=<yourdbport> \
44 -e DB_USER=<yourdbuser> \
45 -e DB_PASSWORD=<yourdbpass> \
46 -e DB_DATABASE=<yourdbdatabase> \
47 -e DB_SSL=false \
48 -e MAIL_CONNECTION=smtp \
49 -e SMPT_HOST=<smtpmailserver> \
50 -e SMTP_PORT=<smtpport> \
51 -e MAIL_SSL=true/false \
52 -e MAIL_USERNAME=<yourmailusername> \
53 -e MAIL_PASSWORD=<yourmailpassword> \
54 -e MAIL_SENDER=<sendemailaddress> \
55 -e IS_CREATION_ENABLED=true \
56 -e IS_DASHBOARD_ENABLED=true \
57 -e IS_REGISTRATION_ENABLED=true \
58 -e CONNECT_WITH_FRANZ=true \
59 -p <port>:80 \
60 -v <path to data>:/config \
61 -v <path to database>:/app/database \
62 -v <path to recipes>:/app/recipes \
63 --restart unless-stopped \
64 getferdi/ferdi-server
65
66### docker-compose
67
68 You can use sample [./docker/docker-compose.yml](https://github.com/getferdi/server/tree/master/docker/docker-compose.yml).
69 This will pull latest image from Docker Hub or use local image which you can build using instructions in [Building locally section](#Building-locally).
70
71 To start the application, use
72
73 docker-compose up
74The server will be launched at [http://localhost:3333/](http://localhost:3333/) address.
75
76## Configuration
77
78Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 3333:80` would expose port `80` from inside the container to be accessible from the host's IP on port `3333` outside the container.
79After the first run, Ferdi-server's configuration is saved inside the `config.txt` file inside your persistent data directory (`/config` in the container).
80
81| Parameter | Function |
82| :----: | --- |
83| `-p <port>:80` | will map the container's port 80 to a port on the host, default is 3333 |
84| `-e NODE_ENV=development` | for specifying Node environment, production or development, default is development |
85| `-e EXTERNAL_DOMAIN=<ferdi-serverdomain>` | for specifying external domain address of the ferdi server |
86| `-e DB_CONNECTION=sqlite` | for specifying the database being used, default is sqlite |
87| `-e DB_HOST=<yourdbhost>` | for specifying the database host, default is 127.0.0.1 |
88| `-e DB_PORT=<yourdbport>` | for specifying the database port, default is 3306 |
89| `-e DB_USER=<yourdbuser>` | for specifying the database user, default is root |
90| `-e DB_PASSWORD=<yourdbpass>` | for specifying the database password, default is password |
91| `-e DB_DATABASE=adonis` | for specifying the database to be used, adonis |
92| `-e DB_SSL=false` | true only if your database is postgres and it is hosted online on platforms like GCP, AWS, etc |
93| `-e MAIL_CONNECTION=<mailsender>` | for specifying the mail sender to be used, default is smtp |
94| `-e SMPT_HOST=<smtpmailserver>` | for specifying the mail host to be used, default is 127.0.0.1 |
95| `-e SMTP_PORT=<smtpport>` | for specifying the mail port to be used, default is 2525 |
96| `-e MAIL_SSL=true/false` | for specifying SMTP mail secuirty, default is false |
97| `-e MAIL_USERNAME=<yourmailusername>` | for specifying your mail username to be used, default is username |
98| `-e MAIL_PASSWORD=<yourmailpassword>` | for specifying your mail password to be used, default is password |
99| `-e MAIL_SENDER=<sendemailaddress` | for specifying the mail sender address to be used, default is noreply@getferdi.com |
100| `-e IS_CREATION_ENABLED=true` | for specifying whether to enable the [creation of custom recipes](#creating-and-using-custom-recipes), default is true |
101| `-e IS_DASHBOARD_ENABLED=true` | for specifying whether to enable the Ferdi-server dashboard, default is true |
102| `-e IS_REGISTRATION_ENABLED=true` | for specifying whether to allow user registration, default is true |
103| `-e CONNECT_WITH_FRANZ=true` | for specifying whether to enable connections to the Franz server, default is true |
104| `-v <path to data>:/config` | this will store persistent ENV data on the docker host |
105| `-v <path to database>:/app/database` | this will strore Ferdi-server's database on the docker host for persistence |
106| `-v <path to recipes>:/app/recipes` | this will strore Ferdi-server's recipes on the docker host for persistence |
107
108By enabling the `CONNECT_WITH_FRANZ` option, Ferdi-server can:
109 - Show the full Franz recipe library instead of only custom recipes
110 - Import Franz accounts
111
112## Supported databases and drivers
113
114To use a different database than the default, SQLite, enter the driver code below in your ENV configuration.
115
116| Database | Driver |
117| :----: | --- |
118| MariaDB | mysql |
119| MySQL | mysql |
120| PostgreSQL | pg |
121| SQLite3 | sqlite |
122
123## Supported mail connections (advanced)
124
125To use a different email sender than the default, SMTP, enter the correct information in your ENV configuration and adapt your docker run, create, or compose commands accordingly.
126
127| Mail Connection | ENV variables |
128| :----: | --- |
129| SMTP | SMTP_PORT, SMTP_HOST, MAIL_USERNAME, MAIL_PASSWORD, MAIL_SSL |
130| SparkPost | SPARKPOST_API_KEY |
131| Mailgun | MAILGUN_DOMAIN, MAILGUN_API_REGION, MAILGUN_API_KEY |
132| Ethereal | A disposable account is created automatically if you choose this option. |
133
134## NGINX config block
135To access Ferdi-server from outside of your home network on a subdomain use this server block:
136
137```
138# Ferdi-server
139server {
140 listen 443 ssl http2;
141 server_name ferdi.my.website;
142
143 # all ssl related config moved to ssl.conf
144 include /config/nginx/ssl.conf;
145
146 location / {
147 proxy_pass http://<Ferdi-IP>:3333;
148 proxy_set_header X-Real-IP $remote_addr;
149 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
150 proxy_set_header Host $host;
151 proxy_set_header X-Forwarded-Proto $scheme;
152 }
153}
154```
155
156## Importing your Franz account
157Ferdi-server allows you to import your full Franz account, including all its settings.
158
159To import your Franz account, open `http://[YOUR FERDI-SERVER]/import` in your browser and login using your Franz account details. Ferdi-server will create a new user with the same credentials and copy your Franz settings, services and workspaces.
160
161## Transferring user data
162Please refer to <https://github.com/getferdi/ferdi/wiki/Transferring-data-between-servers>
163
164## Creating and using custom recipes
165Ferdi-server allows to extends the Franz recipe catalogue with custom Ferdi recipes.
166
167For documentation on how to create a recipe, please visit [the official guide by Franz](https://github.com/meetfranz/plugins/blob/master/docs/integration.md).
168
169To add your recipe to Ferdi-server, open `http://[YOUR FERDI-SERVER]/new` in your browser. You can now define the following settings:
170- `Author`: Author who created the recipe
171- `Name`: Name for your new service. Can contain spaces and unicode characters
172- `Service ID`: Unique ID for this recipe. Does not contain spaces or special characters (e.g. `google-drive`)
173- `Link to PNG/SVG image`: Direct link to a 1024x1024 PNG image and SVG that is used as a logo inside the store. Please use jsDelivr when using a file uploaded to GitHub as raw.githubusercontent files won't load
174- `Recipe files`: Recipe files that you created using the [Franz recipe creation guide](https://github.com/meetfranz/plugins/blob/master/docs/integration.md). Please do *not* package your files beforehand - upload the raw files (you can drag and drop multiple files). ferdi-server will automatically package and store the recipe in the right format. Please also do not drag and drop or select the whole folder, select the individual files.
175
176### Listing custom recipes
177Inside Ferdi, searching for `ferdi:custom` will list all your custom recipes.
178
179## Support Info
180
181* Shell access while the container is running: `docker exec -it ferdi-server /bin/bash`
182* To monitor the logs of the container in realtime: `docker logs -f ferdi-server`
183
184## Updating Info
185
186Below are the instructions for updating the container to get the most recent version of Ferdi-server:
187
188### Via Docker Run/Create
189* Update the image: `docker pull getferdi/ferdi-server`
190* Stop the running container: `docker stop ferdi-server`
191* Delete the container: `docker rm ferdi-server`
192* Recreate a new container with the same docker create parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and your ENV settings will be preserved)
193* Start the new container: `docker start ferdi-server`
194* You can also remove the old dangling images: `docker image prune`
195
196### Via Docker Compose
197* Update all images: `docker-compose pull`
198 * or update a single image: `docker-compose pull ferdi-server`
199* Let compose update all containers as necessary: `docker-compose up -d`
200 * or update a single container: `docker-compose up -d ferdi-server`
201* You can also remove the old dangling images: `docker image prune`
202
203## Building locally
204
205If you want to make local modifications to this image for development purposes or just to customize the logic:
206```
207git clone https://github.com/getferdi/server-docker.git
208cd server-docker
209docker build \
210 --no-cache \
211 --pull \
212 -t getferdi/ferdi-server:latest .
213```
214
215## Versions
216
217* **05.02.21:** - Repository moved to ferdi-server repository
218* **19.01.21:** - Updated Mail SSL and DB SLL settings
219* **20.09.20:** - Updated SMTP Mailer settings for password reset.
220* **21.06.20:** - Rebase to Alpine 3.11 and added Mailer settings.
221* **25.09.19:** - Initial Release.
222
223## License
224Ferdi-server-docker and ferdi-server are licensed under the MIT License.