diff --git a/docs/admin/repo-admin.rst b/docs/admin/repo-admin.rst new file mode 100644 --- /dev/null +++ b/docs/admin/repo-admin.rst @@ -0,0 +1,28 @@ +.. _repo-admin-set: +.. _permissions-info-add-group-ref: + +Repository Administration +========================= + +Repository permissions in |RCE| can be managed in a number of different ways. +This overview should give you an insight into how you could adopt particular +settings for your needs: + +* Global |repo| permissions: This allows you to set the default permissions + for each new |repo| created within |RCE|, see :ref:`repo-default-ref`. All + |repos| created will inherit these permissions unless explicitly configured. +* Individual |repo| permissions: To set individual |repo| permissions, + see :ref:`set-repo-perms`. +* Repository Group permissions: This allows you to define the permissions for + a group, and all |repos| created within that group will inherit the same + permissions. + +.. toctree:: + + repo_admin/repo-perm-steps + repo_admin/repo-extra-fields + repo_admin/repo-hooks + repo_admin/repo-issue-tracker + repo_admin/repo-vcs + repo_admin/restore-deleted-repositories + repo_admin/repo-admin-tasks \ No newline at end of file diff --git a/docs/admin/repo_admin/repo-admin-tasks.rst b/docs/admin/repo_admin/repo-admin-tasks.rst new file mode 100644 --- /dev/null +++ b/docs/admin/repo_admin/repo-admin-tasks.rst @@ -0,0 +1,24 @@ +.. _repo-admin-tasks: + +Common Admin Tasks for Repositories +----------------------------------- + + +Manually Force Delete Repository +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In case of attached forks or pull-requests repositories should be archived. +Here is how to force delete a repository and remove all dependent objects + + +.. code-block:: bash + + # starts the ishell interactive prompt + $ rccontrol ishell enterprise-1 + +.. code-block:: python + + In [4]: from rhodecode.model.repo import RepoModel + In [3]: repo = Repository.get_by_repo_name('test_repos/repo_with_prs') + In [5]: RepoModel().delete(repo, forks='detach', pull_requests='delete') + In [6]: Session().commit() diff --git a/docs/admin/repo-extra-fields.rst b/docs/admin/repo_admin/repo-extra-fields.rst rename from docs/admin/repo-extra-fields.rst rename to docs/admin/repo_admin/repo-extra-fields.rst --- a/docs/admin/repo-extra-fields.rst +++ b/docs/admin/repo_admin/repo-extra-fields.rst @@ -29,7 +29,7 @@ 1. Go to :menuselection:`Admin --> Repos beside the |repo| to which you wish to add extra fields. 2. On the |repo| settings page, select the :guilabel:`Extra fields` tab. -.. image:: ../images/extra-repo-fields.png +.. image:: ../../images/extra-repo-fields.png The most important is the `New field key` variable which under the value will be stored. It needs to be unique for each repository. The label and description diff --git a/docs/admin/repo-hooks.rst b/docs/admin/repo_admin/repo-hooks.rst rename from docs/admin/repo-hooks.rst rename to docs/admin/repo_admin/repo-hooks.rst diff --git a/docs/admin/repo-issue-tracker.rst b/docs/admin/repo_admin/repo-issue-tracker.rst rename from docs/admin/repo-issue-tracker.rst rename to docs/admin/repo_admin/repo-issue-tracker.rst diff --git a/docs/admin/repo-perm-steps.rst b/docs/admin/repo_admin/repo-perm-steps.rst rename from docs/admin/repo-perm-steps.rst rename to docs/admin/repo_admin/repo-perm-steps.rst diff --git a/docs/admin/repo-vcs.rst b/docs/admin/repo_admin/repo-vcs.rst rename from docs/admin/repo-vcs.rst rename to docs/admin/repo_admin/repo-vcs.rst diff --git a/docs/admin/restore-deleted-repositories.rst b/docs/admin/repo_admin/restore-deleted-repositories.rst rename from docs/admin/restore-deleted-repositories.rst rename to docs/admin/repo_admin/restore-deleted-repositories.rst diff --git a/docs/admin/setting-repo-perms.rst b/docs/admin/setting-repo-perms.rst deleted file mode 100644 --- a/docs/admin/setting-repo-perms.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. _permissions-info-add-group-ref: - -Repository Administration -========================= - -Repository permissions in |RCE| can be managed in a number of different ways. -This overview should give you an insight into how you could adopt particular -settings for your needs: - -* Global |repo| permissions: This allows you to set the default permissions - for each new |repo| created within |RCE|, see :ref:`repo-default-ref`. All - |repos| created will inherit these permissions unless explicitly configured. -* Individual |repo| permissions: To set individual |repo| permissions, - see :ref:`set-repo-perms`. -* Repository Group permissions: This allows you to define the permissions for - a group, and all |repos| created within that group will inherit the same - permissions. - -.. toctree:: - - repo-perm-steps - repo-extra-fields - repo-hooks - repo-issue-tracker - repo-vcs - diff --git a/docs/admin/system-admin.rst b/docs/admin/system-admin.rst --- a/docs/admin/system-admin.rst +++ b/docs/admin/system-admin.rst @@ -16,19 +16,17 @@ The following are the most common system .. toctree:: - config-files-overview - vcs-server - svn-http - svn-path-permissions - gunicorn-ssl-support - apache-config - nginx-config - backup-restore - tuning-rhodecode - indexing - reset-information - enable-debug - admin-tricks - cleanup-cmds - restore-deleted-repositories - + system_admin/config-files-overview + system_admin/vcs-server + system_admin/svn-http + system_admin/svn-path-permissions + system_admin/gunicorn-ssl-support + system_admin/apache-config + system_admin/nginx-config + system_admin/backup-restore + system_admin/tuning-rhodecode + system_admin/indexing + system_admin/reset-information + system_admin/enable-debug + system_admin/admin-tricks + system_admin/cleanup-cmds diff --git a/docs/admin/admin-tricks.rst b/docs/admin/system_admin/admin-tricks.rst rename from docs/admin/admin-tricks.rst rename to docs/admin/system_admin/admin-tricks.rst --- a/docs/admin/admin-tricks.rst +++ b/docs/admin/system_admin/admin-tricks.rst @@ -57,7 +57,7 @@ 2. To add a message that will be display 3. Select :guilabel:`Save`, and you will see the message once your page refreshes. -.. image:: ../images/server-wide-announcement.png +.. image:: ../../images/server-wide-announcement.png :alt: Server Wide Announcement .. _md-rst: @@ -207,7 +207,7 @@ 2. Restart the |RCE| instance and check Instance "enterprise-2" successfully stopped. Instance "enterprise-2" successfully started. -.. image:: ../images/language.png +.. image:: ../../images/language.png .. _set-repo-pub: diff --git a/docs/admin/apache-config.rst b/docs/admin/system_admin/apache-config.rst rename from docs/admin/apache-config.rst rename to docs/admin/system_admin/apache-config.rst --- a/docs/admin/apache-config.rst +++ b/docs/admin/system_admin/apache-config.rst @@ -8,7 +8,7 @@ the information in the following section .. toctree:: - apache-conf-example - apache-diffie-hellman - apache-subdirectory - apache-wsgi-coding + apache/apache-conf-example + apache/apache-diffie-hellman + apache/apache-subdirectory + apache/apache-wsgi-coding diff --git a/docs/admin/apache-conf-example.rst b/docs/admin/system_admin/apache/apache-conf-example.rst rename from docs/admin/apache-conf-example.rst rename to docs/admin/system_admin/apache/apache-conf-example.rst diff --git a/docs/admin/apache-diffie-hellman.rst b/docs/admin/system_admin/apache/apache-diffie-hellman.rst rename from docs/admin/apache-diffie-hellman.rst rename to docs/admin/system_admin/apache/apache-diffie-hellman.rst diff --git a/docs/admin/apache-subdirectory.rst b/docs/admin/system_admin/apache/apache-subdirectory.rst rename from docs/admin/apache-subdirectory.rst rename to docs/admin/system_admin/apache/apache-subdirectory.rst diff --git a/docs/admin/apache-wsgi-coding.rst b/docs/admin/system_admin/apache/apache-wsgi-coding.rst rename from docs/admin/apache-wsgi-coding.rst rename to docs/admin/system_admin/apache/apache-wsgi-coding.rst diff --git a/docs/admin/backup-restore.rst b/docs/admin/system_admin/backup-restore.rst rename from docs/admin/backup-restore.rst rename to docs/admin/system_admin/backup-restore.rst diff --git a/docs/admin/cleanup-cmds.rst b/docs/admin/system_admin/cleanup-cmds.rst rename from docs/admin/cleanup-cmds.rst rename to docs/admin/system_admin/cleanup-cmds.rst diff --git a/docs/admin/config-files-overview.rst b/docs/admin/system_admin/config-files-overview.rst rename from docs/admin/config-files-overview.rst rename to docs/admin/system_admin/config-files-overview.rst diff --git a/docs/admin/enable-debug.rst b/docs/admin/system_admin/enable-debug.rst rename from docs/admin/enable-debug.rst rename to docs/admin/system_admin/enable-debug.rst diff --git a/docs/admin/gunicorn-ssl-support.rst b/docs/admin/system_admin/gunicorn-ssl-support.rst rename from docs/admin/gunicorn-ssl-support.rst rename to docs/admin/system_admin/gunicorn-ssl-support.rst diff --git a/docs/admin/indexing.rst b/docs/admin/system_admin/indexing.rst rename from docs/admin/indexing.rst rename to docs/admin/system_admin/indexing.rst diff --git a/docs/admin/nginx-config.rst b/docs/admin/system_admin/nginx-config.rst rename from docs/admin/nginx-config.rst rename to docs/admin/system_admin/nginx-config.rst --- a/docs/admin/nginx-config.rst +++ b/docs/admin/system_admin/nginx-config.rst @@ -8,7 +8,7 @@ the information in the following section .. toctree:: - nginx-config-example - nginx-diffie-hellman - nginx-proxy-conf - nginx-url-prefix + nginx/nginx-config-example + nginx/nginx-diffie-hellman + nginx/nginx-proxy-conf + nginx/nginx-url-prefix diff --git a/docs/admin/nginx-config-example.rst b/docs/admin/system_admin/nginx/nginx-config-example.rst rename from docs/admin/nginx-config-example.rst rename to docs/admin/system_admin/nginx/nginx-config-example.rst diff --git a/docs/admin/nginx-diffie-hellman.rst b/docs/admin/system_admin/nginx/nginx-diffie-hellman.rst rename from docs/admin/nginx-diffie-hellman.rst rename to docs/admin/system_admin/nginx/nginx-diffie-hellman.rst diff --git a/docs/admin/nginx-proxy-conf.rst b/docs/admin/system_admin/nginx/nginx-proxy-conf.rst rename from docs/admin/nginx-proxy-conf.rst rename to docs/admin/system_admin/nginx/nginx-proxy-conf.rst diff --git a/docs/admin/nginx-url-prefix.rst b/docs/admin/system_admin/nginx/nginx-url-prefix.rst rename from docs/admin/nginx-url-prefix.rst rename to docs/admin/system_admin/nginx/nginx-url-prefix.rst diff --git a/docs/admin/reset-information.rst b/docs/admin/system_admin/reset-information.rst rename from docs/admin/reset-information.rst rename to docs/admin/system_admin/reset-information.rst diff --git a/docs/admin/svn-http.rst b/docs/admin/system_admin/svn-http.rst rename from docs/admin/svn-http.rst rename to docs/admin/system_admin/svn-http.rst diff --git a/docs/admin/svn-path-permissions.rst b/docs/admin/system_admin/svn-path-permissions.rst rename from docs/admin/svn-path-permissions.rst rename to docs/admin/system_admin/svn-path-permissions.rst diff --git a/docs/admin/tuning-rhodecode.rst b/docs/admin/system_admin/tuning-rhodecode.rst rename from docs/admin/tuning-rhodecode.rst rename to docs/admin/system_admin/tuning-rhodecode.rst --- a/docs/admin/tuning-rhodecode.rst +++ b/docs/admin/system_admin/tuning-rhodecode.rst @@ -8,14 +8,14 @@ may find some of the following methods u .. toctree:: - tuning-gunicorn - tuning-vcs-memory-cache - tuning-user-sessions-performance - tuning-increase-db-performance - tuning-scale-horizontally-cluster - tuning-mount-cache-memory - tuning-change-encoding - tuning-change-large-file-dir - tuning-change-lfs-dir - tuning-hg-auth-loop + tuning/tuning-gunicorn + tuning/tuning-vcs-memory-cache + tuning/tuning-user-sessions-performance + tuning/tuning-increase-db-performance + tuning/tuning-scale-horizontally-cluster + tuning/tuning-mount-cache-memory + tuning/tuning-change-encoding + tuning/tuning-change-large-file-dir + tuning/tuning-change-lfs-dir + tuning/tuning-hg-auth-loop diff --git a/docs/admin/tuning-change-encoding.rst b/docs/admin/system_admin/tuning/tuning-change-encoding.rst rename from docs/admin/tuning-change-encoding.rst rename to docs/admin/system_admin/tuning/tuning-change-encoding.rst diff --git a/docs/admin/tuning-change-large-file-dir.rst b/docs/admin/system_admin/tuning/tuning-change-large-file-dir.rst rename from docs/admin/tuning-change-large-file-dir.rst rename to docs/admin/system_admin/tuning/tuning-change-large-file-dir.rst diff --git a/docs/admin/tuning-change-lfs-dir.rst b/docs/admin/system_admin/tuning/tuning-change-lfs-dir.rst rename from docs/admin/tuning-change-lfs-dir.rst rename to docs/admin/system_admin/tuning/tuning-change-lfs-dir.rst diff --git a/docs/admin/tuning-gunicorn.rst b/docs/admin/system_admin/tuning/tuning-gunicorn.rst rename from docs/admin/tuning-gunicorn.rst rename to docs/admin/system_admin/tuning/tuning-gunicorn.rst --- a/docs/admin/tuning-gunicorn.rst +++ b/docs/admin/system_admin/tuning/tuning-gunicorn.rst @@ -42,7 +42,7 @@ 2. In the ``[server:main]`` section, cha ## restarted, could prevent memory leaks max_requests = 1000 max_requests_jitter = 30 - ## amount of time a worker can spend with handling a request before it + ## amount of time a worker can spend with handling a request tuning-change-lfs-dir.before it ## gets killed and restarted. Set to 6hrs timeout = 21600 diff --git a/docs/admin/tuning-hg-auth-loop.rst b/docs/admin/system_admin/tuning/tuning-hg-auth-loop.rst rename from docs/admin/tuning-hg-auth-loop.rst rename to docs/admin/system_admin/tuning/tuning-hg-auth-loop.rst diff --git a/docs/admin/tuning-increase-db-performance.rst b/docs/admin/system_admin/tuning/tuning-increase-db-performance.rst rename from docs/admin/tuning-increase-db-performance.rst rename to docs/admin/system_admin/tuning/tuning-increase-db-performance.rst diff --git a/docs/admin/tuning-mount-cache-memory.rst b/docs/admin/system_admin/tuning/tuning-mount-cache-memory.rst rename from docs/admin/tuning-mount-cache-memory.rst rename to docs/admin/system_admin/tuning/tuning-mount-cache-memory.rst diff --git a/docs/admin/tuning-scale-horizontally-cluster.rst b/docs/admin/system_admin/tuning/tuning-scale-horizontally-cluster.rst rename from docs/admin/tuning-scale-horizontally-cluster.rst rename to docs/admin/system_admin/tuning/tuning-scale-horizontally-cluster.rst diff --git a/docs/admin/tuning-user-sessions-performance.rst b/docs/admin/system_admin/tuning/tuning-user-sessions-performance.rst rename from docs/admin/tuning-user-sessions-performance.rst rename to docs/admin/system_admin/tuning/tuning-user-sessions-performance.rst diff --git a/docs/admin/tuning-vcs-memory-cache.rst b/docs/admin/system_admin/tuning/tuning-vcs-memory-cache.rst rename from docs/admin/tuning-vcs-memory-cache.rst rename to docs/admin/system_admin/tuning/tuning-vcs-memory-cache.rst diff --git a/docs/admin/vcs-server.rst b/docs/admin/system_admin/vcs-server.rst rename from docs/admin/vcs-server.rst rename to docs/admin/system_admin/vcs-server.rst diff --git a/docs/api/api.rst b/docs/api/api.rst --- a/docs/api/api.rst +++ b/docs/api/api.rst @@ -204,6 +204,7 @@ are not required in args. methods/pull-request-methods methods/repo-methods methods/repo-group-methods + methods/search-methods methods/server-methods methods/user-methods methods/user-group-methods diff --git a/docs/api/methods/repo-methods.rst b/docs/api/methods/repo-methods.rst --- a/docs/api/methods/repo-methods.rst +++ b/docs/api/methods/repo-methods.rst @@ -462,6 +462,7 @@ get_repo_file :param cache: Use internal caches for fetching files. If disabled fetching files is slower but more memory efficient :type cache: Optional(bool) + Example output: .. code-block:: bash @@ -499,53 +500,51 @@ get_repo_nodes .. py:function:: get_repo_nodes(apiuser, repoid, revision, root_path, ret_type=, details=, max_file_bytes=) Returns a list of nodes and children in a flat list for a given - path at given revision. + path at given revision. - It's possible to specify ret_type to show only `files` or `dirs`. + It's possible to specify ret_type to show only `files` or `dirs`. - This command can only be run using an |authtoken| with admin rights, - or users with at least read rights to |repos|. + This command can only be run using an |authtoken| with admin rights, + or users with at least read rights to |repos|. - :param apiuser: This is filled automatically from the |authtoken|. - :type apiuser: AuthUser - :param repoid: The repository name or repository ID. - :type repoid: str or int - :param revision: The revision for which listing should be done. - :type revision: str - :param root_path: The path from which to start displaying. - :type root_path: str - :param ret_type: Set the return type. Valid options are - ``all`` (default), ``files`` and ``dirs``. - :type ret_type: Optional(str) - :param details: Returns extended information about nodes, such as - md5, binary, and or content. - The valid options are ``basic`` and ``full``. - :type details: Optional(str) - :param max_file_bytes: Only return file content under this file size bytes - :type details: Optional(int) - - Example output: + :param apiuser: This is filled automatically from the |authtoken|. + :type apiuser: AuthUser + :param repoid: The repository name or repository ID. + :type repoid: str or int + :param revision: The revision for which listing should be done. + :type revision: str + :param root_path: The path from which to start displaying. + :type root_path: str + :param ret_type: Set the return type. Valid options are + ``all`` (default), ``files`` and ``dirs``. + :type ret_type: Optional(str) + :param details: Returns extended information about nodes, such as + md5, binary, and or content. + The valid options are ``basic`` and ``full``. + :type details: Optional(str) + :param max_file_bytes: Only return file content under this file size bytes + :type details: Optional(int) - .. code-block:: bash + Example output: + + .. code-block:: bash - id : - result: [ - { - "binary": false, - "content": "File line - Line2 - ", - "extension": "md", - "lines": 2, - "md5": "059fa5d29b19c0657e384749480f6422", - "mimetype": "text/x-minidsrc", - "name": "file.md", - "size": 580, - "type": "file" - }, - ... - ] - error: null + id : + result: [ + { + "binary": false, + "content": "File line", + "extension": "md", + "lines": 2, + "md5": "059fa5d29b19c0657e384749480f6422", + "mimetype": "text/x-minidsrc", + "name": "file.md", + "size": 580, + "type": "file" + }, + ... + ] + error: null get_repo_refs diff --git a/docs/api/methods/search-methods.rst b/docs/api/methods/search-methods.rst new file mode 100644 --- /dev/null +++ b/docs/api/methods/search-methods.rst @@ -0,0 +1,35 @@ +.. _search-methods-ref: + +search methods +============== + +search +------ + +.. py:function:: search(apiuser, search_query, search_type, page_limit=, page=, search_sort=, repo_name=, repo_group_name=) + + Fetch Full Text Search results using API. + + :param apiuser: This is filled automatically from the |authtoken|. + :type apiuser: AuthUser + :param search_query: Search query. + :type search_query: str + :param search_type: Search type. The following are valid options: + * commit + * content + * path + :type search_type: str + :param page_limit: Page item limit, from 1 to 500. Default 10 items. + :type page_limit: Optional(int) + :param page: Page number. Default first page. + :type page: Optional(int) + :param search_sort: Search sort order. Default newfirst. The following are valid options: + * newfirst + * oldfirst + :type search_sort: Optional(str) + :param repo_name: Filter by one repo. Default is all. + :type repo_name: Optional(str) + :param repo_group_name: Filter by one repo group. Default is all. + :type repo_group_name: Optional(str) + + diff --git a/docs/index.rst b/docs/index.rst --- a/docs/index.rst +++ b/docs/index.rst @@ -46,7 +46,7 @@ and commit files and |repos| while manag nix/default-env admin/system-admin admin/user-admin - admin/setting-repo-perms + admin/repo-admin admin/security-tips auth/auth issue-trackers/issue-trackers diff --git a/rhodecode/api/views/repo_api.py b/rhodecode/api/views/repo_api.py --- a/rhodecode/api/views/repo_api.py +++ b/rhodecode/api/views/repo_api.py @@ -444,7 +444,7 @@ def get_repo_nodes(request, apiuser, rep result: [ { "binary": false, - "content": "File line\nLine2\n", + "content": "File line", "extension": "md", "lines": 2, "md5": "059fa5d29b19c0657e384749480f6422", @@ -529,6 +529,7 @@ def get_repo_file(request, apiuser, repo :param cache: Use internal caches for fetching files. If disabled fetching files is slower but more memory efficient :type cache: Optional(bool) + Example output: .. code-block:: bash