]> git.mxchange.org Git - friendica.git/blob - doc/tools.md
Fixed E_NOTICE when no valid result has been returned. (#5457)
[friendica.git] / doc / tools.md
1 Admin Tools
2 ===========
3
4 * [Home](help)
5
6 Friendica Tools
7 ---------------
8
9 Friendica has a build in command console you can find in the *bin* directory.
10 The console provides the following commands:
11
12 * config:                 Edit site config
13 * createdoxygen:          Generate Doxygen headers
14 * dbstructure:            Do database updates
15 * docbloxerrorchecker:    Check the file tree for DocBlox errors
16 * extract:                Generate translation string file for the Friendica project (deprecated)
17 * globalcommunityblock:   Block remote profile from interacting with this node
18 * globalcommunitysilence: Silence remote profile from global community page
19 * archivecontact:         Archive a contact when you know that it isn't existing anymore
20 * help:                   Show help about a command, e.g (bin/console help config)
21 * autoinstall:            Starts automatic installation of friendica based on values from htconfig.php
22 * maintenance:            Set maintenance mode for this node
23 * newpassword:            Set a new password for a given user
24 * php2po:                 Generate a messages.po file from a strings.php file
25 * po2php:                 Generate a strings.php file from a messages.po file
26 * typo:                   Checks for parse errors in Friendica files
27
28 Please consult *bin/console help* on the command line interface of your server for details about the commands.
29
30 3rd Party Tools
31 ---------------
32
33 In addition to the tools Friendica includes, some 3rd party tools can make your admin days easier.
34
35 ### Fail2ban
36
37 Fail2ban is an intrusion prevention framework ([see Wikipedia](https://en.wikipedia.org/wiki/Fail2ban)) that you can use to forbid access to a server under certain conditions, e.g. 3 failed attempts to log in, for a certain amount of time.
38
39 The following configuration was [provided](https://forum.friendi.ca/display/174591b4135ae40c1ad7e93897572454) by Steffen K9 using Debian.
40 You need to adjust the *logpath* in the *jail.local* file and the *bantime* (value is in seconds).
41
42 In */etc/fail2ban/jail.local* create a section for Friendica:
43
44         [friendica]
45         enabled = true
46         findtime = 300
47         bantime  = 900
48         filter = friendica
49         port = http,https
50         logpath = /var/log/friend.log
51         logencoding = utf-8
52
53 And create a filter definition in */etc/fail2ban/filter.d/friendica.conf*:
54
55         [Definition]
56         failregex = ^.*Login\.php.*failed login attempt.*from IP <HOST>.*$
57         ignoreregex =
58
59 Additionally you have to define the number of failed logins before the ban should be activated.
60 This is done either in the global configuration or for each jail separately.
61 You should inform your users about the number of failed login attempts you grant them.
62 Otherwise you'll get many reports about the server not functioning if the number is too low.
63
64 ### Log rotation
65
66 If you have activated the logs in Friendica, be aware that they can grow to a significant size.
67 To keep them in control you should add them to the automatic [log rotation](https://en.wikipedia.org/wiki/Log_rotation), e.g. using the *logrotate* command.
68
69 In */etc/logrotate.d/* add a file called *friendica* that contains the configuration.
70 The following will compress */var/log/friendica* (assuming this is the location of the log file) on a daily basis and keep 2 days of back-log.
71
72         /var/log/friendica.log {
73                 compress
74                 daily
75                 rotate 2
76         }