Skip to content

A file viewer, written in Ruby using Sinatra, by that guy. It's intended for use with ShareX by those guys.

License

Notifications You must be signed in to change notification settings

Ociidii-Works/That-one-file-viewer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

That-one-file-viewer

A file viewer, written in Ruby using Sinatra, by that guy. It's intended for use with ShareX by those guys.

##Installing That One File Viewer ##Table of Contents

  1. Set aliases
  2. Download the required tools
    1. Windows
    2. Linux
  3. Configure nginx
  4. Configure Linux users
  5. clone the repo
  6. Install the requirements for the file viewer
  7. configure the file viewer
  8. Running
  9. FTP Server
  10. Autorun

##Set aliases

#Use 'apt-get' for ubuntu.
alias aptcmd='aptitude'
#replace with your own username
tuser=$USER
programs="nano sudo nginx dos2unix ruby-devel build-essential libiconv-devel libxml2-devel tmux curl git make"

##Download the required tools ###Windows Install Cygwin and the following packages:

  • Devel/git (Unless you have another git binary installed)
  • Editors/nano
  • Libs/libiconv
  • Net/curl
  • Utils/ruby-rails
  • Utils/tmux (alternatively, Utils/screen)
  • Web/nginx
  • Util/dos2unix

####Nokogiri Gem

The nokogiri requires to be compiled natively. You will need the following packages:

  • Devel/g++
  • Devel/make
  • Interpreters/ruby-devel
  • Libs/libiconv-devel
  • Libs/libxml2-devel
  • Libs/libxslt-devel

Run this before executing "bundle install" below

bundle config build.nokogiri --use-system-libraries
gem install pkg-config -v "~> 1.1.7"`

###Linux

aptcmd install ${programs}

Remember to install a command-line text editor if you don't like vi(m) or nano ####Install the GPG key

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

####Install RVM and ruby \curl -sSL https://get.rvm.io | bash -s stable --ruby

####Configure nginx nano /etc/nginx/sites-available/sharex_server

If you modify nginx.conf directly, remember to remove the existing server block, or adapt your configuration for your environment

server {
        listen 80;
        location / {
                proxy_pass http://localhost:4567/;
                proxy_set_header Host $host;
        }
        server_name example.com;
}

Remember to change example.com to the domain your image viewer will use.

Enable the new configuration

ln -s /etc/nginx/sites-available/sharex_server /etc/nginx/sites-enabled/sharex_server

if for some reason the directory is missing, see #17415606 OR just edit /etc/nginx/nginx.conf, see http block.

*For windows/nginx, you can edit it directly with your favorite editor using the following path: "C:\cygwin\etc\nginx\nginx.conf"

Now, restart nginx:

Linux: /etc/init.d/nginx restart

Windows: Windows is a little silly. It does not create the proper folders.

#You may need to run cygwin terminal as admin
mkdir /var/log/nginx
mkdir /var/lib/nginx/tmp -p
/usr/sbin/nginx.exe

##Configure access


Linux-only, cygwin has no equivalent

#add ruby user(s) to the 'rvm' group
adduser ${tuser} rvm`
#clean up after ourselves
unset tuser && unalias apt
#login as user
su login ${tuser}

###clone the repo

Once you are logged in as user:

cd ${HOME}
git clone --depth=1 https://github.com/0xC7/That-one-file-viewer.git src/fileviewer/

##Install the requirements for the file viewer

cd src/fileviewer
bundle install

##configure the file viewer

cp config/examples/example_basic_cfg.yml config/basic_cfg.yml
nano config/basic_cfg.yml

##Running

dos2unix sharex_control.sh
./sharex_control.sh start

##FTP server You will need to set up your own FTP server on the machine and configure your secure access to it.

Autorun

To automatically run the script after a system reboot, edit the user's crontab file (crontab -e) and add something like this:

@reboot ~/src/fileviewer/sharex_control.sh start

About

A file viewer, written in Ruby using Sinatra, by that guy. It's intended for use with ShareX by those guys.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 87.4%
  • CSS 9.1%
  • Ruby 1.9%
  • Other 1.6%