mirror of
https://github.com/aurora-dot/pastel.codes.git
synced 2024-12-04 22:12:21 +00:00
Compare commits
10 Commits
80813d48e3
...
dec522c914
Author | SHA1 | Date | |
---|---|---|---|
dec522c914 | |||
b3aae82a2a | |||
140fa8fea0 | |||
eba987561e | |||
e2115e041e | |||
dbd54804e6 | |||
7f2c5975da | |||
ee4d60d07a | |||
be151ade85 | |||
8449b30401 |
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@ -0,0 +1,15 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
|
||||
[pug.ts]
|
||||
indent_size = 4
|
3
.eslintrc.json
Normal file
3
.eslintrc.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["prettier"]
|
||||
}
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -201,3 +201,5 @@ notes
|
||||
public/stylesheets/style.css
|
||||
ngrok
|
||||
.dccache
|
||||
|
||||
.DS_store
|
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
_
|
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
8
.prettierrc.json
Normal file
8
.prettierrc.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"trailingComma": "es5",
|
||||
"semi": true,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": true,
|
||||
"plugins": ["prettier-plugin-tailwindcss", "@prettier/plugin-pug"]
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
FROM node:16-bullseye-slim
|
||||
FROM node:21-bullseye-slim
|
||||
|
||||
ENV IS_DOCKER=true
|
||||
ENV NODE_ENV=production
|
||||
|
43
app.js
43
app.js
@ -4,7 +4,7 @@ var path = require('path');
|
||||
var cookieParser = require('cookie-parser');
|
||||
var mLogger = require('morgan');
|
||||
var logger = require('./config/winston');
|
||||
const helmet = require("helmet");
|
||||
const helmet = require('helmet');
|
||||
|
||||
var indexRouter = require('./routes/index');
|
||||
var aboutRouter = require('./routes/about');
|
||||
@ -12,7 +12,8 @@ var contactRouter = require('./routes/contact');
|
||||
|
||||
var app = express();
|
||||
|
||||
if (process.env.IS_DOCKER != 'true') app.set('trust proxy', 'loopback,uniquelocal');
|
||||
if (process.env.IS_DOCKER != 'true')
|
||||
app.set('trust proxy', 'loopback,uniquelocal');
|
||||
app.disable('x-powered-by');
|
||||
|
||||
// view engine setup
|
||||
@ -20,7 +21,7 @@ app.set('views', path.join(__dirname, 'views'));
|
||||
app.set('view engine', 'pug');
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
app.use(mLogger("common", { "stream": logger.stream }));
|
||||
app.use(mLogger('common', { stream: logger.stream }));
|
||||
} else {
|
||||
app.use(mLogger('dev'));
|
||||
}
|
||||
@ -30,11 +31,32 @@ app.use(
|
||||
helmet.contentSecurityPolicy({
|
||||
directives: {
|
||||
defaultSrc: ["'self'"],
|
||||
scriptSrc: ["'self'", "'unsafe-inline'", "'unsafe-eval'", "https://hcaptcha.com", "https://*.hcaptcha.com", "https://cdn.ravenjs.com/"],
|
||||
imgSrc: ["'self'", "https://blog.pastel.codes", "https://static.ghost.org", "https://secure.gravatar.com"],
|
||||
styleSrc: ["'self'", "'unsafe-inline'", "https://hcaptcha.com", "https://*.hcaptcha.com"],
|
||||
fontSrc: ["'self'", "data:"],
|
||||
frameSrc: ["https://hcaptcha.com", "https://*.hcaptcha.com"],
|
||||
scriptSrc: [
|
||||
"'self'",
|
||||
"'unsafe-inline'",
|
||||
"'unsafe-eval'",
|
||||
'https://hcaptcha.com',
|
||||
'https://*.hcaptcha.com',
|
||||
'https://cdn.ravenjs.com/',
|
||||
'https://cdnjs.cloudflare.com/',
|
||||
'https://cdn.jsdelivr.net/',
|
||||
'https://*.cloudfront.net/',
|
||||
],
|
||||
imgSrc: [
|
||||
"'self'",
|
||||
'https://blog.pastel.codes',
|
||||
'https://static.ghost.org',
|
||||
'https://secure.gravatar.com',
|
||||
'data: ',
|
||||
],
|
||||
styleSrc: [
|
||||
"'self'",
|
||||
"'unsafe-inline'",
|
||||
'https://hcaptcha.com',
|
||||
'https://*.hcaptcha.com',
|
||||
],
|
||||
fontSrc: ["'self'", 'data:'],
|
||||
frameSrc: ['https://hcaptcha.com', 'https://*.hcaptcha.com'],
|
||||
objectSrc: ["'none'"],
|
||||
upgradeInsecureRequests: [],
|
||||
},
|
||||
@ -45,6 +67,7 @@ app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: false }));
|
||||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
app.use('/obsidian', express.static(path.join(__dirname, 'obsidian')));
|
||||
|
||||
app.use('/', indexRouter);
|
||||
app.use('/about', aboutRouter);
|
||||
@ -56,14 +79,14 @@ app.use(function(req, res, next) {
|
||||
});
|
||||
|
||||
// error handler
|
||||
app.use(function(err, req, res, next) {
|
||||
app.use(function (err, req, res, _next) {
|
||||
// set locals, only providing error in development
|
||||
res.locals.message = err.message;
|
||||
res.locals.error = req.app.get('env') === 'development' ? err : {};
|
||||
|
||||
// render the error page
|
||||
res.status(err.status || 500);
|
||||
res.render('error', { title: 'Error', description: "Error" });
|
||||
res.render('error', { title: 'Error', description: 'Error' });
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
|
8
bin/www
8
bin/www
@ -59,9 +59,7 @@ function onError(error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
var bind = typeof port === 'string'
|
||||
? 'Pipe ' + port
|
||||
: 'Port ' + port;
|
||||
var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;
|
||||
|
||||
// handle specific listen errors with friendly messages
|
||||
switch (error.code) {
|
||||
@ -84,8 +82,6 @@ function onError(error) {
|
||||
|
||||
function onListening() {
|
||||
var addr = server.address();
|
||||
var bind = typeof addr === 'string'
|
||||
? 'pipe ' + addr
|
||||
: 'port ' + addr.port;
|
||||
var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;
|
||||
debug('Listening on ' + bind);
|
||||
}
|
||||
|
@ -10,21 +10,21 @@ var logger = new winston.createLogger({
|
||||
json: true,
|
||||
maxsize: 5242880, //5MB
|
||||
maxFiles: 5,
|
||||
colorize: false
|
||||
colorize: false,
|
||||
}),
|
||||
new winston.transports.Console({
|
||||
level: 'debug',
|
||||
handleExceptions: true,
|
||||
json: false,
|
||||
colorize: true
|
||||
})
|
||||
colorize: true,
|
||||
}),
|
||||
],
|
||||
exitOnError: false
|
||||
exitOnError: false,
|
||||
});
|
||||
|
||||
logger.stream = {
|
||||
write: function(message, encoding){
|
||||
write: function (message, _encoding) {
|
||||
logger.info(message);
|
||||
}
|
||||
},
|
||||
};
|
||||
module.exports = logger
|
||||
module.exports = logger;
|
||||
|
20
eslint.config.mjs
Normal file
20
eslint.config.mjs
Normal file
@ -0,0 +1,20 @@
|
||||
import globals from 'globals';
|
||||
import pluginJs from '@eslint/js';
|
||||
|
||||
export default [
|
||||
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
|
||||
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
|
||||
pluginJs.configs.recommended,
|
||||
{
|
||||
rules: {
|
||||
'no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
19
obsidian/00-tags/tag-admin.html
Normal file
19
obsidian/00-tags/tag-admin.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-ai.html
Normal file
19
obsidian/00-tags/tag-ai.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-api.html
Normal file
19
obsidian/00-tags/tag-api.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-application-ui.html
Normal file
19
obsidian/00-tags/tag-application-ui.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-art.html
Normal file
19
obsidian/00-tags/tag-art.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-automated-email.html
Normal file
19
obsidian/00-tags/tag-automated-email.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-backend.html
Normal file
19
obsidian/00-tags/tag-backend.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-bash.html
Normal file
19
obsidian/00-tags/tag-bash.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-blender.html
Normal file
19
obsidian/00-tags/tag-blender.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-bootstrap.html
Normal file
19
obsidian/00-tags/tag-bootstrap.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-bot.html
Normal file
19
obsidian/00-tags/tag-bot.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-browser-automation.html
Normal file
19
obsidian/00-tags/tag-browser-automation.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-browser-extension.html
Normal file
19
obsidian/00-tags/tag-browser-extension.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-character-design.html
Normal file
19
obsidian/00-tags/tag-character-design.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-chrome-extension.html
Normal file
19
obsidian/00-tags/tag-chrome-extension.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-cicd.html
Normal file
19
obsidian/00-tags/tag-cicd.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-concurrency.html
Normal file
19
obsidian/00-tags/tag-concurrency.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-css.html
Normal file
19
obsidian/00-tags/tag-css.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-cybersecurity.html
Normal file
19
obsidian/00-tags/tag-cybersecurity.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-data-management.html
Normal file
19
obsidian/00-tags/tag-data-management.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-data-science.html
Normal file
19
obsidian/00-tags/tag-data-science.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-decryption.html
Normal file
19
obsidian/00-tags/tag-decryption.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-devops.html
Normal file
19
obsidian/00-tags/tag-devops.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-diffing.html
Normal file
19
obsidian/00-tags/tag-diffing.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-discord.html
Normal file
19
obsidian/00-tags/tag-discord.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-django-rest-framework.html
Normal file
19
obsidian/00-tags/tag-django-rest-framework.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-django.html
Normal file
19
obsidian/00-tags/tag-django.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-docker.html
Normal file
19
obsidian/00-tags/tag-docker.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-domain-name-management.html
Normal file
19
obsidian/00-tags/tag-domain-name-management.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-dsa.html
Normal file
19
obsidian/00-tags/tag-dsa.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-express.html
Normal file
19
obsidian/00-tags/tag-express.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-firefox-extension.html
Normal file
19
obsidian/00-tags/tag-firefox-extension.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-frontend.html
Normal file
19
obsidian/00-tags/tag-frontend.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-fullstack.html
Normal file
19
obsidian/00-tags/tag-fullstack.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-game-design.html
Normal file
19
obsidian/00-tags/tag-game-design.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-game-dev.html
Normal file
19
obsidian/00-tags/tag-game-dev.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-gamejam.html
Normal file
19
obsidian/00-tags/tag-gamejam.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-gdb.html
Normal file
19
obsidian/00-tags/tag-gdb.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-genetic-algorithm.html
Normal file
19
obsidian/00-tags/tag-genetic-algorithm.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-github-actions.html
Normal file
19
obsidian/00-tags/tag-github-actions.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-github-contributor.html
Normal file
19
obsidian/00-tags/tag-github-contributor.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-go.html
Normal file
19
obsidian/00-tags/tag-go.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-godot.html
Normal file
19
obsidian/00-tags/tag-godot.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-hackathon.html
Normal file
19
obsidian/00-tags/tag-hackathon.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-heroku.html
Normal file
19
obsidian/00-tags/tag-heroku.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-hosting.html
Normal file
19
obsidian/00-tags/tag-hosting.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-html.html
Normal file
19
obsidian/00-tags/tag-html.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-image-gen.html
Normal file
19
obsidian/00-tags/tag-image-gen.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-irc.html
Normal file
19
obsidian/00-tags/tag-irc.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-java.html
Normal file
19
obsidian/00-tags/tag-java.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-js.html
Normal file
19
obsidian/00-tags/tag-js.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-jupyter-notebook.html
Normal file
19
obsidian/00-tags/tag-jupyter-notebook.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-latex.html
Normal file
19
obsidian/00-tags/tag-latex.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-level-design.html
Normal file
19
obsidian/00-tags/tag-level-design.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-linux.html
Normal file
19
obsidian/00-tags/tag-linux.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-low-level-debugging.html
Normal file
19
obsidian/00-tags/tag-low-level-debugging.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-machine-learning.html
Normal file
19
obsidian/00-tags/tag-machine-learning.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-matplotlib.html
Normal file
19
obsidian/00-tags/tag-matplotlib.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-music.html
Normal file
19
obsidian/00-tags/tag-music.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-myers-diff-algo.html
Normal file
19
obsidian/00-tags/tag-myers-diff-algo.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-network-traffic-capture.html
Normal file
19
obsidian/00-tags/tag-network-traffic-capture.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-networking.html
Normal file
19
obsidian/00-tags/tag-networking.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-neural-networks.html
Normal file
19
obsidian/00-tags/tag-neural-networks.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-nextjs.html
Normal file
19
obsidian/00-tags/tag-nextjs.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-nltk.html
Normal file
19
obsidian/00-tags/tag-nltk.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-nodejs.html
Normal file
19
obsidian/00-tags/tag-nodejs.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-npm.html
Normal file
19
obsidian/00-tags/tag-npm.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-numpy.html
Normal file
19
obsidian/00-tags/tag-numpy.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-oauth.html
Normal file
19
obsidian/00-tags/tag-oauth.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-oop.html
Normal file
19
obsidian/00-tags/tag-oop.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-openai.html
Normal file
19
obsidian/00-tags/tag-openai.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-pandas.html
Normal file
19
obsidian/00-tags/tag-pandas.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-parcel.html
Normal file
19
obsidian/00-tags/tag-parcel.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-php.html
Normal file
19
obsidian/00-tags/tag-php.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-platformer.html
Normal file
19
obsidian/00-tags/tag-platformer.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-postgres.html
Normal file
19
obsidian/00-tags/tag-postgres.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-prod.html
Normal file
19
obsidian/00-tags/tag-prod.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-protocol.html
Normal file
19
obsidian/00-tags/tag-protocol.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-proxy.html
Normal file
19
obsidian/00-tags/tag-proxy.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-pug.html
Normal file
19
obsidian/00-tags/tag-pug.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-puppeteer.html
Normal file
19
obsidian/00-tags/tag-puppeteer.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-pwndbg.html
Normal file
19
obsidian/00-tags/tag-pwndbg.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-pygame.html
Normal file
19
obsidian/00-tags/tag-pygame.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-python.html
Normal file
19
obsidian/00-tags/tag-python.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-pytorch.html
Normal file
19
obsidian/00-tags/tag-pytorch.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-react.html
Normal file
19
obsidian/00-tags/tag-react.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-realtime.html
Normal file
19
obsidian/00-tags/tag-realtime.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-redis.html
Normal file
19
obsidian/00-tags/tag-redis.html
Normal file
File diff suppressed because one or more lines are too long
19
obsidian/00-tags/tag-research.html
Normal file
19
obsidian/00-tags/tag-research.html
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user