-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
741 additions
and
243 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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
#!/bin/zsh -e | ||
|
||
golint -set_exit_status ./... | ||
go mod tidy -v | ||
docker compose up -d mysql mariadb postgres | ||
|
||
export SHIORI_TEST_PG_URL="postgres://shiori:shiori@localhost:5432/shiori?sslmode=disable" | ||
export SHIORI_TEST_MYSQL_URL="shiori:shiori@(localhost:3306)/shiori" | ||
export SHIORI_TEST_MARIADB_URL="shiori:shiori@(localhost:3307)/shiori" | ||
|
||
make lint | ||
|
||
make unittest GOTESTFMT_FLAGS="-hide all" |
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
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 |
---|---|---|
|
@@ -9,18 +9,10 @@ | |
|
||
To run the current development server with the defaults you can run the following command: | ||
|
||
```bash | ||
make serve | ||
``` | ||
|
||
If you want to run the refactored server, you can run the following command: | ||
|
||
```bash | ||
make run-server | ||
``` | ||
|
||
> **ℹ️ Note:** For more information into what the _refactored server_ means, please check this issue: https://github.com/go-shiori/shiori/issues/640 | ||
## Updating the API documentation | ||
|
||
> **ℹ️ Note:** This only applies for the Rest API documentation under the `internal/http` folder, **not** the one under `internal/webserver`. | ||
|
@@ -65,14 +57,19 @@ In order to run the test suite, you need to have running a local instance of Mar | |
If you have docker, you can do this by running the following command with the compose file provided: | ||
|
||
```bash | ||
docker-compose up -d mariadb postgres | ||
docker-compose up -d mariadb mysql postgres | ||
``` | ||
|
||
After that, provide the `SHIORI_TEST_PG_URL` and `SHIORI_TEST_MYSQL_URL` environment variables with the connection string to the databases: | ||
After that, provide the environment variables for the unitest to connect to the database engines: | ||
|
||
- `SHIORI_TEST_MYSQL_URL` for MySQL | ||
- `SHIORI_TEST_MARIADB_URL` for MariaDB | ||
- `SHIORI_TEST_PG_URL` for PostgreSQL | ||
|
||
``` | ||
SHIORI_TEST_PG_URL=postgres://shiori:[email protected]:5432/shiori?sslmode=disable | ||
SHIORI_TEST_MYSQL_URL=shiori:shiori@tcp(127.0.0.1:3306)/shiori | ||
SHIORI_TEST_MARIADB_URL=shiori:shiori@tcp(127.0.0.1:3307)/shiori | ||
``` | ||
|
||
Finally, run the tests with the following command: | ||
|
@@ -94,3 +91,33 @@ mkdocs serve | |
This will start a local server at `http://127.0.0.1:8000` where you can preview your changes in real-time. | ||
|
||
Documentation for production is generated automatically on every release and published using github pages. | ||
|
||
## Running the server with docker | ||
|
||
To run the development server using Docker, you can use the provided `docker-compose.yaml` file which includes both PostgreSQL and MariaDB databases: | ||
|
||
```bash | ||
docker compose up shiori | ||
``` | ||
|
||
This will start the Shiori server on port 8080 with hot-reload enabled. Any changes you make to the code will automatically rebuild and restart the server. | ||
|
||
By default, it uses SQLite mounting the local `dev-data` folder in the source code path. To use MariaDB or PostgreSQL instead, uncomment the `SHIORI_DATABASE_URL` line for the appropriate engine in the `docker-compose.yaml` file. | ||
|
||
## Running the server using an nginx reverse proxy and a custom webroot | ||
|
||
To test Shiori behind an nginx reverse proxy with a custom webroot (e.g., `/shiori/`), you can use the provided nginx configuration: | ||
|
||
1. First, ensure the `SHIORI_HTTP_ROOT_PATH` environment variable is uncommented in `docker-compose.yaml`: | ||
```yaml | ||
SHIORI_HTTP_ROOT_PATH: /shiori/ | ||
``` | ||
2. Then start both Shiori and nginx services: | ||
```bash | ||
docker compose up shiori nginx | ||
``` | ||
|
||
This will start the shiori service along with nginx. You can access Shiori using [http://localhost:8081/shiori](http://localhost:8081/shiori). | ||
|
||
The nginx configuration in `testdata/nginx.conf` handles all the necessary configuration. |
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
Oops, something went wrong.