-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repo: https://github.com/metarhia/Template PR: #32
- Loading branch information
1 parent
8730760
commit f051fbe
Showing
56 changed files
with
2,073 additions
and
5,793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{*.js,*.mjs,*.ts,*.json,*.yml}] | ||
indent_size = 2 | ||
indent_style = space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
{ | ||
"extends": ["metarhia", "plugin:prettier/recommended"], | ||
"env": { | ||
"es2021": true, | ||
"node": true, | ||
"browser": true | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": {} | ||
"ecmaVersion": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
const toRelative = require('./src/utils/relativePath.js'); | ||
const path = require('node:path'); | ||
|
||
const relative = (files) => | ||
files.map((file) => path.relative(process.cwd(), file)).join(' '); | ||
|
||
module.exports = { | ||
'*': 'prettier --check --ignore-unknown', | ||
'*.js': 'eslint --cache', | ||
'*.{js,ts}': () => 'npm run typescript:check', | ||
'*': (files) => | ||
`cspell --show-suggestions --quiet --gitignore ${toRelative(files)}`, | ||
`cspell --show-suggestions --quiet --gitignore ${relative(files)}`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
prisma/**/ | ||
application/tasks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"semi": true, | ||
"trailingComma": "es5", | ||
"singleQuote": true | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"overrides": [ | ||
{ | ||
"files": ["**/.*rc", "**/*.json"], | ||
"options": { "parser": "json" } | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[ERD](./prisma/README.md) | ||
# 🦾 Back-end part of the messenger application |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"id-denylist": [ | ||
2, | ||
"application", | ||
"node", | ||
"npm", | ||
"api", | ||
"lib", | ||
"db", | ||
"domain", | ||
"config", | ||
"metarhia" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"globals": { | ||
"api": "readonly", | ||
"application": "readonly", | ||
"config": "readonly", | ||
"context": "readonly", | ||
"node": "readonly", | ||
"npm": "readonly", | ||
"lib": "readonly", | ||
"db": "readonly", | ||
"bus": "readonly", | ||
"domain": "readonly", | ||
"metarhia": "readonly", | ||
"DomainError": "readonly" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
({ | ||
access: 'public', | ||
|
||
parameters: { | ||
a: 'number', | ||
b: 'number', | ||
}, | ||
|
||
method: async ({ a, b }) => { | ||
const result = a + b; | ||
return result; | ||
}, | ||
|
||
returns: 'number', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generate certificates | ||
|
||
## Certbot (for production) | ||
|
||
- Let's Encrypt is a free certificate authority: https://letsencrypt.org/ | ||
- Use Certbot (free tool for automatically using Let’s Encrypt certificates on | ||
manually-administrated websites to enable HTTPS): https://certbot.eff.org/ | ||
|
||
``` | ||
dnf -y install certbot | ||
certbot certonly --standalone -d www.domain.com -d domain.com -m [email protected] --agree-tos --no-eff-email | ||
yes | cp /etc/letsencrypt/live/domain.com/fullchain.pem ~/domain.com/application/cert/cert.pem | ||
yes | cp /etc/letsencrypt/live/domain.com/privkey.pem ~/domain.com/application/cert/key.pem | ||
``` | ||
|
||
Or use impress web server for challenge exchange: | ||
|
||
``` | ||
certbot certonly --webroot -w ~/domain.com/application/static -d www.domain.com -d domain.com -m [email protected] --agree-tos --no-eff-email | ||
``` | ||
|
||
## Self-signed (for testing) | ||
|
||
- Run `./generate.sh` in this directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
authorityKeyIdentifier=keyid,issuer | ||
basicConstraints=CA:FALSE | ||
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment | ||
subjectAltName = @alt_names | ||
|
||
[alt_names] | ||
DNS.1 = example.com | ||
DNS.2 = hello.example.com | ||
DNS.3 = hello1.example.com | ||
DNS.4 = hello2.example.com | ||
IP.1 = 127.0.0.1 | ||
IP.2 = ::1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
cd "$(dirname "$0")" | ||
openssl genrsa -out key.pem 3072 | ||
openssl req -new -out self.pem -key key.pem -subj '/CN=localhost' | ||
openssl req -text -noout -in self.pem | ||
openssl x509 -req -days 1024 -in self.pem -signkey key.pem -out cert.pem -extfile generate.ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"strict": ["error", "never"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
({ | ||
keepDays: 100, | ||
writeInterval: 3000, | ||
writeBuffer: 64 * 1024, | ||
toFile: ['error', 'warn', 'info', 'debug', 'log'], | ||
toStdout: ['error', 'warn', 'info', 'debug', 'log'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
({ | ||
cloud: 'PrivateCloud', | ||
server: '1', | ||
instance: 'standalone', | ||
token: '2aC8F1-W9gM2*2-p=9g6xs2Q4v7e1kw-', | ||
gc: 60 * 60 * 1000, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
({ | ||
host: '0.0.0.0', | ||
protocol: 'http', | ||
ports: [8000], | ||
nagle: false, | ||
timeouts: { | ||
bind: 2000, | ||
start: 30000, | ||
stop: 5000, | ||
request: 5000, | ||
watch: 1000, | ||
test: 60000, | ||
}, | ||
queue: { | ||
concurrency: 1000, | ||
size: 2000, | ||
timeout: 3000, | ||
}, | ||
scheduler: { | ||
concurrency: 10, | ||
size: 2000, | ||
timeout: 3000, | ||
}, | ||
workers: { | ||
pool: 0, | ||
wait: 2000, | ||
timeout: 5000, | ||
}, | ||
cors: { | ||
origin: '*', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
({ | ||
sid: 'token', | ||
characters: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', | ||
length: 64, | ||
secret: 'secret', | ||
regenerate: 60 * 60 * 1000, | ||
expire: 2 * 60 * 60 * 1000, | ||
persistent: true, | ||
limits: { | ||
ip: 20, | ||
user: 5, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>404 Not found</title> | ||
</head> | ||
<body> | ||
<h1>404 Not found</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"globals": { | ||
"application": "readonly", | ||
"api": "readonly" | ||
}, | ||
"rules": { | ||
"id-denylist": [2, "global"], | ||
"import/no-unresolved": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
Metarhia application server repository template | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.