Annotate

INSTALL @ 12642:9061f9621330

Switch to a new role-based authorization framework, removing is_admin() We began moving away from simple "is this user an admin?" permission checks before 0.12, with the introduction of mod_authz_internal and the ability to dynamically change the roles of individual users. The approach in 0.12 still had various limitations however, and apart from the introduction of roles other than "admin" and the ability to pull that info from storage, not much actually changed. This new framework shakes things up a lot, though aims to maintain the same functionality and behaviour on the surface for a default Prosody configuration. That is, if you don't take advantage of any of the new features, you shouldn't notice any change. The biggest change visible to developers is that usermanager.is_admin() (and the auth provider is_admin() method) have been removed. Gone. Completely. Permission checks should now be performed using a new module API method: module:may(action_name, context) This method accepts an action name, followed by either a JID (string) or (preferably) a table containing 'origin'/'session' and 'stanza' fields (e.g. the standard object passed to most events). It will return true if the action should be permitted, or false/nil otherwise. Modules should no longer perform permission checks based on the role name. E.g. a lot of code previously checked if the user's role was prosody:admin before permitting some action. Since many roles might now exist with similar permissions, and the permissions of prosody:admin may be redefined dynamically, it is no longer suitable to use this method for permission checks. Use module:may(). If you start an action name with ':' (recommended) then the current module's name will automatically be used as a prefix. To define a new permission, use the new module API: module:default_permission(role_name, action_name) module:default_permissions(role_name, { action_name[, action_name...] }) This grants the specified role permission to execute the named action(s) by default. This may be overridden via other mechanisms external to your module. The built-in roles that developers should use are: - prosody:user (normal user) - prosody:admin (host admin) - prosody:operator (global admin) The new prosody:operator role is intended for server-wide actions (such as shutting down Prosody). Finally, all usage of is_admin() in modules has been fixed by this commit. Some of these changes were trickier than others, but no change is expected to break existing deployments. EXCEPT: mod_auth_ldap no longer supports the ldap_admin_filter option. It's very possible nobody is using this, but if someone is then we can later update it to pull roles from LDAP somehow.
author Matthew Wild <mwild1@gmail.com>
date Wed, 15 Jun 2022 12:15:01 +0100
parent 12286:ad88732eea51
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5407
c9ff345a27e7 INSTALL: Update from wiki
Matthew Wild <mwild1@gmail.com>
parents: 4885
diff changeset
1 (This file was created from
7359
a5a080c12c96 Update every link to the documentation to use HTTPS
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 5407
diff changeset
2 https://prosody.im/doc/installing_from_source on 2013-03-31)
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
4 # Installing from source
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
5
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
6 ## Dependencies
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
7
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
8 There are a couple of development packages which Prosody needs installed
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
9 before you can build it. These are:
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
11 - The [Lua](http://lua.org/) library, version 5.4 recommended
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
12 - [OpenSSL](http://openssl.org/)
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
13 - String processing library, one of
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
14 - [ICU](https://icu.unicode.org/) (recommended)
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
15 - [GNU libidn](http://www.gnu.org/software/libidn/)
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
17 These can be installed on Debian/Ubuntu by running
12286
ad88732eea51 util.dependencies: Refer to 'apt' instead of 'apt-get'
Kim Alvefur <zash@zash.se>
parents: 12222
diff changeset
18 `apt build-dep prosody` or by installing the packages
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
19 `liblua5.4-dev`, `libicu-dev` and `libssl-dev`.
4885
8df3e709f8b7 INSTALL: Update with changes from wiki.
Kim Alvefur <zash@zash.se>
parents: 1192
diff changeset
20
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
21 On Mandriva try:
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
23 urpmi lua liblua-devel libidn-devel libopenssl-devel
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
25 On Mac OS X, if you have MacPorts installed, you can try:
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
26
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
27 sudo port install lua lua-luasocket lua-luasec lua-luaexpat
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
29 On other systems... good luck, but please let us know of the best way of
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
30 getting the dependencies for your system and we can add it here.
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
31
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
32 ## configure
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
34 The first step of building is to run the configure script. This creates
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
35 a file called 'config.unix' which is used by the next step to control
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
36 aspects of the build process.
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
38 ./configure
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
40 All options to configure can be seen by running
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
42 ./configure --help
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
43
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
44 ## make
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
45
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 Once you have run configure successfully, then you can simply run:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 make
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 Simple? :-)
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
52 If you do happen to have problems at this stage, it is most likely due
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
53 to the build process not finding the dependencies. Ensure you have them
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
54 installed, and in the standard library paths for your system.
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56 For more help, just ask ;-)
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 ==== install ====
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
59
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60 At this stage you should be able to run Prosody simply with:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62 ./prosody
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
64 There is no problem with this, it is actually the easiest way to do
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
65 development, as it doesn't spread parts around your system, and you
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
66 can keep multiple versions around in their own directories without
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67 conflict.
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
68
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
69 Should you wish to install it system-wide however, simply run:
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
70
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
71 sudo make install
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
72
12222
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
73 ...it will install into /usr/local/ by default. To change this you can
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
74 pass to the initial ./configure using the 'prefix' option, or edit
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
75 config.unix directly. If the new path doesn't require root permission to
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
76 write to, you also won't need (or want) to use 'sudo' in front of the
61592927335b INSTALL: Update from site version
Kim Alvefur <zash@zash.se>
parents: 7359
diff changeset
77 'make install'.
1192
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
78
b1b42ce4f0f6 Finally add README and INSTALL files
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
79 Have fun, and see you on Jabber!