Show More
@@ -1,119 +1,115 b'' | |||||
1 | .. _rhodecode-reset-ref: |
|
1 | .. _rhodecode-reset-ref: | |
2 |
|
2 | |||
3 | Settings Management |
|
3 | Settings Management | |
4 | ------------------- |
|
4 | ------------------- | |
5 |
|
5 | |||
6 | All |RCE| settings can be set from the user interface, but in the event that |
|
6 | All |RCE| settings can be set from the user interface, but in the event that | |
7 | it somehow becomes unavailable you can use ``ishell`` inside your |RCE| |
|
7 | it somehow becomes unavailable you can use ``ishell`` inside your |RCE| | |
8 | ``virtualenv`` to carry out emergency measures. |
|
8 | ``virtualenv`` to carry out emergency measures. | |
9 |
|
9 | |||
10 | .. warning:: |
|
10 | .. warning:: | |
11 |
|
11 | |||
12 | Logging into the |RCE| database with ``iShell`` should only be done by an |
|
12 | Logging into the |RCE| database with ``iShell`` should only be done by an | |
13 | experienced and knowledgeable database administrator. |
|
13 | experienced and knowledgeable database administrator. | |
14 |
|
14 | |||
15 | Reset Admin Account Privileges |
|
15 | Reset Admin Account Privileges | |
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
17 |
|
17 | |||
18 | If you accidentally remove your admin privileges from the admin account you |
|
18 | If you accidentally remove your admin privileges from the admin account you | |
19 | can restore them using ``ishell``. Use the following example to reset your |
|
19 | can restore them using ``ishell``. Use the following example to reset your | |
20 | account permissions. |
|
20 | account permissions. | |
21 |
|
21 | |||
22 | .. code-block:: bash |
|
22 | .. code-block:: bash | |
23 |
|
23 | |||
24 | # Open iShell from the terminal |
|
24 | # Open iShell from the terminal | |
25 |
$ |
|
25 | $ rccontrol ishell enterprise-1 | |
26 | ishell .rccontrol/enterprise-1/rhodecode.ini |
|
|||
27 |
|
26 | |||
28 | .. code-block:: mysql |
|
27 | .. code-block:: mysql | |
29 |
|
28 | |||
30 | # Use this example to change user permissions |
|
29 | # Use this example to change user permissions | |
31 | In [1]: adminuser = User.get_by_username('username') |
|
30 | In [1]: adminuser = User.get_by_username('username') | |
32 | In [2]: adminuser.admin = True |
|
31 | In [2]: adminuser.admin = True | |
33 | In [3]: Session().add(adminuser);Session().commit() |
|
32 | In [3]: Session().add(adminuser);Session().commit() | |
34 | In [4]: exit() |
|
33 | In [4]: exit() | |
35 |
|
34 | |||
36 | Set to read global ``.hgrc`` file |
|
35 | Set to read global ``.hgrc`` file | |
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
38 |
|
37 | |||
39 | By default, |RCE| does not read global ``hgrc`` files in |
|
38 | By default, |RCE| does not read global ``hgrc`` files in | |
40 | ``/etc/mercurial/hgrc`` or ``/etc/mercurial/hgrc.d`` because it |
|
39 | ``/etc/mercurial/hgrc`` or ``/etc/mercurial/hgrc.d`` because it | |
41 | can lead to issues. This is set in the ``rhodecode_ui`` table for which |
|
40 | can lead to issues. This is set in the ``rhodecode_ui`` table for which | |
42 | there is no UI. If you need to edit this you can |
|
41 | there is no UI. If you need to edit this you can | |
43 | manually change the settings using SQL statements with ``ishell``. Use the |
|
42 | manually change the settings using SQL statements with ``ishell``. Use the | |
44 | following example to make changes to this table. |
|
43 | following example to make changes to this table. | |
45 |
|
44 | |||
46 | .. code-block:: bash |
|
45 | .. code-block:: bash | |
47 |
|
46 | |||
48 | # Open iShell from the terminal |
|
47 | # Open iShell from the terminal | |
49 | $ .rccontrol/enterprise-5/profile/bin/paster \ |
|
48 | $ rccontrol ishell enterprise-1 | |
50 | ishell.rccontrol/enterprise-5/rhodecode.ini |
|
|||
51 |
|
49 | |||
52 | .. code-block:: mysql |
|
50 | .. code-block:: mysql | |
53 |
|
51 | |||
54 | # Use this example to enable global .hgrc access |
|
52 | # Use this example to enable global .hgrc access | |
55 | In [1]: new_option = RhodeCodeUi() |
|
53 | In [1]: new_option = RhodeCodeUi() | |
56 | In [2]: new_option.ui_section='web' |
|
54 | In [2]: new_option.ui_section='web' | |
57 | In [3]: new_option.ui_key='allow_push' |
|
55 | In [3]: new_option.ui_key='allow_push' | |
58 | In [4]: new_option.ui_value='*' |
|
56 | In [4]: new_option.ui_value='*' | |
59 | In [5]: Session().add(new_option);Session().commit() |
|
57 | In [5]: Session().add(new_option);Session().commit() | |
60 | In [6]: exit() |
|
58 | In [6]: exit() | |
61 |
|
59 | |||
62 | Manually Reset Password |
|
60 | Manually Reset Password | |
63 | ^^^^^^^^^^^^^^^^^^^^^^^ |
|
61 | ^^^^^^^^^^^^^^^^^^^^^^^ | |
64 |
|
62 | |||
65 | If you need to manually reset a user password, use the following steps. |
|
63 | If you need to manually reset a user password, use the following steps. | |
66 |
|
64 | |||
67 | 1. Navigate to your |RCE| install location. |
|
65 | 1. Navigate to your |RCE| install location. | |
68 | 2. Run the interactive ``ishell`` prompt. |
|
66 | 2. Run the interactive ``ishell`` prompt. | |
69 | 3. Set a new password. |
|
67 | 3. Set a new password. | |
70 |
|
68 | |||
71 | Use the following code example to carry out these steps. |
|
69 | Use the following code example to carry out these steps. | |
72 |
|
70 | |||
73 | .. code-block:: bash |
|
71 | .. code-block:: bash | |
74 |
|
72 | |||
75 | # starts the ishell interactive prompt |
|
73 | # starts the ishell interactive prompt | |
76 |
$ |
|
74 | $ rccontrol ishell enterprise-1 | |
77 | ishell .rccontrol/enterprise-1/rhodecode.ini |
|
|||
78 |
|
75 | |||
79 | .. code-block:: mysql |
|
76 | .. code-block:: mysql | |
80 |
|
77 | |||
81 | In [1]: from rhodecode.lib.auth import generate_auth_token |
|
78 | In [1]: from rhodecode.lib.auth import generate_auth_token | |
82 | In [2]: from rhodecode.lib.auth import get_crypt_password |
|
79 | In [2]: from rhodecode.lib.auth import get_crypt_password | |
83 | # Enter the user name whose password you wish to change |
|
80 | # Enter the user name whose password you wish to change | |
84 | In [3]: my_user = 'USERNAME' |
|
81 | In [3]: my_user = 'USERNAME' | |
85 | In [4]: u = User.get_by_username(my_user) |
|
82 | In [4]: u = User.get_by_username(my_user) | |
86 | # If this fails then the user does not exist |
|
83 | # If this fails then the user does not exist | |
87 | In [5]: u.auth_token = generate_auth_token(my_user) |
|
84 | In [5]: u.auth_token = generate_auth_token(my_user) | |
88 | # Set the new password |
|
85 | # Set the new password | |
89 | In [6]: u.password = get_crypt_password('PASSWORD') |
|
86 | In [6]: u.password = get_crypt_password('PASSWORD') | |
90 | In [7]: Session().add(u);Session().commit() |
|
87 | In [7]: Session().add(u);Session().commit() | |
91 | In [8]: exit() |
|
88 | In [8]: exit() | |
92 |
|
89 | |||
93 |
|
90 | |||
94 |
|
91 | |||
95 | Change user details |
|
92 | Change user details | |
96 | ^^^^^^^^^^^^^^^^^^^ |
|
93 | ^^^^^^^^^^^^^^^^^^^ | |
97 |
|
94 | |||
98 | If you need to manually change some of users details, use the following steps. |
|
95 | If you need to manually change some of users details, use the following steps. | |
99 |
|
96 | |||
100 | 1. Navigate to your |RCE| install location. |
|
97 | 1. Navigate to your |RCE| install location. | |
101 | 2. Run the interactive ``ishell`` prompt. |
|
98 | 2. Run the interactive ``ishell`` prompt. | |
102 | 3. Set a new arguments for users. |
|
99 | 3. Set a new arguments for users. | |
103 |
|
100 | |||
104 | Use the following code example to carry out these steps. |
|
101 | Use the following code example to carry out these steps. | |
105 |
|
102 | |||
106 | .. code-block:: bash |
|
103 | .. code-block:: bash | |
107 |
|
104 | |||
108 | # starts the ishell interactive prompt |
|
105 | # starts the ishell interactive prompt | |
109 |
$ |
|
106 | $ rccontrol ishell enterprise-1 | |
110 | ishell .rccontrol/enterprise-1/rhodecode.ini |
|
|||
111 |
|
107 | |||
112 | .. code-block:: mysql |
|
108 | .. code-block:: mysql | |
113 |
|
109 | |||
114 | # Use this example to change email and username of LDAP user |
|
110 | # Use this example to change email and username of LDAP user | |
115 | In [1]: my_user = User.get_by_username('some_username') |
|
111 | In [1]: my_user = User.get_by_username('some_username') | |
116 | In [2]: my_user.email = 'new_email@foobar.com' |
|
112 | In [2]: my_user.email = 'new_email@foobar.com' | |
117 | In [3]: my_user.username = 'SomeUser' |
|
113 | In [3]: my_user.username = 'SomeUser' | |
118 | In [4]: Session().add(my_user);Session().commit() |
|
114 | In [4]: Session().add(my_user);Session().commit() | |
119 | In [5]: exit() |
|
115 | In [5]: exit() |
@@ -1,32 +1,32 b'' | |||||
1 | .. _hg-lrg-loc: |
|
1 | .. _hg-lrg-loc: | |
2 |
|
2 | |||
3 | Change the |hg| Large Files Location |
|
3 | Change the |hg| Large Files Location | |
4 | ------------------------------------ |
|
4 | ------------------------------------ | |
5 |
|
5 | |||
6 | |RCE| manages |hg| larges files from the following default location |
|
6 | |RCE| manages |hg| larges files from the following default location | |
7 | :file:`/home/{user}/repos/.cache/largefiles`. If you wish to change this, use |
|
7 | :file:`/home/{user}/repos/.cache/largefiles`. If you wish to change this, use | |
8 | the following steps: |
|
8 | the following steps: | |
9 |
|
9 | |||
10 | 1. Open ishell from the terminal and use it to log into the |RCE| database by |
|
10 | 1. Open ishell from the terminal and use it to log into the |RCE| database by | |
11 | specifying the instance :file:`rhodecode.ini` file. |
|
11 | specifying the instance :file:`rhodecode.ini` file. | |
12 |
|
12 | |||
13 | .. code-block:: bash |
|
13 | .. code-block:: bash | |
14 |
|
14 | |||
15 | # Open iShell from the terminal and set ini file |
|
15 | # Open iShell from the terminal and set ini file | |
16 | $ .rccontrol/enterprise-1/profile/bin/paster ishell .rccontrol/enterprise-1/rhodecode.ini |
|
16 | $ rccontrol ishell enterprise-1 | |
17 |
|
17 | |||
18 | 2. Run the following commands, and ensure that |RCE| has write access to the |
|
18 | 2. Run the following commands, and ensure that |RCE| has write access to the | |
19 | new directory: |
|
19 | new directory: | |
20 |
|
20 | |||
21 | .. code-block:: bash |
|
21 | .. code-block:: bash | |
22 |
|
22 | |||
23 | # Once logged into the database, use SQL to redirect |
|
23 | # Once logged into the database, use SQL to redirect | |
24 | # the large files location |
|
24 | # the large files location | |
25 | In [1]: from rhodecode.model.settings import SettingsModel |
|
25 | In [1]: from rhodecode.model.settings import SettingsModel | |
26 | In [2]: SettingsModel().get_ui_by_key('usercache') |
|
26 | In [2]: SettingsModel().get_ui_by_key('usercache') | |
27 | Out[2]: <RhodeCodeUi[largefiles]usercache=>/mnt/hgfs/shared/workspace/xxxx/.cache/largefiles]> |
|
27 | Out[2]: <RhodeCodeUi[largefiles]usercache=>/mnt/hgfs/shared/workspace/xxxx/.cache/largefiles]> | |
28 |
|
28 | |||
29 | In [3]: largefiles_cache = SettingsModel().get_ui_by_key('usercache') |
|
29 | In [3]: largefiles_cache = SettingsModel().get_ui_by_key('usercache') | |
30 | In [4]: largefiles_cache.ui_value = '/new/path’ |
|
30 | In [4]: largefiles_cache.ui_value = '/new/path’ | |
31 | In [5]: Session().add(largefiles_cache);Session().commit() |
|
31 | In [5]: Session().add(largefiles_cache);Session().commit() | |
32 |
|
32 |
General Comments 0
You need to be logged in to leave comments.
Login now