Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust Rewrite #4

Draft
wants to merge 132 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
783ae72
Initial commit
ErrorNoInternet Mar 3, 2023
d765e48
Add new README
ErrorNoInternet Mar 3, 2023
e9dc41a
Add GPL license
ErrorNoInternet Mar 4, 2023
f2cb9a3
Add basic dependencies
ErrorNoInternet Apr 10, 2023
93f6818
hello, openheimer!
ErrorNoInternet Apr 10, 2023
fab1c3f
Add database trait
ErrorNoInternet Apr 10, 2023
e5b63c2
Add SQLite database (for now)
ErrorNoInternet Apr 10, 2023
ffa9180
Add server/player structs
ErrorNoInternet Apr 10, 2023
951df31
Add basic player struct
ErrorNoInternet Apr 10, 2023
c940e95
Add server struct
ErrorNoInternet Apr 10, 2023
fa700f4
Update Minecraft structs
ErrorNoInternet May 3, 2023
6ffa216
Add database locations
ErrorNoInternet May 3, 2023
f8fcc1d
Add logger
ErrorNoInternet May 3, 2023
a5513b0
Print startup message
ErrorNoInternet May 3, 2023
87a479d
Add verbosity levels
ErrorNoInternet May 3, 2023
67d7256
Add basic argument parser
ErrorNoInternet May 3, 2023
dbfbcf2
Bump version
ErrorNoInternet May 3, 2023
b6fed3a
Add basic configuration structs
ErrorNoInternet May 3, 2023
d1e5270
Add required dependencies
ErrorNoInternet May 3, 2023
4932ee2
Format code
ErrorNoInternet May 3, 2023
9b35fe0
Add serde_derive
ErrorNoInternet Jun 20, 2023
35e674c
Add serde_derive
ErrorNoInternet Jun 20, 2023
33aca3f
Rename sqlite to sqlite3
ErrorNoInternet Jun 20, 2023
90fdb6d
Read and parse configuration
ErrorNoInternet Jun 20, 2023
49a8a32
Improve log_error
ErrorNoInternet Jun 20, 2023
4b1169a
Ignore configuration file
ErrorNoInternet Jun 20, 2023
ddc5959
Add serde_derive
ErrorNoInternet Jun 20, 2023
6e1e14a
Update dependencies
ErrorNoInternet Jun 20, 2023
57bb1ea
Add ConfigurationWarning
ErrorNoInternet Jun 20, 2023
37cdcce
Parse configuration
ErrorNoInternet Jun 20, 2023
8d3203e
Parse & print configuration
ErrorNoInternet Jun 20, 2023
d1e9509
defualt
ErrorNoInternet Jun 20, 2023
7330234
Add Discord link
ErrorNoInternet Jun 20, 2023
4fdaccf
Update dependencies
ErrorNoInternet Jul 22, 2023
f3fd886
you happy now? 🤓
ErrorNoInternet Oct 11, 2023
74ba557
Add warning message
ErrorNoInternet Oct 11, 2023
a13aeda
Update dependencies
ErrorNoInternet Oct 11, 2023
e665f03
Add Nix flake
ErrorNoInternet Oct 11, 2023
c6a053a
Remove extra space
ErrorNoInternet Oct 15, 2023
3489466
Use serde for configuration deserialization
ErrorNoInternet Oct 16, 2023
1cafb00
Add serde_json
ErrorNoInternet Oct 16, 2023
51c332d
Add Serialize trait to server & player
ErrorNoInternet Oct 16, 2023
6f348b7
Fix Database trait
ErrorNoInternet Oct 16, 2023
ca44bd6
Add basic trait functions for sqlite3 database
ErrorNoInternet Oct 16, 2023
652864f
Use clap_derive for arguments
ErrorNoInternet Oct 16, 2023
784f21e
Use `Information` instead of `Verbose1`
ErrorNoInternet Oct 16, 2023
a6663a5
chore: ignore binary and logs
ErrorNoInternet Dec 17, 2023
d0f8367
perf: cargo build optimizations
ErrorNoInternet Dec 17, 2023
664cfa6
chore(cargo): trim build dependency paths
ErrorNoInternet Jan 7, 2024
ccf3af5
chore(nix): fix up flake
ErrorNoInternet Jan 7, 2024
b6402af
chore: add fetch.sh for npcap
ErrorNoInternet Jan 7, 2024
6ed9063
feat(pnet): windows support
ErrorNoInternet Jan 7, 2024
fe01b9b
feat: git commit hash version
ErrorNoInternet Jan 7, 2024
a461663
chore: add TODO
ErrorNoInternet Jan 7, 2024
22e06fa
chore(cargo): update dependencies
ErrorNoInternet Jan 7, 2024
fd3aa72
chore: use mold linker
ErrorNoInternet Jan 7, 2024
9cf7a7b
chore(TODO): cleanup work
ErrorNoInternet Jan 7, 2024
a112426
chore: docs/
ErrorNoInternet Jan 7, 2024
4d4efea
refactor: remove todo
ErrorNoInternet Jan 7, 2024
8005aa6
chore(todo): github projects
ErrorNoInternet Jan 7, 2024
1eabb6e
refactor: oxidize
ErrorNoInternet Jan 15, 2024
8d0ae72
chore(TODO): tracing
ErrorNoInternet Jan 16, 2024
5131a96
chore(cargo): tweak options
ErrorNoInternet Jan 28, 2024
498e6c9
chore(nix): flake package fixes
ErrorNoInternet Jan 28, 2024
e1730d6
chore(deps): add tracing
ErrorNoInternet Jan 28, 2024
6441f96
chore(deps): add tracing subscriber and appender
ErrorNoInternet Jan 29, 2024
c0d3b56
feat: new logging system
ErrorNoInternet Jan 29, 2024
6d618f0
chore(TODO): finish tracing
ErrorNoInternet Jan 29, 2024
6741dcc
tweak(nix): version => "dev"
ErrorNoInternet Jan 29, 2024
1c275fa
feat: versioning
ErrorNoInternet Jan 29, 2024
50b335a
refactor: minor cleanups
ErrorNoInternet Jan 29, 2024
41210d7
refactor(database): serialize helper function
ErrorNoInternet Jan 29, 2024
4171a19
feat: configuration subcommand
ErrorNoInternet Jan 29, 2024
1f8a3e6
refactor: add help text
ErrorNoInternet Jan 29, 2024
e500d1c
feat: `start` subcommand
ErrorNoInternet Jan 29, 2024
63df4e5
test: add basic logging test
ErrorNoInternet Jan 29, 2024
07df3e5
chore(TODO): update
ErrorNoInternet Jan 29, 2024
c2b3c3e
chore(TODO): switch to github projects
ErrorNoInternet Jan 29, 2024
11fc020
chore: add dependabot
ErrorNoInternet Jan 29, 2024
bfc5e69
ci: rust and nix workflows
ErrorNoInternet Jan 29, 2024
002b1ce
refactor: public minecraft objects
ErrorNoInternet Jan 29, 2024
d2d6446
ci: organize workflows
ErrorNoInternet Jan 29, 2024
ff31a02
refactor: clean up flake
ErrorNoInternet Jan 29, 2024
4a06d74
refactor(flake): remove dead code
ErrorNoInternet Jan 29, 2024
fd9266b
refactor(flake): devShell -> devShells.default
ErrorNoInternet Jan 29, 2024
dc1f3e7
chore(flake): switch to flake-parts
ErrorNoInternet Jan 29, 2024
3423f36
ci: add cachix
ErrorNoInternet Jan 29, 2024
99507f0
ci: tweak job name
ErrorNoInternet Jan 29, 2024
360ef03
refactor(flake): format
ErrorNoInternet Jan 29, 2024
70bef5c
ci: treat warnings as errors
ErrorNoInternet Jan 29, 2024
23ce454
refactor: remove bool returns
ErrorNoInternet Jan 29, 2024
ebcbf14
ci: remove cachix
ErrorNoInternet Jan 29, 2024
e43203e
fix: remove target cpu
ErrorNoInternet Jan 29, 2024
ab7335e
refactor: sqlite3 -> sqlite
ErrorNoInternet Jan 29, 2024
3f0e803
refactor: acquire_connection helper
ErrorNoInternet Jan 29, 2024
3b6aebe
refactor: make crate public
ErrorNoInternet Jan 29, 2024
c0a2f71
Revert "refactor: make crate public"
ErrorNoInternet Jan 29, 2024
dbfb3be
chore(gitignore): cleanups
ErrorNoInternet Jan 29, 2024
0c8c607
chore: +x fetch.sh
ErrorNoInternet Jan 29, 2024
919cbac
chore: minor cleanups
ErrorNoInternet Jan 29, 2024
cb21c6c
tweak(cargo): release mode options
ErrorNoInternet Jan 29, 2024
0a22003
chore(deps): update everything
ErrorNoInternet Jan 29, 2024
b4b9267
fix: file logging
ErrorNoInternet Jan 29, 2024
dd335fa
feat: better logger setup
ErrorNoInternet Jan 29, 2024
3b97fee
refactor: oxidize
ErrorNoInternet Jan 29, 2024
0f77774
refactor: trim configuration file
ErrorNoInternet Jan 29, 2024
6c9542a
feat: better error printing
ErrorNoInternet Jan 29, 2024
8b1edd2
feat: better configuration handling
ErrorNoInternet Jan 29, 2024
41593af
refactor: split logging
ErrorNoInternet Jan 29, 2024
f443494
fix: verbosity
ErrorNoInternet Jan 29, 2024
08cf60d
refactor: set_up -> init
ErrorNoInternet Jan 29, 2024
2dff02f
ci: build
ErrorNoInternet Jan 29, 2024
b251bd6
chore(flake): add curl & unzip
ErrorNoInternet Jan 29, 2024
07def3f
chore(flake): add substituter
ErrorNoInternet Jan 29, 2024
5ed49ef
ci: add release workflow
ErrorNoInternet Jan 29, 2024
eaceaf3
ci: release workflow overhaul
ErrorNoInternet Jan 29, 2024
2b828d8
ci: improve support
ErrorNoInternet Jan 29, 2024
8faf501
chore(flake): drop macOS
ErrorNoInternet Jan 29, 2024
296a4bb
ci: fix dependabot
ErrorNoInternet Jan 30, 2024
4389b27
tweak: options -> fields
ErrorNoInternet Jan 30, 2024
92b350e
tweak: configuration help text
ErrorNoInternet Jan 30, 2024
1a54c66
feat(arguments): subcommand aliases
ErrorNoInternet Feb 1, 2024
d02d69e
build: replace with true
ErrorNoInternet Feb 1, 2024
87696ee
ci: lint Cargo.toml
ErrorNoInternet Feb 9, 2024
abf39c6
chore(deps): loosen version requirements
ErrorNoInternet Feb 9, 2024
158b00f
chore(deps): update everything
ErrorNoInternet Feb 9, 2024
e668264
chore(nix): fix nixConfig
ErrorNoInternet Feb 9, 2024
07055f7
chore(nix): update inputs
ErrorNoInternet Feb 12, 2024
a4233a0
chore(deps): update everything
ErrorNoInternet Feb 12, 2024
d18685a
refactor: oxidize
ErrorNoInternet Feb 12, 2024
48fea95
chore(nix): use shortRev for version
ErrorNoInternet Feb 23, 2024
8eb1780
refactor(nix): clean up flake
ErrorNoInternet May 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

