📁 Well Known Web Server - A webserver that can be used in conjunction with Traefik's PathPrefixes to serve a global /.well-known/ directory.
Go to file
Quinn Lane 056fcf9949 💚 Forgot to rename the artifacts directory. Whoops. 2022-08-01 04:39:47 +00:00
.idea 🎉 Basic project down 2022-08-01 00:23:22 -04:00
.gitignore 🎉 Basic project down 2022-08-01 00:23:22 -04:00
.gitlab-ci.yml 💚 Forgot to rename the artifacts directory. Whoops. 2022-08-01 04:39:47 +00:00
Dockerfile 🎉 Basic project down 2022-08-01 00:23:22 -04:00
LICENSE 🎉 Basic project down 2022-08-01 00:23:22 -04:00
README.md 🎉 Basic project down 2022-08-01 00:23:22 -04:00
go.mod 🎉 Basic project down 2022-08-01 00:23:22 -04:00
go.sum 🎉 Basic project down 2022-08-01 00:23:22 -04:00
main.go 🎉 Basic project down 2022-08-01 00:23:22 -04:00

README.md

WKWS

A simple and lightweight Go webserver that can be used in conjunction with Traefik's PathPrefixes to serve an RFC-8615 compliant global /.well-known/ directory.

Features

  • Opens a webserver on port 1337
  • Is extraordinarily lightweight (When testing, it was using ~800kb of RAM)
  • Gets out of your way

Deployment

You can deploy this project in two possible ways, with Docker CLI or with Docker Compose. Please note that these are configured to be used by Traefik and without any SSL, you will have to configure that yourself along with adapting it to fit your specific deployment.

Docker CLI

  $ docker volume create wkws_data
  $ docker run -d -p 1337 --name wkws --restart=on-failure:3 --network=traefik -v wkws_data:/serve -l traefik.enable=true -l traefik.http.routers.wkws.entrypoints=web -l traefik.http.routers.wkws.rule=PathPrefix(`/.well-known`) registry.gitlab.com/saharacorp/wkws:latest

Docker Compose

version: '3'

services:
  app:
    image: registry.gitlab.com/saharacorp/wkws:latest
    restart: on-failure
    networks:
      - traefik
    ports:
      - "1337"
    volumes:
      - data:/serve
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.wkws.entrypoints=web"
      - "traefik.http.routers.wkws.rule=PathPrefix(`/.well-known`)"
      
volumes:
  data:
  
networks:
  traefik:
    external: true
  $ docker-compose up -d # Docker Compose v1 (seperate command)
  # OR
  $ docker compose up -d # Docker Compose v2 (Docker CLI plugin)

Post Deployment

Visit http://:1337 to see the server.

Run Locally

  1. Clone the repository
  $ git clone https://gitlab.com/saharacorp/wkws.git
  # OR
  $ glab repo clone saharacorp/wkws

  $ cd wkws/
  1. Install dependencies
  $ go get -u -v ./...
  1. Build application
  $ go build -o out/production/WKWS/app main.go
  1. Run application
  $ cd out/production/WKWS/
  $ mkdir -p serve/
  $ ./app

Any files that are inside of the serve/ directory will be served on the webroot at http://localhost:1337.

FAQ

Are there any plans to add any more features?

We are trying to keep this project as light weight as possible, so no new features are planned.

License

This project is licensed under the BSD 3-Clause "New" or "Revised" License. The fulltext of the license can be found here.

Authors