Giter VIP home page Giter VIP logo

homemade_screenshotter's Introduction

Homemade Screenshotter

Create and publish self-hosted screenshots

Installation

The screenshotter consists of 3 parts:

  • Client part (branch master)
  • Uploader part (branch uploader)
  • Static content part (branch server)

So, the main idea of using this tool is the following:

  1. You copy text or image in the clipboard (Ctrl+C)
  2. You open the Client app and press "Upload" button
  3. The Client app sends the content to Uploader app, running on your server. The Uploader app puts uploaded file into some folder, configured as nginx-served site, and returns you URL.
  4. When you open the URL, nginx serves it. All assets for text content is defined by Server app part. So, your content is intended to be downloaded as fast as possible by nginx, no ads or any other dynamic bullshit is used there.

Client part

  • install GoTK3 on your computer, here are instructions
  • clone this repo - go get -d github.com/zevst/homemade_screenshotter
  • open repo folder - cd $GOPATH/src/github.com/zevst/homemade_screenshotter
  • open Terminal and run cp .env.dist .env. Then, fill actual values in .env file - for example
UPLOAD_URL=https://screenshots.uploaded.here:3333/upload
ACCESS_KEY=verY_long_secret
  • open Terminal and run ./build.sh
  • add application icon to Favorites (for Ubuntu - ./ubuntu_add_desktop_app.sh)

Uploader part

  • Open your server's terminal, cd to the folder you want to use for Uploader
  • Clone the repo and run git checkout uploader
  • Then make env file - cp .env.dist .env
  • Edit .env with actual settings, for example
IMAGE_PATH=/some/folder/homemade_screenshotter_server/i
STATIC_SERVER_PATH=https://screenshots.served.here.by.nginx/i/
ACCESS_KEY=verY_long_secret
LISTEN_ADDR=0.0.0.0:3333

Using the same key in ACCESS_KEY with Client here is a must. The port should be any free. The STATIC_SERVER_PATH is an URL prefix for your uploaded content, it should be served by nginx, as mentioned above.

Server part

  • Open your server's terminal, cd to the folder you want to use for Server
  • Clone the repo and run git checkout server
  • Just make this folder served by nginx under the host name, set in STATIC_SERVER_PATH for the Uploader app part. So, when your uploader returned you an URL of type https://screenshots.served.here.by.nginx/i/smth.html, it's expected from nginx to seek for "smth.html" in "i" subfolder of this repo, branch Server. For example:
server { 
	listen 80;
	server_name screenshots.served.here.by.nginx;
	root /some/folder/homemade_screenshotter_server;
	index index.html;

	location / {
		try_files $uri /index.html$is_args$args;
	}
}

The root of our site is a parent folder of IMAGE_PATH, used in Uploader app, so the URL, returned by Uploader will be hosted by nginx and point exactly to the uploaded file "smth.html" in "i" subfolder.

Usage

  • Copy image or text to clipboard
  • Open app and press "Upload"
  • Client app replaces copied content with the URL to it after uploading. You can share that URL as you wish, it's permanent.

homemade_screenshotter's People

Contributors

mszuyev avatar

Watchers

 avatar

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.