[target.x86_64-unknown-linux-musl]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: "daily"
47 changes: 47 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build
on:
push:
paths:
- '**.nix'
- '**.rs'
- Cargo.*
- flake.lock
pull_request:
workflow_dispatch:

jobs:
openheimer:
name: openheimer
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
include:
- system: x86_64-linux
- system: aarch64-linux

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install QEMU
run: |
sudo apt update -y
sudo apt install -y qemu-user-static

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500
system = ${{ matrix.system }}

- name: Set up Cachix
uses: cachix/cachix-action@v13
with:
name: errornobinaries
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build for ${{ matrix.system }}
run: nix build -L
68 changes: 68 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Check
on:
push:
paths:
- '**.nix'
- '**.rs'
- Cargo.*
- flake.lock
pull_request:
workflow_dispatch:

jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-22.04

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500

- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Set up build cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-${{ runner.os }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('flake.nix') }}-${{ hashFiles('**.lock') }}

- name: Run cargo test
run: nix develop -c cargo t -v

nix-flake:
name: Nix flake
runs-on: ubuntu-22.04

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500

- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v5
with:
fail-mode: true
check-outdated: false

- name: Check Nix flake outputs
run: nix flake check -v --all-systems
98 changes: 98 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Lint
on:
push:
paths:
- '**.nix'
- '**.rs'
- Cargo.*
- flake.lock
pull_request:
workflow_dispatch:

