Skip to content

Commit

Permalink
Pull in files from rust-actis-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
ddimaria committed Feb 17, 2020
0 parents commit 4b7c224
Show file tree
Hide file tree
Showing 46 changed files with 5,652 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
13 changes: 13 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
AUTH_SALT=CHANGEME
DATABASE_CONNECTION=mysql
DATABASE_URL=mysql://root:[email protected]:8889/rust-actix-framework?socket=/Applications/MAMP/tmp/mysql/mysql.sock
JWT_EXPIRATION=24
JWT_KEY=4125442A472D4B614E645267556B58703273357638792F423F4528482B4D6251
REDIS_URL=127.0.0.1:6379
RUST_BACKTRACE=1
RUST_LOG="actix_web=info,actix_server=info,actix_redis=trace"
SERVER=0.0.0.0:3000
SESSION_KEY=4125442A472D4B614E645267556B58703273357638792F423F4528482B4D6251
SESSION_NAME=auth
SESSION_SECURE=false
SESSION_TIMEOUT=20
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
AUTH_SALT=CHANGEME
DATABASE=mysql
DATABASE_URL=mysql://root:[email protected]:8889/rust-actix-framework?socket=/Applications/MAMP/tmp/mysql/mysql.sock
JWT_EXPIRATION=24
JWT_KEY=4125442A472D4B614E645267556B58703273357638792F423F4528482B4D6251
REDIS_URL=127.0.0.1:6379
RUST_BACKTRACE=1
RUST_LOG="actix_web=info,actix_server=info,actix_redis=trace"
SERVER=127.0.0.1:3000
SESSION_KEY=4125442A472D4B614E645267556B58703273357638792F423F4528482B4D6251
SESSION_NAME=auth
SESSION_SECURE=false
SESSION_TIMEOUT=20
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target
.env
.cargo
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: rust
rust:
- stable
matrix:
fast_finish: true
cache: cargo
env:
global:
- SERVER: 127.0.0.1:3000
before_script:
- sudo apt-get update
script:
- cargo build --verbose --all
- SERVER=127.0.0.1:3000
- cargo test --verbose --all
3,117 changes: 3,117 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[package]
name = "rust_actix_framework"
version = "0.2.0"
authors = ["David DiMaria <[email protected]>"]
edition = "2018"

[dependencies]
actix = "0.9.0"
actix-cors = "0.2.0"
actix-files = "0.2.1"
actix-identity = "0.2.1"
actix-redis = "0.8.0"
actix-rt = "1"
actix-service = "1.0.5"
actix-web = "2"
argon2rs = "0.2.1"
chrono = { version = "0.4", features = ["serde"] }
derive_more = "0.15"
diesel = { version = "1.4.0", features = ["chrono", "mysql", "postgres", "sqlite", "r2d2", "uuidv07"] }
dotenv = "0.14"
envy = "0.4"
env_logger = "0.6"
futures = "0.3.1"
jsonwebtoken = "7"
lazy_static = "1.4"
listenfd = "0.3"
log = "0.4"
rayon = "1.0"
redis-async = "0.6.1"
r2d2 = "0.8"
r2d2-diesel = "1.0.0"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
uuid = { version = "0.7", features = ["serde", "v4"] }
validator = "0.8.0"
validator_derive = "0.8.0"

[dev-dependencies]
actix-http-test = "0.2.0"

[features]
cockroach = []
mysql = []
postgres = []
sqlite = []
default = ["mysql"]
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG BASE_IMAGE=ekidd/rust-musl-builder:latest

# Our first FROM statement declares the build environment.
FROM ${BASE_IMAGE} AS builder

# Add our source code.
ADD . ./

# Fix permissions on source code.
RUN sudo chown -R rust:rust /home/rust

# Build our application.
RUN cargo build --release

# Now, we need to build our _real_ Docker container, copying in `rust_actix_framework`.
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=builder \
/home/rust/src/target/x86_64-unknown-linux-musl/release/rust_actix_framework \
/usr/local/bin/
CMD /usr/local/bin/rust_actix_framework
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 David D.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 4b7c224

Please sign in to comment.