Compare commits
5
Commits
6707364251
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1f14a5bba
|
||
|
|
0cad77fb39
|
||
|
|
14e22db8ec
|
||
|
|
a827bd5eef
|
||
|
|
911ae77516
|
@@ -14,7 +14,7 @@ skopeo copy \
|
|||||||
"docker-archive:result" \
|
"docker-archive:result" \
|
||||||
"docker://${IMAGE}"
|
"docker://${IMAGE}"
|
||||||
|
|
||||||
if [ "${GITEA_REF_TYPE:-}" = "branch" ] && [ "${GITEA_REF_NAME:-}" = "main" ]; then
|
if [ "${REF_NAME:-}" = "main" ]; then
|
||||||
skopeo copy \
|
skopeo copy \
|
||||||
--dest-creds "${USERNAME}:${PASSWORD}" \
|
--dest-creds "${USERNAME}:${PASSWORD}" \
|
||||||
"docker-archive:result" \
|
"docker-archive:result" \
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ jobs:
|
|||||||
REPOSITORY: "${{ gitea.repository }}"
|
REPOSITORY: "${{ gitea.repository }}"
|
||||||
USERNAME: "${{ secrets.REGISTRY_USER }}"
|
USERNAME: "${{ secrets.REGISTRY_USER }}"
|
||||||
PASSWORD: "${{ secrets.REGISTRY_TOKEN }}"
|
PASSWORD: "${{ secrets.REGISTRY_TOKEN }}"
|
||||||
|
REF_NAME: "${{ gitea.ref_name }}"
|
||||||
TAG: "${{ gitea.sha }}"
|
TAG: "${{ gitea.sha }}"
|
||||||
run: .gitea/scripts/push-image.sh
|
run: bash .gitea/scripts/push-image.sh
|
||||||
|
|
||||||
build-wordle-solver-web-image:
|
build-wordle-solver-web-image:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
@@ -41,5 +42,6 @@ jobs:
|
|||||||
REPOSITORY: "${{ gitea.repository }}-web"
|
REPOSITORY: "${{ gitea.repository }}-web"
|
||||||
USERNAME: "${{ secrets.REGISTRY_USER }}"
|
USERNAME: "${{ secrets.REGISTRY_USER }}"
|
||||||
PASSWORD: "${{ secrets.REGISTRY_TOKEN }}"
|
PASSWORD: "${{ secrets.REGISTRY_TOKEN }}"
|
||||||
|
REF_NAME: "${{ gitea.ref_name }}"
|
||||||
TAG: "${{ gitea.sha }}"
|
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,
|
nginx,
|
||||||
runCommand,
|
runCommand,
|
||||||
wordle-solver-web,
|
wordle-solver-web,
|
||||||
writeShellScriptBin,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
dockerTools.buildImage {
|
dockerTools.buildImage {
|
||||||
@@ -21,10 +20,6 @@ let
|
|||||||
"nogroup:x:65534:"
|
"nogroup:x:65534:"
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
(writeShellScriptBin "start" ''
|
|
||||||
echo "Start serving worlde-solver at port 80..."
|
|
||||||
/bin/nginx -c /etc/nginx.conf
|
|
||||||
'')
|
|
||||||
(runCommand "nginx-conf" {} ''
|
(runCommand "nginx-conf" {} ''
|
||||||
mkdir -p $out/etc
|
mkdir -p $out/etc
|
||||||
|
|
||||||
@@ -47,13 +42,13 @@ let
|
|||||||
EOF
|
EOF
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
pathsToLink = ["/bin" "/etc"];
|
pathsToLink = ["/etc"];
|
||||||
};
|
};
|
||||||
runAsRoot = ''
|
runAsRoot = ''
|
||||||
mkdir -p /var/log/nginx
|
mkdir -p /var/log/nginx
|
||||||
'';
|
'';
|
||||||
config = {
|
config = {
|
||||||
Cmd = ["/bin/start"];
|
Cmd = ["${nginx}/bin/nginx" "-c" "/etc/nginx.conf"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|||||||
+2
-1
@@ -4,13 +4,14 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"serve": "run-s wasm-pack:release vite:serve",
|
||||||
"build-no-wasm": "run-s tsc vite:build",
|
"build-no-wasm": "run-s tsc vite:build",
|
||||||
"build": "run-s wasm-pack:release tsc vite:build",
|
"build": "run-s wasm-pack:release tsc vite:build",
|
||||||
"dev": "run-s wasm-pack:dev vite:dev",
|
"dev": "run-s wasm-pack:dev vite:dev",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"vite:build": "vite build",
|
"vite:build": "vite build",
|
||||||
"vite:dev": "vite -c vite.config.dev.ts",
|
"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: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 ."
|
"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