diff --git a/README.md b/README.md index 4b3c4d30e..c59a43567 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,9 @@ But in a world where many were previously finding ways to rely on the big intern And as soon as people started streaming their DJ sets, movie watching parties, and themselves just sitting around listening to music the big companies came to mute their streams, remove their recordings or ban these users all together. -That's when I wanted a better option. Something you could run yourself and get all the functionality of these services, where you could live stream to an audience and and them take part in the chat, just like they've been used to on all the other services. But instead you run it, you won't get shut down, and you own it all. +That's when I wanted a better option for people. Something you could run yourself and get all the functionality of these services, where you could live stream to an audience and and allow them to take part in the chat, just like they've been used to on all the other services. But instead of handing control over to somebody else, you run it. **You won't get shut down, and you own it all, just like it should be.** + +I figured you can install Wordpress and self-host your blog, or install Megento and self-host your e-commerce site. You can install Icecast and have your own internet radio station. Spin up an instance of Mastodon and you have your own social media site that you control. You can even install Nextcloud and have your own personal productivity service replacing Dropbox and Google Docs. There's an open-source alternative to all the big services that you can run for almost everything, but I couldn't think of what the live video streaming equivalent was. **There should be a independent, standalone _Twitch in a Box_.** **Keep in mind that while streaming to the big social companies is always free, you pay for it with your identity and your data, as well as the identity and data of every person that tunes in. When you self-host anything you'll have to pay with your money instead. But running a self-hosted live stream server can be done for as cheap as $5/mo, and that's a much better deal than selling your soul to Facebook, Google or Amazon.** @@ -146,7 +148,7 @@ The following is a list of things, as long as there's some traction, I'd like to * Real web layout and chat UI is being worked on by [gingervitis](https://github.com/gingervitis). -* Utilizing non-Amazon owned, but still S3 compatible storage. There's so many services out there that are S3 compatible such as [Linode Object Storage](https://www.linode.com/products/object-storage/), [Wasabi](https://wasabi.com/what-is-wasabi/), [Google Storage](https://cloud.google.com/storage/), [DreamHost DreamObjects](https://www.dreamhost.com/cloud/storage/), or you can [even run your own](https://min.io/). So it's good to have options. +* Utilizing non-Amazon owned, but still S3 compatible storage. There's so many services out there that are S3 compatible such as [Linode Object Storage](https://www.linode.com/products/object-storage/), [Wasabi](https://wasabi.com/what-is-wasabi/), [Backblaze](https://www.backblaze.com/b2/cloud-storage-pricing.html), [Google Storage](https://cloud.google.com/storage/), [DreamHost DreamObjects](https://www.dreamhost.com/cloud/storage/), or you can [even run your own](https://min.io/). So it's good to have options. * Refactor chat so it's more controlled by the server and doesn't accept just anything from clients and relay it back to everyone. diff --git a/ffmpeg.go b/ffmpeg.go index d178ce993..63e7b063e 100644 --- a/ffmpeg.go +++ b/ffmpeg.go @@ -30,12 +30,6 @@ func startFfmpeg(configuration Config) { verifyError(err) } -func verifyError(e error) { - if e != nil { - panic(e) - } -} - func writePlaylist(data string, filePath string) { f, err := os.Create(filePath) defer f.Close() diff --git a/main.go b/main.go index bd7504058..18fd9855d 100644 --- a/main.go +++ b/main.go @@ -15,8 +15,6 @@ var server *Server var online = false func main() { - // resetDirectories() - var hlsDirectoryPath = configuration.PublicHLSPath log.Println("Starting up. Please wait...") diff --git a/utils.go b/utils.go index ad55fc84b..ce0a58656 100644 --- a/utils.go +++ b/utils.go @@ -1,55 +1,14 @@ package main import ( - "fmt" - "io/ioutil" - "log" "os" "path/filepath" - "time" ) -func resetDirectories() { - os.RemoveAll("hls") - os.MkdirAll("hls", 0777) -} - -func touch(fileName string) { - _, err := os.Stat(fileName) - if os.IsNotExist(err) { - file, err := os.Create("temp.txt") - if err != nil { - log.Fatal(err) - } - defer file.Close() - } else { - currentTime := time.Now().Local() - err = os.Chtimes(fileName, currentTime, currentTime) - if err != nil { - fmt.Println(err) - } - } -} - func getTempPipePath() string { return filepath.Join(os.TempDir(), "streampipe.flv") } -func copy(src, dst string) { - input, err := ioutil.ReadFile(src) - if err != nil { - fmt.Println(err) - return - } - - err = ioutil.WriteFile(dst, input, 0644) - if err != nil { - fmt.Println("Error creating", dst) - fmt.Println(err) - return - } -} - func fileExists(name string) bool { if _, err := os.Stat(name); err != nil { if os.IsNotExist(err) { @@ -58,3 +17,9 @@ func fileExists(name string) bool { } return true } + +func verifyError(e error) { + if e != nil { + panic(e) + } +}