How To Set Up Laravel, Nginx, and MySQL with Docker Compose

How To Set Up Laravel, Nginx, and MySQL with Docker Compose
https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose
faizanbashir
By Faizan Bashir
Last Validated onMarch 9, 2020 Originally Published onNovember 8, 2018 592.5kviews
The author selected The FreeBSD Foundation to receive a donation as part of the Write for DOnations program.
Introduction
Over the past few years, Docker has become a frequently used solution for deploying applications thanks to how it simplifies running and deploying applications in ephemeral containers. When using a LEMP application stack, for example, with PHP, Nginx, MySQL and the Laravel framework, Docker can significantly streamline the setup process.
Docker Compose has further simplified the development process by allowing developers to define their infrastructure, including application services, networks, and volumes, in a single file. Docker Compose offers an efficient alternative to running multiple docker container create and docker container run commands.
In this tutorial, you will build a web application using the Laravel framework, with Nginx as the web server and MySQL as the database, all inside Docker containers. You will define the entire stack configuration in a docker-compose file, along with configuration files for PHP, MySQL, and Nginx.
Prerequisites
Before you start, you will need:

One Ubuntu 18.04 server, and a non-root user with sudo privileges. Follow the Initial Server Setup with Ubuntu 18.04 tutorial to set this up.
Docker installed, following Steps 1 and 2 of How To Install and Use Docker on Ubuntu 18.04.
Docker Compose installed, following Step 1 of How To Install Docker Compose on Ubuntu 18.04.

Step 1 — Downloading Laravel and Installing Dependencies
As a first step, we will get the latest version of Laravel and install the dependencies for the project, including Composer, the application-level package manager for PHP. We will install these dependencies with Docker to avoid having to install Composer globally.
First, check that you are in your home directory and clone the latest Laravel release to a directory called laravel-app:
cd ~
git clone https://github.com/laravel/laravel.git laravel-app

Move into the laravel-app directory:
cd  ~/laravel-app

Next, use Docker’s composer image to mount the directories that you will need for your Laravel project and avoid the overhead of installing Composer globally:
docker run --rm -v $(pwd):/app composer install

Using the -v and --rm flags with docker run creates an ephemeral container that will be bind-mounted to your current directory before being removed. This will copy the contents of your  ~/laravel-app directory to the container and also ensure that the vendor folder Composer creates inside the container is copied to your current directory.
As a final step, set permissions on the project directory so that it is owned by your non-root user:
sudo chown -R $USER:$USER  ~/laravel-app

This will be important when you write the Dockerfile for your application image in Step 4, as it will allow you to work with your application code and run processes in your container as a non-root user.
With your application code in place, you can move on to defining your services with Docker Compose.
Step 2 — Creating the Docker Compose File
Building your applications with Docker Compose simplifies the process of setting up and versioning your infrastructure. To set up our Laravel application, we will write a docker-compose file that defines our web server, database, and application services.
Open the file:
nano  ~/laravel-app/docker-compose.yml

In the docker-compose file, you will define three services: app, webserver, and db. Add the following code to the file, being sure to replace the root password for MYSQL_ROOT_PASSWORD, defined as an environment variable under the db service, with a strong password of your choice:
#  ~/laravel-app/docker-compose.yml
version: '3'
services:

  #PHP Service
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: digitalocean.com/php
    container_name: app
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    networks:
      - app-network

  #Nginx Service
  webserver:
    image: nginx:alpine
    container_name: webserver
    restart: unless-stopped
    tty: true
    ports:
      - "80:80"
      - "443:443"
    networks:
      - app-network

  #MySQL Service
  db:
    image: mysql:5.7.22
    container_name: db
    restart: unless-stopped
    tty: true
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: laravel
      MYSQL_ROOT_PASSWORD: your_mysql_root_password
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    networks:
      - app-network

#Docker Networks
networks:
  app-network:
    driver: bridge

The services defined here include:

app: This service definition contains the Laravel application and runs a custom Docker image, digitalocean.com/php, that you will define in Step 4. It also sets the working_dir in the container to /var/www.

webserver: This service definition pulls the nginx:alpine image from Docker and exposes ports 80 and 443.

db: This service definition pulls the mysql:5.7.22 image from Docker and defines a few environmental variables, including a database called laravel for your application and the root password for the database. You are free to name the database whatever you would like, and you should replace your_mysql_root_password with your own strong password. This service definition also maps port 3306 on the host to port 3306 on the container.
-Each container_name property defines a name for the container, which corresponds to the name of the service. If you don’t define this property, Docker will assign a name to each container by combining a historically famous person’s name and a random word separated by an underscore.

To facilitate communication between containers, the services are connected to a bridge network called app-network. A bridge network uses a software bridge that allows containers connected to the same bridge network to communicate with each other.

The bridge driver automatically installs rules in the host machine so that containers on different bridge networks cannot communicate directly with each other. This creates a greater level of security for applications, ensuring that only related services can communicate with one another.

It also means that you can define multiple networks and services connecting to related functions: front-end application services can use a frontend network, for example, and back-end services can use a backend network.

Let’s look at how to add volumes and bind mounts to your service definitions to persist your application data.
Step 3 — Persisting Data
Docker has powerful and convenient features for persisting data. In our application, we will make use of volumes and bind mounts for persisting the database, and application and configuration files. Volumes offer flexibility for backups and persistence beyond a container’s lifecycle, while bind mounts facilitate code changes during development, making changes to your host files or directories immediately available in your containers. Our setup will make use of both.
Warning: By using bind mounts, you make it possible to change the host filesystem through processes running in a container, including creating, modifying, or deleting important system files or directories. This is a powerful ability with security implications, and could impact non-Docker processes on the host system. Use bind mounts with care.
In the docker-compose file, define a volume called dbdata under the db service definition to persist the MySQL database:
#  ~/laravel-app/docker-compose.yml
...
#MySQL Service
db:
  ...
    volumes:
      - dbdata:/var/lib/mysql
    networks:
      - app-network
  ...

The named volume dbdata persists the contents of the /var/lib/mysql folder present inside the container. This allows you to stop and restart the db service without losing data.
At the bottom of the file, add the definition for the dbdata volume:
#  ~/laravel-app/docker-compose.yml
...
#Volumes
volumes:
  dbdata:
    driver: local

With this definition in place, you will be able to use this volume across services.
Next, add a bind mount to the db service for the MySQL configuration files you will create in Step 7:
#  ~/laravel-app/docker-compose.yml
...
#MySQL Service
db:
  ...
    volumes:
      - dbdata:/var/lib/mysql
      - ./mysql/my.cnf:/etc/mysql/my.cnf
  ...

This bind mount binds  ~/laravel-app/mysql/my.cnf to /etc/mysql/my.cnf in the container.
Next, add bind mounts to the webserver service. There will be two: one for your application code and another for the Nginx configuration definition that you will create in Step 6:
#  ~/laravel-app/docker-compose.yml
#Nginx Service
webserver:
  ...
  volumes:
      - ./:/var/www
      - ./nginx/conf.d/:/etc/nginx/conf.d/
  networks:
      - app-network

The first bind mount binds the application code in the  ~/laravel-app directory to the /var/www directory inside the container. The configuration file that you will add to  ~/laravel-app/nginx/conf.d/ will also be mounted to /etc/nginx/conf.d/ in the container, allowing you to add or modify the configuration directory’s contents as needed.
Finally, add the following bind mounts to the app service for the application code and configuration files:
#  ~/laravel-app/docker-compose.yml
#PHP Service
app:
  ...
  volumes:
       - ./:/var/www
       - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
  networks:
      - app-network

The app service is bind-mounting the  ~/laravel-app folder, which contains the application code, to the /var/www folder in the container. This will speed up the development process, since any changes made to your local application directory will be instantly reflected inside the container. You are also binding your PHP configuration file,  ~/laravel-app/php/local.ini, to /usr/local/etc/php/conf.d/local.ini inside the container. You will create the local PHP configuration file in Step 5.
Your docker-compose file will now look like this:
# ~/laravel-app/docker-compose.yml
version: '3'
services:

  #PHP Service
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: digitalocean.com/php
    container_name: app
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./:/var/www
      - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - app-network

  #Nginx Service
  webserver:
    image: nginx:alpine
    container_name: webserver
    restart: unless-stopped
    tty: true
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./:/var/www
      - ./nginx/conf.d/:/etc/nginx/conf.d/
    networks:
      - app-network

  #MySQL Service
  db:
    image: mysql:5.7.22
    container_name: db
    restart: unless-stopped
    tty: true
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: laravel
      MYSQL_ROOT_PASSWORD: your_mysql_root_password
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    volumes:
      - dbdata:/var/lib/mysql/
      - ./mysql/my.cnf:/etc/mysql/my.cnf
    networks:
      - app-network

#Docker Networks
networks:
  app-network:
    driver: bridge
#Volumes
volumes:
  dbdata:
    driver: local

Save the file and exit your editor when you are finished making changes.
With your docker-compose file written, you can now build the custom image for your application.
Step 4 — Creating the Dockerfile
Docker allows you to specify the environment inside of individual containers with a Dockerfile. A Dockerfile enables you to create custom images that you can use to install the software required by your application and configure settings based on your requirements. You can push the custom images you create to Docker Hub or any private registry.
Our Dockerfile will be located in our  ~/laravel-app directory. Create the file:
nano  ~/laravel-app/Dockerfile

This Dockerfile will set the base image and specify the necessary commands and instructions to build the Laravel application image. Add the following code to the file:
# ~/laravel-app/php/Dockerfile
FROM php:7.2-fpm

# Copy composer.lock and composer.json
COPY composer.lock composer.json /var/www/

# Set working directory
WORKDIR /var/www

# Install dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    libpng-dev \
    libjpeg62-turbo-dev \
    libfreetype6-dev \
    locales \
    zip \
    jpegoptim optipng pngquant gifsicle \
    vim \
    unzip \
    git \
    curl

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install extensions
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install gd

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www

# Copy existing application directory contents
COPY . /var/www

# Copy existing application directory permissions
COPY --chown=www:www . /var/www

# Change current user to www
USER www

# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]

