Like Marathon or Upstart - for your desktop!

websysd

Like Marathon or Upstart, for your desktop!

Screenshot of websysd workspace list

Getting started

Download a binary release, or run it with Docker:

docker run -v `pwd`/workspace.json:/workspace.json -v `pwd`/websysd.json:/websysd.json iankent/websysd -workspace=/workspace.json

If you didn't name your config files websysd.json and workspace.json:

websysd -global websysd.local.json -workspace myworkspace.json

And if you want to load multiple workspaces:

websysd -workspace myworkspace.json -workspace someproject.json

Why

Too many console windows.

Useful info

  • Active tasks will be killed if websysd dies or is stopped
  • Use the /bin/sh -c executor on Linux
  • Use custom columns and functions to add UI metadata, e.g. display git branch name

Environment

Default websysd behaviour is to ignore all preset environment variables.

This means you will need to set any variables you want explicitly (including $PATH, which you might want to set to /bin:/usr/bin:/usr/local/bin).

You can change this behaviour by setting InheritEnvironment in either the global configuration or a workspace configuration file:

{
	"InheritEnvironment": true
}

If InheritEnvironment is true in the global workspace, the setting is ignored by individual workspaces and the full environment will be inherited anyway.

STDOUT/STDERR logs

Output from tasks is stored in-memory by default.

You can set Stdout and Stderr to a filename per-task to override this behaviour.

Filenames can include environment variables, and $TASK and $RUN are set by websysd.

{
	"Stdout": "/tmp/$TASK-$RUN.out"
}

Screenshots

Screenshot of websysd task list Screenshot of websysd task view Screenshot of websysd log view

Licence

