Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mebtte committed Jan 22, 2024
1 parent e8f5e3a commit 7966a8b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 47 deletions.
48 changes: 48 additions & 0 deletions docs/run_by_source_code/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Run by source code

## Requirements

- [Node>=18](https://nodejs.org)

## Deployment

```sh
git clone https://github.com/mebtte/cicada.git
cd cicada
npm ci
npm run build:pwa
npm start -- -- start --port <port> --data <data> # attention: double --
```

When needing upgrade, you should run below commands:

```sh
git pull # pull the latest code
npm run build:pwa # rebuild pwa
npm start -- -- start --port <port> --data <data> # restart the server
```

## Migration

```sh
git fetch -p
git switch v2
npm ci
npm start -- -- upgrade-data <data>
```

## Music import

```sh
# import directory
npm start -- -- import --data /path_to/cicada_data --recursive <music_directory>

# import file
npm start -- -- import --data /path_to/cicada_data <music>
```

## Data fix

```sh
npm start -- -- fix-data <data>
```
51 changes: 4 additions & 47 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can deploy cicada by under options, and initial user of cicada is `username:

Download from [releases](https://github.com/mebtte/cicada/releases) and start server:

> If your platform isn't x64, you can [build](./docs/build/index.md) by yourself
> If your platform isn't x64, you can [build](./docs/build/index.md) by yourself or deploy by [source code](./docs/run_by_source_code/index.md).
```sh
./cicada start
Expand Down Expand Up @@ -72,26 +72,6 @@ services:
- /path/data:/data
```
### Source Code
When using source code to deploy, you should install [Node>=18](https://nodejs.org) first.
```sh
git clone https://github.com/mebtte/cicada.git
cd cicada
npm ci
npm run build:pwa
npm start -- -- start --port <port> --data <data> # attention: double --
```

When needing to upgrade, you should run below commands:

```sh
git pull # pull the latest code
npm run build:pwa # rebuild pwa
npm start -- -- start --port <port> --data <data> # restart the server
```

## Migration
### From v1 to v2
Expand All @@ -110,20 +90,11 @@ cicada upgrade-data <data>
docker run -it --rm -v <data>:/data mebtte/cicada:v2 upgrade-data /data
```

#### Source Code

```sh
git fetch -p
git switch v2
npm ci
npm start -- -- upgrade-data <data>
```

#### Other versions

- [From v0 to v1](https://github.com/mebtte/cicada/tree/v1#from-v0-to-v1)

## Import music
## Music import

You can use `cicada import` to import music file and music directory, but the filename must to fit the below format:

Expand Down Expand Up @@ -153,34 +124,20 @@ docker run -it --rm -v <data>:/data mebtte/cicada:v2 -v <music_directory>:/sourc
docker run -it --rm -v <data>:/data mebtte/cicada:v2 -v <music_directory>:/source import --data /path_to/cicada_data --recursive /source/<music>
```

### Source Code

```sh
# import directory
npm start -- -- import --data /path_to/cicada_data --recursive <music_directory>

# import file
npm start -- -- import --data /path_to/cicada_data <music>
```

## Fix data
## Data fixing

According to known issues, some old versions of cicada will breakdown the data, you can fix it by using below command:

```sh
cicada fix-data <data>
```

This command is unharmful, so you can run it even the data isn't broken. Also can run the command by docker or source code:
This command is unharmful, so you can run it even the data isn't broken. Also can run the command by docker:

```sh
docker run -it --rm -v <data>:/data mebtte/cicada:v2 fix-data /data
```

```sh
npm start -- -- fix-data <data>
```

## Development

Cicada is a **monorepo** that contains two sub-projects under the `apps` directory. `cli` is for the server, which is used to manage assets and start services. `pwa` is for the client, which is used to access for users. And there is a `shared` directory on the root, which contains the code runs on both `cli` and `pwa`.
Expand Down

0 comments on commit 7966a8b

Please sign in to comment.