diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..09301dc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +# flyctl launch added from .gitignore +target +fly.toml diff --git a/.env b/.env new file mode 100644 index 0000000..4681397 --- /dev/null +++ b/.env @@ -0,0 +1,24 @@ +HOST=0.0.0.0 +PORT=8000 + +#REDIS_URL=redis://default:ziURmFi6J9umiLDn8Ywxxqcl0nbnHWWs@redis-10502.c83.us-east-1-2.ec2.redns.redis-cloud.com:10502 +REDIS_URL=redis://default:wDpC7hY1CkdDOkjP6xP09UtzlCp5SL5Q@redis-16155.c270.us-east-1-3.ec2.redns.redis-cloud.com:16155 +#WS_SERVER=wss://websocket-rust-autumn-snow-632.fly.dev/ws +WS_SERVER=ws://localhost:8000/ws + + +# flyctl secrets set PORT=8000 +# flyctl secrets set REDIS_URL=redis://default:sHDDM6AwFAvue0xai1FmU3fe2jkozVIp@redis-17711.c90.us-east-1-3.ec2.redns.redis-cloud.com:17711 + +# flyctl secrets set WS_SERVER=wss://websocket-rust-autumn-snow-632.fly.dev/ws +#REACT_APP_GOOGLE_MAPS_API_KEY=AIzaSyAYemHqW9xU48b7KhMXauA6P0fDFTWyly0 +#REACT_APP_AWS_PROJECT_REGION=ap-northeast-1 +#REACT_APP_AWS_COGNITO_IDENTITY_POOL_ID= +#REACT_APP_AWS_COGNITO_REGION=ap-northeast-1s +#REACT_APP_AWS_USER_POOLS_ID=ap-northeast-1_CeDvu2GtB +#REACT_APP_AWS_USER_POOLS_CLIENT_ID=7in4innl65ojj70bug3sd53guc +#REACT_APP_WEBSOCKET_URL=wss://websocket-rust-autumn-snow-632.fly.dev +# REACT_APP_WEBSOCKET_URL=ws://localhost:8000 +# REACT_APP_WEBSOCKET_URL=wss://192.168.1.108 +# REACT_APP_PROXY_URL=https://websocket-rust-autumn-snow-632.fly.dev + diff --git a/.env.list b/.env.list new file mode 100644 index 0000000..298bfca --- /dev/null +++ b/.env.list @@ -0,0 +1,6 @@ +HOST=0.0.0.0 +PORT=8000 + +REDIS_URL=redis://default:sHDDM6AwFAvue0xai1FmU3fe2jkozVIp@redis-17711.c90.us-east-1-3.ec2.redns.redis-cloud.com:17711 +WS_SERVER=ws://localhost:8000/ws + diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml new file mode 100644 index 0000000..b0c246e --- /dev/null +++ b/.github/workflows/fly-deploy.yml @@ -0,0 +1,18 @@ +# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ + +name: Fly Deploy +on: + push: + branches: + - main +jobs: + deploy: + name: Deploy app + runs-on: ubuntu-latest + concurrency: deploy-group # optional: ensure only one action runs at a time + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..acf9b84 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,45 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug executable websocket_rust", + "cargo":{ + "args": [ + "build", + "--bin=websocket_rust", + "--package=websocket_rust" + ], + "filter": { + "name": "websocket_rust", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in websocket_rust", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=websocket_rust" + ], + "filter": { + "name": "websocket_rust", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..11f1c52 --- /dev/null +++ b/fly.toml @@ -0,0 +1,20 @@ +# fly.toml app configuration file generated for websocket-rust-autumn-snow-632 on 2024-10-09T17:21:24+09:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'websocket-rust-autumn-snow-632' +primary_region = 'nrt' + +[build] + +[http_service] + internal_port = 8000 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + size = 'shared-cpu-1x' diff --git a/front b/front index 634d7ba..0f27f14 160000 --- a/front +++ b/front @@ -1 +1 @@ -Subproject commit 634d7ba0e6aa8359291f296707b6ece5df240bc0 +Subproject commit 0f27f141b0fb67e9477fd343c88b33850129d9fc