Add Steam Deck docker for testing without SSL, fix x cors found in testing

This commit is contained in:
NGnius (Graham) 2022-12-09 21:41:39 -05:00
parent b86fa50f77
commit 428b994f71
6 changed files with 36 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/target /target
/store /store
not-decky-*

3
Dockerfile Normal file
View file

@ -0,0 +1,3 @@
FROM ghcr.io/steamdeckhomebrew/holo-toolchain-rust:latest
ENTRYPOINT [ "/not-decky-store/entrypoint.sh" ]

4
create_docker_img.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
# build docker container locally
docker build -t not_decky_store .

19
entrypoint.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
set -e
echo "Container's IP address: `awk 'END{print $1}' /etc/hosts`"
cd /not-decky-store
echo "--- Rust version info ---"
rustup --version
rustc --version
cargo --version
echo "--- Building plugin backend ---"
cargo build --release
cp target/release/not-decky-store ./not-decky-store-docker
echo " --- Cleaning up ---"
# remove estranged target folder
cargo clean

5
run_docker_img.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
# run docker container locally
# assumes you're running in the same dir as this script
docker run -i --entrypoint /not-decky-store/entrypoint.sh -v $PWD:/not-decky-store not_decky_store

View file

@ -28,7 +28,10 @@ async fn main() -> std::io::Result<()> {
HttpServer::new(move || { HttpServer::new(move || {
let cors = actix_cors::Cors::default() let cors = actix_cors::Cors::default()
.allowed_origin("https://steamloopback.host") //.allowed_origin("https://steamloopback.host")
.allow_any_origin()
.send_wildcard()
.allow_any_method()
.allow_any_header() .allow_any_header()
.expose_any_header(); .expose_any_header();