Unable to connect server via parse dashboard? - parse-server

I have set up the parse-server and parse-dashboard in a dedicated instance on Alibaba Cloud with 2vCPU and 8GB of RAM with ApsaraDB for MongoDB as DB for Parse.
I successfully setup the dashboard and server. When I tried to access the server I get the following error,
"Unable to connect to server."
Parse Dashboard Error Screenshot
I am successfully able to make POST and GET Requests like below
curl -X POST \
-H "X-Parse-Application-Id: APPLICATION_ID" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore
//Response
{
"objectId": "2ntvSpRGIK",
"createdAt": "2016-03-11T23:51:48.050Z"
}
I am able to connect via putty and FTP.
Thanks

While your computer (by that I mean other applications) is reaching the server the Parse dashboard isn't.
Inside your dashboard config you can try changing
http://localhost:1337/parse
to
http://[ip-address]:1337/parse
Also go through this thread, you might be able to get some more insight on why it is not working:
https://github.com/parse-community/parse-dashboard/issues/785

Related

Rundeck : How to check Rundeck health status?

We have a few jobs in production rundeck, due to other application running and throttling CPU, rundeck sometimes goes slow and lag sometimes nearly dead but rundeckd process will be still running. I wanted to set up cron(which I know) to query rundeck healthcheck and report if its sluggish till we migrate rundeck to dedicated VM. I found rundeck3.3 has api enabled by default and I am able to query in browser like http://rundesckhost:4440/metrics/ping which will return pong. Apparently http://rundeckhost:4440/metrics/healthcheck shows json
{"dataSource.connection.time":{"healthy":true,"message":"Datasource connection healthy with timeout 5 seconds"},"quartz.scheduler.threadPool":{"healthy":true}}
I have generated API token of admin user for authentication in scripting purpose. All I wanted to know how to use API to curl with token to get the result ? I tried following but couldn't get the required result.
curl --location --request GET 'http://rundeckhost:4440/metrics/ping' \
--header 'Accept: application/json' \
--header 'X-Rundeck-Auth-Token: <generated token here>'
My ENV spec:
OS : Centos 8 |
Java : 8 |
Rundeck: 3.3 community edition |
Scripting Language : curl, bash
Your ping API call is wrong, with the following call it works:
curl --location --request GET 'http://rundeckhost:4440/api/35/metrics/ping' \
--header 'Accept: application/json' \
--header 'X-Rundeck-Auth-Token: <your-token-here>'
Just in case, also you can use RD CLI tool for that, with the command:
$ rd metrics ping
Result:
# [2020-07-31T09:09:37.200] Pinging server...
# [2020-07-31T09:09:37.503] pong
More insight answer to my own question :
if anyone is having issues in using URL http://rundeckhost:4440/api/35/metrics/ping then it would be wrong api version which could be different for different versions of rundeck. so you can find out the right version by accessing your own rundeck http://rundeckhostIP:4440/api/ which will show up xml with api version in it as follows:
Use that version number in the querying URL in which in my case its 35.

Isolated Azure Kubernetes Service (AKS) SSL Error

I deployed a helm chart onto an isolated server and in the self-signed certificate HTTPS post it does to the kube-api it is failing w/ this error:
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to kubernetes.default.svc:443
Anyone seen it before? This is the “POST”:
echo "Creating a secret for the certificate and keys"
STATUS=$(curl -ik \
-o ${TMP_DIR}/output \
-w "%{http_code}" \
-X POST \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"kind": "Secret",
"apiVersion": "v1",
"metadata": {
"name": "spark-webhook-certs",
"namespace": "'"$NAMESPACE"'"
},
"data": {
"ca-cert.pem": "'"$ca_cert"'",
"ca-key.pem": "'"$ca_key"'",
"server-cert.pem": "'"$server_cert"'",
"server-key.pem": "'"$server_key"'"
}
}' \
https://kubernetes.default.svc/api/v1/namespaces/${NAMESPACE}/secrets
The error is occuring due to a self signed certificate whose .sh is being invoked by a docker image command here: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/hack/gencerts.sh
I know it's not getting to the end of this because it's failing to make the secret it's trying to post. Where do y'all think I should look to start troubleshooting? I've posted additional info here including screen shots: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/issues/926
I would try to update the contents of gencerts.sh to get some more context on the error:
Add the -v or --verbose option to the curl command.
Use strace to invoke the curl command
Both of those options will send more outputs to stderr so you should be able to inspect in your log and get a better idea of the failure mode. Fair warning: strace will generate a lot of output.
Another source of information would be the kube-apiserver logs. You'll need to enable collection of master logs by adjusting the configuration of your cluster. You should expect every API request to be logged by kube-apiserver.
The first question here is whether the request is received by the control plane at all. To troubleshoot this, I would get a shell on a container inside the cluster and try to recreate the curl request that gencerts.sh is making. There is some information on accessing the cluster API without kubectl in the kubernetes docs.

.Is it possible to have create local repositories using CUrl commands in JFrog?

