FTP-Sync for Visual Studio Code with implicit FTP TLS/SSL - visual-studio

I'm trying to mimic my working WinSCP FTP site on Visual Studio Code with the FTP-Sync package and I can't get this done for some reason.
Our server requires implicit FTP so my working site is ftps://ftpwebsite.user:990 and it prompts for my user and pass which works.
This package tries to connect for a minute and then closes with no luck.
Config file:
{
"protocol": "ftps",
"host": "ftpweb.user",
"port": 990,
"user": "ftpweb.user|user123",
"pass": "**********",
"remote": "/",
"secure": false,
"uploadOnSave": true,
"passive": true,
"debug": true,
"privateKeyPath": null,
"passphrase": null,
"agent": null,
"watch":[],
"watchTimeout": 500,
"allow": [],
"ignore": [
"\\.vscode",
"\\.git",
"\\.DS_Store"
],
"generatedFiles": {
"extensionsToInclude": [
""
],
"path": ""
}
}

It seems that the ftp-sync uses Node.js node-ftp module.
And it seems that for it to use implicit TLS/SSL, you need to set secure to implicit:
secure - mixed - Set to true for both control and data connection encryption, 'control' for control connection encryption only, or 'implicit' for implicitly encrypted control connection (this mode is deprecated in modern times, but usually uses port 990) Default: false
See also How to connect to a implicit FTPS server with nodeJS?
Though are you sure that you need to use the implicit mode? As even mentioned in the above documentation, the implicit mode is obsolete.

Related

Understanding the ports in lauchsettings.json

Background
I have the following launchsettings.json:
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:54732",
"sslPort": 44382
}
},
"profiles": {
"NoteKeeperService": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7249;http://localhost:5249",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
This was generated by Visual Studio and I am trying to understand the different ports that it generated. Specifically there are 4 different ports generated by Visual Studio:
The four ports are:
iisSettings->iisExpress->applicationUrl (Line 7)
Port: 54732 - (http)
iiSettings->IssExpress->sslPort (Line 8)
Port: 44382 - (https)
profiles->applicationUrl (Line 17)
Port: 7249 - (https)
Port: 5249 - (http)
There are a pair (http and https) for IIS Express and a pair for the service directly (when it runs inside of Visual Studio, I think...?) I am guessing they all different so you don't get any port conflicts when running in IIS Express and locally.
Question
And what range rules do these ports follow for generation?
Details (ignorable)
I am creating my own template, and I want to make sure I understand the ranges for each port number so I don't put the ports in an invalid range. The dotnet templating system has a generator for ports, but it requires that I supply a range value for the ports. I am unsure what those ranges should be, or if it even matters.
This is actually more of an OS/Infrastructure question than a Visual Studio question, since ports are how the system will manage communications.
Generally speaking ports < 1024 may be "reserved" for use by "well known" programs. e.g. 80 for http, 443 for https, 21 for ftp etc.
The IANA port list may give you a more complete picture
Safe to say for your Visual Studio template any port between 1025 and 65000 should suffice. It should be up to the end user (developer in this case) to determine if the high range port is already in use by another development project.

Strapi deployment to Heroku

I am totally new on Strapi and Heroku. I am trying to deploy my app that is working well locally to Heroku but I am getting the following error:
2020-06-15T09:56:29.114780+00:00 app[web.1]: [2020-06-15T09:56:29.114Z] error Impossible to register the 'menus.menus' model.
2020-06-15T09:56:29.115672+00:00 app[web.1]: [2020-06-15T09:56:29.115Z] error TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
At the beginning I thought it was a problem connecting to the database, but in my local environment it work perfectly and connect with no issues.
I even upgraded my database to a paid version in case the connection is timing out.
I also follow some answers I found only about modifying my config/environment/production/database.json as follow:
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "bookshelf",
"settings": {
"client": "postgres",
"host": "***.compute-1.amazonaws.com",
"port": "5432",
"database": "***",
"username": "***",
"password": "***",
"ssl": { "rejectUnauthorized": false }
},
"options": {
"debug": false,
"acquireConnectionTimeout": 100000,
"pool": {
"min": 0,
"max": 10,
"createTimeoutMillis": 30000,
"acquireTimeoutMillis": 600000,
"idleTimeoutMillis": 20000,
"reapIntervalMillis": 20000,
"createRetryIntervalMillis": 200
}
}
}
}
}
Any other idea of what can it be?
When I run the develop locally I got a warn (but even this the app run anyway after):
[2020-06-15T10:36:41.261Z] warn The bootstrap function is taking unusually long to execute (3500 miliseconds).
[2020-06-15T10:36:41.261Z] warn Make sure you call it?
[2020-06-15T10:36:42.476Z] warn The bootstrap function is taking unusually long to execute (3500 miliseconds).
[2020-06-15T10:36:42.476Z] warn Make sure you call it?
One simple first step option is to launch a strapi quickstart application on heroku. You can find this link here.. https://github.com/strapi/strapi
Relaunching with this method will provide you with a working, secure instance to begin development on.
Also note that heroku deploys strapi to production, so that you are not able to use the content-types editor, so it is recommended that you develop locally & test your app and use the heroku cli to update your deployment.

How to enable HTTPS for VS Code Live Server extension?

I have installed OpenSSL and created a certificate and private key. I used the configuration from this page (shown below) but when I use live server extension from VS Code, it says "Connection not secured" and "Certificate is Invalid".
liveServer.settings.https: To enable https protocol.
Properties :
"liveServer.settings.https": {
"enable": false, //set it true to enable the feature.
"cert": "C:\\https\\server.cert", //full path
"key": "C:\\https\\server.key", //full path
"passphrase": "12345"
},

Setting up site in sublime text ftp manager

I have a perfectly working instance of WinSCP that I"m using for ftp. I have no problems with it but it's inconvenient and I want to use FTP within sublime text
I installed the SFTP/FTP package and trying to setup my remote server but the connection times out every time.
WinSCP details from site manager:
File Protocol: FTP
Encryption: TLS/SSL Implicit Encryption
Host Name: ftp.testUser.testSite
port number: 990
user name: ftp.testUser.testSite|testUser
password: test123!
Current sftp-config.json file:
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"sync_down_on_open": true,
"sync_same_age": true,
"host": "ftp.testUser.testSite",
"user": "ftp.testUser.testSite|testUser",
"password": "test123!",
"port": "990",
"remote_path": "C:/users/testUser/ftpweb/siteFolder",
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
"allow_config_upload": true,
}

sublime text FTP - Editing file creates new one

I recently installed sublime text 2 plugin "SFTP" to work directly with my ftp server files.
It connects to my ftp server correctly, but when I upload/save the file (in order to save the edits to the original file) it doesn't overrides the original file saving the updates, instead, it creates a new file in my ftp folder: If I edit "index.php" when i save it sublime text creates a new file "index.php.1" and the original index.php remains un-updated.
I tough that this could be a permission issue, but on my server the folder is with 777 on all users and files got 777 permission too.
Here is my sftp pluguin config file (sftp-config.json):
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": true,
"sync_skip_deletes": false,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "mobility.unixdata.es",
"user": "admin",
"password": "mlcud",
//"port": "22",
"remote_path": "/Escriptori/htdocs/betamobility/testing",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn", "\\.hg", "\\.git",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
"file_permissions": "777",
"dir_permissions": "777",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
}
Thanks for your help !!
Most likely this is due to a setting of the FTP server. See https://superuser.com/questions/333022/ftp-upload-overwrite-does-not-overwite-but-creates-file-ext-instead for an answer to a similar question.
If you are transferring files over a public network, I recommend you use SFTP instead of FTP.

Resources