Copyright Β©β€Ž 2014 - 2016, Ian Kent (http://iankent.uk).

Released under MIT license, see LICENSE for details.

Owner
websysd
Like Marathon or Upstart - for your desktop!
websysd
Comments
  • Contributions made (favicon, bug fixes, etc)

    Contributions made (favicon, bug fixes, etc)

    • Cater for scenario where the environment KEY is empty
    • Set the workspace intended environment on the workspace instead of on GlobalWorkspace
    • Allow functions to inherit environment.
    • Wrap the "GetColumn" output in a <pre> tag. This is useful when the return result has multiple lines. For instance if the Function Command is git -C $PATH status -s
    • Added column headers to the home page (workspaces.html)
    • Added a favicon.ico
    • Added a contribution guide (CONTRIBUTING.md)
  • Add `PWD` variable support for stdout and stderr

    Add `PWD` variable support for stdout and stderr

    This allows us to use the PWD variable for Tasks:

    workspace.json:

    "Tasks": [
        {
            ...
            "Stdout": "$PWD/$TASK-$RUN.out",
            "Stderr": "$PWD/$TASK-$RUN.err",
            ...
        }
    ]
    
  • Fix issue with redir()

    Fix issue with redir()

    Description Fix issue with redir() causing actions (e.g /enable) to redirect to

    /workspace/%WORKSPACE%/task/%TASK%/%REFERRER_URL% instead of redirecting to %REFERRER%.

    redir() checks if the request object has a referrer value session.Request.Referrer() and passes it to session.Redirect() as u := &url.URL{Path: referrer}.

    But u.String() for the referrer value evaluates to a relative URL, for e.g ./http://localhost:7050, which causes to HTTP redirect headers to be set relative to the current request.

    Solution: We parse the referrer URL using url.Parse() before passing to session.Redirect(). If the value failed to parse, it will default to "/".

    It should handle the referrer URL properly, for both absolute or relative URLs.

    Other Notes Also includes PR #8 changes to fix import references because it is a blocking issue that prevents the project to build.

  • Possible memory leak or unbounded memory usage?

    Possible memory leak or unbounded memory usage?

    Hi @ian-kent

    Been using websysd for about two weeks for a small project on production. It has been really useful and has been making managing processes much easier.

    Though I've noticed that after a few days usage, that websysd process itself uses a huge chunk of memory. (The processes that it manage have stable memory footprint though)

    On my 512MB DigitalOcean droplet, it would start with 6% memory usage, before eventually using 50% after several days, before I had to kill it and restart websysd.

    This issue seems worst when the logs are stored in-memory by default (which makes perfect sense). While setting the STDOUT and STDERR config helps, currently it just delay the inevitable.

    Could you kindly advise a way to work around this or help to improve websysd memory usage?

    Below is my current config files

    global config

    {
      "Environment": {
        "GO15VENDOREXPERIMENT": "1",
        "WEBSYSD": "true",
        "PROD": "1",
      },
      "InheritEnvironment": true,
      "Functions": {
        "DiskUsage": {
          "Args": ["$PATH"],
          "Executor": ["/bin/sh", "-c"],
          "Command": "du -sh $PATH"
        },
        "GitBranch": {
          "Args": ["$PATH"],
          "Executor": ["/bin/sh", "-c"],
          "Command": "git --git-dir $PATH/.git rev-parse --abbrev-ref HEAD"
        }
      }
    }
    

    workspace1

    {
      "Name": "main",
      "Environment": {
        "WORKSPACE": "main"
      },
      "Columns": {
        "Disk usage": { "DiskUsage": [ "$PATH" ] }
      },
      "Tasks": [
        {
          "Name": "ngrok",
          "Command": "ngrok -log=stdout 4001",
          "Stdout": "/home/sogko/logs/$TASK-$RUN.out",
          "Stderr": "/home/sogko/logs/$TASK-$RUN.err"
        },
        {
          "Name": "cron",
          "Environment": {
            "LOGLEVEL": "info"
          },
          "Command": "my_cron",
          "Stdout": "/home/sogko/logs/$TASK-$RUN.out",
          "Stderr": "/home/sogko/logs/$TASK-$RUN.err"
        },
        {
          "Name": "main.go",
          "Environment": {
            "LOGLEVEL": "warning"
          },
          "Command": "my_server",
          "Stdout": "/home/sogko/logs/$TASK-$RUN.out",
          "Stderr": "/home/sogko/logs/$TASK-$RUN.err"
        }
      ]
    }
    

    Note: Currently I'm trying to see if removing custom columns (for e.g. the Disk Usage here) would help to improve the situation.

    Thanks! πŸ‘πŸ»

  • Gulp tasks break if the `USER` environment variable is set

    Gulp tasks break if the `USER` environment variable is set

    The AddDefaultVars method sets the USER variable. This causes gulp tasks to fail with this error:

    Unable to cache a config file for v8flags to a your home directory
    or a temporary folder. To fix this problem, please correct your
    environment by setting HOME=/path/to/home or TEMP=/path/to/temp.
    NOTE: the user running this must be able to access provided path.
    If all else fails, please open an issue here:
    http://github.com/tkellen/js-v8flags
        at Error (native)
    

    Commenting out the line vars["USER"] = u.Username solves the problem for now.

  • If task names have spaces the web gui breaks

    If task names have spaces the web gui breaks

    If you have a task with spaces in the name (like "My server") it will break the UI at some points.

    For instance going into the task "history" view and clicking on the Start, then Stop, then Start buttons it will break. It sometimes even breaks on the first time pressing the start button.

πŸš€ A command with fzf-like UI to quickly search Wikipedia articles and open it in your browser

fzwiki A command with fzf-like UI to quickly search Wikipedia articles and open it in your browser. Usage Run the command by specifying a search query

Dec 20, 2022
A simple api built in Go that facilitates directly sending email from your client side html to your inbox

go-email-service A simple api built in Go that facilitates directly sending emai

Dec 28, 2021
fzf-like fuzzy-finder as a Go library
fzf-like fuzzy-finder as a Go library

go-fuzzyfinder go-fuzzyfinder is a Go library that provides fuzzy-finding with an fzf-like terminal user interface. Installation $ go get github.com/k

Jan 1, 2023
Software for archiving my digital stuff like tweets

rsms's memex Software for managing my digital information, like tweets. Usage First check out the source and build. You'll need Make and Go installed.

Nov 17, 2022
A simple Go utility to display track information from, and send commands to, spotifyd from Tiling Window Managers like Sway and i3
A simple Go utility to display track information from, and send commands to, spotifyd from Tiling Window Managers like Sway and i3

Untitled Spotifyd Controller A simple Go utility to display track information from, and send commands to, spotifyd from Tiling Window Managers like Sw

Mar 8, 2022
DND-magic-item-Generator - D&D magic item generator like in Diablo

DND-magic-item-Generator D&D magic item generator like in Diablo Legendary items

Mar 28, 2022
Nvote - Decentralized, vote-driven community similar to services like Reddit and HackerNews. Built on nostr

NVote Nvote is a decentralized, vote-driven community similar to services like R

Jan 4, 2023
Service that wrap up different movies-related APIs like IMDB and match it to streaming services
Service that wrap up different movies-related APIs like IMDB and match it to streaming services

Service that wrap up different movies-related APIs like IMDB and match it to streaming services. That way you can check in which platforms you can find your favorite movies.

Feb 10, 2022
Prig is for Processing Records In Go. Like AWK, but snobbish.

Prig: the snobbish AWK Prig is for Processing Records In Go. It's like AWK, but snobbish (Go! static typing!). It's also faster to execute, and if you

Sep 20, 2022
GoBatch is a batch processing framework in Go like Spring Batch in Java
GoBatch is a batch processing framework in Go like Spring Batch in Java

GoBatch English|δΈ­ζ–‡ GoBatch is a batch processing framework in Go like Spring Batch in Java. If you are familiar with Spring Batch, you will find GoBat

Dec 25, 2022
Sync your bank transactions with google sheets using Open Banking APIs

Sync your bank transactions with google sheets using Open Banking APIs

Jul 22, 2022
Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises
Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises

AWS, Turn off my Account, please Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises Resource

Oct 25, 2022
Sync your bank transactions with google sheets using Open Banking APIs

this is a markdown version of the copy on the site landing page: https://youneedaspreadsheet.com You need a spreadsheet ?? Get on top of your finances

Jul 22, 2022
Automatically resize your ebs

ebs-autoresize Automatically resize your ebs. Table of Contents ebs-autoresize Table of Contents Installing Getting Started Resize Best practices Cont

Oct 16, 2022
efsu is for accessing AWS EFS from your machine without a VPN

efsu: VPN-less access to AWS EFS efsu is for accessing AWS EFS from your machine without a VPN. It achieves this by deploying a Lambda function and sh

Mar 11, 2022
A "passwordless" login experience for your AWS RDS
A

RDS Auth Proxy A two-layer proxy for connecting into RDS postgres databases based on IAM authentication. This tool allows you to keep your databases f

Dec 28, 2022
Plot your repository stars over time.

Plot your repository stars over time.

Dec 30, 2022
Automatically roll your AWS IAM access key (aws_access_key_id) and secret key (aws_secret_access_key).

roll-it Keep your AWS Credentials fresh ?? on Windows, Mac, Linux (arm or x86)! What it Does Programmatically rotate your AWS IAM access keys and secr

Jan 6, 2023