jobs:
cargo-toml:
name: Cargo.toml
runs-on: ubuntu-22.04

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500

- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v3

- name: Run taplo lint
run: nix develop -c taplo lint Cargo.toml

- name: Run taplo fmt
if: always()
run: nix develop -c taplo fmt --check Cargo.toml

rust:
name: Rust
runs-on: ubuntu-22.04

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500

- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v3

- name: Set up build cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-${{ runner.os }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('flake.nix') }}-${{ hashFiles('**.lock') }}

- name: cargo clippy
run: nix develop -c cargo clippy -- -Dwarnings -Wclippy::pedantic

- name: cargo fmt
if: always()
run: nix develop -c cargo fmt --check

nix:
name: Nix
runs-on: ubuntu-22.04

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500

- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v3

- name: Check formatting
run: nix run nixpkgs#alejandra -- -c .

- name: Run static code analysis
if: always()
run: nix run nixpkgs#statix -- check

- name: Scan for dead code
if: always()
run: nix run nixpkgs#deadnix -- -f
48 changes: 48 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release
on:
release:
types: [created]

jobs:
compile:
name: Compile
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
path: target/x86_64-pc-windows-gnu/release/openheimer.exe
extension: .exe

- target: x86_64-unknown-linux-musl
path: target/x86_64-unknown-linux-musl/release/openheimer
extension: ""

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500

- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Fetch dependencies
run: lib/fetch.sh

- name: Compile for ${{ matrix.target }}
run: nix develop -c cargo b -r --target ${{ matrix.target }}

- name: Upload build artifacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ${{ matrix.path }}
asset_name: openheimer_${{ matrix.target }}${{ matrix.extension }}
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
openheimer
openheimer.db
openheimer.log
ips
old-db
lib/npcap

/target

*.log
openheimer*
Loading
Loading