Show More
@@ -1,175 +1,175 b'' | |||
|
1 | 1 | .. _installation_puppet: |
|
2 | 2 | |
|
3 | 3 | =================================== |
|
4 | 4 | Installation and setup using Puppet |
|
5 | 5 | =================================== |
|
6 | 6 | |
|
7 | 7 | The whole installation and setup process of Kallithea can be simplified by |
|
8 | 8 | using Puppet and the `rauch/kallithea |
|
9 | 9 | <https://forge.puppetlabs.com/rauch/kallithea>`_ Puppet module. This is |
|
10 | 10 | especially useful for getting started quickly, without having to deal with all |
|
11 | 11 | the Python specialities. |
|
12 | 12 | |
|
13 | 13 | .. note:: The following instructions assume you are not familiar with Puppet at |
|
14 | 14 | all. If this is not the case, you should probably skip directly to the |
|
15 | 15 | `Kallithea Puppet module documentation |
|
16 | 16 | <https://forge.puppetlabs.com/rauch/kallithea#puppet-kallithea>`_. |
|
17 | 17 | |
|
18 | 18 | |
|
19 | 19 | Installing Puppet |
|
20 | 20 | ----------------- |
|
21 | 21 | |
|
22 | 22 | This installation variant requires a Unix/Linux type server with Puppet 3.0+ |
|
23 | 23 | installed. Many major distributions have Puppet in their standard repositories. |
|
24 | 24 | Thus, you will probably be ready to go by running, e.g. ``apt-get install |
|
25 | 25 | puppet`` or ``yum install puppet``, depending on your distro's favoured package |
|
26 | 26 | manager. Afterwards, check the Puppet version by running ``puppet --version`` |
|
27 | 27 | and ensure you have at least 3.0. |
|
28 | 28 | |
|
29 | 29 | If your distribution does not provide Puppet packages or you need a |
|
30 | 30 | newer version, please see the `Puppet Reference Manual |
|
31 | 31 | <https://docs.puppetlabs.com/puppet/4.2/reference/install_linux.html>`_ for |
|
32 | 32 | instructions on how to install Puppet on your target platform. |
|
33 | 33 | |
|
34 | 34 | |
|
35 | 35 | Installing the Puppet module |
|
36 | 36 | ---------------------------- |
|
37 | 37 | |
|
38 | 38 | To install the latest version of the Kallithea Puppet module from the Puppet |
|
39 | 39 | Forge, run the following as ``root``: |
|
40 | 40 | |
|
41 | 41 | .. code-block:: bash |
|
42 | 42 | |
|
43 | 43 | puppet module install rauch/kallithea |
|
44 | 44 | |
|
45 | 45 | This will install both the Kallithea Puppet module and its dependency modules. |
|
46 | 46 | |
|
47 | 47 | .. warning:: Be aware that Puppet can do all kinds of things to your systems. |
|
48 | 48 | Third-party modules (like the ``kallithea`` module) may run |
|
49 | 49 | arbitrary commands on your system (most of the time as the |
|
50 | 50 | ``root`` user), so do not apply them on production machines if |
|
51 | 51 | you don't know what you are doing. Instead, use a test system |
|
52 | 52 | (e.g. a virtual machine) for evaluation purposes. |
|
53 | 53 | |
|
54 | 54 | |
|
55 | 55 | Applying the module |
|
56 | 56 | ------------------- |
|
57 | 57 | |
|
58 | 58 | To trigger the actual installation process, we have to *apply* the |
|
59 | 59 | ``kallithea`` Puppet class, which is provided by the module we have just |
|
60 | 60 | installed, to our system. For this, create a file named e.g. ``kallithea.pp``, |
|
61 | 61 | a *Puppet manifest*, with the following content: |
|
62 | 62 | |
|
63 | 63 | .. _simple_manifest: |
|
64 | 64 | .. code-block:: puppet |
|
65 | 65 | |
|
66 | 66 | class { 'kallithea': |
|
67 | 67 | seed_db => true, |
|
68 | 68 | manage_git => true, |
|
69 | 69 | } |
|
70 | 70 | |
|
71 | 71 | To apply the manifest, simply run the following (preferably as root): |
|
72 | 72 | |
|
73 | 73 | .. code-block:: bash |
|
74 | 74 | |
|
75 | 75 | puppet apply kallithea.pp |
|
76 | 76 | |
|
77 | 77 | This will basically run through the usual Kallithea :ref:`installation` and |
|
78 | 78 | :ref:`setup` steps, as documented. Consult the module documentation for details |
|
79 | 79 | on `what the module affects |
|
80 | 80 | <https://forge.puppetlabs.com/rauch/kallithea#what-kallithea-affects>`_. You |
|
81 | 81 | can also do a *dry run* by adding the ``--noop`` option to the command. |
|
82 | 82 | |
|
83 | 83 | |
|
84 | 84 | Using parameters for customizing the setup process |
|
85 | 85 | -------------------------------------------------- |
|
86 | 86 | |
|
87 | 87 | The ``kallithea`` Puppet class provides a number of `parameters |
|
88 | 88 | <https://forge.puppetlabs.com/rauch/kallithea#class-kallithea>`_ for |
|
89 | 89 | customizing the setup process. You have seen the usage of the ``seed_db`` |
|
90 | 90 | parameter in the :ref:`example above <simple_manifest>`, but there are more. |
|
91 | 91 | For example, you can specify the installation directory, the name of the user |
|
92 | 92 | under which Kallithea gets installed, the initial admin password, etc. |
|
93 | Notably, you can provide arbitrary modifications to Kallitheas configuration | |
|
93 | Notably, you can provide arbitrary modifications to Kallithea's configuration | |
|
94 | 94 | file by means of the ``config_hash`` parameter. |
|
95 | 95 | |
|
96 | 96 | Parameters, which have not been set explicitly, will be set to default values, |
|
97 | 97 | which are defined inside the ``kallithea`` Puppet module. For example, if you |
|
98 | 98 | just stick to the defaults as in the :ref:`example above <simple_manifest>`, |
|
99 | 99 | you will end up with a Kallithea instance, which |
|
100 | 100 | |
|
101 | 101 | - is installed in ``/srv/kallithea``, owned by the user ``kallithea`` |
|
102 | 102 | - uses the Kallithea default configuration |
|
103 | 103 | - uses the admin user ``admin`` with password ``adminpw`` |
|
104 | 104 | - is started automatically and enabled on boot |
|
105 | 105 | |
|
106 | 106 | As of Kallithea 0.3.0, this in particular means that Kallithea will use an |
|
107 | 107 | SQLite database and listen on ``http://localhost:5000``. |
|
108 | 108 | |
|
109 | 109 | See also the `full parameters list |
|
110 | 110 | <https://forge.puppetlabs.com/rauch/kallithea#class-kallithea>`_ for more |
|
111 | 111 | information. |
|
112 | 112 | |
|
113 | 113 | |
|
114 | 114 | Making your Kallithea instance publicly available |
|
115 | 115 | ------------------------------------------------- |
|
116 | 116 | |
|
117 | 117 | If you followed the instructions above, the Kallithea instance will be |
|
118 | 118 | listening on ``http://localhost:5000`` and therefore not publicly available. |
|
119 | 119 | There are several ways to change this. |
|
120 | 120 | |
|
121 | 121 | The direct way |
|
122 | 122 | ^^^^^^^^^^^^^^ |
|
123 | 123 | |
|
124 | 124 | The simplest setup is to instruct Kallithea to listen on another IP address |
|
125 | 125 | and/or port by using the ``config_hash`` parameter of the Kallithea Puppet |
|
126 | 126 | class. For example, assume we want to listen on all interfaces on port 80: |
|
127 | 127 | |
|
128 | 128 | .. code-block:: puppet |
|
129 | 129 | |
|
130 | 130 | class { 'kallithea': |
|
131 | 131 | seed_db => true, |
|
132 | 132 | config_hash => { |
|
133 | 133 | "server:main" => { |
|
134 | 134 | 'host' => '0.0.0.0', |
|
135 | 135 | 'port' => '80', |
|
136 | 136 | } |
|
137 | 137 | } |
|
138 | 138 | } |
|
139 | 139 | |
|
140 | 140 | Using Apache as reverse proxy |
|
141 | 141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
142 | 142 | |
|
143 | 143 | In a more advanced setup, you might instead want use a full-blown web server |
|
144 | 144 | like Apache HTTP Server as the public web server, configured such that requests |
|
145 | 145 | are internally forwarded to the local Kallithea instance (a so called *reverse |
|
146 | 146 | proxy setup*). This can be easily done with Puppet as well: |
|
147 | 147 | |
|
148 | 148 | First, install the `puppetlabs/apache |
|
149 | 149 | <https://forge.puppetlabs.com/puppetlabs/apache>`_ Puppet module as above by running the following as root: |
|
150 | 150 | |
|
151 | 151 | .. code-block:: bash |
|
152 | 152 | |
|
153 | 153 | puppet module install puppetlabs/apache |
|
154 | 154 | |
|
155 | 155 | Then, append the following to your manifest: |
|
156 | 156 | |
|
157 | 157 | .. code-block:: puppet |
|
158 | 158 | |
|
159 | 159 | include apache |
|
160 | 160 | |
|
161 | 161 | apache::vhost { 'kallithea.example.com': |
|
162 | 162 | docroot => '/var/www/html', |
|
163 | 163 | manage_docroot => false, |
|
164 | 164 | port => 80, |
|
165 | 165 | proxy_preserve_host => true, |
|
166 | 166 | proxy_pass => [ |
|
167 | 167 | { |
|
168 | 168 | path => '/', |
|
169 | 169 | url => 'http://localhost:5000/', |
|
170 | 170 | }, |
|
171 | 171 | ], |
|
172 | 172 | } |
|
173 | 173 | |
|
174 | 174 | Applying the resulting manifest will install the Apache web server and setup a |
|
175 | 175 | virtual host acting as a reverse proxy for your local Kallithea instance. |
General Comments 0
You need to be logged in to leave comments.
Login now