From d220bb7090b23e52ff20ddf6c367c4c59d5975c3 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 23 Apr 2018 17:52:31 -0300 Subject: [PATCH 01/34] add new key --- README.md | 12 +++++++++++- keys.yaml | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ecab302..3026612 100644 --- a/README.md +++ b/README.md @@ -24,5 +24,15 @@ source("key-generator.R") key_generator("name-of-the-endpoint") ``` -The function will make necessary modifications to `keys.yaml`. They generated key will be printed to the console. +The function will make necessary modifications to `keys.yaml`. They generated key will be printed to the console. **Note** The key is printed only once. +## Updating the endpoint + +On shell, type: + +``` +now +now alisas {{}} decryptr +``` + +You must have `now` CLI installed. diff --git a/keys.yaml b/keys.yaml index 1e6e6ea..ffa2c93 100644 --- a/keys.yaml +++ b/keys.yaml @@ -2,6 +2,8 @@ rfb: - ef556689177dbe281139a5688162f54166127c83746a83c87b872605621aa156 - ef556689177dbe281139a5688162f54166127c83746a83c87b872605621aa156 - b934527d8d59be4766e43db6c9de039871ddcea33c948bcf59ee5ed29fdc1f4f +- 5ead3acec819ee56b15a9d1d9ddd64044ee1fe80f12333a1724ba1febbeb7d84 +- 20f8cad884b29ffd9a926633a95594d71e5c38137123afecac14a0f8a0020afb tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From 9eb70e6c47e52c26690a635f9a9822f43472c179 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 23 Apr 2018 17:57:01 -0300 Subject: [PATCH 02/34] update readme --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 3026612..fafc93e 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,35 @@ now alisas {{}} decryptr ``` You must have `now` CLI installed. + +## Using from R + +You can use the API from with the following chunk of code: + +``` +library(magrittr) + +# parameters +arq <- "https://decryptr.netlify.com/img/sample-captcha.png" +key <- "your-api-key" + +# converting the image to base64 + +img <- arq %>% + readr::read_file_raw() %>% + base64enc::base64encode() + +# post request +res <- httr::POST( + "https://decryptr.now.sh/rfb", + body = list( + img = img, + key = key + ), + encode = "json" +) + +httr::content(res) +``` + +Please visit [decryptr.netlify.com](decryptr.netlify.com) fore more info and to obtain your own key. From e2872921f570f48aaefbd200cfa06e2de3bc911a Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 23 Apr 2018 18:02:07 -0300 Subject: [PATCH 03/34] add htp --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fafc93e..597b825 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,4 @@ res <- httr::POST( httr::content(res) ``` -Please visit [decryptr.netlify.com](decryptr.netlify.com) fore more info and to obtain your own key. +Please visit [decryptr.netlify.com](http://decryptr.netlify.com) fore more info and to obtain your own key. From 54c6222bf28a9e82514fedf811ae696ae25cd784 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 23 Apr 2018 18:13:38 -0300 Subject: [PATCH 04/34] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 597b825..0013b05 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ On shell, type: ``` now -now alisas {{}} decryptr +now alias {{}} decryptr ``` You must have `now` CLI installed. From a5f70bac03dc99c1001c30045c3fe12a448d2bc7 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 24 Apr 2018 13:31:32 -0300 Subject: [PATCH 05/34] adicionar nova chave --- keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/keys.yaml b/keys.yaml index ffa2c93..7677e6a 100644 --- a/keys.yaml +++ b/keys.yaml @@ -4,6 +4,7 @@ rfb: - b934527d8d59be4766e43db6c9de039871ddcea33c948bcf59ee5ed29fdc1f4f - 5ead3acec819ee56b15a9d1d9ddd64044ee1fe80f12333a1724ba1febbeb7d84 - 20f8cad884b29ffd9a926633a95594d71e5c38137123afecac14a0f8a0020afb +- 370313260a42bc2d8e78f423d10768526defe4653b02ce4eac9faccc01791153 tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From 3639fb87ae5c103611f2d386e98b0c195eed5d4c Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 5 Jun 2018 14:16:57 -0300 Subject: [PATCH 06/34] add + chave --- keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/keys.yaml b/keys.yaml index 7677e6a..2980c3b 100644 --- a/keys.yaml +++ b/keys.yaml @@ -5,6 +5,7 @@ rfb: - 5ead3acec819ee56b15a9d1d9ddd64044ee1fe80f12333a1724ba1febbeb7d84 - 20f8cad884b29ffd9a926633a95594d71e5c38137123afecac14a0f8a0020afb - 370313260a42bc2d8e78f423d10768526defe4653b02ce4eac9faccc01791153 +- 8a1c837e472bff753c204e391d23bd3827c0c8a1f4ba6b2f509050a6d7a26ebc tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From 3218980390954ca91acf816720e06a20d2f75698 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 7 Jun 2018 16:52:23 -0300 Subject: [PATCH 07/34] add rsc endpoint --- Dockerfile | 2 +- api.R | 16 ++++++++++++++++ keys.yaml | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3f917a2..654338a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN R -e "keras::install_keras()" # Install captcha-breaking captchas RUN R -e "devtools::install_github('decryptr/decryptrModels')" -RUN R -e "devtools::install_github('decryptr/decryptr', ref = 'raw-reading-support')" +RUN R -e "devtools::install_github('decryptr/decryptr')" COPY api.R api.R COPY keys.yaml keys.yaml diff --git a/api.R b/api.R index 9c32619..24c467d 100644 --- a/api.R +++ b/api.R @@ -2,6 +2,8 @@ library(decryptr) library(base64enc) model_rfb <- load_model("rfb") +model_rsc <- load_model("rsc") + keys <- yaml::read_yaml("keys.yaml") #* @post /rfb @@ -16,3 +18,17 @@ rfb <- function(img, key){ decrypt(img_decoded, model_rfb) } +#* post/rsc +rsc <- function(img, key){ + + key <- openssl::sha256(key) + if(!key %in% keys$rsc | is.null(key) | is.na(key)) { + stop("Not authorized. Get an api key from decryptr.com.br") + } + + img_decoded <- base64enc::base64decode(img) + decrypt(img_decoded, model_rsc) +} + + + diff --git a/keys.yaml b/keys.yaml index 2980c3b..5f849e9 100644 --- a/keys.yaml +++ b/keys.yaml @@ -9,3 +9,4 @@ rfb: tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 +rsc: a62d0d5f6c6d541028e5af059a18da585888550d815fe0a1289671433e2a7986 From c3693072dda95109ce626df48449caaf5a897582 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 11 Jun 2018 15:40:45 -0300 Subject: [PATCH 08/34] updating the api --- Dockerfile | 2 +- api.R | 11 +++++++++++ keys.yaml | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 654338a..d4102f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN R -e "devtools::install_github('rstudio/keras')" RUN R -e "keras::install_keras()" # Install captcha-breaking captchas -RUN R -e "devtools::install_github('decryptr/decryptrModels')" +RUN R -e "devtools::install_github('decryptr/decryptrModels', force = TRUE)" RUN R -e "devtools::install_github('decryptr/decryptr')" COPY api.R api.R diff --git a/api.R b/api.R index 24c467d..40fda12 100644 --- a/api.R +++ b/api.R @@ -3,6 +3,7 @@ library(base64enc) model_rfb <- load_model("rfb") model_rsc <- load_model("rsc") +model_cadesp <- load_model("cadesp") keys <- yaml::read_yaml("keys.yaml") @@ -30,5 +31,15 @@ rsc <- function(img, key){ decrypt(img_decoded, model_rsc) } +#* post/cadesp +cadesp <- function(img, key){ + key <- openssl::sha256(key) + if(!key %in% keys$cadesp | is.null(key) | is.na(key)) { + stop("Not authorized. Get an api key from decryptr.com.br") + } + + img_decoded <- base64enc::base64decode(img) + decrypt(img_decoded, model_cadesp) +} diff --git a/keys.yaml b/keys.yaml index 5f849e9..ee977f4 100644 --- a/keys.yaml +++ b/keys.yaml @@ -10,3 +10,6 @@ tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 rsc: a62d0d5f6c6d541028e5af059a18da585888550d815fe0a1289671433e2a7986 +cadesp: +- d7abeb4ab20aab42c3a54f92f37d98330f2cbd1d7e3804f282eaa265d35dede9 +- 9ac78bf7017408c0c1c803c7ff3481872142cb35f7cff1535f7c09f902192436 From ac4502c6f1bad85bb926e0f12b6239c83a020c3a Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 24 Jul 2018 16:59:22 -0300 Subject: [PATCH 09/34] adicionar key --- keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/keys.yaml b/keys.yaml index ee977f4..ce5a3bd 100644 --- a/keys.yaml +++ b/keys.yaml @@ -6,6 +6,7 @@ rfb: - 20f8cad884b29ffd9a926633a95594d71e5c38137123afecac14a0f8a0020afb - 370313260a42bc2d8e78f423d10768526defe4653b02ce4eac9faccc01791153 - 8a1c837e472bff753c204e391d23bd3827c0c8a1f4ba6b2f509050a6d7a26ebc +- 89a41eb33e7921d09d2e6016bfc6952daa421a799acd7a0425d63850d483b170 tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From 4ec6805279d5603f0e1f90ccd794f1c61854f740 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 24 Jul 2018 17:18:37 -0300 Subject: [PATCH 10/34] add mais chave --- keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/keys.yaml b/keys.yaml index ce5a3bd..1093aad 100644 --- a/keys.yaml +++ b/keys.yaml @@ -7,6 +7,7 @@ rfb: - 370313260a42bc2d8e78f423d10768526defe4653b02ce4eac9faccc01791153 - 8a1c837e472bff753c204e391d23bd3827c0c8a1f4ba6b2f509050a6d7a26ebc - 89a41eb33e7921d09d2e6016bfc6952daa421a799acd7a0425d63850d483b170 +- 43582a1663f54bf4cce2efe1743613f78d1226f70c8251d799c1b1fdce7517c1 tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From e49ace137e37753dd8d096c8fe361355f7165c86 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Wed, 15 Aug 2018 09:51:48 -0300 Subject: [PATCH 11/34] add nova chave --- keys.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keys.yaml b/keys.yaml index 1093aad..2fa577e 100644 --- a/keys.yaml +++ b/keys.yaml @@ -8,6 +8,8 @@ rfb: - 8a1c837e472bff753c204e391d23bd3827c0c8a1f4ba6b2f509050a6d7a26ebc - 89a41eb33e7921d09d2e6016bfc6952daa421a799acd7a0425d63850d483b170 - 43582a1663f54bf4cce2efe1743613f78d1226f70c8251d799c1b1fdce7517c1 +- cec6341c56c90c8fb195a6b0dc398364e9b4f7becf28e2660de4dd7022bd4aba +- 425d030a3ea9bbac450d36aafc5b3be0137aafc66573a43b68a4dcc2659bb246 tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From 649901ffdbbb0de8750ee0ff22a06229035de3f4 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 16 Aug 2018 00:28:52 -0300 Subject: [PATCH 12/34] update instructions --- README.md | 10 +++++++--- key-generator.R | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0013b05..9298d03 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,15 @@ The function will make necessary modifications to `keys.yaml`. They generated ke On shell, type: ``` -now -now alias {{}} decryptr +docker build dfalbel/decryptr +docker push dfalbel/decryptr +hyper stop decryptr +hyper rm decryptr +hyper run -d -p 80:8000 --name decryptr dfalbel/decryptr +hyper fip attach decryptr decryptr ``` -You must have `now` CLI installed. +You must have `hyper.sh` CLI installed. ## Using from R diff --git a/key-generator.R b/key-generator.R index 57cfdb4..cc3e3df 100644 --- a/key-generator.R +++ b/key-generator.R @@ -5,3 +5,4 @@ key_generator <- function(endpoint) { yaml::write_yaml(keys, file = "keys.yaml") new_key } + From 55fb9cac2eb00b201fe3e24010004b1869ef92ec Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Sun, 26 Aug 2018 13:25:28 -0300 Subject: [PATCH 13/34] add key --- keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/keys.yaml b/keys.yaml index 2fa577e..d3e1211 100644 --- a/keys.yaml +++ b/keys.yaml @@ -10,6 +10,7 @@ rfb: - 43582a1663f54bf4cce2efe1743613f78d1226f70c8251d799c1b1fdce7517c1 - cec6341c56c90c8fb195a6b0dc398364e9b4f7becf28e2660de4dd7022bd4aba - 425d030a3ea9bbac450d36aafc5b3be0137aafc66573a43b68a4dcc2659bb246 +- b31a3e607c9233304beca5d2e207f202e9cdfb8e62446e242d85472f415dd9c6 tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From d7e93b7ea36aba0b3d8c666715a36d40b3a86cd7 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 27 Aug 2018 15:57:43 -0300 Subject: [PATCH 14/34] moving to google app engine --- .gitignore | 1 + Dockerfile | 32 +++----------------------------- api.R | 13 +++++++++++-- app.yaml | 24 ++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 app.yaml diff --git a/.gitignore b/.gitignore index 7b732e7..bbb6a19 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .RData .Ruserdata .DS_Store +test.R diff --git a/Dockerfile b/Dockerfile index d4102f7..89e2c9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,9 @@ -FROM trestletech/plumber +FROM dfalbel/keras-r-docker MAINTAINER decryptr -# Install Python. -RUN apt-get update || apt-get update - -RUN \ - apt-get update && apt-get install -y apt-transport-https && \ - apt-get install -y python python-dev python-pip python-virtualenv libssl-dev && \ - rm -rf /var/lib/apt/lists/* - - -# Install ML packages -RUN R -e "install.packages('plumber')" -RUN R -e "install.packages('yaml')" -RUN R -e "install.packages('base64enc')" -RUN R -e "install.packages('openssl')" -RUN R -e "install.packages('devtools')" -RUN R -e "install.packages('base64enc')" -RUN R -e "install.packages('reticulate')" -RUN R -e "install.packages('tensorflow')" -RUN R -e "tensorflow::install_tensorflow()" -RUN R -e "devtools::install_github('rstudio/keras')" -RUN R -e "keras::install_keras()" - -# Install captcha-breaking captchas -RUN R -e "devtools::install_github('decryptr/decryptrModels', force = TRUE)" -RUN R -e "devtools::install_github('decryptr/decryptr')" - COPY api.R api.R COPY keys.yaml keys.yaml # Run -EXPOSE 8000 -CMD ["api.R"] +EXPOSE 8080 +CMD ["Rscript", "-e", "pr <- plumber::plumb('api.R'); pr$run(host='0.0.0.0', port=8080)"] diff --git a/api.R b/api.R index 40fda12..2bab2eb 100644 --- a/api.R +++ b/api.R @@ -19,7 +19,7 @@ rfb <- function(img, key){ decrypt(img_decoded, model_rfb) } -#* post/rsc +#* @post /rsc rsc <- function(img, key){ key <- openssl::sha256(key) @@ -31,7 +31,7 @@ rsc <- function(img, key){ decrypt(img_decoded, model_rsc) } -#* post/cadesp +#* @post /cadesp cadesp <- function(img, key){ key <- openssl::sha256(key) @@ -43,3 +43,12 @@ cadesp <- function(img, key){ decrypt(img_decoded, model_cadesp) } +#* @get /liveness_check +liveness_check <- function(){ + 200 +} + +#* @get /readiness_check +readiness_check <- function(){ + 200 +} diff --git a/app.yaml b/app.yaml new file mode 100644 index 0000000..30d3b7c --- /dev/null +++ b/app.yaml @@ -0,0 +1,24 @@ +runtime: custom +env: flex + +manual_scaling: + instances: 1 +resources: + cpu: 1 + memory_gb: 1 + disk_size_gb: 10 + +liveness_check: + path: "/liveness_check" + check_interval_sec: 30 + timeout_sec: 4 + failure_threshold: 2 + success_threshold: 2 + +readiness_check: + path: "/readiness_check" + check_interval_sec: 5 + timeout_sec: 4 + failure_threshold: 2 + success_threshold: 2 + app_start_timeout_sec: 300 From ba5d30b5b751fbd259ca2ef3c1dd6eaf16005f53 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 27 Aug 2018 16:01:26 -0300 Subject: [PATCH 15/34] updating update instructions --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9298d03..7c5ca5f 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ To serve the API on [http://localhost:80](http://localhost:80) with no load balancing, run the command below: ``` -docker build api . -docker run -p 80:8000 api +docker build -t api . +docker run -p 80:8080 api ``` ## Adding a new key @@ -31,15 +31,10 @@ The function will make necessary modifications to `keys.yaml`. They generated ke On shell, type: ``` -docker build dfalbel/decryptr -docker push dfalbel/decryptr -hyper stop decryptr -hyper rm decryptr -hyper run -d -p 80:8000 --name decryptr dfalbel/decryptr -hyper fip attach decryptr decryptr +gcloud app deploy --project decryptr-196601 ``` -You must have `hyper.sh` CLI installed. +You must have `gcloud` CLI installed. ## Using from R From 1a29f50e53bf1c11e5eb104c523d10d5f4f17628 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 27 Aug 2018 17:55:12 -0300 Subject: [PATCH 16/34] add new key --- keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/keys.yaml b/keys.yaml index d3e1211..d7892c6 100644 --- a/keys.yaml +++ b/keys.yaml @@ -11,6 +11,7 @@ rfb: - cec6341c56c90c8fb195a6b0dc398364e9b4f7becf28e2660de4dd7022bd4aba - 425d030a3ea9bbac450d36aafc5b3be0137aafc66573a43b68a4dcc2659bb246 - b31a3e607c9233304beca5d2e207f202e9cdfb8e62446e242d85472f415dd9c6 +- 92de28b6fb134ed15a51d3e2a8283d5c1570b4eb0c2a12656db1953907946b15 tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 From 1824bcf224b37cc3ac57be6d93fdc1a216aa7814 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Wed, 29 Aug 2018 12:01:56 -0300 Subject: [PATCH 17/34] use hyper no lugar do gcloud --- README.md | 9 +++++++-- api.R | 10 ---------- app.yaml | 24 ------------------------ 3 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 app.yaml diff --git a/README.md b/README.md index 7c5ca5f..e8a222f 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,15 @@ The function will make necessary modifications to `keys.yaml`. They generated ke On shell, type: ``` -gcloud app deploy --project decryptr-196601 +hyper stop decryptr +hyper rm decryptr +docker build -t api . +hyper load -l api:latest +hyper run -d --name decryptr -p 80:8080 --size=s4 api +hyper fip attach decryptr decryptr ``` -You must have `gcloud` CLI installed. +You must have `hyper` CLI installed. ## Using from R diff --git a/api.R b/api.R index 2bab2eb..b7b01fb 100644 --- a/api.R +++ b/api.R @@ -42,13 +42,3 @@ cadesp <- function(img, key){ img_decoded <- base64enc::base64decode(img) decrypt(img_decoded, model_cadesp) } - -#* @get /liveness_check -liveness_check <- function(){ - 200 -} - -#* @get /readiness_check -readiness_check <- function(){ - 200 -} diff --git a/app.yaml b/app.yaml deleted file mode 100644 index 30d3b7c..0000000 --- a/app.yaml +++ /dev/null @@ -1,24 +0,0 @@ -runtime: custom -env: flex - -manual_scaling: - instances: 1 -resources: - cpu: 1 - memory_gb: 1 - disk_size_gb: 10 - -liveness_check: - path: "/liveness_check" - check_interval_sec: 30 - timeout_sec: 4 - failure_threshold: 2 - success_threshold: 2 - -readiness_check: - path: "/readiness_check" - check_interval_sec: 5 - timeout_sec: 4 - failure_threshold: 2 - success_threshold: 2 - app_start_timeout_sec: 300 From bf79e5a51e1649454a7303158e8508bd5fa0262b Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 4 Sep 2018 07:50:27 -0300 Subject: [PATCH 18/34] update code and instructions --- Dockerfile | 1 + README.md | 7 ++++--- api.R | 13 +++++++++++++ keys.yaml | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89e2c9a..d10df54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,5 @@ COPY keys.yaml keys.yaml # Run EXPOSE 8080 + CMD ["Rscript", "-e", "pr <- plumber::plumb('api.R'); pr$run(host='0.0.0.0', port=8080)"] diff --git a/README.md b/README.md index e8a222f..7d29d14 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,12 @@ The function will make necessary modifications to `keys.yaml`. They generated ke On shell, type: ``` +docker build -t dfalbel/api . +docker push dfalbel/api hyper stop decryptr hyper rm decryptr -docker build -t api . -hyper load -l api:latest -hyper run -d --name decryptr -p 80:8080 --size=s4 api +hyper pull dfalbel/api +hyper run -d --name decryptr -p 80:8080 --size=s4 dfalbel/api hyper fip attach decryptr decryptr ``` diff --git a/api.R b/api.R index b7b01fb..e28c837 100644 --- a/api.R +++ b/api.R @@ -4,6 +4,7 @@ library(base64enc) model_rfb <- load_model("rfb") model_rsc <- load_model("rsc") model_cadesp <- load_model("cadesp") +model_nfesp <- load_model("nfesp") keys <- yaml::read_yaml("keys.yaml") @@ -42,3 +43,15 @@ cadesp <- function(img, key){ img_decoded <- base64enc::base64decode(img) decrypt(img_decoded, model_cadesp) } + +#* @post /nfesp +nfesp <- function(img, key){ + + key <- openssl::sha256(key) + if(!key %in% keys$nfesp | is.null(key) | is.na(key)) { + stop("Not authorized. Get an api key from decryptr.com.br") + } + + img_decoded <- base64enc::base64decode(img) + decrypt(img_decoded, model_nfesp) +} diff --git a/keys.yaml b/keys.yaml index d7892c6..f9d0478 100644 --- a/keys.yaml +++ b/keys.yaml @@ -19,3 +19,6 @@ rsc: a62d0d5f6c6d541028e5af059a18da585888550d815fe0a1289671433e2a7986 cadesp: - d7abeb4ab20aab42c3a54f92f37d98330f2cbd1d7e3804f282eaa265d35dede9 - 9ac78bf7017408c0c1c803c7ff3481872142cb35f7cff1535f7c09f902192436 +nfesp: +- 805f61f603b71bb4ea2fcf1b4e0f7e81aa7dce862bf0cc8abc8e136d0670b1c7 +- 611a69d04ea3b5daf033a09c74fb1d9c2229262adf375b9b80fab11fa636c3fd From 3a52e71eac22c820582de6c098c26b8119132ad3 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Wed, 10 Oct 2018 14:24:10 -0300 Subject: [PATCH 19/34] -v para tbm remover o vulme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d29d14..1a0f3a7 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ On shell, type: docker build -t dfalbel/api . docker push dfalbel/api hyper stop decryptr -hyper rm decryptr +hyper rm decryptr -v hyper pull dfalbel/api hyper run -d --name decryptr -p 80:8080 --size=s4 dfalbel/api hyper fip attach decryptr decryptr From 9b7114792fae6aeffd70519839e35c0711f81673 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 7 Jan 2019 16:28:54 -0200 Subject: [PATCH 20/34] update instructions --- Dockerfile | 4 ++-- README.md | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index d10df54..2c0dc17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ COPY api.R api.R COPY keys.yaml keys.yaml # Run -EXPOSE 8080 +EXPOSE 80 -CMD ["Rscript", "-e", "pr <- plumber::plumb('api.R'); pr$run(host='0.0.0.0', port=8080)"] +CMD ["Rscript", "-e", "pr <- plumber::plumb('api.R'); pr$run(host='0.0.0.0', port=80)"] diff --git a/README.md b/README.md index 1a0f3a7..79886b4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ with no load balancing, run the command below: ``` docker build -t api . -docker run -p 80:8080 api +docker run -p 80:80 api ``` ## Adding a new key @@ -33,14 +33,19 @@ On shell, type: ``` docker build -t dfalbel/api . docker push dfalbel/api -hyper stop decryptr -hyper rm decryptr -v -hyper pull dfalbel/api -hyper run -d --name decryptr -p 80:8080 --size=s4 dfalbel/api -hyper fip attach decryptr decryptr +gcloud compute instances create-with-container decryptr \ + --project=decryptr-196601 \ + --container-image dfalbel/api \ + --machine-type g1-small \ + --tags http-server \ + --address 104.197.127.86 \ + --metadata startup-script='#! /bin/bash +sudo iptables -w -A INPUT -p tcp --dport 80 -j ACCEPT +EOF +' ``` -You must have `hyper` CLI installed. +You must have `gcloud` CLI installed. ## Using from R From 1dd145dcc91cb636c1e80c12cfbb01d4754b2259 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 12 Mar 2019 18:05:01 -0300 Subject: [PATCH 21/34] add log messages --- api.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api.R b/api.R index e28c837..092f644 100644 --- a/api.R +++ b/api.R @@ -17,6 +17,7 @@ rfb <- function(img, key){ } img_decoded <- base64enc::base64decode(img) + message(Sys.time(), ": rfb") decrypt(img_decoded, model_rfb) } @@ -29,6 +30,7 @@ rsc <- function(img, key){ } img_decoded <- base64enc::base64decode(img) + message(Sys.time(), ": rsc") decrypt(img_decoded, model_rsc) } @@ -41,6 +43,7 @@ cadesp <- function(img, key){ } img_decoded <- base64enc::base64decode(img) + message(Sys.time(), ": cadesp") decrypt(img_decoded, model_cadesp) } @@ -53,5 +56,6 @@ nfesp <- function(img, key){ } img_decoded <- base64enc::base64decode(img) + message(Sys.time(), ": nfesp") decrypt(img_decoded, model_nfesp) } From 5cea7f2239af2f9ebf2c17055abccdb0d80b4e52 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 15:03:55 -0300 Subject: [PATCH 22/34] deploy on 8080 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c0dc17..d10df54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ COPY api.R api.R COPY keys.yaml keys.yaml # Run -EXPOSE 80 +EXPOSE 8080 -CMD ["Rscript", "-e", "pr <- plumber::plumb('api.R'); pr$run(host='0.0.0.0', port=80)"] +CMD ["Rscript", "-e", "pr <- plumber::plumb('api.R'); pr$run(host='0.0.0.0', port=8080)"] From c702a28c58b62828409926483c59364886c24649 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 15:08:55 -0300 Subject: [PATCH 23/34] respond on root --- api.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api.R b/api.R index 092f644..590018b 100644 --- a/api.R +++ b/api.R @@ -8,6 +8,11 @@ model_nfesp <- load_model("nfesp") keys <- yaml::read_yaml("keys.yaml") +#* @get / +root <- function() { + "hi" +} + #* @post /rfb rfb <- function(img, key){ From cee1a02220300a49f549238c795db40e11dedff6 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 15:14:25 -0300 Subject: [PATCH 24/34] build all deps --- Dockerfile | 17 +++++++++++++++-- api.R | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d10df54..f3fa975 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,18 @@ -FROM dfalbel/keras-r-docker -MAINTAINER decryptr +FROM rocker/tidyverse +MAINTAINER decryptr + +RUN \ + apt-get update && apt-get install -y apt-transport-https && \ + apt-get install -y python python-dev python-pip python-virtualenv libssl-dev libjpeg-dev libmagick++-dev && \ + rm -rf /var/lib/apt/lists/* + +RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" +RUN R -e "remotes::install_github('rstudio/tensorflow')" +RUN R -e "remotes::install_github('rstudio/keras')" +RUN R -e "keras::install_keras()" + +# Install captcha-breaking captchas +RUN R -e "remotes::install_github('decryptr/decryptr')" COPY api.R api.R COPY keys.yaml keys.yaml diff --git a/api.R b/api.R index 590018b..10c6b28 100644 --- a/api.R +++ b/api.R @@ -10,7 +10,7 @@ keys <- yaml::read_yaml("keys.yaml") #* @get / root <- function() { - "hi" + "hello world" } #* @post /rfb From 87bb16c93769f5a4eb2bed7866dc5ad87fdc70b8 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 15:14:56 -0300 Subject: [PATCH 25/34] install tf 1.13 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f3fa975..49ca045 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN \ RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" RUN R -e "remotes::install_github('rstudio/tensorflow')" RUN R -e "remotes::install_github('rstudio/keras')" -RUN R -e "keras::install_keras()" +RUN R -e "keras::install_keras(tensorflow = '1.13')" # Install captcha-breaking captchas RUN R -e "remotes::install_github('decryptr/decryptr')" From f835de9f4ab0cf847efdbaab1d5496930b1354fb Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 15:20:11 -0300 Subject: [PATCH 26/34] correctly pass the version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 49ca045..e0c2984 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN \ RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" RUN R -e "remotes::install_github('rstudio/tensorflow')" RUN R -e "remotes::install_github('rstudio/keras')" -RUN R -e "keras::install_keras(tensorflow = '1.13')" +RUN R -e "keras::install_keras(tensorflow = '1.13.2')" # Install captcha-breaking captchas RUN R -e "remotes::install_github('decryptr/decryptr')" From 4bf23f49cf628370be90df763304fc54e3b9b34b Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 15:33:18 -0300 Subject: [PATCH 27/34] add h5py --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e0c2984..9e83585 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN \ RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" RUN R -e "remotes::install_github('rstudio/tensorflow')" RUN R -e "remotes::install_github('rstudio/keras')" -RUN R -e "keras::install_keras(tensorflow = '1.13.2')" +RUN R -e "keras::install_keras(tensorflow = '1.13.2', extra_packages = 'h5py')" # Install captcha-breaking captchas RUN R -e "remotes::install_github('decryptr/decryptr')" From 0e2f9ae33c62a45e7d901c0e4eaf564e044fba7a Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 16:48:25 -0300 Subject: [PATCH 28/34] add hdf5 lib --- Dockerfile | 2 +- api.R | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9e83585..a7b8032 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER decryptr RUN \ apt-get update && apt-get install -y apt-transport-https && \ - apt-get install -y python python-dev python-pip python-virtualenv libssl-dev libjpeg-dev libmagick++-dev && \ + apt-get install -y python python-dev python-pip python-virtualenv libssl-dev libjpeg-dev libmagick++-dev libhdf5-dev && \ rm -rf /var/lib/apt/lists/* RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" diff --git a/api.R b/api.R index 10c6b28..f78ff2f 100644 --- a/api.R +++ b/api.R @@ -1,6 +1,8 @@ library(decryptr) library(base64enc) +reticulate::use_virtualenv("r-reticulate", required = TRUE) + model_rfb <- load_model("rfb") model_rsc <- load_model("rsc") model_cadesp <- load_model("cadesp") From d8a6a45def72ff93b0b60691a5e8566f1d5dc09d Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 19:35:02 -0300 Subject: [PATCH 29/34] add libpython --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a7b8032..f6bb24d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER decryptr RUN \ apt-get update && apt-get install -y apt-transport-https && \ - apt-get install -y python python-dev python-pip python-virtualenv libssl-dev libjpeg-dev libmagick++-dev libhdf5-dev && \ + apt-get install -y libpython-dev python3 python3-pip python3-virtualenv python3-venv libssl-dev libjpeg-dev libmagick++-dev libhdf5-dev && \ rm -rf /var/lib/apt/lists/* RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" From a334d21e7723ab5efa54f6c1685c16e40f954179 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Fri, 23 Aug 2019 19:47:30 -0300 Subject: [PATCH 30/34] use reticulate master and remove virtualenv call --- Dockerfile | 1 + api.R | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f6bb24d..dbd59d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ RUN \ rm -rf /var/lib/apt/lists/* RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" +RUN R -e "remotes::install_github('rstudio/reticulate')" RUN R -e "remotes::install_github('rstudio/tensorflow')" RUN R -e "remotes::install_github('rstudio/keras')" RUN R -e "keras::install_keras(tensorflow = '1.13.2', extra_packages = 'h5py')" diff --git a/api.R b/api.R index f78ff2f..10c6b28 100644 --- a/api.R +++ b/api.R @@ -1,8 +1,6 @@ library(decryptr) library(base64enc) -reticulate::use_virtualenv("r-reticulate", required = TRUE) - model_rfb <- load_model("rfb") model_rsc <- load_model("rsc") model_cadesp <- load_model("cadesp") From 35a9b3f89d444488893c1438e14a4a02a69c4f3f Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Sat, 24 Aug 2019 10:09:11 -0300 Subject: [PATCH 31/34] use rocker tensorflow --- Dockerfile | 8 ++++---- example.Rmd | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 example.Rmd diff --git a/Dockerfile b/Dockerfile index dbd59d0..7a72091 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ -FROM rocker/tidyverse +FROM rocker/tensorflow MAINTAINER decryptr RUN \ - apt-get update && apt-get install -y apt-transport-https && \ - apt-get install -y libpython-dev python3 python3-pip python3-virtualenv python3-venv libssl-dev libjpeg-dev libmagick++-dev libhdf5-dev && \ + apt-get update && + apt-get install -y apt-transport-https && \ + apt-get install -y libssl-dev libjpeg-dev libmagick++-dev && \ rm -rf /var/lib/apt/lists/* RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" RUN R -e "remotes::install_github('rstudio/reticulate')" RUN R -e "remotes::install_github('rstudio/tensorflow')" RUN R -e "remotes::install_github('rstudio/keras')" -RUN R -e "keras::install_keras(tensorflow = '1.13.2', extra_packages = 'h5py')" # Install captcha-breaking captchas RUN R -e "remotes::install_github('decryptr/decryptr')" diff --git a/example.Rmd b/example.Rmd new file mode 100644 index 0000000..ebf1914 --- /dev/null +++ b/example.Rmd @@ -0,0 +1,45 @@ +--- +title: "Untitled" +output: html_document +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +Suppose I have 2 overloaded functions in the C++ library I am creating wrapers for R: + +```{Rcpp} +int fun (int i) { + return i + 1; +} + +int fun (int i, int j) { + return i + j +} +``` + +I am writing the C++ code like this: + +```{Rcpp} +int my_wraper (int i, Rcpp::Nullable j) { + + int out; + + if (j.isNull()) { + out = fun(i); + } else { + out = fun(i, j); + } + + return out; +} +``` + +The problem is that this quickly becomes tedious if the function has 10 +different signatures. Would there be any way to + + + + + From e870f16275baa21ccfdbc63de6080aa1efa9d776 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Sat, 24 Aug 2019 10:10:06 -0300 Subject: [PATCH 32/34] " --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7a72091..f0502a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM rocker/tensorflow MAINTAINER decryptr RUN \ - apt-get update && + apt-get update && \ apt-get install -y apt-transport-https && \ apt-get install -y libssl-dev libjpeg-dev libmagick++-dev && \ rm -rf /var/lib/apt/lists/* From dae07a9ad3f2fd6e0aa635dd551f1a585fa14801 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 5 Sep 2019 11:27:15 -0300 Subject: [PATCH 33/34] chaves servem p/ qualquer ponto --- api.R | 8 ++++---- keys.yaml | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/api.R b/api.R index 10c6b28..c60c664 100644 --- a/api.R +++ b/api.R @@ -17,7 +17,7 @@ root <- function() { rfb <- function(img, key){ key <- openssl::sha256(key) - if(!key %in% keys$rfb | is.null(key) | is.na(key)) { + if(!key %in% keys | is.null(key) | is.na(key)) { stop("Not authorized. Get an api key from decryptr.com.br") } @@ -30,7 +30,7 @@ rfb <- function(img, key){ rsc <- function(img, key){ key <- openssl::sha256(key) - if(!key %in% keys$rsc | is.null(key) | is.na(key)) { + if(!key %in% keys | is.null(key) | is.na(key)) { stop("Not authorized. Get an api key from decryptr.com.br") } @@ -43,7 +43,7 @@ rsc <- function(img, key){ cadesp <- function(img, key){ key <- openssl::sha256(key) - if(!key %in% keys$cadesp | is.null(key) | is.na(key)) { + if(!key %in% keys | is.null(key) | is.na(key)) { stop("Not authorized. Get an api key from decryptr.com.br") } @@ -56,7 +56,7 @@ cadesp <- function(img, key){ nfesp <- function(img, key){ key <- openssl::sha256(key) - if(!key %in% keys$nfesp | is.null(key) | is.na(key)) { + if(!key %in% keys | is.null(key) | is.na(key)) { stop("Not authorized. Get an api key from decryptr.com.br") } diff --git a/keys.yaml b/keys.yaml index f9d0478..68fd835 100644 --- a/keys.yaml +++ b/keys.yaml @@ -1,4 +1,3 @@ -rfb: - ef556689177dbe281139a5688162f54166127c83746a83c87b872605621aa156 - ef556689177dbe281139a5688162f54166127c83746a83c87b872605621aa156 - b934527d8d59be4766e43db6c9de039871ddcea33c948bcf59ee5ed29fdc1f4f @@ -12,13 +11,10 @@ rfb: - 425d030a3ea9bbac450d36aafc5b3be0137aafc66573a43b68a4dcc2659bb246 - b31a3e607c9233304beca5d2e207f202e9cdfb8e62446e242d85472f415dd9c6 - 92de28b6fb134ed15a51d3e2a8283d5c1570b4eb0c2a12656db1953907946b15 -tjsp: - 500b9353182dbe693eba1a6c242108103dcef7954d1bdab3e622a0bda3187474 - d28be9f24a8ffc0e7698e87e9fa84c7a469135561b9294ba66091658bb413856 -rsc: a62d0d5f6c6d541028e5af059a18da585888550d815fe0a1289671433e2a7986 -cadesp: +- a62d0d5f6c6d541028e5af059a18da585888550d815fe0a1289671433e2a7986 - d7abeb4ab20aab42c3a54f92f37d98330f2cbd1d7e3804f282eaa265d35dede9 - 9ac78bf7017408c0c1c803c7ff3481872142cb35f7cff1535f7c09f902192436 -nfesp: - 805f61f603b71bb4ea2fcf1b4e0f7e81aa7dce862bf0cc8abc8e136d0670b1c7 - 611a69d04ea3b5daf033a09c74fb1d9c2229262adf375b9b80fab11fa636c3fd From be8856d7bc87524a1eea6deafd8102e643997bec Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 5 Sep 2019 11:27:23 -0300 Subject: [PATCH 34/34] usar Rscript --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0502a0..e2af811 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,13 @@ RUN \ apt-get install -y libssl-dev libjpeg-dev libmagick++-dev && \ rm -rf /var/lib/apt/lists/* -RUN R -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" -RUN R -e "remotes::install_github('rstudio/reticulate')" -RUN R -e "remotes::install_github('rstudio/tensorflow')" -RUN R -e "remotes::install_github('rstudio/keras')" +RUN Rscript -e "install.packages(c('plumber', 'yaml', 'base64enc', 'remotes'))" +RUN Rscript -e "remotes::install_github('rstudio/reticulate')" +RUN Rscript -e "remotes::install_github('rstudio/tensorflow')" +RUN Rscript -e "remotes::install_github('rstudio/keras')" # Install captcha-breaking captchas -RUN R -e "remotes::install_github('decryptr/decryptr')" +RUN Rscript -e "remotes::install_github('decryptr/decryptr')" COPY api.R api.R COPY keys.yaml keys.yaml