Image provider using pluggable backends and indexes.
Tim Schuster ac1f5dae57
Merge branch 'release/0.1.4'
1 year ago
backend Various bugfixes on common functions/types 1 year ago
cmd added resourcehandler in res.go 1 year ago
config Using seperate Pepper instead of HMAC Key, enforcing 32 character size 1 year ago
crypto Improved documentation 1 year ago
logger Changelog for Commit 1 year ago
papers Reworked crypto backend 1 year ago
snowflakes Updated IDs 1 year ago
utils Moved HMAC to crypto package and added paper on the hmac function 1 year ago
vendor Amended vendor.json 1 year ago
.drone.yml No longer need skip_verify in drone.yml 1 year ago
.gitignore Removed Makepass binary from repo, added to gitignore and added build to travis 1 year ago
.travis.yml Updated .travis.yml for gorice 1 year ago
CHANGELOG.md Added changelog 1 year ago
LICENSE Added License and Amended README 1 year ago
README.md Added S3 backend to README 1 year ago

README.md

CatGi - Selfhosted Image and Code Dump

Travis Build Status

CatGi is a pluggable, extensible and selfhosted provider of images, text and more.

The App does not rely on any configuration and operates as an in-memory testable filestore until a config is specified.

At the moment files can be stored for up to 1 month and no longer. Permanent storage is a goal for a future release.

Usage

CatGi requires govendor to be build.

# Clone the repository
git clone gogs@git.timschuster.info:rls.moe/catgi 
# Go into Repository
cd catgi

# Optional:
# Install missing dependencies
govendor fetch +missing

# Optional:
# Install full vendor directory
govendor fetch +all

# Otherwise
# Install missing dependencies globally
go get

# Build makepass
cd makepass
go build

# Build catgi
cd ..
cd catgi
go build

makepass

makepass is a simple utility to generate user configuration.

It asks for user and password (no confirmation) on the CLI and then prints a JSON string that can be copy-pasted into the configuration

catgi

catgi [config-file]

Starts the webserver and configured backends. If no config is specified, catgi starts in default configuration.

The default configuration stores everything in memory and leaves no permanent traces on the system (usually) and requires no login.

It is recommended to setup authentication.

Configuration

Here is an example config file:

{
    "backend": {
        "driver": "fcache",
        "params": {
            "driver": "buntdb",
            "params": {
                "file": ":memory:"
            },
            "cache_size": 20,
            "async_upload": false
        }
    },
    "users": [
    ],
    "http": {
        "port": 8080,
        "listen": "[::1]"
    },
    "loglevel": "debug"
}

This configuration will setup CatGi as follows:

  • Set highest logging level : loglevel
  • Listen on [::1]:8080 for HTTP traffic : http.port and http.listen
  • Empty user list means no login required : users
  • Use fcache for the backend : backend.driver
    • fcache will use buntdb as backend : backend.params.driver
    • fcache will cache 20 entries : backend.params.cache_size
    • fcache will wait for upload to complete : backend.params.async_upload
      • buntdb will use an in-memory db

Other backends might required differing configuration.

Available backends

Name Driver Name Notes
B2Backblaze b2 No automatic GC and rather slow
BuntDB buntdb Automatic GC and fast
FCache fcache Caching Backend, not standalone
LocalFS localfs Stores in Filesystem, no auto GC
AWS S3 s3 Like B2 but for AWS

License

CatGi is licensed under MPL 2.0

Dependencies are under their respective license and copyright.

Contribute

Pull requests should be well formatted.

HTML should be kept to minimal filesize, CSS or JS should be avoided.

Pull Request will be accepted from any of the code mirrors.

Code Repository

Origin

Github

Future

I regard CatGi as mostly feature complete for myself missing only two things:

* Public Gallery
* Automatic Garbage Collection (Manual GC works now)
* Permanent Files
* Named Publishing (eg `catgi.rls.moe/n/helloworld.txt`)

I have a few other features planned to, like S3 and GCS support, federating across servers and much more.

Pull Requests for additional features are welcome.