Show More
@@ -1,31 +1,31 b'' | |||||
1 | .. _lab-settings: |
|
1 | .. _lab-settings: | |
2 |
|
2 | |||
3 | Lab Settings |
|
3 | Lab Settings | |
4 | ============ |
|
4 | ============ | |
5 |
|
5 | |||
6 | |RCE| Lab Settings is for delivering features which may require an additional |
|
6 | |RCE| Lab Settings is for delivering features which may require an additional | |
7 | level of support to optimize for production scenarios. To enable lab settings, |
|
7 | level of support to optimize for production scenarios. To enable lab settings, | |
8 | use the following instructions: |
|
8 | use the following instructions: | |
9 |
|
9 | |||
10 | 1. Open the |RCE| configuration file, |
|
10 | 1. Open the |RCE| configuration file, | |
11 |
:file:` |
|
11 | :file:`config/_shared/rhodecode.ini` | |
12 |
|
12 | |||
13 | 2. Add the following configuration option in the ``[app:main]`` section. |
|
13 | 2. Add the following configuration option in the ``[app:main]`` section. | |
14 |
|
14 | |||
15 | .. code-block:: bash |
|
15 | .. code-block:: bash | |
16 |
|
16 | |||
17 | [app:main] |
|
17 | [app:main] | |
18 |
|
18 | |||
19 | ## Display extended labs settings |
|
19 | ## Display extended labs settings | |
20 | labs_settings_active = true |
|
20 | labs_settings_active = true | |
21 |
|
21 | |||
22 | 3. Restart your |RCE| instance |
|
22 | 3. Restart your |RCE| instance | |
23 |
|
23 | |||
24 | .. code-block:: bash |
|
24 | .. code-block:: bash | |
25 |
|
25 | |||
26 | $ rccontrol restart enterprise-1 |
|
26 | $ rccontrol restart enterprise-1 | |
27 |
|
27 | |||
28 | 4. You will see the labs setting on the |
|
28 | 4. You will see the labs setting on the | |
29 | :menuselection:`Admin --> Settings --> labs` page. |
|
29 | :menuselection:`Admin --> Settings --> labs` page. | |
30 |
|
30 | |||
31 | .. image:: ../images/lab-setting.png |
|
31 | .. image:: ../images/lab-setting.png |
@@ -1,57 +1,57 b'' | |||||
1 | .. _x-frame: |
|
1 | .. _x-frame: | |
2 |
|
2 | |||
3 | Securing HTTPS Connections |
|
3 | Securing HTTPS Connections | |
4 | -------------------------- |
|
4 | -------------------------- | |
5 |
|
5 | |||
6 | * To secure your |RCE| instance against `Cross Frame Scripting`_ exploits, you |
|
6 | * To secure your |RCE| instance against `Cross Frame Scripting`_ exploits, you | |
7 | should configure your webserver ``x-frame-options`` setting. |
|
7 | should configure your webserver ``x-frame-options`` setting. | |
8 |
|
8 | |||
9 | * To configure your instance for `HTTP Strict Transport Security`_, you need to |
|
9 | * To configure your instance for `HTTP Strict Transport Security`_, you need to | |
10 | configure the ``Strict-Transport-Security`` setting. |
|
10 | configure the ``Strict-Transport-Security`` setting. | |
11 |
|
11 | |||
12 | Nginx |
|
12 | Nginx | |
13 | ^^^^^ |
|
13 | ^^^^^ | |
14 |
|
14 | |||
15 | In your nginx configuration, add the following lines in the correct files. For |
|
15 | In your nginx configuration, add the following lines in the correct files. For | |
16 | more detailed information see the :ref:`nginx-ws-ref` section. |
|
16 | more detailed information see the :ref:`nginx-ws-ref` section. | |
17 |
|
17 | |||
18 | .. code-block:: nginx |
|
18 | .. code-block:: nginx | |
19 |
|
19 | |||
20 | # Add this line to the nginx.conf file |
|
20 | # Add this line to the nginx.conf file | |
21 | add_header X-Frame-Options SAMEORIGIN; |
|
21 | add_header X-Frame-Options SAMEORIGIN; | |
22 |
|
22 | |||
23 | # This line needs to be added inside your virtual hosts block/file |
|
23 | # This line needs to be added inside your virtual hosts block/file | |
24 | add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; |
|
24 | add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; | |
25 |
|
25 | |||
26 | Apache |
|
26 | Apache | |
27 | ^^^^^^ |
|
27 | ^^^^^^ | |
28 |
|
28 | |||
29 | In your :file:`apache2.conf` file, add the following line. For more detailed |
|
29 | In your :file:`apache2.conf` file, add the following line. For more detailed | |
30 | information see the :ref:`apache-ws-ref` section. |
|
30 | information see the :ref:`apache-ws-ref` section. | |
31 |
|
31 | |||
32 | .. code-block:: apache |
|
32 | .. code-block:: apache | |
33 |
|
33 | |||
34 | # Add this to your virtual hosts file |
|
34 | # Add this to your virtual hosts file | |
35 | Header always append X-Frame-Options SAMEORIGIN |
|
35 | Header always append X-Frame-Options SAMEORIGIN | |
36 |
|
36 | |||
37 | # Add this line in your virtual hosts file |
|
37 | # Add this line in your virtual hosts file | |
38 | Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" |
|
38 | Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" | |
39 |
|
39 | |||
40 | |RCE| Configuration |
|
40 | |RCE| Configuration | |
41 | ^^^^^^^^^^^^^^^^^^^ |
|
41 | ^^^^^^^^^^^^^^^^^^^ | |
42 |
|
42 | |||
43 | |RCE| can also be configured to force strict *https* connections and Strict |
|
43 | |RCE| can also be configured to force strict *https* connections and Strict | |
44 | Transport Security. To set this, configure the following options to ``true`` |
|
44 | Transport Security. To set this, configure the following options to ``true`` | |
45 |
in the :file:` |
|
45 | in the :file:`config/_shared/rhodecode.ini` file. | |
46 |
|
46 | |||
47 | .. code-block:: ini |
|
47 | .. code-block:: ini | |
48 |
|
48 | |||
49 | ## force https in RhodeCode, fixes https redirects, assumes it's always https |
|
49 | ## force https in RhodeCode, fixes https redirects, assumes it's always https | |
50 | force_https = false |
|
50 | force_https = false | |
51 |
|
51 | |||
52 | ## use Strict-Transport-Security headers |
|
52 | ## use Strict-Transport-Security headers | |
53 | use_htsts = false |
|
53 | use_htsts = false | |
54 |
|
54 | |||
55 |
|
55 | |||
56 | .. _Cross Frame Scripting: https://www.owasp.org/index.php/Cross_Frame_Scripting |
|
56 | .. _Cross Frame Scripting: https://www.owasp.org/index.php/Cross_Frame_Scripting | |
57 | .. _HTTP Strict Transport Security: https://www.owasp.org/index.php/HTTP_Strict_Transport_Security No newline at end of file |
|
57 | .. _HTTP Strict Transport Security: https://www.owasp.org/index.php/HTTP_Strict_Transport_Security |
@@ -1,179 +1,179 b'' | |||||
1 | .. _sec-your-server: |
|
1 | .. _sec-your-server: | |
2 |
|
2 | |||
3 | Securing Your Server |
|
3 | Securing Your Server | |
4 | -------------------- |
|
4 | -------------------- | |
5 |
|
5 | |||
6 | |RCE| runs on your hardware, and while it is developed with security in mind |
|
6 | |RCE| runs on your hardware, and while it is developed with security in mind | |
7 | it is also important that you ensure your servers are well secured. In this |
|
7 | it is also important that you ensure your servers are well secured. In this | |
8 | section we will cover some basic security practices that are best to |
|
8 | section we will cover some basic security practices that are best to | |
9 | configure when setting up your |RCE| instances. |
|
9 | configure when setting up your |RCE| instances. | |
10 |
|
10 | |||
11 | SSH Keys |
|
11 | SSH Keys | |
12 | ^^^^^^^^ |
|
12 | ^^^^^^^^ | |
13 |
|
13 | |||
14 | Using SSH keys to access your server provides more security than using the |
|
14 | Using SSH keys to access your server provides more security than using the | |
15 | standard username and password combination. To set up your SSH Keys, use the |
|
15 | standard username and password combination. To set up your SSH Keys, use the | |
16 | following steps: |
|
16 | following steps: | |
17 |
|
17 | |||
18 | 1. On your local machine create the public/private key combination. The |
|
18 | 1. On your local machine create the public/private key combination. The | |
19 | private key you will keep, and the matching public key is copied to the |
|
19 | private key you will keep, and the matching public key is copied to the | |
20 | server. Setting a passphrase here is optional, if you set one you will |
|
20 | server. Setting a passphrase here is optional, if you set one you will | |
21 | always be prompted for it when logging in. |
|
21 | always be prompted for it when logging in. | |
22 |
|
22 | |||
23 | .. code-block:: bash |
|
23 | .. code-block:: bash | |
24 |
|
24 | |||
25 | # Generate SSH Keys |
|
25 | # Generate SSH Keys | |
26 | user@ubuntu:~$ ssh-keygen -t rsa |
|
26 | user@ubuntu:~$ ssh-keygen -t rsa | |
27 |
|
27 | |||
28 | .. code-block:: bash |
|
28 | .. code-block:: bash | |
29 |
|
29 | |||
30 | Generating public/private rsa key pair. |
|
30 | Generating public/private rsa key pair. | |
31 | Enter file in which to save the key (/home/user/.ssh/id_rsa): |
|
31 | Enter file in which to save the key (/home/user/.ssh/id_rsa): | |
32 | Created directory '/home/user/.ssh'. |
|
32 | Created directory '/home/user/.ssh'. | |
33 | Enter passphrase (empty for no passphrase): |
|
33 | Enter passphrase (empty for no passphrase): | |
34 | Enter same passphrase again: |
|
34 | Enter same passphrase again: | |
35 | Your identification has been saved in /home/user/.ssh/id_rsa. |
|
35 | Your identification has been saved in /home/user/.ssh/id_rsa. | |
36 | Your public key has been saved in /home/user/.ssh/id_rsa.pub. |
|
36 | Your public key has been saved in /home/user/.ssh/id_rsa.pub. | |
37 | The key fingerprint is: |
|
37 | The key fingerprint is: | |
38 | 02:82:38:95:e5:30:d2:ad:17:60:15:7f:94:17:9f:30 user@ubuntu |
|
38 | 02:82:38:95:e5:30:d2:ad:17:60:15:7f:94:17:9f:30 user@ubuntu | |
39 | The key\'s randomart image is: |
|
39 | The key\'s randomart image is: | |
40 | +--[ RSA 2048]----+ |
|
40 | +--[ RSA 2048]----+ | |
41 |
|
41 | |||
42 | 2. SFTP to your server, and copy the public key to the ``~/.ssh`` folder. |
|
42 | 2. SFTP to your server, and copy the public key to the ``~/.ssh`` folder. | |
43 |
|
43 | |||
44 | .. code-block:: bash |
|
44 | .. code-block:: bash | |
45 |
|
45 | |||
46 | # SFTP to your server |
|
46 | # SFTP to your server | |
47 | $ sftp user@hostname |
|
47 | $ sftp user@hostname | |
48 |
|
48 | |||
49 | # copy your public key |
|
49 | # copy your public key | |
50 | sftp> mput /home/user/.ssh/id_rsa.pub /home/user/.ssh |
|
50 | sftp> mput /home/user/.ssh/id_rsa.pub /home/user/.ssh | |
51 | Uploading /home/user/.ssh/id_rsa.pub to /home/user/.ssh/id_rsa.pub |
|
51 | Uploading /home/user/.ssh/id_rsa.pub to /home/user/.ssh/id_rsa.pub | |
52 | /home/user/.ssh/id_rsa.pub 100% 394 0.4KB/s 00:00 |
|
52 | /home/user/.ssh/id_rsa.pub 100% 394 0.4KB/s 00:00 | |
53 |
|
53 | |||
54 | 3. On your server, add the public key to the :file:`~/.ssh/authorized_keys` |
|
54 | 3. On your server, add the public key to the :file:`~/.ssh/authorized_keys` | |
55 | file. |
|
55 | file. | |
56 |
|
56 | |||
57 | .. code-block:: bash |
|
57 | .. code-block:: bash | |
58 |
|
58 | |||
59 | $ cat /home/user/.ssh/id_rsa.pub > /home/user/.ssh/authorized_keys |
|
59 | $ cat /home/user/.ssh/id_rsa.pub > /home/user/.ssh/authorized_keys | |
60 |
|
60 | |||
61 | You should now be able to log into your server using your SSH |
|
61 | You should now be able to log into your server using your SSH | |
62 | Keys. If you've added a passphrase you'll be asked for it. For more |
|
62 | Keys. If you've added a passphrase you'll be asked for it. For more | |
63 | information about using SSH keys with |RCE| |repos|, see the |
|
63 | information about using SSH keys with |RCE| |repos|, see the | |
64 | :ref:`ssh-connection` section. |
|
64 | :ref:`ssh-connection` section. | |
65 |
|
65 | |||
66 | VPN Whitelist |
|
66 | VPN Whitelist | |
67 | ^^^^^^^^^^^^^ |
|
67 | ^^^^^^^^^^^^^ | |
68 |
|
68 | |||
69 | Most company networks will have a VPN. If you need to set one up, there are |
|
69 | Most company networks will have a VPN. If you need to set one up, there are | |
70 | many tutorials online for how to do that. Getting it right requires good |
|
70 | many tutorials online for how to do that. Getting it right requires good | |
71 | knowledge and attention to detail. Once set up, you can configure your |
|
71 | knowledge and attention to detail. Once set up, you can configure your | |
72 | |RCE| instances to only allow user access from the VPN, to do this see the |
|
72 | |RCE| instances to only allow user access from the VPN, to do this see the | |
73 | :ref:`settip-ip-white` section. |
|
73 | :ref:`settip-ip-white` section. | |
74 |
|
74 | |||
75 | Public Key Infrastructure and SSL/TLS Encryption |
|
75 | Public Key Infrastructure and SSL/TLS Encryption | |
76 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
76 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
77 |
|
77 | |||
78 | Public key infrastructure (PKI) is a system that creates, manages, and |
|
78 | Public key infrastructure (PKI) is a system that creates, manages, and | |
79 | validates certificates for identifying nodes on a network and encrypting |
|
79 | validates certificates for identifying nodes on a network and encrypting | |
80 | communication between them. SSL or TLS certificates can be used to |
|
80 | communication between them. SSL or TLS certificates can be used to | |
81 | authenticate different entities with one another. To read more about PKIs, |
|
81 | authenticate different entities with one another. To read more about PKIs, | |
82 | see the `OpenSSL PKI tutorial`_ site, or this `Cloudflare PKI post`_. |
|
82 | see the `OpenSSL PKI tutorial`_ site, or this `Cloudflare PKI post`_. | |
83 |
|
83 | |||
84 | If the network you are running is SSL/TLS encrypted, you can configure |RCE| |
|
84 | If the network you are running is SSL/TLS encrypted, you can configure |RCE| | |
85 | to always use secure connections using the ``force_https`` and ``use_htsts`` |
|
85 | to always use secure connections using the ``force_https`` and ``use_htsts`` | |
86 |
options in the :file:` |
|
86 | options in the :file:`config/_shared/rhodecode.ini` file. | |
87 | For more details, see the :ref:`x-frame` section. |
|
87 | For more details, see the :ref:`x-frame` section. | |
88 |
|
88 | |||
89 | FireWalls and Ports |
|
89 | FireWalls and Ports | |
90 | ^^^^^^^^^^^^^^^^^^^ |
|
90 | ^^^^^^^^^^^^^^^^^^^ | |
91 |
|
91 | |||
92 | Setting up a network firewall for your internal traffic is a good way |
|
92 | Setting up a network firewall for your internal traffic is a good way | |
93 | of keeping it secure by blocking off any ports that should not be used. |
|
93 | of keeping it secure by blocking off any ports that should not be used. | |
94 | Additionally, you can set non-default ports for certain functions which adds |
|
94 | Additionally, you can set non-default ports for certain functions which adds | |
95 | an extra layer of security to your setup. |
|
95 | an extra layer of security to your setup. | |
96 |
|
96 | |||
97 | A well configured firewall will restrict access to everything except the |
|
97 | A well configured firewall will restrict access to everything except the | |
98 | services you need to remain open. By exposing fewer services you reduce the |
|
98 | services you need to remain open. By exposing fewer services you reduce the | |
99 | number of potential vulnerabilities. |
|
99 | number of potential vulnerabilities. | |
100 |
|
100 | |||
101 | There are a number of different firewall solutions, but for most Linux systems |
|
101 | There are a number of different firewall solutions, but for most Linux systems | |
102 | using the built in `IpTables`_ firewall should suffice. On BSD systems you |
|
102 | using the built in `IpTables`_ firewall should suffice. On BSD systems you | |
103 | can use `IPFILTER`_ or `IPFW`_. Use the following examples, and the IpTables |
|
103 | can use `IPFILTER`_ or `IPFW`_. Use the following examples, and the IpTables | |
104 | documentation to configure your IP Tables on Ubuntu. |
|
104 | documentation to configure your IP Tables on Ubuntu. | |
105 |
|
105 | |||
106 | Changing the default SSH port. |
|
106 | Changing the default SSH port. | |
107 |
|
107 | |||
108 | .. code-block:: bash |
|
108 | .. code-block:: bash | |
109 |
|
109 | |||
110 | # Open SSH config file and change to port 10022 |
|
110 | # Open SSH config file and change to port 10022 | |
111 | vi /etc/ssh/sshd_config |
|
111 | vi /etc/ssh/sshd_config | |
112 |
|
112 | |||
113 | # What ports, IPs and protocols we listen for |
|
113 | # What ports, IPs and protocols we listen for | |
114 | Port 10022 |
|
114 | Port 10022 | |
115 |
|
115 | |||
116 | Setting IP Table rules for SSH traffic. It is important to note that the |
|
116 | Setting IP Table rules for SSH traffic. It is important to note that the | |
117 | default policy of your IpTables can differ and it is worth checking how each |
|
117 | default policy of your IpTables can differ and it is worth checking how each | |
118 | is configured. The options are *ACCEPT*, *REJECT*, *DROP*, or *LOG*. The |
|
118 | is configured. The options are *ACCEPT*, *REJECT*, *DROP*, or *LOG*. The | |
119 | usual practice is to block access on all ports and then enable access only on |
|
119 | usual practice is to block access on all ports and then enable access only on | |
120 | the ports you with to expose. |
|
120 | the ports you with to expose. | |
121 |
|
121 | |||
122 | .. code-block:: bash |
|
122 | .. code-block:: bash | |
123 |
|
123 | |||
124 | # Check iptables policy |
|
124 | # Check iptables policy | |
125 | $ sudo iptables -L |
|
125 | $ sudo iptables -L | |
126 |
|
126 | |||
127 | Chain INPUT (policy ACCEPT) |
|
127 | Chain INPUT (policy ACCEPT) | |
128 | target prot opt source destination |
|
128 | target prot opt source destination | |
129 |
|
129 | |||
130 | Chain FORWARD (policy ACCEPT) |
|
130 | Chain FORWARD (policy ACCEPT) | |
131 | target prot opt source destination |
|
131 | target prot opt source destination | |
132 |
|
132 | |||
133 | Chain OUTPUT (policy ACCEPT) |
|
133 | Chain OUTPUT (policy ACCEPT) | |
134 | target prot opt source destination |
|
134 | target prot opt source destination | |
135 |
|
135 | |||
136 | # Close all ports by default |
|
136 | # Close all ports by default | |
137 | $ sudo iptables -P INPUT DROP |
|
137 | $ sudo iptables -P INPUT DROP | |
138 |
|
138 | |||
139 | $ sudo iptables -L |
|
139 | $ sudo iptables -L | |
140 | Chain INPUT (policy DROP) |
|
140 | Chain INPUT (policy DROP) | |
141 | target prot opt source destination |
|
141 | target prot opt source destination | |
142 | DROP all -- anywhere anywhere |
|
142 | DROP all -- anywhere anywhere | |
143 |
|
143 | |||
144 | Chain FORWARD (policy ACCEPT) |
|
144 | Chain FORWARD (policy ACCEPT) | |
145 | target prot opt source destination |
|
145 | target prot opt source destination | |
146 |
|
146 | |||
147 | Chain OUTPUT (policy ACCEPT) |
|
147 | Chain OUTPUT (policy ACCEPT) | |
148 | target prot opt source destination |
|
148 | target prot opt source destination | |
149 |
|
149 | |||
150 | .. code-block:: bash |
|
150 | .. code-block:: bash | |
151 |
|
151 | |||
152 | # Deny outbound SSH traffic |
|
152 | # Deny outbound SSH traffic | |
153 | sudo iptables -A OUTPUT -p tcp --dport 10022 -j DROP |
|
153 | sudo iptables -A OUTPUT -p tcp --dport 10022 -j DROP | |
154 |
|
154 | |||
155 | # Allow incoming SSH traffic on port 10022 |
|
155 | # Allow incoming SSH traffic on port 10022 | |
156 | sudo iptables -A INPUT -p tcp --dport 10022 -j ACCEPT |
|
156 | sudo iptables -A INPUT -p tcp --dport 10022 -j ACCEPT | |
157 |
|
157 | |||
158 | # Allow incoming HTML traffic on port 80 and 443 |
|
158 | # Allow incoming HTML traffic on port 80 and 443 | |
159 | iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT |
|
159 | iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT | |
160 | iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT |
|
160 | iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT | |
161 |
|
161 | |||
162 | Saving your IP Table rules, and restoring them from file. |
|
162 | Saving your IP Table rules, and restoring them from file. | |
163 |
|
163 | |||
164 | .. code-block:: bash |
|
164 | .. code-block:: bash | |
165 |
|
165 | |||
166 | # Save you IP Table Rules |
|
166 | # Save you IP Table Rules | |
167 | iptables-save |
|
167 | iptables-save | |
168 |
|
168 | |||
169 | # Save your IP Table Rules to a file |
|
169 | # Save your IP Table Rules to a file | |
170 | sudo sh -c "iptables-save > /etc/iptables.rules" |
|
170 | sudo sh -c "iptables-save > /etc/iptables.rules" | |
171 |
|
171 | |||
172 | # Restore your IP Table rules from file |
|
172 | # Restore your IP Table rules from file | |
173 | iptables-restore < /etc/iptables.rules |
|
173 | iptables-restore < /etc/iptables.rules | |
174 |
|
174 | |||
175 | .. _OpenSSL PKI tutorial: https://pki-tutorial.readthedocs.org/en/latest/# |
|
175 | .. _OpenSSL PKI tutorial: https://pki-tutorial.readthedocs.org/en/latest/# | |
176 | .. _Cloudflare PKI post: https://blog.cloudflare.com/how-to-build-your-own-public-key-infrastructure/ |
|
176 | .. _Cloudflare PKI post: https://blog.cloudflare.com/how-to-build-your-own-public-key-infrastructure/ | |
177 | .. _IpTables: https://help.ubuntu.com/community/IptablesHowTo |
|
177 | .. _IpTables: https://help.ubuntu.com/community/IptablesHowTo | |
178 | .. _IPFW: https://www.freebsd.org/doc/handbook/firewalls-ipfw.html |
|
178 | .. _IPFW: https://www.freebsd.org/doc/handbook/firewalls-ipfw.html | |
179 | .. _IPFILTER: https://www.freebsd.org/doc/handbook/firewalls-ipf.html |
|
179 | .. _IPFILTER: https://www.freebsd.org/doc/handbook/firewalls-ipf.html |
@@ -1,172 +1,172 b'' | |||||
1 | .. _system-overview-ref: |
|
1 | .. _system-overview-ref: | |
2 |
|
2 | |||
3 | System Overview |
|
3 | System Overview | |
4 | =============== |
|
4 | =============== | |
5 |
|
5 | |||
6 | Latest Version |
|
6 | Latest Version | |
7 | -------------- |
|
7 | -------------- | |
8 |
|
8 | |||
9 | * |release| on Unix and Windows systems. |
|
9 | * |release| on Unix and Windows systems. | |
10 |
|
10 | |||
11 | System Architecture |
|
11 | System Architecture | |
12 | ------------------- |
|
12 | ------------------- | |
13 |
|
13 | |||
14 | The following diagram shows a typical production architecture. |
|
14 | The following diagram shows a typical production architecture. | |
15 |
|
15 | |||
16 | .. image:: ../images/architecture-diagram.png |
|
16 | .. image:: ../images/architecture-diagram.png | |
17 | :align: center |
|
17 | :align: center | |
18 |
|
18 | |||
19 | Supported Operating Systems |
|
19 | Supported Operating Systems | |
20 | --------------------------- |
|
20 | --------------------------- | |
21 |
|
21 | |||
22 | Linux |
|
22 | Linux | |
23 | ^^^^^ |
|
23 | ^^^^^ | |
24 |
|
24 | |||
25 | * Ubuntu 14.04+ |
|
25 | * Ubuntu 14.04+ | |
26 | * CentOS 6.2, 7 and 8 |
|
26 | * CentOS 6.2, 7 and 8 | |
27 | * RHEL 6.2, 7 and 8 |
|
27 | * RHEL 6.2, 7 and 8 | |
28 | * Debian 7.8 |
|
28 | * Debian 7.8 | |
29 | * RedHat Fedora |
|
29 | * RedHat Fedora | |
30 | * Arch Linux |
|
30 | * Arch Linux | |
31 | * SUSE Linux |
|
31 | * SUSE Linux | |
32 |
|
32 | |||
33 | Windows |
|
33 | Windows | |
34 | ^^^^^^^ |
|
34 | ^^^^^^^ | |
35 |
|
35 | |||
36 | * Windows Vista Ultimate 64bit |
|
36 | * Windows Vista Ultimate 64bit | |
37 | * Windows 7 Ultimate 64bit |
|
37 | * Windows 7 Ultimate 64bit | |
38 | * Windows 8 Professional 64bit |
|
38 | * Windows 8 Professional 64bit | |
39 | * Windows 8.1 Enterprise 64bit |
|
39 | * Windows 8.1 Enterprise 64bit | |
40 | * Windows Server 2008 64bit |
|
40 | * Windows Server 2008 64bit | |
41 | * Windows Server 2008-R2 64bit |
|
41 | * Windows Server 2008-R2 64bit | |
42 | * Windows Server 2012 64bit |
|
42 | * Windows Server 2012 64bit | |
43 |
|
43 | |||
44 | Supported Databases |
|
44 | Supported Databases | |
45 | ------------------- |
|
45 | ------------------- | |
46 |
|
46 | |||
47 | * SQLite |
|
47 | * SQLite | |
48 | * MySQL |
|
48 | * MySQL | |
49 | * MariaDB |
|
49 | * MariaDB | |
50 | * PostgreSQL |
|
50 | * PostgreSQL | |
51 |
|
51 | |||
52 | Supported Browsers |
|
52 | Supported Browsers | |
53 | ------------------ |
|
53 | ------------------ | |
54 |
|
54 | |||
55 | * Chrome |
|
55 | * Chrome | |
56 | * Safari |
|
56 | * Safari | |
57 | * Firefox |
|
57 | * Firefox | |
58 | * Internet Explorer 10 & 11 |
|
58 | * Internet Explorer 10 & 11 | |
59 |
|
59 | |||
60 | System Requirements |
|
60 | System Requirements | |
61 | ------------------- |
|
61 | ------------------- | |
62 |
|
62 | |||
63 | |RCE| performs best on machines with ultra-fast hard disks. Generally disk |
|
63 | |RCE| performs best on machines with ultra-fast hard disks. Generally disk | |
64 | performance is more important than CPU performance. In a corporate production |
|
64 | performance is more important than CPU performance. In a corporate production | |
65 | environment handling 1000s of users and |repos| you should deploy on a 12+ |
|
65 | environment handling 1000s of users and |repos| you should deploy on a 12+ | |
66 | core 64GB RAM server. In short, the more RAM the better. |
|
66 | core 64GB RAM server. In short, the more RAM the better. | |
67 |
|
67 | |||
68 |
|
68 | |||
69 | For example: |
|
69 | For example: | |
70 |
|
70 | |||
71 | - for team of 1 - 5 active users you can run on 1GB RAM machine with 1CPU |
|
71 | - for team of 1 - 5 active users you can run on 1GB RAM machine with 1CPU | |
72 | - above 250 active users, |RCE| needs at least 8GB of memory. |
|
72 | - above 250 active users, |RCE| needs at least 8GB of memory. | |
73 | Number of CPUs is less important, but recommended to have at least 2-3 CPUs |
|
73 | Number of CPUs is less important, but recommended to have at least 2-3 CPUs | |
74 |
|
74 | |||
75 |
|
75 | |||
76 | .. _config-rce-files: |
|
76 | .. _config-rce-files: | |
77 |
|
77 | |||
78 | Configuration Files |
|
78 | Configuration Files | |
79 | ------------------- |
|
79 | ------------------- | |
80 |
|
80 | |||
81 |
* :file:` |
|
81 | * :file:`config/_shared/rhodecode.ini` | |
82 | * :file:`/home/{user}/.rccontrol/{instance-id}/search_mapping.ini` |
|
82 | * :file:`/home/{user}/.rccontrol/{instance-id}/search_mapping.ini` | |
83 | * :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` |
|
83 | * :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` | |
84 | * :file:`/home/{user}/.rccontrol/supervisor/supervisord.ini` |
|
84 | * :file:`/home/{user}/.rccontrol/supervisor/supervisord.ini` | |
85 | * :file:`/home/{user}/.rccontrol.ini` |
|
85 | * :file:`/home/{user}/.rccontrol.ini` | |
86 | * :file:`/home/{user}/.rhoderc` |
|
86 | * :file:`/home/{user}/.rhoderc` | |
87 | * :file:`/home/{user}/.rccontrol/cache/MANIFEST` |
|
87 | * :file:`/home/{user}/.rccontrol/cache/MANIFEST` | |
88 |
|
88 | |||
89 | For more information, see the :ref:`config-files` section. |
|
89 | For more information, see the :ref:`config-files` section. | |
90 |
|
90 | |||
91 | Log Files |
|
91 | Log Files | |
92 | --------- |
|
92 | --------- | |
93 |
|
93 | |||
94 | * :file:`/home/{user}/.rccontrol/{instance-id}/enterprise.log` |
|
94 | * :file:`/home/{user}/.rccontrol/{instance-id}/enterprise.log` | |
95 | * :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.log` |
|
95 | * :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.log` | |
96 | * :file:`/home/{user}/.rccontrol/supervisor/supervisord.log` |
|
96 | * :file:`/home/{user}/.rccontrol/supervisor/supervisord.log` | |
97 | * :file:`/tmp/rccontrol.log` |
|
97 | * :file:`/tmp/rccontrol.log` | |
98 | * :file:`/tmp/rhodecode_tools.log` |
|
98 | * :file:`/tmp/rhodecode_tools.log` | |
99 |
|
99 | |||
100 | Storage Files |
|
100 | Storage Files | |
101 | ------------- |
|
101 | ------------- | |
102 |
|
102 | |||
103 | * :file:`/home/{user}/.rccontrol/{instance-id}/data/index/{index-file.toc}` |
|
103 | * :file:`/home/{user}/.rccontrol/{instance-id}/data/index/{index-file.toc}` | |
104 | * :file:`/home/{user}/repos/.rc_gist_store` |
|
104 | * :file:`/home/{user}/repos/.rc_gist_store` | |
105 | * :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.db` |
|
105 | * :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.db` | |
106 | * :file:`/opt/rhodecode/store/{unique-hash}` |
|
106 | * :file:`/opt/rhodecode/store/{unique-hash}` | |
107 |
|
107 | |||
108 | Default Repositories Location |
|
108 | Default Repositories Location | |
109 | ----------------------------- |
|
109 | ----------------------------- | |
110 |
|
110 | |||
111 | * :file:`/home/{user}/repos` |
|
111 | * :file:`/home/{user}/repos` | |
112 |
|
112 | |||
113 | Connection Methods |
|
113 | Connection Methods | |
114 | ------------------ |
|
114 | ------------------ | |
115 |
|
115 | |||
116 | * HTTPS |
|
116 | * HTTPS | |
117 | * SSH |
|
117 | * SSH | |
118 | * |RCE| API |
|
118 | * |RCE| API | |
119 |
|
119 | |||
120 | Internationalization Support |
|
120 | Internationalization Support | |
121 | ---------------------------- |
|
121 | ---------------------------- | |
122 |
|
122 | |||
123 | Currently available in the following languages, see `Transifex`_ for the |
|
123 | Currently available in the following languages, see `Transifex`_ for the | |
124 | latest details. If you want a new language added, please contact us. To |
|
124 | latest details. If you want a new language added, please contact us. To | |
125 | configure your language settings, see the :ref:`set-lang` section. |
|
125 | configure your language settings, see the :ref:`set-lang` section. | |
126 |
|
126 | |||
127 | .. hlist:: |
|
127 | .. hlist:: | |
128 |
|
128 | |||
129 | * Belorussian |
|
129 | * Belorussian | |
130 | * Chinese |
|
130 | * Chinese | |
131 | * French |
|
131 | * French | |
132 | * German |
|
132 | * German | |
133 | * Italian |
|
133 | * Italian | |
134 | * Japanese |
|
134 | * Japanese | |
135 | * Portuguese |
|
135 | * Portuguese | |
136 | * Polish |
|
136 | * Polish | |
137 | * Russian |
|
137 | * Russian | |
138 | * Spanish |
|
138 | * Spanish | |
139 |
|
139 | |||
140 | Licencing Information |
|
140 | Licencing Information | |
141 | --------------------- |
|
141 | --------------------- | |
142 |
|
142 | |||
143 | * See licencing information `here`_ |
|
143 | * See licencing information `here`_ | |
144 |
|
144 | |||
145 | Peer-to-peer Failover Support |
|
145 | Peer-to-peer Failover Support | |
146 | ----------------------------- |
|
146 | ----------------------------- | |
147 |
|
147 | |||
148 | * Yes |
|
148 | * Yes | |
149 |
|
149 | |||
150 | Additional Binaries |
|
150 | Additional Binaries | |
151 | ------------------- |
|
151 | ------------------- | |
152 |
|
152 | |||
153 | * Yes, see :ref:`rhodecode-nix-ref` for full details. |
|
153 | * Yes, see :ref:`rhodecode-nix-ref` for full details. | |
154 |
|
154 | |||
155 | Remote Connectivity |
|
155 | Remote Connectivity | |
156 | ------------------- |
|
156 | ------------------- | |
157 |
|
157 | |||
158 | * Available |
|
158 | * Available | |
159 |
|
159 | |||
160 | Executable Files |
|
160 | Executable Files | |
161 | ---------------- |
|
161 | ---------------- | |
162 |
|
162 | |||
163 | Windows: :file:`RhodeCode-installer-{version}.exe` |
|
163 | Windows: :file:`RhodeCode-installer-{version}.exe` | |
164 |
|
164 | |||
165 | Deprecated Support |
|
165 | Deprecated Support | |
166 | ------------------ |
|
166 | ------------------ | |
167 |
|
167 | |||
168 | - Internet Explorer 8 support deprecated since version 3.7.0. |
|
168 | - Internet Explorer 8 support deprecated since version 3.7.0. | |
169 | - Internet Explorer 9 support deprecated since version 3.8.0. |
|
169 | - Internet Explorer 9 support deprecated since version 3.8.0. | |
170 |
|
170 | |||
171 | .. _here: https://rhodecode.com/licenses/ |
|
171 | .. _here: https://rhodecode.com/licenses/ | |
172 | .. _Transifex: https://explore.transifex.com/rhodecode/RhodeCode/ |
|
172 | .. _Transifex: https://explore.transifex.com/rhodecode/RhodeCode/ |
@@ -1,300 +1,300 b'' | |||||
1 | .. _admin-tricks: |
|
1 | .. _admin-tricks: | |
2 |
|
2 | |||
3 | One-time Admin Tasks |
|
3 | One-time Admin Tasks | |
4 | -------------------- |
|
4 | -------------------- | |
5 |
|
5 | |||
6 | * :ref:`web-analytics` |
|
6 | * :ref:`web-analytics` | |
7 | * :ref:`admin-tricks-license` |
|
7 | * :ref:`admin-tricks-license` | |
8 | * :ref:`announcements` |
|
8 | * :ref:`announcements` | |
9 | * :ref:`md-rst` |
|
9 | * :ref:`md-rst` | |
10 | * :ref:`repo-stats` |
|
10 | * :ref:`repo-stats` | |
11 | * :ref:`server-side-merge` |
|
11 | * :ref:`server-side-merge` | |
12 | * :ref:`remap-rescan` |
|
12 | * :ref:`remap-rescan` | |
13 | * :ref:`custom-hooks` |
|
13 | * :ref:`custom-hooks` | |
14 | * :ref:`clear-repo-cache` |
|
14 | * :ref:`clear-repo-cache` | |
15 | * :ref:`set-repo-pub` |
|
15 | * :ref:`set-repo-pub` | |
16 | * :ref:`ping` |
|
16 | * :ref:`ping` | |
17 |
|
17 | |||
18 | .. _web-analytics: |
|
18 | .. _web-analytics: | |
19 |
|
19 | |||
20 | Adding Web Analytics |
|
20 | Adding Web Analytics | |
21 | ^^^^^^^^^^^^^^^^^^^^ |
|
21 | ^^^^^^^^^^^^^^^^^^^^ | |
22 |
|
22 | |||
23 | If you wish to add a Google Analytics, or any other kind of tracker to your |
|
23 | If you wish to add a Google Analytics, or any other kind of tracker to your | |
24 | |RCE| instance you can add the necessary codes to the header or footer |
|
24 | |RCE| instance you can add the necessary codes to the header or footer | |
25 | section of each instance using the following steps: |
|
25 | section of each instance using the following steps: | |
26 |
|
26 | |||
27 | 1. From the |RCE| interface, select |
|
27 | 1. From the |RCE| interface, select | |
28 | :menuselection:`Admin --> Settings --> Global` |
|
28 | :menuselection:`Admin --> Settings --> Global` | |
29 | 2. To add a tracking code to you instance, enter it in the header or footer |
|
29 | 2. To add a tracking code to you instance, enter it in the header or footer | |
30 | section and select **Save** |
|
30 | section and select **Save** | |
31 |
|
31 | |||
32 | Use the example templates in the drop-down menu to set up your configuration. |
|
32 | Use the example templates in the drop-down menu to set up your configuration. | |
33 |
|
33 | |||
34 | .. _admin-tricks-license: |
|
34 | .. _admin-tricks-license: | |
35 |
|
35 | |||
36 | Licence Key Management |
|
36 | Licence Key Management | |
37 | ^^^^^^^^^^^^^^^^^^^^^^ |
|
37 | ^^^^^^^^^^^^^^^^^^^^^^ | |
38 |
|
38 | |||
39 | To manage your license key, go to |
|
39 | To manage your license key, go to | |
40 | :menuselection:`Admin --> Settings --> License`. |
|
40 | :menuselection:`Admin --> Settings --> License`. | |
41 | On this page you can see the license key details. If you need a new license, |
|
41 | On this page you can see the license key details. If you need a new license, | |
42 | or have questions about your current one, contact support@rhodecode.com |
|
42 | or have questions about your current one, contact support@rhodecode.com | |
43 |
|
43 | |||
44 | .. _announcements: |
|
44 | .. _announcements: | |
45 |
|
45 | |||
46 | Server-wide Announcements |
|
46 | Server-wide Announcements | |
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
48 |
|
48 | |||
49 | If you need to make a server-wide announcement to all users, |
|
49 | If you need to make a server-wide announcement to all users, | |
50 | you can add a message to be displayed using the following steps: |
|
50 | you can add a message to be displayed using the following steps: | |
51 |
|
51 | |||
52 | 1. From the |RCE| interface, select |
|
52 | 1. From the |RCE| interface, select | |
53 | :menuselection:`Admin --> Settings --> Global` |
|
53 | :menuselection:`Admin --> Settings --> Global` | |
54 | 2. To add a message that will be displayed to all users, |
|
54 | 2. To add a message that will be displayed to all users, | |
55 | select :guilabel:`Server Announcement` from the drop-down menu and |
|
55 | select :guilabel:`Server Announcement` from the drop-down menu and | |
56 | change the ``var message = "TYPE YOUR MESSAGE HERE";`` example line. |
|
56 | change the ``var message = "TYPE YOUR MESSAGE HERE";`` example line. | |
57 | 3. Select :guilabel:`Save`, and you will see the message once your page |
|
57 | 3. Select :guilabel:`Save`, and you will see the message once your page | |
58 | refreshes. |
|
58 | refreshes. | |
59 |
|
59 | |||
60 | .. image:: ../../images/server-wide-announcement.png |
|
60 | .. image:: ../../images/server-wide-announcement.png | |
61 | :alt: Server Wide Announcement |
|
61 | :alt: Server Wide Announcement | |
62 |
|
62 | |||
63 | .. _md-rst: |
|
63 | .. _md-rst: | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | Suppress license warnings or errors |
|
66 | Suppress license warnings or errors | |
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
68 |
|
68 | |||
69 | In case you're running on maximum allowed users, RhodeCode will display a |
|
69 | In case you're running on maximum allowed users, RhodeCode will display a | |
70 | warning message on pages that you're close to the license limits. |
|
70 | warning message on pages that you're close to the license limits. | |
71 | It's often not desired to show that all the time. Here's how you can suppress |
|
71 | It's often not desired to show that all the time. Here's how you can suppress | |
72 | the license messages. |
|
72 | the license messages. | |
73 |
|
73 | |||
74 | 1. From the |RCE| interface, select |
|
74 | 1. From the |RCE| interface, select | |
75 | :menuselection:`Admin --> Settings --> Global` |
|
75 | :menuselection:`Admin --> Settings --> Global` | |
76 | 2. Select :guilabel:`Flash message filtering` from the drop-down menu. |
|
76 | 2. Select :guilabel:`Flash message filtering` from the drop-down menu. | |
77 | 3. Select :guilabel:`Save`, and you will no longer see the license message |
|
77 | 3. Select :guilabel:`Save`, and you will no longer see the license message | |
78 | once your page refreshes. |
|
78 | once your page refreshes. | |
79 |
|
79 | |||
80 | .. _admin-tricks-suppress-license-messages: |
|
80 | .. _admin-tricks-suppress-license-messages: | |
81 |
|
81 | |||
82 |
|
82 | |||
83 | Markdown or RST Rendering |
|
83 | Markdown or RST Rendering | |
84 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
84 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
85 |
|
85 | |||
86 | |RCE| can use `Markdown`_ or `reStructured Text`_ in commit message, |
|
86 | |RCE| can use `Markdown`_ or `reStructured Text`_ in commit message, | |
87 | code review messages, and inline comments. To set the default to either, |
|
87 | code review messages, and inline comments. To set the default to either, | |
88 | select your preference from the drop-down menu on the |
|
88 | select your preference from the drop-down menu on the | |
89 | :menuselection:`Admin --> Settings --> Visual` page and select |
|
89 | :menuselection:`Admin --> Settings --> Visual` page and select | |
90 | :guilabel:`Save settings`. |
|
90 | :guilabel:`Save settings`. | |
91 |
|
91 | |||
92 | .. _repo-stats: |
|
92 | .. _repo-stats: | |
93 |
|
93 | |||
94 | Enabling Repository Statistics |
|
94 | Enabling Repository Statistics | |
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
96 |
|
96 | |||
97 | To enable |repo| statistics, use the following steps: |
|
97 | To enable |repo| statistics, use the following steps: | |
98 |
|
98 | |||
99 | 1. From the |RCE| interface, open |
|
99 | 1. From the |RCE| interface, open | |
100 | :menuselection:`Admin --> Repositories` and select |
|
100 | :menuselection:`Admin --> Repositories` and select | |
101 | :guilabel:`Edit` beside the |repo| for which you wish to enable statistics. |
|
101 | :guilabel:`Edit` beside the |repo| for which you wish to enable statistics. | |
102 | 2. Check the :guilabel:`Enable statistics` box, and select :guilabel:`Save` |
|
102 | 2. Check the :guilabel:`Enable statistics` box, and select :guilabel:`Save` | |
103 |
|
103 | |||
104 | .. _server-side-merge: |
|
104 | .. _server-side-merge: | |
105 |
|
105 | |||
106 | Enabling Server-side Merging |
|
106 | Enabling Server-side Merging | |
107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
108 |
|
108 | |||
109 | To enable server-side merging, use the following steps: |
|
109 | To enable server-side merging, use the following steps: | |
110 |
|
110 | |||
111 | 1. From the |RCE| interface, open :menuselection:`Admin --> Settings --> VCS` |
|
111 | 1. From the |RCE| interface, open :menuselection:`Admin --> Settings --> VCS` | |
112 | 2. Check the :guilabel:`Server-side merge` box, and select |
|
112 | 2. Check the :guilabel:`Server-side merge` box, and select | |
113 | :guilabel:`Save Settings` |
|
113 | :guilabel:`Save Settings` | |
114 |
|
114 | |||
115 | If you encounter slow performance with server-side merging enabled, check the |
|
115 | If you encounter slow performance with server-side merging enabled, check the | |
116 | speed at which your server is performing actions. When server-side merging is |
|
116 | speed at which your server is performing actions. When server-side merging is | |
117 | enabled, the following actions occurs on the server. |
|
117 | enabled, the following actions occurs on the server. | |
118 |
|
118 | |||
119 | * A |pr| is created in the database. |
|
119 | * A |pr| is created in the database. | |
120 | * A shadow |repo| is created as a working environment for the |pr|. |
|
120 | * A shadow |repo| is created as a working environment for the |pr|. | |
121 | * On display, |RCE| checks if the |pr| can be merged. |
|
121 | * On display, |RCE| checks if the |pr| can be merged. | |
122 |
|
122 | |||
123 | To check how fast the shadow |repo| creation is occurring on your server, use |
|
123 | To check how fast the shadow |repo| creation is occurring on your server, use | |
124 | the following steps: |
|
124 | the following steps: | |
125 |
|
125 | |||
126 | 1. Log into your server and create a directory in your |repos| folder. |
|
126 | 1. Log into your server and create a directory in your |repos| folder. | |
127 | 2. Clone a |repo| that is showing slow performance and time the action. |
|
127 | 2. Clone a |repo| that is showing slow performance and time the action. | |
128 |
|
128 | |||
129 | .. code-block:: bash |
|
129 | .. code-block:: bash | |
130 |
|
130 | |||
131 | # One option is to use the time command |
|
131 | # One option is to use the time command | |
132 | $ time hg clone SOURCE_REPO TARGET |
|
132 | $ time hg clone SOURCE_REPO TARGET | |
133 |
|
133 | |||
134 | .. _remap-rescan: |
|
134 | .. _remap-rescan: | |
135 |
|
135 | |||
136 | Remap and Rescan Repositories |
|
136 | Remap and Rescan Repositories | |
137 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
137 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
138 |
|
138 | |||
139 | You may want to Remap and rescan the |repos| that |RCE| is managing to ensure |
|
139 | You may want to Remap and rescan the |repos| that |RCE| is managing to ensure | |
140 | the system is always up-to-date. This is useful after importing, deleting, |
|
140 | the system is always up-to-date. This is useful after importing, deleting, | |
141 | or carrying out general cleaning up operations. To do this use the |
|
141 | or carrying out general cleaning up operations. To do this use the | |
142 | following steps: |
|
142 | following steps: | |
143 |
|
143 | |||
144 | 1. From the |RCE|, open |
|
144 | 1. From the |RCE|, open | |
145 | :menuselection:`Admin --> Settings --> Remap and rescan` |
|
145 | :menuselection:`Admin --> Settings --> Remap and rescan` | |
146 | 2. Click :guilabel:`Rescan Repositories` |
|
146 | 2. Click :guilabel:`Rescan Repositories` | |
147 |
|
147 | |||
148 | Check the additional options if needed: |
|
148 | Check the additional options if needed: | |
149 |
|
149 | |||
150 | * :guilabel:`Destroy old data`: Useful for purging deleted repository |
|
150 | * :guilabel:`Destroy old data`: Useful for purging deleted repository | |
151 | information from the database. |
|
151 | information from the database. | |
152 | * :guilabel:`Invalidate cache for all repositories`: Use this to completely |
|
152 | * :guilabel:`Invalidate cache for all repositories`: Use this to completely | |
153 | remap all |repos|. Useful when importing or migrating |repos| to ensure all |
|
153 | remap all |repos|. Useful when importing or migrating |repos| to ensure all | |
154 | new information is picked up. |
|
154 | new information is picked up. | |
155 |
|
155 | |||
156 | .. _custom-hooks: |
|
156 | .. _custom-hooks: | |
157 |
|
157 | |||
158 | Adding Custom Hooks |
|
158 | Adding Custom Hooks | |
159 | ^^^^^^^^^^^^^^^^^^^ |
|
159 | ^^^^^^^^^^^^^^^^^^^ | |
160 |
|
160 | |||
161 | To add custom hooks to your instance, use the following steps: |
|
161 | To add custom hooks to your instance, use the following steps: | |
162 |
|
162 | |||
163 | 1. Open :menuselection:`Admin --> Settings --> Hooks` |
|
163 | 1. Open :menuselection:`Admin --> Settings --> Hooks` | |
164 | 2. Add your custom hook details, you can use a file path to specify custom |
|
164 | 2. Add your custom hook details, you can use a file path to specify custom | |
165 | hook scripts, for example: |
|
165 | hook scripts, for example: | |
166 | ``pretxnchangegroup.example`` with value ``python:/path/to/custom_hook.py:my_func_name`` |
|
166 | ``pretxnchangegroup.example`` with value ``python:/path/to/custom_hook.py:my_func_name`` | |
167 | 3. Select :guilabel:`Save` |
|
167 | 3. Select :guilabel:`Save` | |
168 |
|
168 | |||
169 | Also, see the RhodeCode Extensions section of the :ref:`rc-tools` guide. RhodeCode |
|
169 | Also, see the RhodeCode Extensions section of the :ref:`rc-tools` guide. RhodeCode | |
170 | Extensions can be used to add additional hooks to your instance and comes |
|
170 | Extensions can be used to add additional hooks to your instance and comes | |
171 | with a number of pre-built plugins if you chose to install them. |
|
171 | with a number of pre-built plugins if you chose to install them. | |
172 |
|
172 | |||
173 | .. _clear-repo-cache: |
|
173 | .. _clear-repo-cache: | |
174 |
|
174 | |||
175 | Clearing |repo| cache |
|
175 | Clearing |repo| cache | |
176 | ^^^^^^^^^^^^^^^^^^^^^ |
|
176 | ^^^^^^^^^^^^^^^^^^^^^ | |
177 |
|
177 | |||
178 | If you need to clear the cache for a particular |repo|, use the following steps: |
|
178 | If you need to clear the cache for a particular |repo|, use the following steps: | |
179 |
|
179 | |||
180 | 1. Open :menuselection:`Admin --> Repositories` and select :guilabel:`Edit` |
|
180 | 1. Open :menuselection:`Admin --> Repositories` and select :guilabel:`Edit` | |
181 | beside the |repo| whose cache you wish to clear. |
|
181 | beside the |repo| whose cache you wish to clear. | |
182 | 2. On the |repo| settings page, go to the :guilabel:`Caches` tab and select |
|
182 | 2. On the |repo| settings page, go to the :guilabel:`Caches` tab and select | |
183 | :guilabel:`Invalidate repository cache`. |
|
183 | :guilabel:`Invalidate repository cache`. | |
184 |
|
184 | |||
185 | .. _set-lang: |
|
185 | .. _set-lang: | |
186 |
|
186 | |||
187 | Changing Default Language |
|
187 | Changing Default Language | |
188 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
188 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
189 |
|
189 | |||
190 | To change the default language of a |RCE| instance, change the language code |
|
190 | To change the default language of a |RCE| instance, change the language code | |
191 |
in the :file:` |
|
191 | in the :file:`config/_shared/rhodecode.ini` file. To | |
192 | do this, use the following steps. |
|
192 | do this, use the following steps. | |
193 |
|
193 | |||
194 | 1. Open the :file:`rhodecode.ini` file and set the required language code. |
|
194 | 1. Open the :file:`rhodecode.ini` file and set the required language code. | |
195 |
|
195 | |||
196 | .. code-block:: ini |
|
196 | .. code-block:: ini | |
197 |
|
197 | |||
198 | ## Optional Languages |
|
198 | ## Optional Languages | |
199 | ## en(default), de, fr, it, ja, pl, pt, ru, zh |
|
199 | ## en(default), de, fr, it, ja, pl, pt, ru, zh | |
200 | lang = de |
|
200 | lang = de | |
201 |
|
201 | |||
202 | 2. Restart the |RCE| instance and check that the language has been updated. |
|
202 | 2. Restart the |RCE| instance and check that the language has been updated. | |
203 |
|
203 | |||
204 | .. code-block:: bash |
|
204 | .. code-block:: bash | |
205 |
|
205 | |||
206 | $ rccontrol restart enterprise-2 |
|
206 | $ rccontrol restart enterprise-2 | |
207 | Instance "enterprise-2" successfully stopped. |
|
207 | Instance "enterprise-2" successfully stopped. | |
208 | Instance "enterprise-2" successfully started. |
|
208 | Instance "enterprise-2" successfully started. | |
209 |
|
209 | |||
210 | .. image:: ../../images/language.png |
|
210 | .. image:: ../../images/language.png | |
211 |
|
211 | |||
212 | .. _set-repo-pub: |
|
212 | .. _set-repo-pub: | |
213 |
|
213 | |||
214 | Setting Repositories to Publish |
|
214 | Setting Repositories to Publish | |
215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
216 |
|
216 | |||
217 | To automatically promote your local |repos| to public after pushing to |RCE|, |
|
217 | To automatically promote your local |repos| to public after pushing to |RCE|, | |
218 | enable the :guilabel:`Set repositories as publishing` option on the |
|
218 | enable the :guilabel:`Set repositories as publishing` option on the | |
219 | :menuselection:`Admin --> Settings --> VCS` page. |
|
219 | :menuselection:`Admin --> Settings --> VCS` page. | |
220 |
|
220 | |||
221 | .. note:: |
|
221 | .. note:: | |
222 |
|
222 | |||
223 | This option is enabled by default on most |RCE| versions, but if upgrading |
|
223 | This option is enabled by default on most |RCE| versions, but if upgrading | |
224 | from a 1.7.x version it could be disabled on upgrade due to inheriting |
|
224 | from a 1.7.x version it could be disabled on upgrade due to inheriting | |
225 | older default settings. |
|
225 | older default settings. | |
226 |
|
226 | |||
227 | .. _ping: |
|
227 | .. _ping: | |
228 |
|
228 | |||
229 | Pinging the |RCE| Server |
|
229 | Pinging the |RCE| Server | |
230 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
|
230 | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
231 |
|
231 | |||
232 | You can check the IP Address of your |RCE| instance using the |
|
232 | You can check the IP Address of your |RCE| instance using the | |
233 | following URL: ``{instance-URL}/_admin/ping``. |
|
233 | following URL: ``{instance-URL}/_admin/ping``. | |
234 |
|
234 | |||
235 | .. code-block:: bash |
|
235 | .. code-block:: bash | |
236 |
|
236 | |||
237 | $ curl https://your.rhodecode.url/_admin/ping |
|
237 | $ curl https://your.rhodecode.url/_admin/ping | |
238 | pong[rce-7880] => 203.0.113.23 |
|
238 | pong[rce-7880] => 203.0.113.23 | |
239 |
|
239 | |||
240 | .. _Markdown: http://daringfireball.net/projects/markdown/ |
|
240 | .. _Markdown: http://daringfireball.net/projects/markdown/ | |
241 | .. _reStructured Text: http://docutils.sourceforge.io/docs/index.html |
|
241 | .. _reStructured Text: http://docutils.sourceforge.io/docs/index.html | |
242 |
|
242 | |||
243 |
|
243 | |||
244 | Unarchiving a repository |
|
244 | Unarchiving a repository | |
245 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
245 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
246 |
|
246 | |||
247 | Archive operation for the repository is similar as delete. Archive keeps the data for future references |
|
247 | Archive operation for the repository is similar as delete. Archive keeps the data for future references | |
248 | but makes the repository read-only. After archiving the repository it shouldn't be modified in any way. |
|
248 | but makes the repository read-only. After archiving the repository it shouldn't be modified in any way. | |
249 | This is why repository settings are disabled for an archived repository. |
|
249 | This is why repository settings are disabled for an archived repository. | |
250 |
|
250 | |||
251 | If there's a need for unarchiving a repository for some reasons, the interactive |
|
251 | If there's a need for unarchiving a repository for some reasons, the interactive | |
252 | ishell interface should be used. |
|
252 | ishell interface should be used. | |
253 |
|
253 | |||
254 | .. code-block:: bash |
|
254 | .. code-block:: bash | |
255 |
|
255 | |||
256 | # Open iShell from the terminal |
|
256 | # Open iShell from the terminal | |
257 | $ rccontrol ishell enterprise-1/community-1 |
|
257 | $ rccontrol ishell enterprise-1/community-1 | |
258 |
|
258 | |||
259 | .. code-block:: python |
|
259 | .. code-block:: python | |
260 |
|
260 | |||
261 | # Set repository as un-archived |
|
261 | # Set repository as un-archived | |
262 | In [1]: repo = Repository.get_by_repo_name('SOME_REPO_NAME') |
|
262 | In [1]: repo = Repository.get_by_repo_name('SOME_REPO_NAME') | |
263 | In [2]: repo.archived = False |
|
263 | In [2]: repo.archived = False | |
264 | In [3]: Session().add(repo);Session().commit() |
|
264 | In [3]: Session().add(repo);Session().commit() | |
265 |
|
265 | |||
266 |
|
266 | |||
267 |
|
267 | |||
268 |
|
268 | |||
269 | Bulk change repository owner |
|
269 | Bulk change repository owner | |
270 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
270 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
271 |
|
271 | |||
272 | Here's how one can change an owner of repository for an user who has been de activated. |
|
272 | Here's how one can change an owner of repository for an user who has been de activated. | |
273 | Settings a new owner can be done via ishell for all repositories that past owner had. |
|
273 | Settings a new owner can be done via ishell for all repositories that past owner had. | |
274 |
|
274 | |||
275 | do run this script the interactive ishell interface should be used. |
|
275 | do run this script the interactive ishell interface should be used. | |
276 |
|
276 | |||
277 | .. code-block:: bash |
|
277 | .. code-block:: bash | |
278 |
|
278 | |||
279 | # Open iShell from the terminal |
|
279 | # Open iShell from the terminal | |
280 | $ rccontrol ishell enterprise-1/community-1 |
|
280 | $ rccontrol ishell enterprise-1/community-1 | |
281 |
|
281 | |||
282 |
|
282 | |||
283 | .. code-block:: python |
|
283 | .. code-block:: python | |
284 |
|
284 | |||
285 | from rhodecode.model.db import User, Repository, Session |
|
285 | from rhodecode.model.db import User, Repository, Session | |
286 | from rhodecode.model.permission import PermissionModel |
|
286 | from rhodecode.model.permission import PermissionModel | |
287 |
|
287 | |||
288 | # replace old-owner and new-owner with your exact users |
|
288 | # replace old-owner and new-owner with your exact users | |
289 | old_owner = User.get_by_username('old-owner') |
|
289 | old_owner = User.get_by_username('old-owner') | |
290 | new_owner = User.get_by_username('new-owner') |
|
290 | new_owner = User.get_by_username('new-owner') | |
291 |
|
291 | |||
292 | # list of users we need to "flush" permissions |
|
292 | # list of users we need to "flush" permissions | |
293 | affected_user_ids = [new_owner.user_id, old_owner.user_id] |
|
293 | affected_user_ids = [new_owner.user_id, old_owner.user_id] | |
294 |
|
294 | |||
295 | for repo in Repository.get_all_repos(user_id=old_owner.user_id): |
|
295 | for repo in Repository.get_all_repos(user_id=old_owner.user_id): | |
296 | repo.user = new_owner |
|
296 | repo.user = new_owner | |
297 | Session().add(repo) |
|
297 | Session().add(repo) | |
298 | Session().commit() |
|
298 | Session().commit() | |
299 |
|
299 | |||
300 | PermissionModel().trigger_permission_flush(affected_user_ids) |
|
300 | PermissionModel().trigger_permission_flush(affected_user_ids) |
@@ -1,74 +1,74 b'' | |||||
1 | .. _config-files: |
|
1 | .. _config-files: | |
2 |
|
2 | |||
3 | Configuration Files Overview |
|
3 | Configuration Files Overview | |
4 | ============================ |
|
4 | ============================ | |
5 |
|
5 | |||
6 | |RCE| and |RCC| have a number of different configuration files. The following |
|
6 | |RCE| and |RCC| have a number of different configuration files. The following | |
7 | is a brief explanation of each, and links to their associated configuration |
|
7 | is a brief explanation of each, and links to their associated configuration | |
8 | sections. |
|
8 | sections. | |
9 |
|
9 | |||
10 | .. rst-class:: dl-horizontal |
|
10 | .. rst-class:: dl-horizontal | |
11 |
|
11 | |||
12 | \- **rhodecode.ini** |
|
12 | \- **rhodecode.ini** | |
13 | Default location: |
|
13 | Default location: | |
14 |
:file:` |
|
14 | :file:`config/_shared/rhodecode.ini` | |
15 |
|
15 | |||
16 | This is the main |RCE| configuration file and controls much of its |
|
16 | This is the main |RCE| configuration file and controls much of its | |
17 | default behaviour. It is also used to configure certain customer |
|
17 | default behaviour. It is also used to configure certain customer | |
18 | settings. Here are some of the most common reasons to make changes to |
|
18 | settings. Here are some of the most common reasons to make changes to | |
19 | this file. |
|
19 | this file. | |
20 |
|
20 | |||
21 | * :ref:`config-database` |
|
21 | * :ref:`config-database` | |
22 | * :ref:`set-up-mail` |
|
22 | * :ref:`set-up-mail` | |
23 | * :ref:`increase-gunicorn` |
|
23 | * :ref:`increase-gunicorn` | |
24 | * :ref:`x-frame` |
|
24 | * :ref:`x-frame` | |
25 |
|
25 | |||
26 | \- **search_mapping.ini** |
|
26 | \- **search_mapping.ini** | |
27 | Default location: |
|
27 | Default location: | |
28 | :file:`/home/{user}/.rccontrol/{instance-id}/search_mapping.ini` |
|
28 | :file:`/home/{user}/.rccontrol/{instance-id}/search_mapping.ini` | |
29 |
|
29 | |||
30 | This file is used to control the |RCE| indexer. It comes configured |
|
30 | This file is used to control the |RCE| indexer. It comes configured | |
31 | to index your instance. To change the default configuration, see |
|
31 | to index your instance. To change the default configuration, see | |
32 | :ref:`advanced-indexing`. |
|
32 | :ref:`advanced-indexing`. | |
33 |
|
33 | |||
34 | \- **vcsserver.ini** |
|
34 | \- **vcsserver.ini** | |
35 | Default location: |
|
35 | Default location: | |
36 | :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` |
|
36 | :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` | |
37 |
|
37 | |||
38 | The VCS Server handles the connection between your |repos| and |RCE|. |
|
38 | The VCS Server handles the connection between your |repos| and |RCE|. | |
39 | See the :ref:`vcs-server` section for configuration options and more |
|
39 | See the :ref:`vcs-server` section for configuration options and more | |
40 | detailed information. |
|
40 | detailed information. | |
41 |
|
41 | |||
42 | \- **supervisord.ini** |
|
42 | \- **supervisord.ini** | |
43 | Default location: |
|
43 | Default location: | |
44 | :file:`/home/{user}/.rccontrol/supervisor/supervisord.ini` |
|
44 | :file:`/home/{user}/.rccontrol/supervisor/supervisord.ini` | |
45 |
|
45 | |||
46 | |RCC| uses Supervisor to monitor and manage installed instances of |
|
46 | |RCC| uses Supervisor to monitor and manage installed instances of | |
47 | |RCE| and the VCS Server. |RCC| will manage this file completely, |
|
47 | |RCE| and the VCS Server. |RCC| will manage this file completely, | |
48 | unless you install |RCE| in self-managed mode. For more information, |
|
48 | unless you install |RCE| in self-managed mode. For more information, | |
49 | see the :ref:`Supervisor Setup<control:supervisor-setup>` section. |
|
49 | see the :ref:`Supervisor Setup<control:supervisor-setup>` section. | |
50 |
|
50 | |||
51 | \- **.rccontrol.ini** |
|
51 | \- **.rccontrol.ini** | |
52 | Default location: :file:`/home/{user}/.rccontrol.ini` |
|
52 | Default location: :file:`/home/{user}/.rccontrol.ini` | |
53 |
|
53 | |||
54 | This file contains the instances that |RCC| starts at boot, which is all |
|
54 | This file contains the instances that |RCC| starts at boot, which is all | |
55 | by default, but for more information, see |
|
55 | by default, but for more information, see | |
56 | the :ref:`Manually Start At Boot <control:set-start-boot>` section. |
|
56 | the :ref:`Manually Start At Boot <control:set-start-boot>` section. | |
57 |
|
57 | |||
58 | \- **.rhoderc** |
|
58 | \- **.rhoderc** | |
59 | Default location: :file:`/home/{user}/.rhoderc` |
|
59 | Default location: :file:`/home/{user}/.rhoderc` | |
60 |
|
60 | |||
61 | This file is used by the |RCE| API when accessing an instance from a |
|
61 | This file is used by the |RCE| API when accessing an instance from a | |
62 | remote machine. The API checks this file for connection and |
|
62 | remote machine. The API checks this file for connection and | |
63 | authentication details. For more details, see the :ref:`config-rhoderc` |
|
63 | authentication details. For more details, see the :ref:`config-rhoderc` | |
64 | section. |
|
64 | section. | |
65 |
|
65 | |||
66 | \- **MANIFEST** |
|
66 | \- **MANIFEST** | |
67 | Default location: :file:`/home/{user}/.rccontrol/cache/MANIFEST` |
|
67 | Default location: :file:`/home/{user}/.rccontrol/cache/MANIFEST` | |
68 |
|
68 | |||
69 | |RCC| uses this file to source the latest available builds from the |
|
69 | |RCC| uses this file to source the latest available builds from the | |
70 | secure RhodeCode download channels. The only reason to mess with this file |
|
70 | secure RhodeCode download channels. The only reason to mess with this file | |
71 | is if you need to do an offline installation, |
|
71 | is if you need to do an offline installation, | |
72 | see the :ref:`Offline Installation<control:offline-installer-ref>` |
|
72 | see the :ref:`Offline Installation<control:offline-installer-ref>` | |
73 | instructions, otherwise |RCC| will completely manage this file. |
|
73 | instructions, otherwise |RCC| will completely manage this file. | |
74 |
|
74 |
@@ -1,148 +1,148 b'' | |||||
1 | .. _debug-mode: |
|
1 | .. _debug-mode: | |
2 |
|
2 | |||
3 | Enabling Debug Mode |
|
3 | Enabling Debug Mode | |
4 | ------------------- |
|
4 | ------------------- | |
5 |
|
5 | |||
6 | Debug Mode will enable debug logging, and request tracking middleware. Debug Mode |
|
6 | Debug Mode will enable debug logging, and request tracking middleware. Debug Mode | |
7 | enabled DEBUG log-level which allows tracking various information about authentication |
|
7 | enabled DEBUG log-level which allows tracking various information about authentication | |
8 | failures, LDAP connection, email etc. |
|
8 | failures, LDAP connection, email etc. | |
9 |
|
9 | |||
10 | The request tracking will add a special |
|
10 | The request tracking will add a special | |
11 | unique ID: `| req_id:00000000-0000-0000-0000-000000000000` at the end of each log line. |
|
11 | unique ID: `| req_id:00000000-0000-0000-0000-000000000000` at the end of each log line. | |
12 | The req_id is the same for each individual requests, it means that if you want to |
|
12 | The req_id is the same for each individual requests, it means that if you want to | |
13 | track particular user logs only, and exclude other concurrent ones |
|
13 | track particular user logs only, and exclude other concurrent ones | |
14 | simply grep by `req_id` uuid which you'll have to find for the individual request. |
|
14 | simply grep by `req_id` uuid which you'll have to find for the individual request. | |
15 |
|
15 | |||
16 | To enable debug mode on a |RCE| instance you need to set the debug property |
|
16 | To enable debug mode on a |RCE| instance you need to set the debug property | |
17 |
in the :file:` |
|
17 | in the :file:`config/_shared/rhodecode.ini` file. To | |
18 | do this, use the following steps |
|
18 | do this, use the following steps | |
19 |
|
19 | |||
20 | 1. Open the file and set the ``debug`` line to ``true`` |
|
20 | 1. Open the file and set the ``debug`` line to ``true`` | |
21 | 2. Restart you instance using the ``rccontrol restart`` command, |
|
21 | 2. Restart you instance using the ``rccontrol restart`` command, | |
22 | see the following example: |
|
22 | see the following example: | |
23 |
|
23 | |||
24 | .. code-block:: ini |
|
24 | .. code-block:: ini | |
25 |
|
25 | |||
26 | [DEFAULT] |
|
26 | [DEFAULT] | |
27 | debug = true |
|
27 | debug = true | |
28 |
|
28 | |||
29 | .. code-block:: bash |
|
29 | .. code-block:: bash | |
30 |
|
30 | |||
31 | # Restart your instance |
|
31 | # Restart your instance | |
32 | $ rccontrol restart enterprise-1 |
|
32 | $ rccontrol restart enterprise-1 | |
33 | Instance "enterprise-1" successfully stopped. |
|
33 | Instance "enterprise-1" successfully stopped. | |
34 | Instance "enterprise-1" successfully started. |
|
34 | Instance "enterprise-1" successfully started. | |
35 |
|
35 | |||
36 |
|
36 | |||
37 | Debug and Logging Configuration |
|
37 | Debug and Logging Configuration | |
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
39 |
|
39 | |||
40 | Further debugging and logging settings can also be set in the |
|
40 | Further debugging and logging settings can also be set in the | |
41 |
:file:` |
|
41 | :file:`config/_shared/rhodecode.ini` file. | |
42 |
|
42 | |||
43 | In the logging section, the various packages that run with |RCE| can have |
|
43 | In the logging section, the various packages that run with |RCE| can have | |
44 | different debug levels set. If you want to increase the logging level change |
|
44 | different debug levels set. If you want to increase the logging level change | |
45 | ``level = DEBUG`` line to one of the valid options. |
|
45 | ``level = DEBUG`` line to one of the valid options. | |
46 |
|
46 | |||
47 | You also need to change the log level for handlers. See the example |
|
47 | You also need to change the log level for handlers. See the example | |
48 | ``##handler`` section below. The ``handler`` level takes the same options as |
|
48 | ``##handler`` section below. The ``handler`` level takes the same options as | |
49 | the ``debug`` level. |
|
49 | the ``debug`` level. | |
50 |
|
50 | |||
51 | .. code-block:: ini |
|
51 | .. code-block:: ini | |
52 |
|
52 | |||
53 | ################################ |
|
53 | ################################ | |
54 | ### LOGGING CONFIGURATION #### |
|
54 | ### LOGGING CONFIGURATION #### | |
55 | ################################ |
|
55 | ################################ | |
56 | [loggers] |
|
56 | [loggers] | |
57 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper |
|
57 | keys = root, sqlalchemy, beaker, celery, rhodecode, ssh_wrapper | |
58 |
|
58 | |||
59 | [handlers] |
|
59 | [handlers] | |
60 | keys = console, console_sql, file, file_rotating |
|
60 | keys = console, console_sql, file, file_rotating | |
61 |
|
61 | |||
62 | [formatters] |
|
62 | [formatters] | |
63 | keys = generic, color_formatter, color_formatter_sql |
|
63 | keys = generic, color_formatter, color_formatter_sql | |
64 |
|
64 | |||
65 | ############# |
|
65 | ############# | |
66 | ## LOGGERS ## |
|
66 | ## LOGGERS ## | |
67 | ############# |
|
67 | ############# | |
68 | [logger_root] |
|
68 | [logger_root] | |
69 | level = NOTSET |
|
69 | level = NOTSET | |
70 | handlers = console |
|
70 | handlers = console | |
71 |
|
71 | |||
72 | [logger_sqlalchemy] |
|
72 | [logger_sqlalchemy] | |
73 | level = INFO |
|
73 | level = INFO | |
74 | handlers = console_sql |
|
74 | handlers = console_sql | |
75 | qualname = sqlalchemy.engine |
|
75 | qualname = sqlalchemy.engine | |
76 | propagate = 0 |
|
76 | propagate = 0 | |
77 |
|
77 | |||
78 | [logger_beaker] |
|
78 | [logger_beaker] | |
79 | level = DEBUG |
|
79 | level = DEBUG | |
80 | handlers = |
|
80 | handlers = | |
81 | qualname = beaker.container |
|
81 | qualname = beaker.container | |
82 | propagate = 1 |
|
82 | propagate = 1 | |
83 |
|
83 | |||
84 | [logger_rhodecode] |
|
84 | [logger_rhodecode] | |
85 | level = DEBUG |
|
85 | level = DEBUG | |
86 | handlers = |
|
86 | handlers = | |
87 | qualname = rhodecode |
|
87 | qualname = rhodecode | |
88 | propagate = 1 |
|
88 | propagate = 1 | |
89 |
|
89 | |||
90 | [logger_ssh_wrapper] |
|
90 | [logger_ssh_wrapper] | |
91 | level = DEBUG |
|
91 | level = DEBUG | |
92 | handlers = |
|
92 | handlers = | |
93 | qualname = ssh_wrapper |
|
93 | qualname = ssh_wrapper | |
94 | propagate = 1 |
|
94 | propagate = 1 | |
95 |
|
95 | |||
96 | [logger_celery] |
|
96 | [logger_celery] | |
97 | level = DEBUG |
|
97 | level = DEBUG | |
98 | handlers = |
|
98 | handlers = | |
99 | qualname = celery |
|
99 | qualname = celery | |
100 |
|
100 | |||
101 | ############## |
|
101 | ############## | |
102 | ## HANDLERS ## |
|
102 | ## HANDLERS ## | |
103 | ############## |
|
103 | ############## | |
104 |
|
104 | |||
105 | [handler_console] |
|
105 | [handler_console] | |
106 | class = StreamHandler |
|
106 | class = StreamHandler | |
107 | args = (sys.stderr, ) |
|
107 | args = (sys.stderr, ) | |
108 | level = DEBUG |
|
108 | level = DEBUG | |
109 | formatter = generic |
|
109 | formatter = generic | |
110 |
|
110 | |||
111 | [handler_console_sql] |
|
111 | [handler_console_sql] | |
112 | class = StreamHandler |
|
112 | class = StreamHandler | |
113 | args = (sys.stderr, ) |
|
113 | args = (sys.stderr, ) | |
114 | level = INFO |
|
114 | level = INFO | |
115 | formatter = generic |
|
115 | formatter = generic | |
116 |
|
116 | |||
117 | [handler_file] |
|
117 | [handler_file] | |
118 | class = FileHandler |
|
118 | class = FileHandler | |
119 | args = ('rhodecode_debug.log', 'a',) |
|
119 | args = ('rhodecode_debug.log', 'a',) | |
120 | level = INFO |
|
120 | level = INFO | |
121 | formatter = generic |
|
121 | formatter = generic | |
122 |
|
122 | |||
123 | [handler_file_rotating] |
|
123 | [handler_file_rotating] | |
124 | class = logging.handlers.TimedRotatingFileHandler |
|
124 | class = logging.handlers.TimedRotatingFileHandler | |
125 | # 'D', 5 - rotate every 5days |
|
125 | # 'D', 5 - rotate every 5days | |
126 | # you can set 'h', 'midnight' |
|
126 | # you can set 'h', 'midnight' | |
127 | args = ('rhodecode_debug_rotated.log', 'D', 5, 10,) |
|
127 | args = ('rhodecode_debug_rotated.log', 'D', 5, 10,) | |
128 | level = INFO |
|
128 | level = INFO | |
129 | formatter = generic |
|
129 | formatter = generic | |
130 |
|
130 | |||
131 | ################ |
|
131 | ################ | |
132 | ## FORMATTERS ## |
|
132 | ## FORMATTERS ## | |
133 | ################ |
|
133 | ################ | |
134 |
|
134 | |||
135 | [formatter_generic] |
|
135 | [formatter_generic] | |
136 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter |
|
136 | class = rhodecode.lib.logging_formatter.ExceptionAwareFormatter | |
137 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
137 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
138 | datefmt = %Y-%m-%d %H:%M:%S |
|
138 | datefmt = %Y-%m-%d %H:%M:%S | |
139 |
|
139 | |||
140 | [formatter_color_formatter] |
|
140 | [formatter_color_formatter] | |
141 | class = rhodecode.lib.logging_formatter.ColorFormatter |
|
141 | class = rhodecode.lib.logging_formatter.ColorFormatter | |
142 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
142 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
143 | datefmt = %Y-%m-%d %H:%M:%S |
|
143 | datefmt = %Y-%m-%d %H:%M:%S | |
144 |
|
144 | |||
145 | [formatter_color_formatter_sql] |
|
145 | [formatter_color_formatter_sql] | |
146 | class = rhodecode.lib.logging_formatter.ColorFormatterSql |
|
146 | class = rhodecode.lib.logging_formatter.ColorFormatterSql | |
147 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
147 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
148 | datefmt = %Y-%m-%d %H:%M:%S No newline at end of file |
|
148 | datefmt = %Y-%m-%d %H:%M:%S |
@@ -1,208 +1,208 b'' | |||||
1 | .. _svn-http: |
|
1 | .. _svn-http: | |
2 |
|
2 | |||
3 | |svn| With Write Over HTTP |
|
3 | |svn| With Write Over HTTP | |
4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
4 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
5 |
|
5 | |||
6 | To use |svn| with read/write support over the |svn| HTTP protocol, you have to |
|
6 | To use |svn| with read/write support over the |svn| HTTP protocol, you have to | |
7 | configure the HTTP |svn| backend. |
|
7 | configure the HTTP |svn| backend. | |
8 |
|
8 | |||
9 | Prerequisites |
|
9 | Prerequisites | |
10 | ============= |
|
10 | ============= | |
11 |
|
11 | |||
12 | - Enable HTTP support inside the admin VCS settings on your |RCE| instance |
|
12 | - Enable HTTP support inside the admin VCS settings on your |RCE| instance | |
13 | - You need to install the following tools on the machine that is running an |
|
13 | - You need to install the following tools on the machine that is running an | |
14 | instance of |RCE|: |
|
14 | instance of |RCE|: | |
15 | ``Apache HTTP Server`` and ``mod_dav_svn``. |
|
15 | ``Apache HTTP Server`` and ``mod_dav_svn``. | |
16 |
|
16 | |||
17 |
|
17 | |||
18 | .. tip:: |
|
18 | .. tip:: | |
19 |
|
19 | |||
20 | We recommend using Wandisco repositories which provide latest SVN versions |
|
20 | We recommend using Wandisco repositories which provide latest SVN versions | |
21 | for most platforms. If you skip this version you'll have to ensure the Client version |
|
21 | for most platforms. If you skip this version you'll have to ensure the Client version | |
22 | is compatible with installed SVN version which might differ depending on the operating system. |
|
22 | is compatible with installed SVN version which might differ depending on the operating system. | |
23 | Here is an example how to add the Wandisco repositories for Ubuntu. |
|
23 | Here is an example how to add the Wandisco repositories for Ubuntu. | |
24 |
|
24 | |||
25 | .. code-block:: bash |
|
25 | .. code-block:: bash | |
26 |
|
26 | |||
27 | $ sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu `lsb_release -cs` svn110" >> /etc/apt/sources.list.d/subversion110.list' |
|
27 | $ sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu `lsb_release -cs` svn110" >> /etc/apt/sources.list.d/subversion110.list' | |
28 | $ sudo wget -q http://opensource.wandisco.com/wandisco-debian-new.gpg -O- | sudo apt-key add - |
|
28 | $ sudo wget -q http://opensource.wandisco.com/wandisco-debian-new.gpg -O- | sudo apt-key add - | |
29 | $ sudo apt-get update |
|
29 | $ sudo apt-get update | |
30 |
|
30 | |||
31 | Here is an example how to add the Wandisco repositories for Centos/Redhat. Using |
|
31 | Here is an example how to add the Wandisco repositories for Centos/Redhat. Using | |
32 | a yum config |
|
32 | a yum config | |
33 |
|
33 | |||
34 | .. code-block:: bash |
|
34 | .. code-block:: bash | |
35 |
|
35 | |||
36 | [wandisco-Git] |
|
36 | [wandisco-Git] | |
37 | name=CentOS-6 - Wandisco Git |
|
37 | name=CentOS-6 - Wandisco Git | |
38 | baseurl=http://opensource.wandisco.com/centos/6/git/$basearch/ |
|
38 | baseurl=http://opensource.wandisco.com/centos/6/git/$basearch/ | |
39 | enabled=1 |
|
39 | enabled=1 | |
40 | gpgcheck=1 |
|
40 | gpgcheck=1 | |
41 | gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco |
|
41 | gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco | |
42 |
|
42 | |||
43 |
|
43 | |||
44 |
|
44 | |||
45 | Example installation of required components for Ubuntu platform: |
|
45 | Example installation of required components for Ubuntu platform: | |
46 |
|
46 | |||
47 | .. code-block:: bash |
|
47 | .. code-block:: bash | |
48 |
|
48 | |||
49 | $ sudo apt-get install apache2 |
|
49 | $ sudo apt-get install apache2 | |
50 | $ sudo apt-get install libapache2-svn |
|
50 | $ sudo apt-get install libapache2-svn | |
51 |
|
51 | |||
52 | Once installed you need to enable ``dav_svn`` on Ubuntu: |
|
52 | Once installed you need to enable ``dav_svn`` on Ubuntu: | |
53 |
|
53 | |||
54 | .. code-block:: bash |
|
54 | .. code-block:: bash | |
55 |
|
55 | |||
56 | $ sudo a2enmod dav_svn |
|
56 | $ sudo a2enmod dav_svn | |
57 | $ sudo a2enmod headers |
|
57 | $ sudo a2enmod headers | |
58 | $ sudo a2enmod authn_anon |
|
58 | $ sudo a2enmod authn_anon | |
59 |
|
59 | |||
60 |
|
60 | |||
61 | Example installation of required components for RedHat/CentOS platform: |
|
61 | Example installation of required components for RedHat/CentOS platform: | |
62 |
|
62 | |||
63 | .. code-block:: bash |
|
63 | .. code-block:: bash | |
64 |
|
64 | |||
65 | $ sudo yum install httpd |
|
65 | $ sudo yum install httpd | |
66 | $ sudo yum install subversion mod_dav_svn |
|
66 | $ sudo yum install subversion mod_dav_svn | |
67 |
|
67 | |||
68 |
|
68 | |||
69 | Once installed you need to enable ``dav_svn`` on RedHat/CentOS: |
|
69 | Once installed you need to enable ``dav_svn`` on RedHat/CentOS: | |
70 |
|
70 | |||
71 | .. code-block:: bash |
|
71 | .. code-block:: bash | |
72 |
|
72 | |||
73 | sudo vi /etc/httpd/conf.modules.d/10-subversion.conf |
|
73 | sudo vi /etc/httpd/conf.modules.d/10-subversion.conf | |
74 | ## The file should read: |
|
74 | ## The file should read: | |
75 |
|
75 | |||
76 | LoadModule dav_svn_module modules/mod_dav_svn.so |
|
76 | LoadModule dav_svn_module modules/mod_dav_svn.so | |
77 | LoadModule headers_module modules/mod_headers.so |
|
77 | LoadModule headers_module modules/mod_headers.so | |
78 | LoadModule authn_anon_module modules/mod_authn_anon.so |
|
78 | LoadModule authn_anon_module modules/mod_authn_anon.so | |
79 |
|
79 | |||
80 | .. tip:: |
|
80 | .. tip:: | |
81 |
|
81 | |||
82 | To check the installed mod_dav_svn module version, you can use such command. |
|
82 | To check the installed mod_dav_svn module version, you can use such command. | |
83 |
|
83 | |||
84 | `strings /usr/lib/apache2/modules/mod_dav_svn.so | grep 'Powered by'` |
|
84 | `strings /usr/lib/apache2/modules/mod_dav_svn.so | grep 'Powered by'` | |
85 |
|
85 | |||
86 |
|
86 | |||
87 | Configuring Apache Setup |
|
87 | Configuring Apache Setup | |
88 | ======================== |
|
88 | ======================== | |
89 |
|
89 | |||
90 | .. tip:: |
|
90 | .. tip:: | |
91 |
|
91 | |||
92 | It is recommended to run Apache on a port other than 80, due to possible |
|
92 | It is recommended to run Apache on a port other than 80, due to possible | |
93 | conflicts with other HTTP servers like nginx. To do this, set the |
|
93 | conflicts with other HTTP servers like nginx. To do this, set the | |
94 | ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example |
|
94 | ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example | |
95 | ``Listen 8090``. |
|
95 | ``Listen 8090``. | |
96 |
|
96 | |||
97 |
|
97 | |||
98 | .. warning:: |
|
98 | .. warning:: | |
99 |
|
99 | |||
100 | Make sure your Apache instance which runs the mod_dav_svn module is |
|
100 | Make sure your Apache instance which runs the mod_dav_svn module is | |
101 | only accessible by |RCE|. Otherwise everyone is able to browse |
|
101 | only accessible by |RCE|. Otherwise everyone is able to browse | |
102 | the repositories or run subversion operations (checkout/commit/etc.). |
|
102 | the repositories or run subversion operations (checkout/commit/etc.). | |
103 |
|
103 | |||
104 | It is also recommended to run apache as the same user as |RCE|, otherwise |
|
104 | It is also recommended to run apache as the same user as |RCE|, otherwise | |
105 | permission issues could occur. To do this edit the ``/etc/apache2/envvars`` |
|
105 | permission issues could occur. To do this edit the ``/etc/apache2/envvars`` | |
106 |
|
106 | |||
107 | .. code-block:: apache |
|
107 | .. code-block:: apache | |
108 |
|
108 | |||
109 | export APACHE_RUN_USER=rhodecode |
|
109 | export APACHE_RUN_USER=rhodecode | |
110 | export APACHE_RUN_GROUP=rhodecode |
|
110 | export APACHE_RUN_GROUP=rhodecode | |
111 |
|
111 | |||
112 | 1. To configure Apache, create and edit a virtual hosts file, for example |
|
112 | 1. To configure Apache, create and edit a virtual hosts file, for example | |
113 | :file:`/etc/apache2/sites-enabled/default.conf`. Below is an example |
|
113 | :file:`/etc/apache2/sites-enabled/default.conf`. Below is an example | |
114 | how to use one with auto-generated config ```mod_dav_svn.conf``` |
|
114 | how to use one with auto-generated config ```mod_dav_svn.conf``` | |
115 | from configured |RCE| instance. |
|
115 | from configured |RCE| instance. | |
116 |
|
116 | |||
117 | .. code-block:: apache |
|
117 | .. code-block:: apache | |
118 |
|
118 | |||
119 | <VirtualHost *:8090> |
|
119 | <VirtualHost *:8090> | |
120 | ServerAdmin rhodecode-admin@localhost |
|
120 | ServerAdmin rhodecode-admin@localhost | |
121 | DocumentRoot /var/www/html |
|
121 | DocumentRoot /var/www/html | |
122 | ErrorLog ${'${APACHE_LOG_DIR}'}/error.log |
|
122 | ErrorLog ${'${APACHE_LOG_DIR}'}/error.log | |
123 | CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined |
|
123 | CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined | |
124 | LogLevel info |
|
124 | LogLevel info | |
125 | # allows custom host names, prevents 400 errors on checkout |
|
125 | # allows custom host names, prevents 400 errors on checkout | |
126 | HttpProtocolOptions Unsafe |
|
126 | HttpProtocolOptions Unsafe | |
127 | # Most likely this will be: /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf |
|
127 | # Most likely this will be: /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf | |
128 | Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf |
|
128 | Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf | |
129 | </VirtualHost> |
|
129 | </VirtualHost> | |
130 |
|
130 | |||
131 |
|
131 | |||
132 | 2. Go to the :menuselection:`Admin --> Settings --> VCS` page, and |
|
132 | 2. Go to the :menuselection:`Admin --> Settings --> VCS` page, and | |
133 | enable :guilabel:`Proxy Subversion HTTP requests`, and specify the |
|
133 | enable :guilabel:`Proxy Subversion HTTP requests`, and specify the | |
134 | :guilabel:`Subversion HTTP Server URL`. |
|
134 | :guilabel:`Subversion HTTP Server URL`. | |
135 |
|
135 | |||
136 | 3. Open the |RCE| configuration file, |
|
136 | 3. Open the |RCE| configuration file, | |
137 |
:file:` |
|
137 | :file:`config/_shared/rhodecode.ini` | |
138 |
|
138 | |||
139 | 4. Add the following configuration option in the ``[app:main]`` |
|
139 | 4. Add the following configuration option in the ``[app:main]`` | |
140 | section if you don't have it yet. |
|
140 | section if you don't have it yet. | |
141 |
|
141 | |||
142 | This enables mapping of the created |RCE| repo groups into special |
|
142 | This enables mapping of the created |RCE| repo groups into special | |
143 | |svn| paths. Each time a new repository group is created, the system will |
|
143 | |svn| paths. Each time a new repository group is created, the system will | |
144 | update the template file and create new mapping. Apache web server needs to |
|
144 | update the template file and create new mapping. Apache web server needs to | |
145 | be reloaded to pick up the changes on this file. |
|
145 | be reloaded to pick up the changes on this file. | |
146 | To do this, simply configure `svn.proxy.reload_cmd` inside the .ini file. |
|
146 | To do this, simply configure `svn.proxy.reload_cmd` inside the .ini file. | |
147 | Example configuration: |
|
147 | Example configuration: | |
148 |
|
148 | |||
149 |
|
149 | |||
150 | .. code-block:: ini |
|
150 | .. code-block:: ini | |
151 |
|
151 | |||
152 | ############################################################ |
|
152 | ############################################################ | |
153 | ### Subversion proxy support (mod_dav_svn) ### |
|
153 | ### Subversion proxy support (mod_dav_svn) ### | |
154 | ### Maps RhodeCode repo groups into SVN paths for Apache ### |
|
154 | ### Maps RhodeCode repo groups into SVN paths for Apache ### | |
155 | ############################################################ |
|
155 | ############################################################ | |
156 | ## Enable or disable the config file generation. |
|
156 | ## Enable or disable the config file generation. | |
157 | svn.proxy.generate_config = true |
|
157 | svn.proxy.generate_config = true | |
158 | ## Generate config file with `SVNListParentPath` set to `On`. |
|
158 | ## Generate config file with `SVNListParentPath` set to `On`. | |
159 | svn.proxy.list_parent_path = true |
|
159 | svn.proxy.list_parent_path = true | |
160 | ## Set location and file name of generated config file. |
|
160 | ## Set location and file name of generated config file. | |
161 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf |
|
161 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf | |
162 | ## Used as a prefix to the <Location> block in the generated config file. |
|
162 | ## Used as a prefix to the <Location> block in the generated config file. | |
163 | ## In most cases it should be set to `/`. |
|
163 | ## In most cases it should be set to `/`. | |
164 | svn.proxy.location_root = / |
|
164 | svn.proxy.location_root = / | |
165 | ## Command to reload the mod dav svn configuration on change. |
|
165 | ## Command to reload the mod dav svn configuration on change. | |
166 | ## Example: `/etc/init.d/apache2 reload` |
|
166 | ## Example: `/etc/init.d/apache2 reload` | |
167 | svn.proxy.reload_cmd = /etc/init.d/apache2 reload |
|
167 | svn.proxy.reload_cmd = /etc/init.d/apache2 reload | |
168 | ## If the timeout expires before the reload command finishes, the command will |
|
168 | ## If the timeout expires before the reload command finishes, the command will | |
169 | ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds. |
|
169 | ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds. | |
170 | #svn.proxy.reload_timeout = 10 |
|
170 | #svn.proxy.reload_timeout = 10 | |
171 |
|
171 | |||
172 |
|
172 | |||
173 | This would create a special template file called ```mod_dav_svn.conf```. We |
|
173 | This would create a special template file called ```mod_dav_svn.conf```. We | |
174 | used that file path in the apache config above inside the Include statement. |
|
174 | used that file path in the apache config above inside the Include statement. | |
175 | It's also possible to manually generate the config from the |
|
175 | It's also possible to manually generate the config from the | |
176 | :menuselection:`Admin --> Settings --> VCS` page by clicking a |
|
176 | :menuselection:`Admin --> Settings --> VCS` page by clicking a | |
177 | `Generate Apache Config` button. |
|
177 | `Generate Apache Config` button. | |
178 |
|
178 | |||
179 | 5. Now only things left is to enable svn support, and generate the initial |
|
179 | 5. Now only things left is to enable svn support, and generate the initial | |
180 | configuration. |
|
180 | configuration. | |
181 |
|
181 | |||
182 | - Select `Proxy subversion HTTP requests` checkbox |
|
182 | - Select `Proxy subversion HTTP requests` checkbox | |
183 | - Enter http://localhost:8090 into `Subversion HTTP Server URL` |
|
183 | - Enter http://localhost:8090 into `Subversion HTTP Server URL` | |
184 | - Click the `Generate Apache Config` button. |
|
184 | - Click the `Generate Apache Config` button. | |
185 |
|
185 | |||
186 | This config will be automatically re-generated once an user-groups is added |
|
186 | This config will be automatically re-generated once an user-groups is added | |
187 | to properly map the additional paths generated. |
|
187 | to properly map the additional paths generated. | |
188 |
|
188 | |||
189 |
|
189 | |||
190 |
|
190 | |||
191 | Using |svn| |
|
191 | Using |svn| | |
192 | =========== |
|
192 | =========== | |
193 |
|
193 | |||
194 | Once |svn| has been enabled on your instance, you can use it with the |
|
194 | Once |svn| has been enabled on your instance, you can use it with the | |
195 | following examples. For more |svn| information, see the `Subversion Red Book`_ |
|
195 | following examples. For more |svn| information, see the `Subversion Red Book`_ | |
196 |
|
196 | |||
197 | .. code-block:: bash |
|
197 | .. code-block:: bash | |
198 |
|
198 | |||
199 | # To clone a repository |
|
199 | # To clone a repository | |
200 | svn checkout http://my-svn-server.example.com/my-svn-repo |
|
200 | svn checkout http://my-svn-server.example.com/my-svn-repo | |
201 |
|
201 | |||
202 | # svn commit |
|
202 | # svn commit | |
203 | svn commit |
|
203 | svn commit | |
204 |
|
204 | |||
205 |
|
205 | |||
206 | .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn |
|
206 | .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn | |
207 |
|
207 | |||
208 | .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue No newline at end of file |
|
208 | .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue |
@@ -1,22 +1,22 b'' | |||||
1 | .. _change-encoding: |
|
1 | .. _change-encoding: | |
2 |
|
2 | |||
3 | Change Default Encoding |
|
3 | Change Default Encoding | |
4 | ----------------------- |
|
4 | ----------------------- | |
5 |
|
5 | |||
6 | |RCE| uses ``utf8`` encoding by default. You can change the default encoding |
|
6 | |RCE| uses ``utf8`` encoding by default. You can change the default encoding | |
7 |
in the :file:` |
|
7 | in the :file:`config/_shared/rhodecode.ini` file. To | |
8 | change the default encoding used by |RCE|, set a new value for the |
|
8 | change the default encoding used by |RCE|, set a new value for the | |
9 | ``default_encoding``. |
|
9 | ``default_encoding``. | |
10 |
|
10 | |||
11 | .. code-block:: ini |
|
11 | .. code-block:: ini | |
12 |
|
12 | |||
13 | # default encoding used to convert from and to unicode |
|
13 | # default encoding used to convert from and to unicode | |
14 | # can be also a comma separated list of encoding in case of mixed |
|
14 | # can be also a comma separated list of encoding in case of mixed | |
15 | # encodings |
|
15 | # encodings | |
16 | default_encoding = utf8 |
|
16 | default_encoding = utf8 | |
17 |
|
17 | |||
18 | .. note:: |
|
18 | .. note:: | |
19 |
|
19 | |||
20 | Changing the default encoding will affect many parts of your |RCE| |
|
20 | Changing the default encoding will affect many parts of your |RCE| | |
21 | installation, including committers names, |
|
21 | installation, including committers names, | |
22 | file names, and the encoding of commit messages. |
|
22 | file names, and the encoding of commit messages. |
@@ -1,17 +1,17 b'' | |||||
1 | .. _hg-auth-loop: |
|
1 | .. _hg-auth-loop: | |
2 |
|
2 | |||
3 | |hg| Authentication Tuning |
|
3 | |hg| Authentication Tuning | |
4 | -------------------------- |
|
4 | -------------------------- | |
5 |
|
5 | |||
6 | When using external authentication tools such as LDAP with |hg|, a |
|
6 | When using external authentication tools such as LDAP with |hg|, a | |
7 | password retry loop in |hg| can result in users being locked out due to too |
|
7 | password retry loop in |hg| can result in users being locked out due to too | |
8 | many failed password attempts. To prevent this from happening, add the |
|
8 | many failed password attempts. To prevent this from happening, add the | |
9 | following setting to your |
|
9 | following setting to your | |
10 |
:file:` |
|
10 | :file:`config/_shared/rhodecode.ini` file, in the | |
11 | ``[app:main]`` section. |
|
11 | ``[app:main]`` section. | |
12 |
|
12 | |||
13 |
|
13 | |||
14 | .. code-block:: ini |
|
14 | .. code-block:: ini | |
15 |
|
15 | |||
16 | [app:main] |
|
16 | [app:main] | |
17 | auth_ret_code_detection = true |
|
17 | auth_ret_code_detection = true |
@@ -1,396 +1,396 b'' | |||||
1 | .. _scale-horizontal-cluster: |
|
1 | .. _scale-horizontal-cluster: | |
2 |
|
2 | |||
3 |
|
3 | |||
4 | Scale Horizontally / RhodeCode Cluster |
|
4 | Scale Horizontally / RhodeCode Cluster | |
5 | -------------------------------------- |
|
5 | -------------------------------------- | |
6 |
|
6 | |||
7 | |RCE| is built in a way it support horizontal scaling across multiple machines. |
|
7 | |RCE| is built in a way it support horizontal scaling across multiple machines. | |
8 | There are three main pre-requisites for that: |
|
8 | There are three main pre-requisites for that: | |
9 |
|
9 | |||
10 | - Shared storage that each machine can access. Using NFS or other shared storage system. |
|
10 | - Shared storage that each machine can access. Using NFS or other shared storage system. | |
11 | - Shared DB connection across machines. Using `MySQL`/`PostgreSQL` that each node can access. |
|
11 | - Shared DB connection across machines. Using `MySQL`/`PostgreSQL` that each node can access. | |
12 | - |RCE| user sessions and caches need to use a shared storage (e.g `Redis`_/`Memcached`) |
|
12 | - |RCE| user sessions and caches need to use a shared storage (e.g `Redis`_/`Memcached`) | |
13 |
|
13 | |||
14 |
|
14 | |||
15 | Horizontal scaling means adding more machines or workers into your pool of |
|
15 | Horizontal scaling means adding more machines or workers into your pool of | |
16 | resources. Horizontally scaling |RCE| gives a huge performance increase, |
|
16 | resources. Horizontally scaling |RCE| gives a huge performance increase, | |
17 | especially under large traffic scenarios with a high number of requests. |
|
17 | especially under large traffic scenarios with a high number of requests. | |
18 | This is very beneficial when |RCE| is serving many users simultaneously, |
|
18 | This is very beneficial when |RCE| is serving many users simultaneously, | |
19 | or if continuous integration servers are automatically pulling and pushing code. |
|
19 | or if continuous integration servers are automatically pulling and pushing code. | |
20 | It also adds High-Availability to your running system. |
|
20 | It also adds High-Availability to your running system. | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | Cluster Overview |
|
23 | Cluster Overview | |
24 | ^^^^^^^^^^^^^^^^ |
|
24 | ^^^^^^^^^^^^^^^^ | |
25 |
|
25 | |||
26 | Below we'll present a configuration example that will use two separate nodes to serve |
|
26 | Below we'll present a configuration example that will use two separate nodes to serve | |
27 | |RCE| in a load-balanced environment. The 3rd node will act as a shared storage/cache |
|
27 | |RCE| in a load-balanced environment. The 3rd node will act as a shared storage/cache | |
28 | and handle load-balancing. In addition 3rd node will be used as shared database instance. |
|
28 | and handle load-balancing. In addition 3rd node will be used as shared database instance. | |
29 |
|
29 | |||
30 | This setup can be used both in Docker based configuration or with individual |
|
30 | This setup can be used both in Docker based configuration or with individual | |
31 | physical/virtual machines. Using the 3rd node for Storage/Redis/PostgreSQL/Nginx is |
|
31 | physical/virtual machines. Using the 3rd node for Storage/Redis/PostgreSQL/Nginx is | |
32 | optional. All those components can be installed on one of the two nodes used for |RCE|. |
|
32 | optional. All those components can be installed on one of the two nodes used for |RCE|. | |
33 | We'll use following naming for our nodes: |
|
33 | We'll use following naming for our nodes: | |
34 |
|
34 | |||
35 | - `rc-node-1` (NFS, DB, Cache node) |
|
35 | - `rc-node-1` (NFS, DB, Cache node) | |
36 | - `rc-node-2` (Worker node1) |
|
36 | - `rc-node-2` (Worker node1) | |
37 | - `rc-node-3` (Worker node2) |
|
37 | - `rc-node-3` (Worker node2) | |
38 |
|
38 | |||
39 | Our shares NFS storage in the example is located on `/home/rcdev/storage` and |
|
39 | Our shares NFS storage in the example is located on `/home/rcdev/storage` and | |
40 | it's RW accessible on **each** node. |
|
40 | it's RW accessible on **each** node. | |
41 |
|
41 | |||
42 | In this example we used certain recommended components, however many |
|
42 | In this example we used certain recommended components, however many | |
43 | of those can be replaced by other, in case your organization already uses them, for example: |
|
43 | of those can be replaced by other, in case your organization already uses them, for example: | |
44 |
|
44 | |||
45 | - `MySQL`/`PostgreSQL`: Aren't replaceable and are the two only supported databases. |
|
45 | - `MySQL`/`PostgreSQL`: Aren't replaceable and are the two only supported databases. | |
46 | - `Nginx`_ on `rc-node-1` can be replaced by: `Hardware Load Balancer (F5)`, `Apache`_, `HA-Proxy` etc. |
|
46 | - `Nginx`_ on `rc-node-1` can be replaced by: `Hardware Load Balancer (F5)`, `Apache`_, `HA-Proxy` etc. | |
47 | - `Nginx`_ on rc-node-2/3 acts as a reverse proxy and can be replaced by other HTTP server |
|
47 | - `Nginx`_ on rc-node-2/3 acts as a reverse proxy and can be replaced by other HTTP server | |
48 | acting as reverse proxy such as `Apache`_. |
|
48 | acting as reverse proxy such as `Apache`_. | |
49 | - `Redis`_ on `rc-node-1` can be replaced by: `Memcached` |
|
49 | - `Redis`_ on `rc-node-1` can be replaced by: `Memcached` | |
50 |
|
50 | |||
51 |
|
51 | |||
52 | Here's an overview what components should be installed/setup on each server in our example: |
|
52 | Here's an overview what components should be installed/setup on each server in our example: | |
53 |
|
53 | |||
54 | - **rc-node-1**: |
|
54 | - **rc-node-1**: | |
55 |
|
55 | |||
56 | - main storage acting as NFS host. |
|
56 | - main storage acting as NFS host. | |
57 | - `nginx` acting as a load-balancer. |
|
57 | - `nginx` acting as a load-balancer. | |
58 | - `postgresql-server` used for database and sessions. |
|
58 | - `postgresql-server` used for database and sessions. | |
59 | - `redis-server` used for storing shared caches. |
|
59 | - `redis-server` used for storing shared caches. | |
60 | - optionally `rabbitmq-server` or `redis` for `Celery` if used. |
|
60 | - optionally `rabbitmq-server` or `redis` for `Celery` if used. | |
61 | - optionally if `Celery` is used Enterprise/Community instance + VCSServer. |
|
61 | - optionally if `Celery` is used Enterprise/Community instance + VCSServer. | |
62 | - optionally mailserver that can be shared by other instances. |
|
62 | - optionally mailserver that can be shared by other instances. | |
63 | - optionally channelstream server to handle live communication for all instances. |
|
63 | - optionally channelstream server to handle live communication for all instances. | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | - **rc-node-2/3**: |
|
66 | - **rc-node-2/3**: | |
67 |
|
67 | |||
68 | - `nginx` acting as a reverse proxy to handle requests to |RCE|. |
|
68 | - `nginx` acting as a reverse proxy to handle requests to |RCE|. | |
69 | - 1x RhodeCode Enterprise/Community instance. |
|
69 | - 1x RhodeCode Enterprise/Community instance. | |
70 | - 1x VCSServer instance. |
|
70 | - 1x VCSServer instance. | |
71 | - optionally for testing connection: postgresql-client, redis-client (redis-tools). |
|
71 | - optionally for testing connection: postgresql-client, redis-client (redis-tools). | |
72 |
|
72 | |||
73 |
|
73 | |||
74 | Before we start here are few assumptions that should be fulfilled: |
|
74 | Before we start here are few assumptions that should be fulfilled: | |
75 |
|
75 | |||
76 | - make sure each node can access each other. |
|
76 | - make sure each node can access each other. | |
77 | - make sure `Redis`_/`MySQL`/`PostgreSQL`/`RabbitMQ`_ are running on `rc-node-1` |
|
77 | - make sure `Redis`_/`MySQL`/`PostgreSQL`/`RabbitMQ`_ are running on `rc-node-1` | |
78 | - make sure both `rc-node-2`/`3` can access NFS storage with RW access |
|
78 | - make sure both `rc-node-2`/`3` can access NFS storage with RW access | |
79 | - make sure rc-node-2/3 can access `Redis`_/`PostgreSQL`, `MySQL` database on `rc-node-1`. |
|
79 | - make sure rc-node-2/3 can access `Redis`_/`PostgreSQL`, `MySQL` database on `rc-node-1`. | |
80 | - make sure `Redis`_/Database/`RabbitMQ`_ are password protected and accessible only from rc-node-2/3. |
|
80 | - make sure `Redis`_/Database/`RabbitMQ`_ are password protected and accessible only from rc-node-2/3. | |
81 |
|
81 | |||
82 |
|
82 | |||
83 |
|
83 | |||
84 | Setup rc-node-2/3 |
|
84 | Setup rc-node-2/3 | |
85 | ^^^^^^^^^^^^^^^^^ |
|
85 | ^^^^^^^^^^^^^^^^^ | |
86 |
|
86 | |||
87 | Initially before `rc-node-1` we'll configure both nodes 2 and 3 to operate as standalone |
|
87 | Initially before `rc-node-1` we'll configure both nodes 2 and 3 to operate as standalone | |
88 | nodes with their own hostnames. Use a default installation settings, and use |
|
88 | nodes with their own hostnames. Use a default installation settings, and use | |
89 | the default local addresses (127.0.0.1) to configure VCSServer and Community/Enterprise instances. |
|
89 | the default local addresses (127.0.0.1) to configure VCSServer and Community/Enterprise instances. | |
90 | All external connectivity will be handled by the reverse proxy (`Nginx`_ in our example). |
|
90 | All external connectivity will be handled by the reverse proxy (`Nginx`_ in our example). | |
91 |
|
91 | |||
92 | This way we can ensure each individual host works, |
|
92 | This way we can ensure each individual host works, | |
93 | accepts connections, or do some operations explicitly on chosen node. |
|
93 | accepts connections, or do some operations explicitly on chosen node. | |
94 |
|
94 | |||
95 | In addition this would allow use to explicitly direct certain traffic to a node, e.g |
|
95 | In addition this would allow use to explicitly direct certain traffic to a node, e.g | |
96 | CI server will only call directly `rc-node-3`. This should be done similar to normal |
|
96 | CI server will only call directly `rc-node-3`. This should be done similar to normal | |
97 | installation so check out `Nginx`_/`Apache`_ configuration example to configure each host. |
|
97 | installation so check out `Nginx`_/`Apache`_ configuration example to configure each host. | |
98 | Each one should already connect to shared database during installation. |
|
98 | Each one should already connect to shared database during installation. | |
99 |
|
99 | |||
100 |
|
100 | |||
101 | 1) Assuming our final url will be http://rc-node-1, Configure `instances_id`, `app.base_url` |
|
101 | 1) Assuming our final url will be http://rc-node-1, Configure `instances_id`, `app.base_url` | |
102 |
|
102 | |||
103 |
a) On **rc-node-2** find the following settings and edit :file:` |
|
103 | a) On **rc-node-2** find the following settings and edit :file:`config/_shared/rhodecode.ini` | |
104 |
|
104 | |||
105 | .. code-block:: ini |
|
105 | .. code-block:: ini | |
106 |
|
106 | |||
107 | ## required format is: *NAME- |
|
107 | ## required format is: *NAME- | |
108 | instance_id = *rc-node-2- |
|
108 | instance_id = *rc-node-2- | |
109 | app.base_url = http://rc-node-1 |
|
109 | app.base_url = http://rc-node-1 | |
110 |
|
110 | |||
111 |
|
111 | |||
112 |
b) On **rc-node-3** find the following settings and edit :file:` |
|
112 | b) On **rc-node-3** find the following settings and edit :file:`config/_shared/rhodecode.ini` | |
113 |
|
113 | |||
114 | .. code-block:: ini |
|
114 | .. code-block:: ini | |
115 |
|
115 | |||
116 | ## required format is: *NAME- |
|
116 | ## required format is: *NAME- | |
117 | instance_id = *rc-node-3- |
|
117 | instance_id = *rc-node-3- | |
118 | app.base_url = http://rc-node-1 |
|
118 | app.base_url = http://rc-node-1 | |
119 |
|
119 | |||
120 |
|
120 | |||
121 |
|
121 | |||
122 | 2) Configure `User Session` to use a shared database. Example config that should be |
|
122 | 2) Configure `User Session` to use a shared database. Example config that should be | |
123 | changed on both **rc-node-2** and **rc-node-3** . |
|
123 | changed on both **rc-node-2** and **rc-node-3** . | |
124 |
Edit :file:` |
|
124 | Edit :file:`config/_shared/rhodecode.ini` | |
125 |
|
125 | |||
126 | .. code-block:: ini |
|
126 | .. code-block:: ini | |
127 |
|
127 | |||
128 | #################################### |
|
128 | #################################### | |
129 | ### BEAKER SESSION #### |
|
129 | ### BEAKER SESSION #### | |
130 | #################################### |
|
130 | #################################### | |
131 |
|
131 | |||
132 | ## Disable the default `file` sessions |
|
132 | ## Disable the default `file` sessions | |
133 | #beaker.session.type = file |
|
133 | #beaker.session.type = file | |
134 | #beaker.session.data_dir = %(here)s/data/sessions |
|
134 | #beaker.session.data_dir = %(here)s/data/sessions | |
135 |
|
135 | |||
136 | ## use shared db based session, fast, and allows easy management over logged in users |
|
136 | ## use shared db based session, fast, and allows easy management over logged in users | |
137 | beaker.session.type = ext:database |
|
137 | beaker.session.type = ext:database | |
138 | beaker.session.table_name = db_session |
|
138 | beaker.session.table_name = db_session | |
139 | # use our rc-node-1 here |
|
139 | # use our rc-node-1 here | |
140 | beaker.session.sa.url = postgresql://postgres:qweqwe@rc-node-1/rhodecode |
|
140 | beaker.session.sa.url = postgresql://postgres:qweqwe@rc-node-1/rhodecode | |
141 | beaker.session.sa.pool_recycle = 3600 |
|
141 | beaker.session.sa.pool_recycle = 3600 | |
142 | beaker.session.sa.echo = false |
|
142 | beaker.session.sa.echo = false | |
143 |
|
143 | |||
144 | In addition make sure both instances use the same `session.secret` so users have |
|
144 | In addition make sure both instances use the same `session.secret` so users have | |
145 | persistent sessions across nodes. Please generate other one then in this example. |
|
145 | persistent sessions across nodes. Please generate other one then in this example. | |
146 |
|
146 | |||
147 | .. code-block:: ini |
|
147 | .. code-block:: ini | |
148 |
|
148 | |||
149 | # use a unique generated long string |
|
149 | # use a unique generated long string | |
150 | beaker.session.secret = 70e116cae2274656ba7265fd860aebbd |
|
150 | beaker.session.secret = 70e116cae2274656ba7265fd860aebbd | |
151 |
|
151 | |||
152 | 3) Configure stored cached/archive cache to our shared NFS `rc-node-1` |
|
152 | 3) Configure stored cached/archive cache to our shared NFS `rc-node-1` | |
153 |
|
153 | |||
154 | .. code-block:: ini |
|
154 | .. code-block:: ini | |
155 |
|
155 | |||
156 | # note the `_` prefix that allows using a directory without |
|
156 | # note the `_` prefix that allows using a directory without | |
157 | # remap and rescan checking for vcs inside it. |
|
157 | # remap and rescan checking for vcs inside it. | |
158 | cache_dir = /home/rcdev/storage/_cache_dir/data |
|
158 | cache_dir = /home/rcdev/storage/_cache_dir/data | |
159 | # note archive cache dir is disabled by default, however if you enable |
|
159 | # note archive cache dir is disabled by default, however if you enable | |
160 | # it also needs to be shared |
|
160 | # it also needs to be shared | |
161 | #archive_cache_dir = /home/rcdev/storage/_tarball_cache_dir |
|
161 | #archive_cache_dir = /home/rcdev/storage/_tarball_cache_dir | |
162 |
|
162 | |||
163 |
|
163 | |||
164 | 4) Use shared exception store. Example config that should be |
|
164 | 4) Use shared exception store. Example config that should be | |
165 | changed on both **rc-node-2** and **rc-node-3**, and also for VCSServer. |
|
165 | changed on both **rc-node-2** and **rc-node-3**, and also for VCSServer. | |
166 |
Edit :file:` |
|
166 | Edit :file:`config/_shared/rhodecode.ini` and | |
167 | :file:`/home/{user}/.rccontrol/{vcsserver-instance-id}/vcsserver.ini` |
|
167 | :file:`/home/{user}/.rccontrol/{vcsserver-instance-id}/vcsserver.ini` | |
168 | and add/change following setting. |
|
168 | and add/change following setting. | |
169 |
|
169 | |||
170 | .. code-block:: ini |
|
170 | .. code-block:: ini | |
171 |
|
171 | |||
172 | exception_tracker.store_path = /home/rcdev/storage/_exception_store_data |
|
172 | exception_tracker.store_path = /home/rcdev/storage/_exception_store_data | |
173 |
|
173 | |||
174 |
|
174 | |||
175 | 5) Change cache backends to use `Redis`_ based caches. Below full example config |
|
175 | 5) Change cache backends to use `Redis`_ based caches. Below full example config | |
176 | that replaces default file-based cache to shared `Redis`_ with Distributed Lock. |
|
176 | that replaces default file-based cache to shared `Redis`_ with Distributed Lock. | |
177 |
|
177 | |||
178 |
|
178 | |||
179 | .. code-block:: ini |
|
179 | .. code-block:: ini | |
180 |
|
180 | |||
181 | ##################################### |
|
181 | ##################################### | |
182 | ### DOGPILE CACHE #### |
|
182 | ### DOGPILE CACHE #### | |
183 | ##################################### |
|
183 | ##################################### | |
184 |
|
184 | |||
185 | ## `cache_perms` cache settings for permission tree, auth TTL. |
|
185 | ## `cache_perms` cache settings for permission tree, auth TTL. | |
186 | #rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace |
|
186 | #rc_cache.cache_perms.backend = dogpile.cache.rc.file_namespace | |
187 | #rc_cache.cache_perms.expiration_time = 300 |
|
187 | #rc_cache.cache_perms.expiration_time = 300 | |
188 |
|
188 | |||
189 | ## alternative `cache_perms` redis backend with distributed lock |
|
189 | ## alternative `cache_perms` redis backend with distributed lock | |
190 | rc_cache.cache_perms.backend = dogpile.cache.rc.redis |
|
190 | rc_cache.cache_perms.backend = dogpile.cache.rc.redis | |
191 | rc_cache.cache_perms.expiration_time = 300 |
|
191 | rc_cache.cache_perms.expiration_time = 300 | |
192 | ## redis_expiration_time needs to be greater then expiration_time |
|
192 | ## redis_expiration_time needs to be greater then expiration_time | |
193 | rc_cache.cache_perms.arguments.redis_expiration_time = 7200 |
|
193 | rc_cache.cache_perms.arguments.redis_expiration_time = 7200 | |
194 | rc_cache.cache_perms.arguments.socket_timeout = 30 |
|
194 | rc_cache.cache_perms.arguments.socket_timeout = 30 | |
195 | rc_cache.cache_perms.arguments.host = rc-node-1 |
|
195 | rc_cache.cache_perms.arguments.host = rc-node-1 | |
196 | rc_cache.cache_perms.arguments.password = qweqwe |
|
196 | rc_cache.cache_perms.arguments.password = qweqwe | |
197 | rc_cache.cache_perms.arguments.port = 6379 |
|
197 | rc_cache.cache_perms.arguments.port = 6379 | |
198 | rc_cache.cache_perms.arguments.db = 0 |
|
198 | rc_cache.cache_perms.arguments.db = 0 | |
199 | rc_cache.cache_perms.arguments.distributed_lock = true |
|
199 | rc_cache.cache_perms.arguments.distributed_lock = true | |
200 |
|
200 | |||
201 | ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS |
|
201 | ## `cache_repo` cache settings for FileTree, Readme, RSS FEEDS | |
202 | #rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace |
|
202 | #rc_cache.cache_repo.backend = dogpile.cache.rc.file_namespace | |
203 | #rc_cache.cache_repo.expiration_time = 2592000 |
|
203 | #rc_cache.cache_repo.expiration_time = 2592000 | |
204 |
|
204 | |||
205 | ## alternative `cache_repo` redis backend with distributed lock |
|
205 | ## alternative `cache_repo` redis backend with distributed lock | |
206 | rc_cache.cache_repo.backend = dogpile.cache.rc.redis |
|
206 | rc_cache.cache_repo.backend = dogpile.cache.rc.redis | |
207 | rc_cache.cache_repo.expiration_time = 2592000 |
|
207 | rc_cache.cache_repo.expiration_time = 2592000 | |
208 | ## redis_expiration_time needs to be greater then expiration_time |
|
208 | ## redis_expiration_time needs to be greater then expiration_time | |
209 | rc_cache.cache_repo.arguments.redis_expiration_time = 2678400 |
|
209 | rc_cache.cache_repo.arguments.redis_expiration_time = 2678400 | |
210 | rc_cache.cache_repo.arguments.socket_timeout = 30 |
|
210 | rc_cache.cache_repo.arguments.socket_timeout = 30 | |
211 | rc_cache.cache_repo.arguments.host = rc-node-1 |
|
211 | rc_cache.cache_repo.arguments.host = rc-node-1 | |
212 | rc_cache.cache_repo.arguments.password = qweqwe |
|
212 | rc_cache.cache_repo.arguments.password = qweqwe | |
213 | rc_cache.cache_repo.arguments.port = 6379 |
|
213 | rc_cache.cache_repo.arguments.port = 6379 | |
214 | rc_cache.cache_repo.arguments.db = 1 |
|
214 | rc_cache.cache_repo.arguments.db = 1 | |
215 | rc_cache.cache_repo.arguments.distributed_lock = true |
|
215 | rc_cache.cache_repo.arguments.distributed_lock = true | |
216 |
|
216 | |||
217 | ## cache settings for SQL queries, this needs to use memory type backend |
|
217 | ## cache settings for SQL queries, this needs to use memory type backend | |
218 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru |
|
218 | rc_cache.sql_cache_short.backend = dogpile.cache.rc.memory_lru | |
219 | rc_cache.sql_cache_short.expiration_time = 30 |
|
219 | rc_cache.sql_cache_short.expiration_time = 30 | |
220 |
|
220 | |||
221 | ## `cache_repo_longterm` cache for repo object instances, this needs to use memory |
|
221 | ## `cache_repo_longterm` cache for repo object instances, this needs to use memory | |
222 | ## type backend as the objects kept are not pickle serializable |
|
222 | ## type backend as the objects kept are not pickle serializable | |
223 | rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru |
|
223 | rc_cache.cache_repo_longterm.backend = dogpile.cache.rc.memory_lru | |
224 | ## by default we use 96H, this is using invalidation on push anyway |
|
224 | ## by default we use 96H, this is using invalidation on push anyway | |
225 | rc_cache.cache_repo_longterm.expiration_time = 345600 |
|
225 | rc_cache.cache_repo_longterm.expiration_time = 345600 | |
226 | ## max items in LRU cache, reduce this number to save memory, and expire last used |
|
226 | ## max items in LRU cache, reduce this number to save memory, and expire last used | |
227 | ## cached objects |
|
227 | ## cached objects | |
228 | rc_cache.cache_repo_longterm.max_size = 10000 |
|
228 | rc_cache.cache_repo_longterm.max_size = 10000 | |
229 |
|
229 | |||
230 |
|
230 | |||
231 | 6) Configure `Nginx`_ as reverse proxy on `rc-node-2/3`: |
|
231 | 6) Configure `Nginx`_ as reverse proxy on `rc-node-2/3`: | |
232 | Minimal `Nginx`_ config used: |
|
232 | Minimal `Nginx`_ config used: | |
233 |
|
233 | |||
234 |
|
234 | |||
235 | .. code-block:: nginx |
|
235 | .. code-block:: nginx | |
236 |
|
236 | |||
237 | ## rate limiter for certain pages to prevent brute force attacks |
|
237 | ## rate limiter for certain pages to prevent brute force attacks | |
238 | limit_req_zone $binary_remote_addr zone=req_limit:10m rate=1r/s; |
|
238 | limit_req_zone $binary_remote_addr zone=req_limit:10m rate=1r/s; | |
239 |
|
239 | |||
240 | ## custom log format |
|
240 | ## custom log format | |
241 | log_format log_custom '$remote_addr - $remote_user [$time_local] ' |
|
241 | log_format log_custom '$remote_addr - $remote_user [$time_local] ' | |
242 | '"$request" $status $body_bytes_sent ' |
|
242 | '"$request" $status $body_bytes_sent ' | |
243 | '"$http_referer" "$http_user_agent" ' |
|
243 | '"$http_referer" "$http_user_agent" ' | |
244 | '$request_time $upstream_response_time $pipe'; |
|
244 | '$request_time $upstream_response_time $pipe'; | |
245 |
|
245 | |||
246 | server { |
|
246 | server { | |
247 | listen 80; |
|
247 | listen 80; | |
248 | server_name rc-node-2; |
|
248 | server_name rc-node-2; | |
249 | #server_name rc-node-3; |
|
249 | #server_name rc-node-3; | |
250 |
|
250 | |||
251 | access_log /var/log/nginx/rhodecode.access.log log_custom; |
|
251 | access_log /var/log/nginx/rhodecode.access.log log_custom; | |
252 | error_log /var/log/nginx/rhodecode.error.log; |
|
252 | error_log /var/log/nginx/rhodecode.error.log; | |
253 |
|
253 | |||
254 | # example of proxy.conf can be found in our docs. |
|
254 | # example of proxy.conf can be found in our docs. | |
255 | include /etc/nginx/proxy.conf; |
|
255 | include /etc/nginx/proxy.conf; | |
256 |
|
256 | |||
257 | ## serve static files by Nginx, recommended for performance |
|
257 | ## serve static files by Nginx, recommended for performance | |
258 | location /_static/rhodecode { |
|
258 | location /_static/rhodecode { | |
259 | gzip on; |
|
259 | gzip on; | |
260 | gzip_min_length 500; |
|
260 | gzip_min_length 500; | |
261 | gzip_proxied any; |
|
261 | gzip_proxied any; | |
262 | gzip_comp_level 4; |
|
262 | gzip_comp_level 4; | |
263 | gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml; |
|
263 | gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml; | |
264 | gzip_vary on; |
|
264 | gzip_vary on; | |
265 | gzip_disable "msie6"; |
|
265 | gzip_disable "msie6"; | |
266 | expires 60d; |
|
266 | expires 60d; | |
267 | #alias /home/rcdev/.rccontrol/community-1/static; |
|
267 | #alias /home/rcdev/.rccontrol/community-1/static; | |
268 | alias /home/rcdev/.rccontrol/enterprise-1/static; |
|
268 | alias /home/rcdev/.rccontrol/enterprise-1/static; | |
269 | } |
|
269 | } | |
270 |
|
270 | |||
271 |
|
271 | |||
272 | location /_admin/login { |
|
272 | location /_admin/login { | |
273 | limit_req zone=req_limit burst=10 nodelay; |
|
273 | limit_req zone=req_limit burst=10 nodelay; | |
274 | try_files $uri @rhode; |
|
274 | try_files $uri @rhode; | |
275 | } |
|
275 | } | |
276 |
|
276 | |||
277 | location / { |
|
277 | location / { | |
278 | try_files $uri @rhode; |
|
278 | try_files $uri @rhode; | |
279 | } |
|
279 | } | |
280 |
|
280 | |||
281 | location @rhode { |
|
281 | location @rhode { | |
282 | # Url to running RhodeCode instance. |
|
282 | # Url to running RhodeCode instance. | |
283 | # This is shown as `- URL: <host>` in output from rccontrol status. |
|
283 | # This is shown as `- URL: <host>` in output from rccontrol status. | |
284 | proxy_pass http://127.0.0.1:10020; |
|
284 | proxy_pass http://127.0.0.1:10020; | |
285 | } |
|
285 | } | |
286 |
|
286 | |||
287 | ## custom 502 error page. Will be displayed while RhodeCode server |
|
287 | ## custom 502 error page. Will be displayed while RhodeCode server | |
288 | ## is turned off |
|
288 | ## is turned off | |
289 | error_page 502 /502.html; |
|
289 | error_page 502 /502.html; | |
290 | location = /502.html { |
|
290 | location = /502.html { | |
291 | #root /home/rcdev/.rccontrol/community-1/static; |
|
291 | #root /home/rcdev/.rccontrol/community-1/static; | |
292 | root /home/rcdev/.rccontrol/enterprise-1/static; |
|
292 | root /home/rcdev/.rccontrol/enterprise-1/static; | |
293 | } |
|
293 | } | |
294 | } |
|
294 | } | |
295 |
|
295 | |||
296 |
|
296 | |||
297 | 7) Optional: Full text search, in case you use `Whoosh` full text search we also need a |
|
297 | 7) Optional: Full text search, in case you use `Whoosh` full text search we also need a | |
298 | shared storage for the index. In our example our NFS is mounted at `/home/rcdev/storage` |
|
298 | shared storage for the index. In our example our NFS is mounted at `/home/rcdev/storage` | |
299 | which represents out storage so we can use the following: |
|
299 | which represents out storage so we can use the following: | |
300 |
|
300 | |||
301 | .. code-block:: ini |
|
301 | .. code-block:: ini | |
302 |
|
302 | |||
303 | # note the `_` prefix that allows using a directory without |
|
303 | # note the `_` prefix that allows using a directory without | |
304 | # remap and rescan checking for vcs inside it. |
|
304 | # remap and rescan checking for vcs inside it. | |
305 | search.location = /home/rcdev/storage/_index_data/index |
|
305 | search.location = /home/rcdev/storage/_index_data/index | |
306 |
|
306 | |||
307 |
|
307 | |||
308 | .. note:: |
|
308 | .. note:: | |
309 |
|
309 | |||
310 | If you use ElasticSearch it's by default shared, and simply running ES node is |
|
310 | If you use ElasticSearch it's by default shared, and simply running ES node is | |
311 | by default cluster compatible. |
|
311 | by default cluster compatible. | |
312 |
|
312 | |||
313 |
|
313 | |||
314 | 8) Optional: If you intend to use mailing all instances need to use either a shared |
|
314 | 8) Optional: If you intend to use mailing all instances need to use either a shared | |
315 | mailing node, or each will use individual local mail agent. Simply put node-1/2/3 |
|
315 | mailing node, or each will use individual local mail agent. Simply put node-1/2/3 | |
316 | needs to use same mailing configuration. |
|
316 | needs to use same mailing configuration. | |
317 |
|
317 | |||
318 |
|
318 | |||
319 |
|
319 | |||
320 | Setup rc-node-1 |
|
320 | Setup rc-node-1 | |
321 | ^^^^^^^^^^^^^^^ |
|
321 | ^^^^^^^^^^^^^^^ | |
322 |
|
322 | |||
323 |
|
323 | |||
324 | Configure `Nginx`_ as Load Balancer to rc-node-2/3. |
|
324 | Configure `Nginx`_ as Load Balancer to rc-node-2/3. | |
325 | Minimal `Nginx`_ example below: |
|
325 | Minimal `Nginx`_ example below: | |
326 |
|
326 | |||
327 | .. code-block:: nginx |
|
327 | .. code-block:: nginx | |
328 |
|
328 | |||
329 | ## define rc-cluster which contains a pool of our instances to connect to |
|
329 | ## define rc-cluster which contains a pool of our instances to connect to | |
330 | upstream rc-cluster { |
|
330 | upstream rc-cluster { | |
331 | # rc-node-2/3 are stored in /etc/hosts with correct IP addresses |
|
331 | # rc-node-2/3 are stored in /etc/hosts with correct IP addresses | |
332 | server rc-node-2:80; |
|
332 | server rc-node-2:80; | |
333 | server rc-node-3:80; |
|
333 | server rc-node-3:80; | |
334 | } |
|
334 | } | |
335 |
|
335 | |||
336 | server { |
|
336 | server { | |
337 | listen 80; |
|
337 | listen 80; | |
338 | server_name rc-node-1; |
|
338 | server_name rc-node-1; | |
339 |
|
339 | |||
340 | location / { |
|
340 | location / { | |
341 | proxy_pass http://rc-cluster; |
|
341 | proxy_pass http://rc-cluster; | |
342 | } |
|
342 | } | |
343 | } |
|
343 | } | |
344 |
|
344 | |||
345 |
|
345 | |||
346 | .. note:: |
|
346 | .. note:: | |
347 |
|
347 | |||
348 | You should configure your load balancing accordingly. We recommend writing |
|
348 | You should configure your load balancing accordingly. We recommend writing | |
349 | load balancing rules that will separate regular user traffic from |
|
349 | load balancing rules that will separate regular user traffic from | |
350 | automated process traffic like continuous servers or build bots. Sticky sessions |
|
350 | automated process traffic like continuous servers or build bots. Sticky sessions | |
351 | are not required. |
|
351 | are not required. | |
352 |
|
352 | |||
353 |
|
353 | |||
354 | Show which instance handles a request |
|
354 | Show which instance handles a request | |
355 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
355 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
356 |
|
356 | |||
357 | You can easily check if load-balancing is working as expected. Visit our main node |
|
357 | You can easily check if load-balancing is working as expected. Visit our main node | |
358 | `rc-node-1` URL which at that point should already handle incoming requests and balance |
|
358 | `rc-node-1` URL which at that point should already handle incoming requests and balance | |
359 | it across node-2/3. |
|
359 | it across node-2/3. | |
360 |
|
360 | |||
361 | Add a special GET param `?showrcid=1` to show current instance handling your request. |
|
361 | Add a special GET param `?showrcid=1` to show current instance handling your request. | |
362 |
|
362 | |||
363 | For example: visiting url `http://rc-node-1/?showrcid=1` will show, in the bottom |
|
363 | For example: visiting url `http://rc-node-1/?showrcid=1` will show, in the bottom | |
364 | of the screen` cluster instance info. |
|
364 | of the screen` cluster instance info. | |
365 | e.g: `RhodeCode instance id: rc-node-3-rc-node-3-3246` |
|
365 | e.g: `RhodeCode instance id: rc-node-3-rc-node-3-3246` | |
366 | which is generated from:: |
|
366 | which is generated from:: | |
367 |
|
367 | |||
368 | <NODE_HOSTNAME>-<INSTANCE_ID>-<WORKER_PID> |
|
368 | <NODE_HOSTNAME>-<INSTANCE_ID>-<WORKER_PID> | |
369 |
|
369 | |||
370 |
|
370 | |||
371 | Using Celery with cluster |
|
371 | Using Celery with cluster | |
372 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
372 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
373 |
|
373 | |||
374 |
|
374 | |||
375 | If `Celery` is used we recommend setting also an instance of Enterprise/Community+VCSserver |
|
375 | If `Celery` is used we recommend setting also an instance of Enterprise/Community+VCSserver | |
376 | on the node that is running `RabbitMQ`_ or `Redis`_. Those instances will be used to |
|
376 | on the node that is running `RabbitMQ`_ or `Redis`_. Those instances will be used to | |
377 | executed async tasks on the `rc-node-1`. This is the most efficient setup. |
|
377 | executed async tasks on the `rc-node-1`. This is the most efficient setup. | |
378 | `Celery` usually handles tasks such as sending emails, forking repositories, importing |
|
378 | `Celery` usually handles tasks such as sending emails, forking repositories, importing | |
379 | repositories from external location etc. Using workers on instance that has |
|
379 | repositories from external location etc. Using workers on instance that has | |
380 | the direct access to disks used by NFS as well as email server gives noticeable |
|
380 | the direct access to disks used by NFS as well as email server gives noticeable | |
381 | performance boost. Running local workers to the NFS storage results in faster |
|
381 | performance boost. Running local workers to the NFS storage results in faster | |
382 | execution of forking large repositories or sending lots of emails. |
|
382 | execution of forking large repositories or sending lots of emails. | |
383 |
|
383 | |||
384 | Those instances need to be configured in the same way as for other nodes. |
|
384 | Those instances need to be configured in the same way as for other nodes. | |
385 | The instance in rc-node-1 can be added to the cluster, but we don't recommend doing it. |
|
385 | The instance in rc-node-1 can be added to the cluster, but we don't recommend doing it. | |
386 | For best results let it be isolated to only executing `Celery` tasks in the cluster setup. |
|
386 | For best results let it be isolated to only executing `Celery` tasks in the cluster setup. | |
387 |
|
387 | |||
388 |
|
388 | |||
389 | .. _Gunicorn: http://gunicorn.org/ |
|
389 | .. _Gunicorn: http://gunicorn.org/ | |
390 | .. _Whoosh: https://pypi.python.org/pypi/Whoosh/ |
|
390 | .. _Whoosh: https://pypi.python.org/pypi/Whoosh/ | |
391 | .. _Elasticsearch: https://www.elastic.co/.. |
|
391 | .. _Elasticsearch: https://www.elastic.co/.. | |
392 | .. _RabbitMQ: http://www.rabbitmq.com/ |
|
392 | .. _RabbitMQ: http://www.rabbitmq.com/ | |
393 | .. _Nginx: http://nginx.io |
|
393 | .. _Nginx: http://nginx.io | |
394 | .. _Apache: http://nginx.io |
|
394 | .. _Apache: http://nginx.io | |
395 | .. _Redis: http://redis.io |
|
395 | .. _Redis: http://redis.io | |
396 |
|
396 |
@@ -1,67 +1,67 b'' | |||||
1 | .. _user-session-ref: |
|
1 | .. _user-session-ref: | |
2 |
|
2 | |||
3 | User Session Performance |
|
3 | User Session Performance | |
4 | ------------------------ |
|
4 | ------------------------ | |
5 |
|
5 | |||
6 | The default file-based sessions are only suitable for smaller setups, or |
|
6 | The default file-based sessions are only suitable for smaller setups, or | |
7 | instances that doesn't have a lot of users or traffic. |
|
7 | instances that doesn't have a lot of users or traffic. | |
8 | They are set as default option because it's setup-free solution. |
|
8 | They are set as default option because it's setup-free solution. | |
9 |
|
9 | |||
10 | The most common issue of file based sessions are file limit errors which occur |
|
10 | The most common issue of file based sessions are file limit errors which occur | |
11 | if there are lots of session files. |
|
11 | if there are lots of session files. | |
12 |
|
12 | |||
13 | Therefore, in a large scale deployment, to give better performance, |
|
13 | Therefore, in a large scale deployment, to give better performance, | |
14 | scalability, and maintainability we recommend switching from file-based |
|
14 | scalability, and maintainability we recommend switching from file-based | |
15 | sessions to database-based user sessions or Redis based sessions. |
|
15 | sessions to database-based user sessions or Redis based sessions. | |
16 |
|
16 | |||
17 | To switch to database-based user sessions uncomment the following section in |
|
17 | To switch to database-based user sessions uncomment the following section in | |
18 |
your :file:` |
|
18 | your :file:`config/_shared/rhodecode.ini` file. | |
19 |
|
19 | |||
20 |
|
20 | |||
21 | .. code-block:: ini |
|
21 | .. code-block:: ini | |
22 |
|
22 | |||
23 | ## db based session, fast, and allows easy management over logged in users |
|
23 | ## db based session, fast, and allows easy management over logged in users | |
24 | beaker.session.type = ext:database |
|
24 | beaker.session.type = ext:database | |
25 | beaker.session.table_name = db_session |
|
25 | beaker.session.table_name = db_session | |
26 |
|
26 | |||
27 | # use just one of the following according to the type of database |
|
27 | # use just one of the following according to the type of database | |
28 | beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode |
|
28 | beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode | |
29 | # or |
|
29 | # or | |
30 | beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode |
|
30 | beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode | |
31 |
|
31 | |||
32 | beaker.session.sa.pool_recycle = 3600 |
|
32 | beaker.session.sa.pool_recycle = 3600 | |
33 | beaker.session.sa.echo = false |
|
33 | beaker.session.sa.echo = false | |
34 |
|
34 | |||
35 |
|
35 | |||
36 | and make sure you comment out the file based sessions. |
|
36 | and make sure you comment out the file based sessions. | |
37 |
|
37 | |||
38 | .. code-block:: ini |
|
38 | .. code-block:: ini | |
39 |
|
39 | |||
40 | ## types are file, ext:memcached, ext:database, and memory (default). |
|
40 | ## types are file, ext:memcached, ext:database, and memory (default). | |
41 | #beaker.session.type = file |
|
41 | #beaker.session.type = file | |
42 | #beaker.session.data_dir = %(here)s/data/sessions/data |
|
42 | #beaker.session.data_dir = %(here)s/data/sessions/data | |
43 |
|
43 | |||
44 |
|
44 | |||
45 | The `table_name` will be automatically created on specified database if it isn't yet existing. |
|
45 | The `table_name` will be automatically created on specified database if it isn't yet existing. | |
46 | Database specified in the `beaker.session.sa.url` can be the same that RhodeCode |
|
46 | Database specified in the `beaker.session.sa.url` can be the same that RhodeCode | |
47 | uses, or if required it can be a different one. We recommend to use the same database. |
|
47 | uses, or if required it can be a different one. We recommend to use the same database. | |
48 |
|
48 | |||
49 |
|
49 | |||
50 |
|
50 | |||
51 | To switch to redis-based user sessions uncomment the following section in |
|
51 | To switch to redis-based user sessions uncomment the following section in | |
52 |
your :file:` |
|
52 | your :file:`config/_shared/rhodecode.ini` file. | |
53 |
|
53 | |||
54 | .. code-block:: ini |
|
54 | .. code-block:: ini | |
55 |
|
55 | |||
56 | ## redis sessions |
|
56 | ## redis sessions | |
57 | beaker.session.type = ext:redis |
|
57 | beaker.session.type = ext:redis | |
58 | beaker.session.url = localhost:6379 |
|
58 | beaker.session.url = localhost:6379 | |
59 |
|
59 | |||
60 |
|
60 | |||
61 | and make sure you comment out the file based sessions. |
|
61 | and make sure you comment out the file based sessions. | |
62 |
|
62 | |||
63 | .. code-block:: ini |
|
63 | .. code-block:: ini | |
64 |
|
64 | |||
65 | ## types are file, ext:memcached, ext:database, and memory (default). |
|
65 | ## types are file, ext:memcached, ext:database, and memory (default). | |
66 | #beaker.session.type = file |
|
66 | #beaker.session.type = file | |
67 | #beaker.session.data_dir = %(here)s/data/sessions/data No newline at end of file |
|
67 | #beaker.session.data_dir = %(here)s/data/sessions/data |
@@ -1,379 +1,379 b'' | |||||
1 | .. _vcs-server: |
|
1 | .. _vcs-server: | |
2 |
|
2 | |||
3 | VCS Server Management |
|
3 | VCS Server Management | |
4 | --------------------- |
|
4 | --------------------- | |
5 |
|
5 | |||
6 | The VCS Server handles |RCE| backend functionality. You need to configure |
|
6 | The VCS Server handles |RCE| backend functionality. You need to configure | |
7 | a VCS Server to run with a |RCE| instance. If you do not, you will be missing |
|
7 | a VCS Server to run with a |RCE| instance. If you do not, you will be missing | |
8 | the connection between |RCE| and its |repos|. This will cause error messages |
|
8 | the connection between |RCE| and its |repos|. This will cause error messages | |
9 | on the web interface. You can run your setup in the following configurations, |
|
9 | on the web interface. You can run your setup in the following configurations, | |
10 | currently the best performance is one of following: |
|
10 | currently the best performance is one of following: | |
11 |
|
11 | |||
12 | * One VCS Server per |RCE| instance. |
|
12 | * One VCS Server per |RCE| instance. | |
13 | * One VCS Server handling multiple instances. |
|
13 | * One VCS Server handling multiple instances. | |
14 |
|
14 | |||
15 | .. important:: |
|
15 | .. important:: | |
16 |
|
16 | |||
17 | If your server locale settings are not correctly configured, |
|
17 | If your server locale settings are not correctly configured, | |
18 | |RCE| and the VCS Server can run into issues. See this `Ask Ubuntu`_ post |
|
18 | |RCE| and the VCS Server can run into issues. See this `Ask Ubuntu`_ post | |
19 | which explains the problem and gives a solution. |
|
19 | which explains the problem and gives a solution. | |
20 |
|
20 | |||
21 | For more information, see the following sections: |
|
21 | For more information, see the following sections: | |
22 |
|
22 | |||
23 | * :ref:`install-vcs` |
|
23 | * :ref:`install-vcs` | |
24 | * :ref:`config-vcs` |
|
24 | * :ref:`config-vcs` | |
25 | * :ref:`vcs-server-options` |
|
25 | * :ref:`vcs-server-options` | |
26 | * :ref:`vcs-server-versions` |
|
26 | * :ref:`vcs-server-versions` | |
27 | * :ref:`vcs-server-maintain` |
|
27 | * :ref:`vcs-server-maintain` | |
28 | * :ref:`vcs-server-config-file` |
|
28 | * :ref:`vcs-server-config-file` | |
29 | * :ref:`svn-http` |
|
29 | * :ref:`svn-http` | |
30 |
|
30 | |||
31 | .. _install-vcs: |
|
31 | .. _install-vcs: | |
32 |
|
32 | |||
33 | VCS Server Installation |
|
33 | VCS Server Installation | |
34 | ^^^^^^^^^^^^^^^^^^^^^^^ |
|
34 | ^^^^^^^^^^^^^^^^^^^^^^^ | |
35 |
|
35 | |||
36 | To install a VCS Server, see |
|
36 | To install a VCS Server, see | |
37 | :ref:`Installing a VCS server <control:install-vcsserver>`. |
|
37 | :ref:`Installing a VCS server <control:install-vcsserver>`. | |
38 |
|
38 | |||
39 | .. _config-vcs: |
|
39 | .. _config-vcs: | |
40 |
|
40 | |||
41 | Hooking |RCE| to its VCS Server |
|
41 | Hooking |RCE| to its VCS Server | |
42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
43 |
|
43 | |||
44 | To configure a |RCE| instance to use a VCS server, see |
|
44 | To configure a |RCE| instance to use a VCS server, see | |
45 | :ref:`Configuring the VCS Server connection <control:manually-vcsserver-ini>`. |
|
45 | :ref:`Configuring the VCS Server connection <control:manually-vcsserver-ini>`. | |
46 |
|
46 | |||
47 | .. _vcs-server-options: |
|
47 | .. _vcs-server-options: | |
48 |
|
48 | |||
49 | |RCE| VCS Server Options |
|
49 | |RCE| VCS Server Options | |
50 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
|
50 | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
51 |
|
51 | |||
52 | The following list shows the available options on the |RCE| side of the |
|
52 | The following list shows the available options on the |RCE| side of the | |
53 | connection to the VCS Server. The settings are configured per |
|
53 | connection to the VCS Server. The settings are configured per | |
54 | instance in the |
|
54 | instance in the | |
55 |
:file:` |
|
55 | :file:`config/_shared/rhodecode.ini` file. | |
56 |
|
56 | |||
57 | .. rst-class:: dl-horizontal |
|
57 | .. rst-class:: dl-horizontal | |
58 |
|
58 | |||
59 | \vcs.backends <available-vcs-systems> |
|
59 | \vcs.backends <available-vcs-systems> | |
60 | Set a comma-separated list of the |repo| options available from the |
|
60 | Set a comma-separated list of the |repo| options available from the | |
61 | web interface. The default is ``hg, git, svn``, |
|
61 | web interface. The default is ``hg, git, svn``, | |
62 | which is all |repo| types available. The order of backends is also the |
|
62 | which is all |repo| types available. The order of backends is also the | |
63 | order backend will try to detect requests type. |
|
63 | order backend will try to detect requests type. | |
64 |
|
64 | |||
65 | \vcs.connection_timeout <seconds> |
|
65 | \vcs.connection_timeout <seconds> | |
66 | Set the length of time in seconds that the VCS Server waits for |
|
66 | Set the length of time in seconds that the VCS Server waits for | |
67 | requests to process. After the timeout expires, |
|
67 | requests to process. After the timeout expires, | |
68 | the request is closed. The default is ``3600``. Set to a higher |
|
68 | the request is closed. The default is ``3600``. Set to a higher | |
69 | number if you experience network latency, or timeout issues with very |
|
69 | number if you experience network latency, or timeout issues with very | |
70 | large push/pull requests. |
|
70 | large push/pull requests. | |
71 |
|
71 | |||
72 | \vcs.server.enable <boolean> |
|
72 | \vcs.server.enable <boolean> | |
73 | Enable or disable the VCS Server. The available options are ``true`` or |
|
73 | Enable or disable the VCS Server. The available options are ``true`` or | |
74 | ``false``. The default is ``true``. |
|
74 | ``false``. The default is ``true``. | |
75 |
|
75 | |||
76 | \vcs.server <host:port> |
|
76 | \vcs.server <host:port> | |
77 | Set the host, either hostname or IP Address, and port of the VCS server |
|
77 | Set the host, either hostname or IP Address, and port of the VCS server | |
78 | you wish to run with your |RCE| instance. |
|
78 | you wish to run with your |RCE| instance. | |
79 |
|
79 | |||
80 | .. code-block:: ini |
|
80 | .. code-block:: ini | |
81 |
|
81 | |||
82 | ################## |
|
82 | ################## | |
83 | ### VCS CONFIG ### |
|
83 | ### VCS CONFIG ### | |
84 | ################## |
|
84 | ################## | |
85 | # set this line to match your VCS Server |
|
85 | # set this line to match your VCS Server | |
86 | vcs.server = 127.0.0.1:10004 |
|
86 | vcs.server = 127.0.0.1:10004 | |
87 | # Set to False to disable the VCS Server |
|
87 | # Set to False to disable the VCS Server | |
88 | vcs.server.enable = True |
|
88 | vcs.server.enable = True | |
89 | vcs.backends = hg, git, svn |
|
89 | vcs.backends = hg, git, svn | |
90 | vcs.connection_timeout = 3600 |
|
90 | vcs.connection_timeout = 3600 | |
91 |
|
91 | |||
92 |
|
92 | |||
93 | .. _vcs-server-versions: |
|
93 | .. _vcs-server-versions: | |
94 |
|
94 | |||
95 | VCS Server Versions |
|
95 | VCS Server Versions | |
96 | ^^^^^^^^^^^^^^^^^^^ |
|
96 | ^^^^^^^^^^^^^^^^^^^ | |
97 |
|
97 | |||
98 | An updated version of the VCS Server is released with each |RCE| version. Use |
|
98 | An updated version of the VCS Server is released with each |RCE| version. Use | |
99 | the VCS Server number that matches with the |RCE| version to pair the |
|
99 | the VCS Server number that matches with the |RCE| version to pair the | |
100 | appropriate ones together. For |RCE| versions pre 3.3.0, |
|
100 | appropriate ones together. For |RCE| versions pre 3.3.0, | |
101 | VCS Server 1.X.Y works with |RCE| 3.X.Y, for example: |
|
101 | VCS Server 1.X.Y works with |RCE| 3.X.Y, for example: | |
102 |
|
102 | |||
103 | * VCS Server 1.0.0 works with |RCE| 3.0.0 |
|
103 | * VCS Server 1.0.0 works with |RCE| 3.0.0 | |
104 | * VCS Server 1.2.2 works with |RCE| 3.2.2 |
|
104 | * VCS Server 1.2.2 works with |RCE| 3.2.2 | |
105 |
|
105 | |||
106 | For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers |
|
106 | For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers | |
107 | match, for example: |
|
107 | match, for example: | |
108 |
|
108 | |||
109 | * VCS Server |release| works with |RCE| |release| |
|
109 | * VCS Server |release| works with |RCE| |release| | |
110 |
|
110 | |||
111 | .. _vcs-server-maintain: |
|
111 | .. _vcs-server-maintain: | |
112 |
|
112 | |||
113 | VCS Server Cache Optimization |
|
113 | VCS Server Cache Optimization | |
114 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
114 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
115 |
|
115 | |||
116 | To optimize the VCS server to manage the cache and memory usage efficiently, it's recommended to |
|
116 | To optimize the VCS server to manage the cache and memory usage efficiently, it's recommended to | |
117 | configure the Redis backend for VCSServer caches. |
|
117 | configure the Redis backend for VCSServer caches. | |
118 | Once configured, restart the VCS Server. |
|
118 | Once configured, restart the VCS Server. | |
119 |
|
119 | |||
120 | Make sure Redis is installed and running. |
|
120 | Make sure Redis is installed and running. | |
121 | Open :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` |
|
121 | Open :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` | |
122 | file and ensure the below settings for `repo_object` type cache are set: |
|
122 | file and ensure the below settings for `repo_object` type cache are set: | |
123 |
|
123 | |||
124 | .. code-block:: ini |
|
124 | .. code-block:: ini | |
125 |
|
125 | |||
126 | ; ensure the default file based cache is *commented out* |
|
126 | ; ensure the default file based cache is *commented out* | |
127 | ##rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace |
|
127 | ##rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace | |
128 | ##rc_cache.repo_object.expiration_time = 2592000 |
|
128 | ##rc_cache.repo_object.expiration_time = 2592000 | |
129 |
|
129 | |||
130 | ; `repo_object` cache settings for vcs methods for repositories |
|
130 | ; `repo_object` cache settings for vcs methods for repositories | |
131 | rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack |
|
131 | rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack | |
132 |
|
132 | |||
133 | ; cache auto-expires after N seconds |
|
133 | ; cache auto-expires after N seconds | |
134 | ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days) |
|
134 | ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days) | |
135 | rc_cache.repo_object.expiration_time = 2592000 |
|
135 | rc_cache.repo_object.expiration_time = 2592000 | |
136 |
|
136 | |||
137 | ; redis_expiration_time needs to be greater then expiration_time |
|
137 | ; redis_expiration_time needs to be greater then expiration_time | |
138 | rc_cache.repo_object.arguments.redis_expiration_time = 3592000 |
|
138 | rc_cache.repo_object.arguments.redis_expiration_time = 3592000 | |
139 |
|
139 | |||
140 | rc_cache.repo_object.arguments.host = localhost |
|
140 | rc_cache.repo_object.arguments.host = localhost | |
141 | rc_cache.repo_object.arguments.port = 6379 |
|
141 | rc_cache.repo_object.arguments.port = 6379 | |
142 | rc_cache.repo_object.arguments.db = 5 |
|
142 | rc_cache.repo_object.arguments.db = 5 | |
143 | rc_cache.repo_object.arguments.socket_timeout = 30 |
|
143 | rc_cache.repo_object.arguments.socket_timeout = 30 | |
144 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
144 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
145 | rc_cache.repo_object.arguments.distributed_lock = true |
|
145 | rc_cache.repo_object.arguments.distributed_lock = true | |
146 |
|
146 | |||
147 |
|
147 | |||
148 | To clear the cache completely, you can restart the VCS Server. |
|
148 | To clear the cache completely, you can restart the VCS Server. | |
149 |
|
149 | |||
150 | .. important:: |
|
150 | .. important:: | |
151 |
|
151 | |||
152 | While the VCS Server handles a restart gracefully on the web interface, |
|
152 | While the VCS Server handles a restart gracefully on the web interface, | |
153 | it will drop connections during push/pull requests. So it is recommended |
|
153 | it will drop connections during push/pull requests. So it is recommended | |
154 | you only perform this when there is very little traffic on the instance. |
|
154 | you only perform this when there is very little traffic on the instance. | |
155 |
|
155 | |||
156 | Use the following example to restart your VCS Server, |
|
156 | Use the following example to restart your VCS Server, | |
157 | for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`. |
|
157 | for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`. | |
158 |
|
158 | |||
159 | .. code-block:: bash |
|
159 | .. code-block:: bash | |
160 |
|
160 | |||
161 | $ rccontrol status |
|
161 | $ rccontrol status | |
162 |
|
162 | |||
163 | .. code-block:: vim |
|
163 | .. code-block:: vim | |
164 |
|
164 | |||
165 | - NAME: vcsserver-1 |
|
165 | - NAME: vcsserver-1 | |
166 | - STATUS: RUNNING |
|
166 | - STATUS: RUNNING | |
167 | logs:/home/ubuntu/.rccontrol/vcsserver-1/vcsserver.log |
|
167 | logs:/home/ubuntu/.rccontrol/vcsserver-1/vcsserver.log | |
168 | - VERSION: 4.7.2 VCSServer |
|
168 | - VERSION: 4.7.2 VCSServer | |
169 | - URL: http://127.0.0.1:10008 |
|
169 | - URL: http://127.0.0.1:10008 | |
170 | - CONFIG: /home/ubuntu/.rccontrol/vcsserver-1/vcsserver.ini |
|
170 | - CONFIG: /home/ubuntu/.rccontrol/vcsserver-1/vcsserver.ini | |
171 |
|
171 | |||
172 | $ rccontrol restart vcsserver-1 |
|
172 | $ rccontrol restart vcsserver-1 | |
173 | Instance "vcsserver-1" successfully stopped. |
|
173 | Instance "vcsserver-1" successfully stopped. | |
174 | Instance "vcsserver-1" successfully started. |
|
174 | Instance "vcsserver-1" successfully started. | |
175 |
|
175 | |||
176 | .. _vcs-server-config-file: |
|
176 | .. _vcs-server-config-file: | |
177 |
|
177 | |||
178 | VCS Server Configuration |
|
178 | VCS Server Configuration | |
179 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
|
179 | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
180 |
|
180 | |||
181 | You can configure settings for multiple VCS Servers on your |
|
181 | You can configure settings for multiple VCS Servers on your | |
182 | system using their individual configuration files. Use the following |
|
182 | system using their individual configuration files. Use the following | |
183 | properties inside the configuration file to set up your system. The default |
|
183 | properties inside the configuration file to set up your system. The default | |
184 | location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`. |
|
184 | location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`. | |
185 | For a more detailed explanation of the logger levers, see :ref:`debug-mode`. |
|
185 | For a more detailed explanation of the logger levers, see :ref:`debug-mode`. | |
186 |
|
186 | |||
187 | .. rst-class:: dl-horizontal |
|
187 | .. rst-class:: dl-horizontal | |
188 |
|
188 | |||
189 | \host <ip-address> |
|
189 | \host <ip-address> | |
190 | Set the host on which the VCS Server will run. VCSServer is not |
|
190 | Set the host on which the VCS Server will run. VCSServer is not | |
191 | protected by any authentication, so we *highly* recommend running it |
|
191 | protected by any authentication, so we *highly* recommend running it | |
192 | under localhost ip that is `127.0.0.1` |
|
192 | under localhost ip that is `127.0.0.1` | |
193 |
|
193 | |||
194 | \port <int> |
|
194 | \port <int> | |
195 | Set the port number on which the VCS Server will be available. |
|
195 | Set the port number on which the VCS Server will be available. | |
196 |
|
196 | |||
197 |
|
197 | |||
198 | .. note:: |
|
198 | .. note:: | |
199 |
|
199 | |||
200 | After making changes, you need to restart your VCS Server to pick them up. |
|
200 | After making changes, you need to restart your VCS Server to pick them up. | |
201 |
|
201 | |||
202 | .. code-block:: ini |
|
202 | .. code-block:: ini | |
203 |
|
203 | |||
204 | ; ################################# |
|
204 | ; ################################# | |
205 | ; RHODECODE VCSSERVER CONFIGURATION |
|
205 | ; RHODECODE VCSSERVER CONFIGURATION | |
206 | ; ################################# |
|
206 | ; ################################# | |
207 |
|
207 | |||
208 | [server:main] |
|
208 | [server:main] | |
209 | ; COMMON HOST/IP CONFIG |
|
209 | ; COMMON HOST/IP CONFIG | |
210 | host = 127.0.0.1 |
|
210 | host = 127.0.0.1 | |
211 | port = 10002 |
|
211 | port = 10002 | |
212 |
|
212 | |||
213 | ; ########################### |
|
213 | ; ########################### | |
214 | ; GUNICORN APPLICATION SERVER |
|
214 | ; GUNICORN APPLICATION SERVER | |
215 | ; ########################### |
|
215 | ; ########################### | |
216 |
|
216 | |||
217 | ; run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini |
|
217 | ; run with gunicorn --log-config rhodecode.ini --paste rhodecode.ini | |
218 |
|
218 | |||
219 | ; Module to use, this setting shouldn't be changed |
|
219 | ; Module to use, this setting shouldn't be changed | |
220 | use = egg:gunicorn#main |
|
220 | use = egg:gunicorn#main | |
221 |
|
221 | |||
222 | ; Sets the number of process workers. More workers means more concurrent connections |
|
222 | ; Sets the number of process workers. More workers means more concurrent connections | |
223 | ; RhodeCode can handle at the same time. Each additional worker also it increases |
|
223 | ; RhodeCode can handle at the same time. Each additional worker also it increases | |
224 | ; memory usage as each has it's own set of caches. |
|
224 | ; memory usage as each has it's own set of caches. | |
225 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more |
|
225 | ; Recommended value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers, but no more | |
226 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. |
|
226 | ; than 8-10 unless for really big deployments .e.g 700-1000 users. | |
227 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) |
|
227 | ; `instance_id = *` must be set in the [app:main] section below (which is the default) | |
228 | ; when using more than 1 worker. |
|
228 | ; when using more than 1 worker. | |
229 | workers = 6 |
|
229 | workers = 6 | |
230 |
|
230 | |||
231 | ; Gunicorn access log level |
|
231 | ; Gunicorn access log level | |
232 | loglevel = info |
|
232 | loglevel = info | |
233 |
|
233 | |||
234 | ; Process name visible in process list |
|
234 | ; Process name visible in process list | |
235 | proc_name = rhodecode_vcsserver |
|
235 | proc_name = rhodecode_vcsserver | |
236 |
|
236 | |||
237 | ; Type of worker class, one of sync, gevent |
|
237 | ; Type of worker class, one of sync, gevent | |
238 | ; currently `sync` is the only option allowed. |
|
238 | ; currently `sync` is the only option allowed. | |
239 | worker_class = sync |
|
239 | worker_class = sync | |
240 |
|
240 | |||
241 | ; The maximum number of simultaneous clients. Valid only for gevent |
|
241 | ; The maximum number of simultaneous clients. Valid only for gevent | |
242 | worker_connections = 10 |
|
242 | worker_connections = 10 | |
243 |
|
243 | |||
244 | ; Max number of requests that worker will handle before being gracefully restarted. |
|
244 | ; Max number of requests that worker will handle before being gracefully restarted. | |
245 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. |
|
245 | ; Prevents memory leaks, jitter adds variability so not all workers are restarted at once. | |
246 | max_requests = 1000 |
|
246 | max_requests = 1000 | |
247 | max_requests_jitter = 30 |
|
247 | max_requests_jitter = 30 | |
248 |
|
248 | |||
249 | ; Amount of time a worker can spend with handling a request before it |
|
249 | ; Amount of time a worker can spend with handling a request before it | |
250 | ; gets killed and restarted. By default set to 21600 (6hrs) |
|
250 | ; gets killed and restarted. By default set to 21600 (6hrs) | |
251 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) |
|
251 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) | |
252 | timeout = 21600 |
|
252 | timeout = 21600 | |
253 |
|
253 | |||
254 | ; The maximum size of HTTP request line in bytes. |
|
254 | ; The maximum size of HTTP request line in bytes. | |
255 | ; 0 for unlimited |
|
255 | ; 0 for unlimited | |
256 | limit_request_line = 0 |
|
256 | limit_request_line = 0 | |
257 |
|
257 | |||
258 | ; Limit the number of HTTP headers fields in a request. |
|
258 | ; Limit the number of HTTP headers fields in a request. | |
259 | ; By default this value is 100 and can't be larger than 32768. |
|
259 | ; By default this value is 100 and can't be larger than 32768. | |
260 | limit_request_fields = 32768 |
|
260 | limit_request_fields = 32768 | |
261 |
|
261 | |||
262 | ; Limit the allowed size of an HTTP request header field. |
|
262 | ; Limit the allowed size of an HTTP request header field. | |
263 | ; Value is a positive number or 0. |
|
263 | ; Value is a positive number or 0. | |
264 | ; Setting it to 0 will allow unlimited header field sizes. |
|
264 | ; Setting it to 0 will allow unlimited header field sizes. | |
265 | limit_request_field_size = 0 |
|
265 | limit_request_field_size = 0 | |
266 |
|
266 | |||
267 | ; Timeout for graceful workers restart. |
|
267 | ; Timeout for graceful workers restart. | |
268 | ; After receiving a restart signal, workers have this much time to finish |
|
268 | ; After receiving a restart signal, workers have this much time to finish | |
269 | ; serving requests. Workers still alive after the timeout (starting from the |
|
269 | ; serving requests. Workers still alive after the timeout (starting from the | |
270 | ; receipt of the restart signal) are force killed. |
|
270 | ; receipt of the restart signal) are force killed. | |
271 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) |
|
271 | ; Examples: 1800 (30min), 3600 (1hr), 7200 (2hr), 43200 (12h) | |
272 | graceful_timeout = 3600 |
|
272 | graceful_timeout = 3600 | |
273 |
|
273 | |||
274 | # The number of seconds to wait for requests on a Keep-Alive connection. |
|
274 | # The number of seconds to wait for requests on a Keep-Alive connection. | |
275 | # Generally set in the 1-5 seconds range. |
|
275 | # Generally set in the 1-5 seconds range. | |
276 | keepalive = 2 |
|
276 | keepalive = 2 | |
277 |
|
277 | |||
278 | ; Maximum memory usage that each worker can use before it will receive a |
|
278 | ; Maximum memory usage that each worker can use before it will receive a | |
279 | ; graceful restart signal 0 = memory monitoring is disabled |
|
279 | ; graceful restart signal 0 = memory monitoring is disabled | |
280 | ; Examples: 268435456 (256MB), 536870912 (512MB) |
|
280 | ; Examples: 268435456 (256MB), 536870912 (512MB) | |
281 | ; 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB) |
|
281 | ; 1073741824 (1GB), 2147483648 (2GB), 4294967296 (4GB) | |
282 | memory_max_usage = 1073741824 |
|
282 | memory_max_usage = 1073741824 | |
283 |
|
283 | |||
284 | ; How often in seconds to check for memory usage for each gunicorn worker |
|
284 | ; How often in seconds to check for memory usage for each gunicorn worker | |
285 | memory_usage_check_interval = 60 |
|
285 | memory_usage_check_interval = 60 | |
286 |
|
286 | |||
287 | ; Threshold value for which we don't recycle worker if GarbageCollection |
|
287 | ; Threshold value for which we don't recycle worker if GarbageCollection | |
288 | ; frees up enough resources. Before each restart we try to run GC on worker |
|
288 | ; frees up enough resources. Before each restart we try to run GC on worker | |
289 | ; in case we get enough free memory after that, restart will not happen. |
|
289 | ; in case we get enough free memory after that, restart will not happen. | |
290 | memory_usage_recovery_threshold = 0.8 |
|
290 | memory_usage_recovery_threshold = 0.8 | |
291 |
|
291 | |||
292 |
|
292 | |||
293 | [app:main] |
|
293 | [app:main] | |
294 | use = egg:rhodecode-vcsserver |
|
294 | use = egg:rhodecode-vcsserver | |
295 |
|
295 | |||
296 | pyramid.default_locale_name = en |
|
296 | pyramid.default_locale_name = en | |
297 | pyramid.includes = |
|
297 | pyramid.includes = | |
298 |
|
298 | |||
299 | ; default locale used by VCS systems |
|
299 | ; default locale used by VCS systems | |
300 | locale = en_US.UTF-8 |
|
300 | locale = en_US.UTF-8 | |
301 |
|
301 | |||
302 | ; ############# |
|
302 | ; ############# | |
303 | ; DOGPILE CACHE |
|
303 | ; DOGPILE CACHE | |
304 | ; ############# |
|
304 | ; ############# | |
305 |
|
305 | |||
306 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. |
|
306 | ; Default cache dir for caches. Putting this into a ramdisk can boost performance. | |
307 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space |
|
307 | ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space | |
308 | cache_dir = %(here)s/data |
|
308 | cache_dir = %(here)s/data | |
309 |
|
309 | |||
310 | ; ********************************************************** |
|
310 | ; ********************************************************** | |
311 | ; `repo_object` cache with redis backend |
|
311 | ; `repo_object` cache with redis backend | |
312 | ; recommended for larger instance, or for better performance |
|
312 | ; recommended for larger instance, or for better performance | |
313 | ; ********************************************************** |
|
313 | ; ********************************************************** | |
314 |
|
314 | |||
315 | ; `repo_object` cache settings for vcs methods for repositories |
|
315 | ; `repo_object` cache settings for vcs methods for repositories | |
316 | rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack |
|
316 | rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack | |
317 |
|
317 | |||
318 | ; cache auto-expires after N seconds |
|
318 | ; cache auto-expires after N seconds | |
319 | ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days) |
|
319 | ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days) | |
320 | rc_cache.repo_object.expiration_time = 2592000 |
|
320 | rc_cache.repo_object.expiration_time = 2592000 | |
321 |
|
321 | |||
322 | ; redis_expiration_time needs to be greater then expiration_time |
|
322 | ; redis_expiration_time needs to be greater then expiration_time | |
323 | rc_cache.repo_object.arguments.redis_expiration_time = 3592000 |
|
323 | rc_cache.repo_object.arguments.redis_expiration_time = 3592000 | |
324 |
|
324 | |||
325 | rc_cache.repo_object.arguments.host = localhost |
|
325 | rc_cache.repo_object.arguments.host = localhost | |
326 | rc_cache.repo_object.arguments.port = 6379 |
|
326 | rc_cache.repo_object.arguments.port = 6379 | |
327 | rc_cache.repo_object.arguments.db = 5 |
|
327 | rc_cache.repo_object.arguments.db = 5 | |
328 | rc_cache.repo_object.arguments.socket_timeout = 30 |
|
328 | rc_cache.repo_object.arguments.socket_timeout = 30 | |
329 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends |
|
329 | ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends | |
330 | rc_cache.repo_object.arguments.distributed_lock = true |
|
330 | rc_cache.repo_object.arguments.distributed_lock = true | |
331 |
|
331 | |||
332 | ; ##################### |
|
332 | ; ##################### | |
333 | ; LOGGING CONFIGURATION |
|
333 | ; LOGGING CONFIGURATION | |
334 | ; ##################### |
|
334 | ; ##################### | |
335 | [loggers] |
|
335 | [loggers] | |
336 | keys = root, vcsserver |
|
336 | keys = root, vcsserver | |
337 |
|
337 | |||
338 | [handlers] |
|
338 | [handlers] | |
339 | keys = console |
|
339 | keys = console | |
340 |
|
340 | |||
341 | [formatters] |
|
341 | [formatters] | |
342 | keys = generic |
|
342 | keys = generic | |
343 |
|
343 | |||
344 | ; ####### |
|
344 | ; ####### | |
345 | ; LOGGERS |
|
345 | ; LOGGERS | |
346 | ; ####### |
|
346 | ; ####### | |
347 | [logger_root] |
|
347 | [logger_root] | |
348 | level = NOTSET |
|
348 | level = NOTSET | |
349 | handlers = console |
|
349 | handlers = console | |
350 |
|
350 | |||
351 | [logger_vcsserver] |
|
351 | [logger_vcsserver] | |
352 | level = DEBUG |
|
352 | level = DEBUG | |
353 | handlers = |
|
353 | handlers = | |
354 | qualname = vcsserver |
|
354 | qualname = vcsserver | |
355 | propagate = 1 |
|
355 | propagate = 1 | |
356 |
|
356 | |||
357 |
|
357 | |||
358 | ; ######## |
|
358 | ; ######## | |
359 | ; HANDLERS |
|
359 | ; HANDLERS | |
360 | ; ######## |
|
360 | ; ######## | |
361 |
|
361 | |||
362 | [handler_console] |
|
362 | [handler_console] | |
363 | class = StreamHandler |
|
363 | class = StreamHandler | |
364 | args = (sys.stderr, ) |
|
364 | args = (sys.stderr, ) | |
365 | level = INFO |
|
365 | level = INFO | |
366 | formatter = generic |
|
366 | formatter = generic | |
367 |
|
367 | |||
368 | ; ########## |
|
368 | ; ########## | |
369 | ; FORMATTERS |
|
369 | ; FORMATTERS | |
370 | ; ########## |
|
370 | ; ########## | |
371 |
|
371 | |||
372 | [formatter_generic] |
|
372 | [formatter_generic] | |
373 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s |
|
373 | format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s | |
374 | datefmt = %Y-%m-%d %H:%M:%S |
|
374 | datefmt = %Y-%m-%d %H:%M:%S | |
375 |
|
375 | |||
376 |
|
376 | |||
377 | .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn |
|
377 | .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn | |
378 |
|
378 | |||
379 | .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue |
|
379 | .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue |
@@ -1,209 +1,209 b'' | |||||
1 | .. _api: |
|
1 | .. _api: | |
2 |
|
2 | |||
3 | API Documentation |
|
3 | API Documentation | |
4 | ================= |
|
4 | ================= | |
5 |
|
5 | |||
6 | The |RCE| API uses a single scheme for calling all API methods. The API is |
|
6 | The |RCE| API uses a single scheme for calling all API methods. The API is | |
7 | implemented with JSON protocol in both directions. To send API requests to |
|
7 | implemented with JSON protocol in both directions. To send API requests to | |
8 | your instance of |RCE|, use the following URL format |
|
8 | your instance of |RCE|, use the following URL format | |
9 | ``<your_server>/_admin`` |
|
9 | ``<your_server>/_admin`` | |
10 |
|
10 | |||
11 | .. note:: |
|
11 | .. note:: | |
12 |
|
12 | |||
13 | To use the API, you should configure the :file:`~/.rhoderc` file with |
|
13 | To use the API, you should configure the :file:`~/.rhoderc` file with | |
14 | access details per instance. For more information, see |
|
14 | access details per instance. For more information, see | |
15 | :ref:`config-rhoderc`. |
|
15 | :ref:`config-rhoderc`. | |
16 |
|
16 | |||
17 |
|
17 | |||
18 | API ACCESS FOR WEB VIEWS |
|
18 | API ACCESS FOR WEB VIEWS | |
19 | ------------------------ |
|
19 | ------------------------ | |
20 |
|
20 | |||
21 | API access can also be turned on for each web view in |RCE| that is |
|
21 | API access can also be turned on for each web view in |RCE| that is | |
22 | decorated with a `@LoginRequired` decorator. To enable API access, change |
|
22 | decorated with a `@LoginRequired` decorator. To enable API access, change | |
23 | the standard login decorator to `@LoginRequired(api_access=True)`. |
|
23 | the standard login decorator to `@LoginRequired(api_access=True)`. | |
24 |
|
24 | |||
25 | From |RCE| version 1.7.0 you can configure a white list |
|
25 | From |RCE| version 1.7.0 you can configure a white list | |
26 | of views that have API access enabled by default. To enable these, |
|
26 | of views that have API access enabled by default. To enable these, | |
27 | edit the |RCE| configuration ``.ini`` file. The default location is: |
|
27 | edit the |RCE| configuration ``.ini`` file. The default location is: | |
28 |
|
28 | |||
29 | * |RCE| Pre-2.2.7 :file:`root/rhodecode/data/production.ini` |
|
29 | * |RCE| Pre-2.2.7 :file:`root/rhodecode/data/production.ini` | |
30 |
* |RCE| 3.0 :file:` |
|
30 | * |RCE| 3.0 :file:`config/_shared/rhodecode.ini` | |
31 |
|
31 | |||
32 | To configure the white list, edit this section of the file. In this |
|
32 | To configure the white list, edit this section of the file. In this | |
33 | configuration example, API access is granted to the patch/diff raw file and |
|
33 | configuration example, API access is granted to the patch/diff raw file and | |
34 | archive. |
|
34 | archive. | |
35 |
|
35 | |||
36 | .. code-block:: ini |
|
36 | .. code-block:: ini | |
37 |
|
37 | |||
38 | ## List of controllers (using glob syntax) that AUTH TOKENS could be used for access. |
|
38 | ## List of controllers (using glob syntax) that AUTH TOKENS could be used for access. | |
39 | ## Adding ?auth_token = <token> to the url authenticates this request as if it |
|
39 | ## Adding ?auth_token = <token> to the url authenticates this request as if it | |
40 | ## came from the the logged in user who own this authentication token. |
|
40 | ## came from the the logged in user who own this authentication token. | |
41 | ## |
|
41 | ## | |
42 | ## Syntax is <ControllerClass>:<function_pattern>. |
|
42 | ## Syntax is <ControllerClass>:<function_pattern>. | |
43 | ## The list should be "," separated and on a single line. |
|
43 | ## The list should be "," separated and on a single line. | |
44 | ## |
|
44 | ## | |
45 | api_access_controllers_whitelist = RepoCommitsView:repo_commit_raw,RepoCommitsView:repo_commit_patch,RepoCommitsView:repo_commit_download |
|
45 | api_access_controllers_whitelist = RepoCommitsView:repo_commit_raw,RepoCommitsView:repo_commit_patch,RepoCommitsView:repo_commit_download | |
46 |
|
46 | |||
47 | After this change, a |RCE| view can be accessed without login by adding a |
|
47 | After this change, a |RCE| view can be accessed without login by adding a | |
48 | GET parameter ``?auth_token=<auth_token>`` to a url. For example to |
|
48 | GET parameter ``?auth_token=<auth_token>`` to a url. For example to | |
49 | access the raw diff. |
|
49 | access the raw diff. | |
50 |
|
50 | |||
51 | .. code-block:: html |
|
51 | .. code-block:: html | |
52 |
|
52 | |||
53 | http://<server>/<repo>/changeset-diff/<sha>?auth_token=<auth_token> |
|
53 | http://<server>/<repo>/changeset-diff/<sha>?auth_token=<auth_token> | |
54 |
|
54 | |||
55 | By default this is only enabled on RSS/ATOM feed views. Exposing raw diffs is a |
|
55 | By default this is only enabled on RSS/ATOM feed views. Exposing raw diffs is a | |
56 | good way to integrate with 3rd party services like code review, or build farms |
|
56 | good way to integrate with 3rd party services like code review, or build farms | |
57 | that could download archives. |
|
57 | that could download archives. | |
58 |
|
58 | |||
59 | API ACCESS |
|
59 | API ACCESS | |
60 | ---------- |
|
60 | ---------- | |
61 |
|
61 | |||
62 | All clients are required to send JSON-RPC spec JSON data. |
|
62 | All clients are required to send JSON-RPC spec JSON data. | |
63 |
|
63 | |||
64 | .. code-block:: bash |
|
64 | .. code-block:: bash | |
65 |
|
65 | |||
66 | { |
|
66 | { | |
67 | "id:"<id>", |
|
67 | "id:"<id>", | |
68 | "auth_token":"<auth_token>", |
|
68 | "auth_token":"<auth_token>", | |
69 | "method":"<method_name>", |
|
69 | "method":"<method_name>", | |
70 | "args":{"<arg_key>":"<arg_val>"} |
|
70 | "args":{"<arg_key>":"<arg_val>"} | |
71 | } |
|
71 | } | |
72 |
|
72 | |||
73 | Example call for auto pulling from remote repositories using curl: |
|
73 | Example call for auto pulling from remote repositories using curl: | |
74 |
|
74 | |||
75 | .. code-block:: bash |
|
75 | .. code-block:: bash | |
76 |
|
76 | |||
77 | curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1, |
|
77 | curl https://server.com/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id":1, | |
78 | "auth_token":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull", "args":{"repoid":"CPython"}}' |
|
78 | "auth_token":"xe7cdb2v278e4evbdf5vs04v832v0efvcbcve4a3","method":"pull", "args":{"repoid":"CPython"}}' | |
79 |
|
79 | |||
80 | Provide those parameters: |
|
80 | Provide those parameters: | |
81 | - **id** A value of any type, which is used to match the response with the |
|
81 | - **id** A value of any type, which is used to match the response with the | |
82 | request that it is replying to. |
|
82 | request that it is replying to. | |
83 | - **auth_token** for access and permission validation. |
|
83 | - **auth_token** for access and permission validation. | |
84 | - **method** is name of method to call |
|
84 | - **method** is name of method to call | |
85 | - **args** is an ``key:value`` list of arguments to pass to method |
|
85 | - **args** is an ``key:value`` list of arguments to pass to method | |
86 |
|
86 | |||
87 | .. note:: |
|
87 | .. note:: | |
88 |
|
88 | |||
89 | To get your |authtoken|, from the |RCE| interface, |
|
89 | To get your |authtoken|, from the |RCE| interface, | |
90 | go to: |
|
90 | go to: | |
91 | :menuselection:`username --> My account --> Auth tokens` |
|
91 | :menuselection:`username --> My account --> Auth tokens` | |
92 |
|
92 | |||
93 | For security reasons you should always create a dedicated |authtoken| for |
|
93 | For security reasons you should always create a dedicated |authtoken| for | |
94 | API use only. |
|
94 | API use only. | |
95 |
|
95 | |||
96 |
|
96 | |||
97 | The |RCE| API will always return a JSON-RPC response: |
|
97 | The |RCE| API will always return a JSON-RPC response: | |
98 |
|
98 | |||
99 | .. code-block:: bash |
|
99 | .. code-block:: bash | |
100 |
|
100 | |||
101 | { |
|
101 | { | |
102 | "id": <id>, # matching id sent by request |
|
102 | "id": <id>, # matching id sent by request | |
103 | "result": "<result>"|null, # JSON formatted result, null if any errors |
|
103 | "result": "<result>"|null, # JSON formatted result, null if any errors | |
104 | "error": "null"|<error_message> # JSON formatted error (if any) |
|
104 | "error": "null"|<error_message> # JSON formatted error (if any) | |
105 | } |
|
105 | } | |
106 |
|
106 | |||
107 | All responses from API will be with `HTTP/1.0 200 OK` status code. |
|
107 | All responses from API will be with `HTTP/1.0 200 OK` status code. | |
108 | If there is an error when calling the API, the *error* key will contain a |
|
108 | If there is an error when calling the API, the *error* key will contain a | |
109 | failure description and the *result* will be `null`. |
|
109 | failure description and the *result* will be `null`. | |
110 |
|
110 | |||
111 | API CLIENT |
|
111 | API CLIENT | |
112 | ---------- |
|
112 | ---------- | |
113 |
|
113 | |||
114 | To install the |RCE| API, see :ref:`install-tools`. To configure the API per |
|
114 | To install the |RCE| API, see :ref:`install-tools`. To configure the API per | |
115 | instance, see the :ref:`rc-tools` section as you need to configure a |
|
115 | instance, see the :ref:`rc-tools` section as you need to configure a | |
116 | :file:`~/.rhoderc` file with your |authtokens|. |
|
116 | :file:`~/.rhoderc` file with your |authtokens|. | |
117 |
|
117 | |||
118 | Once you have set up your instance API access, use the following examples to |
|
118 | Once you have set up your instance API access, use the following examples to | |
119 | get started. |
|
119 | get started. | |
120 |
|
120 | |||
121 | .. code-block:: bash |
|
121 | .. code-block:: bash | |
122 |
|
122 | |||
123 | # Getting the 'rhodecode' repository |
|
123 | # Getting the 'rhodecode' repository | |
124 | # from a RhodeCode Enterprise instance |
|
124 | # from a RhodeCode Enterprise instance | |
125 | rhodecode-api --instance-name=enterprise-1 get_repo repoid:rhodecode |
|
125 | rhodecode-api --instance-name=enterprise-1 get_repo repoid:rhodecode | |
126 |
|
126 | |||
127 | Calling method get_repo => http://127.0.0.1:5000 |
|
127 | Calling method get_repo => http://127.0.0.1:5000 | |
128 | Server response |
|
128 | Server response | |
129 | { |
|
129 | { | |
130 | <json data> |
|
130 | <json data> | |
131 | } |
|
131 | } | |
132 |
|
132 | |||
133 | # Creating a new mercurial repository called 'brand-new' |
|
133 | # Creating a new mercurial repository called 'brand-new' | |
134 | # with a description 'Repo-description' |
|
134 | # with a description 'Repo-description' | |
135 | rhodecode-api --instance-name=enterprise-1 create_repo repo_name:brand-new repo_type:hg description:Repo-description |
|
135 | rhodecode-api --instance-name=enterprise-1 create_repo repo_name:brand-new repo_type:hg description:Repo-description | |
136 | { |
|
136 | { | |
137 | "error": null, |
|
137 | "error": null, | |
138 | "id": 1110, |
|
138 | "id": 1110, | |
139 | "result": { |
|
139 | "result": { | |
140 | "msg": "Created new repository `brand-new`", |
|
140 | "msg": "Created new repository `brand-new`", | |
141 | "success": true, |
|
141 | "success": true, | |
142 | "task": null |
|
142 | "task": null | |
143 | } |
|
143 | } | |
144 | } |
|
144 | } | |
145 |
|
145 | |||
146 | A broken example, what not to do. |
|
146 | A broken example, what not to do. | |
147 |
|
147 | |||
148 | .. code-block:: bash |
|
148 | .. code-block:: bash | |
149 |
|
149 | |||
150 | # A call missing the required arguments |
|
150 | # A call missing the required arguments | |
151 | # and not specifying the instance |
|
151 | # and not specifying the instance | |
152 | rhodecode-api get_repo |
|
152 | rhodecode-api get_repo | |
153 |
|
153 | |||
154 | Calling method get_repo => http://127.0.0.1:5000 |
|
154 | Calling method get_repo => http://127.0.0.1:5000 | |
155 | Server response |
|
155 | Server response | |
156 | "Missing non optional `repoid` arg in JSON DATA" |
|
156 | "Missing non optional `repoid` arg in JSON DATA" | |
157 |
|
157 | |||
158 | You can specify pure JSON using the ``--format`` parameter. |
|
158 | You can specify pure JSON using the ``--format`` parameter. | |
159 |
|
159 | |||
160 | .. code-block:: bash |
|
160 | .. code-block:: bash | |
161 |
|
161 | |||
162 | rhodecode-api --format=json get_repo repoid:rhodecode |
|
162 | rhodecode-api --format=json get_repo repoid:rhodecode | |
163 |
|
163 | |||
164 | In such case only output that this function shows is pure JSON, we can use that |
|
164 | In such case only output that this function shows is pure JSON, we can use that | |
165 | and pipe output to some json formatter. |
|
165 | and pipe output to some json formatter. | |
166 |
|
166 | |||
167 | If output is in pure JSON format, you can pipe output to a JSON formatter. |
|
167 | If output is in pure JSON format, you can pipe output to a JSON formatter. | |
168 |
|
168 | |||
169 | .. code-block:: bash |
|
169 | .. code-block:: bash | |
170 |
|
170 | |||
171 | rhodecode-api --instance-name=enterprise-1 --format=json get_repo repoid:rhodecode | python -m json.tool |
|
171 | rhodecode-api --instance-name=enterprise-1 --format=json get_repo repoid:rhodecode | python -m json.tool | |
172 |
|
172 | |||
173 | API METHODS |
|
173 | API METHODS | |
174 | ----------- |
|
174 | ----------- | |
175 |
|
175 | |||
176 | Each method by default required following arguments. |
|
176 | Each method by default required following arguments. | |
177 |
|
177 | |||
178 | .. code-block:: bash |
|
178 | .. code-block:: bash | |
179 |
|
179 | |||
180 | id : "<id_for_response>" |
|
180 | id : "<id_for_response>" | |
181 | auth_token : "<auth_token>" |
|
181 | auth_token : "<auth_token>" | |
182 | method : "<method name>" |
|
182 | method : "<method name>" | |
183 | args : {} |
|
183 | args : {} | |
184 |
|
184 | |||
185 | Use each **param** from docs and put it in args, Optional parameters |
|
185 | Use each **param** from docs and put it in args, Optional parameters | |
186 | are not required in args. |
|
186 | are not required in args. | |
187 |
|
187 | |||
188 | .. code-block:: bash |
|
188 | .. code-block:: bash | |
189 |
|
189 | |||
190 | args: {"repoid": "rhodecode"} |
|
190 | args: {"repoid": "rhodecode"} | |
191 |
|
191 | |||
192 | .. Note: From this point on things are generated by the script in |
|
192 | .. Note: From this point on things are generated by the script in | |
193 | `scripts/fabfile.py`. To change things below, update the docstrings in the |
|
193 | `scripts/fabfile.py`. To change things below, update the docstrings in the | |
194 | ApiController. |
|
194 | ApiController. | |
195 |
|
195 | |||
196 | .. --- API DEFS MARKER --- |
|
196 | .. --- API DEFS MARKER --- | |
197 | .. toctree:: |
|
197 | .. toctree:: | |
198 |
|
198 | |||
199 | methods/repo-methods |
|
199 | methods/repo-methods | |
200 | methods/store-methods |
|
200 | methods/store-methods | |
201 | methods/license-methods |
|
201 | methods/license-methods | |
202 | methods/deprecated-methods |
|
202 | methods/deprecated-methods | |
203 | methods/gist-methods |
|
203 | methods/gist-methods | |
204 | methods/pull-request-methods |
|
204 | methods/pull-request-methods | |
205 | methods/repo-group-methods |
|
205 | methods/repo-group-methods | |
206 | methods/search-methods |
|
206 | methods/search-methods | |
207 | methods/server-methods |
|
207 | methods/server-methods | |
208 | methods/user-methods |
|
208 | methods/user-methods | |
209 | methods/user-group-methods |
|
209 | methods/user-group-methods |
@@ -1,144 +1,144 b'' | |||||
1 | .. _ssh-connection: |
|
1 | .. _ssh-connection: | |
2 |
|
2 | |||
3 | SSH Connection |
|
3 | SSH Connection | |
4 | -------------- |
|
4 | -------------- | |
5 |
|
5 | |||
6 | If you wish to connect to your |repos| using SSH protocol, use the |
|
6 | If you wish to connect to your |repos| using SSH protocol, use the | |
7 | following instructions. |
|
7 | following instructions. | |
8 |
|
8 | |||
9 | 1. Include |RCE| generated `authorized_keys` file into your sshd_config. |
|
9 | 1. Include |RCE| generated `authorized_keys` file into your sshd_config. | |
10 |
|
10 | |||
11 | By default a file `authorized_keys_rhodecode` is created containing |
|
11 | By default a file `authorized_keys_rhodecode` is created containing | |
12 | configuration and all allowed user connection keys are stored inside. |
|
12 | configuration and all allowed user connection keys are stored inside. | |
13 | On each change of stored keys inside |RCE| this file is updated with |
|
13 | On each change of stored keys inside |RCE| this file is updated with | |
14 | proper data. |
|
14 | proper data. | |
15 |
|
15 | |||
16 | .. code-block:: bash |
|
16 | .. code-block:: bash | |
17 |
|
17 | |||
18 | # Edit sshd_config file most likely at /etc/ssh/sshd_config |
|
18 | # Edit sshd_config file most likely at /etc/ssh/sshd_config | |
19 | # add or edit the AuthorizedKeysFile, and set to use custom files |
|
19 | # add or edit the AuthorizedKeysFile, and set to use custom files | |
20 |
|
20 | |||
21 | AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode |
|
21 | AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode | |
22 |
|
22 | |||
23 | This way we use a separate file for SSH access and separate one for |
|
23 | This way we use a separate file for SSH access and separate one for | |
24 | SSH access to |RCE| repositories. |
|
24 | SSH access to |RCE| repositories. | |
25 |
|
25 | |||
26 |
|
26 | |||
27 | 2. Enable the SSH module on instance. |
|
27 | 2. Enable the SSH module on instance. | |
28 |
|
28 | |||
29 | On the server where |RCE| is running executing: |
|
29 | On the server where |RCE| is running executing: | |
30 |
|
30 | |||
31 | .. code-block:: bash |
|
31 | .. code-block:: bash | |
32 |
|
32 | |||
33 | rccontrol enable-module ssh {instance-id} |
|
33 | rccontrol enable-module ssh {instance-id} | |
34 |
|
34 | |||
35 | This will add the following configuration into :file:`rhodecode.ini`. |
|
35 | This will add the following configuration into :file:`rhodecode.ini`. | |
36 | This also can be done manually: |
|
36 | This also can be done manually: | |
37 |
|
37 | |||
38 | .. code-block:: ini |
|
38 | .. code-block:: ini | |
39 |
|
39 | |||
40 | ############################################################ |
|
40 | ############################################################ | |
41 | ### SSH Support Settings ### |
|
41 | ### SSH Support Settings ### | |
42 | ############################################################ |
|
42 | ############################################################ | |
43 |
|
43 | |||
44 | ## Defines if a custom authorized_keys file should be created and written on |
|
44 | ## Defines if a custom authorized_keys file should be created and written on | |
45 | ## any change user ssh keys. Setting this to false also disables posibility |
|
45 | ## any change user ssh keys. Setting this to false also disables posibility | |
46 | ## of adding SSH keys by users from web interface. Super admins can still |
|
46 | ## of adding SSH keys by users from web interface. Super admins can still | |
47 | ## manage SSH Keys. |
|
47 | ## manage SSH Keys. | |
48 | ssh.generate_authorized_keyfile = true |
|
48 | ssh.generate_authorized_keyfile = true | |
49 |
|
49 | |||
50 | ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` |
|
50 | ## Options for ssh, default is `no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding` | |
51 | # ssh.authorized_keys_ssh_opts = |
|
51 | # ssh.authorized_keys_ssh_opts = | |
52 |
|
52 | |||
53 | ## Path to the authrozied_keys file where the generate entries are placed. |
|
53 | ## Path to the authrozied_keys file where the generate entries are placed. | |
54 | ## It is possible to have multiple key files specified in `sshd_config` e.g. |
|
54 | ## It is possible to have multiple key files specified in `sshd_config` e.g. | |
55 | ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode |
|
55 | ## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode | |
56 | ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode |
|
56 | ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode | |
57 |
|
57 | |||
58 | ## Command to execute the SSH wrapper. The binary is available in the |
|
58 | ## Command to execute the SSH wrapper. The binary is available in the | |
59 | ## rhodecode installation directory. |
|
59 | ## rhodecode installation directory. | |
60 | ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper |
|
60 | ## e.g ~/.rccontrol/community-1/profile/bin/rc-ssh-wrapper | |
61 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper |
|
61 | ssh.wrapper_cmd = ~/.rccontrol/community-1/rc-ssh-wrapper | |
62 |
|
62 | |||
63 | ## Allow shell when executing the ssh-wrapper command |
|
63 | ## Allow shell when executing the ssh-wrapper command | |
64 | ssh.wrapper_cmd_allow_shell = false |
|
64 | ssh.wrapper_cmd_allow_shell = false | |
65 |
|
65 | |||
66 | ## Enables logging, and detailed output send back to the client during SSH |
|
66 | ## Enables logging, and detailed output send back to the client during SSH | |
67 | ## operations. Useful for debugging, shouldn't be used in production. |
|
67 | ## operations. Useful for debugging, shouldn't be used in production. | |
68 | ssh.enable_debug_logging = false |
|
68 | ssh.enable_debug_logging = false | |
69 |
|
69 | |||
70 | ## Paths to binary executable, by default they are the names, but we can |
|
70 | ## Paths to binary executable, by default they are the names, but we can | |
71 | ## override them if we want to use a custom one |
|
71 | ## override them if we want to use a custom one | |
72 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg |
|
72 | ssh.executable.hg = ~/.rccontrol/vcsserver-1/profile/bin/hg | |
73 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git |
|
73 | ssh.executable.git = ~/.rccontrol/vcsserver-1/profile/bin/git | |
74 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve |
|
74 | ssh.executable.svn = ~/.rccontrol/vcsserver-1/profile/bin/svnserve | |
75 |
|
75 | |||
76 | ## Enables SSH key generator web interface. Disabling this still allows users |
|
76 | ## Enables SSH key generator web interface. Disabling this still allows users | |
77 | ## to add their own keys. |
|
77 | ## to add their own keys. | |
78 | ssh.enable_ui_key_generator = true |
|
78 | ssh.enable_ui_key_generator = true | |
79 |
|
79 | |||
80 |
|
80 | |||
81 | 3. Set base_url for instance to enable proper event handling (Optional): |
|
81 | 3. Set base_url for instance to enable proper event handling (Optional): | |
82 |
|
82 | |||
83 | If you wish to have integrations working correctly via SSH please configure |
|
83 | If you wish to have integrations working correctly via SSH please configure | |
84 | The Application base_url. |
|
84 | The Application base_url. | |
85 |
|
85 | |||
86 | Use the ``rccontrol status`` command to view instance details. |
|
86 | Use the ``rccontrol status`` command to view instance details. | |
87 | Hostname is required for the integration to properly set the instance URL. |
|
87 | Hostname is required for the integration to properly set the instance URL. | |
88 |
|
88 | |||
89 | When your hostname is known (e.g https://code.rhodecode.com) please set it |
|
89 | When your hostname is known (e.g https://code.rhodecode.com) please set it | |
90 |
inside :file:` |
|
90 | inside :file:`config/_shared/rhodecode.ini` | |
91 |
|
91 | |||
92 | add into `[app:main]` section the following configuration: |
|
92 | add into `[app:main]` section the following configuration: | |
93 |
|
93 | |||
94 | .. code-block:: ini |
|
94 | .. code-block:: ini | |
95 |
|
95 | |||
96 | app.base_url = https://code.rhodecode.com |
|
96 | app.base_url = https://code.rhodecode.com | |
97 |
|
97 | |||
98 |
|
98 | |||
99 | 4. Add the public key to your user account for testing. |
|
99 | 4. Add the public key to your user account for testing. | |
100 | First generate a new key, or use your existing one and have your public key |
|
100 | First generate a new key, or use your existing one and have your public key | |
101 | at hand. |
|
101 | at hand. | |
102 |
|
102 | |||
103 | Go to |
|
103 | Go to | |
104 | :menuselection:`My Account --> SSH Keys` and add the public key with proper description. |
|
104 | :menuselection:`My Account --> SSH Keys` and add the public key with proper description. | |
105 |
|
105 | |||
106 | This will generate a new entry inside our configured `authorized_keys_rhodecode` file. |
|
106 | This will generate a new entry inside our configured `authorized_keys_rhodecode` file. | |
107 |
|
107 | |||
108 | Test the connection from your local machine using the following example: |
|
108 | Test the connection from your local machine using the following example: | |
109 |
|
109 | |||
110 | .. note:: |
|
110 | .. note:: | |
111 |
|
111 | |||
112 | In case of connection problems please set |
|
112 | In case of connection problems please set | |
113 | `ssh.enable_debug_logging = true` inside the SSH configuration of |
|
113 | `ssh.enable_debug_logging = true` inside the SSH configuration of | |
114 |
:file:` |
|
114 | :file:`config/_shared/rhodecode.ini` | |
115 | Then add, remove your SSH key and try connecting again. |
|
115 | Then add, remove your SSH key and try connecting again. | |
116 | Debug logging will be printed to help find the problems on the server side. |
|
116 | Debug logging will be printed to help find the problems on the server side. | |
117 |
|
117 | |||
118 | Test connection using the ssh command from the local machine. Make sure |
|
118 | Test connection using the ssh command from the local machine. Make sure | |
119 | to use the use who is running the |RCE| server, and not your username from |
|
119 | to use the use who is running the |RCE| server, and not your username from | |
120 | the web interface. |
|
120 | the web interface. | |
121 |
|
121 | |||
122 |
|
122 | |||
123 | For SVN: |
|
123 | For SVN: | |
124 |
|
124 | |||
125 | .. code-block:: bash |
|
125 | .. code-block:: bash | |
126 |
|
126 | |||
127 | SVN_SSH="ssh -i ~/.ssh/id_rsa_test_ssh_private.key" svn checkout svn+ssh://rhodecode@rc-server/repo_name |
|
127 | SVN_SSH="ssh -i ~/.ssh/id_rsa_test_ssh_private.key" svn checkout svn+ssh://rhodecode@rc-server/repo_name | |
128 |
|
128 | |||
129 | For GIT: |
|
129 | For GIT: | |
130 |
|
130 | |||
131 | .. code-block:: bash |
|
131 | .. code-block:: bash | |
132 |
|
132 | |||
133 | GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa_test_ssh_private.key' git clone ssh://rhodecode@rc-server/repo_name |
|
133 | GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa_test_ssh_private.key' git clone ssh://rhodecode@rc-server/repo_name | |
134 |
|
134 | |||
135 | For Mercurial: |
|
135 | For Mercurial: | |
136 |
|
136 | |||
137 | .. code-block:: bash |
|
137 | .. code-block:: bash | |
138 |
|
138 | |||
139 | Add to hgrc: |
|
139 | Add to hgrc: | |
140 |
|
140 | |||
141 | [ui] |
|
141 | [ui] | |
142 | ssh = ssh -C -i ~/.ssh/id_rsa_test_ssh_private.key |
|
142 | ssh = ssh -C -i ~/.ssh/id_rsa_test_ssh_private.key | |
143 |
|
143 | |||
144 | hg clone ssh://rhodecode@rc-server/repo_name |
|
144 | hg clone ssh://rhodecode@rc-server/repo_name |
@@ -1,45 +1,45 b'' | |||||
1 | .. _set-up-mail: |
|
1 | .. _set-up-mail: | |
2 |
|
2 | |||
3 | Set up Email |
|
3 | Set up Email | |
4 | ------------ |
|
4 | ------------ | |
5 |
|
5 | |||
6 | To setup email with your |RCE| instance, open the default |
|
6 | To setup email with your |RCE| instance, open the default | |
7 | :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` |
|
7 | :file:`config/_shared/rhodecode.ini` | |
8 | file and uncomment and configure the email section. If it is not there, |
|
8 | file and uncomment and configure the email section. If it is not there, | |
9 | use the below example to insert it. |
|
9 | use the below example to insert it. | |
10 |
|
10 | |||
11 | Once configured you can check the settings for your |RCE| instance on the |
|
11 | Once configured you can check the settings for your |RCE| instance on the | |
12 | :menuselection:`Admin --> Settings --> Email` page. |
|
12 | :menuselection:`Admin --> Settings --> Email` page. | |
13 |
|
13 | |||
14 | Please be aware that both section should be changed the `[DEFAULT]` for main applications |
|
14 | Please be aware that both section should be changed the `[DEFAULT]` for main applications | |
15 | email config, and `[server:main]` for exception tracking email |
|
15 | email config, and `[server:main]` for exception tracking email | |
16 |
|
16 | |||
17 | .. code-block:: ini |
|
17 | .. code-block:: ini | |
18 |
|
18 | |||
19 | [DEFAULT] |
|
19 | [DEFAULT] | |
20 | ; ######################################################################## |
|
20 | ; ######################################################################## | |
21 | ; EMAIL CONFIGURATION |
|
21 | ; EMAIL CONFIGURATION | |
22 | ; These settings will be used by the RhodeCode mailing system |
|
22 | ; These settings will be used by the RhodeCode mailing system | |
23 | ; ######################################################################## |
|
23 | ; ######################################################################## | |
24 |
|
24 | |||
25 | ; prefix all emails subjects with given prefix, helps filtering out emails |
|
25 | ; prefix all emails subjects with given prefix, helps filtering out emails | |
26 | #email_prefix = [RhodeCode] |
|
26 | #email_prefix = [RhodeCode] | |
27 |
|
27 | |||
28 | ; email FROM address all mails will be sent |
|
28 | ; email FROM address all mails will be sent | |
29 | #app_email_from = rhodecode-noreply@localhost |
|
29 | #app_email_from = rhodecode-noreply@localhost | |
30 |
|
30 | |||
31 | #smtp_server = mail.server.com |
|
31 | #smtp_server = mail.server.com | |
32 | #smtp_username = |
|
32 | #smtp_username = | |
33 | #smtp_password = |
|
33 | #smtp_password = | |
34 | #smtp_port = |
|
34 | #smtp_port = | |
35 | #smtp_use_tls = false |
|
35 | #smtp_use_tls = false | |
36 | #smtp_use_ssl = true |
|
36 | #smtp_use_ssl = true | |
37 |
|
37 | |||
38 | [server:main] |
|
38 | [server:main] | |
39 | ; Send email with exception details when it happens |
|
39 | ; Send email with exception details when it happens | |
40 | #exception_tracker.send_email = true |
|
40 | #exception_tracker.send_email = true | |
41 |
|
41 | |||
42 | ; Comma separated list of recipients for exception emails, |
|
42 | ; Comma separated list of recipients for exception emails, | |
43 | ; e.g admin@rhodecode.com,devops@rhodecode.com |
|
43 | ; e.g admin@rhodecode.com,devops@rhodecode.com | |
44 | ; Can be left empty, then emails will be sent to ALL super-admins |
|
44 | ; Can be left empty, then emails will be sent to ALL super-admins | |
45 | #exception_tracker.send_email_recipients = |
|
45 | #exception_tracker.send_email_recipients = |
@@ -1,91 +1,91 b'' | |||||
1 | .. _multi-instance-setup: |
|
1 | .. _multi-instance-setup: | |
2 |
|
2 | |||
3 | Scaling |RCE| Using Multiple Instances |
|
3 | Scaling |RCE| Using Multiple Instances | |
4 | ====================================== |
|
4 | ====================================== | |
5 |
|
5 | |||
6 | Running multiple instances of |RCE| from a single database can be used to |
|
6 | Running multiple instances of |RCE| from a single database can be used to | |
7 | scale the application for the following deployment setups: |
|
7 | scale the application for the following deployment setups: | |
8 |
|
8 | |||
9 | * Using dedicated Continuous Integrations instances. |
|
9 | * Using dedicated Continuous Integrations instances. | |
10 | * Locating instances closer to geographically dispersed development teams. |
|
10 | * Locating instances closer to geographically dispersed development teams. | |
11 | * Running production and testing instances, or failover instances on a |
|
11 | * Running production and testing instances, or failover instances on a | |
12 | different server. |
|
12 | different server. | |
13 | * Running proxy read-only instances for pull operations. |
|
13 | * Running proxy read-only instances for pull operations. | |
14 |
|
14 | |||
15 | If you wish to run multiple instances of |RCE| using a single database for |
|
15 | If you wish to run multiple instances of |RCE| using a single database for | |
16 | settings, use the following instructions to set this up. Before you get onto |
|
16 | settings, use the following instructions to set this up. Before you get onto | |
17 | multiple instances though, you should install |RCE|, and set |
|
17 | multiple instances though, you should install |RCE|, and set | |
18 | up your first instance as you see fit. You can see the full instructions here |
|
18 | up your first instance as you see fit. You can see the full instructions here | |
19 | :ref:`Installing RhodeCode Enterprise <control:rcc>` |
|
19 | :ref:`Installing RhodeCode Enterprise <control:rcc>` | |
20 |
|
20 | |||
21 | Once you have configured your first instance, you can run additional instances |
|
21 | Once you have configured your first instance, you can run additional instances | |
22 | from the same database using the following steps: |
|
22 | from the same database using the following steps: | |
23 |
|
23 | |||
24 | 1. Install a new instance of |RCE|, choosing SQLite as the database. It is |
|
24 | 1. Install a new instance of |RCE|, choosing SQLite as the database. It is | |
25 | important to choose SQLite, because this will not overwrite any other |
|
25 | important to choose SQLite, because this will not overwrite any other | |
26 | database settings you may have. |
|
26 | database settings you may have. | |
27 |
|
27 | |||
28 | Once the new instance is installed you need to update the licence token and |
|
28 | Once the new instance is installed you need to update the licence token and | |
29 | database connection string in the |
|
29 | database connection string in the | |
30 |
:file:` |
|
30 | :file:`config/_shared/rhodecode.ini` file. | |
31 |
|
31 | |||
32 | .. code-block:: bash |
|
32 | .. code-block:: bash | |
33 |
|
33 | |||
34 | $ rccontrol install Enterprise |
|
34 | $ rccontrol install Enterprise | |
35 |
|
35 | |||
36 | Agree to the licence agreement? [y/N]: y |
|
36 | Agree to the licence agreement? [y/N]: y | |
37 | Username [admin]: username |
|
37 | Username [admin]: username | |
38 | Password (min 6 chars): |
|
38 | Password (min 6 chars): | |
39 | Repeat for confirmation: |
|
39 | Repeat for confirmation: | |
40 | Email: user@example.com |
|
40 | Email: user@example.com | |
41 | Respositories location [/home/brian/repos]: |
|
41 | Respositories location [/home/brian/repos]: | |
42 | IP to start the Enterprise server on [127.0.0.1]: |
|
42 | IP to start the Enterprise server on [127.0.0.1]: | |
43 | Port for the Enterprise server to use [10000]: |
|
43 | Port for the Enterprise server to use [10000]: | |
44 | Database type - [s]qlite, [m]ysql, [p]ostresql: s |
|
44 | Database type - [s]qlite, [m]ysql, [p]ostresql: s | |
45 |
|
45 | |||
46 | 2. The licence token used on each new instance needs to be the token from your |
|
46 | 2. The licence token used on each new instance needs to be the token from your | |
47 | initial instance. This allows multiple instances to run the same licence key. |
|
47 | initial instance. This allows multiple instances to run the same licence key. | |
48 |
|
48 | |||
49 | To get the licence token, go to the |RCE| interface of your primary |
|
49 | To get the licence token, go to the |RCE| interface of your primary | |
50 | instance and select :menuselection:`admin --> setting --> license`. Then |
|
50 | instance and select :menuselection:`admin --> setting --> license`. Then | |
51 | update the licence token setting in each new instance's |
|
51 | update the licence token setting in each new instance's | |
52 | :file:`rhodecode.ini` file. |
|
52 | :file:`rhodecode.ini` file. | |
53 |
|
53 | |||
54 | .. code-block:: ini |
|
54 | .. code-block:: ini | |
55 |
|
55 | |||
56 | ## generated license token, goto license page in RhodeCode settings to get |
|
56 | ## generated license token, goto license page in RhodeCode settings to get | |
57 | ## new token |
|
57 | ## new token | |
58 | license_token = add-token-here |
|
58 | license_token = add-token-here | |
59 |
|
59 | |||
60 | 3. Update the database connection string in the |
|
60 | 3. Update the database connection string in the | |
61 | :file:`rhodecode.ini` file to point to your database. For |
|
61 | :file:`rhodecode.ini` file to point to your database. For | |
62 | more information, see :ref:`config-database`. |
|
62 | more information, see :ref:`config-database`. | |
63 |
|
63 | |||
64 | .. code-block:: ini |
|
64 | .. code-block:: ini | |
65 |
|
65 | |||
66 | ######################################################### |
|
66 | ######################################################### | |
67 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
67 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
68 | ######################################################### |
|
68 | ######################################################### | |
69 |
|
69 | |||
70 | # Default SQLite config |
|
70 | # Default SQLite config | |
71 | sqlalchemy.db1.url = sqlite:////home/user/.rccontrol/enterprise-1/rhodecode.db |
|
71 | sqlalchemy.db1.url = sqlite:////home/user/.rccontrol/enterprise-1/rhodecode.db | |
72 |
|
72 | |||
73 | # Use this example for a PostgreSQL |
|
73 | # Use this example for a PostgreSQL | |
74 | sqlalchemy.db1.url = postgresql://username:password@localhost/rhodecode |
|
74 | sqlalchemy.db1.url = postgresql://username:password@localhost/rhodecode | |
75 |
|
75 | |||
76 | 4. Restart your updated instance. Once restarted the new instance will read |
|
76 | 4. Restart your updated instance. Once restarted the new instance will read | |
77 | the licence key in the database and will function identically as the |
|
77 | the licence key in the database and will function identically as the | |
78 | original instance. |
|
78 | original instance. | |
79 |
|
79 | |||
80 | .. code-block:: bash |
|
80 | .. code-block:: bash | |
81 |
|
81 | |||
82 | $ rccontrol restart enterprise-2 |
|
82 | $ rccontrol restart enterprise-2 | |
83 |
|
83 | |||
84 | If you wish to add additional performance to your setup, see the |
|
84 | If you wish to add additional performance to your setup, see the | |
85 | :ref:`rhodecode-tuning-ref` section. |
|
85 | :ref:`rhodecode-tuning-ref` section. | |
86 |
|
86 | |||
87 | Scaling Deployment Diagram |
|
87 | Scaling Deployment Diagram | |
88 | -------------------------- |
|
88 | -------------------------- | |
89 |
|
89 | |||
90 | .. image:: ../images/scaling-diagrm.png |
|
90 | .. image:: ../images/scaling-diagrm.png | |
91 | :align: center |
|
91 | :align: center |
General Comments 0
You need to be logged in to leave comments.
Login now