First, the Dockerfile creates an image on top of the php:7.2-fpm Docker image. This is a Debian-based image that has the PHP FastCGI implementation PHP-FPM installed. The file also installs the prerequisite packages for Laravel: mcrypt, pdo_mysql, mbstring, and imagick with composer.
The RUN directive specifies the commands to update, install, and configure settings inside the container, including creating a dedicated user and group called www. The WORKDIR instruction specifies the /var/www directory as the working directory for the application.
Creating a dedicated user and group with restricted permissions mitigates the inherent vulnerability when running Docker containers, which run by default as root. Instead of running this container as root, we’ve created the www user, who has read/write access to the /var/www folder thanks to the COPY instruction that we are using with the --chown flag to copy the application folder’s permissions.
Finally, the EXPOSE command exposes a port in the container, 9000, for the php-fpm server. CMD specifies the command that should run once the container is created. Here, CMD specifies "php-fpm", which will start the server.
Save the file and exit your editor when you are finished making changes.
You can now move on to defining your PHP configuration.
Step 5 — Configuring PHP
Now that you have defined your infrastructure in the docker-compose file, you can configure the PHP service to act as a PHP processor for incoming requests from Nginx.
To configure PHP, you will create the local.ini file inside the php folder. This is the file that you bind-mounted to /usr/local/etc/php/conf.d/local.ini inside the container in Step 2. Creating this file will allow you to override the default php.ini file that PHP reads when it starts.
Create the php directory:
mkdir  ~/laravel-app/php

Next, open the local.ini file:
nano  ~/laravel-app/php/local.ini

To demonstrate how to configure PHP, we’ll add the following code to set size limitations for uploaded files:
# ~/laravel-app/php/local.ini
upload_max_filesize=40M
post_max_size=40M

The upload_max_filesize and post_max_size directives set the maximum allowed size for uploaded files, and demonstrate how you can set php.ini configurations from your local.ini file. You can put any PHP-specific configuration that you want to override in the local.ini file.
Save the file and exit your editor.
With your PHP local.ini file in place, you can move on to configuring Nginx.
Step 6 — Configuring Nginx
With the PHP service configured, you can modify the Nginx service to use PHP-FPM as the FastCGI server to serve dynamic content. The FastCGI server is based on a binary protocol for interfacing interactive programs with a web server. For more information, please refer to this article on Understanding and Implementing FastCGI Proxying in Nginx.
To configure Nginx, you will create an app.conf file with the service configuration in the  ~/laravel-app/nginx/conf.d/ folder.
First, create the nginx/conf.d/ directory:
mkdir -p  ~/laravel-app/nginx/conf.d

Next, create the app.conf configuration file:
nano  ~/laravel-app/nginx/conf.d/app.conf

Add the following code to the file to specify your Nginx configuration:
# ~/laravel-app/nginx/conf.d/app.conf
server {
    listen 80;
    index index.php index.html;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/public;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass app:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
    location / {
        try_files $uri $uri/ /index.php?$query_string;
        gzip_static on;
    }
}

The server block defines the configuration for the Nginx web server with the following directives:

listen: This directive defines the port on which the server will listen to incoming requests.
error_log and access_log: These directives define the files for writing logs.
root: This directive sets the root folder path, forming the complete path to any requested file on the local file system.
In the php location block, the fastcgi_pass directive specifies that the app service is listening on a TCP socket on port 9000. This makes the PHP-FPM server listen over the network rather than on a Unix socket. Though a Unix socket has a slight advantage in speed over a TCP socket, it does not have a network protocol and thus skips the network stack. For cases where hosts are located on one machine, a Unix socket may make sense, but in cases where you have services running on different hosts, a TCP socket offers the advantage of allowing you to connect to distributed services.
Because our app container is running on a different host from our webserver container, a TCP socket makes the most sense for our configuration.

Save the file and exit your editor when you are finished making changes.
Thanks to the bind mount you created in Step 2, any changes you make inside the nginx/conf.d/ folder will be directly reflected inside the webserver container.
Next, let’s look at our MySQL settings.
Step 7 — Configuring MySQL
With PHP and Nginx configured, you can enable MySQL to act as the database for your application.
To configure MySQL, you will create the my.cnf file in the mysql folder. This is the file that you bind-mounted to /etc/mysql/my.cnf inside the container in Step 2. This bind mount allows you to override the my.cnf settings as and when required.
To demonstrate how this works, we’ll add settings to the my.cnf file that enable the general query log and specify the log file.
First, create the mysql directory:
mkdir  ~/laravel-app/mysql

Next, make the my.cnf file:
nano  ~/laravel-app/mysql/my.cnf

In the file, add the following code to enable the query log and set the log file location:
# ~/laravel-app/mysql/my.cnf
[mysqld]
general_log = 1
general_log_file = /var/lib/mysql/general.log

This my.cnf file enables logs, defining the general_log setting as 1 to allow general logs. The general_log_file setting specifies where the logs will be stored.
Save the file and exit your editor.
Our next step will be to start the containers.
Step 8 — Modifying Environment Settings and Running the Containers
Now that you have defined all of your services in your docker-compose file and created the configuration files for these services, you can start the containers. As a final step, though, we will make a copy of the .env.example file that Laravel includes by default and name the copy .env, which is the file Laravel expects to define its environment:
cp .env.example .env

You can now modify the .env file on the app container to include specific details about your setup.
Open the file using nano or your text editor of choice:
nano .env

Find the block that specifies DB_CONNECTION and update it to reflect the specifics of your setup. You will modify the following fields:
DB_HOST will be your db database container.
DB_DATABASE will be the laravel database.
DB_USERNAME will be the username you will use for your database. In this case, we will use laraveluser.
DB_PASSWORD will be the secure password you would like to use for this user account.
/var/www/.env
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laraveluser
DB_PASSWORD=your_laravel_db_password

Save your changes and exit your editor.
With all of your services defined in your docker-compose file, you just need to issue a single command to start all of the containers, create the volumes, and set up and connect the networks:
docker-compose up -d

When you run docker-compose up for the first time, it will download all of the necessary Docker images, which might take a while.  The -d flag daemonizes the process, running your containers in the background.
Once the process is complete, use the following command to list all of the running containers:
docker ps

You will see the following output with details about your app, webserver, and db containers:
Output
CONTAINER ID        NAMES               IMAGE                             STATUS              PORTS
c31b7b3251e0        db                  mysql:5.7.22                      Up 2 seconds        <IP_ADDRESS>:3306->3306/tcp
ed5a69704580        app                 digitalocean.com/php              Up 2 seconds        9000/tcp
5ce4ee31d7c0        webserver           nginx:alpine                      Up 2 seconds        <IP_ADDRESS>:80->80/tcp, <IP_ADDRESS>:443->443/tcp

The CONTAINER ID in this output is a unique identifier for each container, while NAMES lists the service name associated with each. You can use both of these identifiers to access the containers. IMAGE defines the image name for each container, while STATUS provides information about the container’s state: whether it’s running, restarting, or stopped.
We’ll now use docker-compose exec to set the application key for the Laravel application. The docker-compose exec command allows you to run specific commands in containers.
The following command will generate a key and copy it to your .env file, ensuring that your user sessions and encrypted data remain secure:
docker-compose exec app php artisan key:generate

You now have the environment settings required to run your application. To cache these settings into a file, which will boost your application’s load speed, run:
docker-compose exec app php artisan config:cache

Your configuration settings will be loaded into /var/www/bootstrap/cache/config.php on the container.
As a final step, visit http://your_server_ip in the browser. You will see the following home page for your Laravel application:
Laravel Home Page
With your containers running and your configuration information in place, you can move on to configuring your user information for the laravel database on the db container.
Step 9 — Creating a User for MySQL
The default MySQL installation only creates the root administrative account, which has unlimited privileges on the database server. In general, it’s better to avoid using the root administrative account when interacting with the database. Instead, let’s create a dedicated database user for our application’s Laravel database.
To create a new user, execute an interactive bash shell on the db container with docker-compose exec:
docker-compose exec db bash

Inside the container, log into the MySQL root administrative account:
mysql -u root -p

You will be prompted for the password you set for the MySQL root account during installation in your docker-compose file.
Start by checking for the database called laravel, which you defined in your docker-compose file. Run the show databases command to check for existing databases:
show databases;

You will see the laravel database listed in the output:
Output
+--------------------+
| Database           |
+--------------------+
| information_schema |
| laravel            |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

Next, create the user account that will be allowed to access this database. Our username will be laraveluser, though you can replace this with another name if you’d prefer. Just be sure that your username and password here match the details you set in your .env file in the previous step:
GRANT ALL ON laravel.* TO 'laraveluser'@'%' IDENTIFIED BY 'your_laravel_db_password';
Flush the privileges to notify the MySQL server of the changes:
FLUSH PRIVILEGES;
Exit MySQL:

EXIT;

Finally, exit the container:
exit

You have configured the user account for your Laravel application database and are ready to migrate your data and work with the Tinker console.
Step 10 — Migrating Data and Working with the Tinker Console
With your application running, you can migrate your data and experiment with the tinker command, which will initiate a PsySH console with Laravel preloaded. PsySH is a runtime developer console and interactive debugger for PHP, and Tinker is a REPL specifically for Laravel. Using the tinker command will allow you to interact with your Laravel application from the command line in an interactive shell.
First, test the connection to MySQL by running the Laravel artisan migrate command, which creates a migrations table in the database from inside the container:
docker-compose exec app php artisan migrate
This command will migrate the default Laravel tables. The output confirming the migration will look like this:
Output

Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table

Once the migration is complete, you can run a query to check if you are properly connected to the database using the tinker command:
docker-compose exec app php artisan tinker

Test the MySQL connection by getting the data you just migrated:
\DB::table('migrations')->get();

You will see output that looks like this:
Output
=> Illuminate\Support\Collection {#2856
     all: [
       {#2862
         +"id": 1,
         +"migration": "2014_10_12_000000_create_users_table",
         +"batch": 1,
       },
       {#2865
         +"id": 2,
         +"migration": "2014_10_12_100000_create_password_resets_table",
         +"batch": 1,
       },
     ],
   }

You can use tinker to interact with your databases and to experiment with services and models.
With your Laravel application in place, you are ready for further development and experimentation.
Conclusion
You now have a LEMP stack application running on your server, which you’ve tested by accessing the Laravel welcome page and creating MySQL database migrations.
Key to the simplicity of this installation is Docker Compose, which allows you to create a group of Docker containers, defined in a single file, with a single command. If you would like to learn more about how to do CI with Docker Compose, take a look at How To Configure a Continuous Integration Testing Environment with Docker and Docker Compose on Ubuntu 16.04. If you want to streamline your Laravel application deployment process then How to Automatically Deploy Laravel Applications with Deployer on Ubuntu 16.04 will be a relevant resource.

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/laravel-app# docker-compose up -d
Starting webserver ...
app is up-to-date
db is up-to-date
Starting webserver ... error

