{"title":"GitLab (self-hosted)","description":"Connect a self-hosted GitLab instance to Altertable through an OAuth application to sync knowledge from your repositories.","order":340,"askSuggestions":["Which scopes does the GitLab OAuth application need?","Why do I get a 404 when connecting GitLab?","How do I fix a redirect URI mismatch?"],"navigation":true,"routeId":"knowledgeIntegrationsGitlabSelfHosted","body":{"code":"var Component=(()=>{var u=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),y=(t,e)=>{for(var i in e)c(t,i,{get:e[i],enumerable:!0})},l=(t,e,i,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let r of b(e))!f.call(t,r)&&r!==i&&c(t,r,{get:()=>e[r],enumerable:!(o=g(e,r))||o.enumerable});return t};var L=(t,e,i)=>(i=t!=null?u(m(t)):{},l(e||!t||!t.__esModule?c(i,\"default\",{value:t,enumerable:!0}):i,t)),w=t=>l(c({},\"__esModule\",{value:!0}),t);var s=A((v,a)=>{a.exports=_jsx_runtime});var G={};y(G,{default:()=>p,frontmatter:()=>x});var n=L(s()),x={title:\"GitLab (self-hosted)\",routeId:\"knowledgeIntegrationsGitlabSelfHosted\",description:\"Connect a self-hosted GitLab instance to Altertable through an OAuth application to sync knowledge from your repositories.\",order:340,askSuggestions:[\"Which scopes does the GitLab OAuth application need?\",\"Why do I get a 404 when connecting GitLab?\",\"How do I fix a redirect URI mismatch?\"]};function h(t){let e={a:\"a\",code:\"code\",h1:\"h1\",h2:\"h2\",li:\"li\",ol:\"ol\",p:\"p\",strong:\"strong\",ul:\"ul\",...t.components},{DocsPreviewDocument:i,DocsPreviewSection:o}=e;return i||d(\"DocsPreviewDocument\",!0),o||d(\"DocsPreviewSection\",!0),(0,n.jsxs)(i,{anchors:\"gitlab-self-hosted prerequisites 1-create-the-oauth-application-on-gitlab 2-complete-the-connection-on-altertable troubleshooting\",children:[(0,n.jsxs)(o,{sectionId:\"gitlab-self-hosted\",sectionTitle:\"GitLab (self-hosted)\",anchors:\"\",ancestors:\"\",index:\"0\",children:[(0,n.jsx)(e.h1,{id:\"gitlab-self-hosted\",children:\"GitLab (self-hosted)\"}),`\n`,(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.a,{href:\"https://about.gitlab.com/\",children:\"GitLab\"}),\" self-managed instances can connect to Altertable through an OAuth application. Because a self-hosted instance runs on your own domain, you register the OAuth application yourself and provide its credentials to Altertable.\"]}),`\n`,(0,n.jsx)(e.p,{children:\"The connection is set up in two stages: you create an OAuth application in GitLab, then enter its credentials in Altertable and authorize the connection.\"}),`\n`]}),(0,n.jsxs)(o,{sectionId:\"prerequisites\",sectionTitle:\"Prerequisites\",anchors:\"\",ancestors:\"\",index:\"1\",children:[(0,n.jsx)(e.h2,{id:\"prerequisites\",children:\"Prerequisites\"}),`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[\"A self-hosted GitLab instance reachable from Altertable (for example \",(0,n.jsx)(e.code,{children:\"https://gitlab.your-company.com\"}),\").\"]}),`\n`,(0,n.jsx)(e.li,{children:\"Permission to create an OAuth application on that instance (user, group, or admin application depending on your setup).\"}),`\n`,(0,n.jsx)(e.li,{children:\"Access to create connections in your Altertable environment.\"}),`\n`]}),`\n`]}),(0,n.jsxs)(o,{sectionId:\"1-create-the-oauth-application-on-gitlab\",sectionTitle:\"1. Create the OAuth application on GitLab\",anchors:\"\",ancestors:\"\",index:\"2\",children:[(0,n.jsx)(e.h2,{id:\"1-create-the-oauth-application-on-gitlab\",children:\"1. Create the OAuth application on GitLab\"}),`\n`,(0,n.jsx)(e.p,{children:\"Register an OAuth application on your GitLab instance so it can authorize Altertable.\"}),`\n`,(0,n.jsxs)(e.ol,{children:[`\n`,(0,n.jsx)(e.li,{children:\"In GitLab, open the OAuth application settings for your user, group, or instance, depending on where you have permission to register applications.\"}),`\n`,(0,n.jsxs)(e.li,{children:[\"Choose \",(0,n.jsx)(e.strong,{children:\"Add new application\"}),\".\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Set a \",(0,n.jsx)(e.strong,{children:\"Name\"}),\", such as \",(0,n.jsx)(e.code,{children:\"Altertable Knowledge\"}),\".\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Set \",(0,n.jsx)(e.code,{children:\"https://app.altertable.ai/gitlab-app/callback\"}),\" as a \",(0,n.jsx)(e.strong,{children:\"Redirect URI\"}),\".\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Enable \",(0,n.jsx)(e.strong,{children:\"Confidential\"}),\".\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Select the required \",(0,n.jsx)(e.strong,{children:\"Scopes\"}),\":\",`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:\"read_api\"}),\" \\u2014 read access to the GitLab API.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:\"read_user\"}),\" \\u2014 read the authenticating user's profile.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:\"read_repository\"}),\" \\u2014 read-only access to repository contents.\"]}),`\n`]}),`\n`]}),`\n`,(0,n.jsx)(e.li,{children:\"Save the application.\"}),`\n`,(0,n.jsxs)(e.li,{children:[\"Copy the generated \",(0,n.jsx)(e.strong,{children:\"Application ID\"}),\" and \",(0,n.jsx)(e.strong,{children:\"Secret\"}),\". The secret is shown only once.\"]}),`\n`]}),`\n`]}),(0,n.jsxs)(o,{sectionId:\"2-complete-the-connection-on-altertable\",sectionTitle:\"2. Complete the connection on Altertable\",anchors:\"\",ancestors:\"\",index:\"3\",children:[(0,n.jsx)(e.h2,{id:\"2-complete-the-connection-on-altertable\",children:\"2. Complete the connection on Altertable\"}),`\n`,(0,n.jsx)(e.p,{children:\"Go to the Altertable connection screen to complete authorization.\"}),`\n`,(0,n.jsxs)(e.ol,{children:[`\n`,(0,n.jsxs)(e.li,{children:[\"In Altertable, open \",(0,n.jsx)(e.strong,{children:\"Settings\"}),\" \\u2192 \",(0,n.jsx)(e.strong,{children:\"Integrations\"}),\", find the \",(0,n.jsx)(e.strong,{children:\"GitLab\"}),\" row, then choose \",(0,n.jsx)(e.strong,{children:\"Connect GitLab\"}),\" \\u2192 \",(0,n.jsx)(e.strong,{children:\"Self-hosted GitLab\"}),\".\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Enter your \",(0,n.jsx)(e.strong,{children:\"Instance URL\"}),\", then paste the \",(0,n.jsx)(e.strong,{children:\"Application ID\"}),\" and \",(0,n.jsx)(e.strong,{children:\"Secret\"}),\" from GitLab.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[\"Choose \",(0,n.jsx)(e.strong,{children:\"Connect\"}),\" to start the OAuth authorization flow.\"]}),`\n`,(0,n.jsx)(e.li,{children:\"Approve the authorization request on your GitLab instance when prompted.\"}),`\n`,(0,n.jsx)(e.li,{children:\"Altertable confirms the connection once authorization succeeds.\"}),`\n`]}),`\n`]}),(0,n.jsxs)(o,{sectionId:\"troubleshooting\",sectionTitle:\"Troubleshooting\",anchors:\"\",ancestors:\"\",index:\"4\",children:[(0,n.jsx)(e.h2,{id:\"troubleshooting\",children:\"Troubleshooting\"}),`\n`,(0,n.jsxs)(e.ul,{children:[`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"404 after clicking Connect:\"}),\" double-check the \",(0,n.jsx)(e.strong,{children:\"Instance URL\"}),\" for typos, and \\u2014 unless a reverse proxy serves GitLab under a subpath \\u2014 enter the plain origin (for example \",(0,n.jsx)(e.code,{children:\"https://gitlab.example.com\"}),\"), not a full page URL such as \",(0,n.jsx)(e.code,{children:\"https://gitlab.example.com/dashboard/projects\"}),\".\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Redirect URI mismatch:\"}),\" the URI registered in GitLab must match the one Altertable provides exactly, including scheme and trailing path.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Authorization fails:\"}),\" confirm the application scopes include \",(0,n.jsx)(e.code,{children:\"read_api\"}),\", \",(0,n.jsx)(e.code,{children:\"read_user\"}),\", and \",(0,n.jsx)(e.code,{children:\"read_repository\"}),\", and that the instance is reachable from Altertable.\"]}),`\n`,(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:\"Instance not reachable:\"}),\" verify the instance URL and that any firewall or network policy allows access from Altertable.\"]}),`\n`]})]})]})}function p(t={}){let{wrapper:e}=t.components||{};return e?(0,n.jsx)(e,{...t,children:(0,n.jsx)(h,{...t})}):h(t)}function d(t,e){throw new Error(\"Expected \"+(e?\"component\":\"object\")+\" `\"+t+\"` to be defined: you likely forgot to import, pass, or provide it.\")}return w(G);})();\n;return Component;"},"_id":"docs/agents/knowledge/integrations/gitlab-self-hosted.mdx","_raw":{"sourceFilePath":"docs/agents/knowledge/integrations/gitlab-self-hosted.mdx","sourceFileName":"gitlab-self-hosted.mdx","sourceFileDir":"docs/agents/knowledge/integrations","contentType":"mdx","flattenedPath":"docs/agents/knowledge/integrations/gitlab-self-hosted"},"type":"Docs","path":"/agents/knowledge/integrations/gitlab-self-hosted","level":4,"parent":"agents/knowledge/integrations"}