npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gogs-migrate

v2.1.0

Published

Migrate existing repositories on a Gogs instance.

Downloads

24

Readme

gogs-migrate npm version

Migrate existing repositories on a Gogs instance.

Overview

Gogs is a lightweight self-hosted Git service. There's a neat GitHub-like interface to show, the repositories, and I find it perfect to mirror public GitHub repositories on a home server, and have really private repositories (that don't even leave your home, unlike "private" cloudish solutions). It's also really lightweight, unlike GitLab, and can easily run with SQLite on tiny computers like a Raspberry PI!

There is a built-in way to migrate external repositories, with a mirror option so your local copy is always up-to-date. And the interesting thing is there's an API to automate this task.

gogs-migrate is a script to automatically migrate (and optionally mirror) all your repositories from different sources (currently only GitHub public repositories are supported), to your Gogs instance.

You need to configure your Gogs URL (--gogs), access token and UID (--gogs-token, and --gogs-uid). If those options are not passed via CLI, and a configuration file is given (--config), gogs-migrate will try to read them from the configuration file. Otherwise, it will prompt for the missing options.

Then, you can configure a source for the repositories to migrate. Currently, only GitHub is supported, with the --github-user option. It will find only the public repositories, and there's currently no way to configure credentials to access private repositories. You can migrate your forks with the --with-forks option, but by default gogs-migrate will ignore them.

On Gogs side, you can pass --mirror so the migrated repositories are flagged as mirrors (Gogs will update them periodically), and --private to make them private.

Installation

With npm

npm install -g gogs-migrate

Manually

Clone this repository, then in the directory:

npm install

You can now use bin/gogs-migrate (or put $PWD/bin in your PATH).

Usage

gogs-migrate [options]

Options

Name | Description ---- | ----------- -h, --help | Show help. -V, --version | Show version. -c, --config=<path> | Read options from given YAML configuration file. --gogs-prefix=<prefix> | Gogs URL prefix (like https://git.example.com). --gogs-token=<token> | Gogs access token (required, prompt otherwise). --gogs-uid=<uid> | Gogs UID (required, prompt otherwise). --github-prefix=<prefix> | GitHub API prefix (defaults to https://api.github.com). --github-user=<user> | GitHub username to stream repositories from. --github-token=<token> | GitHub user token to access private repositories. --mirror | Create mirror repositories. --private | Force private repositories (copy source visibility otherwise). --with-forks | Include forked repositories. --save | Save migrated repositories to configuration file to avoid downloading them again the next time.

Configuration

You can specify a YAML configuration file with the --config option. It can contain all the normal CLI long options, with the leading -- removed.

gogs: https://git.example.com
gogs-token: foo
gogs-uid: 42
github-user: bar
mirror: true

Here, gogs-pass is not specified, and if it's not given via CLI, so you will be prompted for your password (that's the recommended way).