ERROR: for webserver  Cannot start service webserver: driver failed programming external connectivity on endpoint webserver (0d698daf1656f6f339b12f6ddb0e8e318e9ed7671d89c6a1101e8bf914ef676a): Error starting userland proxy: listen tcp4 <IP_ADDRESS>:80: bind: address already in use

ERROR: for webserver  Cannot start service webserver: driver failed programming external connectivity on endpoint webserver (0d698daf1656f6f339b12f6ddb0e8e318e9ed7671d89c6a1101e8bf914ef676a): Error starting userland proxy: listen tcp4 <IP_ADDRESS>:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.
root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/laravel-app# netstat -tulpn | grep --color :80
tcp        0      0 <IP_ADDRESS>:80              <IP_ADDRESS>:*               LISTEN      106973/nginx: maste
tcp6       0      0 :::80                   :::*                    LISTEN      106973/nginx: maste
root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/laravel-app# fuser -k 80/tcp
80/tcp:<PHONE_NUMBER>74 106975
root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/laravel-app# netstat -tulpn | grep --color :80
root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/laravel-app# docker-compose up -d
app is up-to-date
db is up-to-date
Starting webserver ... done


How to transmit binary data?

Sometime you have to transmit binary data, like an image.
JSON (our main encoding scheme) does not support binary data.
What do we recommend?
Several options, which are all compatible with current LECO definitions:

You can send the binary data in the first (and more) payload frame, while setting the message_type to some specific (TBD) value
You can send a JSON message in the first payload frame and add the binary objects in additional payload frames.
This requires, however, that the code looks at the whole message and makes the additional frames available to the json-rpc interpreter somehow.
Here it might be good to define its own message type as well.
(I implemented this for PyMoDAQ)
You can encode the binary data with some binary-to-text encoding to plain ASCII text, which can be sent via JSON.
The most common encoding seems to be base64.

All three approaches have their advantages and disadvantages.
I guess the choice depends on the circumstances.
Here I want to present them, maybe we can recommend one or the other, or even all three as

More elaborate discussion of the different methods.
1. Binary data as the only payload
Implementation
The payload of the LECO message is the binary data, without any (pre-defined) other information.
Pro
From the LECO side quite simple: put the binary data in one or several payload frames (several for several binary objects).
Cons

It requires an additional (or even several different) message types, to indicate how to interpret the data. Maybe even user defined message types.
Methods cannot be described via Open-RPC descriptions of JSON-RPC methods.
It works only as a response to a request, as the requester knows, what he requested and can attribute the response to the original request via the conversation id
Difficult to use the binary data as a parameter of a RPC call, as it does not contain the information which method to call.
From the experience and point of view of PyLECO: it requires additional logic, as the default implementation uses JSON-RPC natively.

2. JSON message and additional payload
Implementation

The first payload frame contains normal JSON-request/response. The binary data is in additional payload frames, which are unused for JSON-RPC.
A method is defined without the binary data as parameter and/or return value as it does not receive the binary data via JSON-RPC nor does it return it via JSON-RPC. Instead, the method has to access the binary data somewhere else and indicate the binary return value somewhere else, as well.

example mehod (based on PyLECO):
current_message: Message  # contains the LECO message
additional_response: bytes  # will later contain the additional, binary, response

def method_with_binary(json_parameter):
    binary_data = current_message.payload[1]
    result = do_something(json_parameter, binary_data)
    additional_response = result
    return None

# afterwards the additional_response has to be added to the response message before sending

Pros

Content of first payload frame is defined.
JSON message can be interpreted by present JSON-RPC infrastructure
You can give normal JSON-RPC compliant parameters to a method additionally to the binary data

Cons

Methods cannot be described completely by Open-RPC description of JSON-RPC methods as the binary data parameter/return values are not mentioned (only in the docstring)
More obscure methods, as the binary data does not enter the signature nor return value.

Open questions

How does a method know, whether it should look for binary data in additional frames?

With a special message type?
Because it always does?
Because a parameter has a certain value and there are additional frames?

How does the recipient of the response know, that the JSON response is not the real response?

With a special message type?
Because the response has a certain value (which one? None?) and there are additional frames?
Because it knows, that it requested binary data? but the JSON-RPC-decoding method (in PyLECO) does not know it

3. Encode binary data to string and send it via JSON
Implementation
Encode your binary data to a string and use that as a parameter for JSON-RPC.
Pros

Uses plain JSON-RPC (and Open-RPC definitions)
No additional logic in the LECO elements needed, just encoding/decoding in the sender/receiver.
Readily available algorithms and their libraries (e.g. base64) for encoding.

Cons

Method definitions contain "string" instead of the binary data type as parameter name
Encoding binary data to a (ASCII) string increases data size (by a third for base64) and takes computation time.
That is especially noteworthy, as binary data tends to be comparatively large (oscilloscope trace, camera image...).

Comments

Using only the binary data (option 1) is the most simple in principle, but requires the most additional effort (manual message handling)

Using additional payload frames (option 2) adds some complexity, albeit limited, but offers binary data natively.

Encoding binary data as a string (option 3) is the most simple one to implement without changing the message handling system. This is implemented in PyMoDAQ.

For simple setups with small binary data, I recommend option 3 due to the reduced complexity (just encoding/decoding added).

For optimized data transfer, I recommend option 2.


Add link to RSS feed in blog header

Closes #21

Hmm, I think I'd prefer to see it as a white icon to the right of the "Engineering" title or at the bottom of the page without an icon just saying RSS Feed beneath the linode.com and Developers links.

I like the white icon idea a lot (I'm partial to an icon for RSS vs. text for no particular reason) -- how's this look?

I should probably link to the feed, huh?

Nice. Could you try making the padding on the left of the icon the same as the left padding on the Engineer title?

I sort of feel like it looks a little nicer nestled against the "Engineering" text but I do not feel strongly about it at all

Cool, thanks!


Logo for IDIA Alliance

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

[x] Filename in the lowercase format
[x] Image format: png
[x] Image size: 256 by 256 px

Added here https://github.com/TrustWallet/tokens/commit/957835ab0a370b0873e8b42af6267e9487df16a9


checked on jquery and bootstrap.js dependency

when I tried to comment out the jquery link, got error from bootstrap.js
when I tried to comment out the bootstrap.js link, the collapsed nav menu for mobile dimensions would not display

just for my research records


Notifiers may raise unexpected "KeyError"

Hello.
Looking at this code sample for example, I would expect some NotifierException rather than a KeyError:
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import notifiers
>>> zulip = notifiers.providers.zulip.Zulip()
>>> zulip.notify(message="msg"<EMAIL_ADDRESS>api_key="abc", subject="test"<EMAIL_ADDRESS>domain="")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\delgan\AppData\Local\Programs\Python\Python36\lib\site-packages\notifiers\core.py", line 272, in notify
    data = self._process_data(**kwargs)
  File "C:\Users\delgan\AppData\Local\Programs\Python\Python36\lib\site-packages\notifiers\core.py", line 204, in _proces
s_data
    data = self._prepare_data(data)
  File "C:\Users\delgan\AppData\Local\Programs\Python\Python36\lib\site-packages\notifiers\providers\zulip.py", line 75,
in _prepare_data
    base_url = self.base_url.format(domain=data.pop('domain')) if data.get('domain') else data.pop('server')
KeyError: 'server'

The issue with using if data.get(key) is that it not only evaluates as False when the key is missing, but also when there is a "falsy" value.
I saw this recipe multiple time in the source code. Maybe if key in data should be used instead?
This is a minor detail (I am not even sure it deserves a fix?), but I'm reporting this in case it causes subtle bugs for providers accepting falsy values like 0.

Thank you for reporting this!
You are right that the current way of checking is inadequate but I belive the optimal solution is to add a capability that's in my backlog for a while now, enforce formats via the schema.
Since I currently heavily depend on the json schema for data validation, it makes sense to enforce format verifications on certain (if not most) fields, so sending an empty string for the "domain" value like your example, would be blocked on an earlier phase.
I'm currently pretty busy in my personal life but I'll make this addition the next priority as I was not aware the lack of it allows for issues such as this.

Glad to hear that, thanks! 👍
It's only an edge case, so there is nothing pressing.


feat: support gateway/tcproute round 1

Type of change:

[ ] Bugfix
[x] New feature provided
[ ] Improve performance
[ ] Backport patches

What this PR does / why we need it:

#644

Pre-submission checklist:

[ ] Did you explain what problem does this PR solve? Or what new features have been added?
[x] Have you added corresponding test cases?
[ ] Have you modified the corresponding document?
[ ] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

please resolve conflics. thanks!

please resolve conflics again. thanks

Codecov Report

Merging #1217 (129387c) into master (2fa8a9c) will increase coverage by 0.07%.
The diff coverage is 81.81%.

@@            Coverage Diff             @@
##           master    #1217      +/-   ##
==========================================
+ Coverage   42.78%   42.85%   +0.07%
==========================================
  Files          73       74       +1
  Lines        6477     6508      +31
==========================================
+ Hits         2771     2789      +18
- Misses       3409     3420      +11
- Partials      297      299       +2

Impacted Files
Coverage Δ

pkg/providers/gateway/translation/translator.go
0.00% <ø> (ø)

.../providers/gateway/translation/gateway_tcproute.go
81.81% <81.81%> (ø)

pkg/providers/apisix/translation/apisix_route.go
19.14% <0.00%> (-0.22%)
:arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

Can you write about your plans for TCPRoute support in the description of this PR? I see that the Add event is mostly handled in this PR, but the Update and Delete events etc. are not handled.
I added the round 1 flag to the title

Preliminary support update and delete has been given.

@AlinsRan could you please merge latest code?


Add Typescript typings

Copied from https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-google-analytics/index.d.ts

Adding this file to my node_modules/gatsby-plugin-gtag stops typescript complaining when I import gatsby-plugin-gtag. The error
error TS7016: Could not find a declaration file for module 'gatsby-plugin-gtag'. '/Users/benscott/src/github.com/Shopify/polaris-icons/node_modules/gatsby-plugin-gtag/index.js' implicitly has an 'any' type.
  Try `npm install @types/gatsby-plugin-gtag` if it exists or add a new declaration (.d.ts) file containing `declare module 'gatsby-plugin-gtag';`

14 import {OutboundLink} from 'gatsby-plugin-gtag';

is now removed.

Published as v1.0.9 thanks!


Registry App crashes

Microsoft PowerToys version
69
Installation method
PowerToys auto-update
Running as admin
Yes
Area(s) with issue?
Registry Preview
Steps to reproduce
Clicked on the new registry app.
Waited.
Clicked on open file...
it immediately closed the window and could not open it again.
✔ Expected Behavior
It to open.
❌ Actual Behavior
When I opened the registry editor app, it immediately crashed and could not reopen it or select it.
Other Software
No response

/dup #25250


Add types

Add types for this package. Simple type definition already exists: https://www.npmjs.com/package/@types/uuid. Incorporating it into this repo would be really helpful.

This has been discussed in the past but as long as this library is written in JavaScript we're going to continue to publish the types as a separate package, see https://github.com/uuidjs/uuid/issues/368#issuecomment-587330334
In fact the maintainers of uuid are maintaining @types/uuid as well!

Most other popular npm packages include types in the same package and saves typescript users from having to import 2 packages. Also makes maintenance easier.
My vote would be including types in the same package, but it's y'all decision.

Feel free to raise this issue over at TypeScript. If TypeScript decides to change their recommendations, I'll be happy to follow whatever the official recommendations are.


dev.boringcrypto: 1.17 release

1.17.0 and 1.17.1 have been released. What is the ETA for the release with BoringCrypto?
Thanks again for maintaining this great branch!
@katiehockman @FiloSottile

Jeremy Faller has provided an update on a (tangentially) related thread on golang-dev:

We had a small snafu with boringcrypto, as we're transferring responsibilities for it's maintenance around internally. This branch will be updated with the next point release for Golang. Following our published process, unless a security release causes rescheduling, that next point release will happen this week, and boringcrypto will be updated soon after now that we've sorted out responsibilities.

I'm closing here since I don't think we need an issue to track the boringcrypto work (it's internal to Google I believe, and traditionally there never was a github issue).


npm install failing node sass terminate called after throwing an instance of 'std::runtime_error'

I get this error when i do npm install --save node-sass
><EMAIL_ADDRESS>install /home/ubuntu/www/project_name/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/ubuntu/.npm/node-sass/4.5.0/linux-x64-48_binding.node

><EMAIL_ADDRESS>postinstall /home/ubuntu/www/project_name/node_modules/node-sass
> node scripts/build.js

Binary found at /home/ubuntu/www/project_name/node_modules/node-sass/vendor/linux-x64-48/binding.node
Testing binary
terminate called after throwing an instance of 'std::runtime_error'
  what():  random_device::__x86_rdrand(void)
Aborted (core dumped)

using nvm for version control

NPM version (npm -v): 4.3.0
Node version (node -v): 6.9.4
npm node-sass versions (npm ls node-sass): empty

Please provide all the requested output from the issue template. It's
important we know which is and version you're on, and any other
non-standard node environment info I.e. are you in an electron shell.
For now you can try npm cache clear before npm install.
On 7 Mar. 2017 6:42 pm, "Vikram Patil"<EMAIL_ADDRESS>wrote:

I get this error when i do npm install --save node-sass

<EMAIL_ADDRESS>install /home/ubuntu/www/project_name/node_modules/node-sass
node scripts/install.js

Cached binary found at /home/ubuntu/.npm/node-sass/4.5.0/linux-x64-48_binding.node

<EMAIL_ADDRESS>postinstall /home/ubuntu/www/project_name/node_modules/node-sass
node scripts/build.js

Binary found at /home/ubuntu/www/project_name/node_modules/node-sass/vendor/linux-x64-48/binding.node
Testing binary
terminate called after throwing an instance of 'std::runtime_error'
what():  random_device::__x86_rdrand(void)
Aborted (core dumped)
using nvm for version control

NPM version (npm -v): 4.3.0
Node version (node -v): 6.9.4
npm node-sass versions (npm ls node-sass): empty

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/sass/node-sass/issues/1919, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAjZWNkvLE0H9rTADH0VdGBR3RQYNWGiks5rjQqCgaJpZM4MVJIx
.


JavaKerberos authentication on Spark framework

Driver version
7.0.0 also 7.1.1 preview
SQL Server version
SQL 2016 also 2014 and 2012
Client Operating System
Ubuntu 18.04.1 on each node of a Spark cluster
JAVA/JVM version
Java 1.8
Table schema
N/A
Problem description
I am trying to get a Spark cluster to write to SQL server using JavaKerberos (i.e., I specify integratedSecurity=true;authenticationScheme=JavaKerberos in the connection string) with credentials specified in a keyTab file. I am not having much success (the problem is the same if I specify credentials in the connections string).
I am submitting the job to spark (a YARN mode, 4-node, in-house spark version 2.3.0 cluster) with:
spark-submit --driver-class-path mssql-jdbc-7.0.0.jre8.jar \
--jars /path/to/mssql-jdbc-7.0.0.jre8.jar \
--conf spark.executor.extraClassPath=/path/to/mssql-jdbc-7.0.0.jre8.jar \
--conf "spark.driver.extraJavaOptions=-Djava.security.auth.login.config=/path/to/SQLJDBCDriver.conf" \
--conf "spark.executor.extraJavaOptions=-Djava.security.auth.login.config=/path/to/SQLJDBCDriver.conf" \
application.jar

where application.jar is a plain scala spark application. A colleague has replicated the same problem in python with PySpark however.
The application ‘half’ works in that the spark driver program will authenticate correctly and create a table, however any of the executors fail to write any data to the table with an exception:
java.security.PrivilegedActionException: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
Things I found:

I can get everything to work if I specify SQL server credentials (however I need to use integrated security in my application)
The keytab and login module file “SQLJDBCDriver.conf” seem to be specified correctly since they work for the driver
I can see the executors pick up the correct command line options in the spark UI :
-Djava.security.auth.login.config=/path/to/SQLJDBCDriver.conf
Using some of the logging options it looks like the executors read the SQLJDBCDriver.conf file but then ignore it.

After a lot of debugging I notice the different behaviour between driver and executors comes from the following lines in KerbAuthentication.java
https://github.com/Microsoft/mssql-jdbc/blob/709342fbedb2e35f25c02c7f3104658319ff5472/src/main/java/com/microsoft/sqlserver/jdbc/KerbAuthentication.java#L83-L90
I noticed:

It works for the driver because it receives null for currentSubject and then creates a new LoginContext using the credentials from the keytab
On the other hand, for some reason, the executors at this point receive a currentSubject populated with the local user credentials of the spark cluster and not those specified in the keytab (or in the connection string if I use that method)

I don't really understand why this is happening – it seems as if the executors are picking up some context object before they know they need to create one with different credentials. I can’t seem to get it to use the keytab credentials after trying many, many variations.
As an experiment I recompiled the driver,  nulling out currentSubject on line 84. This then works – a new LoginContext is created but this time with credentials as specified in the keytab and all data is written to the table correctly.
Can anyone help me understand how I can force the executors to use credentials provided in the keytab (or connection string) or otherwise get JavaKerberos to work with Spark?

Hi @peterbae, many thanks for looking into this. Likewise, I am not sure it is necessarily a jdbc driver problem and not something spark is doing. Or even that it's something more difficult like perhaps it's the way spark executors have to start that the jdbc driver doesn't like.
The jdbc driver behaviour is still a bit puzzling however. With the java command line options I have selected I have to have a SQLJDBCDriver.conf file available or it fails with file not found. The file has to be correctly formatted or it fails with 'no login modules available for SQLJDBCDriver.conf'. With debug logging options switched on I can even see that this file is being read and the wanted options are parsed. However it then completely disregards what it's read and tries to use default properties and the local user credentials.
In fact the  (GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)) does make some kind of sense given that it is trying to use the wrong credentials. I can get this message if I deliberately use wrong credentials and use the default driver behaviour i.e., useTicketCache=true useKeyTab=false .
I am pretty confident our Kerberos setup is not misconfigured - I can test TGT generation and so forth with kinit, klist etc. And as I said with my nasty hack it does work and I can observe the correct logins on the SQL server.
I guess if you have any idea on where the context it gets from AccessControlContext context = AccessController.getContext(); on line 83 and the embedded subject it gets from line 84 is originally being set it would be helpful.
I do plan to take this up somewhere in the spark ecosystem as well to see if I can gain more insight - just haven't got there yet. This is eating up a vast amount of time, but is a blocking issue for this application so will soldier on...
I will try and build a standalone java application as you suggest to see if I can get some more understanding of the issue. I fear it will work in the same way the spark driver program works, rather than the problematic executors (sorry about the confusing terminology there: we have a spark driver and jdbc driver).
Anyway - thanks again

Well - apologies for the false alarm. It seems spark executors cannot do Kerberos auth according to an old JIRA (https://issues.apache.org/jira/browse/SPARK-12312) which is still true of latest spark v2.3.2 according to the spark user list and some more testing I did.
Seems like a pretty serious limitation to me, not sure why it's never been addressed. Anyway, I've worked around it for now by creating a wrapper for the jdbc driver which manages the keytab auth and passes back the connection to spark based on the idea here: https://datamountaineer.com/2016/01/15/spark-jdbc-sql-server-kerberos/


Added CMake support

Added CMakeLists.txt.
Added clause to differentiate debug builds (build defaults to Release)
Added CMake package finding support.
Modified version.h to receive version information fro CMake. From now on, simply modify the project command in CMakeLists.txt to change the version number, and then run CMake once. The newly generated version header will overwrite the old one.

Ah woops, I was copy-pasting the pull request (mostly the same 🤣 ) I will amend the PR comment.


[CI/CD] Add tests for azure.ymal schema

We need to run a gh-action to check that the schema is valid.
Right now, if there is a typo or the json is not valid, we don't know until someone tries to use the schema from VSCode.

I would like to work on fixing this!


Implement Clock exercise for Crystal

@ErikSchierboom - I'm trying to use configlet to get things set properly.
I keep getting an error when trying to sync:
bin/configlet sync -e clock
Cloning https://github.com/exercism/problem-specifications/... failure
Cloning into '/Users/mark/Library/Caches/exercism/configlet/problem-specifications'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I am able to clone the problem-specifications repo the old fashioned way:
git clone https://github.com/exercism/problem-specifications.git
Cloning into 'problem-specifications'...
remote: Enumerating objects: 12172, done.
remote: Counting objects: 100% (1227/1227), done.
remote: Compressing objects: 100% (376/376), done.
remote: Total 12172 (delta 989), reused 925 (delta 849), pack-reused 10945
Receiving objects: 100% (12172/12172), 2.68 MiB | 8.90 MiB/s, done.
Resolving deltas: 100% (7367/7367), done.

The PR looks good. Let's figure out the configlet issue and then we can merge.

Approving, although you should incorporate the changes @ee7 is suggesting.
I'm ok if this happens outside this PR, maybe throw it in an issue if you need to troubleshoot configlet sync.

I think the issue with configlet and cloning is the trailing slash. I tried cloning with and without it, and the trailing slash makes it fail:
➜  code git clone https://github.com/exercism/problem-specifications
Cloning into 'problem-specifications'...
remote: Enumerating objects: 12177, done.
remote: Counting objects: 100% (1125/1125), done.
remote: Compressing objects: 100% (354/354), done.
remote: Total 12177 (delta 911), reused 843 (delta 769), pack-reused 11052
Receiving objects: 100% (12177/12177), 2.69 MiB | 3.23 MiB/s, done.
Resolving deltas: 100% (7363/7363), done.
➜  code rm -rf problem-specifications
➜  code git clone https://github.com/exercism/problem-specifications/
Cloning into 'problem-specifications'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


CURLRequest: get redirect URL

Hi,
So I know this should be in the forum, but I've already coded it. I was just wondering if it could be worthy of a PR.
Using CURLRequest I found myself wanting access to the redirect URL after a 301 code but found no option for it. So I made one.
Now this isn't ideal since it messes directly with the $curlOptions that are then used in curl_setopt_array(). Maybe there is a cleaner way by injecting some sort of $curlInfoOptions before curl_close($ch);
Running on CI 4.1.4 PHP-FPM 7.4.3
diff --git a/www/system/HTTP/CURLRequest.php b/www/system/HTTP/CURLRequest.php
index 3be8214..c3e7d26 100755
--- a/www/system/HTTP/CURLRequest.php
+++ b/www/system/HTTP/CURLRequest.php
@@ -37,6 +37,13 @@ class CURLRequest extends Request
      */
     protected $baseURI;

+    /**
+     * The URL the server wants to redirect to
+     *
+     * @var string (URL)
+     */
+    private $redirect_url = '';
+
     /**
      * The setting values
      *
@@ -62,6 +69,7 @@ class CURLRequest extends Request
             'http',
             'https',
         ],
+        'get_redirect_url' => false,
     ];

     /**
@@ -526,6 +534,10 @@ class CURLRequest extends Request

             if ($config['allow_redirects'] === false) {
                 $curlOptions[CURLOPT_FOLLOWLOCATION] = 0;
+
+                if ($settings['get_redirect_url'] === true) {
+                    $curlOptions[CURLINFO_REDIRECT_URL] = 1;
+                }
             } else {
                 $curlOptions[CURLOPT_FOLLOWLOCATION] = 1;
                 $curlOptions[CURLOPT_MAXREDIRS]      = $settings['max'];
@@ -541,6 +553,10 @@ class CURLRequest extends Request
                 }

                 $curlOptions[CURLOPT_REDIR_PROTOCOLS] = $protocols;
+
+                if ($settings['get_redirect_url'] === true) {
+                    $curlOptions[CURLINFO_EFFECTIVE_URL] = 1;
+                }
             }
         }

@@ -621,8 +637,24 @@ class CURLRequest extends Request
             throw HTTPException::forCurlError((string) curl_errno($ch), curl_error($ch));
         }

+        if (isset($curlOptions[CURLINFO_REDIRECT_URL])) {
+            $this->redirect_url = curl_getinfo($ch, CURLINFO_REDIRECT_URL);
+        } else if (isset($curlOptions[CURLINFO_EFFECTIVE_URL])) {
+            $this->redirect_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
+        }
+
         curl_close($ch);

         return $output;
     }
+
+    /**
+     * Get the redirect URL
+     *
+     * @return string
+     */
+    public function getRedirectUrl(): string
+    {
+        return $this->redirect_url;
+    }
 }

Cheers

why not save $ch in property and adds common method?
/**
 * @var resourse|CurlHandle CURL handler
 */
protected $handler;
/**
 * @param int|string|null $option CURLINFO_* constant or it string representation - get option, NULL - get all options
 * @return mixed
 */
public function getRedirectUrl($option = null)
{
    if ($this->handler === null) {
        throws new RuntimeException('Undefined CURL handler');
    }
    if (is_int($option)) {
        return curl_getinfo($this->handler, $option) ?: null;
    }
    $options = curl_getinfo($this->handler);
    if ($option === null) {
        return $options;
    }
    return $options[$option] ?? null;
}

@pVesian yes, need more changes
/**
 * @var resourse|CurlHandle CURL handler
 */
protected $handler;

/**
 * @param int|string|null $option CURLINFO_* constant or string representation, NULL to get all
 * @return mixed
 */
public function getInfo($option = null)
{
    if ($this->handler === null) {
        throws new RuntimeException('Undefined CURL handler');
    }
    if (is_int($option)) {
        return curl_getinfo($this->handler, $option) ?: null;
    }
    $options = curl_getinfo($this->handler) ?: [];
    if ($option === null) {
        return $options;
    }
    return $options[$option] ?? null;
}

protected function sendRequest(array $curlOptions = []): string
{
    if ($this->handler === null) {
         $this->handler = curl_init();
    }
    curl_setopt_array($this->handler, $curlOptions);
    // Send the request and wait for a response.
    $output = curl_exec($this->handler);
    if ($output === false) {
        throw new HTTPException(curl_error($this->handler), curl_error($this->handler));
    }
    return $output;
}

public function __destruct()
{
    if ($this->handler !== null) {
         curl_close($this->handler);
    }
}

It seems nobody needs this.
Close.
We use GitHub issues to track BUGS and to track approved DEVELOPMENT work packages. We use our forum to provide SUPPORT and to discuss FEATURE REQUESTS.

FYI, Guzzle Security Advisories, Fix failure to strip headers on HTTP downgrade:

https://github.com/guzzle/guzzle/security/advisories/GHSA-f2wf-25xc-69c9
https://github.com/guzzle/guzzle/security/advisories/GHSA-w248-ffj2-4v5q


dist directory not included in the npm package

version: 3.1.0
reference: https://www.npmjs.com/package/happy-css-modules/v/3.1.0?activeTab=code
has bin and src, but dist is missing.

Thank you for this tools improving experience of development a lot.

Oh... I will fix it today!

I shipped<EMAIL_ADDRESS>Please try it out! @honey32
https://github.com/mizdra/happy-css-modules/releases/tag/v3.1.1

Worked in my project! Thank you!


Assistants API

This is a WIP draft to add API coverage for the OpenAI Assistant tooling.
This implements the bulk of the beta API, with the exception of the File endpoints. This requires a bigger effort than this PR.
We may wish to stash all this stuff in a submodule like OpenAI.Assistants, especially since there are so many API endpoints associated with the assistants.
I'm also addressing some formatting stuff inside the repo, since many of the function declarations are very wide and do not generally fit in most conventional editing panes. This is however not the primary focus of this PR and may not be complete. I'd prefer if we merged in #56 so that the formatting issues were addressed more thoroughly.
API implementations
Assistants API to implement

[X] Create assistant
[X] Retrieve assistant
[X] Modify assistant
[X] Delete assistant
[X] List assistants

Threads

[x] Create thread
[x] Retrieve thread
[x] Modify thread
[x] Delete thread

Messages

[x] Create message
[x] Retrieve message
[x] Delete message
[x] Modify message
[x] List messages

Runs

[x] Create run
[x] Retrieve run
[x] Modify run
[x] List runs
[x] cancel run

Will not be implemented in this PR:

create thread and run
Retrieve run step
List run steps
Submit tool outputs to run
Create assistant file
Retrieve assistant file
Delete assistant file
List assistant files
Retrieve message file
List message files

As per #50, I'm going to leave anything that has to do with the Files API out of the PR.

Okie dokie! We're now ready for a review. I added tests and such but we should be good to go here. All tests pass locally using my personal API key.

@rory-linehan could we merge this one or do a review? The tests fail due to not having and API key, but they pass locally on my machine.

Looks good to me! Sorry, I've been traveling for the past couple weeks.

Tests seem to fail on my side, and after merge.. I'm familiarizing myself with the Assistants API to figure out what's going on. Do they still pass for you locally? The failure I'm seeing is:
{
  "error": {
    "message": "Cannot update run with status 'in_progress'.",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}


Lucid Multi Sig Transaction Example

I'm coming from the Mesh SDK where doing a multi sig transaction is pretty simple. Essentially on the backend the steps to do a simple multi sig transaction are:

Get the user's stake -> Look up all the UTXO's using Blockfrost (for each address)

const address_utxos = await blockfrostProvider.fetchAddressUTxOs(
  address
);

Find x number of UTXO's that combined have 2 ADA in them

const lovelace_utxos = largestFirst(
  "2000000",
  address_utxos,
  true
);

Then I set the tx inputs to use in the transaction:

tx.setTxInputs(lovelace_utxos);

Send the 2 ADA to my wallet and send the change back to the user

// Send 2 ADA to the site wallet address
tx.sendLovelace(site_address, "2000000");

// User will receive change back to their wallet
tx.setChangeAddress(address);

Set the required signers and build the tx

// Set the required signers
tx.setRequiredSigners([address, site_address]);

// Generate the CBOR to send to the user
const unsignedTx = await tx.build();

At this point you would send the unsignedTx CBOR to the user for them to sign and then send that CBOR back to the backend to also sign, then submit the tx.
What would this look like with Lucid? I haven't been able to find any substantial examples of how I would accomplish this with Lucid (without using a Contract).
Any guidance would be appreciated!

I don't understand step 2. Is this coin selection? In Lucid this happend automatically. Here's an example:
// .. instantiated Lucid

lucid.selectWalletFrom({address});

const tx = await lucid.newTx()
  .payToAddress(site_address, {lovelace: 2000000n})
  .addSigner(address)
  .addSigner(site_address)
  .complete();

const cborTx = tx.toString();

// .. sending cbor to signer (address)

const signature = await lucid.fromTx(cborTx).partialSign();

// .. sending cbor to signer (site_address)

const signature2 = await lucid.fromTx(cborTx).partialSign();

// .. assemble and submit

const txHash = await lucid.fromTx(cborTx).assemble([signature, signature2])
  .complete()
  .then(tx => tx.submit())

Thanks so much @alessandrokonrad. Appreciate your time! :)


API LEVEL > 29 network.download(...) save the downloaded pdf file but acrobat reader : the file could not be accessed

if API LEVEL bigger than 29 the adobe acrobat throw an error : the file could not be accessed :
local function networkListener( event )
if (event.status == 200 and event.bytesTransferred>0) then
local path = system.pathForFile("sample.pdf" , system.DocumentsDirectory )
local wasOpened = system.openURL(path)
end
end
network.download( "http://www.africau.edu/images/default/sample.pdf", "GET", networkListener,null, "sample.pdf", system.DocumentsDirectory, 0, 0 )
but it works for chrome if you want to open a html.
is missing and grant for the file provider ?

Adbe Acrobat Reader fixed this bug ! Version 22.3.0 -


Handler wrapping issue

The current implementation assumes the handler is in the function sources. The handler doesn't get instrumented when it is in a library that is part of a lambda layer (maybe there are some other scenarios, but that's how I've seen it). This additional InstrumentationNodeModuleDefinition will take care of that scenario.

Also, I added package-lock.json because I run into issues with unreproducible build results.

https://coralogix.atlassian.net/browse/CDS-475


Added DataValidation Support

I have check this and as far as i can tell this works, not 100% sure if this will be the final stage of this, but it keeps all old dataValidations and will add new ones, still need to test removing one, and getting the formula from one.. but hey does what i needed it to do
i tried to keep to your coding style @dtjohnson haha, this is also my first attempt at contributing with significant amount of code.
feedback is more than welcome.

forgot to change getter...


Mobile navigation menu scrolls past its height

When in its desktop form, the navigation menu is treated separately from the actual content and the content scrolls by itself: https://gfycat.com/SlowOffbeatAsiantrumpetfish

However, when in its mobile form, the menu scrolls with the content which looks rather odd as there is obviously nothing underneath the menu (so you get this area of nothing in the bottom-left corner): https://gfycat.com/MarvelousLateBighornsheep

Perhaps this is intentional or I'm missing something obvious, in which case please say, but it seems to me that the menu should be fixed and be independent of the content itself even in its mobile state.

Thanks for the bug report @kapito.
I think this scrolling behavior makes sense on "mobile". Since the menu is generally smaller than the viewport height on those screen sizes, it would have to scroll, and having two separate scrolling contexts would be even more confusing. The viewport you tested on is quite big, on phone-size devices it feels better IMO.
For the "area of nothing", this is not what I observe on iOS / Safari: there scrolling stops at the end of the menu when it is open. So this issue is specific to either the browser engine, or viewport you are using – could you share the Firefox version this was tested with as well as the viewport size?

Sorry @thibaudcolas, I don't have access to that machine right now however I believe it's the most recent version of Firefox. I'll give it a go with some other browsers (Chromium, Safari, IE maybe) when I get the chance.

Closing as this is most likely intentional behavior of the menu.


Implement Fixture Cleanup in generate_fixture scripts

As mentioned in PR #110, we need to ensure that before regenerating fixtures, we remove the existing fixtures using unlink(), similar to the implementation in tests/generate_fixtures/generate_target_dnadiff_files.py.
for file in DELTA_DIR.glob("*.delta"):
    file.unlink()
for file in FILTER_DIR.glob("*.filter"):
    file.unlink()
for file in SHOW_DIFF_DIR.glob("*.rdiff"):
    file.unlink()
for file in SHOW_COORDS_DIR.glob("*.mcoords"):
    file.unlink()
for file in DNADIFF_DIR.glob("*.report"):
    file.unlink()

Currently, this practice is not implemented in other generate_fixtures scripts. Implementing this will help maintain consistency and avoid potential issues with outdated test sets.

I'm just about to create a PR for this. I've already implemented changes to the fastANI generate_fixture. I will leave it as it is, and we can resolve any conflicts later, depending on which branch gets merged first, I guess.

Forgot to mention that, I'm working on this on branch issue_114.

Closed by #115.


gh-1877 - required annotation added to opChain field

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@0dd3370). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop    #1878   +/-   ##
==========================================
  Coverage           ?   79.92%
==========================================
  Files              ?       84
  Lines              ?     2785
  Branches           ?      340
==========================================
  Hits               ?     2226
  Misses             ?      440
  Partials           ?      119

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dd3370...5db9170. Read the comment docs.


Online Mode

Is there a way in the, hopefully near future, to use this on the online version of the game?
Or it is just impossible with the current anticheat?

The AntiCheat will most likely ban you. There are ways around that, but that would turn this utility (or at least its way of acting) into an online cheat. Tell FromSoft we don't have 2001 anymore and they should remove frame locks.


Logging an info message when segment upload interrupted - 93588,97051,97051

Codecov Report

Merging #1290 into master will decrease coverage by 0.09%.
The diff coverage is 40%.

@@           Coverage Diff            @@
##           master   #1290     +/-   ##
========================================
- Coverage   67.39%   67.3%   -0.1%
========================================
  Files         774     774
  Lines       37773   37777      +4
  Branches     4934    4934
========================================
- Hits        25458   25424     -34
- Misses      10655   10679     +24
- Partials     1660    1674     +14

Impacted Files
Coverage Δ

...t/resources/PinotSegmentUploadRestletResource.java
50.59% <40%> (-0.42%)
:arrow_down:

...e/query/aggregation/groupby/utils/LongToIdMap.java
68.75% <0%> (-6.25%)
:arrow_down:

...nkedin/pinot/common/metrics/ValidationMetrics.java
77.04% <0%> (-4.92%)
:arrow_down:

...time/converter/stats/RealtimeColumnStatistics.java
70.31% <0%> (-3.13%)
:arrow_down:

...ealtime/converter/RealtimeSegmentRecordReader.java
82.35% <0%> (-2.95%)
:arrow_down:

...regation/function/customobject/QuantileDigest.java
53.21% <0%> (-2.58%)
:arrow_down:

...pinot/controller/validation/ValidationManager.java
81.01% <0%> (-2.32%)
:arrow_down:

...manager/realtime/HLRealtimeSegmentDataManager.java
77.34% <0%> (-2.21%)
:arrow_down:

...e/realtime/converter/RealtimeSegmentConverter.java
87.5% <0%> (-2.09%)
:arrow_down:

...edin/pinot/common/metadata/ZKMetadataProvider.java
71.42% <0%> (-2.05%)
:arrow_down:

... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1d4160...a48a428. Read the comment docs.


Add missing dependence to structures-hl7org-dstu2

saxon is used in Utilities.java

[Jenkins Automated Message - This is not a real comment from James] OK TO TEST?

Thanks for the pull request.
FYI the HL7.org structures library isn't a part of the default HAPI build because we're still working on getting these structures integrated with the rest of the library. The goal is to have that work done in the next few weeks, but it won't be until after 0.9 is released which should be this week.
Merging now!


Improve SSR reliability

Problem is that, for the most part, the way we use and build components is incompatible with Svelte SSR. More specifically one part - reactive statements (ie $: ).
For an ideal SSR experience, we should make it an antipattern to have any reactivity (that might happen during SSR; prop reactivity is an exception) happen through reactive statements, and instead use derived stores and event handlers.
Example from _DataTable:
$: finalColumnOrder = getFinalColumnOrder(
	$props.columns.map((d) => d.id),
	$props.priorityColumns
);
$: orderedColumns = [...$props.columns].sort(
	(a, b) => finalColumnOrder.indexOf(a.id) - finalColumnOrder.indexOf(b.id)
);

should become
const finalColumnOrder = derived(props, ($props) => getFinalColumnOrder(
	$props.columns.map((d) => d.id),
	$props.priorityColumns
));
const orderedColumns = derived([props, finalColumnOrder], ([$props, $finalColumnOrder]) => [...$props.columns].sort(
	(a, b) => $finalColumnOrder.indexOf(a.id) - $finalColumnOrder.indexOf(b.id)
));

or something to that effect
This is especially relevant in components that make use of <slot /> for composing their behaviour (DataTable is also the best example here, should also be the starting point for changes)
General translation guide:

$: var = something; should become const var = derived(something, ([$something]) => { ... });
$: if (state) { ... } should become an event handler for whereever state is being changed
chunky $: { ... }s should be broken down into chunks that should fall into one of the above 2 categories

can be expanded upon w/ exception cases when we start work on this

Not necessarily directly related, but we should also do a once-over of basic prop reactivity to pick up on things like ySet in #2574


Better deprecation

I hope this is the last deprecation commit for a while.  It didn't take that long, but it's "technical".

I looked at BPA code and realized that deprecation was unsatisfactory, because a majority of the things that were deprecated were still done just with a comment.
I wanted a mechanism so we can say this:
"If you run your bp 3.x project [with these settings] then it will detect any deprecated features you use"
I found some animations in BPA that still use deprecated imports (our main issue), and set out to try to detect those neatly.

Long story short, we can now deprecate things very early - at Python code import time.  We use an environment variable to make the switch (so it goes off "as early as possible").  And if you run
BIBLIOPIXEL_DEPRECATE=fail bp your-project.json ...

and it doesn't fail, then you are (pretty well) guaranteed that your project will work without changes in BP 4.0.  (There is also the warn setting, but it cannot catch using deprecated imports...)
This deprecation costs something at Python code import time, nothing at frame generation time, and a little at construction time of animations, layouts and that sort of thing (but we do those once).

Note... inline env vars is not possible in Windows. I would prefer --deprecate fail or something.

Ah, I vaguely remembered that nasty catch.
Well.  Whatever we do has to happen before any bibliopixel symbols are loaded, because we use deprecated in bibliopixel/init.py.
So... it has to go into bp itself.
Awright then, that isn't really awful, brb.

Ah, that was more work than I thought but there it is...


Error during request to remote service: \nRequest failed with status code 415

Describe the bug
When doing a scan from my code, ""Error during request to remote service: \nRequest failed with status code 415" is started coming, it was working fine before.
We have a CDS entity whose field content is defined with LargeBinary data-type. Our app was released in 2111 and from that time, it was working fine. But now issue is coming while doing Malware scanning. Code snippet is as below:

Expected behavior
Malware scan should accept values from LargeBinary data-type field.
Screenshots

Used Versions:

node version via node -v  16.17.0
npm version via npm -v     8.15.0
SAP Cloud SDK version you used as dependency
"@sap-cloud-sdk/core": "1.54.0",
"@sap-cloud-sdk/http-client": "^2.4.0",
"@sap/cds": "^6.0.1",
"@sap/cds-dk": "^6.0.1",
"@sap/cds-mtx": "^2.5.3",

Impact / Priority        High priority

Affected development phase: e.g. Getting Started, Development, Release, Production   Customer Testing, initial Release happened in 2111
Impact: e.g. No Impact, Inconvenience, Impaired, Blocked       Blocked for customer testing
In case if you need further information, please contact through our internal teams chat at<EMAIL_ADDRESS>Best Regards
Krishan Raheja

Hi @krishraheja ,
Thanks for raising up.

SAP Cloud SDK version you used as dependency
"@sap-cloud-sdk/core": "1.54.0", // sdk
"@sap-cloud-sdk/http-client": "^2.4.0", // sdk
"@sap/cds": "^6.0.1", // cds
"@sap/cds-dk": "^6.0.1", // cds
"@sap/cds-mtx": "^2.5.3", // cds

I see you listed some cds dependencies as SDK dependency, which is not the case.
Please contact the cds team here.
Also, please use the same major version for all SDK dependencies.
Mixing them might cause some issues.
FYI, the version 1 SDK is deprecated, consider using SDK version 2 is preferred.

I would close this issue because it is not a SDK issue. Please reach out to the CAP colleagues. As some hint I would try to either get some http logs to see what CAP is actually sending as a request causing the 415 error OR
use some low level http client (axios, node-fetch....) to see if it is working in principal. Perhaps the API of your target malware scanner endpoint has changed?
In case you have a minimal example using the http-client of the SDK making a request showing some bugs please reopen the issue.
Best
Frank

Hi @FrankEssenberger and @jjtang1985,
I had another look into this issue and I observed the following behavior:
For the mentioned POST request, CAP generates the following request config:

Please note that content-type header is not set.
In the error object, I can see that the following config was used:

Please note the content-type header set by the SDK.
The malware scan API expects the content-type header to be set to application/octet-stream. If I set that manually, the request works.
With CDS 5 and SDK V1 the following is send by CAP and the SDK:

In that version, the content-length and content-type is not set correctly. This is fixed by CAP in the meanwhile.

In the eventually used config, I can see that the SDK calculated the content-length correctly, but also uses application/json as content type. That might worked by coincidence in the past.
As per API documentation, application/octet-stream should be used.
From my point of view, CAP uses the right config now, but I wonder why the SDK adds the content-type: application/x-www-form-urlencoded. Could you please double check?

Hi @johannes-vogel,
thanks for providing the request details so that we can get an idea what went wrong. Just as a first clarification we do not set the Content-Type header or length. This is done by the low lying http-agent which is axios in our case. There is one exception to this rule. For OData request we set the content type to JSON which is ok since OData API must accept JSON or some XML I guess.
So the value application/x-www-form-urlencoded you started seeing after the update is just the default value from axios. I guess this is a good default for post request because it will work in most cases.
Since for the specific API Johannes found that the value must be application/octet-stream, @krishraheja you must set this on the request level. I do not know how to pass custom headers to the req using the .tx() call but Johannes knows this for sure. In case this is not possible you can have a look at the axios API how to adjust this globally or for the next call via the axios scope bypassing the CAP and SDK API, which is not nice, but a workaround in such a case.
I also assume the API you were calling was getting more strict recently, because in the past the header was set accidentally via CAP to application/json which was accepted. Now, another wrong header  value is not accepted. Anyway, as I said the correct way to do it is to specify the header explicitly.
Best
Frank

@FrankEssenberger Thanks for clarifying!


⚠ Bofrost.be has degraded performance

In 8fd84fc, Bofrost.be (https://www.bofrost.be) experienced degraded performance:

HTTP code: 200
Response time: 2507 ms

Resolved: Bofrost.be performance has improved in 42c4f7a.


GEOMESA-2468 Make the CLI --src-list param work with stdin

Simplify ingest class hierarchy to avoid redundancy

Signed-off-by: Emilio Lahr-Vivaz<EMAIL_ADDRESS>

Needs to be rebased.

rebased


How does CLASP know which project to push to?

I am managing several different CLASP projects, and I am having problems with local files getting pushed to the wrong Google project. I am confused about how clasp push knows which project to push to, since I don't see any hidden, .clasp files in my local directories with that kind of info, as one sees with Git.
Can I get more information about how CLASP associates local directories with remote projects, to reduce problems with pushing to the wrong project?

We navigate up the folder heirarchy to find the parent folder with a .clasp file. Defaults to current dir.
https://github.com/google/clasp/blob/master/src/dotfile.ts#L95
Be sure parent directories don't have a .clasp file.

Thanks a lot for your reply. I don't see any .clasp files in my project directories or in parent directories.
To fix the issue of pushing to the wrong project, I copy my local project to a tmp folder, re-clone the Google project by its script ID, delete all the contents in the cloned folder, copy the contents over from the tmp folder then push.
This pushes the files to the correct project, but then I switch to a different directory (representing a different project) and when I type clasp push again it uploads to the same Google project as the previous project.

I know see I have a single .clasp.json file in my user folder, storing a single scriptId. Should I have a file like this in each clasp project directory, or just delete this one in my user folder?

Each project should have it's own .clasp.json file.
It like .git. In most cases, you'll want 1 of these per project.

Okay, great. These files don't seem to get created automatically by clasp clone. Could that be a feature request or a bug?

clasp clone https://script.google.com/d/1rAssKxAPxDbHQgawGvDDvPBXNZexODl1-q7qTbB_3qLivZU6ZQd7DBf4/edit
Should create a .clasp.json file. Does it not? If not, please file a new bug.

I think the problem was that I had a sneaky .clasp.json file lingering in a parent directory.
With that file gone, clasp clone <scriptId> does generate a .clasp.json, but when I put that file back in the parent directory, clasp clone <scriptId> does not generate it.
Thanks for your help.

Can you file a new bug with specific steps to reproduce the issue? What version are you running?

I created a new bug report here: https://github.com/google/clasp/issues/384
Let me know if that is useful!

OK will continue the conversation on #384.

Suppose that you are managing the project in VSC. Here the fatastic things that you can do with CLASP:

I have a GAS project with (let's say) ID "A" after clasp login you can clone the project from GAS to VSC with clasp clone ID ("A")
I have a GAS project with ID "A" after clasp clone in VSC you can pull (from inside VSC) the project from GAS to VSC with clasp pull
I have a GAS project with ID "A"  in VSC you can push (from inside VSC) the project from VSC to GAS with clasp push
I have a GAS project with ID "A"  in VSC you can push (from inside VSC) in another GAS project (let's say ) ID "B" the whole project: the steps are - modifiy clasp.json inside VSC (change ID from A to B) and into the VSC terminal run clasp push. Important! you have to create project with ID "B" before to run clasp command

@progettazionemauro I would like to do number 4 from your list, but I keep getting this output on my terminal:
No valid /Users/iancampbell/Desktop/GAS/test_app/.clasp.json project file. You may need to create or clone a project first.


hhvm: missing libdwarf.so.1

Issue description
HHVM is broken because it looks for libdwarf.so.1, while it looks like libdwarf only provides an unversioned libdwarf.so. It broke somewhere between 16.03 and 16.09, since it didn't start failing until I upgraded to 16.09.
Might be the same problem as #5072 since libdwarf has since been updated in 16.09 but not in 16.03.
Steps to reproduce
Install HHVM.
$ hhvm
hhvm: error while loading shared libraries: libdwarf.so.1: cannot open shared object file: No such file or directory

Technical details
nixos 16.09 - I don't have a precise version since I had to roll back. Verified issue exists in master as well.

libdwarf started setting a soname with #18968. Installing libdwarf.so.1 and symlinking libdwarf.so should fix it; I'm preparing a PR.

Hmm, I understand now – it was broken by our previous update fcb41707f1 and not the last one.


Enhance the UI/UX of the cart pop-pop

Hey @RIKI-05 you can assign this to me i can give it a try

The project is done..
I could do it more better but the code was breaking hope you'll like it..

@amitroy-thedev i opened your pr it has some conflicts fix them ill merge your pr


R0.9

Can one of the admins verify this patch?

We're not quite done with r0.9, we'll merge it when we publish the non-RC.


Adding an existing contact returns true, but should return false

package s8.ce44
boolean addNewContact(Contact contact) has a bug

Reason is given below

int findContact(String name) doesn't work as expected

Fix for issue #1
Iterate over myContacts ArrayList<Contact>
For each contact within, use equals(name) on the contact getter : getName()


Add space

On the footer add space character after GitHub logo

sir can i ?

is this issue still open?

is this issue still open?

No this issue is resolved :) thanks for asking!

sir can you please give me any beginner friendly issue


Configurations with Kubernetes RBAC authorization enforced aren't working

For 0.1.0 we punted on RBAC support because minikube doesn't yet enable the RBAC authorization mode and we didn't want to ask people to enable RBAC to try out Conduit. However, now we have people trying to use Conduit with RBAC authorization enabled and it's not working. At a minimum we need to make sure that Conduit works regardless of whether RBAC authorization is enforced or not. In particular, some of the controller services need to be running under service accounts that have roles that enable them to make the Kubernetes API server queries for the specific data sets they access.
Ideally we'd do this 100% automatically and it would work regardless of whether RBAC enforcement is enabled. If we can't then we can create a switch for conduit install to disable RBAC. (Because of the "Secure by Default" design goal, the default should be to enable RBAC.)

Here's some background from linkerd: https://buoyant.io/2017/07/24/using-linkerd-kubernetes-rbac/

Here's one of the multiple user requests for this: https://discourse.linkerd.io/t/demo-support-for-rbac/443

Log messages from the discourse thread:

If I shell into the conduit-proxy container, I’m not able to actually connect to the controller:

curl hxxp://proxy-api.conduit.svc.cluster.local:8086/conduit.proxy.telemetry.Telemetry/Report
curl: (56) Recv failure: Connection reset by peer

Also I see a lot of this in the logs for the destination container in the controller:

E1211 23:45:01.296991 1 reflector.go:199] github.com/runconduit/conduit/vendor/k8s.io/client-go/tools/cache/reflector.go:94: Failed to list *v1.Service: the server does not allow access to the requested resource (get services)
E1211 23:45:02.302709 1 reflector.go:199] github.com/runconduit/conduit/vendor/k8s.io/client-go/tools/cache/reflector.go:94: Failed to list *v1.Endpoints: the server does not allow access to the requested resource (get Endpoints)

I see these logs on controller's destination container.
E1213 06:07:54.890236       1 reflector.go:199] github.com/runconduit/conduit/vendor/k8s.io/client-go/tools/cache/reflector.go:94: Failed to list *v1.Endpoints: endpoints is forbidden: User "system:serviceaccount:conduit:default" cannot list endpoints at the cluster scope

The default ServiceAccount has no enough permission to communicate with API server, we need to create a ServiceAccount.

If someone needs RBAC, this may be a good starting point: https://github.com/container-bootcamp/infrastruktur/tree/conduit/conduit
Unfortunately, I cannot test any further, because there are other issues I ran into...
Just look at the logs and add resources resp. apiGroups to the ClusterRole resource and apply the rbac.yaml again

@FaKod There need more API permissions for the Deployments and ServiceAccount for them. See this yaml, I use this to deploy.


chore(deps): update controller-sdk-go in prep of v2.1 release

relies on https://github.com/deis/controller/pull/842 before merging.

@bacongobbler Unfortunately, there is no way to get deis/controller#842 to pass without merging this first. Since there are no binaries from PRs, there is no way to use the CLI from this PR to test deis/controller#842. The only way I see to do this is to merge this PR (temporarily breaking e2e), then rerun tests on deis/controller#842 and when that passes merge it and fix e2e.


LeaveApplication#Cancel Should Return Locked Hours to LeaveTime via LeaveTimeUsage

Destroying leave application has no error, however,  "cancelling" leave application still deduct the leave time usable hours

Rspec broken
leave time duration should be in unit of hours

由於 #99 修改假單結構產生 LeaveTimeUsage，故此issue 需改為 當假單被刪除時，必須 return 回
locked_hours 到相對應的 leave_times

備註：不管是假單被取消或者是被駁回，都會將 locked_hours 回歸為 usable_hours

備註：需要補上 Model Spec

於 PR #115 中完成，且測試無誤，故關閉此 issue。


Datasets not available on WEkEO

@mdrudi We have some problems related to the dataset available on WEkEO.
Currently the product MEDSEA_MULTIYEAR_PHY_006_004 is no more avaiable.
If a try to search it on WEkEO it seems to return to me the right product but when I try to open it I can see this dataset: MEDSEA_MULTIYEAR_PHY_006_004-statics_202105.
Then, if a try to download the monthly temperature dataset using the download module I receive this error:
Error: Unexpected response <Response [500]>
Error: Unexpected response <Response [404]>

How should we proceed since the high instability of this service in the last month?

This issue stop me also to continue the test of the download module, because this problem regards also other dataset, for example MEDSEA_MULTIYEAR_WAV_006_012 (one of the new dataset that I should introduce)

To keep in mind, the products we are targetting now are:

MEDSEA_MULTIYEAR_PHY_006_004
GLOBAL_REANALYSIS_PHY_001_030
OCEANCOLOUR_MED_BGC_L4_MY_009_144 (replacing OCEANCOLOUR_MED_CHL_L4_REP_OBSERVATIONS_009_078)
MEDSEA_MULTIYEAR_WAV_006_012

Note here https://github.com/CMCC-Foundation/bluecloud-mockup_method/pull/15#issuecomment-1191568351

https://help.marine.copernicus.eu/en/articles/5151127-how-to-consume-the-motu-rest-api-and-cas-sso
https://help.marine.copernicus.eu/en/articles/4796533-what-are-the-motu-client-motuclient-and-python-requirements

20220829 UPDATE

MEDSEA_MULTIYEAR_PHY_006_004: on WEkEO site it is available only in a specific date 16/05/2020
OCEANCOLOUR_MED_BGC_L4_MY_009_144: doesn't return a netCDF4 files but a dods (?) file

20220829 UPDATE
* **MEDSEA_MULTIYEAR_PHY_006_004**: on WEkEO site it is available only in a specific date 16/05/2020

* **OCEANCOLOUR_MED_BGC_L4_MY_009_144**: doesn't return a netCDF4 files but a dods (?) file

...per la tabella di report che chiedevo questa mattina, va bene anche se la scrivi qui. Pero' avrei bisogno che mi indicassi anche il CF standard name del campo che si tenta di accedere


Geth is able to read the snapshot blocks, but the blocks are not synchronizing automatically...

I have installed the base chain node and Docker is running fine. Geth is able to read the snapshot blocks, but the blocks are not synchronizing automatically. The block is stuck at: 16987426.

I have attached the configuration. If anyone knowledgeable could provide some guidance, thank lot.

net.peerCount is always at 0, and the blocks aren't syncing automatically.
Would appreciate some help from those who know, thanks a lot

Facing same issue.

Peer count is always 0, started for me when the node's OS was rebooted for security patches last night

Hello, same issue here.
Could you share the tree/folder structure to make sure the node read the correct snapshot folder ?


False Documentation Link for Custom Themes

Explain the bug
There is false documentation link in the Custom Themes documentation, which can be accessed via Settings > Appearance. When trying to click the documentation link in info button, it redirects to https://files-community.github.io/docs/#/articles/custom-themes instead of https://files-community.github.io/docs/#/articles/custom-skins.
To reproduce

Go to Settings
Surf to Appearance Tab
Click on the link on info button in Custom themes
See 404 Error Page

Expected behavior
The link should redirect user to https://files-community.github.io/docs/#/articles/custom-skins instead of https://files-community.github.io/docs/#/articles/custom-themes.
Screenshots
https://user-images.githubusercontent.com/69080584/126259911-849ce6b2-93c9-4ca0-9fcb-a2c9d678dc4b.mp4
System Information

OS Version: Windows 10 21H1 19043.1110
App version: v<IP_ADDRESS>

Additional comment
Does this problem happen again after restarting the app? Yes

We should also remove the "Performance Settings" page from the documentation as the settings described there have been removed.

@gave92 it's been removed from the new documentation site.

@stanleyowen The documentation links have been updated.

Okay thanks!

@yaichenbaum they seem to be broken again in Version: <IP_ADDRESS>
OS Version: 10.0.19043.1165

@yaichenbaum they seem to be broken again in Version: <IP_ADDRESS>
OS Version: 10.0.19043.1165

The new website hasn't been published yet.


lambda aft-enable-cloudtrail fails

aft version: 1.0.11
feature flag: aft_feature_cloudtrail_data_events = true
after the first new account is provisioned and enrolled in controltower the step function aft-feature-options fails at Enable Cloudtrail.
the lambda it invokes (aft-enable-cloudtrail) throws an error:
[ERROR] TrailNotFoundException: An error occurred (TrailNotFoundException) when calling the GetTrail operation: Unknown trail: aws-aft-CustomizationsCloudTrail for the user: xxxxxxxxxxx
Traceback (most recent call last):
  File "/var/task/aft_enable_cloudtrail.py", line 130, in lambda_handler
    if not trail_exists(ct_session):
  File "/var/task/aft_enable_cloudtrail.py", line 16, in trail_exists
    response = client.get_trail(Name=CLOUDTRAIL_TRAIL_NAME)
  File "/opt/python/lib/python3.8/site-packages/botocore/client.py", line 386, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/python/lib/python3.8/site-packages/botocore/client.py", line 705, in _make_api_call
    raise error_class(parsed_response, operation_name)

i believe this should throw an exception that is gracefully caught in the lambda python code. you can see in the code a conditional for this cloudtail being created. as it stands in version 1.0.11 if the cloudtrail trail doesnt exist the boto3 request error isnt caught and it just fails:
https://github.com/aws-ia/terraform-aws-control_tower_account_factory/blob/d347c43d90a048b68184b9f29e2e448ff6c8561e/modules/aft-feature-options/lambda/aft-enable-cloudtrail/aft_enable_cloudtrail.py#L16
you can see in an earlier version of AFT this was actually being handled correctly:
https://github.com/aws-ia/terraform-aws-control_tower_account_factory/blob/ae35712fdef0ca38cfe9dca34d708f5e9040fcf0/modules/aft-feature-options/lambda/aft-enable-cloudtrail/lambda_function.py#L13-L20
So currently i dont think this functionality for enabling cloudtrail data events will work, correct me if im wrong?

to mitigate this you need to disable cloudtrail data events feature flag in the AFT terraform
# Feature Flags
aft_feature_cloudtrail_data_events = false

Hey @androidwiltron, I'm taking a quick look into this, but in the mean time, do you know if within your Control Tower management account, under Organizations, that you have Access Enabled for the CloudTrail service?

CloudTrail - Access Disabled
@balltrev is this somthing that needs enabling - not sure i spotted this in the docs?

I believe it is a prerequisite for the feature option, I'll see if I can't find a documentation link for you.
We did confirm that regression you pointed out and are working on deploying the fix now, thanks for the catch!

https://docs.aws.amazon.com/controltower/latest/userguide/aft-feature-options.html
Prerequisite

Before you enable this feature option, be sure that trusted access for AWS CloudTrail is enabled in your organization.

To check the status of trusted access for CloudTrail :

    Navigate to the AWS Organizations console.

    Choose Services > CloudTrail.

    Then select Enable trusted access in the upper right, if needed.

Thanks for the docs.
Creeping out of scope for this issue a little but I feel that is somthing that could be done in the AFT module itself:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/config_organization_managed_rule
Just a suggestion.

That's a pretty good call out, though I agree it's a little out of scope here so I went ahead and made a backlog for that enhancement.

Hey! We just pushed a fix for this issue - https://github.com/aws-ia/terraform-aws-control_tower_account_factory/releases/tag/1.0.12