I have hosted JFrog-OSS docker container which is running behind Nginx along with DNS attached to it .I want to create new repositories(local ones) using REST Apis (curl commands ) .Since it's a free version .Is it possible to have create local repositories using CUrl commands in JFrog ?.
curl -s -uadmin:password -X PUT -H 'Content-Type: application/json' https://devops.com/artifactory/libs-release-local/path/to/directory/ -d '
[ {
"\key"\ : "\example-repo-local"\,
"\description"\ : "\artifactory repository"\,
"\type"\ : "\LOCAL"\,
"\url"\ : "\https://devops.com/artifactory/example-repo-local"\,
"\packageType"\ : "\Generic"\
}'
Creating repositories via REST API requires Artifactory Pro.
Also, the url and JSON configurations seems wrong.
The url that the request is sent to should not include path, but a repository only.
The "type" key should be "rclass". "url" key is only for remote.
See documentation for more details.

Use Nexus 3 API to change admin password

I would like to use the Nexus 3 api to change the admin default password as well as the email address using groovy. But I don't understand how to set the password using the groovy api. Can someone provide an example of how to do this?
Summary
You can use the REST API to both update user information and change their password. This includes the admin user.
Nexus REST API: Update user information
The default admin user-data.json in my instance is the following:
{
"userId": "admin",
"firstName": "Administrator",
"lastName": "User",
"emailAddress": "admin#example.org",
"source": "default",
"status": "active",
"readOnly": false,
"roles": [
"nx-admin"
],
"externalRoles": []
}
Update the user-data.json to your desired values and use curl with the REST API.
NX_PASSWORD="admin user password"
curl -ifu admin:"${NX_PASSWORD}" \
-XPUT -H 'Content-Type: application/json' \
--data "$(< user-data.json)" \
<nexus base URL>/service/rest/v1/security/users/admin
Nexus REST API: Change password
You'll want to use the Security Management API.
See Nexus 3 backend source code.
OLD_PASSWORD="nexus admin password"
NEW_PASSWORD="your new password"
curl -ifu admin:"${OLD_PASSWORD}" \
-XPUT -H 'Content-Type: text/plain' \
--data "${NEW_PASSWORD}" \
<nexus base URL>/service/rest/v1/security/users/admin/change-password
Screenshot of Nexus documentation
This documentation is only available on a running Nexus instance. You can view this API on your own running Nexus instance by visiting:
Menu: System configuration > System > API.
Old way: Change password during initial onboarding
This only works during initial onboarding. You should definitely not use this method. Just documenting for completeness.
This section is for changing the initial password during onboarding.
Referencing Nexus source
Frontend code
Backend code
You can change the admin user password with a single curl command.
OLD_PASSWORD="initial nexus password"
NEW_PASSWORD="somepass"
curl -ifu admin:"${OLD_PASSWORD}" \
-XPUT -H 'Content-Type: text/plain' \
--data "${NEW_PASSWORD}" \
<nexus base URL>/service/rest/internal/ui/onboarding/change-admin-password
I originally thought changePassword was deprecated, but I was mistaken. Here is an example of updating admin email address and changing the password:
def user = security.securitySystem.getUser('admin')
user.setEmailAddress('admin#mycompany.com')
security.securitySystem.updateUser(user)
security.securitySystem.changePassword('admin','admin456')
Sonatype Nexus has change-admin-password internal api to update the admin password, but its not straight forward to use, it's using the session id that's created with the /service/rapture/session endpoint.
curl -v 'https://<hostname>/service/rapture/session' --data 'username=<base64 username>&password=<base64 password>'
curl -v -X PUT 'https://<hostname>/service/rest/internal/ui/onboarding/change-admin-password' -H 'cookie: <NXSESSIONID form the above response>' --data '<plain text password>'
Reference:
https://github.com/sonatype/nexus-public/blob/9b177ab50bd7f8470b08247b146da459170ecc8f/plugins/nexus-onboarding-plugin/src/main/resources/static/rapture/NX/onboarding/step/ChangeAdminPasswordStep.js#L50
Install the nexus3 cli:
pip install nexus3-cli
Get the first initial password (Assuming Nexus is running in docker):
docker exec nexus cat /nexus-data/admin.password
Set environment variables:
export NEXUS3_PASSWORD=<PASSWORD FROM PREVIOUS STEP>
export NEXUS3_USERNAME=<USERNAME>
export NEXUS3_URL=<URL>
Allow remote script execution by updating /nexus-data/etc/nexus.properties and appending the below line:
nexus.scripts.allowCreation=true
Restart nexus service to reload the last change:
docker container restart <nexus>
Create a file reset-password.groovy with the following contents (Thanks to #Dennis Hoer) :
def user = security.securitySystem.getUser('admin')
user.setEmailAddress('admin#mycompany.com')
security.securitySystem.updateUser(user)
security.securitySystem.changePassword('admin','admin456')
From command line create the script and run the script to reset the password of admin:
nexus3 script create --script-type groovy passreset reset-password.groovy
nexus3 script run passreset
The password is now reset

How to get Authorization Token for Ceilometer API Openstack

I am new to openstack, trying to use Ceilometer python API to pull some data from a testbed server, I am accessing the server from a remote site
the problem is that I cannot figure out how get the an authorization token
I used the following command
curl -i 'http://HOST:8774/' -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d/tokens auth": {"tenantName": "project", "passwordCredentials": {"username": "user", "password": "password"}}}'
But it does not give me anything,
curl -X GET -H "X-Auth-Token:$MY_TOKEN" http://HOST:8774/tokens
also does not give me any token
From your use of port 8774 I suspect you might be using DevStack. Try this
curl -s -X POST http://$OPENSTACK_KEYSTONE_HOST:5000/v2.0/tokens -d '{"auth": {"passwordCredentials": {"username":"my-username", "password":"my-password"}, "tenantName":"my-tenantName"}}
In DevStack Keystone (the auth service you get tokens from) is running on port 5000 by default. This may or may not be true in your case. Ask your friendly OpenStack operator what host (and port) Keystone is running on and put that in place of $OPENSTACK_KEYSTONE_HOST:5000