-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working on real identity / auth (#30)
* working on real identity / auth * cleanup * reorganized folders * fix centralized packages * fixed project reference error * migrated all identity functionality to SQL Server * fix issues with email sending * finally have auth working * defining some shared types * added Akka.NET messages * added some DData replication for the index * added command and event processing for drawings * defining entity actors and other subscription commands * add indicies subscriptions * added Akka.Hosting and Sharding config * working on defining local paint actors * added local drawing actor * added Akka.Hosting support for local actors * actor startup works correctly * disable DData persistence * added data loading to homepage * fixed up new UI * fixed startup crash issues * got new paint session navigation working * fixing issues with pruning dead sessions * fixing some UX issues * fixed SSR
- Loading branch information
1 parent
40f9117
commit 87c8a0e
Showing
123 changed files
with
6,453 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DrawTogether.NET Infrastructure | ||
|
||
This folder contains some "`git clone` and run" tooling for helping run all of DrawTogether.NET's infrastructure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
REM @echo off | ||
REM executes all `build.cmd` scripts recursively inside from this directory on down | ||
|
||
pushd "%~dp0" | ||
for /R %%f in ("build.cmd") do ( | ||
IF EXIST "%%f" ( | ||
call "%%f" %~1 | ||
) | ||
) | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
# executes all `build.sh` scripts recursively inside from this directory on down | ||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
cd "$parent_path" | ||
|
||
for file in ./**/build.sh; do | ||
./${file} $1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# MSSQL Image | ||
|
||
This is a prebuilt [SQL Server 2022 on Linux](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-whats-new-2019) Docker image that contains a blank `DrawTogether` database which will subsequently be used by Akka.Persistence.Sql for relevant samples. | ||
|
||
## Build | ||
|
||
To build this image, run the `build.sh` or `build.cmd` script found in root of this directory. | ||
|
||
```shell | ||
build.sh [-t {tag}] | ||
```` | ||
|
||
```shell | ||
build.cmd [-t {tag}] | ||
``` | ||
|
||
This will produce an image named `drawtogether.sqlserver:{tag}`. | ||
|
||
If you leave out the `{tag}` parameter the image name will default to `drawtogether.sqlserver:0.1.0`. | ||
|
||
### Adding Additional Schema | ||
|
||
If you need additional tables or any other DDLs added to this sample, modify the [`setup.sql`](setup.sql) script inside this repository. Those schema modifications will be applied when the container first starts up. | ||
|
||
### Deployment | ||
|
||
To run this image you will still need to provide the default environment variable arguments required by the [SQL Server 2022 public Docker image](https://hub.docker.com/_/microsoft-mssql-server): | ||
|
||
```shell | ||
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=yourStrong(!)Password" -p 1633:1433 -d drawtogether.sqlserver:0.1.0 | ||
``` | ||
|
||
This will produce a connection string that you can use to run Akka.Persistence (from the host machine): | ||
|
||
``` | ||
Server=localhost; Database=DrawTogether; User Id=sa; Password=yourStrong(!)Password; | ||
``` | ||
> **N.B.** It might take `drawtogether.sqlserver.sqlserver` up to 30 seconds to fully initialize the very first time it starts. Please be patient prior to running your sample and check the logs inside the Docker dashboard to see if the `DrawTogether` database has been created. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@echo off | ||
REM builds all docker images | ||
|
||
set version="0.1.0" | ||
set imageName="drawtogether.sqlserver" | ||
|
||
if "%~1"=="" ( | ||
REM No version tag specified | ||
echo No tag for [%imageName%] specified. Defaulting to [%version%] | ||
) else ( | ||
set version="%~1" | ||
echo Building [%imageName%] with tag [%~1] | ||
) | ||
|
||
docker build %~dp0/src/. -t "%imageName%:%version%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
# Builds docker images | ||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
cd "$parent_path" | ||
|
||
version="0.1.0" | ||
imageName="drawtogether.sqlserver" | ||
|
||
if [ -z $1 ]; then | ||
echo "No tag for [${imageName}] specified. Defaulting to [${version}]" | ||
else | ||
version="$1" | ||
echo "Building [${imageName}] with tag [${version}]" | ||
fi | ||
|
||
docker build ./src/. -t "${imageName}:${version}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
echo off | ||
REM Deploys container instance into Kubernetes namespace | ||
|
||
set namespace="drawtogether" | ||
|
||
if "%~1"=="" ( | ||
REM No K8S namespace specified | ||
echo No namespace specified. Defaulting to [%namespace%] | ||
) else ( | ||
set namespace="%~1" | ||
echo Deploying into K8s namespace [%namespace%] | ||
) | ||
|
||
kubectl apply -f "%~dp0/drawtogether.sql.yaml" -n "%namespace%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# Deploys container instance into Kubernetes namespace | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
|
||
namespace="drawtogether" | ||
|
||
if [ -z $1 ]; then | ||
echo "No namespace specified. Defaulting to [${namespace}]" | ||
else | ||
namespace="$1" | ||
echo "Deploying into K8s namespace [${namespace}]" | ||
fi | ||
|
||
kubectl apply -f "drawtogether.sql.yaml" -n "%namespace%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: sqlserver | ||
spec: | ||
ports: | ||
- name: sqlserver | ||
port: 1644 | ||
protocol: TCP | ||
targetPort: 1433 | ||
selector: | ||
app: sqlserver | ||
type: NodePort | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: sqlserver | ||
labels: | ||
app: sqlserver | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: sqlserver | ||
template: | ||
metadata: | ||
labels: | ||
app: sqlserver | ||
spec: | ||
containers: | ||
- name: sqlserver | ||
image: drawtogether.sqlserver:0.1.0 | ||
env: | ||
- name: ACCEPT_EULA | ||
value: "Y" | ||
- name: SA_PASSWORD | ||
value: "yourStrong(!)Password" | ||
ports: | ||
- containerPort: 1433 | ||
name: sqlserver | ||
readinessProbe: | ||
exec: | ||
command: ["/bin/sh", "-c", "ready-check.sh"] | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM mcr.microsoft.com/mssql/server:2022-latest | ||
|
||
COPY ./setup.sql . | ||
COPY ./setup.sh . | ||
COPY ./ready-check.sh . | ||
|
||
# Grant permission on the setup script | ||
#RUN chmod +x ./setup.sh | ||
|
||
CMD /bin/bash -C './setup.sh';'bash' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "checking to see if [DrawTogether] database is available..." | ||
|
||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -d master -q "select [dbo].[DatabaseExists]('DrawTogether')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# start SQL Server | ||
/opt/mssql/bin/sqlservr & | ||
|
||
#wait for the SQL Server to come up | ||
sleep 15s | ||
|
||
# setup the tables | ||
echo "Connecting to SQL and creating Akka database." | ||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -d master -i setup.sql | ||
|
||
sleep infinity |
Oops, something went wrong.