Compare commits

..

4 Commits

29 changed files with 9467 additions and 375 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
npm-debug.log

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# ignore the node_modules directory since this can be automatically generated
node_modules/
# ignore the generated CSS files (source files are SASS)
public/css/

View File

@ -1,26 +0,0 @@
pipeline:
build:
image: jekyll/jekyll:4
environment:
- JEKYLL_ROOTLESS=1
commands:
- mkdir _site
- jekyll build -s src/ --disable-disk-cache
deploy:
image: appleboy/drone-scp
settings:
host:
- www3.int.metaunix.net
- www4.int.metaunix.net
user: xadmin
port: 22
password:
from_secret: ssh_password
command_timeout: 2m
target: /var/www/mc.bitgoblin.tech
source: ./_site/*
rm: True
strip_components: 1
when:
event: tag

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM node:16.8
WORKDIR /usr/src/minecraft-website
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run gulp sass
# expose node_modules as a volume so it stays within the container
VOLUME node_modules
EXPOSE 3000
CMD [ "npm", "run", "server" ]

View File

@ -1,3 +1,13 @@
# minecraft-website
# Bit Goblin <3 Minecraft
The source code for Bit Goblin's Minecraft info website
**This is not "Microsoft <3 Linux"... this is for real!**
The source code for Bit Goblin's Minecraft info website, built with express.js. I know the framework is rather old at this point, but who cares? It's stable and works well enough to serve a mostly static website.
Anyways, this is basically a simple website that displays the current Minecraft server info for the Bit Goblin community. This was originally made with Jekyll, but I had an idea for a cool little active players counter that required this be dynamically generated... or I could've used some javascript AJAX requests but no one wants that if it's not really necessary.
Feel free to clone this repository and get hacking on it! It's really nothing special but any help making the site better for the community or whatever will be greatly appreciated!
Featured in this repository are some scripts under `bin/` which will make your life easier if you wish to hack on this thing. Assuming your user has access to Docker, then you can simply run a `bin/docker-watch.sh` to get running with a simple node.js container that installs all dependencies and even watches for changes in the local directory (thank you nodemon!).
This code is open-source and available to all under the Apache license 2.0. All contributions to this codebase shall be made under the current license, and any future licenses this repository may change to. (e.g. if I decide to change to the BSD 2-Clause license, all code will then be under the BSD 2-Clause license)

61
assets/sass/camelot.sass Normal file
View File

@ -0,0 +1,61 @@
body
background: black
color: #eee
font-size: 16px
a
color: #2ecc71
text-decoration: none
transition: color 300ms ease-in-out
&:hover
color: darken(#2ecc71, 10%)
table
box-sizing: border-box
width: 100%
border: none
tr
&:not(:last-child)
td
border-bottom: 1px solid white
td
border: none
&:not(:last-child)
border-right: 1px solid white
#background-image
position: fixed
left: 0
top: 0
z-index: -1
width: 100%
max-height: 100%
// Add blur effect
filter: blur(5px) grayscale(30%) brightness(95%)
-webkit-filter: blur(5px) grayscale(30%) brightness(95%)
#main-container
max-width: 1050px
margin-top: 30px
margin-bottom: 50px
padding: 25px 45px
background: #333
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)
#main-header
margin-bottom: 40px
.server-info
h3
text-align: center
text-decoration: underline
td
font-size: 2rem
#site-links
h5
font-weight: bold
text-decoration: underline
ul
list-style: none
font-size: 2rem

3
bin/docker-build-dev.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
docker build -t minecraft-website .

3
bin/docker-run-dev.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
docker run -d --rm -p 3000:3000 -v "$(pwd)":/usr/src/minecraft-website --name minecraft-website minecraft-website

View File

@ -1,8 +0,0 @@
#!/bin/sh
docker run -d --rm \
--volume="$PWD/src:/srv/jekyll" \
--publish 4000:4000 \
--name="jekyll" \
jekyll/jekyll:4 \
jekyll serve

20
gulpfile.js Normal file
View File

@ -0,0 +1,20 @@
'use strict';
var gulp = require('gulp');
var sass = require('gulp-dart-sass');
// compile SASS stylesheets
function stylesheets() {
return gulp.src('./assets/sass/*.sass')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./public/css'));
}
// watch for assets that need compiling
function watch() {
gulp.watch('./assets/sass/*.sass', stylesheets);
}
// export commands
exports.sass = stylesheets;
exports.watch = watch;

9235
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "minecraft-website",
"description": "**This is not \"Microsoft <3 Linux\"... this is for real!**",
"version": "0.1.0",
"main": "server.js",
"scripts": {
"server": "node server.js",
"gulp": "gulp"
},
"repository": {
"type": "git",
"url": "gitea@git.metaunix.net:bitgoblin/minecraft-website.git"
},
"author": "Gregory Ballantine <gballantine@bitgoblin.tech>",
"license": "Apache-2.0",
"dependencies": {
"express": "^4.17.1",
"pug": "^3.0.2"
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-dart-sass": "^1.0.2"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

3
routes/site.js Normal file
View File

@ -0,0 +1,3 @@
exports.index = function(req, res){
res.render('index');
};

27
server.js Normal file
View File

@ -0,0 +1,27 @@
const express = require('express');
const app = express();
const port = 3000;
// load routes
var siteRoutes = require('./routes/site');
// load template engine
app.set('views', './views');
app.set('view engine', 'pug');
// logging middleware
app.use((req, res, next) => {
console.log(`${req.method}: ${req.url}`);
next();
});
// serve static files from the public/ directory
app.use(express.static('public'));
// register routes
app.get('/', siteRoutes.index);
// start the express.js server
app.listen(port, () => {
console.log(`Server started at port ${port}`);
});

5
src/.gitignore vendored
View File

@ -1,5 +0,0 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor

View File

@ -1,25 +0,0 @@
---
permalink: /404.html
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>

View File

@ -1,29 +0,0 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.2.0"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

View File

@ -1,89 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorator (1.1.0)
concurrent-ruby (1.1.9)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
execjs (2.8.1)
ffi (1.15.3)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jekyll (4.2.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-coffeescript (2.0.0)
coffee-script (~> 2.2)
coffee-script-source (~> 1.12)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.3)
rouge (3.26.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)
PLATFORMS
x86_64-linux-musl
DEPENDENCIES
jekyll (~> 4.2.0)
jekyll-coffeescript
jekyll-feed (~> 0.12)
minima (~> 2.5)
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.1)
BUNDLED WITH
2.2.24

View File

@ -1,21 +0,0 @@
# Welcome to Jekyll!
title: Bit Goblin Community Minecraft Server
email: gballantine@bitgoblin.tech
description: >-
Server info for the Bit Goblin community Minecraft server
baseurl: "/"
url: "https://mc.bitgoblin.tech"
permalink: '/:year/:month/:day/:title:output_ext'
links:
bitgoblin: 'https://www.bitgoblin.tech'
youtube_channel: 'https://youtube.com/BitGoblin'
forum: 'https://forum.bitgoblin.tech'
# Build settings
plugins:
- jekyll-feed
sass:
sass_dir: assets/styles
style: compressed

View File

@ -1,25 +0,0 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ page.title }}</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">
<link rel="stylesheet" href="/assets/stylesheets/falador.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="/assets/scripts/rimmington.js"></script>
</head>
<body>
<div class="container">
<header class="row">
<div class="columns twelve">
<img src="https://i.imgur.com/XJQoBDx.png" alt="Minecraft logo" class="u-max-full-width">
</div>
</header>
<!-- main content -->
{{ content }}
</div>
</body>
</html>

View File

@ -1,24 +0,0 @@
---
layout: default
---
<div class="row">
<div class="card columns four">
{{ content }}
</div>
<div class="card columns four">
<p>Welcome to the official website for the Bit Goblin community Minecraft server. Anyone who wants to play here may play, and any future additions of worlds/realms will be noted here.</p>
<p>The only rule in play is to "be excellent to each other", but this will be revised as necessary.</p>
</div>
<div class="card columns four">
<h4>Bit Goblin Sites:</h4>
<ul class="other-sites">
<li><a href="https://www.bitgoblin.tech">Bit Goblin</a></li>
<li><a href="https://youtube.com/BitGoblin">YouTube</a></li>
<li><a href="https://forum.bitgoblin.tech">Forum</a></li>
</ul>
</div>
</div>

View File

@ -1,7 +0,0 @@
---
layout: default
---
This is a page layout.
{{ content }}

View File

@ -1,7 +0,0 @@
---
layout: default
---
This is a post layout.
{{ content }}

View File

@ -1,29 +0,0 @@
---
layout: post
title: "Welcome to Jekyll!"
date: 2021-08-22 01:05:59 -0500
categories: jekyll update
---
Youll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
Jekyll requires blog post files to be named according to the following format:
`YEAR-MONTH-DAY-title.MARKUP`
Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit numbers, and `MARKUP` is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekylls GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/

View File

@ -1,6 +0,0 @@
---
---
$(document).ready(function() {
console.log('Test.');
});

View File

@ -1,50 +0,0 @@
---
---
body{
background: #000;
color: #eee;
font-size: 16px;
}
a{
color: #2ecc71;
text-decoration: none;
transition: color 300ms ease-in-out;
&:hover{
color: darken(#2ecc71, 10%);
}
}
table{
box-sizing: border-box;
width: 100%;
border: none;
tr{
&:not(:last-child){
td{
border-bottom: 1px solid white;
}
}
td{
border: none;
&:not(:last-child){
border-right: 1px solid white;
}
}
}
}
.card{
background: #212121;
padding: 15px 25px;
h4{
text-decoration: underline;
}
}
.other-sites{
list-style: none;
font-size: 3rem;
}

View File

@ -1,22 +0,0 @@
---
layout: home
---
#### Server #1
| --- | --- |
| Address | mc1.bitgoblin.tech |
| Port | 25565 |
| Version | 1.18.2 |
| Mode | Survival |
| Mods? | None (Vanilla) |
#### Server #2
| --- | --- |
| Address | mc2.bitgoblin.tech |
| Port | 25566 |
| Version | 1.18,2 |
| Mode | Survival |
| Mods? | None (Vanilla) |

55
views/index.pug Normal file
View File

@ -0,0 +1,55 @@
doctype=html
html
head
meta(name='viewport' content='width=device-width, initial-scale=1.0')
title Minecraft @ Bit Goblin
link(rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css')
link(rel='stylesheet' href='/css/camelot.css')
body
img#background-image(src='/img/minecraft-landscape-1.png')
div#main-container.container
header#main-header.row
.columns.twelve
img.u-max-full-width(src='https://i.imgur.com/XJQoBDx.png' alt='Minecraft java edition logo')
section.row
p Welcome to the Bit Goblin community Minecraft server! This is hosted free-of-charge for anyone who so pleases. I'm open to expanding how many/what servers are being hosted, so be sure to let me know any additions/changes you think should be made!
p The only rules for the server(s) are as follows: "Be excellent to each other." So go out and have fun, but please don't be a jerk!
hr
section.row
article.server-info.columns.twelve
h3 Server Info
table
tbody
tr
td Address
td mc1.bitgoblin.tech
tr
td Port
td 25565
tr
td Version
td 1.17.1
tr
td Mode
td Survival
tr
td Server Type
td Vanilla
hr
footer#main-footer.row
.columns.six
p Hosted by Bit Goblin, with love.
#site-links.columns.six
h5 Other Bit Goblin sites:
ul
li #[a(href='https://www.bitgoblin.tech') Main Website]
li #[a(href='https://youtube.com/BitGoblin') YouTube]
li #[a(href='https://twitch.tv/brotherballan') Twitch]