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

@digitalist-open-cloud/backstage-plugin-harbor-backend

v0.4.2

Published

This plugin will show information about your docker images within Harbor.

Downloads

550

Readme

Backstage Harbor Backend plugin

This plugin will show information about your docker images within Harbor.

This is a fork, and no promises for backwards compatibility. But have been tested on Backstage 1.29.x.

Our goal is to contribute back, after we have done internal testing.

For the original code, please see the GitHub repo

Getting started

First install frontend

Enabling backend

New backend

yarn --cwd packages/backend add @digitalist-open-cloud/backstage-plugin-harbor-backend

Add to packages/backend/src/index.ts:

backend.add(import('@digitalist-open-cloud/backstage-plugin-harbor-backend'));

Now, jump to configuration step.

Old backend

Please note, this could be broken as it not tested with this fork.

yarn --cwd packages/backend add @digitalist-open-cloud/backstage-plugin-harbor-backend

Create a new file named packages/backend/src/plugins/harbor.ts, and add the following to it

import { createRouter } from '@digitalist-open-cloud/backstage-plugin-harbor-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin({
  logger,
  config,
}: PluginEnvironment): Promise<Router> {
  return await createRouter({ logger, config });
}

And finally, wire this into the overall backend router. Edit packages/backend/src/index.ts

import harbor from './plugins/harbor';
// ...
async function main() {
  // ...
  const harborEnv = useHotMemoize(module, () => createEnv('harbor'));
  apiRouter.use('/harbor', await harborusage(harborEnv));

Configuration

The plugin requires configuration in the Backstage app-config.yaml to connect to Harbor API.

harbor:
  # This is the traditional way of configuring the Harbor plugin.
  baseUrl: https://harbor.yourdomain.com
  username: ${HARBOR_USERNAME}
  password: ${HARBOR_PASSWORD}

  # This is the way to go if you need to connect to multiple Harbor instances. You can also combine those approaches.
  instances:
    - host: harbor2.yourdomain.com
      baseUrl: https://harbor2.yourdomain.com
      username: ${HARBOR_USERNAME}
      password: ${HARBOR_PASSWORD}

Adding annotations and values to your component file.

apiVersion: backstage.io/v1alpha1
kind: System
metadata:
  name: sample-system
  description: "A sample system"
  annotations:
    # This will use harbor.baseUrl
    goharbor.io/repository-slug: project/repository
    # OR
    # This will use harbor.instances[].baseUrl based on the matching host
    goharbor.io/repository-slug: harbor.yourdomain.com/project/repository
    # OR
    # This will fetch the first image from harbor.baseUrl and the second image from harbor.instances[].baseUrl
    goharbor.io/repository-slug: project/repository, harbor.yourdomain.com/project/repository

Contributing

Please contribute back to the original repo, and you are free to use any code from this repo to contribute back to the original repo without giving us credit.

History

This Backstage plugin was initially created by BESTSELLER and transferred to Container Registry. This fork was started because of an acute need.