blinky

package module
v0.0.0-...-545993c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

README

Blinky

Simple, all in one Pacman repository hosting server software.

GitHub GitHub go.mod Go version Go Report Card Blinky CI/CD

Document Conventions

This Git repository contains both the Blinky server and the blinky CLI tool. In order to keep track of which one is being talked about, the server will be referred to as either Blinky, the server, or blinkyd, depending on the context.

Likewise, the CLI tool will be referred to as the CLI, or as simply blinky.

Installation

Docker (Server only)

Docker Compose Example:

version: "2.4"
services:
  blinky:
    image: ghcr.io/brenekh/blinky:master
    environment:
      - BLINKY_REPO_PATH=/repos/repo_name
    volumes:
      - ./data:/data:rw
      - ./repos:/repos:rw
    ports:
      - 9000:9000
    restart: unless-stopped
Source

To install the Blinky components from source, the Go compiler needs to be installed.

Server

go install github.com/BrenekH/blinky/cmd/blinkyd@latest

CLI

go install github.com/BrenekH/blinky/cmd/blinky@latest

Package Managers

Currently, Blinky is not available in any package managers.

Usage

The following usage instructions are just the basics of how to use Blinky. For a full run down, please visit the Blinky wiki.

Server

blinkyd supports 3 methods of configuration, command-line arguments, environment variables, and a TOML config file located at either /etc/blinky/config.toml or $XDG_CONFIG_HOME/blinky/config.toml. The names are the same across each method, but with differing capitalization and word separators. This document will only use command-line args, but a full table can be found in the wiki.

Setting up repository paths

Blinky uses the same syntax as the Linux PATH variable to specify where the repository's files should be stored. The required folders will be created if they do not exist. The last element of the path is used as the name of the repo. For example, the following command will create 3 repos: repo1, repo2, and repo3.

blinkyd --repo-path "/mnt/storage1/repo1:/mnt/storage1/repo2:/opt/repo3"

Change the port

Using --http-port the port Blinky uses for the HTTP server can be changed.

Protecting the API

A username and password can be set so that only those who know the username and password can manage packages.

The username is set by using --api-uname and the password is set with --api-passwd.

Getting help from the terminal

Using blinkyd --help will output a usage text and exit the application.

CLI

blinky has 4 basic commands: login, logout, upload, and remove.

login is used to save the login credentials for a server.

logout removes the saved credentials for a server.

upload uploads new/updated packages to a repository hosted on a server.

remove deletes packages from a repository on a server.

Examples:

$ blinky login --default https://blinky.example.com
Username: user
Password:

$ blinky upload custom_repo my_package.pkg.tar.zst
...

$ blinky remove custom_repo my_package
...

$ blinky logout https://blinky.example.com
...

More detailed usage instructions can be found by running blinky --help.

HTTPS

Because Blinky uses the HTTP Basic Authentication standard, it is recommended to use an HTTPS certificate with a reverse proxy to encrypt the conversation between Blinky and clients.

Passwords in Shell History

While blinky does support providing a password as a CLI flag, it is not a recommended method to do so.

Instead, the interactive prompt should be used for entering passwords where possible.

Known Issues

Only x86_64 is supported

Blinky is built with only the x86_64 architecture in mind, since that is all that Arch Linux officially supports. If you require support for other architectures, please reach out either in the issues or discussions and we can figure out how to make it work.

Frequently Asked Questions

What is wrong with repo-add?

repo-add requires direct access to the directory that is being used to host the database and all of the package files. While this is fine for a local repository, building a hosted version that can be updated from anywhere starts to become more complicated than using an API. Instead of opening SSH, setting up Samba, or configuring a VPN, one can use the HTTP setup already required for both managing and consuming the repository.

Why is it called Blinky?

According to Pac-Man lore, each of the four ghosts from the original game has a unique name. The American versions of these names are Inky, Blinky, Pinky, and Clyde and because servers often have blinky lights, Blinky was chosen as the name.

License

Blinky is licensed under the GNU General Public License version 3, a copy of which can be found in the LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	CreateMiddleware(http.Handler) http.Handler
}

The Authenticator interface describes how a given API expects a struct that provides authentication capabilities to behave.

type PackageNameToFileProvider

type PackageNameToFileProvider interface {
	PackageFile(packageName string) (filePath string, err error)
	StorePackageFile(packageName, filePath string) (err error)
	DeletePackageFileEntry(packageName string) (err error)
}

The PackageNameToFileProvider interface describes what methods a struct needs to implement in order to be used as a way for Blinky to associate a package to the last file that was uploaded for it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL