Code Monkey home page Code Monkey logo

selfhostedpro / yacht Goto Github PK

View Code? Open in Web Editor NEW
3.1K 44.0 151.0 73.79 MB

A web interface for managing docker containers with an emphasis on templating to provide 1 click deployments. Think of it like a decentralized app store for servers that anyone can make packages for.

License: MIT License

Dockerfile 0.29% Python 24.70% JavaScript 11.53% HTML 1.87% Vue 61.49% Mako 0.12%
docker flask python webinterface docker-deployment vuejs yacht appstore jwt-authentication hacktoberfest

yacht's Introduction

logo

Docker Hub Pulls Docker Image Size Open Collective

Yacht Logo From Github

Yacht

Yacht is a container management UI with a focus on templates and 1-click deployments.

I'm currently rewriting the backend in Typescript as an attempt to have a language that more people would contribute to. You can follow development of that here.

Please note, that while we are rewriting the back end. The Yacht.sh website is outdated on its instructions, please visit https://dev.yacht.sh for now. The main Yacht.sh site will be updated with the new release.

Demo:

Tempaltes

Installation:

Currently only linux has been verified as working but we are open to the idea of supporting windows eventually as well.

Keep in mind, this is an alpha so the risk of data loss is real and it may not be stable

Installation documentation can be found here.

Check out the getting started guide if this is the first time you've used Yacht: https://dev.yacht.sh/docs/Installation/Getting_Started

Yacht is also available via the DigitalOcean marketplace:

DigitalOcean

We can also be found on Linode

<img src="https://www.linode.com/wp-content/uploads/2021/01/Linode-Logo-Black.svg" width="200" >

Features So Far:

  • Vuetify UI Framework
  • Basic Container Management
  • Template Framework
  • Easy Template Updating
  • Centralized settings for volume management and similar QOL functionality.
  • Docker-Compose Compatibility
  • Advanced Container Management (Edit/Modify)

Planned Features:

  • Container Monitoring
  • Easy access to container interfaces
  • User Management
  • Scheduled Jobs

If you want something that's not planned please open a feature request issue and we'll see about getting it added.

Templating:

Currently Yacht is compatible with portainer templates. You'll add a template url in the "Add Template" settings. The the template will be read, separated into apps, and imported into the database. The apps associated with the templates are linked via a db relationship so when the template is removed, so are the apps associated with it. We store the template url as well so we can enable updating templates with a button press.

We recommend starting with:

https://raw.githubusercontent.com/SelfhostedPro/selfhosted_templates/yacht/Template/template.json

In templates you are able to define variables (starting with !) to have them automatically replaced by whatever variable the user has set in their server settings (ie. !config will be replaced by /yacht/AppData/Config by default).

Notes for ARM devices

If you're on arm and graphs aren't showing up add the following to your cmdline.txt:

cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1

Supported Environment Variables

You can utilize the following environment variables in Yacht. None of them are mandatory.

Variable Description
PUID Set userid that the container will run as.
PGID Set groupid that the container will run as.
SECRET_KEY Setting this to a random string ensures you won't be logged out in between reboots of Yacht.
ADMIN_EMAIL This sets the email for the default Yacht user.
DISABLE_AUTH This disables authentication on the backend of Yacht. It's not recommended unless you're using something like Authelia to manage authentication.
DATABASE_URL If you want to have Yacht use a database like SQL instead of the built in sqlite on you can put that info here in the following format:postgresql://user:password@postgresserver/db
COMPOSE_DIR This is the path inside the container which contains your folders that have docker compose projects. (compose tag only)

Notes for installing Docker and Yacht on WSL2 platform under Windows

If you’re running under WSL2 inside Windows, because of the difference in how permissions are handled. Your essentially inside of a Linux machine accessing a Windows file system. You will need to run after installation before adding the Yacht container:

$ sudo usermod -aG docker $USER

Additional information about this can be found in the Post-installation steps for Linux

Update button not working?

If the built in update button isn't working for you try the following command:

docker run --rm -d -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower:latest --cleanup --run-once <container-name>

License

MIT License

yacht's People

Contributors

dependabot[bot] avatar dtslvr avatar gridhead avatar kylo252 avatar marcjmiller avatar potts99 avatar selfhostedpro avatar snyk-bot avatar wickedyoda avatar zachmyers3 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yacht's Issues

Templates:

  • Form for addition
  • Decoding of JSON
  • Importing to db
  • Show collection of apps in template
  • Page for deleting templates
  • Updating templates from button on template details page

Log Scrolling

Logs for apps load from the top rather than the last entry. Scrolling down is needed to see latest entries.

Minor issue.

[BUG] 500 Internal server error on login page

