Giter VIP home page Giter VIP logo

staticdeploy's Introduction

CircleCI codecov


logo


StaticDeploy is an open-source platform for deploying and configuring static web applications and websites. We can think about it as a Kubernetes for static content.

StaticDeploy was created with two objectives in mind:

  • make it easy to configure a static app at runtime, as opposed to injecting the configuration into its static build

  • make it easy to deploy multiple "versions" of a static app, specifically a version for each branch / pull request, so that frontend developers can show their work-in-progress and get early feedback from their clients

For more information on StaticDeploy visit staticdeploy.io.

Projects

This is the StaticDeploy monorepo, which includes several different projects:

  • core: module implementing StaticDeploy's core business logic (entities, usecases, and gateway interfaces)
  • pg-s3-storages: gateway for storage resources backed by S3 and [PostgreSQL]
  • memory-storages: in-memory gateway for storage resources
  • storages-test-suite: test suite for storages
  • tar-archiver: implementation of the core IArchiver interface using tar
  • jwt-authentication-strategy: authentication strategy for authenticating requests with JWT tokens
  • oidc-authentication-strategy: authentication strategy for authenticating requests with OpenID Connect tokens
  • http-adapters: adapters that implement an http API for StaticDeploy's core usecases
  • serve-static: express middleware for serving files in a local directory
  • staticdeploy: main service pulling together the other modules and implementing the StaticDeploy platform
  • sdk: browser and nodejs SDK for StaticDeploy's API
  • cli: CLI tool to deploy static apps
  • management-console: web GUI for the API
  • website: landing page and documentation, deployed with StaticDeploy on staticdeploy.io

Contributing

See CONTRIBUTING.md.

staticdeploy's People

Contributors

davidebianchi avatar matteogll avatar pendulla avatar pscanf 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

staticdeploy's Issues

How to make storage persistent with docker?

I'm loving the potential for this project, however I can't seem to figure out where exactly all of the assets are stored in the docker container.

I'm trying to figure out where to mount a persistent storage volume to achieve this, could someone point me in the right direction?

Thanks!

Pretty 404 pages

Make static-server return an html page on 404s, with a description of the error (instead of just returning the error message as a string).

Validation error when creating bundles with custom headers specified via config file

Problem

Creating a bundle specifying headers in a config file like the following fails:

module.exports = {
  bundle: {
    headers: {
      "**/*": {
        "Cache-Control": "public"
      }
    }
  }
};

Cause

When supplying the headers option to yargs as an object (while the option is declared as a string), yargs transforms it in a way that makes the headers option invalid, which in turn causes the validation error when sending it to the backend.

Example transformation

The headers object from the example above becomes:

{
  "**/*": {
    "Cache-Control": "public"
  },
  "**/*CacheControl": "public"
}

Abandonware?

Not a single commit to this repository for at least three years. Repository is not deprecated. The lights are on, but is anyone home?

'name' and 'description' as option for command `bundle`

Hello,
This is some minor suggestion.

About following command:

staticdeploy bundle \
  --from website/demo-static-app \
  --name demo-static-app \
  --tag master \
  --description "version 1.0.0"

how about making name and description as option, and offer default value if not exists?
I think it can be generated automatically using from and tag...

Allow configuring canonical paths for `*.html` and `*/index.html` resources

Test case

GIven entrypoint + bundle:

{
    urlMatcher: "domain.com/",
    bundleContent: {
        asset: "domain.com/ + /asset",
        nested: {
            asset: "domain.com/ + /nested/asset",
            "index.html": "domain.com/ + /nested/index.html"
        },
        fallback: "domain.com/ + /fallback"
    },
    bundleFallbackAssetPath: "/fallback",
    bundleFallbackStatusCode: 200,
    bundleHeaders: {}
}

the test:

{
    requestedUrl: "domain.com/prefix/nested",
    expectedStatusCode: 301,
    expectedLocation: "/nested/index.html"
}

should pass or fail according to the canonical-path configuration (e.g. if / is configured as the canonical path, expectedLocation should be /nested/)

Dedicated module for common typings

Now everyone reads from - and therefore depends on - the storage module. So when installing the cli, the storage module is also installed, along with sqlite and other unnecessary things. This would be solved by having a dedicated module for common typings.

Allow relative fallback paths

Maintainer of rocky-linux/rockylinux.org here.

We're going to be moving our stuff from Vercel to a hosted instance of this tool, but one feature this seems to be missing that we needed from it has been routers.

