Forbidden when trying to register-user on axon server 4.4 - axon

After succesfully installing local axon-server-se version 4.4 I am not able to register users. I am getting 403 back from axon-server (forbidden). Users command, which should list all users on axon-server, returns empty result.
Register a user:
java -jar axonserver-cli.jar register-user -S https://AXON_SERVER:8024 -t TOKEN -u admin -p test -r ADMIN
results in
Error processing command 'register-user' on 'https://AXON_SERVER:8024/v1/users': HTTP/1.1 403 - {"timestamp":1599137927417,"status":403,"error":"Forbidden","message":"Forbidden","path":"/v1/users"}

This is a known issue for Axon and it is already fixed on 4.4.1 version, which was released yesterday!
As of version 4.4.1, you have a new properties for this case: axoniq.axonserver.accesscontrol.adminToken. This property should get the token you want to use on CLI as Admin.
If you have to stick to 4.4 though, the workaround is to create the very first admin user with access control disabled and enable it afterwards.

Related

Contao > 4.3 sending emails with sendmail throw error on some providers

Older Versions of Contao (till 4.3) working like expected with sending emails via sendmail.
After upgrade to Contao 4.9 I got some errors at Providers like 1u1 / ionos or mittwald.
The error in the logs sound like:
"Expected response code 220 but got an empty response"
Sending Mails from CLI of the Server (means if logged in via SSH) working like expected:sendmail test" |
/usr/sbin/sendmail -t -v -f sender#domain.com reciepient#otherOne.com
The solution is to add this to config/config.yml
swiftmailer:
default_mailer: default
mailers:
default:
url: '%env(MAILER_URL)%'
transport: sendmail
command: '/usr/sbin/sendmail -t -i'
After that, clear the Contao-Cache (e.g. via contao-manager.phar) and give it a try.
The reason for that issue is, that by default the swiftMailer use sendmail -bs as command, which means that sendmail run as standalone Service.
Depending at the way your provider configure it's sendmail, this will be the cause of the error.
If you update symfony/swiftmailer-bundle to version 3.5.0, then the default value used for the sendmail command will be read from the PHP configuration. See https://github.com/symfony/swiftmailer-bundle/pull/302
So provided the PHP configuration of your hosting environment contains the correct command in sendmail_path, sending emails should work without any changes.

Proxy authentication using wget on cygwin

My institute recently installed a new proxy server for our network. I am trying to configure my Cygwin environment to be able to run wget and download data from a remote repository.
Browsing the internet I have found two different solutions to my problem, but no one of them seem to work in my case.
The first one I tried was to follow these instructions, so in Cygwin:
cd /cygdrive/c/cygwin64/etc/
nano wgetrc
at the end of the file, I added:
use_proxy = on
http_proxy=http://username:password#my.proxy.ip:my.port/
https_proxy=https://username:password#my.proxy.ip:my.port/
ftp_proxy=http://username:password#my.proxy.ip:my.port/
(of course, using my user and password)
The second approach was what was suggested by this SO post, so in my Cygwin environment:
export http_proxy=http://username:password#my.proxy.ip:my.port/
export https_proxy=https://username:password#my.proxy.ip:my.port/
export ftp_proxy=http://username:password#my.proxy.ip:my.port/
in both cases, if I try to test my wget, I get the following:
$ wget http://www.google.com
--2020-01-30 12:12:22-- http://www.google.com/
Resolving my.proxy.ip (my.proxy.ip)... 10.1XX.XXX.XX
Connecting to my.proxy.ip (my.proxy.ip)|10.1XX.XXX.XX|:8XXX... connected.
Proxy request sent, awaiting response... 407 Proxy Authentication Required
2020-01-30 12:12:22 ERROR 407: Proxy Authentication Required.
It looks like if my user and password are not ok, but I actually checked them on my browsers and my credentials work just fine.
Any idea on what this could be due to?
This problem was solved thanks to the suggestion of a User of the community AskUbuntu.
Basically, instead of editing the global configuration file wgetrc, I should have created a new .wgetrc with my proxy configuration in my Cygwin home directory.
In summary:
Step 1 - Create a .wgetrc file;
nano ~/.wgetrc
Step 2 - record in this file the proxy info:
use_proxy=on
http_proxy=http://my.proxy.ip:my.port
https_proxy=https://my.proxy.ip:my.port
ftp_proxy=http://my.proxy.ip:my.port
proxy_user=username
proxy_password=password

