Compare commits
11 Commits
v1.1.0-alp
...
50ae422de8
| Author | SHA1 | Date | |
|---|---|---|---|
| 50ae422de8 | |||
| 8467ed555e | |||
| 01ddc76f7e | |||
| ffb3565ff5 | |||
| 6d700ef6dd | |||
| b8acb6da4c | |||
| 6b4127f0ef | |||
| 5ceade81db | |||
| 8a456d2cde | |||
| 8841230653 | |||
| 4d0a7deaf2 |
@@ -1,21 +0,0 @@
|
|||||||
name: renovate
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- staging
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
renovate:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: git.fossy.my.id/renovate-clanker/renovate:latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- run: renovate
|
|
||||||
env:
|
|
||||||
RENOVATE_CONFIG_FILE: ${{ gitea.workspace }}/renovate-config.js
|
|
||||||
LOG_LEVEL: "debug"
|
|
||||||
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
|
||||||
GITHUB_COM_TOKEN: ${{ secrets.COM_TOKEN }}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
"endpoint": "https://git.fossy.my.id/api/v1",
|
|
||||||
"gitAuthor": "Renovate-Clanker <renovate-bot@fossy.my.id>",
|
|
||||||
"platform": "gitea",
|
|
||||||
"onboardingConfigFileName": "renovate.json",
|
|
||||||
"autodiscover": true,
|
|
||||||
"optimizeForDisabled": true,
|
|
||||||
};
|
|
||||||
@@ -2,9 +2,11 @@ package server
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
"time"
|
||||||
"tunnel_pls/internal/config"
|
"tunnel_pls/internal/config"
|
||||||
"tunnel_pls/internal/grpc/client"
|
"tunnel_pls/internal/grpc/client"
|
||||||
"tunnel_pls/session"
|
"tunnel_pls/session"
|
||||||
@@ -64,30 +66,32 @@ func (s *Server) Start() {
|
|||||||
|
|
||||||
func (s *Server) handleConnection(conn net.Conn) {
|
func (s *Server) handleConnection(conn net.Conn) {
|
||||||
sshConn, chans, forwardingReqs, err := ssh.NewServerConn(conn, s.config)
|
sshConn, chans, forwardingReqs, err := ssh.NewServerConn(conn, s.config)
|
||||||
defer func(sshConn *ssh.ServerConn) {
|
|
||||||
err = sshConn.Close()
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("failed to close SSH server: %v", err)
|
|
||||||
}
|
|
||||||
}(sshConn)
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to establish SSH connection: %v", err)
|
log.Printf("failed to establish SSH connection: %v", err)
|
||||||
err := conn.Close()
|
err = conn.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to close SSH connection: %v", err)
|
log.Printf("failed to close SSH connection: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx := context.Background()
|
|
||||||
log.Println("SSH connection established:", sshConn.User())
|
defer func(sshConn *ssh.ServerConn) {
|
||||||
|
err = sshConn.Close()
|
||||||
|
if err != nil && !errors.Is(err, net.ErrClosed) {
|
||||||
|
log.Printf("failed to close SSH server: %v", err)
|
||||||
|
}
|
||||||
|
}(sshConn)
|
||||||
|
|
||||||
user := "UNAUTHORIZED"
|
user := "UNAUTHORIZED"
|
||||||
if s.grpcClient != nil {
|
if s.grpcClient != nil {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
|
||||||
_, u, _ := s.grpcClient.AuthorizeConn(ctx, sshConn.User())
|
_, u, _ := s.grpcClient.AuthorizeConn(ctx, sshConn.User())
|
||||||
user = u
|
user = u
|
||||||
|
cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Println("SSH connection established:", sshConn.User())
|
||||||
sshSession := session.New(sshConn, forwardingReqs, chans, s.sessionRegistry, user)
|
sshSession := session.New(sshConn, forwardingReqs, chans, s.sessionRegistry, user)
|
||||||
err = sshSession.Start()
|
err = sshSession.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -672,22 +672,32 @@ func (m *model) View() string {
|
|||||||
MarginBottom(boxMargin).
|
MarginBottom(boxMargin).
|
||||||
Width(boxMaxWidth)
|
Width(boxMaxWidth)
|
||||||
|
|
||||||
urlDisplay := m.getTunnelURL()
|
authenticatedUser := m.interaction.lifecycle.GetUser()
|
||||||
if shouldUseCompactLayout(m.width, 80) && len(urlDisplay) > m.width-20 {
|
|
||||||
maxLen := m.width - 25
|
userInfoStyle := lipgloss.NewStyle().
|
||||||
if maxLen > 10 {
|
Foreground(lipgloss.Color("#FAFAFA")).
|
||||||
urlDisplay = truncateString(urlDisplay, maxLen)
|
Bold(true)
|
||||||
}
|
|
||||||
}
|
sectionHeaderStyle := lipgloss.NewStyle().
|
||||||
|
Foreground(lipgloss.Color("#888888")).
|
||||||
|
Bold(true)
|
||||||
|
|
||||||
|
addressStyle := lipgloss.NewStyle().
|
||||||
|
Foreground(lipgloss.Color("#FAFAFA"))
|
||||||
|
|
||||||
var infoContent string
|
var infoContent string
|
||||||
if shouldUseCompactLayout(m.width, 70) {
|
if shouldUseCompactLayout(m.width, 70) {
|
||||||
infoContent = fmt.Sprintf("🌐 %s", urlBoxStyle.Render(urlDisplay))
|
infoContent = fmt.Sprintf("👤 %s\n\n%s\n%s",
|
||||||
} else if isCompact {
|
userInfoStyle.Render(authenticatedUser),
|
||||||
infoContent = fmt.Sprintf("🌐 Forwarding to:\n\n %s", urlBoxStyle.Render(urlDisplay))
|
sectionHeaderStyle.Render("🌐 FORWARDING ADDRESS:"),
|
||||||
|
addressStyle.Render(fmt.Sprintf(" %s", urlBoxStyle.Render(m.getTunnelURL()))))
|
||||||
} else {
|
} else {
|
||||||
infoContent = fmt.Sprintf("🌐 F O R W A R D I N G T O:\n\n %s", urlBoxStyle.Render(urlDisplay))
|
infoContent = fmt.Sprintf("👤 Authenticated as: %s\n\n%s\n %s",
|
||||||
|
userInfoStyle.Render(authenticatedUser),
|
||||||
|
sectionHeaderStyle.Render("🌐 FORWARDING ADDRESS:"),
|
||||||
|
addressStyle.Render(urlBoxStyle.Render(m.getTunnelURL())))
|
||||||
}
|
}
|
||||||
|
|
||||||
b.WriteString(responsiveInfoBox.Render(infoContent))
|
b.WriteString(responsiveInfoBox.Render(infoContent))
|
||||||
b.WriteString("\n")
|
b.WriteString("\n")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user