Giter Club home page Giter Club logo

webalizer's Introduction

Webalizer

Intro

Webalizer is a web interface for running local programs and scripts remotely.

It is implemented as a command line application that reads command definition configurations and exposes those commands with a simple, easy to use UI. I use it for running tasks and scripts in my home server.

Despite it has authentication and I do my best to make it as secure as possible, it is intended to be used in a trusted environment, such as your home network and not directly exposed to the internet. Be careful. This is just a side project.

Here is a screenshot:

Screenshot

Installation

Ensure you have a recent version of node and npm, then:

npm i -g webalizer

Configuration

By default, webalizer will look for command definition files at ~/.webalizer/*.json where each .json file represents the configuration for a single command in the web interface. Here is an example configuration file which you can create for example at ~/.webalizer/start_vm.json:

{
  "command": "VBoxManage startvm Windows --type headless",
  "name": "Start windows VM",
  "description": "Starts the windows VM",
  "button": "Start",
  "shell": true,
  "confirm": "Are you sure you want to start this VM?",
  "timeout": 5000
}

The following configuration options are available:

command: Required. Actual program or shell script to run. Note that if your command depends on any shell feature, you will need to set also shell: true for it to work correctly.

name: Required. Name of this script to be shown in the UI

description: Optional. An explanatory description of what this command does.

button: Optional, defaults to "Run". Label the button for running this command will have in the UI

shell: Optional, defaults to false. If set to true, the command will be run inside a shell. warning This might be more insecure than running just a program. Use with caution.

confirm: Optional, defaults to false. If set to true, it will prompt for confirmation with a default message when the user clicks the button to run the command. If set to a non empty message, it will show this message to the user instead of the default one

timeout: Optional, defaults to 1 minute. Maximum time for the script to run. After this time is reached, the script will be killed.

Running

ADDRESS=0.0.0.0 PORT=8088 USERNAME=someuser PASSWORD=somepass NEXTAUTH_URL=http://yourPublicServerAddressOrIP:8088 webalizer

The following environment variables are available:

ADDRESS: Optional, defaults to 127.0.0.1. IP address where the web application will listen for connections

PORT: Optional, defaults to 3000. Port where the web application will listen for connections

USERNAME: Optional. if this and the PASSWORD options are set to non empty values, the application will ask for logging in.

PASSWORD: Optional. if this and the USERNAME options are set to non empty values, the application will ask for logging in.

NEXTATUH_URL: Optional, only required if USERNAME and PASSWORD are set. Public URL you will use to reach your application.

SCRIPTS_ROOT: Optional, defaults to ~/.webalizer. Directory where to look for command definition files.

Development

Clone this repository, and then:

npm install
npm run dev

You can optionally customize development time env vars by doing

cp .env.example .env

and customizing the values in .env

To run tests:

npm test

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.