add color customization of template

pull/177/head
robinmoisson 2023-04-03 13:45:36 +02:00
rodzic 707d05c83f
commit ff55a69c99
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 9419716500078583
5 zmienionych plików z 57 dodań i 51 usunięć

Wyświetl plik

@ -71,47 +71,53 @@ The password argument is optional if `STATICRYPT_PASSWORD` is set in the environ
Usage: staticrypt <filename> [options] Usage: staticrypt <filename> [options]
Options: Options:
--help Show help [boolean] --help Show help [boolean]
--version Show version number [boolean] --version Show version number [boolean]
-c, --config Path to the config file. Set to "false" to -c, --config Path to the config file. Set to "false" to
disable. [string] [default: ".staticrypt.json"] disable.[string] [default: ".staticrypt.json"]
-d, --directory Name of the directory where the encrypted files -d, --directory Name of the directory where the encrypted
will be saved. [string] [default: "encrypted/"] files will be saved.
-p, --password The password to encrypt your file with. Leave [string] [default: "encrypted/"]
empty to be prompted for it. If -p, --password The password to encrypt your file with. Leave
STATICRYPT_PASSWORD is set in the env, we'll use empty to be prompted for it. If
that instead. [string] [default: null] STATICRYPT_PASSWORD is set in the env, we'll
--remember Expiration in days of the "Remember me" checkbox use that instead. [string] [default: null]
that will save the (salted + hashed) password in --remember Expiration in days of the "Remember me"
localStorage when entered by the user. Set to checkbox that will save the (salted + hashed)
"false" to hide the box. Default: "0", no password in localStorage when entered by the
expiration. [number] [default: 0] user. Set to "false" to hide the box. Default:
-s, --salt Generate a config file or set the salt manually. "0", no expiration. [number] [default: 0]
Pass a 32-character-long hexadecimal string to -s, --salt Generate a config file or set the salt
use as salt, or leave empty to generate, display manually. Pass a 32-character-long hexadecimal
and save to config a random salt. This won't string to use as salt, or leave empty to
overwrite an existing config file. [string] generate, display and save to config a random
--share Get a link containing your hashed password that salt. This won't overwrite an existing config
will auto-decrypt the page. Pass your URL as a file. [string]
value to append "#staticrypt_pwd=<hashed_pwd>", --share Get a link containing your hashed password
or leave empty to display the hash to append. that will auto-decrypt the page. Pass your URL
[string] as a value to append
--short Hide the "short password" warning. "#staticrypt_pwd=<hashed_pwd>", or leave empty
to display the hash to append. [string]
--short Hide the "short password" warning.
[boolean] [default: false] [boolean] [default: false]
-t, --template Path to custom HTML template with password -t, --template Path to custom HTML template with password
prompt. prompt.
[string] [default: "/code/staticrypt/lib/password_template.html"] [string] [default: "/code/staticrypt/lib/password_template.html"]
--template-button Label to use for the decrypt button. Default: --template-button Label to use for the decrypt button. Default:
"DECRYPT". [string] [default: "DECRYPT"] "DECRYPT". [string] [default: "DECRYPT"]
--template-instructions Special instructions to display to the user. --template-color-primary Primary color (button...)
[string] [default: "#4CAF50"]
--template-color-secondary Secondary color (page background...)
[string] [default: "#76B852"]
--template-instructions Special instructions to display to the user.
[string] [default: ""] [string] [default: ""]
--template-error Error message to display on entering wrong --template-error Error message to display on entering wrong
password. [string] [default: "Bad password!"] password. [string] [default: "Bad password!"]
--template-placeholder Placeholder to use for the password input. --template-placeholder Placeholder to use for the password input.
[string] [default: "Password"] [string] [default: "Password"]
--template-remember Label to use for the "Remember me" checkbox. --template-remember Label to use for the "Remember me" checkbox.
[string] [default: "Remember me"] [string] [default: "Remember me"]
--template-title Title for the output HTML page. --template-title Title for the output HTML page.
[string] [default: "Protected Page"] [string] [default: "Protected Page"]

Wyświetl plik

@ -350,6 +350,16 @@ function parseCommandLineArguments() {
describe: 'Label to use for the decrypt button. Default: "DECRYPT".', describe: 'Label to use for the decrypt button. Default: "DECRYPT".',
default: "DECRYPT", default: "DECRYPT",
}) })
.option("template-color-primary", {
type: "string",
describe: "Primary color (button...)",
default: "#4CAF50",
})
.option("template-color-secondary", {
type: "string",
describe: "Secondary color (page background...)",
default: "#76B852",
})
.option("template-instructions", { .option("template-instructions", {
type: "string", type: "string",
describe: "Special instructions to display to the user.", describe: "Special instructions to display to the user.",
@ -374,16 +384,6 @@ function parseCommandLineArguments() {
type: "string", type: "string",
describe: "Title for the output HTML page.", describe: "Title for the output HTML page.",
default: "Protected Page", default: "Protected Page",
}) });
.option("template-color-primary", {
type: "string",
describe: "Button color.",
default: "#4CAF50",
})
.option("template-color-secondary", {
type: "string",
describe: "Background color of the page.",
default: "#76b852",
})
} }
exports.parseCommandLineArguments = parseCommandLineArguments; exports.parseCommandLineArguments = parseCommandLineArguments;

Wyświetl plik

@ -63,7 +63,7 @@
.staticrypt-form .staticrypt-decrypt-button:hover, .staticrypt-form .staticrypt-decrypt-button:active, .staticrypt-form .staticrypt-decrypt-button:focus { .staticrypt-form .staticrypt-decrypt-button:hover, .staticrypt-form .staticrypt-decrypt-button:active, .staticrypt-form .staticrypt-decrypt-button:focus {
background: /*[|template_color_primary|]*/0; background: /*[|template_color_primary|]*/0;
filter: brightness(95%); filter: brightness(92%);
} }
.staticrypt-html { .staticrypt-html {

4
package-lock.json wygenerowano
Wyświetl plik

@ -1,12 +1,12 @@
{ {
"name": "staticrypt", "name": "staticrypt",
"version": "3.0.4", "version": "3.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "staticrypt", "name": "staticrypt",
"version": "3.0.4", "version": "3.1.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"dotenv": "^16.0.3", "dotenv": "^16.0.3",

Wyświetl plik

@ -1,6 +1,6 @@
{ {
"name": "staticrypt", "name": "staticrypt",
"version": "3.0.4", "version": "3.1.0",
"description": "Based on the [crypto-js](https://github.com/brix/crypto-js) library, StatiCrypt uses AES-256 to encrypt your input with your passphrase and put it in a HTML file with a password prompt that can decrypted in-browser (client side).", "description": "Based on the [crypto-js](https://github.com/brix/crypto-js) library, StatiCrypt uses AES-256 to encrypt your input with your passphrase and put it in a HTML file with a password prompt that can decrypted in-browser (client side).",
"main": "index.js", "main": "index.js",
"files": [ "files": [