Describe the bug
The login page causes an internal server error

To Reproduce

  1. Go to '/account/login'

Expected behavior
A login form

Additional context
Docker version 19.03.8
Running on windows with WSL 2 and powershell

Logs

...
File "/app/templates/account/login.html", line 2, in <module>
    {% import 'macros/form_macros.html' as f %}
File "/app/templates/layouts/base.html", line 40, in <module>
    {% block content %}
File "/app/templates/account/login.html", line 22, in <module>
    <a href="{{ url_for('account.reset_password_request') }}">Forgot password?</a>
...
werkzeug.routing.BuildError: Could not build url for endpoint 'account.reset_password_request'.
Did you mean 'account.reset_password' instead?

[Feature Request] Add container label support

Allowing users to add labels to containers will allow traefik to automatically discover the containers.
It would be nice to be able to define some default labels for all containers, and then edit them on a per container basis

Make notes more prominent in the deployment process

When deploying apps from the template, notes do not appear visible. I am either missing something or notes are just not visible. Can you sticky the notes for apps at the top of each deployment step? Notes hold critical information about the apps such as login details.

Docker Compose Support

Support docker-compose via an in browser editor, a form to download compose files (possibly via git) and have a list like the templates section.

Apps:

  • List of all apps compiled from db
  • Deploy page with dynamic fields based on template data
  • Connect to the docker socket using docker-py to launch docker container using variables provided in the form.
  • Basic docker controls (Start, Stop, Restart, Remove)

[Suggestion] Colour-coding containers on "View Applications"-page for further sorting

The following is an idea only, not a full on suggestion. Would love your feedback on it.
Colour-coding containers:
In case someone has many containers running, like on my system with currently 28 containers, somehow grouping or identifying them by colour, for example, would be nice. Give all container names which serve websites like wordpress or apache a red background, all container names with containers which serve media a green background. Could be done of a stack by stack basis. Stack A=red, stack B=blue, stack C=green. Much like Portainer displays the state of containers, "running" has a green background. I hope I made sense here. English isn't my first languange, sorry.

Copy pasted from original issue #77 as per the wish of SelfhostedPro.

docker stats reported as null for ARM

Got an error on my raspberry pi. There is not stats, and container log's contain

ERROR:    Exception in ASGI application". 
Error Logs:
RuntimeError: aclose(): asynchronous generator is already running
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 154, in run_asgi
    result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
  File "/usr/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "/usr/lib/python3.8/site-packages/fastapi/applications.py", line 180, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/lib/python3.8/site-packages/starlette/applications.py", line 111, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/lib/python3.8/site-packages/starlette/middleware/errors.py", line 146, in __call__
    await self.app(scope, receive, send)
  File "/usr/lib/python3.8/site-packages/starlette/exceptions.py", line 58, in __call__
    await self.app(scope, receive, send)
  File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 566, in __call__
    await route.handle(scope, receive, send)
  File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 283, in handle
    await self.app(scope, receive, send)
  File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 57, in app
    await func(session)
  File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 242, in app
    await dependant.call(**values)
  File "./api/routers/apps.py", line 145, in dashboard
    await asyncio.gather(*tasks)
  File "./api/routers/apps.py", line 154, in process_container
    mem_current = line["memory_stats"]["usage"]
KeyError: 'usage'

[Feature Request] Container start line storage

I would like to see a basic way to store and display text. The docker start lines that I edit and use to create containers should be storable. For example is the start line for Yacht:

docker run -d -p 8321:8000 -v /var/run/docker.sock:/var/run/docker.sock -v yacht:/config selfhostedpro/yacht

I've edited the port information, and in another I could edit the volume information... I want to be able to store this text information inside the docker volume "yacht" (or bind mount) so that the info survives restarts and container updates. Preferably an interface where you can name each file and have a set number of characters for the "sheet"/notes. And be able to copy and paste from it.

[Feature Request] Ability to pull & deploy new (latest) image of a already deployed container

It would be nice if there is a way to pull and deploy the latest image for a running container out of Yacht.

Yes, there is Watchtower which offers this ability and I'm already using it in "check-only-mode" as I want to be in control of if/when a container shall be updated.

Right now I have to use CLI and stop/remove a container, pull the latest image and deploy it again, or didn't I realise that there is a way from within Yacht right now?

[Feature Request] Show Stack/Compose a container belongs to in "View Application"-page

Once compose support is implemented (if I understood that right, that support for compose files is coming), show the stack/compose the container belongs to, if applicable. For Example, on my current prod system, I've got a compose-file in /prosper, so Portainer shows containers as part of stack "prosper".

image

Copy pasted from original issue #77 as per the wish of SelfhostedPro.

Misleading "Add New Apps" button sub header

