Skip to content

Commit cf0b764

Browse files
Merge pull request #21 from MaddyGuthridge/maddy-ssh-keygen
Add support for custom SSH config
2 parents 3c35b0e + 0a4c980 commit cf0b764

File tree

95 files changed

+1686
-780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1686
-780
lines changed

design/Setup.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# Setup process
22

3-
1. User specifies a data repository URL, which is then cloned.
4-
2. If the repo is empty, some default data is configured:
5-
* `config.json` with the site's default configuration
6-
* `.gitignore` with a simple gitignore to ignore the local configuration
7-
3. Otherwise, the `.gitignore` is checked to ensure that `config.local.json`
8-
will be ignored (lest auth information be leaked).
9-
4. A secure password is generated, and stored securely in `config.local.json`.
10-
It is shown to the user once, and they are prompted to take note of it.
11-
12-
The site is then fully configured.
3+
## 1. Account creation
4+
5+
The user creates the initial account, which triggers the private data setup.
6+
7+
## 2. Data initialization
8+
9+
The user then chooses how to initialize the repo:
10+
11+
* From a `git` repo. The repo is cloned.
12+
* Empty, meaning a new blank repository is created.
13+
14+
The user is also given the options to control how the server uses SSH keys.
15+
Allowed options are:
16+
17+
* Generate an SSH key-pair, stored within the private data.
18+
* Use an existing private key given its path.
19+
* Use the default SSH identity, which works best if the app is running on an
20+
account with existing SSH access.

eslint.config.mjs

Lines changed: 55 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import js from '@eslint/js';
33
import ts from 'typescript-eslint';
44
import svelte from 'eslint-plugin-svelte';
5+
import svelteParser from 'svelte-eslint-parser';
56
import globals from 'globals';
67

78
export default ts.config(
89
js.configs.recommended,
9-
...ts.configs.recommended,
10+
...ts.configs.recommendedTypeChecked,
11+
...ts.configs.stylisticTypeChecked,
1012
...svelte.configs['flat/recommended'],
1113
{
1214
languageOptions: {
@@ -19,39 +21,68 @@ export default ts.config(
1921
}
2022
},
2123
{
22-
files: ['**/*.svelte'],
2324
languageOptions: {
25+
parser: ts.parser,
2426
parserOptions: {
25-
parser: ts.parser
26-
}
27-
}
27+
// ...
28+
project: true,
29+
extraFileExtensions: ['.svelte'], // This is a required setting in `@typescript-eslint/parser` v4.24.0.
30+
},
31+
},
32+
},
33+
{
34+
files: ['**/*.svelte', '*.svelte'],
35+
languageOptions: {
36+
parser: svelteParser,
37+
// Parse the `<script>` in `.svelte` as TypeScript by adding the following configuration.
38+
parserOptions: {
39+
parser: ts.parser,
40+
},
41+
},
2842
},
2943
{
3044
rules: {
3145
// Allow explicit any, to avoid type gymnastics
32-
"@typescript-eslint/no-explicit-any": "off",
33-
"@typescript-eslint/no-unused-vars": ["error", {
34-
argsIgnorePattern: "^_",
35-
caughtErrors: "none",
36-
}]
46+
'@typescript-eslint/no-explicit-any': 'off',
47+
'@typescript-eslint/no-unused-vars': ['error', {
48+
argsIgnorePattern: '^_',
49+
caughtErrors: 'none',
50+
}],
51+
// Disallow floating promises to avoid random crashes
52+
'@typescript-eslint/no-floating-promises': 'error',
53+
// Single quotes where possible
54+
quotes: ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }],
55+
// Allow some `any` expressions since otherwise they seriously mess with tests, or enforce
56+
// strictness in areas where it really doesn't matter (eg error handling)
57+
'@typescript-eslint/no-unsafe-assignment': 'off',
58+
'@typescript-eslint/no-unsafe-argument': 'off',
59+
// Also disable template expression checks, since they're also error handling stuff
60+
// TODO: Enable them at some point when I get around to actually tidying things up
61+
'@typescript-eslint/no-base-to-string': 'off',
62+
'@typescript-eslint/restrict-template-expressions': 'off',
63+
// FIXME: When I get around to hardening the request body validation, enable this rule again
64+
'@typescript-eslint/no-unsafe-member-access': 'off',
65+
// Allow empty functions, as they are useful to silence promise errors
66+
'@typescript-eslint/no-empty-function': 'off',
3767
},
3868
},
3969
{
4070
ignores: [
41-
"**/.DS_Store",
42-
"**/node_modules",
43-
"build",
44-
".svelte-kit",
45-
"package",
46-
"**/.env",
47-
"**/.env.*",
48-
"!**/.env.example",
49-
"**/pnpm-lock.yaml",
50-
"**/package-lock.json",
51-
"**/yarn.lock",
52-
"**/svelte.config.js",
53-
"**/vitest.config.ts",
54-
"eslint.config.mjs",
71+
'**/.DS_Store',
72+
'**/node_modules',
73+
'build',
74+
'.svelte-kit',
75+
'package',
76+
'**/.env',
77+
'**/.env.*',
78+
'!**/.env.example',
79+
'**/pnpm-lock.yaml',
80+
'**/package-lock.json',
81+
'**/yarn.lock',
82+
'**/svelte.config.js',
83+
'**/vitest.config.ts',
84+
'eslint.config.mjs',
85+
'vite.config.ts',
5586
],
5687
},
5788
);

0 commit comments

Comments
 (0)