Giter Club home page Giter Club logo

mini-asciinema-store's Introduction

mini-asciinema-store

Build Status Coverage Status

Small server for store asciinema recordings

Building from source

Install Go on your system and clone the repository:

git clone https://github.com/Gerifield/mini-asciinema-store.git
cd mini-asciinema-store
go build -o mini-asciinema-store src/cmd/server/server.go

The you have your binary there. Just run it! :)

If you don't want to build from source, just grab a binary form the release page.

Usage

  -authFile string
    	Authenticated tokens in a file (one token per line)
  -https
    	HTTPS enable
  -httpsCert string
    	HTTPS cert (default "server.crt")
  -httpsPrivateKey string
    	HTTPS private key (default "server.key")
  -listenAddr string
    	HTTP listening address (default ":8080")
  -serverBaseURL string
    	Base URL for the server (default "http://127.0.0.1:8080")
  -uploadBucket string
    	Folder or bucket URL to store the uploaded files (supports: file, mem, s3) (default "file:///uploads/")

For using the server just edit your asciinema config file (or create one): ~/.config/asciinema/config

Then add the following config:

[api]

; API server URL, default: https://asciinema.org
; If you run your own instance of asciinema-server then set its address here
; It can also be overriden by setting ASCIINEMA_API_URL environment variable
url = http://127.0.0.1:8080

(Change the URL to your base URL.)

If you'd like to use a folder to store the uploads, just create one then set the uploadBucket at the start for example:

mini-asciinema-store -uploadBucket="file://$(pwd)/uploads"

The server uses the https://gocloud.dev/howto/blob/ driver for the storage.

Authentication

You could use a simple text file with one token per line to allow only certain users to upload. Create a new file and put the client's install ID in that.

You could find the install ID by default here: ~/.config/asciinema/install-id

Example:

echo "<my install id>" > authFile.txt
go run src/cmd/server/server.go -uploadBucket="file://$(pwd)/uploads" -authFile authFile.txt

This will set the upload target to the uploads folder in this directory and set the authFile.txt.

Build and run in docker

It'll put the uploaded files in a /uploads folder in the root of the container.

For a simple build and demostration you could use the following commands to build and start the server on your localhost port 8080:

$ docker build -t mini-store .
$ docker run -p8080:8080 mini-store:latest

mini-asciinema-store's People

Contributors

gerifield avatar mathieu-aubin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jadia

mini-asciinema-store's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.