Vercel: how to block the reading of important files - .htaccess

I would like to block some files, so that no user can access them. As files / folder css, js, sass ...
I found a part of vercel's documentation that talks about server configuration. However, I couldn't find any way to block these files.
It has the redirect, but it would be a lot of work.
this is my json so far
{
"cleanUrls": true,
"trailingSlash": false,
"rewrites": [
{ "source": "/inicio", "destination": "https://blog-semnome-9ui4b0xed-gobsruiz.vercel.app/html/index" },
{ "source": "/blog", "destination": "https://blog-semnome-9ui4b0xed-gobsruiz.vercel.app/html/blog" },
{ "source": "/contato", "destination": "https://blog-semnome-9ui4b0xed-gobsruiz.vercel.app/html/contact" },
{ "source": "/jogos-gratis-2021-pt1", "destination": "https://blog-semnome-9ui4b0xed-gobsruiz.vercel.app/html/posts/jogos-gratis-2021-pt1" }
]
}
Does anyone know any way to block?
https://vercel.com/docs/configuration

Related

Azure ADLS v2 - Lifecycle management logs

I'm running a policy that moves files to the archive access tier after one day.
Is there a log indicating what policy triggered the move and when/how it was executed?.
Perhaps Log Analytics may be helpful in this question, what would the settings look like?
Please see code below for the policies I'm testing with, not sure if the one with the front slash prefix is the one working or not. I'm testing both methods since I was getting no results, also added one policy for modified and one for accessed files. This works now but I don't know which policy was the one that worked.
Thanks for any answers you may provide.
'''{
"rules": [
{
"enabled": true,
"name": "move to archive storage amcont01 accessed",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterLastAccessTimeGreaterThan": 1
}
}
},
"filters": {
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"/amcont01",
"/amcont01/folder1",
"amcont01",
"amcont01/folder1"
]
}
}
},
{
"enabled": true,
"name": "move to archive rule amcont01 modified folder1",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 1
}
}
},
"filters": {
"blobTypes": [
"blockBlob"
],
"prefixMatch": [
"amcont01",
"amcont01/folder1",
"/amcont01",
"/amcont01/folder1"
]
}
}
}
]
}'''

Limiting `declarative_net_request` rules to subdomain in Chrome Extension manifest version 3

In Manifest V3 Chrome's team introduced declarativeNetRequest. We can't seem to make sure those rules are applied only to sites of a certain domain:
[
{
"id": 1,
"priority": 1,
"action": {
"type": "block"
},
"condition": {
"urlFilter": "main.js",
"resourceTypes": ["script"]
}
}
]
We defined, those rules are fired in every webpage you visit. Can we filter the rules by this host of rule and not by the destination of the script? We couldn't find indication for it in the docs or the examples.
Needless to say any off-docs improvisation in the manifest.json failed to leave a mark. For instance:
{
...
"declarative_net_request": {
"matches": ["https://SUB_DOMAIN_NAME.domain.com/*"], <====== this
"rule_resources": [
{
"id": "ruleset_1",
"enabled": true,
"path": "rules.json"
}
]
}
}

JSDoc configuration to exclude output files

I'm writing up some API documentation for a Node/Express app with JSDoc. I have a simple configuration file set up when running jsdoc ./routes -c config.json:
{
"source": {
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc", "closure"]
},
"plugins": ["plugins/markdown"],
"templates": {
"cleverLinks": true,
"monospaceLinks": true
},
"opts": {
"destination": "docs",
"recurse": true,
"readme": "README.md"
}
}
The command outputs a folder /docs with fonts, scripts, styles, and index.html. Is there a way to configure JSDoc to exclude outputting all directories besides a simple HTML file?I was thinking something like:
"output": {
"exclude": ["fonts", "scripts", "styles"]
}

How to disable eslint eqeqeq?

I use create-react-app and just want to add rules to my package.json. I see that I can disable this rule, but how? In the official document, only the phrase "If you don't want to enforce a style for using equality operators, then it's safe to disable this rule."
https://github.com/eslint/eslint/blob/master/docs/rules/eqeqeq.md#when-not-to-use-it
I found that i can write this:
// package.json
{
"name": "mypackage",
...,
"eslintConfig": {
"rules": {
"eqeqeq": "off"
}
}
}
but it not works.
I would like to clarify the question. The reason for my question here is not that I don't know how to disable the rule, I do not know how to disable it in the package.json. I just don't want to clutter up the project's root directory with an additional file.
you can add an eslint configuration file .eslintrc and disable the rules you want inside it.
docs
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:#angular-eslint/recommended",
"plugin:#angular-eslint/template/process-inline-templates"
],
"rules": {
"#angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"#angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:#angular-eslint/template/recommended"
],
"rules": {
"#angular-eslint/template/eqeqeq": "off"
}
}
]
}
Look at the last rule
Now as how to turn it to "smart" rather than "off" I'm yet to figure that out.
** Notice how its in the "files": [.html] or "files": [.ts]. I put mine in the .html rules because my errors were in html files but if they were in a ts file I'd put the rule there instead.
EDIT 1: I found this website useful https://github.com/nrwl/nx-examples/blob/master/.eslintrc.json
Go to your project root folder (where is packaje.json) and create a file named .eslintrc.json
Inside this add the following:
{
"rules": {
"eqeqeq": "off",
}
}
Then re launch the app and the rule should be disabled.
You may locate the eslint configuration file, and change eqeqeq rule to off:
eqeqeq: 'off',
Also, make sure that you don't override the setting farther.
Go to .eslintrc.js then add
rules: {
eqeqeq: 'off',
},

Modeshape full-text-search works only on binary files

I am trying to perform a full-text-search on my Modeshape 5.3.0.Final repository. The query is as simple as:
Query query = queryManager.createQuery("SELECT * FROM [nt:resource] as data WHERE ISDESCENDANTNODE('/somenode') AND CONTAINS(data.*,'*" + text + "*')
Looks like it works well for binary stored files (i.e. pdf,doc,docx, etc...) but it does not match txt files, or any text format file.
This is my repository configuration
{
"name": "Persisted-Repository",
"textExtraction": {
"extractors": {
"tikaExtractor": {
"name": "General content-based extractor",
"classname": "tika"
}
}
},
"workspaces": {
"predefined": [
"otherWorkspace"
],
"default": "default",
"allowCreation": true
},
"security": {
"anonymous": {
"roles": [
"readonly",
"readwrite",
"admin"
],
"useOnFailedLogin": false
}
},
"storage": {
"persistence": {
"type": "file",
"path": "/var/content/storage"
},
"binaryStorage": {
"type": "file",
"directory": "/var/content/binaries",
"minimumBinarySizeInBytes": 999,
"mimeTypeDetection": "content"
}
},
"indexProviders": {
"lucene": {
"classname": "lucene",
"directory": "/var/content/indexes"
}
},
"indexes": {
"textFromFiles": {
"kind": "text",
"provider": "lucene",
"nodeType": "nt:resource",
"columns": "jcr:data(BINARY)"
}
}
}
Currently I'm performing a hack to get around this issue by executing another search for configured text file extensions and manually using Tika (maybe since it's text already Tika is not required here...) to extract the text and search for occurrences.
Does anybody know if this is expected behavior or maybe I am doing something wrong?
Cheers!

Resources