Giter Site home page Giter Site logo

silentpatrik / caddy-ui-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qdm12/caddy-ui-server

0.0 0.0 0.0 94 KB

Server responsible to serve the Caddy UI and communicate with the Caddy server API

License: MIT License

Go 87.02% Dockerfile 12.98%

caddy-ui-server's Introduction

Caddy UI server

โžก๏ธ Server responsible to serve the Caddy UI and communicate with the Caddy server API

Please refer to the caddy-ui repository for end-user instructions.

Build status Join Slack channel GitHub last commit GitHub commit activity GitHub issues

Architecture

This server is stateless and does the following:

  • Serve the built static files of the frontend to the user
  • Act as an intermediary proxy to communicate with your Caddy server (to work around CORS)

It is written in Go in order to have a small static binary on a Docker Scratch image.

Repository

The repository contains:

  • the HTTP API server written in Go
  • the web frontend app written in ReactJS, as the ui Git submodule

Setup

  1. Use the following command:

    docker run -d -p 8000:8000/tcp qmcgaw/caddy-ui

    You can also use docker-compose.yml with:

    docker-compose up -d
  2. You can update the image with docker pull qmcgaw/caddy-ui or use one of tags available

Environment variables

Environment variable Default Description
CADDY_API_ENDPOINT http://localhost:2019 Caddy server API endpoint address
LOG_ENCODING console Logging format, can be json or console
LOG_LEVEL info Logging level, can be debug, info, warning, error
NODE_ID -1 Node ID for logger (-1 to disable)
LISTENING_PORT 8000 Internal listening TCP port
ROOT_URL / URL path, used if behind a reverse proxy
TZ America/Montreal Timezone string

Development

  1. Setup your environment

    Using VSCode and Docker (easier)

    1. Install Docker
      • On Windows, share a drive with Docker Desktop and have the project on that partition
      • On OSX, share your project directory with Docker Desktop
    2. With Visual Studio Code, install the remote containers extension
    3. In Visual Studio Code, press on F1 and select Remote-Containers: Open Folder in Container...
    4. Your dev environment is ready to go!... and it's running in a container ๐Ÿ‘ So you can discard it and update it easily!

    Locally

    1. Install Go, Docker and Git

    2. Install Go dependencies with

      go mod download
    3. Install golangci-lint

    4. You might want to use an editor such as Visual Studio Code with the Go extension. Working settings are already in .vscode/settings.json.

  2. Commands available:

    # Build the binary
    go build cmd/app/main.go
    # Test the code
    go test ./...
    # Lint the code
    golangci-lint run
    # Build the Docker image
    docker build -o build ui
    docker build -t qmcgaw/caddy-ui .
    # Run the container
    docker run -it --rm -p 8000:8000/tcp qmcgaw/caddy-ui
  3. See Contributing for more information on how to contribute to this repository.

TODOs

  • Unit tests
  • Integration tests

License

This repository is under an MIT license unless otherwise indicated

caddy-ui-server's People

Contributors

qdm12 avatar

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.