allow SimpleFIN credentials via ENV
This commit is contained in:
@@ -44,6 +44,9 @@ INVESTMENT_PAYEE_NAME="Investment"
|
|||||||
INVESTMENT_CATEGORY_GROUP_NAME="Income"
|
INVESTMENT_CATEGORY_GROUP_NAME="Income"
|
||||||
# optional, name of the category for added investment tracking transactions
|
# optional, name of the category for added investment tracking transactions
|
||||||
INVESTMENT_CATEGORY_NAME="Investment"
|
INVESTMENT_CATEGORY_NAME="Investment"
|
||||||
|
|
||||||
|
# optional, for logging into SimpleFIN
|
||||||
|
SIMPLEFIN_CREDENTIALS="<credentials - not the setup token!>"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -215,6 +218,9 @@ You can optionally change the category group used for the transactions by settin
|
|||||||
You can optionally change the category used for the transactions by setting
|
You can optionally change the category used for the transactions by setting
|
||||||
`INVESTMENT_CATEGORY_NAME` in the `.env` file.
|
`INVESTMENT_CATEGORY_NAME` in the `.env` file.
|
||||||
|
|
||||||
|
You can optionally store the SimpleFIN credentials generated from your setup
|
||||||
|
token by setting `SIMPLEFIN_CREDENTIALS` in the `.env` file.
|
||||||
|
|
||||||
To run:
|
To run:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ require("dotenv").config();
|
|||||||
|
|
||||||
|
|
||||||
const getCredentials = async () => {
|
const getCredentials = async () => {
|
||||||
|
if (process.env.SIMPLEFIN_CREDENTIALS) {
|
||||||
|
return process.env.SIMPLEFIN_CREDENTIALS;
|
||||||
|
}
|
||||||
|
|
||||||
const token = readline.question('Enter your SimpleFIN setup token: ');
|
const token = readline.question('Enter your SimpleFIN setup token: ');
|
||||||
const url = atob(token.trim());
|
const url = atob(token.trim());
|
||||||
|
|
||||||
@@ -19,6 +23,7 @@ const getCredentials = async () => {
|
|||||||
|
|
||||||
const data = `${username}:${pw}`;
|
const data = `${username}:${pw}`;
|
||||||
fs.writeFileSync('simplefin.credentials', data);
|
fs.writeFileSync('simplefin.credentials', data);
|
||||||
|
console.log('SimpleFIN credentials:', data);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user