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