df2

command module
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

df2

Go

df2 is a terminal tool for managing plus optimising the files and database of defacto2.net. It is broken down into multiple parts.

The tool to optimise and manage defacto2.net
Copyright © 2020-22 Ben Garrett
https://github.com/Defacto2/df2

Usage:
  df2 [flags]
  df2 [command]

Admin:
  approve     Approve the records that are ready to go live.
  fix         Fixes database entries and records.
  new         Manage files marked as waiting to go live (default).
  output      Generators for JSON, HTML, SQL and sitemap documents.
  proof       Manage records tagged as #releaseproof.

Drive:
  clean       Discover or clean orphan files.
  shrink      Reduces the space used in directories.

Remote:
  apis        Batch data synchronization with remote APIs.
  demozoo     Interact with Demozoo submissions.
  lookup      Lookup the file URL of a record's ID or UUID.
  test        Test various features of the website or database that cannot be fixed with automation.

Additional Commands:
  config      Configure the settings for this tool.
  help        Help about any command

Flags:
      --ascii     suppress all ANSI color feedback
  -h, --help      help for df2
      --quiet     suppress all feedback except for errors
  -v, --version   version and information for this program

Use "df2 [command] --help" for more information about a command.

Install

df2 is built on Go and is packaged for Debian Linux.

wget https://github.com/Defacto2/df2/releases/latest/download/df2.deb
dpkg -i df2.deb # also works for updating
df2 --version
Dependencies

The df2 fix text command requires the installation of AnsiLove/C in the system PATH.

WebP support image conversion needs libwebp. PNG image compression relies on pngquant. Image conversion needs both imagemagick and netpbm.

Ubuntu installation
sudo apt install -y ansilove imagemagick netpbm pngquant webp
# optional file archivers
sudo apt install -y arj lhasa unrar unzip

Configuration

To view and test the database and directory configurations.

df2 config info

To change the configuration.

df2 config edit

Docker container

The Docker container runs on a Go container built in Debian Linux. The main purpose is unit testing and compiling of the Go source code in a Linux environment.

# change directory to the local repository
cd df2
# synchronize any remote repository tags
git pull 
# build the current directory as an image tagged as 'df2'
docker build --tag df2 . 
# run the image tagged as 'df2' with the container name 'df2-test'
docker run -it --name df2-test df2

Source code and building

GitHub Actions combined with GoReleaser handles the building process when new release tags are created.

All changes should be tested with the golangci-lint Go linters aggregator.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
archive
Package archive handles collections of files that are either packaged together or compressed.
Package archive handles collections of files that are either packaged together or compressed.
assets
Package assets handles the site resources such as file downloads, thumbnails and backups.
Package assets handles the site resources such as file downloads, thumbnails and backups.
cmd
Package cmd handles the commandline user interface and interactions.
Package cmd handles the commandline user interface and interactions.
config
Package config saves and fetches settings used by the df2 tool.
Package config saves and fetches settings used by the df2 tool.
database
Package database interacts with the MySQL datastore of Defacto2.
Package database interacts with the MySQL datastore of Defacto2.
demozoo
Package demozoo interacts with the demozoo.org API for data scraping and file downloads.
Package demozoo interacts with the demozoo.org API for data scraping and file downloads.
directories
Package directories interacts with the filepaths that hold files and assets.
Package directories interacts with the filepaths that hold files and assets.
download
Package download handles the fetching of remote files.
Package download handles the fetching of remote files.
groups
Package groups deals with group names and their initialisms.
Package groups deals with group names and their initialisms.
images
Package images generate thumbnails and converts between image formats.
Package images generate thumbnails and converts between image formats.
logs
Package logs handles errors and user feedback.
Package logs handles errors and user feedback.
people
Package people deals with people, person names, aliases and their roles.
Package people deals with people, person names, aliases and their roles.
prompt
Package prompt are functions that parse stardard input loops.
Package prompt are functions that parse stardard input loops.
proof
Package proof handles files that have the section tagged as releaseproof.
Package proof handles files that have the section tagged as releaseproof.
recent
Package recent is a work in progress JSON generator to display the most recent files on the file.
Package recent is a work in progress JSON generator to display the most recent files on the file.
sitemap
Package sitemap generates an list of pages of the website.
Package sitemap generates an list of pages of the website.
str
Package str are print to terminal display and colour functions.
Package str are print to terminal display and colour functions.
text
Package text generates images from text files using the Ansilove/C program.
Package text generates images from text files using the Ansilove/C program.
zipcontent
Package zipcontent scans archives for file and directory content.
Package zipcontent scans archives for file and directory content.

Jump to

Keyboard shortcuts

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