Git Integration #5

Open
opened 2025-10-27 15:10:46 +00:00 by vxfemboy · 1 comment
vxfemboy commented 2025-10-27 15:10:46 +00:00 (Migrated from github.com)

Git Integration

i want to buildin rgit for /projects (but with my own frontend and auto pushing to github, gitea, gogs, githlab, etc so multiple other public git instances)

Approach: Fork/vendor rgit or use as library

Custom Frontend:

  • ASCII-themed git interface
  • File browser with syntax highlighting
  • Commit history visualization
  • README rendering with markdown

Multi-Instance Git Sync

Architecture:

// In src/mods/git_sync.rs
pub struct GitSyncManager {
    local_repo: Repository,
    remotes: Vec,
}

pub struct GitRemote {
    name: String,
    url: String,
    auth: AuthMethod, // SSH key, token, etc.
    provider: GitProvider, // GitHub, Gitea, GitLab, etc.
}

impl GitSyncManager {
    pub async fn sync_all(&self) -> Result;
    pub async fn push_to_remote(&self, remote: &str) -> Result;
}

Features:

  • Webhook receiver for auto-sync on push
  • Background job for periodic syncing
  • Conflict resolution strategy
  • Status dashboard showing sync state

Repository Configuration

[git_sync]
enabled = true
local_repo = "/path/to/repos"
sync_interval_minutes = 30

[[git_sync.remotes]]
name = "github"
url = "git@github.com:vxfemboy/project.git"
provider = "github"
auth_type = "ssh_key"
ssh_key_path = "/path/to/key"

[[git_sync.remotes]]
name = "gitea"
url = "https://gitea.io/vxfemboy/project.git"
provider = "gitea"
auth_type = "token"
token_env = "GITEA_TOKEN"

[[git_sync.remotes]]
name = "gitlab"
url = "git@gitlab.com:vxfemboy/project.git"
provider = "gitlab"
auth_type = "ssh_key"
# Git Integration i want to buildin [rgit][1] for /projects (but with my own frontend and auto pushing to github, gitea, gogs, githlab, etc so multiple other public git instances) **Approach**: Fork/vendor [rgit][1] or use as library [1]: https://github.com/w4/rgit **Custom Frontend**: - ASCII-themed git interface - File browser with syntax highlighting - Commit history visualization - README rendering with markdown ## Multi-Instance Git Sync **Architecture**: ```rust // In src/mods/git_sync.rs pub struct GitSyncManager { local_repo: Repository, remotes: Vec, } pub struct GitRemote { name: String, url: String, auth: AuthMethod, // SSH key, token, etc. provider: GitProvider, // GitHub, Gitea, GitLab, etc. } impl GitSyncManager { pub async fn sync_all(&self) -> Result; pub async fn push_to_remote(&self, remote: &str) -> Result; } ``` **Features**: - Webhook receiver for auto-sync on push - Background job for periodic syncing - Conflict resolution strategy - Status dashboard showing sync state ## Repository Configuration ```toml [git_sync] enabled = true local_repo = "/path/to/repos" sync_interval_minutes = 30 [[git_sync.remotes]] name = "github" url = "git@github.com:vxfemboy/project.git" provider = "github" auth_type = "ssh_key" ssh_key_path = "/path/to/key" [[git_sync.remotes]] name = "gitea" url = "https://gitea.io/vxfemboy/project.git" provider = "gitea" auth_type = "token" token_env = "GITEA_TOKEN" [[git_sync.remotes]] name = "gitlab" url = "git@gitlab.com:vxfemboy/project.git" provider = "gitlab" auth_type = "ssh_key" ```
vxfemboy commented 2025-12-31 13:27:15 +00:00 (Migrated from github.com)
rgit is now https://codeberg.org/kallisti5/gitore
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
vxfemboy/zoa.sh#5
No description provided.