sftp: init and access API with a token

This commit is contained in:
Girish Ramakrishnan
2020-10-19 17:26:20 -07:00
parent 2aa5c387c7
commit 876d0d5873
4 changed files with 13 additions and 10 deletions
+3
View File
@@ -9,6 +9,7 @@ var apps = require('./apps.js'),
assert = require('assert'),
async = require('async'),
debug = require('debug')('box:sftp'),
hat = require('./hat.js'),
infra = require('./infra_version.js'),
safe = require('safetydance'),
shell = require('./shell.js'),
@@ -43,6 +44,7 @@ function rebuild(callback) {
const tag = infra.images.sftp.tag;
const memoryLimit = 256;
const cloudronToken = hat(8 * 128);
apps.getAll(function (error, result) {
if (error) return done(error);
@@ -94,6 +96,7 @@ function rebuild(callback) {
--dns-search=. \
-p 222:22 \
${appDataVolumes} \
-e CLOUDRON_SFTP_TOKEN="${cloudronToken}" \
-v "/etc/ssh:/etc/ssh:ro" \
--label isCloudronManaged=true \
--read-only -v /tmp -v /run "${tag}"`;