@icgio/clients-config 1.0.297 → 1.0.299

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- secretread.js:c7bda157f8995a2fb1ad888c0fc29375849b68125c4db5d90d36fedcad0b3cb3
1
+ secretread.js:1a273db37276e5f11e810f354ddec652c4e8c2b785dcefd4231183379db16825
2
2
  data-source.js:440e328f62856d665e4b66a66f55406e0c9f3a974d2be3c000041fd1c552652b
package/README.md CHANGED
@@ -1,2 +1,152 @@
1
- # clients-config
2
- All clients config files and secret files with read-only permissions.
1
+ # Clients Config
2
+
3
+ Centralized configuration management for ICG trading clients. Contains client trading configurations and protected secret files managed with git-secret.
4
+
5
+ ## Features
6
+
7
+ - **Client Configuration**: Trading parameters, pairs, and settings for each client
8
+ - **Secret Management**: Sensitive data protected with git-secret
9
+ - **Dynamic Loading**: Safe require with fallback for missing modules
10
+ - **Shared Configuration**: Common settings shared across clients
11
+
12
+ ## Prerequisites
13
+
14
+ - Node.js >= 16.0.0
15
+ - git-secret installed
16
+ - GPG key-pair configured (version 1.4.x recommended for consistency)
17
+
18
+ ## Installation
19
+
20
+ 1. Clone the repository:
21
+
22
+ ```bash
23
+ git clone <repository-url>
24
+ cd clients-config
25
+ ```
26
+
27
+ 2. Install dependencies:
28
+
29
+ ```bash
30
+ npm install
31
+ ```
32
+
33
+ 3. Reveal secrets (requires GPG key access):
34
+
35
+ ```bash
36
+ git secret reveal
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```javascript
42
+ const clients_config = require('@icgio/clients-config')
43
+
44
+ // Access client configuration
45
+ const config = clients_config.config
46
+
47
+ // Access secret data (requires revealed secrets)
48
+ const secret = clients_config.secretread
49
+
50
+ // Access shared secrets
51
+ const shared = clients_config.secretread_shared
52
+
53
+ // Access data source configuration
54
+ const data_source = clients_config['data-source']
55
+ ```
56
+
57
+ ## Project Structure
58
+
59
+ ```
60
+ clients-config/
61
+ ├── index.js # Main entry point with safe_require
62
+ ├── config.js # Client configuration (public)
63
+ ├── config.json # JSON configuration data
64
+ ├── config-archive.json # Archived configurations
65
+ ├── update-config-json.js # Configuration update script
66
+ ├── data-source.js.secret # Data source config (encrypted)
67
+ ├── secretread.js.secret # Secret reader (encrypted)
68
+ ├── .gitsecret/
69
+ │ ├── keys/ # GPG public keys
70
+ │ └── paths/
71
+ │ └── mapping.cfg # Tracked secret files
72
+ └── package.json
73
+ ```
74
+
75
+ ## Git-Secret Setup
76
+
77
+ ### For New Team Members
78
+
79
+ 1. Install git-secret:
80
+
81
+ ```bash
82
+ # macOS
83
+ brew install git-secret
84
+
85
+ # Ubuntu/Debian
86
+ apt-get install git-secret
87
+ ```
88
+
89
+ 2. Generate GPG key (use version 1.4.x for consistency):
90
+
91
+ ```bash
92
+ gpg --gen-key
93
+ ```
94
+
95
+ 3. Export your public key:
96
+
97
+ ```bash
98
+ gpg --export --armor your@email.com > public_key.asc
99
+ ```
100
+
101
+ 4. Send the public key to an admin to be added to the repository
102
+
103
+ ### For Admins
104
+
105
+ Add a new user's key:
106
+
107
+ ```bash
108
+ git secret tell user@email.com
109
+ git secret reveal
110
+ git secret hide
111
+ git commit -m "Add user@email.com to git-secret"
112
+ git push
113
+ ```
114
+
115
+ ## Configuration Structure
116
+
117
+ ### config.js
118
+
119
+ Contains client-specific trading configuration:
120
+
121
+ - Exchange credentials references
122
+ - Trading pairs and strategies
123
+ - Risk parameters
124
+ - Notification settings
125
+
126
+ ### secretread.js (encrypted)
127
+
128
+ Contains functions to read sensitive data:
129
+
130
+ - API keys
131
+ - Secret credentials
132
+ - Private configuration
133
+
134
+ ## Dependencies
135
+
136
+ | Package | Purpose |
137
+ |---------|---------|
138
+ | `lodash` | Utility functions |
139
+ | `fs-extra` | File system utilities (dev) |
140
+ | `node-cmd` | Command execution (dev) |
141
+ | `prompt` | Interactive prompts (dev) |
142
+
143
+ ## Security Notes
144
+
145
+ - Never commit `.secret` files in decrypted form
146
+ - Always run `git secret hide` before committing
147
+ - Keep GPG private keys secure
148
+ - Rotate credentials periodically
149
+
150
+ ## License
151
+
152
+ ISC License