tempest.games 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # tempest.games
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 47c52e1: ✨ Automatically ban suspicious IPs at the network level.
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 6be0203: ✨ Validations and security.
14
+
15
+ - Enhanced backend security by adding IP tracking and banning for multiple failed login attempts.
16
+ - Improved signup and login forms with error handling, validation feedback, and input readiness checks.
17
+ - Extended database schema to include user tracking and login history tables.
18
+ - Added a list of common passwords to restrict in password validation.
19
+ - Introduced new admin view component and updated global styles.
20
+ - Added tests for password complexity validation.
21
+ - Updated package.json with new database scripts and dependencies.
22
+
23
+ - 0098170: 💄 Added some general styles.
24
+ - 2f0434c: ✨ Basic login/signup flow.
25
+
3
26
  ## 0.1.0
4
27
 
5
28
  ### Minor Changes
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import * as os from "node:os"
4
+
5
+ import postgres from "postgres"
6
+
7
+ import { env } from "../src/library/env.ts"
8
+
9
+ const PRETTY_PLEASE = process.env.PRETTY_PLEASE
10
+
11
+ if (!PRETTY_PLEASE) {
12
+ console.warn(`🚨 this is a dangerous script, please ask nicely`)
13
+ process.exit(1)
14
+ }
15
+
16
+ const osUser = os.userInfo().username
17
+ const user = osUser === `unknown` ? `postgres` : osUser
18
+
19
+ const sql = postgres({
20
+ user,
21
+ password: env.POSTGRES_PASSWORD,
22
+ database: `postgres`,
23
+ host: env.POSTGRES_HOST,
24
+ port: env.POSTGRES_PORT,
25
+ })
26
+
27
+ await sql.unsafe(`DROP DATABASE ${env.POSTGRES_DATABASE};`)
28
+
29
+ await sql.end()
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import * as os from "node:os"
4
+
5
+ import postgres from "postgres"
6
+
7
+ import { env } from "../src/library/env.ts"
8
+
9
+ const osUser = os.userInfo().username
10
+ const user = osUser === `unknown` ? `postgres` : osUser
11
+
12
+ const sql = postgres({
13
+ user,
14
+ password: env.POSTGRES_PASSWORD,
15
+ database: `postgres`,
16
+ host: env.POSTGRES_HOST,
17
+ port: env.POSTGRES_PORT,
18
+ })
19
+
20
+ try {
21
+ process.stdout.write(`🚀 Creating database ${env.POSTGRES_DATABASE}... `)
22
+ await sql`CREATE DATABASE ${sql(env.POSTGRES_DATABASE)}`
23
+ console.log(`Done!`)
24
+ } catch (thrown) {
25
+ if (thrown instanceof Error) {
26
+ console.error(`💥 Failed:`, thrown.message)
27
+ }
28
+ }
29
+
30
+ try {
31
+ process.stdout.write(`🚀 Creating user ${env.POSTGRES_USER}... `)
32
+ await sql.unsafe(
33
+ `CREATE USER ${env.POSTGRES_USER} WITH PASSWORD '${env.POSTGRES_PASSWORD}'`,
34
+ )
35
+ console.log(`Done!`)
36
+ } catch (thrown) {
37
+ if (thrown instanceof Error) {
38
+ console.error(`💥 Failed:`, thrown.message)
39
+ }
40
+ }
41
+
42
+ try {
43
+ process.stdout.write(
44
+ `🚀 Granting privileges to ${env.POSTGRES_USER} on ${env.POSTGRES_DATABASE}... `,
45
+ )
46
+ await sql`GRANT ALL PRIVILEGES ON DATABASE ${sql(env.POSTGRES_DATABASE)} TO ${sql(
47
+ env.POSTGRES_USER,
48
+ )}`
49
+ console.log(`Done!`)
50
+ } catch (thrown) {
51
+ if (thrown instanceof Error) {
52
+ console.error(`💥 Failed:`, thrown.message)
53
+ }
54
+ }
55
+
56
+ await sql.end()
57
+ console.log(`🚀 Database connection closed`)
@@ -0,0 +1,5 @@
1
+ import { execSync } from "node:child_process"
2
+
3
+ export default (): void => {
4
+ execSync(`pnpm db:up`)
5
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ :root{color-scheme:light dark;--fg-tint-3: #fff;--fg-hard-3: var(--fg-tint-3);--fg-tint-2: #fafafa;--fg-hard-2: var(--fg-tint-2);--fg-tint-1: #f5f5f5;--fg-hard-1: var(--fg-tint-1);--fg: #eee;--fg-dark-1: #ddd;--fg-soft-1: var(--fg-dark-1);--fg-dark-2: #ccc;--fg-soft-2: var(--fg-dark-2);--fg-dark-3: #bbb;--fg-soft-3: var(--fg-dark-3);--bg-tint-3: #333;--bg-soft-3: var(--bg-tint-3);--bg-tint-2: #222;--bg-soft-2: var(--bg-tint-2);--bg-tint-1: #111;--bg-soft-1: var(--bg-tint-1);--bg: #090909;--bg-dark-1: #060606;--bg-hard-1: var(--bg-dark-1);--bg-dark-2: #030303;--bg-hard-2: var(--bg-dark-2);--bg-dark-3: #000;--bg-hard-3: var(--bg-dark-3);--hyperlink-color: #09f;--hyperlink-hover-color: #0df;--PI: 3.14159265358979;color:var(--fg);background-color:var(--bg);position:relative}:root body{padding:0;margin:0}*,*:before,*:after{box-sizing:border-box;font-size:15px;line-height:1.3333333333}@media (prefers-color-scheme: light){:root{--fg-tint-3: #666;--fg-hard-3: var(--fg-tint-3);--fg-tint-2: #555;--fg-hard-2: var(--fg-tint-2);--fg-tint-1: #444;--fg-hard-1: var(--fg-tint-1);--fg: #333;--fg-dark-1: #222;--fg-soft-1: var(--fg-dark-1);--fg-dark-2: #111;--fg-soft-2: var(--fg-dark-2);--fg-dark-3: #000;--fg-soft-3: var(--fg-dark-3);--bg-tint-3: #fffefc;--bg-hard-3: var(--bg-tint-3);--bg-tint-2: #fdfcfa;--bg-hard-2: var(--bg-tint-2);--bg-tint-1: #f5f4f2;--bg-hard-1: var(--bg-tint-1);--bg: #efede9;--bg-dark-1: #eae8e4;--bg-soft-1: var(--bg-dark-1);--bg-dark-2: #e4e2de;--bg-soft-2: var(--bg-dark-2);--bg-dark-3: #dedcd8;--bg-soft-3: var(--bg-dark-3);color:var(--fg);background-color:var(--bg);--hyperlink-color: #08f;--hyperlink-hover-color: #04f}a:hover{color:#08f}button{background-color:#f9f9f9}}a{font-weight:500;color:var(--hyperlink-color);text-decoration:inherit}a:hover{color:var(--hyperlink-hover-color);text-decoration:underline}@font-face{font-family:name;src:url(/love_yanone.ttf)}@font-face{font-family:"|_'_|";src:url(/DelveSystem-Regular.otf)}@font-face{font-family:sudo;src:url(/Sudo-Code.otf)}@font-face{font-family:theia;src:url(/Theia0.2.300-300.otf);font-weight:300}@font-face{font-family:theia;src:url(/Theia0.2.400-400.otf);font-weight:400}@font-face{font-family:theia;src:url(/Theia0.2.500-500.otf);font-weight:500}:root{font-family:Uruz;font-size:20px;line-height:1.5;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}i{font-family:Uruz}b{font-family:"|_'_|"}code{font-family:sudo}@font-face{font-family:Uruz;src:url(/Uruz/Uruz-5r.otf);font-weight:500}@font-face{font-family:Uruz;src:url(/Uruz/Uruz-6r.otf);font-weight:600}@font-face{font-family:Uruz;src:url(/Uruz/Uruz-7r.otf);font-weight:700}@font-face{font-family:Manufab;src:url(/manufabVF.ttf)}main._class_1g72u_1{display:flex;flex-flow:column;min-height:100vh;width:100%;overflow:hidden;justify-content:center;align-items:center;padding:60px 10px 30px}main._class_1g72u_1>header{width:100%;max-width:512px}main._class_1g72u_1>header svg{width:100%;max-width:270px}@media (prefers-color-scheme: light){main._class_1g72u_1>header svg{mix-blend-mode:multiply}}main._class_1g72u_1>main{width:100%;max-width:512px;flex-grow:1;align-content:end}main._class_1g72u_1>main>form{display:flex;flex-flow:row wrap;height:100%;gap:30px;align-items:end}main._class_1g72u_1>main>form>main{width:100%;max-width:200px;display:flex;flex-flow:column;gap:10px}main._class_1g72u_1>main>form>main>aside{background-color:#f007;color:var(--bg-hard-3);font-size:15px;padding:3px 6px}main._class_1g72u_1>main>form>main>label{display:flex;flex-flow:column;position:relative}main._class_1g72u_1>main>form>main>label>span{flex-grow:1;font-size:15px}main._class_1g72u_1>main>form>main>label>input{--energy-color: var(--fg-soft-3);box-sizing:border-box;height:34px;background:none;border:1px solid var(--energy-color);font-family:Uruz;font-size:21px}main._class_1g72u_1>main>form>main>label>input:focus{outline:none;border-width:2px}main._class_1g72u_1>main>form>main>label>aside{display:none}main._class_1g72u_1>main>form>main>label:focus-within>aside{position:absolute;display:flex;flex-flow:column-reverse;bottom:calc(100% - 24px);right:0;max-width:160px;font-size:15px;line-height:1.2em;text-align:right;padding:3px 4px 4px;background-color:red;color:var(--bg)}main._class_1g72u_1>main>form>main>button{background-color:var(--bg-dark-3);color:var(--fg);width:40px;height:40px;font-family:theia;border:none;align-self:flex-end;margin-top:10px;cursor:pointer}main._class_1g72u_1>main>form>main>button:disabled{background-color:var(--bg-hard-1);border:1px solid var(--bg-soft-1);color:var(--bg-soft-3)}main._class_1g72u_1>main>form>main>button:disabled:hover{cursor:not-allowed}main._class_1g72u_1>main>form>footer{display:flex;flex-flow:column;gap:30px;align-items:start}main._class_1g72u_1>main>form>footer>a{font-size:15px;color:var(--fg)}main._class_1g72u_1>main>form>footer>a:hover{color:var(--hyperlink-hover-color)}main._class_1g72u_1>main>form>footer>a:hover>u{color:var(--hyperlink-hover-color)}main._class_1g72u_1>main>form>footer>a>u{color:var(--hyperlink-color)}main._class_1g72u_1>main>article{width:100%;overflow:visible}main._class_1g72u_1>main>article>h1{font-size:min(40vw,400px);margin:max(-18vw,-180px) 0}