On /apps the "Add New Apps" button has a sub header that says "Invites a new user to create their own account", but i believe something like "Add an app using an existing template" would be more appropriate.

Not able to see my Dashboard any more Reaching over 100 Dockers

Hi,
I have been using Yacht for the last couple of days. Everything works OK till I added a couple of Dockers too many.
At this point I can NOT see anything in the Dashboard BUT the word Status and a Refresh Arrow.
Doing F12 - Getting this Error:

Error: Request failed with status code 401
    at t.exports (createError.js:16)
    at t.exports (settle.js:17)
    at XMLHttpRequest.f.onreadystatechange (xhr.js:69)
Home.vue:85 Starting connection to Websocket

Not sure what type of Authorization is needed and How I am violating it?
Please assist.
Thanks

Yacht Page doesn't load on trying to install calibre-web

I went to apps.
Add calibre-web
Change the host path for books and config.

It doesn't download the image
and hangs on the following page.
http://192.168.8.183:5000/apps/add/11/info
"This page not working"

From modest _wu:
[2020-06-26 15:50:35 +0000] [252] [CRITICAL] WORKER TIMEOUT (pid:285)
[2020-06-26 15:50:35 +0000] [285] [INFO] Worker exiting (pid: 285)
valid
['PUID=1000', 'PGID=100']
{'8083': '8083/tcp'}
stop
[2020-06-26 15:50:35 +0000] [286] [INFO] Booting worker with pid: 286
RaygunProvider error: ApiKey not set, errors will not be transmitted

Templates issue

After installing yacht through portrainer and just using docker compose, both give me the issue with the template from Selfhosted.
In the Yacht UI itself it gives an error: Unauthorized.

Am I doing something wrong or is there a command I need to use for this?

[Feature Request] Start line/compose parsing to template.

I would like an interface where I can paste in a container start line:

docker run -d -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock -v yacht:/config selfhostedpro/yacht

After hitting enter or clicking a Go button, the parser should identify each part of the syntax and place it in a new template that can be further edited/saved/executed. Ideally the parser should read start lines and/or compose syntax for template creation.

Issue with Yacht dashboard - Exceeding the max Dokcer count - I think.

Hi,
I have been using Yacht for the last couple of days. Everything works OK till I added a couple of Dockers too many.
At this point I can NOT see anything in the Dashboard BUT the word Status and a Refresh Arrow.
Doing F12 - Getting this Error:

Error: Request failed with status code 401
    at t.exports (createError.js:16)
    at t.exports (settle.js:17)
    at XMLHttpRequest.f.onreadystatechange (xhr.js:69)
Home.vue:85 Starting connection to Websocket

Not sure what type of Authorization is needed and How I am violating it?
Please assist.
Thanks

High cpu-usage when accessing trough Safari on MacOS Catalina

When accessing the webpage trough MacOS Catalina on my Macbook, the cpu usage is above 100% and the webpage freezes.
With Firefox running on the same machine there's no problem and everything works fine and smooth.

Nice project btw πŸ‘

kr.,
Frepke

Support for Docker Socket Proxy

I keep access to the docker socket behind a proxy, so mapping /var/run/docker.sock doesn't work for my use case. Instead, all of my containers that need access to the docker socket get access through tcp://socket-proxy:2375 via a specific command or environment variable. I'd like to give this a shot to compare to portainer, but won't be able to until this is supported.

https://github.com/fluencelabs/docker-socket-proxy

[Feature Request] Expand View Applications page

If feasible, I'd love to see the following additions to the "View Applications" page:
Ports:

  • Ports on the host and contaienr in the usual host:container format, for each app.

Stack/Compose:

  • Once compose support is implemented (if I understood that right, that support for compose files is coming), show the stack/compose the container belongs to, if applicable. For Example, on my current prod system, I've got a compose-file in /prosper, so Portainer shows containers as part of stack "prosper".

Columns:

  • Allow users to specify the columns displayed. For example: Only show "Name", "Status", "Ports" & hide "Stack","Image", "Created At". Allows for more personalization, me thinks.

The following is an idea only, not a full on suggestion. Would love your feedback on it.
Colour-coding containers:
In case someone has many containers running, like on my system with currently 28 containers, somehow grouping or identifying them by colour, for example, would be nice. Give all container names which serve websites like wordpress or apache a red background, all container names with containers which serve media a green background. Could be done of a stack by stack basis. Stack A=red, stack B=blue, stack C=green. Much like Portainer displays the state of containers, "running" has a green background. I hope I made sense here. English isn't my first languange, sorry.

[Feature Request] Ports in "View Application"-page

If feasible, I'd love to see the following addition to the "View Applications" page:

