Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ menta-account.txt
ethicalmetrics/.env

/node_modules
PLAN.md
PLAN.md
PLAN-TAGS.md
58 changes: 57 additions & 1 deletion internal/http/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,51 @@ func GitHubWikiProxyHandler(c *gin.Context) {
c.JSON(http.StatusNotFound, gin.H{"error": "wiki page not found"})
}

func GitLabWikiProxyHandler(c *gin.Context) {
owner := c.Param("owner")
repo := c.Param("repo")

projectID := url.PathEscape(owner + "/" + repo)
apiURL := fmt.Sprintf("https://gitlab.com/api/v4/projects/%s/wikis", projectID)
if c.Query("with_content") == "1" {
apiURL += "?with_content=1"
}

req, err := http.NewRequest("GET", apiURL, nil)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "proxy error"})
return
}
if token := os.Getenv("GITLAB_TOKEN"); token != "" {
req.Header.Set("PRIVATE-TOKEN", token)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", "gitGost/1.0")

client := &http.Client{Timeout: 15 * time.Second}
resp, err := client.Do(req)
if err != nil {
utils.Log("GitLab wiki proxy error: %v", err)
c.JSON(http.StatusBadGateway, gin.H{"error": "gitlab unreachable"})
return
}
defer resp.Body.Close()

if resp.StatusCode != 200 {
// Wiki no accesible (proyecto privado o deshabilitada): normalizar a 200
// con lista vacía para que el frontend muestre el estado sin errores de red.
c.JSON(http.StatusOK, []gin.H{})
return
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

body, err := io.ReadAll(resp.Body)
if err != nil {
c.JSON(http.StatusBadGateway, gin.H{"error": "failed to read response"})
return
}
c.Data(http.StatusOK, resp.Header.Get("Content-Type"), body)
}

func CreateAnonymousCommentHandler(c *gin.Context) {
var req anonymousCommentRequest
if err := c.ShouldBindJSON(&req); err != nil {
Expand Down Expand Up @@ -2927,6 +2972,11 @@ func CodebergProxyHandler(c *gin.Context) {

client := &http.Client{Timeout: 45 * time.Second}
resp, err := client.Do(req)
if err != nil {
// Codeberg sufre timeouts puntuales: reintentar una vez antes de devolver 502.
time.Sleep(500 * time.Millisecond)
resp, err = client.Do(req)
}
if err != nil {
utils.Log("Codeberg proxy error: %v", err)
c.AbortWithStatusJSON(http.StatusBadGateway, gin.H{"error": "failed to reach Codeberg"})
Expand Down Expand Up @@ -2960,6 +3010,12 @@ func SearchHandler(c *gin.Context) {

results := []gin.H{}

// Support GitHub-style `topic:<name>` queries: use the topic for every provider
// so GitLab/Codeberg don't receive the literal "topic:" prefix.
if topicParam == "" && strings.HasPrefix(query, "topic:") {
topicParam = strings.TrimPrefix(query, "topic:")
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

ghQuery := query
glQuery := query
cbQuery := query
Expand Down Expand Up @@ -3057,7 +3113,7 @@ func searchCodeberg(query, topic string) []gin.H {
results := []gin.H{}

q := query
if q == "" && topic != "" {
if topic != "" {
q = topic
}

Expand Down
1 change: 1 addition & 0 deletions internal/http/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func SetupRouter(cfg *config.Config) *gin.Engine {
api.GET("/gh-discussions/:owner/:repo", GitHubDiscussionsProxyHandler)
api.GET("/gh-discussion/:owner/:repo/:number", GitHubDiscussionDetailProxyHandler)
api.GET("/gh-wiki/:owner/:repo/:page", GitHubWikiProxyHandler)
api.GET("/gl-wiki/:owner/:repo", GitLabWikiProxyHandler)
}

r.GET("/appeal", AppealStartHandler)
Expand Down
8 changes: 8 additions & 0 deletions web/assets/MaterialIconTheme/legal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"source": "https://github.com/material-extensions/vscode-material-icon-theme",
"path": "icons",
"branch": "main",
"license": "MIT",
"last_sync": "1785960368",
"commit": "146ded17af5d4a77aa416fd86699aac50fba900f"
}
Comment thread
livrasand marked this conversation as resolved.
Resolved
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--3d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--abap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--abc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--ada.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--adonis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--advpl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--agent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--amplify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--android.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--angular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--antlr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--apollo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--arduino.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/assets/MaterialIconTheme/material-icon-theme--astro.svg
Loading
Loading