Go to file
Dmitry Miasnenko bc8fd6de9c
Update docker-compose.yml
Fix #19 and keep postgres version
2024-01-28 23:17:33 +03:00
.github/workflows Fully implemented cors. Added testing and make them more structural 2023-11-13 15:50:32 +03:00
assets Fully implemented cors. Added testing and make them more structural 2023-11-13 15:50:32 +03:00
entity Added cors layer. Added entity and migrations to store origins. Added endpoints for manipulation origins. Automatically clear origins on teardown and upload implemented. Added endpoints spec to openapi.yml. Untested 2023-11-06 01:05:48 +03:00
migration Added cors layer. Added entity and migrations to store origins. Added endpoints for manipulation origins. Automatically clear origins on teardown and upload implemented. Added endpoints spec to openapi.yml. Untested 2023-11-06 01:05:48 +03:00
nginx-templates journey starts here 2023-10-25 18:08:11 +03:00
src First implementation with mime_guess 2023-11-16 14:20:40 +03:00
tests Fully implemented cors. Added testing and make them more structural 2023-11-13 15:50:32 +03:00
.dockerignore journey starts here 2023-10-25 18:08:11 +03:00
.gitignore Fully implemented cors. Added testing and make them more structural 2023-11-13 15:50:32 +03:00
Cargo.toml First implementation with mime_guess 2023-11-16 14:20:40 +03:00
CODE_OF_CONDUCT.md Create code of conduct 2023-11-01 21:30:30 +03:00
docker-compose.yml Update docker-compose.yml 2024-01-28 23:17:33 +03:00
Dockerfile journey starts here 2023-10-25 18:08:11 +03:00
LICENSE LICENSE added 2023-11-02 21:04:30 +03:00
logo.svg journey starts here 2023-10-25 18:08:11 +03:00
openapi.yml Rewritten cors check closure to tokio spawn with channels 2023-11-08 16:50:50 +03:00
readme.md add CORS feature 2023-11-13 17:25:55 +03:00


Logo

sero

Lightning-fast, static web publishing with zero configuration and full control

Postgres Rust Docker Nginx

License

📖 Table Of Contents

🔧 Tools

Sero - this tool is used to upload your site to sero servers

About The Project

This project is essentially a revamp of the well-known surge.sh platform. While surge.sh is a fantastic tool for publishing web applications, I noticed it lacked certain features that could significantly enhance its utility. Therefore, I decided to create my own version, incorporating those missing elements to provide a more comprehensive and seamless user experience.

One key feature that it is self-hosted. This gives users more flexibility and control over their projects, allowing them to truly make their work their own. My goal with this project is to create a platform that not only meets but exceeds the needs of web developers, making the process of publishing web applications as hassle-free and efficient as possible. It also has some features that are not in surge.sh

So saying shortly this is a simple web server for static websites but with an ability to deploy it with custom subdomain without any configuration using cli tool. On upload it will automatically create subdomain for your site.

This is a cli tool for upload tool

🚀 Features

  • Deploy in seconds without configuration
  • Enable and disable site new
  • Download site new
  • Limits control new
  • Easy upload with cli tool
  • Custom 404.html (on 404 status user will see your 404.html)
  • Custom 503.html new (on disabled site)
  • Clean urls
  • CORS

🔌 Built With

⌨️ Getting Started

Prerequisites

That is what you will need to deploy this project

  • You need to buy a domain
  • You need a server
  • You need access to DNS records
  • You need to have docker-compose installed

Installation

Clone this repository

git clone https://github.com/clowzed/sero

✏️ Configure DNS records

  • Add wildcard subdomain to your server.

It is usually done by adding TXT DNS record with value "*" pointing to your server

✏️ Configure docker-compose.yml

Simply open a docker-compose.yml file from this repo with any redactor you link

  1. Configure your domain and zone (for example I bought example.com) (lines 30 and 31)
environment variable description
DOMAIN example
ZONE com
  1. Configure desired limits if you want (you can skip this)
environment variable description already set
MAX_USERS Maximum amount of users to be registered 1
MAX_SITES_PER_USER Maximum amount of sites which each user can upload 100
MAX_BODY_LIMIT_BYTES Maximum body limit in bytes 10000000 (10mb)

🚀 Deploy

docker-compose up -d

Usage

Let see an example of uploading your site to your sero server.

Consider our domain is awesome.com

Installing cli tool

npm i -g @clowzed/sero

🆕 Creating and initializing folder

mkdir our-website
cd our-website
sero init # This will generate default sero.toml file

🆕 Creating index.html

echo "Hello from our website!" > index.html

🔍 Inspecting sero.toml

Tha is how default sero.toml file looks like

[credentials]
username = "clowzed" # Here will be your hostname
password = ""

[server]
url = "http://sero.com/" 
subdomain = "clowzed"

[cors]
origins = []

✏️ Changing sero.toml

So now we need to change url to point to our server.

We also want to change subdomain for our website

[credentials]
username = "clowzed"
password = ""

[server]
url = "http://awesome.com/" 
subdomain = "oursite"

[cors]
origins = ["*"] # list of origins you trust

⬆️ Registration and uploading

sero register # We need to call it this only if we've changed username
sero upload

Now your site is available at http://oursite.awesome.com/index.html

Advanced usage with new features

  1. Disabling site new

You can disable your site using this command.

sero disable

This will preserve your subdomain so other users will not be able to borrow it. This will return 503 status code for any request to site with your subdomain. You can create 503.html file so it will be returned to user. You can do it for maintenance. The 503.html file should be at root of your folder

  1. You can enable site with this command. Now it will work as usual. new
sero enable
  1. Download your site new

You can easily download your site as zip with this command

sero download
  1. Delete your site and free subdomain
sero teardown

📍 Roadmap

See the open issues for a list of proposed features (and known issues).

🧑‍🤝‍🧑 Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.
  • Please also read through the Code Of Conduct before posting your first idea as well.

Creating A Pull Request

  1. Fork the Project
  2. Create your feature Branch (git checkout -b feature/some)
  3. Commit your changes (git commit -m 'implementation of some feature')
  4. Push to the branch (git push origin feature/some)
  5. Open a Pull Request

License

Distributed under the MIT License

Authors

  • clowzed