ForgejoGitLFS Team Setup & Clone Repo Tutorial

Step 1 — Setup Forgejo on WineJS

We use an automated script winejs_install_forgejogitlfs_opengraph.sh to provision Forgejo on the WineJS platform with Git LFS support and full integration:

# winejs_install_forgejogitlfs_opengraph.sh
# - Verifies WineJS platform at /opt/winejs
# - Creates docker network (winejs-net)
# - Downloads & configures Forgejo with Git LFS support
# - Sets up LFS path mapping server for large file handling
# - Creates shared volumes system (backups, imports, ci-cd)
# - Sets up auto-heal monitor and PM2 persistence
# - Injects OpenGraph meta tags for GitHub-style social sharing
# - Adds Repository Info button with JSON metadata extraction
# - Adds VsCodeServer fast-repo button
# - Configures webhook endpoints for automation
# ✅ Makes Forgejo accessible at https://your-domain.com/forgejo/

Git-LFS allows you to upload and store files more than 50mb, with extra filetype-specific monitoring

After running the installer, Forgejo is ready:

# Forgejo installation takes ~2-3 minutes to complete 
# Open https://your-domain.com/forgejo/ in the browser

The first time you start the app, you need to:

  1. The installer creates an admin username & password automatically (winejs-admin)
  2. Log in to the web UI with provided credentials
  3. Create your first user profile (e.g., your-username)
  4. Create your first repository (e.g., your-reponame)
  5. Generate your first personal access token in SettingsApplicationsGenerate New Token or via (e.g., winejs-cli)
  6. Set token permissions to [repository read/write] and copy the token (e.g., 1c9ca278c04f1713f3ff29ac03f81179a11acf85)

Step 2 — Clone Repo Automaticly - Script Generator

Auth token is required for private repos to clone.

VSCode
Visual Studio

Step 3 — Adding Collaborators

  1. New team members create their own Forgejo accounts at https://wine.example.com/forgejo
  2. As project manager, go to your repo → Settings → Collaboration
  3. Search for their username and add them as collaborators with Write access
  4. Each collaborator generates their own personal access token for Git operations

Step 4 — Setup Team Access

Forgejo supports multiple users on a repo without sharing accounts:

  1. Each team member creates their own Forgejo account.
  2. The repo owner/admin adds them as a collaborator on the your-reponame repo:
    • Go to repo → Settings → Collaborators & Teams → Add Collaborator
    • Set permission level:
      • Read → pull only
      • Write → pull & push
  3. Each user generates their own personal access token.
  4. Each dev clones using their own token:
    git clone https://[email protected]/forgejo/USERNAME/REPO.git

Pros:

Best practice for a game dev team:

Step 5 — Setup VSCode and Visual Studio 2022

Your project enables you to utilize two powerful text editors:

Both editors can be used simultaneously for writing code. However, the game compilation happens in Visual Studio 2022 or with 'cmake' on VSCode.

6 — Enable Git LFS on Developer Machines

To manage large binary files in video game projects (like UE3 assets), Git LFS should be initialized on every developer machine:

VSCode
Visual Studio

✅ This ensures all large game assets (textures, models, sounds, binaries) are tracked efficiently with Git LFS, reducing repository size and improving collaboration.

Step 7 — Setting up Webhooks

Forgejo supports webhooks, which let your repository send real-time updates to external services (e.g., Discord, project management tools, or CI/CD pipelines). Configure them here:

https://wine.example.com/forgejo/username/repo/settings/hooks

🔔 Discord Webhooks

  1. Go to your Discord server → Server Settings → Integrations → Webhooks.
  2. Create a new webhook, copy the https://discord.com/api/webhooks/.../... URL.
  3. In Forgejo repo settings → Webhooks, add this Discord webhook URL.
  4. Select which events to trigger (push, pull request, release, etc.).

Now every commit, PR, or release will post directly to your Discord channel.

📋 Team Management Webhooks

You can connect Forgejo to open-source or self-hosted tools by creating webhook endpoints. Each endpoint can process repository events (like pushes, pull requests, or issue updates) and update your project boards, chat systems, or other services.

✅ This keeps your workflow fully open-source and self-hosted, without relying on paid cloud services.

Custom Webhook Servers

🐍 Python Webhook Receiver Example

If you want to process Forgejo events yourself (e.g., trigger a build, auto-tag, or custom bot), here’s a simple Python Flask app to catch webhook payloads:


  from flask import Flask, request, jsonify

  app = Flask(__name__)

  @app.route("/webhook", methods=["POST"])
  def forgejo_webhook():
      event = request.headers.get("X-Gitea-Event")  # Forgejo is Gitea-compatible
      payload = request.json
      print(f"Received {event}: {payload}")
      
      # Example: push event
      if event == "push":
          commits = payload.get("commits", [])
          for commit in commits:
              print(f"New commit: {commit['message']} by {commit['author']['name']}")
      
      return jsonify({"status": "ok"})

  if __name__ == "__main__":
      app.run(host="0.0.0.0", port=5000)
  

⚙️ Posting Back to Discord with Python


  import requests

  discord_webhook = "https://discord.com/api/webhooks/XXXX/YYYY"

  def post_to_discord(message):
      data = {"content": message}
      response = requests.post(discord_webhook, json=data)
      print("Discord response:", response.status_code)

  # Example usage
  post_to_discord("New build completed! 🚀")
  

✅ With this, you can integrate Forgejo with both Discord for alerts and any custom project management system.

Step 8 — Enhancing Forgejo with Tampermonkey

To improve workflow efficiency, a custom Tampermonkey script was written for Firefox.

This script adds customizable, repository-specific navigation buttons to your Forgejo instance's header.

What does this script do?
Once installed, it injects useful icons (for quick access to project management tools, VM creation, documentation, etc.) directly into the Forgejo interface on a per-repository basis. This is ideal for teams that have specific automation or links tied to their projects.

Fully Customizable: The script is a starting point and can be easily modified to add, remove, or change the buttons and their links to fit your exact needs.

How to Install:

  1. Install Tampermonkey: First, you need the browser extension that can run user scripts.
    Download Tampermonkey for Firefox

  2. Click the link below to open the generator. Enter your desired links and labels, then click the button to create your custom script.
    Open the Forgejo Tampermonkey Script Generator
  3. Install the Script: Copy the generated script from the generator. Then, in your browser, click on Extensions → Tampermonkey → Create a new script... Replace the default content with your copied script and save it.
  4. Refresh Forgejo:
    Navigate to your Forgejo repository page and refresh. You should see your new navigation buttons in the header.
Step 1Setup Forgejo Step 2Clone Scripts Step 3Add Collaborators Step 4Team Access Step 5VSCode/VS Step 6Git LFS Step 7Webhooks Step 8Tampermonkey