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

@ -74,28 +74,30 @@ The password argument is optional if `STATICRYPT_PASSWORD` is set in the environ
--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.
[string] [default: "encrypted/"]
-p, --password The password to encrypt your file with. Leave -p, --password The password to encrypt your file with. Leave
empty to be prompted for it. If empty to be prompted for it. If
STATICRYPT_PASSWORD is set in the env, we'll use STATICRYPT_PASSWORD is set in the env, we'll
that instead. [string] [default: null] use that instead. [string] [default: null]
--remember Expiration in days of the "Remember me" checkbox --remember Expiration in days of the "Remember me"
that will save the (salted + hashed) password in checkbox that will save the (salted + hashed)
localStorage when entered by the user. Set to password in localStorage when entered by the
"false" to hide the box. Default: "0", no user. Set to "false" to hide the box. Default:
expiration. [number] [default: 0] "0", no expiration. [number] [default: 0]
-s, --salt Generate a config file or set the salt manually. -s, --salt Generate a config file or set the salt
Pass a 32-character-long hexadecimal string to manually. Pass a 32-character-long hexadecimal
use as salt, or leave empty to generate, display string to use as salt, or leave empty to
and save to config a random salt. This won't generate, display and save to config a random
overwrite an existing config file. [string] salt. This won't overwrite an existing config
--share Get a link containing your hashed password that file. [string]
will auto-decrypt the page. Pass your URL as a --share Get a link containing your hashed password
value to append "#staticrypt_pwd=<hashed_pwd>", that will auto-decrypt the page. Pass your URL
or leave empty to display the hash to append. as a value to append
[string] "#staticrypt_pwd=<hashed_pwd>", or leave empty
to display the hash to append. [string]
--short Hide the "short password" warning. --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
@ -103,6 +105,10 @@ The password argument is optional if `STATICRYPT_PASSWORD` is set in the environ
[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-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. --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

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": [