Giter VIP home page Giter VIP logo

hostlify's People

Contributors

dmaretskyi avatar mj426382 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hostlify's Issues

Next steps

  • Re-use old comments instead of creating new ones
  • #11
  • Authorization for the api with API key
  • Add metadata to builds to be able to list them or automatically delete old ones
    • Add list endpoint
    • Add remove endpoint

Add a workflow to build an publish new image on every push to main

Example:

name: Release
on:
  release:
    types: [ created ]

jobs:
  build:
    name: Build docker image
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      - name: Build docker image
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          context: .
          file: ./Dockerfile
          push: true
          tags: .....

Deploy

  • Publish on GitHub container registry
  • Digital ocean deploy truefipreview.io 64.227.99.18
  • Read the domain name from env variable DOMAIN_NAME
    • Should use it in the config generation
    • For the proxy config as well
    • Re-generate configs on app start

Roadmap

Stage 1. Configure Nginx

  • Figure out how to test domains locally *.lvh.me
  • Serve 2 separate builds under different domains: build1.hostlify.local, build2.hostlify.local

Stage 2. API server

  • Create node api server with typescript, express (or something else?)
  • Make nginx forward api requests from root domain lvh.me to the API
  • Make api generate config
  • List all subdirectories in the repository directory
    • For each generate an nginx conf file that serves it under a proper subdomain
    • Include generated configs from the main config file
    • Add default404 nginx
  • Add /upload/:id route that uploads a new build to the repository
    • Place files in the proper direcotry
    • Regenerate config
    • Run command to reload nginx config nginx -s reload or docker exec <container id> nginx -s reload
    • Docker compose exec...
    • Return OK 201 Created { "url": "build123.lvh.me" }

Stage 3. Docker build

  • Build single docker image with nginx and node api server

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.