From a1c3ca029d09b3bbf0f3dc4f2959e94ade35176f Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 19 Apr 2019 19:00:41 +0900 Subject: [PATCH] Docker config is now in its own repository --- docker-compose.yml | 2 +- docker/README.md | 60 +++++++++++++++++++++ Dockerfile => docker/development.Dockerfile | 0 main.go | 3 -- ports.go | 33 ------------ 5 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 docker/README.md rename Dockerfile => docker/development.Dockerfile (100%) delete mode 100644 ports.go diff --git a/docker-compose.yml b/docker-compose.yml index e3712464..f01f2a6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ services: notify.moe: build: context: . + dockerfile: docker/development.Dockerfile network: host image: animenotifier/notify.moe hostname: docker @@ -10,7 +11,6 @@ services: tty: true network_mode: host ports: - - "80:4000" - "443:4001" volumes: - ~:/my \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..c85a5570 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,60 @@ +# animenotifier/notify.moe + +This is a fully pre-configured development environment for Anime Notifier development (notify.moe). + +## Getting Started + +### Prerequisities + +In order to run this container you'll need docker installed. + +* [Linux](https://docs.docker.com/linux/started/) +* [Mac](https://docs.docker.com/mac/started/) +* [Windows](https://docs.docker.com/windows/started) + +### Usage + +#### Download the image + +```shell +docker pull animenotifier/notify.moe +``` + +#### Boot up the dev environment + +Download the notify.moe repository to get access to the docker-compose configuration. Run the following inside the repository: + +```shell +docker-compose run notify.moe +``` + +#### Volumes + +* `/my` - Your home directory + +## Built With + +* Arch Linux +* Aero +* Git +* ...any many others. + +## Find Us + +* [Discord](https://github.com/animenotifier/notify.moe) +* [GitHub](https://github.com/animenotifier/notify.moe) + +## Contributing + +Please read [CONTRIBUTING.md](https://github.com/animenotifier/notify.moe/blob/go/CONTRIBUTING.md) for details on how to contribute to this project. + +## Authors + +* **Eduard Urbach** - [eduardurbach.com](https://eduardurbach.com) + +See also the list of [contributors](https://github.com/animenotifier/notify.moe/graphs/contributors) who +participated in this project. + +## License + +This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/animenotifier/notify.moe/blob/go/LICENSE) file for details. diff --git a/Dockerfile b/docker/development.Dockerfile similarity index 100% rename from Dockerfile rename to docker/development.Dockerfile diff --git a/main.go b/main.go index 3b49c81d..3f908f5d 100644 --- a/main.go +++ b/main.go @@ -55,9 +55,6 @@ func configure(app *aero.Application) *aero.Application { app.Config.Domain = "beta.notify.moe" app.Config.Title += " - Beta" app.Config.Manifest.Name = app.Config.Title - - // Test connectivity - app.OnStart(testConnectivity) } // Authentication diff --git a/ports.go b/ports.go deleted file mode 100644 index 26ea3bf5..00000000 --- a/ports.go +++ /dev/null @@ -1,33 +0,0 @@ -package main - -import ( - "crypto/tls" - "fmt" - "os" - "os/exec" - - "github.com/blitzprog/color" -) - -// testConnectivity will test if port 443 is accessible or not. -// If not, it will attempt to run "sudo make ports" and resume -// execution once the user has entered the password. -func testConnectivity() { - config := tls.Config{ - InsecureSkipVerify: true, - } - - _, err := tls.Dial("tcp", ":443", &config) - - if err != nil { - fmt.Println("--------------------------------------------------------------------------------") - color.Red("HTTPS port 443 is not accessible") - fmt.Println("Running", color.YellowString("make ports"), "to be able to access", color.GreenString("https://"+app.Config.Domain)) - - cmd := exec.Command("sudo", "make", "ports") - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - cmd.Stdin = os.Stdin - cmd.Run() - } -}