A plugin which helps people signup with a code or referal code through a webpage for LogPass
PassMaker
PassMaker allows Server Owners to have people from their communities get their own LogPass Account in the server.
This plugin is dependent on the LogPass Plugin. This Plugin will NOT work without LogPass.
This makes a website that uses a code that the OPs can create and users can use to make their LogPass Account.
When First Setting Up Use
/pass token <token>In The Console
Commands for non OP
/pass referral or /refer — Only when referrals are enabled in config.yml - Gives the player a one time code so he can let another player use it on the web panel.
/pass referral remove or /refer remove — Doesn't care if referrals are enabled in config.yml - Deletes all of the users' referral codes.
Commands for Console or OP
/pass token <token> — Links the server to the sign-up worker if specified.
/pass maker <code> <uses|unlimited> — Create or update a sign-up code.
/pass maker_delete <code> — Delete a sign-up or referral code.
/pass maker reload — Re-loads config.yml and page.html.
Permissions
logpass.admin - gives a logpass user access to the /pass commands (including op)
Config
config.yml
# ----------------------------------------------------------------------
# Hosting option 1: the PassMaker site on Cloudflare
# ----------------------------------------------------------------------
cloudflare:
enabled: true
# Set with your own worker.js hosted url or use my hosted version.
# Create your own version https://github.com/Epiz-Studio/passmakerjs
url: "@CLOUDFLARE_URL@"
# Filled in for you by "/pass token <token>" - no need to edit by hand.
token: ""
server-id: ""
# How often this server asks the site for new sign-ups (seconds). It speeds up
# to the "active" rate by itself while someone is on your sign-up page.
idle-poll-seconds: 20
active-poll-seconds: 2
# ----------------------------------------------------------------------
# Referral codes
# ----------------------------------------------------------------------
# When true, players who are logged into a LogPass account can run
# /pass referral to get a random one-use code (like a Discord invite) to give a friend.
referral: false
# How many unused referral codes one account can hold at a time.
referral-max-unused: 3
# ----------------------------------------------------------------------
# Hosting option 2: serve the page from this server's own IP/port
# ----------------------------------------------------------------------
server:
# Serve the page on the SAME port/IP as the Minecraft server (no extra port
# needed). Needs a full server restart to change.
share-minecraft-port: false
# OPTIONAL: also listen on a separate port of its own (0 = off).
standalone-port: 0
standalone-bind: "0.0.0.0"
https:
# Also answer HTTPS (TLS) on the same port. Over plain HTTP the chosen
# password travels unencrypted.
enabled: true
# Keystore (PKCS12 or JKS) inside plugins/PassMaker/. Replace it with your
# own certificate to avoid browser warnings.
keystore-file: "keystore.p12"
keystore-password: "changeit"
# If the keystore doesn't exist yet, create a self-signed one with the JDK's keytool.
generate-self-signed: true
self-signed-hostname: "localhost"
signup:
username-min-length: 3
username-max-length: 16
# Usernames may only contain letters, numbers, _ and -
# The effective minimum password length is the larger of this and LogPass's
# own min-password-length.
password-min-length: 4
password-max-length: 64
# false = "welcome" and "WELCOME" are the same code (the cloud site always ignores case)
codes-case-sensitive: false
security:
# Local page only: after this many wrong codes from one IP, that IP is locked out.
max-failed-attempts: 5
lockout-seconds: 300
# Log every request to the console (for troubleshooting).
debug: false
# ----------------------------------------------------------------------
# Sign-up codes. Create them with /pass maker, or edit by hand.
# uses: how many sign-ups are left. 0 = unlimited.
# A code with limited uses is deleted automatically when it runs out.
# Code names may only contain letters, numbers, _ and - (max 64 characters)
# Example:
# WELCOME:
# uses: 10
# ----------------------------------------------------------------------
codes: {}
# ----------------------------------------------------------------------
# Local page customisation (the cloud site has its own look). For total
# control, edit plugins/PassMaker/page.html (delete it to get a fresh copy).
# Reload with /pass maker reload.
# ----------------------------------------------------------------------
web:
text:
title: "Create your account"
heading: "Join the server"
subheading: "Enter your sign-up code to create your login."
code-placeholder: "Sign-up code"
code-button: "Continue"
popup-title: "Choose your login"
popup-subtitle: "You'll use these with /login in-game."
username-label: "Username"
username-placeholder: "e.g. Steve_01"
password-label: "Password"
confirm-label: "Confirm password"
create-button: "Create account"
cancel-button: "Cancel"
success-title: "Account created!"
# {username} is replaced with the chosen username
success-text: "Join the server and type /login {username} <your password>"
mismatch-text: "The passwords don't match."
working-text: "Please wait..."
network-error-text: "Couldn't reach the server. Try again."
show-password: "Show"
hide-password: "Hide"
footer: ""
style:
background-color: "#12151c"
card-color: "#1c212b"
accent-color: "#4f9cf9"
text-color: "#e8ecf3"
muted-color: "#8b95a7"
font-family: "system-ui, -apple-system, Segoe UI, Roboto, sans-serif"
# Full image URL, or "" for none
background-image: ""
# One emoji used as the browser tab icon
favicon-emoji: "🔑"
# Extra CSS appended to the page
custom-css: ""
# Messages shown to players (on both the local page and the cloud site).
# {min} / {max} are filled in automatically.
messages:
invalid-code: "That code isn't valid."
invalid-username: "Usernames must be {min}-{max} characters: letters, numbers, _ or -."
username-taken: "That username is already taken."
password-too-short: "Password must be at least {min} characters."
password-too-long: "Password can be at most {max} characters."
invalid-password: "Passwords can't contain spaces or control characters."
rate-limited: "Too many wrong codes. Try again in a few minutes."
server-busy: "The server is busy - try again in a moment."
create-failed: "Something went wrong creating the account. Please tell an admin."
bad-request: "Invalid request."
page.html
Only use if you serve directly from the server and not via a worker.
<!DOCTYPE html>
<!--
PassMaker page template. Every {{TOKEN}} is filled in from config.yml (web.text / web.style).
Edit this file freely - just keep the element ids (code, codeForm, accForm, ...) the script uses.
Delete this file to get a fresh copy on the next start. Apply changes with /pass maker reload.
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{TITLE}}</title>
<link rel="icon" href="{{FAVICON}}">
<style>
:root{--bg:{{COLOR_BG}};--card:{{COLOR_CARD}};--accent:{{COLOR_ACCENT}};--text:{{COLOR_TEXT}};--muted:{{COLOR_MUTED}};--font:{{FONT}}}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
body{background:var(--bg);background-image:{{BG_IMAGE}};background-size:cover;background-position:center;color:var(--text);font-family:var(--font);display:flex;align-items:center;justify-content:center;min-height:100vh;padding:20px}
.card{background:var(--card);border-radius:16px;padding:32px 28px;width:100%;max-width:420px;box-shadow:0 12px 40px rgba(0,0,0,.35)}
h1{margin:0 0 6px;font-size:1.6rem}
h2{margin:0 0 4px;font-size:1.3rem}
.sub{margin:0 0 22px;color:var(--muted);font-size:.95rem}
label{display:block;font-size:.85rem;color:var(--muted);margin:14px 0 6px}
input{width:100%;padding:12px 14px;border-radius:10px;border:1px solid rgba(255,255,255,.12);background:rgba(0,0,0,.25);color:var(--text);font:inherit;font-size:1rem;outline:none}
input:focus{border-color:var(--accent)}
button{font:inherit;cursor:pointer}
.primary{width:100%;margin-top:18px;padding:12px;border:0;border-radius:10px;background:var(--accent);color:#fff;font-weight:600;font-size:1rem}
.primary:disabled{opacity:.6;cursor:wait}
.ghost{width:100%;margin-top:10px;padding:10px;border:0;border-radius:10px;background:transparent;color:var(--muted)}
.err{min-height:1.2em;margin:12px 0 0;color:#ff7b7b;font-size:.9rem}
.foot{margin:18px 0 0;text-align:center;color:var(--muted);font-size:.8rem}
.foot:empty{display:none}
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;padding:20px;z-index:10}
.overlay[hidden]{display:none}
.modal{position:relative;background:var(--card);border-radius:16px;padding:28px;width:100%;max-width:400px;box-shadow:0 16px 50px rgba(0,0,0,.5)}
.x{position:absolute;top:10px;right:14px;border:0;background:none;color:var(--muted);font-size:1.6rem;line-height:1}
.pw{position:relative}
.pw input{padding-right:70px}
.pw button{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:0;background:none;color:var(--accent);font-size:.85rem;padding:6px 8px}
[hidden]{display:none!important}
{{CUSTOM_CSS}}
</style>
</head>
<body>
<main class="card">
<h1>{{HEADING}}</h1>
<p class="sub">{{SUBHEADING}}</p>
<form id="codeForm" autocomplete="off">
<input id="code" name="code" maxlength="64" placeholder="{{CODE_PLACEHOLDER}}" autocapitalize="off" autocorrect="off" spellcheck="false" required>
<button id="codeBtn" class="primary" type="submit">{{CODE_BUTTON}}</button>
<p id="codeErr" class="err" role="alert"></p>
</form>
<p class="foot">{{FOOTER}}</p>
</main>
<div id="overlay" class="overlay" hidden>
<div class="modal" role="dialog" aria-modal="true" aria-labelledby="popupTitle">
<button id="close" class="x" type="button" aria-label="Close">×</button>
<div id="stepForm">
<h2 id="popupTitle">{{POPUP_TITLE}}</h2>
<p class="sub">{{POPUP_SUBTITLE}}</p>
<form id="accForm" autocomplete="off">
<label for="username">{{USERNAME_LABEL}}</label>
<input id="username" name="username" maxlength="32" placeholder="{{USERNAME_PLACEHOLDER}}" autocapitalize="off" autocorrect="off" spellcheck="false" required>
<label for="password">{{PASSWORD_LABEL}}</label>
<div class="pw"><input id="password" name="password" type="password" maxlength="128" autocomplete="new-password" required><button id="toggle" type="button">{{SHOW_TEXT}}</button></div>
<label for="confirm">{{CONFIRM_LABEL}}</label>
<input id="confirm" name="confirm" type="password" maxlength="128" autocomplete="new-password" required>
<p id="accErr" class="err" role="alert"></p>
<button id="accBtn" class="primary" type="submit">{{CREATE_BUTTON}}</button>
<button id="cancel" class="ghost" type="button">{{CANCEL_BUTTON}}</button>
</form>
</div>
<div id="stepDone" hidden>
<h2>{{SUCCESS_TITLE}}</h2>
<p id="doneText" class="sub"></p>
</div>
</div>
</div>
<div id="cfg" hidden data-mismatch="{{MISMATCH_TEXT}}" data-working="{{WORKING_TEXT}}" data-network="{{NETWORK_ERROR_TEXT}}" data-success="{{SUCCESS_TEXT}}" data-show="{{SHOW_TEXT}}" data-hide="{{HIDE_TEXT}}" data-create="{{CREATE_BUTTON}}" data-go="{{CODE_BUTTON}}"></div>
<script>
(function () {
var $ = function (id) { return document.getElementById(id); };
var cfg = $('cfg').dataset;
var code = '';
function post(path, data) {
return fetch(path, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams(data).toString(),
cache: 'no-store'
}).then(function (r) { return r.json(); })
.catch(function () { return { ok: false, error: cfg.network }; });
}
function busy(btn, on, label) { btn.disabled = on; btn.textContent = on ? cfg.working : label; }
function openPopup() {
$('overlay').hidden = false;
$('stepForm').hidden = false;
$('stepDone').hidden = true;
$('accErr').textContent = '';
setTimeout(function () { $('username').focus(); }, 50);
}
function closePopup() {
$('overlay').hidden = true;
$('password').value = '';
$('confirm').value = '';
}
$('codeForm').addEventListener('submit', function (e) {
e.preventDefault();
$('codeErr').textContent = '';
busy($('codeBtn'), true, cfg.go);
post('/api/check', { code: $('code').value.trim() }).then(function (j) {
busy($('codeBtn'), false, cfg.go);
if (j.ok) { code = $('code').value.trim(); openPopup(); }
else { $('codeErr').textContent = j.error || ''; }
});
});
$('accForm').addEventListener('submit', function (e) {
e.preventDefault();
$('accErr').textContent = '';
if ($('password').value !== $('confirm').value) { $('accErr').textContent = cfg.mismatch; return; }
var name = $('username').value.trim();
busy($('accBtn'), true, cfg.create);
post('/api/create', { code: code, username: name, password: $('password').value }).then(function (j) {
busy($('accBtn'), false, cfg.create);
if (j.ok) {
$('doneText').textContent = cfg.success.split('{username}').join(name);
$('stepForm').hidden = true;
$('stepDone').hidden = false;
$('password').value = '';
$('confirm').value = '';
$('code').value = '';
code = '';
} else { $('accErr').textContent = j.error || ''; }
});
});
$('toggle').addEventListener('click', function () {
var show = $('password').type === 'password';
$('password').type = show ? 'text' : 'password';
$('confirm').type = show ? 'text' : 'password';
$('toggle').textContent = show ? cfg.hide : cfg.show;
});
$('close').addEventListener('click', closePopup);
$('cancel').addEventListener('click', closePopup);
document.addEventListener('keydown', function (e) { if (e.key === 'Escape') closePopup(); });
})();
</script>
</body>
</html>
Hosted Worker.js
You can make your own worker with CloudFlare for free. Docs: https://github.com/Epiz-Studio/passmakerjs
I have made 2 workers that you can use: (they may not be reliable when more than 20 servers are connected at a time.)
https://passmaker.epizstudio.workers.dev https://get.passmaker.workers.dev
Support: https://discord.gg/A6kg7bpdba
PassMaker Email: [email protected]
Information
Pinned Versions
- R26.3
Pages
Members
1Owner