Compare commits
1 Commits
static-can
...
AUT-860
Author | SHA1 | Date | |
---|---|---|---|
![]() |
aee0674d20 |
@@ -31,6 +31,7 @@
|
||||
"accounting": "^0.4.1",
|
||||
"ajv-formats": "^2.1.1",
|
||||
"axios": "1.6.0",
|
||||
"basic-ftp": "^5.0.5",
|
||||
"bcrypt": "^5.0.1",
|
||||
"bullmq": "^3.0.0",
|
||||
"cors": "^2.8.5",
|
||||
|
1
packages/backend/src/apps/ftp/assets/favicon.svg
Normal file
1
packages/backend/src/apps/ftp/assets/favicon.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 109.36" style="enable-background:new 0 0 122.88 109.36" xml:space="preserve"><g><path d="M14.69,16.44h3.56V8.63c0-1.09,0.88-1.97,1.97-1.97h3.5V1.97C23.72,0.88,24.6,0,25.69,0h31.92c1.09,0,1.97,0.88,1.97,1.97 v4.69h43.05c1.09,0,1.97,0.88,1.97,1.97v7.82h3.59c1.09,0,1.97,0.88,1.97,1.97c0,0.14-0.01,0.28-0.04,0.42l-6.88,50.59 c-0.22,1.65-0.95,3.18-2.05,4.29c-1.1,1.1-2.54,1.78-4.25,1.78H70.95v5.86h2.12c1.54,0,2.8,1.26,2.8,2.8v5.06h10.44 c1.25,0,2.32,0.83,2.67,1.97h26.1c3.73,0,6.14,2.07,7.2,4.71c0.4,1,0.6,2.08,0.6,3.14c0,1.06-0.2,2.14-0.6,3.14 c-1.06,2.64-3.47,4.71-7.2,4.71H89.09c-0.15,1.4-1.35,2.49-2.78,2.49H72.63H38.8c-1.44,0-2.63-1.1-2.78-2.49H7.8 c-3.73,0-6.14-2.07-7.2-4.71c-0.4-1-0.6-2.08-0.6-3.14c0-1.06,0.2-2.14,0.6-3.14c1.06-2.64,3.47-4.71,7.2-4.71h28.32 c0.36-1.14,1.42-1.97,2.67-1.97h8.74v-5.06c0-1.54,1.26-2.8,2.8-2.8h1.69v-5.86H24.38c-1.71,0-3.19-0.69-4.3-1.79 c-1.11-1.11-1.83-2.66-2.01-4.33l-5.33-50.74c-0.11-1.08,0.67-2.04,1.75-2.15C14.56,16.45,14.63,16.45,14.69,16.44L14.69,16.44 L14.69,16.44L14.69,16.44z M31.38,34.43h16.29v4.58H38v3.72h8.26v4.3H38v8.71h-6.61V34.43L31.38,34.43z M50.08,34.43H70.1v5.27 h-6.72v16.05h-6.59V39.7h-6.71V34.43L50.08,34.43z M73.41,34.43h10.95c2.38,0,4.17,0.57,5.35,1.7c1.19,1.14,1.78,2.75,1.78,4.84 c0,2.15-0.65,3.84-1.94,5.05c-1.3,1.21-3.27,1.82-5.93,1.82h-3.6v7.91h-6.61V34.43L73.41,34.43z M80.03,43.52h1.61 c1.27,0,2.16-0.22,2.68-0.66c0.51-0.44,0.77-1,0.77-1.69c0-0.67-0.22-1.24-0.67-1.7c-0.44-0.47-1.28-0.7-2.51-0.7h-1.88V43.52 L80.03,43.52z M56.38,81.34h10.21v-5.79H56.38V81.34L56.38,81.34z M89.11,94.88v8.27h25.97c1.97,0,3.22-1.04,3.76-2.37 c0.22-0.54,0.33-1.15,0.33-1.76s-0.11-1.22-0.33-1.76c-0.54-1.33-1.79-2.37-3.76-2.37H89.11L89.11,94.88z M36,103.15v-8.27H7.8 c-1.97,0-3.22,1.04-3.76,2.37c-0.22,0.54-0.33,1.15-0.33,1.76s0.11,1.22,0.33,1.76c0.54,1.33,1.79,2.37,3.76,2.37H36L36,103.15z M20.23,20.38h-3.35l5.1,48.57c0.08,0.78,0.39,1.47,0.87,1.95c0.4,0.4,0.92,0.64,1.53,0.64h72.54c0.59,0,1.1-0.24,1.48-0.62 c0.49-0.49,0.82-1.22,0.93-2.03l6.6-48.51L20.23,20.38L20.23,20.38L20.23,20.38z M22.19,10.6v5.83l78.46-0.83v-5H57.61 c-1.09,0-1.97-0.88-1.97-1.97V3.94H27.66v4.69c0,1.09-0.88,1.97-1.97,1.97L22.19,10.6L22.19,10.6L22.19,10.6z"/></g></svg>
|
After Width: | Height: | Size: 2.3 KiB |
91
packages/backend/src/apps/ftp/auth/index.js
Normal file
91
packages/backend/src/apps/ftp/auth/index.js
Normal file
@@ -0,0 +1,91 @@
|
||||
import verifyCredentials from './verify-credentials.js';
|
||||
import isStillVerified from './is-still-verified.js';
|
||||
|
||||
export default {
|
||||
fields: [
|
||||
{
|
||||
key: 'screenName',
|
||||
label: 'Screen Name',
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
placeholder: null,
|
||||
description:
|
||||
'Screen name of your connection to be used on Automatisch UI.',
|
||||
clickToCopy: false,
|
||||
},
|
||||
{
|
||||
key: 'host',
|
||||
label: 'Host',
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
placeholder: null,
|
||||
description: 'The host information Automatisch will connect to.',
|
||||
docUrl: 'https://automatisch.io/docs/ftp#host',
|
||||
clickToCopy: false,
|
||||
},
|
||||
{
|
||||
key: 'username',
|
||||
label: 'Email/Username',
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
placeholder: null,
|
||||
description: 'Your FTP login credentials.',
|
||||
docUrl: 'https://automatisch.io/docs/ftp#username',
|
||||
clickToCopy: false,
|
||||
},
|
||||
{
|
||||
key: 'password',
|
||||
label: 'Password',
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
placeholder: null,
|
||||
description: null,
|
||||
docUrl: 'https://automatisch.io/docs/ftp#password',
|
||||
clickToCopy: false,
|
||||
},
|
||||
{
|
||||
key: 'secure',
|
||||
label: 'Secure',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
readOnly: false,
|
||||
value: false,
|
||||
placeholder: null,
|
||||
description: null,
|
||||
docUrl: 'https://automatisch.io/docs/ftp#secure',
|
||||
clickToCopy: false,
|
||||
options: [
|
||||
{
|
||||
label: 'Yes',
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
label: 'No',
|
||||
value: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'port',
|
||||
label: 'Port',
|
||||
type: 'string',
|
||||
required: false,
|
||||
readOnly: false,
|
||||
value: '21',
|
||||
placeholder: null,
|
||||
description: null,
|
||||
docUrl: 'https://automatisch.io/docs/ftp#port',
|
||||
clickToCopy: false,
|
||||
},
|
||||
],
|
||||
verifyCredentials,
|
||||
isStillVerified,
|
||||
};
|
8
packages/backend/src/apps/ftp/auth/is-still-verified.js
Normal file
8
packages/backend/src/apps/ftp/auth/is-still-verified.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import verifyCredentials from './verify-credentials.js';
|
||||
|
||||
const isStillVerified = async ($) => {
|
||||
await verifyCredentials($);
|
||||
return true;
|
||||
};
|
||||
|
||||
export default isStillVerified;
|
19
packages/backend/src/apps/ftp/auth/verify-credentials.js
Normal file
19
packages/backend/src/apps/ftp/auth/verify-credentials.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Client } from 'basic-ftp';
|
||||
|
||||
const verifyCredentials = async ($) => {
|
||||
const client = new Client();
|
||||
client.ftp.verbose = true;
|
||||
|
||||
await client.access({
|
||||
host: $.auth.data.host,
|
||||
user: $.auth.data.username,
|
||||
password: $.auth.data.password,
|
||||
secure: $.auth.data.secure,
|
||||
});
|
||||
|
||||
await $.auth.set({
|
||||
screenName: $.auth.data.screenName,
|
||||
});
|
||||
};
|
||||
|
||||
export default verifyCredentials;
|
14
packages/backend/src/apps/ftp/index.js
Normal file
14
packages/backend/src/apps/ftp/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import defineApp from '../../helpers/define-app.js';
|
||||
import auth from './auth/index.js';
|
||||
|
||||
export default defineApp({
|
||||
name: 'FTP',
|
||||
key: 'ftp',
|
||||
iconUrl: '{BASE_URL}/apps/ftp/assets/favicon.svg',
|
||||
authDocUrl: 'https://automatisch.io/docs/apps/ftp/connection',
|
||||
supportsConnections: true,
|
||||
baseUrl: '',
|
||||
apiBaseUrl: '',
|
||||
primaryColor: '000000',
|
||||
auth,
|
||||
});
|
@@ -113,6 +113,12 @@ export default defineConfig({
|
||||
{ text: 'Connection', link: '/apps/formatter/connection' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'FTP',
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
items: [{ text: 'Connection', link: '/apps/ftp/connection' }],
|
||||
},
|
||||
{
|
||||
text: 'Ghost',
|
||||
collapsible: true,
|
||||
|
16
packages/docs/pages/apps/ftp/connection.md
Normal file
16
packages/docs/pages/apps/ftp/connection.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# FTP
|
||||
|
||||
:::info
|
||||
This page explains the steps you need to follow to set up the FTP connection in Automatisch. If any of the steps are outdated, please let us know!
|
||||
:::
|
||||
|
||||
FTP, which stands for File Transfer Protocol, is a standard network protocol used for the transfer of computer files between a client and server on a computer network. t's commonly used to download files from a server or upload files to a server.. You need to provide the following information from Automatisch by using FTP connection.
|
||||
|
||||
1. Write any screen name to be displayed in Automatisch.
|
||||
1. Fill host address field with the FTP host address.
|
||||
1. Fill username field with the FTP username.
|
||||
1. Fill password field with the FTP password.
|
||||
1. Select the Secure field.
|
||||
1. Fill port field with the FTP port. Default is 21.
|
||||
1. Click **Submit** button on Automatisch.
|
||||
1. Now, you can start using the FTP connection with Automatisch.
|
1
packages/docs/pages/public/favicons/ftp.svg
Normal file
1
packages/docs/pages/public/favicons/ftp.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 109.36" style="enable-background:new 0 0 122.88 109.36" xml:space="preserve"><g><path d="M14.69,16.44h3.56V8.63c0-1.09,0.88-1.97,1.97-1.97h3.5V1.97C23.72,0.88,24.6,0,25.69,0h31.92c1.09,0,1.97,0.88,1.97,1.97 v4.69h43.05c1.09,0,1.97,0.88,1.97,1.97v7.82h3.59c1.09,0,1.97,0.88,1.97,1.97c0,0.14-0.01,0.28-0.04,0.42l-6.88,50.59 c-0.22,1.65-0.95,3.18-2.05,4.29c-1.1,1.1-2.54,1.78-4.25,1.78H70.95v5.86h2.12c1.54,0,2.8,1.26,2.8,2.8v5.06h10.44 c1.25,0,2.32,0.83,2.67,1.97h26.1c3.73,0,6.14,2.07,7.2,4.71c0.4,1,0.6,2.08,0.6,3.14c0,1.06-0.2,2.14-0.6,3.14 c-1.06,2.64-3.47,4.71-7.2,4.71H89.09c-0.15,1.4-1.35,2.49-2.78,2.49H72.63H38.8c-1.44,0-2.63-1.1-2.78-2.49H7.8 c-3.73,0-6.14-2.07-7.2-4.71c-0.4-1-0.6-2.08-0.6-3.14c0-1.06,0.2-2.14,0.6-3.14c1.06-2.64,3.47-4.71,7.2-4.71h28.32 c0.36-1.14,1.42-1.97,2.67-1.97h8.74v-5.06c0-1.54,1.26-2.8,2.8-2.8h1.69v-5.86H24.38c-1.71,0-3.19-0.69-4.3-1.79 c-1.11-1.11-1.83-2.66-2.01-4.33l-5.33-50.74c-0.11-1.08,0.67-2.04,1.75-2.15C14.56,16.45,14.63,16.45,14.69,16.44L14.69,16.44 L14.69,16.44L14.69,16.44z M31.38,34.43h16.29v4.58H38v3.72h8.26v4.3H38v8.71h-6.61V34.43L31.38,34.43z M50.08,34.43H70.1v5.27 h-6.72v16.05h-6.59V39.7h-6.71V34.43L50.08,34.43z M73.41,34.43h10.95c2.38,0,4.17,0.57,5.35,1.7c1.19,1.14,1.78,2.75,1.78,4.84 c0,2.15-0.65,3.84-1.94,5.05c-1.3,1.21-3.27,1.82-5.93,1.82h-3.6v7.91h-6.61V34.43L73.41,34.43z M80.03,43.52h1.61 c1.27,0,2.16-0.22,2.68-0.66c0.51-0.44,0.77-1,0.77-1.69c0-0.67-0.22-1.24-0.67-1.7c-0.44-0.47-1.28-0.7-2.51-0.7h-1.88V43.52 L80.03,43.52z M56.38,81.34h10.21v-5.79H56.38V81.34L56.38,81.34z M89.11,94.88v8.27h25.97c1.97,0,3.22-1.04,3.76-2.37 c0.22-0.54,0.33-1.15,0.33-1.76s-0.11-1.22-0.33-1.76c-0.54-1.33-1.79-2.37-3.76-2.37H89.11L89.11,94.88z M36,103.15v-8.27H7.8 c-1.97,0-3.22,1.04-3.76,2.37c-0.22,0.54-0.33,1.15-0.33,1.76s0.11,1.22,0.33,1.76c0.54,1.33,1.79,2.37,3.76,2.37H36L36,103.15z M20.23,20.38h-3.35l5.1,48.57c0.08,0.78,0.39,1.47,0.87,1.95c0.4,0.4,0.92,0.64,1.53,0.64h72.54c0.59,0,1.1-0.24,1.48-0.62 c0.49-0.49,0.82-1.22,0.93-2.03l6.6-48.51L20.23,20.38L20.23,20.38L20.23,20.38z M22.19,10.6v5.83l78.46-0.83v-5H57.61 c-1.09,0-1.97-0.88-1.97-1.97V3.94H27.66v4.69c0,1.09-0.88,1.97-1.97,1.97L22.19,10.6L22.19,10.6L22.19,10.6z"/></g></svg>
|
After Width: | Height: | Size: 2.3 KiB |
@@ -5471,6 +5471,11 @@ basic-auth@^2.0.1, basic-auth@~2.0.1:
|
||||
dependencies:
|
||||
safe-buffer "5.1.2"
|
||||
|
||||
basic-ftp@^5.0.5:
|
||||
version "5.0.5"
|
||||
resolved "https://registry.yarnpkg.com/basic-ftp/-/basic-ftp-5.0.5.tgz#14a474f5fffecca1f4f406f1c26b18f800225ac0"
|
||||
integrity sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==
|
||||
|
||||
batch@0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz"
|
||||
|
Reference in New Issue
Block a user