Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Update Docker stuff (thanks Snoot) and fix patch site
Browse files Browse the repository at this point in the history
  • Loading branch information
larsenv committed Aug 11, 2018
1 parent ead93ec commit dd6affa
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 57 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
# Clean packages
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && apt-get clean

# Pre-download listed dependencies to take
# advantage of Docker cache.
RUN mkdir -p /go/src/Mail-Go
WORKDIR /go/src/Mail-Go
COPY get.sh /go/src/Mail-Go
# We use Disconnnect24 as the name is hardcoded into patch's source code.
WORKDIR /go/src/github.com/Disconnect24/Mail-Go
COPY get.sh /go/src/github.com/Disconnect24/Mail-Go
RUN sh get.sh

# Copy the entire Mail-Go source into builder's source.
COPY . .
# Copy needed parts of the Mail-Go source into builder's source,
COPY *.go ./
COPY patch patch

RUN go get ./...

# Build to name "app".
RUN GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app .

# Wait until there's an actual MySQL connection we can use to start.
# CMD ["dockerize", "-wait", "tcp://database:3306", "-timeout", "60s", "/go/src/Mail-Go/app"]
CMD ["/app"]
CMD ["dockerize", "-wait", "tcp://127.0.0.1:3306", "-timeout", "60s", "/go/src/github.com/Disconnect24/Mail-Go/app"]
24 changes: 4 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
version: "3"

services:
database:
image: disconnect24/docker-alpine-mariadb
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "true"
MYSQL_USER: rc24
MYSQL_PASSWORD: changeme
ports:
# Container 80 -> Host 8080
- "3306:3306"
volumes:
- mail_data:/var/lib/mysql
- ./schema/:/docker-entrypoint-initdb.d/:ro
mail:
build: .
# Mail-Go runs in /, and it looks for config in the current dir. Hence /config
volumes:
- ./config:/config
- ./config:/go/src/github.com/Disconnect24/Mail-Go/config
ports:
# Container 80 -> Host 8080
- "8080:80"
# We must wait for the DB to import/etc before starting ourselves.
depends_on:
- "database"
restart: on-failure

restart: on-failure
network_mode: "host"
volumes:
mail_data:
mail_data:
Binary file removed patch/site/DC24logo.png
Binary file not shown.
64 changes: 36 additions & 28 deletions patch/site/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Disconnect24 Patcher</title>
<style type="text/css">
.default {
font-family: Gill Sans, Gill Sans MT, Myriad Pro, DejaVu Sans Condensed, Helvetica, Arial, sans-serif;
text-align: center;
color: #FFFFFF;
background-color: black
}
</style>
<title>RiiConnect24 Mail</title>
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.blue-teal.min.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<body class="default">
<div/>
<h1>Disconnect24 Mail</h1>
<p><img src="DC24logo.png" width="531" height="187" alt=""/>
</p>
<h2>Mail Patcher v1.2</h2>
<h3>This time it actually works.™</h3>
<p>Upload your nwc24msg.cfg below to register your Wii.</p>
<form action="/patch" method="post" enctype="multipart/form-data" class="dropzone">
<div class="default">
<input type="file" name="uploaded_config" class="textB"/><span class="textB"><br/><br/>
</span>
<input class="textB" type="submit" value="Upload and Patch!"/><span class="textB">
</span>
</div>
<h4>Recommendation: You should use the Disconnect24 Patcher at:</h4>
<h5>https://github.com/Disconnect24/dc24-channel/releases</h5>
</form>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">RiiConnect24 Mail</span>
<div class="mdl-layout-spacer"></div>
<nav class="mdl-navigation">
<a class="mdl navigation__link" style="color:white; text-decoration: none;" href="https://rc24.xyz">Home</a>
<a class="mdl-navigation__link" href="#patch">Patch!</a>
</nav>
</div>
</header>

<main class="mdl-layout__content">
<div class="page-content">
<div id="patch">
<h3>Patch:</h3>
<h4>Please submit your config with the form; we'll register you right away!</h4>
<form action="/patch" method="post" enctype="multipart/form-data" class="dropzone">
<input type="file" name="uploaded_config">
<br/>
<br/>
<input class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent" type="submit" value="Upload and Patch!">
</form>
<br/>
<p>Recommendation: You should use the Mail Patcher that runs as Wii homebrew, <a href="https://github.com/RiiConnect24/Mail-Patcher/releases">click here for the link</a>. Only use this patcher if you are experiencing a problem using the app.</p>
</div>
</main>

<!-- Begin Footer -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
</body>

</html>

0 comments on commit dd6affa

Please sign in to comment.