In our repo, the file vercel.json contains this block:

  "routes": [
    { "handle": "filesystem" },
    { "src": "/zh-cn/(.*)", "status": 404, "dest": "/zh-cn/404.html" },
    { "src": "/zh-hk/(.*)", "status": 404, "dest": "/zh-hk/404.html" },
    { "src": "/fr/(.*)", "status": 404, "dest": "/fr/404.html" },
    { "src": "/de/(.*)", "status": 404, "dest": "/de/404.html" },
    { "src": "/es/(.*)", "status": 404, "dest": "/es/404.html" },
// ...
    { "src": "/(.*)",    "status": 404, "dest": "/404.html" }
  ],

All this basically does is tell Vercel to read from the filesystem, then fall back onto a number of static pages depending on where the user attempted to browse to. Basically, --fallbackAssetPath based on the current route.

If this could be implemented in StaticDeploy, it would seriously help us switch.

At the moment, we'd be forced to create multiple bundles with different fallback paths, which just is not feasible for the setup we want (automatic branch-based deployments and review deployments for PRs).

DNS Pointing

Hey there,

it's more than a question rather than a issue, regarding the setup of the DNS (Cloudflare) with the project. Basically I have setup the staticdeploy on my own domain, with

A.   STATIC.MY_DOMAIN.TLD    123.456.789.000

the project itself is setup with docker (compose) and is proxied over a caddy instance.

The problem I'm facing at the moment is that, that when deploying a site, I configure its entrypoint like this:

CNAME    SITE.MY_DOMAIN.TLD    STATIC.MY_DOMAIN.TLD

but the domain is not reachable and won't be opened to show the website. This problem is unfortunately not documented, so I thought about asking it here. An answer would be much appreciated

CLI unable to upload bundles larger than 10MB

When trying to upload a bundle larger than 10MB, axios throws a Request body larger than maxBodyLength limit error. This is caused by a 10MB limit on body length set by axios's dependency follow-redirects.

Handle OIDC JWKS rollover

Noticeable when using StaticDeploy with Azure Active Directory, that periodically rolls over signing keys, but could affect other providers.

Log invalid JWT

If I send an invalid string as a login key on the admin UI, currently I receive only a 401 status code, and nothing in the log (ecxept the usual request log). Took me an hour to realize that I have failed to copy the last character of my JWT 😅

There is a single return null; statement in the JWT authentication strategy, I think there would be easy to log something.

I don't know if this is a good idea (it might be used to abuse the service or something), but it would be helpful.

Thanks!

Bundle / deploy does not give error when using ui url as api

This is a fantastic tool that I had spent literally days looking for before finding this one!

Something that would improve the cli experience:

I accidentally used the ui url as the api url when first trying it and the cli returned success leading to some confusion. Providing an error message for this issue would make it easier for new users.

special characters in bundle tags messes with routing

Hello,

My tags names contain "/" (named after their related feature branch feature/featurename).
As a consequence
https://staticdeploy.mydomain.com/bundles/application/feature/featurename shows me "no data". But bundles are properly uploaded and can be used in any entrypoints I want.

Yet, if I manually url-encode the forward slash by replacing it with %2F, everything is fine and my bundles appeared to be properly listed. So I guess, bundle names should be url-encoded before being inserted into the navigation URL ?

destory/delete/teardown an app

Hi,

Huge fan of the tool, and will probably try to contribute this myself.
Just wonder is there a way to teardown an app via the CLI ?
Currently I am deploying static versions of our website based on PRs and I want to tear down the app on merge/close.

Thanks a lot for the amazing tool

Cross-origin request blocked when attempting OpenID connect authorization

When trying to login with using Gitlab as an OpenID Connect Provider, staticdeploy will replace the "Login with Gitlab" button with a network error message and the following error will be in the console.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://gitlab.com/.well-known/openid-configuration.
(Reason: CORS header ‘Access-Control-Allow-Origin’ missing)

When I deliberately mis-configure the OIDC_CONFIGURATION_URL variable so that it would 404 I still get the same error. So I don't believe it's an issue with Gitlab.

This is the docker-compose file that I'm using.

version: '3'

services:
  staticdeploy:
    image: staticdeploy/staticdeploy
    ports:
      - 80:80
    environment:
      MANAGEMENT_HOSTNAME: local.staticdeploy.io
      OIDC_CLIENT_ID: $OIDC_CLIENT_ID
      OIDC_CONFIGURATION_URL: https://gitlab.com
      OIDC_PROVIDER_NAME: GitLab

Common styling

Hello~
This is just a question about minor issue.

While reading a code, seems common styling rule is not adopt in the projects.

Because seems it recommends to use semi-colon at end of line, but several codes don't have it

Do you have plan for updates?

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.