Compare commits
5
Commits
6707364251
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1f14a5bba
|
||
|
|
0cad77fb39
|
||
|
|
14e22db8ec
|
||
|
|
a827bd5eef
|
||
|
|
911ae77516
|
@@ -14,7 +14,7 @@ skopeo copy \
|
||||
"docker-archive:result" \
|
||||
"docker://${IMAGE}"
|
||||
|
||||
if [ "${GITEA_REF_TYPE:-}" = "branch" ] && [ "${GITEA_REF_NAME:-}" = "main" ]; then
|
||||
if [ "${REF_NAME:-}" = "main" ]; then
|
||||
skopeo copy \
|
||||
--dest-creds "${USERNAME}:${PASSWORD}" \
|
||||
"docker-archive:result" \
|
||||
|
||||
@@ -21,8 +21,9 @@ jobs:
|
||||
REPOSITORY: "${{ gitea.repository }}"
|
||||
USERNAME: "${{ secrets.REGISTRY_USER }}"
|
||||
PASSWORD: "${{ secrets.REGISTRY_TOKEN }}"
|
||||
REF_NAME: "${{ gitea.ref_name }}"
|
||||
TAG: "${{ gitea.sha }}"
|
||||
run: .gitea/scripts/push-image.sh
|
||||
run: bash .gitea/scripts/push-image.sh
|
||||
|
||||
build-wordle-solver-web-image:
|
||||
runs-on: nixos
|
||||
@@ -41,5 +42,6 @@ jobs:
|
||||
REPOSITORY: "${{ gitea.repository }}-web"
|
||||
USERNAME: "${{ secrets.REGISTRY_USER }}"
|
||||
PASSWORD: "${{ secrets.REGISTRY_TOKEN }}"
|
||||
REF_NAME: "${{ gitea.ref_name }}"
|
||||
TAG: "${{ gitea.sha }}"
|
||||
run: .gitea/scripts/push-image.sh
|
||||
run: bash .gitea/scripts/push-image.sh
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# Wordle Solver
|
||||
|
||||
This wordle solver uses an information theory based approach to evaluate the next-best-guess. It's heavily inspired by [3b1b's approach](https://www.youtube.com/watch?v=v68zYyaEmEA) on solving wordle.
|
||||
|
||||
There are two ways to use the wordle-solver.
|
||||
|
||||
1. a CLI tool
|
||||
2. a web interface
|
||||
|
||||
|
||||
# Docker
|
||||
|
||||
#### CLI
|
||||
```sh
|
||||
docker run --rm -it git.jroeger.de/jonas/wordle-solver-rs
|
||||
```
|
||||
|
||||
#### web
|
||||
``` sh
|
||||
docker run -p 8080:80 --rm -it git.jroeger.de/jonas/wordle-solver-rs-web
|
||||
```
|
||||
|
||||
# Nix
|
||||
|
||||
#### CLI
|
||||
|
||||
``` sh
|
||||
nix run .
|
||||
```
|
||||
|
||||
#### Static web site
|
||||
|
||||
``` sh
|
||||
nix build git+http://git.jroeger.de/jonas/wordle-solver-rs#wordle-solver-web
|
||||
```
|
||||
|
||||
# Native
|
||||
|
||||
#### CLI
|
||||
|
||||
you will need to have `cargo` installed.
|
||||
|
||||
```sh
|
||||
cargo run --profile release
|
||||
```
|
||||
|
||||
#### web
|
||||
|
||||
you need the following tools:
|
||||
- `wasm-pack`
|
||||
- `wasm-bindgen`
|
||||
- `cargo`
|
||||
- `nodejs`
|
||||
- `yarn`
|
||||
|
||||
``` sh
|
||||
cd web
|
||||
yarn install
|
||||
yarn serve # or yarn build
|
||||
```
|
||||
@@ -6,7 +6,6 @@ let
|
||||
nginx,
|
||||
runCommand,
|
||||
wordle-solver-web,
|
||||
writeShellScriptBin,
|
||||
...
|
||||
}:
|
||||
dockerTools.buildImage {
|
||||
@@ -21,10 +20,6 @@ let
|
||||
"nogroup:x:65534:"
|
||||
];
|
||||
})
|
||||
(writeShellScriptBin "start" ''
|
||||
echo "Start serving worlde-solver at port 80..."
|
||||
/bin/nginx -c /etc/nginx.conf
|
||||
'')
|
||||
(runCommand "nginx-conf" {} ''
|
||||
mkdir -p $out/etc
|
||||
|
||||
@@ -47,13 +42,13 @@ let
|
||||
EOF
|
||||
'')
|
||||
];
|
||||
pathsToLink = ["/bin" "/etc"];
|
||||
pathsToLink = ["/etc"];
|
||||
};
|
||||
runAsRoot = ''
|
||||
mkdir -p /var/log/nginx
|
||||
'';
|
||||
config = {
|
||||
Cmd = ["/bin/start"];
|
||||
Cmd = ["${nginx}/bin/nginx" "-c" "/etc/nginx.conf"];
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
||||
+2
-1
@@ -4,13 +4,14 @@
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"serve": "run-s wasm-pack:release vite:serve",
|
||||
"build-no-wasm": "run-s tsc vite:build",
|
||||
"build": "run-s wasm-pack:release tsc vite:build",
|
||||
"dev": "run-s wasm-pack:dev vite:dev",
|
||||
"tsc": "tsc",
|
||||
"vite:build": "vite build",
|
||||
"vite:dev": "vite -c vite.config.dev.ts",
|
||||
"vite:preview": "vite preview",
|
||||
"vite:serve": "vite -c vite.config.ts",
|
||||
"wasm-pack:dev": "rm -rf pkg; wasm-pack build --dev --features wasm-bindgen --manifest-path ../Cargo.toml; mv ../pkg .",
|
||||
"wasm-pack:release": "rm -rf pkg; wasm-pack build --features wasm-bindgen --manifest-path ../Cargo.toml; mv ../pkg ."
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user