@lamalibre/create-portlama 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md
CHANGED
|
@@ -98,3 +98,20 @@ The **licensor** is the individual or entity offering these terms, and the **sof
|
|
|
98
98
|
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
99
99
|
|
|
100
100
|
**Use** means anything you do with the software requiring one of your licenses.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Disclaimer
|
|
105
|
+
|
|
106
|
+
This software is provided "as is", without warranty of any kind, express or implied. The authors and contributors accept no liability for any damages, data loss, security incidents, or legal consequences arising from the use of this software.
|
|
107
|
+
|
|
108
|
+
Portlama is designed for self-hosted use cases — personal projects, development environments, demos, and internal tools. It is not a substitute for production infrastructure. Production workloads require dedicated hosting, load balancing, redundancy, monitoring, and operational expertise that are beyond the scope of this project.
|
|
109
|
+
|
|
110
|
+
**You are solely responsible for what you expose through Portlama.** By tunneling an application to the public internet, you grant anyone with access the ability to interact with that application as if they were on your local network. This carries inherent risks:
|
|
111
|
+
|
|
112
|
+
- **Arbitrary code execution:** If the tunneled application contains vulnerabilities or backdoors, remote attackers may exploit them to execute code on your machine, access your file system, or compromise your operating system.
|
|
113
|
+
- **Data exposure:** Misconfigured or insecure applications may leak sensitive data, credentials, or private files to the internet.
|
|
114
|
+
- **Lateral movement:** A compromised tunneled application may be used as an entry point to attack other devices and services on your local network.
|
|
115
|
+
- **Resource abuse:** Publicly accessible applications may be used for cryptocurrency mining, spam relaying, botnet hosting, or other abuse that could result in legal action against you.
|
|
116
|
+
|
|
117
|
+
Portlama provides authentication and access control mechanisms, but no security measure is absolute. It is your responsibility to understand the software you expose, keep it updated, and assess the risks of making it publicly accessible. The authors of Portlama bear no responsibility for the consequences of tunneling untrusted, vulnerable, or malicious software.
|
package/README.md
CHANGED
|
@@ -43,6 +43,21 @@ configured through the browser-based onboarding wizard after installation.
|
|
|
43
43
|
See the main repository for architecture, development plan, and full
|
|
44
44
|
documentation: <https://github.com/lamalibre/portlama>
|
|
45
45
|
|
|
46
|
+
## Disclaimer
|
|
47
|
+
|
|
48
|
+
This software is provided "as is", without warranty of any kind, express or implied. The authors and contributors accept no liability for any damages, data loss, security incidents, or legal consequences arising from the use of this software.
|
|
49
|
+
|
|
50
|
+
Portlama is designed for self-hosted use cases — personal projects, development environments, demos, and internal tools. It is not a substitute for production infrastructure. Production workloads require dedicated hosting, load balancing, redundancy, monitoring, and operational expertise that are beyond the scope of this project.
|
|
51
|
+
|
|
52
|
+
**You are solely responsible for what you expose through Portlama.** By tunneling an application to the public internet, you grant anyone with access the ability to interact with that application as if they were on your local network. This carries inherent risks:
|
|
53
|
+
|
|
54
|
+
- **Arbitrary code execution:** If the tunneled application contains vulnerabilities or backdoors, remote attackers may exploit them to execute code on your machine, access your file system, or compromise your operating system.
|
|
55
|
+
- **Data exposure:** Misconfigured or insecure applications may leak sensitive data, credentials, or private files to the internet.
|
|
56
|
+
- **Lateral movement:** A compromised tunneled application may be used as an entry point to attack other devices and services on your local network.
|
|
57
|
+
- **Resource abuse:** Publicly accessible applications may be used for cryptocurrency mining, spam relaying, botnet hosting, or other abuse that could result in legal action against you.
|
|
58
|
+
|
|
59
|
+
Portlama provides authentication and access control mechanisms, but no security measure is absolute. It is your responsibility to understand the software you expose, keep it updated, and assess the risks of making it publicly accessible. The authors of Portlama bear no responsibility for the consequences of tunneling untrusted, vulnerable, or malicious software.
|
|
60
|
+
|
|
46
61
|
## License
|
|
47
62
|
|
|
48
63
|
[Polyform Noncommercial 1.0.0](./LICENSE.md) — see [LICENSE.md](./LICENSE.md) for details.
|
package/package.json
CHANGED
|
@@ -224,14 +224,39 @@ function generateInvitePageHtml() {
|
|
|
224
224
|
function showSuccess(result) {
|
|
225
225
|
app.className = 'card success-card';
|
|
226
226
|
var loginBtn = result.loginUrl
|
|
227
|
-
? '<a href="' + escapeHtml(result.loginUrl) + '" class="btn" style="text-decoration:none;text-align:center;display:block">Go to Login</a>'
|
|
227
|
+
? '<a href="' + escapeHtml(result.loginUrl) + '" class="btn" style="text-decoration:none;text-align:center;display:block;margin-top:1rem">Go to Login</a>'
|
|
228
228
|
: '';
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
|
|
230
|
+
if (result.totpUri) {
|
|
231
|
+
app.innerHTML =
|
|
232
|
+
'<div class="icon">\\u2705</div>' +
|
|
233
|
+
'<h1>Account Created</h1>' +
|
|
234
|
+
'<p>Your account <strong style="color:#22d3ee">' + escapeHtml(result.username) + '</strong> has been created.</p>' +
|
|
235
|
+
'<p style="margin-bottom:1.5rem">Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.) to set up two-factor authentication.</p>' +
|
|
236
|
+
'<div id="qr-container" style="display:flex;justify-content:center;margin-bottom:1.5rem;background:#fff;border-radius:0.5rem;padding:1rem;max-width:220px;margin-left:auto;margin-right:auto"></div>' +
|
|
237
|
+
'<p style="font-size:0.75rem;color:#52525b;margin-bottom:1rem;word-break:break-all"><strong style="color:#a1a1aa">Manual entry:</strong> ' + escapeHtml(result.totpUri.match(/secret=([^&]+)/)?.[1] || '') + '</p>' +
|
|
238
|
+
'<div class="error-msg" style="background:#0f1c1c;border-color:#134e4a;color:#5eead4;text-align:center">\\u26A0\\uFE0F Save this before navigating away — it cannot be shown again.</div>' +
|
|
239
|
+
loginBtn;
|
|
240
|
+
|
|
241
|
+
// Load QR code library and render
|
|
242
|
+
var script = document.createElement('script');
|
|
243
|
+
script.src = 'https://cdn.jsdelivr.net/npm/qrcode-generator@1.4.4/qrcode.min.js';
|
|
244
|
+
script.onload = function() {
|
|
245
|
+
var qr = qrcode(0, 'M');
|
|
246
|
+
qr.addData(result.totpUri);
|
|
247
|
+
qr.make();
|
|
248
|
+
var container = document.getElementById('qr-container');
|
|
249
|
+
if (container) container.innerHTML = qr.createSvgTag(4, 0);
|
|
250
|
+
};
|
|
251
|
+
document.head.appendChild(script);
|
|
252
|
+
} else {
|
|
253
|
+
app.innerHTML =
|
|
254
|
+
'<div class="icon">\\u2705</div>' +
|
|
255
|
+
'<h1>Account Created</h1>' +
|
|
256
|
+
'<p>Your account <strong style="color:#22d3ee">' + escapeHtml(result.username) + '</strong> has been created successfully.</p>' +
|
|
257
|
+
'<p>Contact your administrator to set up two-factor authentication.</p>' +
|
|
258
|
+
loginBtn;
|
|
259
|
+
}
|
|
235
260
|
}
|
|
236
261
|
|
|
237
262
|
function escapeHtml(str) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { readInvitations, writeInvitations } from '../lib/state.js';
|
|
3
|
-
import { createUserFromInvitation, hashPassword, readUsersRaw } from '../lib/authelia.js';
|
|
3
|
+
import { createUserFromInvitation, hashPassword, readUsersRaw, generateTotpSecret, writeTotpToDatabase } from '../lib/authelia.js';
|
|
4
4
|
import { getConfig } from '../lib/config.js';
|
|
5
5
|
|
|
6
6
|
const AcceptInvitationSchema = z.object({
|
|
@@ -101,6 +101,17 @@ export default async function inviteRoutes(fastify, _opts) {
|
|
|
101
101
|
return reply.code(500).send({ error: 'Failed to create user account' });
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// Generate TOTP so the user can scan the QR code immediately
|
|
105
|
+
let totpUri = null;
|
|
106
|
+
try {
|
|
107
|
+
const { secret, uri } = generateTotpSecret(invitation.username);
|
|
108
|
+
await writeTotpToDatabase(invitation.username, secret);
|
|
109
|
+
totpUri = uri;
|
|
110
|
+
} catch (err) {
|
|
111
|
+
request.log.error(err, 'Failed to generate TOTP for invited user');
|
|
112
|
+
// Non-fatal: user was created, they can have admin reset TOTP later
|
|
113
|
+
}
|
|
114
|
+
|
|
104
115
|
// Mark invitation as used
|
|
105
116
|
invitation.used = true;
|
|
106
117
|
invitation.acceptedAt = new Date().toISOString();
|
|
@@ -118,6 +129,7 @@ export default async function inviteRoutes(fastify, _opts) {
|
|
|
118
129
|
ok: true,
|
|
119
130
|
username: invitation.username,
|
|
120
131
|
loginUrl,
|
|
132
|
+
totpUri,
|
|
121
133
|
};
|
|
122
134
|
});
|
|
123
135
|
}
|