How to filter journalctl logs for Errors for ASPNET core application hosted on Linux

I have a website built using ASP.NET core 2.0.7 and it is hosted on Ubuntu 16.04. I have done like this
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.0&tabs=aspnetcore2x
I use systemd to make it start automatically, and logs are sent to journald.
I can get my logs with commands like
journalctl --no-pager -u lic6.service > lic6.log
However, if I only want to have the errors and above, I should be able to use -p, i.e.
journalctl --no-pager -u lic6.service -p 3 > lic6.log
according to https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs
However, it seems that Microsofts log format is not compatible with the -p filtering of journalctl. What should I change?
Tmds.Systemd.Logging is a systemd logger for ASP.NET Core (Microsoft.Extensions.Logging). It logs priorities and also does structured logging. You can find more info at: https://github.com/tmds/Tmds.Systemd.

Cannot install Jenkins: no valid crumb

I've just installed Jenkins on a google cloud vm and configured nginx to point at 8080. I can enter the initial admin password and then i get to the screen where i can select plugins. When i click on "install suggested plugins" an error appears:
No valid crumb was included in this request
I started Jenkins with the command:
java -Dhudson.security.csrf.requestfield=Jenkins-Crumb -jar jenkins.war
stdout says:
INFO: Session node016ikde2z4paqem02o7wos0rgd1 already being invalidated
Nov 02, 2017 7:57:44 PM hudson.security.csrf.CrumbFilter doFilter
WARNING: Found invalid crumb 27d19a27be31d1d5703128b635b60c3b. Will
check remaining parameters for a valid one...
Nov 02, 2017 7:57:44 PM hudson.security.csrf.CrumbFilter doFilter
WARNING: No valid crumb was included in request for
/pluginManager/installPlugins. Returning 403.
does anybody know how i can either disable CSRF or include a valid crumb in my request? I can generate a valid crumb by running:
$ curl -u "admin:ebdcf2fcf6f74ee8b4ec907a1486ml?xpath=concat(//crumbRequestField,":",//crumb)'
Jenkins-Crumb:ef6250c9afe294555e20f1b9ab875261
but i don't know what to do with it after that.
Many thanks!
To Disable CSRF (although this is not recommended), follow the below 3 steps:
Log in to Jenkins as an Administrator
GOTO: Jenkins > Manage Jenkins > Configure Global Security and enable Prevent
Cross Site Request Forgery exploits
Uncheck this option
Mention the version of the Jenkins you are using to suggest on how to provide a valid crumb in your request.

Debian Stretch MariaDB cannot authenticate from PHP application

I'm using a fresh installation of Debian Stretch, and installed PHP7 and MariaDB as recommended:
sudo apt-get install nginx mariadb-server mariadb-client php-mysqli php7.0-fpm php7.0-curl
Then using sudo mysql_secure_installation I followed the prompts to remove test users etc.
MariaDB seems to use unix_socket authentication (which is a new concept to me). I like how it restricts root access to sudoers and allows me to grant DB permissions to specific OS users.
However I'd prefer to assign individual user/passwords for each web application running on the server. They all run as www-data user on the system and I see no reason to let them share databases.
So I created a user for my first PHP script and granted access to a new database:
CREATE USER 'telemetry'#'localhost' IDENTIFIED BY 'yeah_toast';
UPDATE mysql.user SET plugin='mysql_native_password' WHERE user='telemetry';
GRANT ALL PRIVILEGES ON telemetry TO 'telemetry'#'localhost';
FLUSH PRIVILEGES;
But it refuses to let me connect from the application:
[error] 19336#19336: *20 FastCGI sent in stderr: "PHP message: PHP Warning: mysqli::real_connect(): (HY000/1045): Access denied for user 'telemetry'#'localhost' (using password: YES) in /path/to/database.inc.php on line 30
The credentials I'm using from the application are as follows:
Host: localhost (also tried 127.0.0.1)
Username: telemetry
Password: yeah_toast
Database: telemetry
I tried deleting and re-creating the username in case it was a password problem, and creating a user #'localhost' and #'%' but none seem to work. In fact when I log in using the same credentials from the command line without sudo it works great (mysql -utelemetry -p).
Am I missing a MariaDB configuration step here?

Resources