Skip to content

Commit

Permalink
added ubuntu instructions + script
Browse files Browse the repository at this point in the history
  • Loading branch information
SRugina committed Feb 24, 2019
1 parent 14e1770 commit 6501582
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 0 deletions.
42 changes: 42 additions & 0 deletions filestash-ubuntu-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

First install go like so (to the /usr/local directory):

sudo apt-get install build-essential curl gcc g++ make nodejs git npm

cd ~ && curl -O https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz

tar xvf go1.11.4.linux-amd64.tar.gz

sudo chown -R root:root ./go

sudo mv go /usr/local

Then run the sh script (filestash-ubuntu-script) to install filestash. The executable will be located at /app and the source code at $GOPATH/src/github.com/mickael-kerjean/filestash/

To run the executable:

cd /app && ./filestash

*NOTE: PORT 8334 IS NEEDED TO RUN, WHICH THE SCRIPT MAKES UFW ALLOW. IF YOU CHANGE THE PORT IN THE SOURCECODE, YOU WILL NEED TO ALLOW THAT PORT IN UFW. IF YOU USE SOMETHING OTHER THAN UFW, EDIT THE SH SCRIPT TO ALLOW PORT 8334 WITH YOUR FIREWALL*

If you edit the source code and want to rebuild the executable, do this:

cd $GOPATH/src/github.com/mickael-kerjean/filestash/

mkdir -p ./dist/data/

cp -r config ./dist/data/

NODE_ENV=production npm run build

go build -ldflags "-X github.com/mickael-kerjean/filestash/server/common.BUILD_NUMBER=`date -u +%Y%m%d`" -o ./dist/filestash ./server/main.go

mkdir -p ./dist/data/plugin

go build -buildmode=plugin -o ./dist/data/plugin/image.so server/plugin/plg_image_light/index.go

sudo mv dist/* /app

Then to execute it:

cd /app && ./filestash
100 changes: 100 additions & 0 deletions filestash-ubuntu-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash

read -p 'make sure you have installed go as described in the md file, then press enter to continue'

sudo echo 'export GOPATH=/tmp/go' >> ~/.profile
sudo echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~/.profile
sudo echo 'export CGO_LDFLAGS_ALLOW='-fopenmp'' >> ~/.profile
sudo source ~/.profile

mkdir -p $GOPATH/src/github.com/mickael-kerjean/

mkdir /tmp/deps && cd /tmp/deps

curl -L -X GET https://github.com/libvips/libvips/releases/download/v8.7.0/vips-8.7.0.tar.gz > libvips.tar.gz

tar -zxf libvips.tar.gz

cd vips-8.7.0/

sudo apt-get install libexif-dev libtiff-dev libjpeg-dev libjpeg-turbo8-dev libpng-dev librsvg2-dev libgif-dev libglib2.0-dev libfftw3-dev libc6-dev libexpat-dev liborc-0.4-dev pkg-config glib2.0-dev libexpat1-dev libtiff5-dev libjpeg-turbo8-dev libgsf-1-dev

sudo ./configure

sudo make -j 6

sudo make install

cd /tmp/deps

curl -X GET https://www.libraw.org/data/LibRaw-0.19.0.tar.gz > libraw.tar.gz

tar -zxf libraw.tar.gz

cd LibRaw-0.19.0/

sudo ./configure

sudo make -j 6

sudo make install

cd $GOPATH/src/github.com/mickael-kerjean

git clone --depth 1 https://github.com/mickael-kerjean/filestash

cd filestash

mkdir -p ./dist/data/

cp -r config ./dist/data/

npm install

npm rebuild node-sass

NODE_ENV=production npm run build

cd $GOPATH/src/github.com/mickael-kerjean/filestash/server

go get

cd ..

go build -ldflags "-X github.com/mickael-kerjean/filestash/server/common.BUILD_NUMBER=`date -u +%Y%m%d`" -o ./dist/filestash ./server/main.go

mkdir -p ./dist/data/plugin

go build -buildmode=plugin -o ./dist/data/plugin/image.so server/plugin/plg_image_light/index.go

sudo apt-get install emacs texlive texlive-base texlive-latex-extra zip

sudo chmod 777 /usr/share/texlive/texmf-dist/tex/latex/base/

sudo curl https://raw.githubusercontent.com/mickael-kerjean/filestash_latex/master/wrapfig.sty > /usr/share/texlive/texmf-dist/tex/latex/base/wrapfig.sty

sudo curl https://raw.githubusercontent.com/mickael-kerjean/filestash_latex/master/capt-of.sty > /usr/share/texlive/texmf-dist/tex/latex/base/capt-of.sty

sudo curl https://raw.githubusercontent.com/mickael-kerjean/filestash_latex/master/sectsty.sty > /usr/share/texlive/texmf-dist/tex/latex/base/sectsty.sty

sudo texhash

sudo find /usr/share/emacs -name '*.pbm' | sudo xargs rm

sudo find /usr/share/emacs -name '*.png' | sudo xargs rm

sudo find /usr/share/emacs -name '*.xpm' | sudo xargs rm

sudo rm -rf /usr/share/texmf-dist/doc

cd $GOPATH/src/github.com/mickael-kerjean/filestash/

sudo apt-get install ca-certificates

sudo mv dist /app

cd /app

sudo ufw allow 8334

./filestash

0 comments on commit 6501582

Please sign in to comment.