Merge pull request #10165 from nupplaphil/bug/strip_pageinfo
[friendica.git/.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 * cache:                  Manage node cache
13 * config:                 Edit site config
14 * createdoxygen:          Generate Doxygen headers
15 * dbstructure:            Do database updates
16 * docbloxerrorchecker:    Check the file tree for DocBlox errors
17 * extract:                Generate translation string file for the Friendica project (deprecated)
18 * globalcommunityblock:   Block remote profile from interacting with this node
19 * globalcommunitysilence: Silence remote profile from global community page
20 * archivecontact:         Archive a contact when you know that it isn't existing anymore
21 * help:                   Show help about a command, e.g (bin/console help config)
22 * autoinstall:            Starts automatic installation of friendica based on values from htconfig.php
23 * maintenance:            Set maintenance mode for this node
24 * newpassword:            Set a new password for a given user
25 * php2po:                 Generate a messages.po file from a strings.php file
26 * po2php:                 Generate a strings.php file from a messages.po file
27 * typo:                   Checks for parse errors in Friendica files
28 * postupdate:             Execute pending post update scripts (can last days)
29 * storage:                Manage storage backend
30 * relay:                  Manage ActivityPub relay servers
31
32 Please consult *bin/console help* on the command line interface of your server for details about the commands.
33
34 3rd Party Tools
35 ---------------
36
37 In addition to the tools Friendica includes, some 3rd party tools can make your admin days easier.
38
39 ### Fail2ban
40
41 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.
42
43 The following configuration was [provided](https://forum.friendi.ca/display/174591b4135ae40c1ad7e93897572454) by Steffen K9 using Debian.
44 You need to adjust the *logpath* in the *jail.local* file and the *bantime* (value is in seconds).
45
46 In */etc/fail2ban/jail.local* create a section for Friendica:
47
48         [friendica]
49         enabled = true
50         findtime = 300
51         bantime  = 900
52         filter = friendica
53         port = http,https
54         logpath = /var/log/friend.log
55         logencoding = utf-8
56
57 And create a filter definition in */etc/fail2ban/filter.d/friendica.conf*:
58
59         [Definition]
60         failregex = ^.*authenticate\: failed login attempt.*\"ip\"\:\"<HOST>\".*$
61         ignoreregex =
62
63 Additionally you have to define the number of failed logins before the ban should be activated.
64 This is done either in the global configuration or for each jail separately.
65 You should inform your users about the number of failed login attempts you grant them.
66 Otherwise you'll get many reports about the server not functioning if the number is too low.
67
68 ### Log rotation
69
70 If you have activated the logs in Friendica, be aware that they can grow to a significant size.
71 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.
72
73 In */etc/logrotate.d/* add a file called *friendica* that contains the configuration.
74 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.
75
76         /var/log/friendica.log {
77                 compress
78                 daily
79                 rotate 2
80         }