Ports on the host and container in the usual host:container format, for each app. An example can be seen in portainer:
image

Copy pasted from original issue #77 as per the wish of SelfhostedPro.

Crash on start

CLI:
docker run -d --name yacht --restart=always -p 8001:8000 -v /var/run/docker.sock:/var/run/docker.sock -v path-to/yacht:/config selfhostedpro/yacht

Error:

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
nginx: [emerg] open() "/config/nginx/nginx.conf" failed (2: No such file or directory)
[services.d] done.
nginx: [emerg] open() "/config/nginx/nginx.conf" failed (2: No such file or directory)
INFO:     Started server process [265]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on unix socket /tmp/gunicorn.sock (Press CTRL+C to quit)
nginx: [emerg] open() "/config/nginx/nginx.conf" failed (2: No such file or directory)
nginx: [emerg] open() "/config/nginx/nginx.conf" failed (2: No such file or directory)
nginx: [emerg] open() "/config/nginx/nginx.conf" failed (2: No such file or directory)
nginx: [emerg] open() "/config/nginx/nginx.conf" failed (2: No such file or directory)

[Feature Request] App tracking on the template page

Is your feature request related to a problem? Please describe.
A way to track if we have already installed the app on the template page.

Describe the solution you'd like
Maybe a number or some sort of flag showing it's installed on the card on the template page.

[Feature Request] Documentation

Need to get some good documentation together to help people get started with this project. Also need a better way of displaying how to setup a dev environment without it being in the readme. Suggestions are welcome. Discussion is easier here: https://discord.gg/d7np9fX

Can't View dashboard anymore

I have been using it for a while and everything went well. But Now I can NOT view the dashboard anymore.
Is there any limitation on Dockers count? I have up to 110 Dockers now. I was able to use dashboard before the upgrade of 4 or 5 new Dockers.
Any idea? thanks

[BUG] Templates with no host port set will fail to deploy.

Describe the bug
If a template doesn't have a host port set it will throw a 422 error in flask.

To Reproduce

  1. Go to templates and add the yacht templates
  2. Try to deploy heimdall without setting host ports

Expected behavior
It should launch with a random host port.

[BUG] - Preset environment variable isn't brought in, env variable name is blank

Describe the bug
I have a working Portainer template file. One of the apps uses "preset" env variables for a couple of items. When brought into Yacht, it doesn't populate the name, but does populate the default value. If you try and deploy this without setting the name properly, Yacht throws a 500 error.

To Reproduce
Steps to reproduce the behavior:

  1. Load app template json
  2. Add App
  3. Fill in template details (but not env variable, should be pulled in)
  4. Deploy, get 500 error

Expected behavior
Yacht should pull in "name" for the env variable from the template file

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Also, "image" should be populated too?

** Logs **
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/lib/python3.8/site-packages/flask_login/utils.py", line 261, in decorated_view return func(*args, **kwargs) File "/app/decorators.py", line 17, in decorated_function return f(*args, **kwargs) File "/app/apps/views.py", line 69, in deploy_app launch_container(form, volumes, ports, env) File "/app/apps/views.py", line 103, in launch_container dclient.containers.run( File "/usr/lib/python3.8/site-packages/docker/models/containers.py", line 802, in run container = self.create(image=image, command=command, File "/usr/lib/python3.8/site-packages/docker/models/containers.py", line 861, in create resp = self.client.api.create_container(**create_kwargs) File "/usr/lib/python3.8/site-packages/docker/api/container.py", line 430, in create_container return self.create_container_from_config(config, name) File "/usr/lib/python3.8/site-packages/docker/api/container.py", line 441, in create_container_from_config return self._result(res, True) File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 267, in _result self._raise_for_status(response) File "/usr/lib/python3.8/site-packages/docker/api/client.py", line 263, in _raise_for_status raise create_api_error_from_http_exception(e) File "/usr/lib/python3.8/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception raise cls(e, response=response, explanation=explanation) docker.errors.APIError: 400 Client Error: Bad Request ("invalid environment variable: =https://github.com/pingidentity/pingidentity-server-profiles.git")

[Feature Request] Predefine CPU and Memory Limits

I grabbed this feature request via reddit - https://www.reddit.com/r/selfhosted/comments/iycwls/yacht_container_management_ui_alpha_is_here/g6cams8/

I want to pre-define some different sized containers (CPU, mem limits) that they can pick from and run R, Python or Julia amongst other things, but not let them have full access to making changes to the overall container definition - because they like to break things - or have them remember to put in limits and constraints by typing stuff in launch their own container by hand. The problem with the analytics tools is they typically take CPU total - 1 as the amount of resource they can put their hands on which doesn't work in a multi-user environment.

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.