Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Juno Website Hosting #917

Closed
wants to merge 4 commits into from
Closed

Juno Website Hosting #917

wants to merge 4 commits into from

Conversation

Reecepbcups
Copy link
Contributor

@Reecepbcups Reecepbcups commented Dec 16, 2023

smart contract required
really rough draft, not prod ready at all

Demo: https://x.com/Reecepbcups_/status/1735844874404892808

Webhost contract: https://github.com/Reecepbcups/cw-webhost

Reecepbcups added a commit to Reecepbcups/cw-webhost that referenced this pull request Dec 16, 2023
@dimiandre
Copy link
Member

Cool concept!

@Reecepbcups
Copy link
Contributor Author

Reecepbcups commented Jan 2, 2024

The following is a local example that serves the zip files as expected. Something with the 1317 API does not like serving the images and other nested content due to the need for http.FileServer(http.FS...))

With ZIP files we can embed standard CSS, JS, and images all in 1 & serve via an open port on the full node

Should load the zip files on request into memory from the contract, but never actually save to zip file to disk

package main

import (
	"archive/zip"
	"log"
	"net/http"
)

func main() {
	// h := Handler()
	// http.HandleFunc("/webhost", h)
	// http.ListenAndServe(":8080", nil)

	filename := "/home/reece/Desktop/webhost/new.zip"
	if filename == "" {
		panic("need a path to a zip file")
	}
	zr, err := zip.OpenReader(filename)
	if err != nil {
		panic(err)
	}
	defer zr.Close()
	const addr = ":8080"
	log.Printf("see http://%s/", addr)

	http.ListenAndServe(addr, http.FileServer(http.FS(zr)))

}

* Add Zip File Integration (CW WIP)

* Remove Write Header

* Hook Into Contract For Zip Support,
Add Python Script for Easy Upload,
Add Demo Website Zip

* Update Error Handling & Debug Msgs

* Code Cleanup & Refactoring

* Limit File Sizes & Lint

* Update app/webhost/_scripts.sh

* Update app/webhost/_scripts.sh

* Update app/webhost/_scripts.sh

---------

Co-authored-by: Reece Williams <31943163+Reecepbcups@users.noreply.github.com>
@faddat
Copy link
Contributor

faddat commented Mar 1, 2024

this is sensible and good and Juno herself should host her website. Not others.

@Reecepbcups
Copy link
Contributor Author

Charter people are against feature upgrades. It will not be getting in.

@Reecepbcups Reecepbcups closed this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants