Giter Site home page Giter Site logo

mlocate-web's Introduction

mlocate-web

A very simple Python web application that offers a web interface for searching a system's filesystem by name using locate / mlocate.

Requirements:

  • Python3 (developed using 3.5.2)
  • Flask (developed using 0.11 installed in a venv with pip)
  • A linux distribution with locate/mlocate set up (developed on Ubuntu 16.04)

Installing and running, in short:

  • Clone to local filesystem
  • cd to directory
  • python3 app.py
  • For detailed instructions, with autostart and using gunicorn to serve the webapp, see below screenshot

Screenshot

ScreenShot

Set up as system service on ubuntu 16.04

  • git clone https://github.com/ehoppmann/mlocate-web.git
  • cd mlocate-web
  • sudo apt-get install python3-pip
  • pip3 install virtualenv
  • virtualenv venv
  • source venv/bin/activate
  • pip3 install -r requirements.txt
  • pip3 install gunicorn
  • Create the file /etc/systemd/system/gunicorn.service with this content:
[Unit]
Description=gunicorn daemon
After=network.target

[Service]
PIDFile=/run/gunicorn/pid
User=<USER YOU WANT THIS TO RUN AS - SUGGEST LIMITED USER>
Group=<GROUP YOU WANT THIS TO RUN AS>
WorkingDirectory=<BASE DIRECTORY - WHERE YOU CLONED TO>
ExecStart=<BASE DIRECTORY - WHERE YOU CLONED TO>/venv/bin/gunicorn --workers 3 -b 0.0.0.0:8000 app:app

[Install]
WantedBy=multi-user.target
  • systemctl start gunicorn
  • systemctl enable gunicorn

The search service should now be available on port 8000 and will automatically start with the system.

mlocate-web's People

Contributors

ehoppmann avatar eric11 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

mlocate-web's Issues

Startup issue

I followed the instructions but this is what I ended up with:

โ— gunicorn.service - gunicorn daemon
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-01-24 21:39:43 PST; 15s ago
 Main PID: 15935 (code=exited, status=203/EXEC)

Jan 24 21:39:43 nuc systemd[1]: Started gunicorn daemon.
Jan 24 21:39:43 nuc systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
Jan 24 21:39:43 nuc systemd[1]: gunicorn.service: Unit entered failed state.
Jan 24 21:39:43 nuc systemd[1]: gunicorn.service: Failed with result 'exit-code'.

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.