The following has been configured
settings.PersistSessionCookies = true;
settings.Locale = "zh-CN";
settings.AcceptLanguageList = "zh-CN";
How can I configure the default developer tool to save in Chinese
enter image description here
Related
I Use ElasticSearch 8.1.2
and Nest 17.7.1
var settings = new ConnectionSettings(new Uri("http://localhost:9200/"))
.CertificateFingerprint("A5:8B:07:2D:A9:E8:53:CE:GB:C0:15:CE:6E:DF:9C:65:89:A3:AC:D2:94:2C:46:BD:85:23:20:6B:F2:69:B3:88")
.BasicAuthentication("elastic", "-L-uXRg5=iOXGFgebP68")
.DeadTimeout(TimeSpan.FromSeconds(300))
.DefaultIndex("people");
var client = new ElasticClient(settings);
var person = new Person
{
Id = 1,
FirstName = "Martijn",
LastName = "Laarman"
};
var asyncIndexResponse = await client.IndexDocumentAsync(person);
return Task.CompletedTask;
But I have Error
enter image description here
error message:
Message = "The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. Call: Status code unknown from: GET /"
Enable the compatibility header in the connection settings:
settings.EnableApiVersioningHeader(); // enable ES 7.x compatibility on ES 8.x servers
Docu here under Enabling Compatibility Mode
I successfully uploaded an image with imagepicker and multer to my folder "uploads/".
I also send the filename back to the client:
res.send({uploadedImage: req.file.path});
// Result:
Object {
"uploadedImage": "uploads\\photo_1619350900261_b1099740-f86c-4809-ae62-0ad973a499c0.jpg",
}
So how can I now read the file or the image? I can put this in a state but there is no url in this image object upload.
To Display the image from response
Use it like this
BaseURL = The URL at which you send post requests (i.e, your Backend Server)
Result.uploadedImage = This you get from the response
So the final uri would be
uri = BaseURL + Result.uploadedImage
It will look Something like this localhost:3000/uploads\\photo_1619350900261_b1099740-f86c-4809-ae62-0ad973a499c0.jpg or 127.0.0.1:3000/uploads\\photo_1619350900261_b1099740-f86c-4809-ae62-0ad973a499c0.jpg
But if you are working on your phone then you might have to replace your BaseURL with your IPv4 address.. This address you can get it from CMD
1.) Open CMD
2.) type ipconfig
3.) Scroll down and look for IPv4 Address..It will look something like this
192.168.100.74
4.) Now uri_to_display = IPv4 Address + : + PORT + Result.uploadedImage
I'm starting using traefik for blue/green deployment. I would like to use the REST API, so I have to put my configuration in the [web] section:
[web]
address = ":8080"
readOnly = false
[backends]
[backends.back]
[backends.back.loadbalancer.stickiness]
cookieName = "backend"
[backends.back.servers.S000]
url = "http://HOST_IP_ADDRESS:30000"
weight = 1
[backends.back.servers.S001]
url = "http://HOST_IP_ADDRESS:30001"
weight = 1
[frontends]
[frontends.front]
backend = "back"
passHostHeader = true
But it's not initialized with those values. However if I use PUT to http://localhost:8091/api/providers/web I can see the web provider OK. And if I use this same configuration for [file] it works right (but I'm unable to update it via API)
Is there any web to initialize [web] backends/frontends?
web section is deprecated.
try this:
# Enable API and dashboard
[api]
# Name of the related entry point
entryPoint = "traefik"
# Enabled Dashboard
dashboard = true
I forked this simple server-client akka project:
https://github.com/roclas/akka-irc
which is an IRC-like chat and I'm trying to encode messages.
In my master branch, if I start a server (sbt run and then select option 2) and then a client (sbt run and then select option 1),
if I write something in the client, the message is correctly sent to the server.
If I start wireshark and listen to the messages that meet these conditions:
tcp.port==1099 and tcp.len>200
I can read the messages in plain text.
How could I encode them using SSL?
You can see what I am trying to do by modifying the src/main/resources/application.conf file in the develop branch
What would I have to modify?
How should my src/main/resources/application.conf file look like?
Thank you
You should enable SSL at yout custom .conf file with:
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.ssl"]
netty.ssl{
enable-ssl = true
security {
key-store = "path-to-your-keystore"
key-store-password = "your-keystore's-password"
key-password = "your-key's-password"
trust-store = "path-to-your-truststore"
trust-store-password = "your-trust-store's-password"
protocol = "TLSv1"
random-number-generator = "AES128CounterSecureRNG"
enabled-algorithms = ["TLS_RSA_WITH_AES_128_CBC_SHA"]
}
}
}
}
And don't forget to change your actor path's prefix to:
akka.ssl.tcp://YourActorSystemName#ip:port:/...
In addition to what J.Santos said, I had forgotten to create these two files:
trust-store = "path-to-your-truststore"
trust-store-password = "your-trust-store's-password"
that I changed by:
key-store = "src/main/resources/keystore"
trust-store = "src/main/resources/truststore"
in my ./src/main/resources/common.conf
as J.Santos reminded me after looking at my project.
Thank you very much!!
I have a problem with the integration of KCFinder in ckeditor. The version of my ckeditor is 4.0 and the other (KCFinder version) is 2.52-dev.
Hi configure the config.js of ckeditor like that:
CKEDITOR.config.baseHref = "/ckeditor/";
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
config.contentsCss = 'contents.css';
config.language= 'it';
config.height = '400px';
config.uiColor = '#ffDC6E';
//kcfinder per l'uoload delle immagini
config.filebrowserBrowseUrl = 'kcfinder-2.51/browse.php?type=files';
config.filebrowserImageBrowseUrl = 'kcfinder-2.51/browse.php?type=images';
config.filebrowserFlashBrowseUrl = 'kcfinder-2.51/browse.php?type=flash';
config.filebrowserUploadUrl = '../../../reserved/kcfinder-2.51/upload.php?type=files';
config.filebrowserImageUploadUrl = '../../../reserved/kcfinder-2.51/upload.php?type=images';
config.filebrowserFlashUploadUrl = '../../../reserved/kcfinder-2.51/upload.php?type=flash';
// Remove some buttons, provided by the standard plugins, which we don't
// need to have in the Standard(s) toolbar.
config.removeButtons = 'Subscript,Superscript';
config.disableNativeSpellChecker = false;
};
The integration is of but when I click to "Show files in the server" or when I upload an image the system says "You do not have permission to list the files" though the permissions are correct.
What is the problem?
Tks
Salvo
I think the problem is that you also need to configure the setting in KCFinder. You need to locate config.php in KCFinder folder, for this:
'disabled' => true
change it to false then you should be able to upload file to your server.
Is not the best way for secure raison, because to disable it inside config.php allow to all user to access it, the best way add the little code bellow inside the php file wich include your textarea :
$_SESSION['KCFINDER'] = array(
'disabled' => false
);
Hopes that help.
From the kcfinder website:
By default KCFinder is disabled. If you just set this setting to false all public visitors can upload and manage files on your web site. It is recommended to override this setting with sesssion configuration so only authenticated users can use KCFinder.