Merge pull request #7 from Xevion/0.2-fix

### Changed

- Mildly reformatted `README.md`
- A development mode check for the `app.state.ip_pool`'s initialization (caused application failure in production only)

### Fixed

- Improper formatting of blockquote Alerts in `README.md`
This commit is contained in:
2024-11-01 17:11:49 -05:00
committed by GitHub
4 changed files with 33 additions and 21 deletions

View File

@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.2.1] - 2024-11-01
### Changed
- Mildly reformatted `README.md`
- A development mode check for the `app.state.ip_pool`'s initialization (caused application failure in production only)
### Fixed
- Improper formatting of blockquote Alerts in `README.md`
## [0.2.0] - 2024-11-01 ## [0.2.0] - 2024-11-01
### Added ### Added

View File

@@ -36,7 +36,8 @@ asdf install
This installs the version of Node.js specified in [`.tool-versions`](.tool-versions). This installs the version of Node.js specified in [`.tool-versions`](.tool-versions).
>[!NOTE] If you use Node.js for other projects, you may want to install the version you need & set it as the global version via `asdf global nodejs <version>` or `asdf install nodejs latest:<version>`. If you don't care, `asdf install latest nodejs` also works. > [!NOTE]
> If you use Node.js for other projects, you may want to install the version you need & set it as the global version via `asdf global nodejs <version>` or `asdf install nodejs latest:<version>`. If you don't care, `asdf install latest nodejs` also works.
2. Install `pnpm` with `npm install -g pnpm` 2. Install `pnpm` with `npm install -g pnpm`
3. `cd frontend` 3. `cd frontend`
@@ -58,7 +59,7 @@ This installs the version of Node.js specified in [`.tool-versions`](.tool-versi
3. Install backend dependencies with `poetry install`. 3. Install backend dependencies with `poetry install`.
4. Start the backend server with `./run.sh` 4. Start the backend server with `./run.sh`
5. (*optional*) Install the [Railway CLI][railway] 5. (_optional_) Install the [Railway CLI][railway]
- Fastest installation is via shell: `bash <(curl -fsSL cli.new)` - Fastest installation is via shell: `bash <(curl -fsSL cli.new)`
- Alternatives found [here][railway]. - Alternatives found [here][railway].
- This will let us skip creating a local `.env` file, as well as keeping your database URL synchronized. - This will let us skip creating a local `.env` file, as well as keeping your database URL synchronized.
@@ -66,7 +67,7 @@ This installs the version of Node.js specified in [`.tool-versions`](.tool-versi
## Usage ## Usage
A full stack (*frontend* and *backend*), automatically reloading project is possible, but it requires two terminals. A full stack (_frontend_ and _backend_), automatically reloading project is possible, but it requires two terminals.
1. Open a terminal in each respective directory (`/backend` and `/frontend`). 1. Open a terminal in each respective directory (`/backend` and `/frontend`).
2. Execute `./run.sh` to start the development server for each. 2. Execute `./run.sh` to start the development server for each.
@@ -74,7 +75,8 @@ A full stack (*frontend* and *backend*), automatically reloading project is poss
- See [`.env.example`](backend/.env.example) for a list of all available environment variables. - See [`.env.example`](backend/.env.example) for a list of all available environment variables.
- For the frontend, the defaults are already sufficient. - For the frontend, the defaults are already sufficient.
>[!WARNING] The `run.sh` scripts provide default environment variables internally; if you want to run the commands manually, you'll need to provide them to `.env` files or the command line. > [!WARNING]
> The `run.sh` scripts provide default environment variables internally; if you want to run the commands manually, you'll need to provide them to `.env` files or the command line.
[peewee]: https://docs.peewee-orm.com/en/latest/ [peewee]: https://docs.peewee-orm.com/en/latest/
[railway]: https://docs.railway.app/guides/cli [railway]: https://docs.railway.app/guides/cli

View File

@@ -67,10 +67,9 @@ scheduler.add_job(flush_ips, IntervalTrigger(seconds=5))
@asynccontextmanager @asynccontextmanager
async def lifespan(_: FastAPI) -> AsyncIterator[None]: async def lifespan(_: FastAPI) -> AsyncIterator[None]:
if is_development: # Originally, this was used to generate a pool of random IP addresses so we could demo a changing list.
# 42 is the answer to everything # Now, this isn't necessary, but I just wanna test it for now. It'll be removed pretty soon.
random.seed(42) random.seed(42) # 42 is the answer to everything
# Generate a pool of random IP addresses
app.state.ip_pool = [ app.state.ip_pool = [
".".join(str(random.randint(0, 255)) for _ in range(4)) for _ in range(50) ".".join(str(random.randint(0, 255)) for _ in range(4)) for _ in range(50)
] ]

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "linkpulse" name = "linkpulse"
version = "0.2.0" version = "0.2.1"
description = "" description = ""
authors = ["Xevion <xevion@xevion.dev>"] authors = ["Xevion <xevion@xevion.dev>"]
license = "GNU GPL v3" license = "GNU GPL v3"