mirror of https://github.com/nocodb/nocodb
Pranav C
2 months ago
21 changed files with 198 additions and 34 deletions
@ -0,0 +1,5 @@ |
|||||||
|
tsconfig.json |
||||||
|
webpack.config.js |
||||||
|
src |
||||||
|
node_modules |
||||||
|
scripts |
File diff suppressed because one or more lines are too long
@ -0,0 +1,68 @@ |
|||||||
|
/*! |
||||||
|
* mime-db |
||||||
|
* Copyright(c) 2014 Jonathan Ong |
||||||
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson |
||||||
|
* MIT Licensed |
||||||
|
*/ |
||||||
|
|
||||||
|
/*! |
||||||
|
* mime-types |
||||||
|
* Copyright(c) 2014 Jonathan Ong |
||||||
|
* Copyright(c) 2015 Douglas Christopher Wilson |
||||||
|
* MIT Licensed |
||||||
|
*/ |
||||||
|
|
||||||
|
/*! ***************************************************************************** |
||||||
|
Copyright (C) Microsoft. All rights reserved. |
||||||
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use |
||||||
|
this file except in compliance with the License. You may obtain a copy of the |
||||||
|
License at http://www.apache.org/licenses/LICENSE-2.0 |
||||||
|
|
||||||
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||||
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED |
||||||
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, |
||||||
|
MERCHANTABLITY OR NON-INFRINGEMENT. |
||||||
|
|
||||||
|
See the Apache Version 2.0 License for specific language governing permissions |
||||||
|
and limitations under the License. |
||||||
|
***************************************************************************** */ |
||||||
|
|
||||||
|
/** |
||||||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd |
||||||
|
* |
||||||
|
* @author Naveen MR <oof1lab@gmail.com> |
||||||
|
* @author Pranav C Balan <pranavxc@gmail.com> |
||||||
|
* |
||||||
|
* @license GNU AGPL version 3 or any later version |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU Affero General Public License as |
||||||
|
* published by the Free Software Foundation, either version 3 of the |
||||||
|
* License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU Affero General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
/** @preserve |
||||||
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c |
||||||
|
* derived from CryptoJS.mode.CTR |
||||||
|
* Jan Hruby jhruby.web@gmail.com |
||||||
|
*/ |
||||||
|
|
||||||
|
/** @preserve |
||||||
|
(c) 2012 by Cédric Mesnil. All rights reserved. |
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||||
|
|
||||||
|
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||||
|
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
*/ |
@ -0,0 +1,60 @@ |
|||||||
|
--- |
||||||
|
title: 'Updating Secrets' |
||||||
|
description: 'Learn how to update secrets in NocoDB using the nc-secret-cli package.' |
||||||
|
tags: ['Secrets', 'nc-secret-cli', 'Update', 'Security'] |
||||||
|
keywords: ['NocoDB secrets', 'nc-secret-cli', 'Update', 'Security'] |
||||||
|
--- |
||||||
|
|
||||||
|
## Updating Secrets |
||||||
|
|
||||||
|
To update a secret in NocoDB, you can use the `nc-secret-cli` package. Follow the steps below to update a secret: |
||||||
|
|
||||||
|
### Using the Command Line Interface (CLI) |
||||||
|
|
||||||
|
1. Install the `nc-secret-cli` package if you haven't already. You can do this by running the following command in your terminal: |
||||||
|
|
||||||
|
```bash |
||||||
|
npm install -g nc-secret-cli |
||||||
|
``` |
||||||
|
|
||||||
|
2. Once the package is installed, you can update a secret by running the following command: |
||||||
|
|
||||||
|
```bash |
||||||
|
NC_DB="pg://host:port?u=user&p=password&d=database" nc-secret-cli update --prev <previous-secret> --new <new-secret> |
||||||
|
``` |
||||||
|
|
||||||
|
OR |
||||||
|
|
||||||
|
```bash |
||||||
|
NC_DB="pg://host:port?u=user&p=password&d=database" nc-secret-cli <previous-secret> --new <new-secret |
||||||
|
``` |
||||||
|
|
||||||
|
Replace `<prev-secret>` with the name of the secret you used previously, and `<new-secret>` with the new value of the secret. |
||||||
|
|
||||||
|
3. After running the command, the secret will be updated in NocoDB. |
||||||
|
|
||||||
|
### Using Executables |
||||||
|
|
||||||
|
Alternatively, you can use the `nc-secret-cli` executable to update secrets. |
||||||
|
|
||||||
|
1. Download the `nc-secret-cli` executable from the [NocoDB website](https://github.com/nocodb/nc-secret-cli/releases/latest). |
||||||
|
4. Run the executable using the following command: |
||||||
|
|
||||||
|
```bash |
||||||
|
NC_DB="pg://host:port?u=user&p=password&d=database" ./nc-secret-macos-arm64 update --prev <previous-secret> --new <new-secret> |
||||||
|
``` |
||||||
|
|
||||||
|
Replace `<prev-secret>` with the name of the secret you used previously, and `<new-secret>` with the new value of the secret. |
||||||
|
|
||||||
|
5. After running the command, the secret will be updated in NocoDB. |
||||||
|
|
||||||
|
|
||||||
|
Note: All environment variables are supported, including `NC_DB`, `NC_DB_JSON`, `NC_DB_JSON_FILE`, `DATABASE_URL`, and `DATABASE_URL_FILE`. You can use any of these variables to specify your database connection. Alternately you can use following equivalent parameters. |
||||||
|
|
||||||
|
| Environment Variable | CLI Parameter | |
||||||
|
| --------------------- | -------------- | |
||||||
|
| `NC_DB` | `--nc-db` | |
||||||
|
| `NC_DB_JSON` | `--nc-db-json` | |
||||||
|
| `NC_DB_JSON_FILE` | `--nc-db-json-file` | |
||||||
|
| `DATABASE_URL` | `--database-url` | |
||||||
|
| `DATABASE_URL_FILE` | `--database-url-file` | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,13 +0,0 @@ |
|||||||
process.env.NC_BINARY_BUILD = 'true'; |
|
||||||
(async () => { |
|
||||||
try { |
|
||||||
const app = require('express')(); |
|
||||||
const {Noco} = require("nocodb"); |
|
||||||
const port = process.env.PORT || 8080; |
|
||||||
const httpServer = app.listen(port); |
|
||||||
app.use(await Noco.init({}, httpServer, app)); |
|
||||||
console.log(`Visit : localhost:${port}/dashboard`) |
|
||||||
} catch(e) { |
|
||||||
console.log(e) |
|
||||||
} |
|
||||||
})() |
|
@ -0,0 +1,8 @@ |
|||||||
|
const fs = require('fs') |
||||||
|
const path = require('path') |
||||||
|
|
||||||
|
const packageJsonPath =path.join(__dirname, '..', 'packages', 'nc-secret-cli', 'package.json') |
||||||
|
|
||||||
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) |
||||||
|
packageJson.version = process.env.targetVersion |
||||||
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, 0, 2)) |
Loading…
Reference in new issue