-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added missing variables to .example.env - Updated docker compose file - Updated environment file - Fixed worker path in server.ts - Fixed Bull-Board not using port environment variable
- Loading branch information
1 parent
62c2446
commit b0e53fd
Showing
6 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,7 @@ NEW_STORAGE_ID= | |
ADD_JOBS= | ||
REDIS_HOST= | ||
REDIS_PORT= | ||
BULLMQ_PORT= | ||
BULLMQ_RESET_QUEUES= | ||
CONCURRENCY= | ||
DRY_RUN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,123 @@ | ||
# Iconik Proxy Migrator | ||
# Iconik Storage Migrator | ||
|
||
Migrates proxies in Iconik to another storage location | ||
Allows for seamless migration of different object types in Iconik to different storage locations. | ||
|
||
Simply install the application locally or with [Docker Compose](https://docs.docker.com/compose/), configure the settings to your liking, and watch it go with the included dashboard! | ||
|
||
## Features | ||
|
||
- Proxy migration | ||
- Concurrency | ||
- Dry run mode which allows for testing without making changes | ||
- Easily deployable through Docker | ||
|
||
## Installation | ||
|
||
**_Note: Certain project settings must be configured before it can be ran_** | ||
|
||
### Local | ||
|
||
First, clone the repository using [git](https://git-scm.com/) and then use [npm](https://www.npmjs.com/) to install the necessary node modules. If [Node.js](https://nodejs.org/) is not already installed, please do so before running npm. | ||
|
||
```bash | ||
# Clone the repository | ||
git clone https://github.com/bootsie123/iconik-storage-migrator.git | ||
|
||
# Enter the directory | ||
cd iconik-storage-migrator | ||
|
||
# Install the dependencies | ||
npm install | ||
|
||
# Copy example .env file | ||
cp .example.env .env | ||
|
||
# Configure the required environment variables | ||
nano .env | ||
``` | ||
|
||
### Docker | ||
|
||
Alternatively, you can install and configure the application with [Docker Compose](https://docs.docker.com/compose/). | ||
|
||
```bash | ||
# Clone the repository | ||
git clone https://github.com/bootsie123/iconik-storage-migrator.git | ||
|
||
# Enter the directory | ||
cd iconik-storage-migrator | ||
|
||
# Configure the required environment variables | ||
nano docker-compose.yml | ||
``` | ||
|
||
## Configuration | ||
|
||
In order to run the app, the following configuration options must be set in the `.env` file or within `docker-compose.yml`. | ||
|
||
| Name | Type | Default | Description | | ||
| -------------- | ------ | --------- | ------------------------------------------------- | | ||
| ICONIK_APP_ID | String | | The ID of the Iconik application token to use | | ||
| ICONIK_TOKEN | String | | The token of the Iconik application token to use | | ||
| NEW_STORAGE_ID | String | | The ID of the storage location to migrate to | | ||
| REDIS_HOST\* | String | localhost | The ip address or correction URL to use for Redis | | ||
| REDIS_PORT\* | Number | 6379 | The port to use for Redis | | ||
|
||
_Only needed if specifically running locally_ | ||
|
||
### Application Settings | ||
|
||
The following table shows the various configurations options which can be set and their default values. These settings can be set in the `.env` file (for local deployment) or within `docker-compose.yml` if using Docker Compose. | ||
|
||
| Name | Type | Default | Description | | ||
| ------------------- | ------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| ICONIK_APP_ID | String | | The ID of the Iconik application token to use | | ||
| ICONIK_TOKEN | String | | The token of the Iconik application token to use | | ||
| NEW_STORAGE_ID | String | | The ID of the storage location to migrate to | | ||
| REDIS_HOST\* | String | `redis` if production, otherwise `localhost` | The ip address or correction URL to use for Redis | | ||
| REDIS_PORT\* | Number | 6379 | The port to use for Redis | | ||
| ADD_JOBS | Boolean | true | Set to true if jobs should automatically be generated and added to their respective queues, otherwise if false, only existing jobs will be processed | | ||
| CONCURRENCY | Number | 10 | The number of concurrent jobs to process per worker | | ||
| BULLMQ_PORT | Number | 3000 | The port to use for the dashboard | | ||
| BULLMQ_RESET_QUEUES | Boolean | false | Set to true if all queues should be reset and jobs removed on start, false if otherwise | | ||
| DRY_RUN | Boolean | `true` if production, otherwise `false` | Determines whether dry run mode is enabled. In dry run mode, no changes are made and instead logged to the console | | ||
|
||
## Usage | ||
|
||
### Local | ||
|
||
To start the application locally simply run: | ||
|
||
```bash | ||
npm run build | ||
|
||
npm start | ||
``` | ||
|
||
This will start the migration and launch a progress dashboard on port `3000` by default. You can connect to it via `http://localhost:3000/status` or through the IP address of your computer `http://192.168.x.x:3000/status` | ||
|
||
### Docker | ||
|
||
To start the application with Docker, simply run: | ||
|
||
```bash | ||
docker compose up -d | ||
``` | ||
|
||
From there, you can then access the progress dashboard on port `3000` by default of your Docker host. For example: `http://192.168.x.x:3000/status` | ||
|
||
#### Logging | ||
|
||
To see all logs, simply run: | ||
|
||
```bash | ||
docker compose logs -f | ||
``` | ||
|
||
## Contributing | ||
|
||
Pull requests are welcome. Any changes are appreciated! | ||
|
||
## License | ||
|
||
This project is licensed under the [MIT License](https://choosealicense.com/licenses/mit/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters