text:
Netscan inside Docker

Intro
Hi there, this is the only library that it worked for me to do a system that performs a host discovery scanner and I am in the process of Dockerizing it. I sorted out the permissions and the scan works, the only thing is that I found that none of the Docker options are working towards scanning the host system through Docker, I may be asking too much but could you let me know if you tried with the library works or how to make it work in Docker?
Recreation steps

create and run an example.rs with the host discovery for the default interface
build it on Docker
Run it on docker and expect the discovered hosts don't match the ones discovered outside of Docker

Notes

I develop on latest MacOS Intel but I tried recreating the steps on my raspberry pi so I discarded OS since there was a bug where the flag --network host was not working on MacOS

Link to my project
Network scanner
Thanks very much for this awesome project!

First of all, thank you for your interest in my project, netscan!
I’m glad to hear that it worked for your host discovery scanner system in your project.
Regarding your question, I haven’t tested netscan in a Docker environment yet. The environments I have tested so far are as follows:

Physical Host OS:

Linux (Kali, Ubuntu)
macOS (Intel, Apple Silicon)
Windows

Virtual Machines:

VMware running Linux (Kali, Ubuntu)

If you are attempting to scan from within Docker, please try the following settings:

Granting Permissions
To properly execute the scan, try adding the CAP_NET_RAW and CAP_NET_ADMIN capabilities to the container
Check Network Interfaces
Verify that the host's network interfaces are accessible from within the Docker container, and adjust the interface specification if necessary.
Packet Capture
If possible, try performing a packet capture to verify whether the send/receive are functioning correctly on the specified network interface.

Currently, I am busy with work and personal commitments, but I plan to continue maintaining netscan, including updating dependencies in the near future.
If you notice anything else or have suggestions, please feel free to let me know.

Thanks very much for the quick reply, I will be investigating and doing some research, if you bare with me for a few weeks, I'd like to have this issue open so I can add my findings and potentially create a proper PR to update the README.md if I get to a successful path.
Thanks a million for this!

authors: albertjimenez shellrow

repo: shellrow/netscan


text:
Support for multiple SCCM servers

Hi!
I added -target-file, so you can specify multiple SCCM servers in a txt file. This enables to create the inventory and to download the files automatically from these servers.
I also changed the if / else part so that you can create the inventory file and download the files afterwards without starting the tool again.

if __name__ == "__main__": 👍
Connecting to SCCM as it's own function 👍
target_file logic 👍
appendToInv logic 👍

Also fixed a bug when target_file was used and options.target_ip not set.
Thanks for the contribution. We owe you a beer

source: gharchive/pull-request

repo: shelltrail/cmloot

license_type: permissive

license_source: github-api


text:
delete

delete

和程序没啥关系

？？？？

不一定没关系把？这名女实习生是实习开发吗？

@jonzrj 就是因为不一定，所以不能放上面啊

source: gharchive/issue

authors: dcy0701 jonzrj shengxinjing

repo: shengxinjing/programmer-job-blacklist

license: mit

license_source: bigquery


text:
vue multiselect - cannot clear or edit data saved from local storage

I have stored the multiple selected values into the local storage to persist data just in case if the user refreshes the page.
Now when I retieve and populate the multiselect. I can no longer edit or change the values in on the multiselect. Here is the code.
<multiselect v-model="formData.daysAvailable" @select="selectedValue" :options="days" :multiple="true"
placeholder="Select the days you can work in"
id="daysAvailable"
:class="hasError('daysAvailable') ? 'is-invalid' : ''"
track-by="name" label="name">

methods: {
openStorage () {
return JSON.parse(localStorage.getItem('applicant_form'))
},
saveStorage (form) {
localStorage.setItem('applicant_form', JSON.stringify(form))
},
updateForm (input, value) {
this.formData[input] = value
let storedForm = this.openStorage()
if (!storedForm) storedForm = {}
storedForm[input] = value
this.saveStorage(storedForm)
},
selectedValue(value) {
            let storedForm = this.openStorage()

            if (storedForm['daysAvailable'].length)  {
                if (Array.isArray(storedForm['daysAvailable'])) {
                    value =  storedForm['daysAvailable'].push(value)
                } else {
                    value = [ storedForm['daysAvailable'], value]
                }
            }
            this.updateForm('daysAvailable', value)
        }

},
mounted() {
this.getInternalData()
const storedForm = this.openStorage()
if (storedForm) {
this.formData = {
...this.formData,
...storedForm
}
}
}

I have solved the problem

repo: shentao/vue-multiselect

license: MIT


text:
为啥我这数据集老是有问题呢

我的操作CUDA_VISIBLE_DEVICES=0 python3 supervised_finetuning.py     --model_type chatglm     --model_name_or_path ./model     --train_file_dir ./data  --validation_file_dir ./data     --per_device_train_batch_size 2     --per_device_eval_batch_size 1     --do_train     --do_eval     --use_peft True     --fp16     --max_train_samples 1000     --max_eval_samples 10   --num_train_epochs 1     --learning_rate 2e-5     --warmup_ratio 0.05     --weight_decay 0.05     --logging_strategy steps     --logging_steps 10     --eval_steps 50     --evaluation_strategy steps     --save_steps500     --save_strategy steps     --save_total_limit 3     --gradient_accumulation_steps 1     --preprocessing_num_workers 1     --max_source_length 128     --max_target_length 128     --output_dir outputs-sft-chatglm2-6b-v1     --overwrite_output_dir     --ddp_timeout 30000     --logging_first_step True     --target_modulesquery_key_value     --lora_rank 8     --lora_alpha 16     --lora_dropout 0.05     --torch_dtype float16     --device_map auto     --report_to tensorboard     --ddp_find_unused_parameters False     --gradient_checkpointing True
error：Failed to read file '/home/wyxx/warBackup/ner/ChatGLM2-6B/data/data.json' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Missing a comma or '}'after an object member. in row 202
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py:134  │
│ in _generate_tables                                                                              │
│                                                                                │
│   131 │   │   │   │   │   │   except pa.ArrowInvalid as e:                                       │
│   132 │   │   │   │   │   │   │   try:                                                           │
│   133 │   │   │   │   │   │   │   │   with open(file, encoding="utf-8") as f:                    │
│ ❱ 134 │   │   │   │   │   │   │   │   │   dataset = json.load(f)                                 │
│   135 │   │   │   │   │   │   │   except json.JSONDecodeError:                                   │
│   136 │   │   │   │   │   │   │   │   logger.error(f"Failed to read file '{file}' with error {   │
│   137 │   │   │   │   │   │   │   │   raise e                                                    │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/json/init.py:293 in load                              │
│                                                                                │
│   290 │   To use a custom JSONDecoder subclass, specify it with the cls                  │
│   291 │   kwarg; otherwise JSONDecoder is used.                                              │
│   292 │   """                                                                                │
│ ❱ 293 │   return loads(fp.read(),                                                                │
│   294 │   │   cls=cls, object_hook=object_hook,                                                  │
│   295 │   │   parse_float=parse_float, parse_int=parse_int,                                      │
│   296 │   │   parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)          │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/json/init.py:346 in loads                             │
│                                                                                │
│   343 │   if (cls is None and object_hook is None and                                            │
│   344 │   │   │   parse_int is None and parse_float is None and                                  │
│   345 │   │   │   parse_constant is None and object_pairs_hook is None and not kw):              │
│ ❱ 346 │   │   return _default_decoder.decode(s)                                                  │
│   347 │   if cls is None:                                                                        │
│   348 │   │   cls = JSONDecoder                                                                  │
│   349 │   if object_hook is not None:                                                            │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/json/decoder.py:340 in decode                             │
│                                                                                │
│   337 │   │   obj, end = self.raw_decode(s, idx=_w(s, 0).end())                                  │
│   338 │   │   end = _w(s, end).end()                                                             │
│   339 │   │   if end != len(s):                                                                  │
│ ❱ 340 │   │   │   raise JSONDecodeError("Extra data", s, end)                                    │
│   341 │   │   return obj                                                                         │
│   342 │                                                                                │
│   343 │   def raw_decode(self, s, idx=0):                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
JSONDecodeError: Extra data: line 2 column 1 (char 408)
During handling of the above exception, another exception occurred:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/builder.py:1858 in                 │
│ _prepare_split_single                                                                            │
│                                                                                │
│   1855 │   │   │   )                                                                             │
│   1856 │   │   │   try:                                                                          │
│   1857 │   │   │   │   _time = time.time()                                                       │
│ ❱ 1858 │   │   │   │   for _, table in generator:                                                │
│   1859 │   │   │   │   │   if max_shard_size is not None and writer._num_bytes > max_shard_size  │
│   1860 │   │   │   │   │   │   num_examples, num_bytes = writer.finalize()                       │
│   1861 │   │   │   │   │   │   writer.close()                                                    │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py:137  │
│ in _generate_tables                                                                              │
│                                                                                │
│   134 │   │   │   │   │   │   │   │   │   dataset = json.load(f)                                 │
│   135 │   │   │   │   │   │   │   except json.JSONDecodeError:                                   │
│   136 │   │   │   │   │   │   │   │   logger.error(f"Failed to read file '{file}' with error {   │
│ ❱ 137 │   │   │   │   │   │   │   │   raise e                                                    │
│   138 │   │   │   │   │   │   │   # If possible, parse the file as a list of json objects and    │
│   139 │   │   │   │   │   │   │   if isinstance(dataset, list):  # list is the only sequence t   │
│   140 │   │   │   │   │   │   │   │   try:                                                       │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py:113  │
│ in _generate_tables                                                                              │
│                                                                                │
│   110 │   │   │   │   │   │   try:                                                               │
│   111 │   │   │   │   │   │   │   while True:                                                    │
│   112 │   │   │   │   │   │   │   │   try:                                                       │
│ ❱ 113 │   │   │   │   │   │   │   │   │   pa_table = paj.read_json(                              │
│   114 │   │   │   │   │   │   │   │   │   │   io.BytesIO(batch), read_options=paj.ReadOptions(   │
│   115 │   │   │   │   │   │   │   │   │   )                                                      │
│   116 │   │   │   │   │   │   │   │   │   break                                                  │
│                                                                                │
│ /home/wyxx/warBackup/ner/ChatGLM2-6B/pyarrow/_json.pyx:258 in pyarrow._json.read_json            │
│                                                                                │
│ [Errno 2] No such file or directory: '/home/wyxx/warBackup/ner/ChatGLM2-6B/pyarrow/_json.pyx'    │
│                                                                                │
│ /home/wyxx/warBackup/ner/ChatGLM2-6B/pyarrow/error.pxi:144 in                                    │
│ pyarrow.lib.pyarrow_internal_check_status                                                        │
│                                                                                │
│ [Errno 2] No such file or directory: '/home/wyxx/warBackup/ner/ChatGLM2-6B/pyarrow/error.pxi'    │
│                                                                                │
│ /home/wyxx/warBackup/ner/ChatGLM2-6B/pyarrow/error.pxi:100 in pyarrow.lib.check_status           │
│                                                                                │
│ [Errno 2] No such file or directory: '/home/wyxx/warBackup/ner/ChatGLM2-6B/pyarrow/error.pxi'    │
╰────────────────���─────────────────────────────────────────────────────────────────────────────────╯
ArrowInvalid: JSON parse error: Missing a comma or '}' after an object member. in row 202
The above exception was the direct cause of the following exception:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/wyxx/warBackup/ner/ChatGLM2-6B/supervised_finetuning.py:550 in                     │
│                                                                                │
│   547                                                                                │
│   548                                                                                │
│   549 if name == "main":                                                                 │
│ ❱ 550 │   main()                                                                                │
│   551                                                                                │
│                                                                                │
│ /home/wyxx/warBackup/ner/ChatGLM2-6B/supervised_finetuning.py:384 in main                        │
│                                                                                │
│   381 │   │   │   │   f'{data_args.validation_file_dir}/**/*.jsonl', recursive=True)             │
│   382 │   │   │   logger.info(f"eval files: {', '.join(eval_data_files)}")                       │
│   383 │   │   │   data_files["validation"] = eval_data_files                                     │
│ ❱ 384 │   │   raw_datasets = load_dataset(                                                       │
│   385 │   │   │   'json',                                                                        │
│   386 │   │   │   data_files=data_files,                                                         │
│   387 │   │   │   cache_dir=model_args.cache_dir,                                                │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/load.py:1797 in load_dataset       │
│                                                                                │
│   1794 │   try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES                              │
│   1795 │                                                                                │
│   1796 │   # Download and prepare data                                                           │
│ ❱ 1797 │   builder_instance.download_and_prepare(                                                │
│   1798 │   │   download_config=download_config,                                                  │
│   1799 │   │   download_mode=download_mode,                                                      │
│   1800 │   │   verification_mode=verification_mode,                                              │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/builder.py:890 in                  │
│ download_and_prepare                                                                             │
│                                                                                │
│    887 │   │   │   │   │   │   │   prepare_split_kwargs["max_shard_size"] = max_shard_size       │
│    888 │   │   │   │   │   │   if num_proc is not None:                                          │
│    889 │   │   │   │   │   │   │   prepare_split_kwargs["num_proc"] = num_proc                   │
│ ❱  890 │   │   │   │   │   │   self._download_and_prepare(                                       │
│    891 │   │   │   │   │   │   │   dl_manager=dl_manager,                                        │
│    892 │   │   │   │   │   │   │   verification_mode=verification_mode,                          │
│    893 │   │   │   │   │   │   │   **prepare_split_kwargs,                                       │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/builder.py:985 in                  │
│ _download_and_prepare                                                                            │
│                                                                                │
│    982 │   │   │                                                                                │
│    983 │   │   │   try:                                                                          │
│    984 │   │   │   │   # Prepare split will record examples associated to the split              │
│ ❱  985 │   │   │   │   self._prepare_split(split_generator, **prepare_split_kwargs)              │
│    986 │   │   │   except OSError as e:                                                          │
│    987 │   │   │   │   raise OSError(                                                            │
│    988 │   │   │   │   │   "Cannot find data file. "                                             │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/builder.py:1746 in _prepare_split  │
│                                                                                │
│   1743 │   │   │   gen_kwargs = split_generator.gen_kwargs                                       │
│   1744 │   │   │   job_id = 0                                                                    │
│   1745 │   │   │   with pbar:                                                                    │
│ ❱ 1746 │   │   │   │   for job_id, done, content in self._prepare_split_single(                  │
│   1747 │   │   │   │   │   gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args           │
│   1748 │   │   │   │   ):                                                                        │
│   1749 │   │   │   │   │   if done:                                                              │
│                                                                                │
│ /data/software/anaconda3/lib/python3.9/site-packages/datasets/builder.py:1891 in                 │
│ _prepare_split_single                                                                            │
│                                                                                │
│   1888 │   │   │   # Ignore the writer's error for no examples written to the file if this erro  │
│   1889 │   │   │   if isinstance(e, SchemaInferenceError) and e.context is not None:         │
│   1890 │   │   │   │   e = e.context                                                         │
│ ❱ 1891 │   │   │   raise DatasetGenerationError("An error occurred while generating the dataset  │
│   1892 │   │                                                                                │
│   1893 │   │   yield job_id, True, (total_num_examples, total_num_bytes, writer.features, num  ���
│   1894                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
DatasetGenerationError: An error occurred while generating the dataset
我的第202行数据{"instruction": "国内货物运输保险的赔偿处理遵循什么原则", "input": "", "output": "对于国内货物运输保险的赔偿是，在发生保险责任范围内的灾害事故时，普通财产保险仅负责被保险财产的直接损失以及为避免损失扩大采取施救、保护等措施而产生的合理费用。对于国内货物运输保险的定义是以在国内运输过程中的货物为保险标的，在标的物遭遇自然灾害或意外事故所造成的损失时给予经济补偿。按照分输方式可分为：直运货物运输保险、联运货物运输保险、集装箱运输保险。在发生保险事故的时候，被保险人要向保险人申请索赔，必须提供下列有关单证：保险凭证、运单（货票）、提货单、发货票，承运部门签发的货运记录、普通记录、交接验收记录、鉴定书，收货单位的入库记录、检验报告、损失清单及救护货物所支付的直接费用的单据。"}
我感觉这没问题啊

数据问题，就自己仔细检查数据，不行删除这条。


text:
macのchromeベースのwebブラウザでページを閲覧すると、点の位置がずれている

chroniumベースのブラウザだと点の位置がずれてしまっている
chrome or brave brawser

こっちがsafari
safariだとちゃんと読み込めている

マークダウン記法の読み込み方が違う？
notionとかに乗っけてweb公開したら直るかもですね。
ただ認証周りが変わってきてしまう可能性があるので工数かかってしまいそうですが... (よく知らない)

ありがとう！マークダウンの読み方現在対応中です

ですです、ここら辺さっきゆうきちゃんと擦り合わせしたのでアプデをお待ちください 🙏

fix アプデしました！ありがとうございます 🥳

authors: bayamasa neila

repo: shiftbase-xyz/UNCHAIN-projects


text:
Use appropriate file extensions

TextMate grammars under grammars and raw should use the official TextMate file extension .tmLanguage.json instead of the regular .json file extension
That way they get JSON TextMate syntax highlighting (VSCode)

Sample files under samples should use their respected language file extensions

This is a repo that synchronize the grammars and themes, but not where you write them - while the syntax highlighting is something good to have, as it would require a lot effort to rewrite the script, I don't feel it's worth it.
the .sample is on purpose to avoid IDE or automation tools that might change the content.

Thanks for bringing this up

authors: RedCMD antfu

repo: shikijs/textmate-grammars-themes


text:
Opencv native mat to opencvsharp mat crash.

Hi:
Opencv native mat to opencvsharp mat crash.
Environment:

windows 10
visual studio 2017
WPF
C#

The program crashed after running for 25minutes.
Crashed:

Code:

I want to display camera pictures.

Hi @sevenzoe
You can use
OpenCvSharp.Extensions.BitmapSourceConverter.ToBitmapSource(image);
Or
image.ToBitmapSource();// using OpenCvSharp.Extensions;

Hi @zpmmehrdad:
The program will still crash:

Creating OpenCvSharp.Mat from your native Mat (cv::Mat*) is dangerous. You must use the same OpenCV version, the same VC++ version and  the same dependency libraries. It is difficult. Native library differences occasionally cause crashes.

authors: sevenzoe shimat zpmmehrdad

repo: shimat/opencvsharp


text:
POST on container fails

I am trying to deploy a container using using rest api. I created a server key and trying to use it in post
curl -S -H 'X-Service-Key: 8zuF.KDOcAzLMUbxqto9I.nu.oHt26HmUNi.' -X POST -d '{"name": "ezeasharma/hello-world"}' http://10.28.51.145:8080/api/containers

EOF

Not sure whats going on here.
I also tried with setting all the properties as described in https://shipyard-project.com/docs/api/#post-containers but no same result.
What is EOF? End of file?

dupe of https://github.com/shipyard/shipyard/issues/571

after specifying the type, i now get "Not Found" response. I would like to force it download from official docker hub.
What is equivalent to "--pull" in terms of web api?

figured it out
http://10.28.51.145:8080/api/containers?pull=tru

repo: shipyard/shipyard


text:
公開画面HTML変更　h1,nav,article

スクリーンリーダーに適したタグに変更する。
h1 -> h2, h2 ->h3

記事/カテゴリ
記事/関連記事
記事/問い合わせ
新着タブ
イベント

nav -> section, div

記事/カテゴリ
記事/関連記事
SNS共有リンク

article

記事/カテゴリ
記事/関連記事

記事/カテゴリ
 =>

 =>

 =>

記事/関連記事
 =>

 =>

 =>

SNS共有リンク
 =>

記事/問い合わせ

 =>

新着タブ

 =>

イベント

 =>

repo: shirasagi/shirasagi


text:
[modify] remove gem 'ruby-debug-ide'

because its installation sometimes succeeds, sometimes fails on CI

coverage: 82.861%. first build when pulling 5085bca3b5b76e3e5621ba6d3a6e4ec1a6154621 on pr-ruby-debug-ide into d301cfce4812a91506379173014d72222387e169 on master.


text:
更新

更新20190406

更新20190406


text:
How to use php with openssl 1.1

PHP with openssl@3 has some bugs.
var_dump(openssl_encrypt('12345', 'bf', 'xxxxxxxx', 0, 'xxxxxxxx'));

When I run it in php8 with openssl@1.1, it works.
But I run it with openssl@3.0, it will be broken.

@limingxinleo
Instead of trying to downgrade openssl, enable legacy providers in it.

open "$(brew --prefix)"/etc/openssl@3/openssl.cnf
Find [default_sect] section in the file and uncomment activate = 1 under it. Then add the legact_sect section under that.

[default_sect]
activate = 1
[legacy_sect]
activate = 1

Then find the [provider_sect] and change it to the following:
[provider_sect]
default = default_sect
legacy = legacy_sect

Save the file and run the following command, it should show both default and legacy providers
openssl list -providers

Your code should work then.

@shivammathur can't thank you enough for this solution! :)

authors: aryojamousi limingxinleo shivammathur

repo: shivammathur/homebrew-php


text:
Update php@8.2

Build php@8.2

:beers: @BrewTestBot has triggered a merge.


text:
dsn_levels v.0.2.2

Minor update with MenuScene to signal memory updates with every jump.  Also don't mind the small formatting changes, as these are from the IDE used (PyCharm).

This is also apart of fixing the memory bug


text:
Fix hot proxy server for shared instances

1. Why is this change necessary?
Currently, the hot-proxy fails to work in shared instances e.g. when using on an internal development server where multiple web application get built at the same time with different domains.
This allows the hot-proxy to get used in a way more widespread environment since many people are not used to local-machine development environments or restricted by company rules to internal development servers.
2. What does this change do, exactly?
This change fixes multiple things

errors inside the lifecycle of a request are now handled properly instead of crashing the whole hot-proxy
port-binds are now bound to the host which eliminates unforeseen binding behavior (e.g. binding to the default :: host may result in only a IPv6 bind)
the request is now piped to a specific host instead of the internal loopback address, which allows any domain-based routers to work properly (e.g. apache/nginx)
reject requests from the wrong host to prevent domain specific content to be served on another domain

3. Describe each step to reproduce the issue or behaviour.

Accessing the Hot-Proxy won't work when using IPv4 because of the IPv6-only bind

$ lsof -i :9998
COMMAND TYPE NODE NAME
node    IPv6 TCP :9998 (LISTEN)

When able to access the Hot-Proxy the pipe won't work due an error: connect ECONNREFUSED 127.0.0.1:80

4. Please link to the relevant issues (if any).
n/a
5. Checklist

[ ] I have written tests and verified that they fail without my change
[x] I have squashed any insignificant commits
[x] I have created a changelog file with all necessary information about my changes
[ ] I have written or adjusted the documentation according to my changes
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[x] I have read the contribution requirements and fulfil them.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

I have also an internal PR which fixes a similar issue. Maybe this fixes this too? It works also on a single port instead of two
From 343c8056a2db4ee9226c27df73f4356f65196a83 Mon Sep 17 00:00:00 2001
From: Soner Sayakci <s.sayakci@shopware.com>
Date: Mon, 14 Sep 2020 20:49:45 +0200
Subject: [PATCH 1/2] NEXT-10838 - Fix administration login on non localhost
 host

---
 .../app/administration/src/core/service/login.service.js        | 2 +-
 .../Resources/app/administration/webpack.config.js              | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Administration/Resources/app/administration/src/core/service/login.service.js b/src/Administration/Resources/app/administration/src/core/service/login.service.js
index 66c009de25..a2c87e7866 100644
--- a/src/Administration/Resources/app/administration/src/core/service/login.service.js
+++ b/src/Administration/Resources/app/administration/src/core/service/login.service.js
@@ -321,7 +321,7 @@ export default function createLoginService(httpClient, context, bearerAuth = nul
      * @returns {CookieStorage}
      */
     function cookieStorageFactory() {
-        const domain = context.host;
+        const domain = window !== undefined ? window.location.hostname : context.host;
         const path = context.basePath + context.pathInfo;

         // Set default cookie values
diff --git a/src/Administration/Resources/app/administration/webpack.config.js b/src/Administration/Resources/app/administration/webpack.config.js
index 64376d8666..18adddd5c7 100644
--- a/src/Administration/Resources/app/administration/webpack.config.js
+++ b/src/Administration/Resources/app/administration/webpack.config.js
@@ -109,6 +109,7 @@ const webpackConfig = {
                     host: process.env.HOST,
                     port: process.env.PORT,
                     open: true,
+                    disableHostCheck: true,
                     proxy: {
                         '/api': {
                             target: process.env.APP_URL,
--
GitLab

From e983bc223eaed3e60b1421c8933a4fb6e61f1aca Mon Sep 17 00:00:00 2001
From: Soner Sayakci <s.sayakci@shopware.com>
Date: Mon, 14 Sep 2020 21:01:25 +0200
Subject: [PATCH 2/2] NEXT-10838 - Fix hot reload in dockerized environment

---
 ...020-09-14-improve-dev-tooling-for-docker.md | 13 +++++++++++++
 .../storefront/build/proxy-server-hot/index.js | 18 +++++++++++++++---
 .../app/storefront/build/start-hot-reload.js   |  5 +++--
 .../Resources/app/storefront/webpack.config.js | 16 +++++++++++-----
 .../Resources/views/storefront/base.html.twig  | 14 ++++++--------
 5 files changed, 48 insertions(+), 18 deletions(-)
 create mode 100644 changelog/_unreleased/2020-09-14-improve-dev-tooling-for-docker.md

diff --git a/changelog/_unreleased/2020-09-14-improve-dev-tooling-for-docker.md b/changelog/_unreleased/2020-09-14-improve-dev-tooling-for-docker.md
new file mode 100644
index 0000000000..e842dd4de8
--- /dev/null
+++ b/changelog/_unreleased/2020-09-14-improve-dev-tooling-for-docker.md
@@ -0,0 +1,13 @@
+---
+title:              Improve developer tooling with Docker
+issue:              NEXT-10838
+---
+# Administration
+* Changed watcher to allow domains other than `localhost`
+* Disabled host check in webpack dev server
+
+---
+# Storefront
+* Removed port suffix in hot module server when the port is `80` or `443`
+* Changed hot module server to support setups with external ip
+
diff --git a/src/Storefront/Resources/app/storefront/build/proxy-server-hot/index.js b/src/Storefront/Resources/app/storefront/build/proxy-server-hot/index.js
index b8cc097bc8..fa18340456 100644
--- a/src/Storefront/Resources/app/storefront/build/proxy-server-hot/index.js
+++ b/src/Storefront/Resources/app/storefront/build/proxy-server-hot/index.js
@@ -8,13 +8,13 @@ const { createServer, request } = require('http');
 const { spawn } = require('child_process');

 module.exports = function createProxyServer({ appPort, originalHost, proxyHost, proxyPort }) {
-    const proxyUrl = `${proxyHost}:${proxyPort}`;
-
+    const proxyUrl = proxyPort !== 80 && proxyPort !== 443 ? `${proxyHost}:${proxyPort}`: proxyHost;
     const originalUrl = appPort !== 80 && appPort !== 443 ? `${originalHost}:${appPort}` : originalHost;

     // Create the HTTP proxy
     const server = createServer((client_req, client_res) => {
         const requestOptions = {
+            host: originalHost,
             port: appPort,
             path: client_req.url,
             method: client_req.method,
@@ -22,11 +22,23 @@ module.exports = function createProxyServer({ appPort, originalHost, proxyHost,
                 ...client_req.headers,
                 host: originalUrl,
                 'hot-reload-mode': true,
-                'hot-reload-port': process.env.STOREFRONT_ASSETS_PORT || 9999,
                 'accept-encoding': 'identity',
             },
         };

+        // Assets
+        if (client_req.url.indexOf('/_webpack_hot_proxy_/') === 0) {
+            requestOptions.host = '127.0.0.1';
+            requestOptions.port = process.env.STOREFRONT_ASSETS_PORT || 9999;
+            requestOptions.path = requestOptions.path.substr(20);
+        }
+
+        //
+        if (client_req.url.indexOf('/sockjs-node/') === 0 || client_req.url.indexOf('hot-update.json') !== -1 || client_req.url.indexOf('hot-update.js') !== -1) {
+            requestOptions.host = '127.0.0.1';
+            requestOptions.port = process.env.STOREFRONT_ASSETS_PORT || 9999;
+        }
+
         // pipe a new request to the client request
         client_req.pipe(
             // request the data
diff --git a/src/Storefront/Resources/app/storefront/build/start-hot-reload.js b/src/Storefront/Resources/app/storefront/build/start-hot-reload.js
index a7973b6ab2..89e1b8e76d 100644
--- a/src/Storefront/Resources/app/storefront/build/start-hot-reload.js
+++ b/src/Storefront/Resources/app/storefront/build/start-hot-reload.js
@@ -6,6 +6,7 @@ const server = createLiveReloadServer();

 server.then(() => {
     const fullUrl = process.env.APP_URL;
+    const proxyUrl = new URL(process.env.PROXY_URL || process.env.APP_URL);
     const proxyPort = process.env.STOREFRONT_PROXY_PORT;

     // first value of array is the http protocol
@@ -15,8 +16,8 @@ server.then(() => {
     const proxyServerOptions = {
         originalHost: domain,
         appPort: port || 80,
-        proxyHost: domain,
-        proxyPort: proxyPort || 9998,
+        proxyHost: proxyUrl.hostname,
+        proxyPort: parseInt(proxyPort || 9998),
     };

     // starting the proxy server
diff --git a/src/Storefront/Resources/app/storefront/webpack.config.js b/src/Storefront/Resources/app/storefront/webpack.config.js
index 807e0ee410..fc748f1d79 100644
--- a/src/Storefront/Resources/app/storefront/webpack.config.js
+++ b/src/Storefront/Resources/app/storefront/webpack.config.js
@@ -26,10 +26,14 @@ if (isHotMode) {
 }

 let hostName;
+const proxyPort = parseInt(process.env.STOREFRONT_PROXY_PORT || 9998);

 try {
-    const { protocol, hostname } = new URL(process.env.APP_URL);
+    const { protocol, hostname } = new URL(process.env.PROXY_URL || process.env.APP_URL);
     hostName = `${protocol}//${hostname}`;
+    if (proxyPort !== 80 && proxyPort !== 443) {
+        hostName += `:${proxyPort}`;
+    }
 } catch (e) {
     hostName = undefined;
 }
@@ -40,7 +44,8 @@ let webpackConfig = {
         if (isHotMode) {
             return {
                 contentBase: path.resolve(__dirname, 'dist'),
-                publicPath: `${hostName}${isHotMode ? ':9999' : ''}/`,
+                public: hostName,
+                publicPath: `${hostName}/`,
                 open: false,
                 overlay: {
                     warnings: false,
@@ -54,7 +59,7 @@ let webpackConfig = {
                 compress: false,
                 disableHostCheck: true,
                 port: 9999,
-                host: '0.0.0.0',
+                host: '127.0.0.1',
                 clientLogLevel: 'warning',
                 headers: {
                     'Access-Control-Allow-Origin': '*'
@@ -281,7 +286,7 @@ let webpackConfig = {
     output: {
         path: path.resolve(__dirname, 'dist'),
         filename: './js/[name].js',
-        publicPath: `${hostName}${isHotMode ? ':9999' : ''}/`,
+        publicPath: `${hostName}/`,
         chunkFilename: './js/[name].js'
     },
     performance: {
@@ -352,8 +357,9 @@ if (isHotMode) {
     const scssEntryFileContent = (() => {
         const fileComment = '// ATTENTION! This file is auto generated by webpack.hot.config.js and should not be edited.\n\n';
         const dumpedVariablesImport = `@import "${scssDumpedVariables}";\n`;
+        const assetOverrides = '$sw-asset-public-url: \'\';\n$sw-asset-theme-url: \'\';\n$sw-asset-asset-url: \'\';\n$sw-asset-sitemap-url: \'\';\n'

-        const collectedImports = [dumpedVariablesImport, ...themeFiles.style.map((value) => {
+        const collectedImports = [dumpedVariablesImport, assetOverrides, ...themeFiles.style.map((value) => {
             return `@import "${value.filepath}";\n`;
         })];

diff --git a/src/Storefront/Resources/views/storefront/base.html.twig b/src/Storefront/Resources/views/storefront/base.html.twig
index efca5fe006..b16c343485 100644
--- a/src/Storefront/Resources/views/storefront/base.html.twig
+++ b/src/Storefront/Resources/views/storefront/base.html.twig
@@ -1,5 +1,5 @@
 {# Set variable to "true" to enable HMR (hot page reloading) mode #}
-{% set isHMRMode = app.request.headers.get('hot-reload-mode') %}
+{% set isHMRMode = app.request.headers.get('hot-reload-mode') and app.environment == 'dev' %}

 {% block base_doctype %}
 <!DOCTYPE html>
@@ -154,14 +154,12 @@

         {% block base_script_hmr_mode %}
             {% if isHMRMode %}
-                {% set baseUrl = app.request.getScheme() ~ '://' ~ app.request.getHost() %}
-                {% set port = app.request.headers.get('hot-reload-port') %}
-                <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/vendor-node.js"></script>
-                <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/vendor-shared.js"></script>
-                <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/runtime.js"></script>
-                <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/app.js"></script>
+                <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-node.js"></script>
+                <script type="text/javascript" src="/_webpack_hot_proxy_/js/vendor-shared.js"></script>
+                <script type="text/javascript" src="/_webpack_hot_proxy_/js/runtime.js"></script>
+                <script type="text/javascript" src="/_webpack_hot_proxy_/js/app.js"></script>
                 {# The storefront entry is a combined entry point which contains all plugins & themes #}
-                <script type="text/javascript" src="{{ baseUrl }}:{{ port }}/js/storefront.js"></script>
+                <script type="text/javascript" src="/_webpack_hot_proxy_/js/storefront.js"></script>
             {% else %}
                 {% for file in shopware.theme.assets.js %}
                     <script type="text/javascript" src="{{ asset(file, 'theme') }}" async></script>
--
GitLab

@shyim ill try this on Monday, weekend is calling :)

Hey @element-code, could you give me a quick update on monday?

@J-Rahe, as far as I can see the changes that @shyim made are looking fine & work as required by this PR.

HMR watcher triggers on plugin SCCS & JS changes
storefront reloads properly,
The second port 9999 doesn't need to be open to the public anymore 👏

Something with the web sockets is not working as expected, it did not affect the workflow anyways.*

I still would suggest some changes (references to 2. What does this change do, exactly?):

Let the proxy server listen to proxyPort, proxyHost instead of only listening to proxyPort as done in https://github.com/shopware/platform/pull/1642/commits/cfe62765ce0b7532df9f4511c7d7a73cdc7c2f03 (see reason in 2.2.)
Reject hot-proxy request from wrong hosts as done in https://github.com/shopware/platform/pull/1642/commits/c67a63db7b6900084810715dea0da8ea5d2ce4d7 (2.4.)
Handle errors in the server request callback "properly" as done in https://github.com/shopware/platform/pull/1642/commits/9979d02a112788bc1d673e34208bcc51ffe856fa (2.1.)

Hey @element-code ,
My changes are now merged. The first change could be problematic. The current setup uses as proxyHost localhost. This would make the server listing only to 127.0.0.1 and not more accessible from outside the docker container.
I have no idea how to handle that smooth with only one Env. As we have already a env for the port, we could create there a second one for the listen ip.
The both other changes are fine for me.
Thanks for your Contribution! 💙

I've excluded the first change from this PR :)

Can you rebase into one commit?

@shyim I tried, but the merge commit seems to create the conflict again and again.
Please tell me how to handle that.
Right now the history is messed up since that merge commit  contains only the conflict resolution and the main commit contains the real merge changes.. not proud of this :D

Maybe try git reset --soft? that would set you back to the choosen commit with the changes you did in an "to-be-commited"-state.

But there is more.. HTTPS.
I'm not sure about the source, but it seems that Firefox throws an upgrade-insecure-requests header in the request when the domain is known to support HTTPS. This is fine but when connecting to :9998 we get our upgrade as well ... and then we get a SSL_ERROR_RX_RECORD_TOO_LONG error.
The question is, do you see any way to support HTTPS on the hot proxy? -- have each developer change his complete browser behavior to be able to develop shopware project seems not like an option.

introduce two new environment variables for the key file paths
bring self-signed keys with shopware, only for this -> this would allow using HTTPS for the hot proxy in general for all shopware development; after accepting the self-signed cert
any ideas, maybe a much easier way?

Hey @element-code, that does sound more like an problem with the setup to me. If you cant tell your server not to serve https on that port, maybe an TLS termination proxy can help? Having the hot proxy run on an Server is not really that common and adding https to the hot-proxy servers will probably be quite a bit of work.

Yeah, I'm not quite sure how the stack is built and who has control over the upgrade process itself.
The main question is if node is involved in that process.
On the other hand should the hot-proxy support/use HTTPS for security reasons.
Let us move this topic out of this merge request, I'll write an issue for this.

This PR should be ready to merge?

@element-code, if you complete the changelog i can put it in our internal review.
You are missing the mail (you do have an mail from github for the case that you don't want your private mail in the changelog)
and we do have some keywords( Added, Removed, Changed, Deprecated) that have to be used, you can take a look at the /changelog/_example.md if you are unsure.

@element-code?

@J-Rahe done 👍

Hello,
thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-14102
Please use this issue to track the state of your pull request.

authors: CLAassistant J-Rahe element-code shopwareBot shyim

repo: shopware/platform


text:
\Shopware\Core\Framework\App\ActiveAppsLoader should be able to completely bypass database connection for CI e.g. with ComposerPluginLoader

PHP Version
8.1
Shopware Version
6.4.8.1
Expected behaviour
An option to bypass accessing the database, when retrieving active apps inside CI similar to the composer database loader, e.g. for bundle:dump command.
Actual behaviour
It doesn't completely fail but it is first trying to access the database and only then retrieving all apps.
In case the composer plugin loader or the static plugin loader is used, I think the database connection should be bypassed completely and they should always be loaded locally.
How to reproduce
Use ComposerPluginLoader and execute bundle:dump command, it will output Warning: Failed to load apps. Loading apps from local.

I don't see the problem here, it works for CI environments there is a fallback, but certainly apps don't fully work if the database connection can not be established, e.g. there is no distinction between active or inactive apps and the bundle:dump command will include inactive apps, therefore the warning.

it might try to connect to an invalid host and provide an invalid password, in theory it could be used maliciously though unlikely as it usually only happens in the CI and there the host will not exist at all or be under the user's control.
However, it would be easy to check the plugin loader and bypass active check for composerpluginloader or even better add an option that could be changed using dot env files so in test envs it could be disabled.

But I could probably create a PR where I add a Shopware setting or ENV variable for this? for those that don't need it, it would still work fine with a corresponding default value and it would provide an option for those that need/want to use it.

@keulinho I would create a PR for this, if you are fine with it and my intention would be to inject the kernel and check if the pluginloader is not the databaseplugin loader and if it is not, I would return all apps, if you are fine with it?
otherwise, it would be more complicated to get all necessary information that far into the code.

I would not inject the kernel, but in the kernel you could set a container param that indicates which pluginLoader is used and inject that param to the ActiveAppsLoader

@keulinho Just wondering if NEXT-20852 takes care of this? https://github.com/shopware/platform/commit/18ca01899b8938ce406c056af6ebff893546aae2
However, does NEXT-20852 also disable plugins or only apps? and it doesn't take care if it 100% as it disables apps instead of loading all for theme compilation.

NEXT-20852 should take care of this, and yes it prevents all apps from being loaded.
You can't load all apps for theme compilation without a DB connection, because it is not guaranteed that all the apps source files are present.

@keulinho Great. The plugins are still loaded with NEXT-20852, only the apps are skipped if I use DISABLE_EXTENSIONS?

Only "composer plugins" are loaded, meaning those plugins that are required over composer.

@keulinho Great that is exactly what I need. the only thing that should be changed is that instead of using $_SERVER for them to use EnviornmentHelper::getVariable('COMPOSER_PLUGIN_LOADER', false), same for DISABLE_EXTENSIONS inside bin/console and public/index.php to ensure e.g. $_ENV works as well.

@keulinho One thing I noticed, if one uses system:install the plugin loader should not switch to the composer plugin loader as this might fail as various database tables are still missing. this one should always use the file loader.
I can create a separate issue if necessary: https://github.com/shopware/production/blob/6.4/bin/console#L66

Hello,
Within our company roadmap and work capacity, we try to address each bug or improvement request but admit that not each one will be resolved. To continue our culture of honesty and openness, we are closing this issue to focus on our roadmap on behalf of all Shopware users.
If you feel like this issue is still impacting you, please create a new issue and let us know.
Thank you again for your valuable feedback.

authors: AndreasA MarcelSchmaeing keulinho

repo: shopware/shopware


text:
Move NPM Development dependencies to the devDependencies section

1. Why is this change necessary?
To keep the javascript dependencies of the  administration backend ui neat and clean.
2. What does this change do, exactly?
Moving development only dependencies from the general dependencies section.
3. Describe each step to reproduce the issue or behaviour.
4. Please link to the relevant issues (if any).
5. Which documentation changes (if any) need to be made because of this PR?
6. Checklist

[ ] I have written tests and verified that they fail without my change
[ ] I have squashed any insignificant commits
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[x] I have read the contribution requirements and fulfil them.

Hey @snnd thanks for your contribution, I'm taking care of it today. Best regards

merged with 6c668b4aeb3
thanks @snnd :+1: :tada:

authors: klarstil mitelg snnd


text:
fix: Use empty string as default value to prevent passing null to strtolower

1. Why is this change necessary?
Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/http/sw5git/shopware/engine/Shopware/Commands/PluginListCommand.php on line 116

2. What does this change do, exactly?
Use an empty string as default value.
3. Describe each step to reproduce the issue or behaviour.
Use the sw:plugin:list command with php 8.2.
4. Please link to the relevant issues (if any).
-
5. Which documentation changes (if any) need to be made because of this PR?
-
6. Checklist

[ ] I have written tests and verified that they fail without my change
[x] I have squashed any insignificant commits
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[x] I have read the contribution requirements and fulfil them.

Hello,
thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/SW-27052
Please use this issue to track the state of your pull request.

thanks for your contribution @aragon999 👍🎉💙
It was merged on the "next" branch, as we are currently in the release phase of 5.7.17

authors: aragon999 mitelg shopwareBot


text:
NEXT-38705 - Remove redundant slash for products without SEO url in sitemap

1. Why is this change necessary?
When a product does not have a SEO url, it's entry in the sitemap is generated as
https://example.com/detail/{uuid}
2. What does this change do, exactly?
For products without seo url it uses ltrim to remove that leading slash to have the same loc format (without leading slash) for products with and without products
3. Describe each step to reproduce the issue or behavior.
Create product
Clear seo_url in DB
bin/console sitemap:generate
check /sitemap.xml
Look for double slashes
4. Please link to the relevant issues (if any).
https://github.com/shopware/shopware/issues/4963
5. Checklist

[X] I have rebased my changes to remove merge conflicts
[X] I have written tests and verified that they fail without my change
[X] I have created a changelog file with all necessary information about my changes
[ ] I have written or adjusted the documentation according to my changes
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[X] I have read the contribution requirements and fulfill them.

@florianliebig what a coincidence :smile: I submitted a pr only yesterday https://github.com/shopware/shopware/pull/4966 - sorry for not mentioning the issue (in the new github issue format) correctly in my pr (just updated it).
My approach was to fix the double slash in SitemapExporter, to make sure the problem is solved independent of the actual URL provider. The same issue would otherwise also occur e.g. for categories w/o SEO url.

My approach was to fix the double slash in SitemapExporter, to make sure the problem is solved independent of the actual URL provider. The same issue would otherwise also occur e.g. for categories w/o SEO url.
Had exact that approach first :D main reason I switched was because the providers are better test-covered and I am not sure this issue exists for other entity types

closed in favor of https://github.com/shopware/shopware/pull/4966

authors: MalteJanz florianliebig vanWittlaer


text:
docs(troubleshooting): fix copy for native and asset changes

Status
READY
Description

docs(troubleshooting): fix copy for native and asset changes

lgtm. Do we link to this from the shorebird patch cli output?

We link to https://docs.shorebird.dev/troubleshooting#unexpected-native-changes which should still work.

repo: shorebirdtech/docs


text:
Bump up Cassandra request throttling tests threshold

Bumping up due to intermittent failures on the CI, as demonstrated on https://github.com/shotover/shotover-proxy/pull/577

A bit of extra context: We recently bumped the expected count from 25 -> 50, so it makes sense that CI lag spikes would also double so we should double our buffer from 5 -> 10. Hence the resulting 50 + 10 = 60 max value.

authors: conorbros rukai

repo: shotover/shotover-proxy


text:
wrap cassandra_cpp::Session in new CassandraConnection type

This is the first step towards allowing the cassandra integration tests to run against an arbitrary driver.
The CassandraConnection enum will have a variant for every driver that it supports.
Currently CassandraConnection still leaks a lot internals of cassandra_cpp but that will be addressed in future PRs.

Do you want to merge this as is and add cdrs-tokio later?

yep, thats my plan


text:
The converter object is not passed into extensions

I have created a plug-in and, based on some samples I saw on-line, I assumed that the converter object should be passed into the extension.
But this is not the case in the 1.4.3 release. Instead, the window object is passed inside, which makes no sense to me:

Isn't this a bug?

I'm not quite sure what you mean but the converter is getting passed correctly to extensions.
The documentation clearly states that the "converter" object is passed as the second argument to "filter" type extensions.
You can see that behavior in this fiddle
showdown.extension('test', function () {
  return {
    type: 'lang',
    filter: function(text, converter, options) {
      console.log('text', text);
      console.log('converter', converter);
      console.log('options', options);
      return text;
    }
  };
});

new showdown.Converter({extensions: ['test']}).makeHtml('some text');

Hm... That seems like a different method of registering extensions than the one I use (and is better too).
Here is what I use (table is my extension):
   // Define the `table` extension.
  ........................

  // Client-side export
  if (typeof window !== 'undefined' && window.Showdown && window.Showdown.extensions) { window.Showdown.extensions.table = table; }
  // Server-side export
  if (typeof module !== 'undefined') {
    module.exports = table;
  }

I have checked the arguments list and there is only one (the window).
Maybe the extension registration method I use is obsolete?
I found it inside the source code of your repository and I assumed it was OK to use. :(

Oh...
Seems like I was using an old version. :(
I had downloaded the latest and though I was using it, but turns out I wasn't.
I was still referencing the older version.
So many changes in only a few months!?!? :o
Even the case in the showdown global variable has changed! ;O

OK.
I think I have figured things out now...
Sorry for the bugging.

authors: DumboJetEngine tivie

repo: showdownjs/showdown


text:
legacyapi: set_auto_mask, S1 variables don't work

More things that don't work in h5netcdf.legacyapi but do work in netCDF4:
import h5netcdf.legacyapi as netCDF4
# import netCDF4  # works

with netCDF4.Dataset("out.e", "w") as rootgrp:
    rootgrp.createDimension("num_dim", 2)
    rootgrp.createDimension("len_string", 33)
    coor_names = rootgrp.createVariable("coor_names", "S1", ("num_dim", "len_string"))
    coor_names.set_auto_mask(False)  # fails
    coor_names[0, 0] = "X"  # fails
    coor_names[1, 0] = "Y"

AttributeError: NetCDF: attribute Variable not found

TypeError: No conversion path for dtype: dtype('<U1')

The omission of set_auto_mask was intentional: https://github.com/shoyer/h5netcdf#legacy-api
You can assign to character variables, but it appears h5py is stricter about dtypes. Try assigning bytes instead of one character strings.

authors: nschloe shoyer


text:
No iOS statusbar

Hello,
I am very new to iOS- and node development, so it could be a silly thing (my apologies in advance), but.
When I generated the iOS xcode project file and build it as described in the docs the status bar is missing. Well, not really missing. When you open the app the status bar is on the splash screen. It turns from black to white and then disappears in the rest of the app.
I have no idea why this happens. Could be a little bug, could be something I missed. Hope somebody could help me out!
Thanks in advance,
//Sem

It depends on your conf. By default the status bar is hidden.
Try changing your conf
"cordova":
    "statubar":
        "show": true

Hahaha yes! Thank you, I just found out myself. In the docs you said "ALL your config files are in config/" so I looked everywhere. But needed to change this in config.xml in the root directory!

If things are not clear enough, do not hesitate to send me pull requests with documentation addition :)

authors: shprink xvilo

repo: shprink/wordpress-hybrid-client


text:
Demo doesn't work: TypeError: issubclass() arg 1 must be a class

I am getting the following error:
File "pydantic/fields.py", line 638, in pydantic.fields.ModelField._type_analysis
File "/usr/local/lib/python3.10/typing.py", line 1157, in subclasscheck
return issubclass(cls, self.origin)
TypeError: issubclass() arg 1 must be a class.
I'm running the code on "pythonanywhere" with python 3.10.5.
Thanks for the help!
Full traceback below:
raceback (most recent call last):
File "/home/nfriedman/do_code_interpreter.py", line 1, in
from codeinterpreterapi import CodeInterpreterSession
File "/home/nfriedman/.local/lib/python3.10/site-packages/codeinterpreterapi/init.py", line 1, in
from codeinterpreterapi.session import CodeInterpreterSession
File "/home/nfriedman/.local/lib/python3.10/site-packages/codeinterpreterapi/session.py", line 6, in
from langchain.tools import StructuredTool, BaseTool
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/init.py", line 6, in
from langchain.agents import MRKLChain, ReActChain, SelfAskWithSearchChain
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/agents/init.py", line 2, in
from langchain.agents.agent import (
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/agents/agent.py", line 16, in
from langchain.agents.tools import InvalidTool
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/agents/tools.py", line 8, in
from langchain.tools.base import BaseTool, Tool, tool
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/tools/init.py", line 3, in
from langchain.tools.arxiv.tool import ArxivQueryRun
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/tools/arxiv/tool.py", line 12, in
from langchain.utilities.arxiv import ArxivAPIWrapper
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/utilities/init.py", line 3, in
from langchain.utilities.apify import ApifyWrapper
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/utilities/apify.py", line 5, in
from langchain.document_loaders import ApifyDatasetLoader
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/document_loaders/init.py", line 44, in
from langchain.document_loaders.embaas import EmbaasBlobLoader, EmbaasLoader
File "/home/nfriedman/.local/lib/python3.10/site-packages/langchain/document_loaders/embaas.py", line 54, in
class BaseEmbaasLoader(BaseModel):
File "pydantic/main.py", line 204, in pydantic.main.ModelMetaclass.new
File "pydantic/fields.py", line 488, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 419, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 539, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 801, in pydantic.fields.ModelField.populate_validators
File "pydantic/validators.py", line 696, in find_validators
File "pydantic/validators.py", line 585, in pydantic.validators.make_typeddict_validator
File "pydantic/annotated_types.py", line 35, in pydantic.annotated_types.create_model_from_typeddict
File "pydantic/main.py", line 972, in pydantic.main.create_model
File "pydantic/main.py", line 204, in pydantic.main.ModelMetaclass.new
File "pydantic/fields.py", line 488, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 419, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 534, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 638, in pydantic.fields.ModelField._type_analysis
File "/usr/local/lib/python3.10/typing.py", line 1157, in subclasscheck
return issubclass(cls, self.origin)
TypeError: issubclass() arg 1 must be a class

Having the same problem. Runnig code from the jupyter notebook.

The problem in pydantic lib, try change version (for ex. pip install --upgrade pydantic==1.10.12)

authors: IshchenkoRoman hpylieva ndfriedman

repo: shroominic/codeinterpreter-api


text:
[Feature Request] Central point to import jsx components

It would be awesome if Nextra had a central point to import jsx components that may be shared
across all mdx pages so we can use them without importing the components individually in each file.
Here is an example of where this is being used in the next-mdx-remote package

Supported in https://github.com/shuding/nextra/releases/tag/nextra-theme-docs%402.0.0-beta.13

repo: shuding/nextra


text:
[Question] Auto-closed sidebar folders

Is it possible to manually make a folder in the sidebar be automatically closed, if it has many items or something?

Do you mean for all items or just some?
We use autoCollapse to colapse all of the items:
sidebar: {
   defaultMenuCollapseLevel: 1,
   auto collapse: true,
 },

Docs are located at https://nextra.site/docs/docs-theme/theme-configuration#menu-collapse-level.
I don't know how to collapse individual menu items.

Do you mean for all items or just some?
We use autoCollapse to colapse all of the items:
sidebar: {
   defaultMenuCollapseLevel: 1,
   auto collapse: true,
 },

Docs are located at https://nextra.site/docs/docs-theme/theme-configuration#menu-collapse-level.
I don't know how to collapse individual menu items.

I was asking for specific items; not all.

to collapse individual items use in _meta file
theme: {
  collapsed?: boolean
}

@dimaMachina That just makes a new sidebar item.

// _meta.json
{
  "my-folder": {
    "theme": {
      "collapsed": true
    }
  }
}

// _meta.json
{
  "my-folder": {
    "theme": {
      "collapsed": true
    }
  }
}

Thanks, this worked.

authors: dimaMachina kgolubic m1-dev


text:
feat(theme-docs): add ability to add custom links to navbar like project & chat links

Previously you could add only two (project & chat link), you could change the icon & link to use these for completely other links but the internal names always where chat & project link and as said you where hardcoded limited to two links which in my opinion was a bad design decision, maybe there was a reason when it was developed.

Now you can add as many links with icons as you want while still supporting "chat" & "project" in the config for backwards compatibility.
You can now use "links" in the config which is an array of link components with and "link" and an "icon" property.
Internally this array just gets mapped over and renders all link components. To have said backwards compatibility the icon & chat link (if set), just get pushed to the links array.
Maybe there is a better solution than using useEffect to pus project & chat link to the links array as you can see i did in the code.
I tested the functionality, works great.

Would love to see this feature in v3.
Best regards,
Matthias

Technically you can use navbar.extraContent to add more "icon buttons", but its not a clear way when you intend to add more buttons and you have to add the linking functionality yourself.
I just think its easier that if you want to add more buttons you have an config where you can add a button object and it just works.
It's your decision whether you think it improves nextra and is useful or not. For me it is.


text:
hisat2のreportの使い所

hisat2実行時にmappning stats情報がreportされる。これは記録しておくとよい。

reportの内容は何に必要でどこで使われるのでしょうか？
関連したところで

また後述のmultiqcで、さらにまとめたreportを得ることもできる。

multiqcは補足で別途追加予定でしょうか？
以下を参考にしました。
様々なバイオインフォマティクスツールの分析結果を１つに集約して分析できる MultiQC - macでインフォマティクス

これはマッピング率など実験の成否を評価できる数値であるので
と理由を追加。

authors: bigmuramura shujishigenobu

repo: shujishigenobu/omics-collab-cm-nibb


text:
No valid LD matrix files were found at: data/ld/

When I executed
python  viprs/bin/viprs_fit -l data/ld/ -s /path/to/sumstats/  --output-dir /
Code did not execute and said
FileNotFoundError: No valid LD matrix files were found at: data/ld/
python  viprs/bin/viprs_fit -l data/ld/chr_* -s S/X.txt  --output-dir /S
also produced error.
opened viprs/bin/viprs_fit
line 43
change the following.
ld_store_files = get_filenames(args.ld_dir, extension='.zgroup')

ld_store_files = get_filenames(args.ld_dir, extension='.zarray')

opened
site-packages/magenpy/GWADataLoader.py:600:
ld_store_files = get_filenames(ld_store_paths, extension='.zgroup')
ld_store_files = get_filenames(ld_store_paths, extension='.zarray')
but error is the same. The new versions use zarr group rather than zarr array.. when LD matrices are extracted ig contains .zarry
chr_1]$ ls -a
.  ..  0  1  10  11  2  3  4  5  6  7  8  9  .zarray  .zattrs

Which versions of magenpy and viprs are you using in this example?
Also, are those your own LD matrices or the ones that we published on Zenodo?
The published LD matrices on Zenodo only work with magenpy<0.1 (e.g. v0.0.12) and viprs<0.1 (e.g. v 0.0.4). I'm working on getting matrices with the new format published as soon as possible, just finalizing some crucial tests.


text:
finish-callback not triggering digest cycle

This happened to me, in case anyone runs into this issue as well:
I made a change on a $scope attribute/variable inside a function I had placed as the 'finish-callback' of a timer, and yet the changes did not happen to be visible upon the view unless you hover upon a button.
As Topher Fangio put it here: Angular Material App - delayed changes,

Without digging into the timer code too much, I'm guessing that the finish-callback functionality that it provides may be running at the end of the digest loop, or entirely outside of Angular's digest cycle (which is a bit odd since it's an Angular module).

+1

Having this issue as well.  Spent soo many hours on it. :(  Can you please post one of your "ugly hacks".

it depends on what you want to achieve, In my case I needed to hide the timer and display a reveal button on that place. I used id and wrote javascript in controller (Yuk!), that worked for me.
In one place I needed to count down until the timer runs out and once the timer finished I need to start a new timer upwards this got bit challenging, I used $scope.$apply and inside it I added new element to another array and used it to create new timer, to hide the old timer I used javascript again in controller ( I vomit twice :P).

I ended up having to wrap my code in $timeout() to get it to work.

Looking back, cases like this where you need to use $scope.$apply can be dealt with $timeout(), but I think $scope.$evalAsync can also be used to some extent.

authors: djoks prime-ralph shivenigma

repo: siddii/angular-timer


text:
配信用ページのリサイズ機能

表示する画像によってはサイズを調整する必要がある。ウィンドウサイズを一発調整する機能が欲しい。
タブバーがあるとサイズが大きくずれるので、PWA対応とどっちを先にするかは検討

今のところPowertoysのリサイズ機能で事足りているので優先度低めで。

repo: side-beach-city/CastBackground


text:
Removed historie packages and upgraded to RC 13

After removing everything related to historie I recieved the following error:
 ERROR  Cannot find package 'pathe' imported from /Users/zoey/Documents/Development/SideStream/sidebase/sidebase/node_modules/@nuxtjs/tailwindcss/dist/module.mjs                                                         14:42:17

  at new NodeError (node:internal/errors:387:5)
  at packageResolve (node:internal/modules/esm/resolve:951:9)
  at moduleResolve (node:internal/modules/esm/resolve:1000:20)
  at defaultResolve (node:internal/modules/esm/resolve:1214:11)
  at nextResolve (node:internal/modules/esm/loader:165:28)
  at ESMLoader.resolve (node:internal/modules/esm/loader:844:30)
  at ESMLoader.getModuleJob (node:internal/modules/esm/loader:431:18)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
  at link (node:internal/modules/esm/module_job:75:36)

This confuses me a lot, as I do not know why @nuxtjs/tailwindcss would be linked with historie. The exact package that causes this error to be thrown is @historie/plugin-nuxt.

you did also bump the nuxt tailwind module - could this be the cause?
Do you think we can get this merged this week? Would be awesome to be ready for nuxt stable which will release next week Wednesday (:

you did also bump the nuxt tailwind module - could this be the cause?

Yes I have! https://github.com/sidebase/sidebase/blob/dc4f12fbef87f716f45551e3a76c2e74319f3b9c/package.json#L30

Yes I have!

I'm saying that this may be the problem :D I would hnestly only remove histoire packages in this PR + do the nuxt bump and that's it!

I'm saying that this may be the problem :D I would hnestly only remove histoire packages in this PR + do the nuxt bump and that's it!

I reverted the change, however the issue still sadly persists!

I do not know why @nuxtjs/tailwindcss would be linked with historie

It might be that historie or some of its dependencies used pathe package, which is no longer present. Have you tried (as a quick fix) adding pathe to dev dependencies?

It might be that historie or some of its dependencies used pathe package, which is no longer present. Have you tried (as a quick fix) adding pathe to dev dependencies?

adding pathe did fix the issue. However I would like to know:

Do we need to install it seperatly? Why does it not get installed together with tailwindcss?
Why are some tests failing now (backend server tests) even tho I changed nothing about the code there?

Glad it worked

Do we need to install it seperatly? Why does it not get installed together with tailwindcss?

It can be a failure of npm to properly resolve shared dependencies during removal of historie. I would:

Uninstall pathe from dev dependencies
Try to reinstall @nuxt/tailwindcss and tailwindcss as well as the nuxt-parse – all packages that have missing packages as their dependencies

Maybe you can also search for npm-related issues on package removal and available solutions

authors: BracketJohn valiafetisov zoey-kaiser

repo: sidebase/sidebase


text:
Cannot update Account

Hello,
I was trying to update CurrentBalance of Account using this code, but seems not working. I also tried batch_update and Fault object is None, so it means no error, right?:

   if partner_contribution_account:
       partner_contribution_account.CurrentBalance = partner_contribution_account.CurrentBalance + amount
   print(partner_contribution_account.to_json())
   resp = partner_contribution_account.save(qb=client)
   print(resp.to_json())

Here is what print out from these 2 print lines above :

{
"AccountSubType": "PartnerContributions",
"AccountType": "Equity",
"AcctNum": "",
"Active": true,
"CurrencyRef": {
"name": "Canadian Dollar",
"type": "",
"value": "CAD"
},
"CurrentBalance": 10000,
"CurrentBalanceWithSubAccounts": 0,
"Description": "Clearing account for share purchases.",
"FullyQualifiedName": "1664 Simcoe Partner Contributions",
"Id": "64",
"MetaData": {
"CreateTime": "2019-10-22T14:06:16-07:00",
"LastUpdatedTime": "2019-10-22T14:20:08-07:00"
},
"Name": "1664 Simcoe Partner Contributions",
"SubAccount": false,
"SyncToken": "1",
"domain": "QBO",
"sparse": false
}
{
"AccountSubType": "PartnerContributions",
"AccountType": "Equity",
"AcctNum": "",
"Active": true,
"CurrencyRef": {
"name": "Canadian Dollar",
"type": "",
"value": "CAD"
},
"CurrentBalance": 0,
"CurrentBalanceWithSubAccounts": 0,
"Description": "Clearing account for share purchases.",
"FullyQualifiedName": "1664 Simcoe Partner Contributions",
"Id": "64",
"MetaData": {
"CreateTime": "2019-10-22T14:06:16-07:00",
"LastUpdatedTime": "2019-10-22T14:20:08-07:00"
},
"Name": "1664 Simcoe Partner Contributions",
"SubAccount": false,
"SyncToken": "1",
"domain": "QBO",
"sparse": false
}

What is the value of the variable amount, and client? Also, what is the purposebehind creating the 'resp' variable and not just calling 'partner_contribution_account.CurrentBalance'?

@crkacer , CurrentBalance is a read-only field on an account, so you can't update it through the API: https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account
It makes sense that this field is read-only, because the balance on an account is calculated from the transactions in that account.
It would be helpful if QBO returned an error when you try to set this field, but the API will often silently ignore fields instead.

authors: CSviaCPA akaptur crkacer

repo: sidecars/python-quickbooks


text:
Adding support for Travis CI.

With support for Ruby 2.2, and JRuby.
Updated Readme.md with Gem version badge, and Travis build status.

Thanks!

@sidoh I think you'll need to enable Travis CI access in the repository settings.

Hmm, I thought I did. I created the webhook and enabled it within Travis. Is there something else I need to do?

@sidoh Hmn just what's on here https://docs.travis-ci.com/user/getting-started/ As the Travis page says there are no builds for this repository. 😄

Haha. Right. Was thinking that was because there have been not commits since the .travis.yml was added.

Travis only runs a build on the commits you push AFTER adding the repository to Travis.

Think that was it. Made a whitespace change and it triggered a build :)

authors: juliancheal sidoh


text:
Confusing message when setting up the limits in YAML file

Hello again.
So I was setting up a service in my YAML file as follows:
  test:
    image: busybox
    instances:
      bb1:
        ship: boot2docker
        limits:
          memory: 512m
          swap: 256m
          cpu: 1
        command: /bin/sh -c "while true; do echo hello world; sleep 1; done"

and when I started up the service, this is the stack that I see:
#  INSTANCE                                 SERVICE              SHIP                                     CONTAINER                  STATUS
  1. bb1                                      test                 boot2docker                              failed to start container! failed!
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/deployer/__main__.py", line 259, in main
    getattr(d, options.command)(**vars(options))
  File "/usr/lib/python2.7/site-packages/deployer/deployer.py", line 163, in restart
    concurrency, step_delay, stop_start_delay, reuse, **kwargs)
  File "/usr/lib/python2.7/site-packages/maestro/maestro.py", line 364, in restart
    stop_start_delay, reuse, only_if_changed))
  File "/usr/lib/python2.7/site-packages/maestro/maestro.py", line 261, in _audit_play
    exceptions.raise_with_tb()
  File "/usr/lib/python2.7/site-packages/maestro/maestro.py", line 249, in _audit_play
    play.run()
  File "/usr/lib/python2.7/site-packages/maestro/plays/__init__.py", line 146, in run
    self._end()
  File "/usr/lib/python2.7/site-packages/maestro/plays/__init__.py", line 138, in _end
    exceptions.raise_with_tb(self._error)
  File "/usr/lib/python2.7/site-packages/maestro/plays/__init__.py", line 95, in act
    task.run()
  File "/usr/lib/python2.7/site-packages/maestro/plays/tasks.py", line 330, in run
    False, self._reuse).run()
  File "/usr/lib/python2.7/site-packages/maestro/plays/tasks.py", line 130, in run
    result = self._create_and_start_container()
  File "/usr/lib/python2.7/site-packages/maestro/plays/tasks.py", line 201, in _create_and_start_container
    command=self.container.command)
  File "/usr/lib/python2.7/site-packages/docker/client.py", line 463, in create_container
    return self.create_container_from_config(config, name)
  File "/usr/lib/python2.7/site-packages/docker/client.py", line 471, in create_container_from_config
    return self._result(res, True)
  File "/usr/lib/python2.7/site-packages/docker/client.py", line 123, in _result
    self._raise_for_status(response)
  File "/usr/lib/python2.7/site-packages/docker/client.py", line 119, in _raise_for_status
    raise errors.APIError(e, response, explanation=explanation)
APIError: 500 Server Error: Internal Server Error ("Minimum memoryswap limit should be larger than memory limit, see usage.")

Your efforts are much appreciated.

Oops! this was meant for docker github

Thanks!

authors: kkebb mpetazzoni

repo: signalfuse/maestro-ng


text:
Filtering events doesnt work as expected

We Configured otel and pods are runnign fine in clusters
But when we check for logs in splunk for some reason queries are not working as expected
index=test "k8s.cluster.name"="poc2" "k8s.namespace.name"="kube-system" ---returns events
but  when searched with below
index=test  "k8s.namespace.name"="kube-system" --doesn't return anything
same goes with any other fields like k8s.* for filtering like pod name etc
it only works fine with soure or sourcetype as in like below
index=test source="/var/log/pods/kube-system_cluster-autoscaler-797ff5dd***/cluster-autoscaler/0.log"
Unfortunately with source it returns lot more events than any othe rworking query like with clustername and namesapce name so I assume thats indexing the data fine but something is wrong with the fields and filtering the data

I think fields selection is just doing a string match and not matching the fields
As in index=test "k8s.namespace.name"="kube-system" returns something if events has string called kube-system in it

Hi @saiharshitachava you will either need to configure fields.conf for the indexed fields as described here or here, or like we  Splunk Cloud we set a feature called  always_include_indexedfield_lispy
always_include_indexedfield_lispy = <boolean>
* Whether or not search always looks for a field that does not have
  "INDEXED = true" set in fields.conf using both the indexed and non-
  indexed forms.
* If set to "true", when searching for <field>=<value>, the lexicon is
  searched for both "<field>::<value>" and "<value>".
* If set to "false", when searching for <field>=<val>, the lexicon is
  searched only for "<value>".
* Set to "true" if you have fields that are sometimes indexed and
  sometimes not indexed.
* For field names that are always indexed, it is much better
  for performance to set "INDEXED = true" in fields.conf for
  that field instead.
* Default: false

You can also simply search with index field syntax k8s.cluster.name=foo to test and confirm.

authors: matthewmodestino saiharshitachava

repo: signalfx/splunk-otel-collector-chart


text:
Various fixes required for building on OS X

I'm not sure how windows builds will handle the pkg-config stuff, but I'm assuming it's possible to figure out how to install and use pkg-config there for builds after doing a few cursory searches on the subject.

Cheers! Tested on FC20, Ubuntu 12.10.

authors: itdaniher radhermit

repo: signalspec/libsmu


text:
Test failure - thread 'misc::escape' panicked at /usr/src/RPM/BUILD/argc-1.21.1/vendor/insta/src/runtime.rs:680:13:

I try to build argc package for ALT, but there's test failure (for the head of main branch):
01:40:31 + cargo test --release
...
01:41:34      Running `/usr/src/RPM/BUILD/argc-1.21.1/target/release/deps/integration-f7bc15118574750c`
01:41:34
01:41:34 running 205 tests
...
01:41:34 test validate::require_tools ... ok
01:41:34 test spec::arg_eval ... ok
01:41:34 test spec::option_help ... ok
01:41:34 test spec::option_eval ... ok
01:41:34 test spec::arg_subcmd_help ... ok
01:41:36 test cli::parallel ... ok
01:41:36
01:41:36 failures:
01:41:36
01:41:36 ---- misc::escape stdout ----
01:41:36 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
01:41:36 Snapshot file: tests/snapshots/integration__misc__escape.snap
01:41:36 Snapshot: escape
01:41:36 Source: tests/misc.rs:5
01:41:36 ────────────────────────────────────────────────────────────────────────────────
01:41:36 Expression: data
01:41:36 ────────────────────────────────────────────────────────────────────────────────
01:41:36 -old snapshot
01:41:36 +new results
01:41:36 ────────────┬───────────────────────────────────────────────────────────────────
01:41:36    10    10 │ cmd '$foo' '`pwd`' '$(pwd)' ''\''' '\1' '' '
01:41:36    11    11 │ ' 世界 ' '
01:41:36    12    12 │
01:41:36    13    13 │ # BUILD_OUTPUT
01:41:36    14       │-argc__args=([0]="prog" [1]="cmd" [2]="\$foo" [3]="\`pwd\`" [4]="\$(pwd)" [5]="'" [6]="\\1" [7]="" [8]=$'\n' [9]="世界" [10]=" ")
01:41:36          14 │+argc__args=([0]="prog" [1]="cmd" [2]="\$foo" [3]="\`pwd\`" [4]="\$(pwd)" [5]="'" [6]="\\1" [7]="" [8]=$'\n' [9]=$'\344\270\226\347\225\214' [10]=" ")
01:41:36    15    15 │ argc__fn=cmd
01:41:36    16       │-argc__positionals=([0]="\$foo" [1]="\`pwd\`" [2]="\$(pwd)" [3]="'" [4]="\\1" [5]="" [6]=$'\n' [7]="世界" [8]=" ")
01:41:36          16 │+argc__positionals=([0]="\$foo" [1]="\`pwd\`" [2]="\$(pwd)" [3]="'" [4]="\\1" [5]="" [6]=$'\n' [7]=$'\344\270\226\347\225\214' [8]=" ")
01:41:36    17    17 │ cmd $foo `pwd` $(pwd) ' \1
01:41:36    18    18 │  世界
01:41:36 ────────────┴───────────────────────────────────────────────────────────────────
01:41:36 To update snapshots run `cargo insta review`
01:41:36 Stopped on the first failure. Run `cargo insta test` to run all snapshots.
01:41:36 thread 'misc::escape' panicked at /usr/src/RPM/BUILD/argc-1.21.1/vendor/insta/src/runtime.rs:680:13:
01:41:36 snapshot assertion for 'escape' failed in line 5
01:41:36 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
01:41:36
01:41:36
01:41:36 failures:
01:41:36     misc::escape
01:41:36
01:41:36 test result: FAILED. 204 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.05s
01:41:36
01:41:36 error: test failed, to rerun pass `--test integration`
01:41:36 error: Bad exit status from /usr/src/tmp/rpm-tmp.14454 (%check)

The build and tests are run in clean environment.
01:47:07 + locale
01:47:07 LANG=
01:47:07 LC_CTYPE="POSIX"
01:47:07 LC_NUMERIC="POSIX"
01:47:07 LC_TIME="POSIX"
01:47:07 LC_COLLATE="POSIX"
01:47:07 LC_MONETARY="POSIX"
01:47:07 LC_MESSAGES="POSIX"
01:47:07 LC_PAPER="POSIX"
01:47:07 LC_NAME="POSIX"
01:47:07 LC_ADDRESS="POSIX"
01:47:07 LC_TELEPHONE="POSIX"
01:47:07 LC_MEASUREMENT="POSIX"
01:47:07 LC_IDENTIFICATION="POSIX"
01:47:07 LC_ALL=

builder@x86_64:/.in$ cargo -V
cargo 1.82.0 (8f40fc59f 2024-08-21)
builder@x86_64:/.in$ rustc -V
rustc 1.82.0 (f6e511eec 2024-10-15) (built from a source tarball)

@vt-alt
Setting LANG to C.UTF-8 or en_US.UTF-8 should solve the problem.

Yes this helped, thank you!

authors: sigoden vt-alt

repo: sigoden/argc


text:
Release 1.0 planning

The MVP is established now and other projects are leveraging fulcio, so its time to plan for 1.0

[x] #194
[x] #187
[x] #195
[x] #13

cc @cpanato

same from rekor:
I would like to add a cloudbuild + goreleaser when we release Fulcio
then I have some questions:

We will use the same KMS key that we use to sign cosign? or we create another?
To push the data to the Rekor server how can we do that in an automated fashion way? there is any guide? or we just don't do it at this time?

@dlorenc @lukehinds @dekkagaijin

The googlecs stuff needs to move to the 1.0 API

Should probably lock down the configuration prior to 1.0: https://github.com/sigstore/fulcio/issues/304

Not 100% configuration change should be 1.0 blocker. If only because it seems like it might take some time to finish up a refactor. I discussed it a bit here: https://github.com/sigstore/fulcio/issues/304#issuecomment-1019345636

I have been thinking the same. fuclio has been operating in a stable manner for a while now. I will freeze the milestone and we can look at closing the release.
cc @cpanato

if need to change any configuration, maybe we can do that now and make a pre-release with deprecations and then plan the 1.0 removing the deprecations.

@cpanato as I understand, it won't be a change of flags or a non backwards compatible change.
At the moment we have a pattern of folks adding to 1.0, but not able to do the work and so we are seeing 1.0 pushed back and a moving target. For me the most important role of fulcio is the public good instance and what we have at present, which although I am sure can be improved over time, is currently functioning well.

ahh got it, i think i misunderstood :(

Everything here has been completed. Work is tracked here - https://github.com/orgs/sigstore/projects/5/views/1

authors: cpanato haydentherapper jdolitsky lukehinds mattmoor nsmith5

repo: sigstore/fulcio


text:
Update dependencies and fix verify

Update dependencies and resolve issue verifying charts

thank you!

Thankyou @sabre1041 for taking up 'helm-sigstore plugin' issue on priority and raising a PR fix for the same.

@mayurmaru release v0.1.5 contains the fix

authors: cpanato mayurmaru sabre1041

repo: sigstore/helm-sigstore


text:
#223 - hide health endpoint

This change is

Checked it and it successfully hides the endpoint.

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (25b301c) 71.62% compared to head (c2edae5) 71.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #256   +/-   ##
=======================================
  Coverage   71.62%   71.62%
=======================================
  Files         137      137
  Lines        6069     6069
  Branches      966      966
=======================================
  Hits         4347     4347
  Misses       1280     1280
  Partials      442      442

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

repo: sillsdev/serval


text:
Add browserslist data file(s)

Our front-end projects use tools like autoprefixer and Babel to modify CSS/JS to make it compatible with older browsers that we support. These tools rely on data from the browserslist project along with a user-configurable list of supported browsers to determine which prefixes/polyfills/etc to use.
Having a centralized list of supported browsers in the browserslist format would reduce duplication across projects, allow us to more easily update the supported browsers list, and serve as a nice reference.
We can follow the guide for shareable browserslist config in the README to do this.
We should consider having at least two different config files: one for public-facing sites and one for internal sites. Public-facing sites will have a much broader support matrix than internal sites.

@kmuncie could you weigh in (and/or open a PR) on these shareable browserlist files?

Just a note that we may not be able to fully follow the guide for shareable browserslist config files that I linked to in the comment above because it would require publishing a package with the browserslist-config- prefix, and I think we'd prefer just to keep the files in this repo with our other standardized config. I don't see a reason we couldn't either symlink to it or require it in like we do with our other config files.

Addressed in #35

repo: silvermine/standardization


text:
DEP 4 branch dev requirements

Issue https://github.com/silverstripeltd/product-issues/issues/531
This PR's a bit different from the other recipe pull-requests that it targets the next-minor branch, rather than the current-minor
Looks like what happened is this wasn't merged up correctly during the 4.10 CMS release, so this is fixing that.

Nope, it's a loose caret requirement so it'll just grab a stable version.  We only need to upgrade references to branches.

repo: silverstripe/recipe-solr-search


text:
ENH: limit max length of success message to improve legibility

Description
When you save a record and the title or type of the record is really long then you can not read it in the "success" message.
https://github.com/silverstripe/silverstripe-framework/blob/5/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php#L569-L570
I would propose that we limit the length to say 40 chars per item so that it is legible and does not look weird.
Additional context or points of discussion
No response
Validations

[X] You intend to implement the feature yourself
[X] You have read the contributing guide
[X] You strongly believe this feature should be in core, rather than being its own community module
[X] You have checked for existing issues or pull requests related to this feature (and didn't find any)

Sounds sensible. Probably should be handled with css via text-overflow: ellipsis; rather than php.
Thanks for raising this, I'm looking forward to the PR 👍

authors: GuySartorelli sunnysideup

repo: silverstripe/silverstripe-framework


text:
4.0: build tasks not protected

In 3.0 BuilldTasks were only accessible by ADMINS.  In 4.0 these tasks are not protected (in test / dev - they are protected in LIVE).  From the three tasks listed in framework, one of them is protected:
https://github.com/silverstripe/silverstripe-framework/blob/4/src/Dev/Tasks/CleanupTestDatabasesTask.php#L24-L32
The other ones are not protected:
https://github.com/silverstripe/silverstripe-framework/blob/4/src/Dev/Tasks/MigrateFileTask.php#L22-L30
Should buildtasks contain some code like this:
        if (!Permission::check('ADMIN') && !Director::is_cli()) {
            $response = Security::permissionFailure();
            if ($response) {
                $response->output();
            }
            die;
        }

if so, then why not add this to the BuildTask class itself? It would be good to make this easier to understand so that you can build buildtasks with confidence ;-)

Assuming that tasks are only accessible through TaskRunner, I don't see any changes between 3.x and 4.x there. The new allow_all_cli flag replaces the messy "tests running" check, but that shouldn't change the underlying behaviour in the way that you describe.
I think the protection in CleanupTestDatabasesTask is a duplicate to TaskRunner which already enforces that.
https://github.com/silverstripe/silverstripe-framework/blob/3/dev/TaskRunner.php#L18
https://github.com/silverstripe/silverstripe-framework/blob/4/src/Dev/TaskRunner.php#L28
I've also verified that I can run a dev/build in dev and test mode without logging in as ADMIN on 3.x.

OK - great.  Thank you for checking Ingo.  I will update ticket.

Summary: remove the double-up security here:
https://github.com/silverstripe/silverstripe-framework/blob/4/src/Dev/Tasks/CleanupTestDatabasesTask.php#L24-L32 - see above for details.

Closing, but happy to review a PR from @sunnysideup

authors: chillu sunnysideup


text:
Password should be required when changing email address

Affected Version
All
Description
Currently a user must enter their existing password to change their password. You do not need to enter your password to change your email address. This is a bit of an issue because someone can now alter a password by changing the email address and using the "forgot password" functionality
Steps to Reproduce

Login to the CMS
Change the email address
Observe you don't have to enter your password to change your email address

Notes
This is related to the idea of #8595 . GitHub has this as one of the actions that can only be done while you're in this heightened state of trust - and I think it makes good sense.
I've formatted this like a bug report but I'm happy to accept that it's an enhancement (and have left the triaging for someone else because I'm indifferent)

I think it'd be an enhancement too.
We should provide extension points so that something like an MFA module might be able to let you "press your security key" instead of entering your password too.

authors: ScopeyNZ robbieaverill


text:
i18n::default_locale should return the value set via config.

Deprecate default_locale setter and getter methods, analoguous to other config getters and setters.
Fixes #4920.

Perfect.

authors: bummzack tractorcow


text:
NEW: Make DataList::getIterator a generator

Huge hat tip to @SilbinaryWolf for suggesting this.

Currently, DataList::getIterator() wraps the result of DataList::toArray() in an ArrayIterator. DataList::toArray() will load every single row in the result into memory at once, creating a DataObject instance for each of them.
After this change, only the current row will be loaded into a DataObject and then discarded before the next one is loaded.
Crudely written benchmarks below:
Small collections
No discernible difference in CPU or memory.
$pages = Page::get()->limit(20);
$count = 0;
foreach ($pages as $page) {
	$count++;
}
echo $count;

Large collections
Significant memory saving, some CPU sacrificed.
$pages = Page::get()->limit(2000);
$count = 0;
foreach ($pages as $page) {
	$count++;
}
echo $count;

Happy to do some more benchmarks if anyone has anything they’d like to see

The increase in CPU is the result of a lot of calls to Query::seek() (one for each row), which in turn will act on the query result object to seek to the given row. That can be avoided by immediately loading all of the database rows in DataListIterator::__construct(), but still “lazily” constructing the DataObject instances, but that approach wipes out a significant amount of the memory saving.

Current blockers:

SQLite3 (non-PDO) CPU usage skyrockets. There’s no SQLite3Result::seek(), so it currently just loops every row until it reaches the given offset. If there are 2000 rows, it has too loop over 1 row, then 2, then 3, all the way up to 2000 when we try to seek the last row. One possible solution would be to fetch and store every row once, then seek(), numRecords() etc could inspect that array. Downside: memory savings are all but gone, as every row now sits in memory. SQLite3 in PDO mode is unaffected by this.
MSSQL module is currently unable to seek in non-PDO mode. Looking at the PHP docs for sqlsrv_fetch_array, we should be able to implement that ability... I just don’t currently have an environment to test this

I’ve tentatively pushed a third commit with some changes to PDOQuery that stops it from loading every result immediately, and instead allows it to seek through rows in the same way that other drivers do. Compared to the original benchmarks above, it saves an additional 4mb of peak memory usage.

I can only say how awesome this is.
I reckon the reason we don't see any memory gains on few records (~20) is because the garbage collector isn't being triggered.

Perhaps DataList::getIterator() could simply be a generator?
function getIterator() {
  foreach($this->dataQuery as $row) {
    yield $this->createDataObject($row);
  }
}

It's possible that this will remove the use of rewind(); if not and we've still got issues with SQLite and MSSQL I'd suggest coding this in a way where the original behaviour is used for those databases.

Note: generators are awesome and much of the ORM could be rewritten to use them, now that we're 5.5+.

What an awesome idea! Look at that, 3 lines of code changed and a ~30% memory saving. ❤
I’ve tested again on MySQL, MySQL+PDO, SQLite3, SQLite3+PDO and PostgreSQL, and performance is consistent across all of them.

Generators. Love 'em!

Adding a precautionary “DO NOT MERGE”. Travis is building against the wrong commit for some reason, there are plenty of failures.

I've cherry-picked this into #6518, so I can close this PR.

authors: dhensby kinglozzer sminnee


text:
Custom scroll theme

I use very nice scrolling plugin "mCustomScrollbar" https://github.com/malihu/malihu-custom-scrollbar-plugin
How I can to join "bootstrap-select" plugin:

You'll probably have to modify the source code a bit (the createDropdown function). You might want to check on StackOverflow.

repo: silviomoreto/bootstrap-select


text:
Bootstrap select handle huge entries

Hello Experts,
I am using bootstrap-select (Version 1.12.2) in my JSP page and the requirement is to load  ~100000 entries in the dropdown dynamically using ajax javascript calls  (And I have 5 to 6 such dropdowns on the same page). I understand that if we load such huge data the browser becomes unresponsive and breaks and I also went through eariler issues reported for this #1229 . Is there a way to achieve this functionality using latest version?
Any other alternative suggestions are also welcome :)
TIA

Using the latest version should solve this problem. The latest version is available here: https://github.com/snapappointments/bootstrap-select. Development has moved there.

authors: KarthikKasiram caseyjhol


text:
not been set error

hello thanks for the bot but i got this error:
BOOKING_URL or CHECK_INTERVAL_MINUTES have not been set. Please set values in .env according to README.
do you know how can I fix it? :)

Check out the readme, you need to set these config values up in an .env file.

authors: incendies similicious

repo: similicious/berlin-buergeramt-bot


text:
THROWAWAY change

mypy: passed
black: passed

This was a throwaway, and it is time to throw it away. Goodbye.

repo: simiotics/locust