mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-30 21:21:42 +00:00
Compare commits
6 commits
5c7bf673ee
...
0095cbdc05
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0095cbdc05 | ||
|
|
a0435a56bd | ||
|
|
3de2c91d93 | ||
|
|
9d438d7d97 | ||
|
|
bca8291229 | ||
|
|
3998248905 |
16 changed files with 218 additions and 21 deletions
1
.env
1
.env
|
|
@ -8,6 +8,7 @@ APP_SECRET=a03498528f5a5fc089273ec9ae5b2849
|
|||
# Change this and uncomment the following line to set the trusted hosts for your Part-DB installation, aka under which
|
||||
# domain names it is reachable. This is makes things more secure, because it can prevent certain header attacks.
|
||||
# You have to escape dots in the domain name with a backslash
|
||||
# IMPORTANT: In .env files (like this one), the value must be wrapped in single quotes as shown below.
|
||||
#TRUSTED_HOSTS='^(your-domain\.invalid)$'
|
||||
|
||||
# You can also allow multiple domain names, e.g. for testing or development purposes, with an | between the domain names.
|
||||
|
|
|
|||
2
.github/workflows/assets_artifact_build.yml
vendored
2
.github/workflows/assets_artifact_build.yml
vendored
|
|
@ -65,7 +65,7 @@ jobs:
|
|||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
|
|
|
|||
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
|
@ -104,7 +104,7 @@ jobs:
|
|||
run: composer install --prefer-dist --no-progress
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
|
|
|
|||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
2.13.3
|
||||
2.13.4
|
||||
|
|
|
|||
|
|
@ -265,10 +265,16 @@ See the [information providers]({% link usage/information_provider_system.md %})
|
|||
should be accessible. If accessed via a hostname not matching the regex, an error page will be shown instead. By default this
|
||||
is empty, meaning Part-DB accepts requests for any host name, which is not recommended for production use.
|
||||
|
||||
For example, if Part-DB should only be reachable under `part-db.example.invalid`, set:
|
||||
For example, if Part-DB should only be reachable under `part-db.example.invalid`, set the following in your
|
||||
`.env.local` file (the value must be wrapped in single quotes here):
|
||||
```
|
||||
TRUSTED_HOSTS='^(part-db\.example\.invalid)$'
|
||||
```
|
||||
If you set `TRUSTED_HOSTS` as an environment variable in your `docker-compose.yaml` instead, the value must
|
||||
**not** be quoted:
|
||||
```
|
||||
TRUSTED_HOSTS=^(part-db\.example\.invalid)$
|
||||
```
|
||||
You can specify multiple host names separated by `|`, e.g. `^(localhost|part-db\.example\.invalid)$`.
|
||||
Part-DB displays a warning on the homepage (visible to administrators only) as long as this value is not set.
|
||||
* `DEMO_MODE` (env only): Set Part-DB into demo mode, which forbids users to change their passwords and settings. Used for the demo
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ services:
|
|||
|
||||
# To prevent HTTP Host header attacks, set this to a regex matching all host names Part-DB should be reachable under.
|
||||
# By default (unset) Part-DB accepts requests for any host name, which is not recommended for production use.
|
||||
# IMPORTANT: Unlike in .env files, the value here must NOT be wrapped in quotes.
|
||||
# - TRUSTED_HOSTS=^(part-db\.example\.invalid)$
|
||||
|
||||
# If you need to install additional composer packages (e.g., for specific mailer transports), you can specify them here:
|
||||
|
|
@ -101,7 +102,8 @@ services:
|
|||
openssl rand -hex 32
|
||||
```
|
||||
6. Uncomment and set the `TRUSTED_HOSTS` variable to a regex matching the host name(s) Part-DB should be reachable under
|
||||
(e.g. `^(part-db\.example\.invalid)$`), to prevent HTTP Host header attacks. See [Configuration]({% link configuration.md %})
|
||||
(e.g. `^(part-db\.example\.invalid)$`), to prevent HTTP Host header attacks. Note that, unlike in `.env` files, the
|
||||
value must **not** be quoted in `docker-compose.yaml`. See [Configuration]({% link configuration.md %})
|
||||
for more information.
|
||||
7. Inside the folder, run
|
||||
|
||||
|
|
@ -181,6 +183,7 @@ services:
|
|||
|
||||
# To prevent HTTP Host header attacks, set this to a regex matching all host names Part-DB should be reachable under.
|
||||
# By default (unset) Part-DB accepts requests for any host name, which is not recommended for production use.
|
||||
# IMPORTANT: Unlike in .env files, the value here must NOT be wrapped in quotes.
|
||||
# - TRUSTED_HOSTS=^(part-db\.example\.invalid)$
|
||||
|
||||
# If you need to install additional composer packages (e.g., for specific mailer transports), you can specify them here:
|
||||
|
|
|
|||
|
|
@ -24,12 +24,18 @@ the reverse proxy).
|
|||
|
||||
You should also set the `TRUSTED_HOSTS` environment variable to a regex matching the host name(s) Part-DB is reachable
|
||||
under via the reverse proxy, to prevent `HTTP Host header attacks`. For example, if Part-DB is reachable via
|
||||
`part-db.example.invalid`, set:
|
||||
`part-db.example.invalid`, set the following in your `.env.local` file (the value must be wrapped in single quotes here):
|
||||
|
||||
```
|
||||
TRUSTED_HOSTS='^(part-db\.example\.invalid)$'
|
||||
```
|
||||
|
||||
If you set `TRUSTED_HOSTS` in your `docker-compose.yaml` instead, the value must **not** be quoted:
|
||||
|
||||
```
|
||||
TRUSTED_HOSTS=^(part-db\.example\.invalid)$
|
||||
```
|
||||
|
||||
See the [configuration options](../configuration.md) page for more information about `TRUSTED_HOSTS`.
|
||||
|
||||
## Part-DB in a subpath via reverse proxy
|
||||
|
|
|
|||
|
|
@ -109,6 +109,21 @@ supplier is not specified, the price and supplier product number fields will be
|
|||
* **`supplier_product_number`** or **`supplier_part_number`** or * **`spn`**: The supplier product number of the part.
|
||||
* **`price`**: The price of the part in the base currency of the database (by default euro).
|
||||
|
||||
The following fields set the EDA / KiCad metadata of the part (see [EDA / KiCad integration](eda_integration.md)).
|
||||
These can be given either as the flat column names below, or in the nested `eda_info.*` form used by the
|
||||
CSV/JSON export and the [example file](#example-data) (e.g. `eda_info.kicad_symbol`), so a file exported from
|
||||
Part-DB can be re-imported without renaming its headers:
|
||||
|
||||
* **`eda_kicad_symbol`** or **`kicad_symbol`**: The KiCad symbol of the part, e.g. `Device:R`.
|
||||
* **`eda_kicad_footprint`** or **`kicad_footprint`**: The KiCad footprint, e.g. `Resistor_SMD:R_0805_2012Metric`.
|
||||
* **`eda_reference_prefix`** or **`kicad_reference`**: The schematic reference prefix, e.g. `R`, `C`, `L`.
|
||||
* **`eda_value`** or **`kicad_value`**: The value shown in the EDA tool, e.g. `10k`.
|
||||
* **`eda_exclude_from_bom`** (or **`eda_exclude_bom`**), **`eda_exclude_from_board`** (or **`eda_exclude_board`**),
|
||||
**`eda_exclude_from_sim`** (or **`eda_exclude_sim`**): Booleans (`1`/`0`) to exclude the part from the BOM, board
|
||||
or simulation.
|
||||
* **`eda_visibility`**: Boolean (`1`/`0`) controlling whether the part is exposed to the EDA tool. The inverse
|
||||
convenience alias **`eda_invisible`** is also accepted (so `eda_invisible=1` hides the part).
|
||||
|
||||
#### Example data
|
||||
|
||||
Here you can find some example data for the import of parts, you can use it as a template for your own import (
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Generated on Mon Jul 13 05:43:59 UTC 2026
|
||||
# Generated on Mon Jul 27 05:55:56 UTC 2026
|
||||
# This file contains all footprints available in the offical KiCAD library
|
||||
Audio_Module:Reverb_BTDR-1H
|
||||
Audio_Module:Reverb_BTDR-1V
|
||||
|
|
@ -7732,6 +7732,15 @@ Connector_TE-Connectivity:TE_Micro-MaTch_2-215079-0_2x10_P1.27mm_Vertical
|
|||
Connector_TE-Connectivity:TE_Micro-MaTch_215079-4_2x02_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_215079-6_2x03_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_215079-8_2x04_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_7-188275-4_2x02_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_7-188275-6_2x03_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_7-188275-8_2x04_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-0_2x05_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-2_2x06_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-4_2x07_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-6_2x08_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_8-188275-8_2x09_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_Micro-MaTch_9-188275-0_2x10_P1.27mm_Vertical
|
||||
Connector_TE-Connectivity:TE_T4041037031-000_M8_03_Socket_Straight
|
||||
Connector_TE-Connectivity:TE_T4041037041-000_M8_04_Socket_Straight
|
||||
Connector_USB:USB3_A_Molex_48393-001
|
||||
|
|
@ -9150,6 +9159,7 @@ Inductor_SMD:L_APV_APH1770
|
|||
Inductor_SMD:L_APV_APH2213
|
||||
Inductor_SMD:L_AVX_LMLP07A7
|
||||
Inductor_SMD:L_Abracon_ASPI-0425
|
||||
Inductor_SMD:L_Abracon_ASPI-0628
|
||||
Inductor_SMD:L_Abracon_ASPI-0630LR
|
||||
Inductor_SMD:L_Abracon_ASPI-3012S
|
||||
Inductor_SMD:L_Abracon_ASPI-4030S
|
||||
|
|
@ -12565,6 +12575,8 @@ Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm
|
|||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.46x2.31mm_ThermalVias
|
||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm
|
||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.66x2.46mm_ThermalVias
|
||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.78x3.37mm
|
||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.78x3.37mm_ThermalVias
|
||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3x3mm_ThermalVias
|
||||
Package_SO:HTSSOP-16-1EP_4.4x5mm_P0.65mm_EP3x3mm
|
||||
Package_SO:HTSSOP-20-1EP_4.4x6.5mm_P0.65mm_EP2.74x3.86mm
|
||||
|
|
@ -12919,6 +12931,8 @@ Package_SO:Texas_DYY0016A_TSOT-23-16_2x4.2mm_P0.5mm
|
|||
Package_SO:Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm
|
||||
Package_SO:Texas_HSOP-8-1EP_3.9x4.9mm_P1.27mm_ThermalVias
|
||||
Package_SO:Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias
|
||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.94x3.34mm
|
||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask2.94x3.34mm_ThermalVias
|
||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm
|
||||
Package_SO:Texas_HTSSOP-14-1EP_4.4x5mm_P0.65mm_EP3.4x5mm_Mask3.155x3.255mm_ThermalVias
|
||||
Package_SO:Texas_PW0020A_TSSOP-20_4.4x6.5mm_P0.65mm
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Generated on Mon Jul 13 05:44:30 UTC 2026
|
||||
# Generated on Mon Jul 27 05:56:38 UTC 2026
|
||||
# This file contains all symbols available in the offical KiCAD library
|
||||
4xxx:14528
|
||||
4xxx:14529
|
||||
|
|
@ -951,6 +951,8 @@ Amplifier_Current:INA201D
|
|||
Amplifier_Current:INA201DGK
|
||||
Amplifier_Current:INA202D
|
||||
Amplifier_Current:INA202DGK
|
||||
Amplifier_Current:INA2180AxxDGK
|
||||
Amplifier_Current:INA2180AxxDSG
|
||||
Amplifier_Current:INA225
|
||||
Amplifier_Current:INA240A1D
|
||||
Amplifier_Current:INA240A1PW
|
||||
|
|
@ -5356,6 +5358,18 @@ Converter_DCDC_Isolated:THN10-7215UIR
|
|||
Converter_DCDC_Isolated:THN10-7221UIR
|
||||
Converter_DCDC_Isolated:THN10-7222UIR
|
||||
Converter_DCDC_Isolated:THN10-7223UIR
|
||||
Converter_DCDC_Isolated:THN15-3611UIR
|
||||
Converter_DCDC_Isolated:THN15-3612UIR
|
||||
Converter_DCDC_Isolated:THN15-3613UIR
|
||||
Converter_DCDC_Isolated:THN15-3615UIR
|
||||
Converter_DCDC_Isolated:THN15-3622UIR
|
||||
Converter_DCDC_Isolated:THN15-3623UIR
|
||||
Converter_DCDC_Isolated:THN15-7211UIR
|
||||
Converter_DCDC_Isolated:THN15-7212UIR
|
||||
Converter_DCDC_Isolated:THN15-7213UIR
|
||||
Converter_DCDC_Isolated:THN15-7215UIR
|
||||
Converter_DCDC_Isolated:THN15-7222UIR
|
||||
Converter_DCDC_Isolated:THN15-7223UIR
|
||||
Converter_DCDC_Isolated:THR40-7211WI
|
||||
Converter_DCDC_Isolated:THR40-7212WI
|
||||
Converter_DCDC_Isolated:THR40-7213WI
|
||||
|
|
@ -5494,6 +5508,24 @@ Converter_DCDC_Isolated:TMR4-4813WI
|
|||
Converter_DCDC_Isolated:TMR4-4815WI
|
||||
Converter_DCDC_Isolated:TMR4-4822WI
|
||||
Converter_DCDC_Isolated:TMR4-4823WI
|
||||
Converter_DCDC_Isolated:TMR8-1211WI
|
||||
Converter_DCDC_Isolated:TMR8-1212WI
|
||||
Converter_DCDC_Isolated:TMR8-1213WI
|
||||
Converter_DCDC_Isolated:TMR8-1215WI
|
||||
Converter_DCDC_Isolated:TMR8-1222WI
|
||||
Converter_DCDC_Isolated:TMR8-1223WI
|
||||
Converter_DCDC_Isolated:TMR8-2411WI
|
||||
Converter_DCDC_Isolated:TMR8-2412WI
|
||||
Converter_DCDC_Isolated:TMR8-2413WI
|
||||
Converter_DCDC_Isolated:TMR8-2415WI
|
||||
Converter_DCDC_Isolated:TMR8-2422WI
|
||||
Converter_DCDC_Isolated:TMR8-2423WI
|
||||
Converter_DCDC_Isolated:TMR8-4811WI
|
||||
Converter_DCDC_Isolated:TMR8-4812WI
|
||||
Converter_DCDC_Isolated:TMR8-4813WI
|
||||
Converter_DCDC_Isolated:TMR8-4815WI
|
||||
Converter_DCDC_Isolated:TMR8-4822WI
|
||||
Converter_DCDC_Isolated:TMR8-4823WI
|
||||
Converter_DCDC_Isolated:TMR_1-0511
|
||||
Converter_DCDC_Isolated:TMR_1-0511SM
|
||||
Converter_DCDC_Isolated:TMR_1-0512
|
||||
|
|
@ -7680,6 +7712,7 @@ Driver_LED:IS31FL3218-GR
|
|||
Driver_LED:IS31FL3218-QF
|
||||
Driver_LED:IS31FL3236-TQ
|
||||
Driver_LED:IS31FL3236A-TQ
|
||||
Driver_LED:IS31FL3242
|
||||
Driver_LED:IS31FL3731-QF
|
||||
Driver_LED:IS31FL3731-SA
|
||||
Driver_LED:IS31FL3733-QF
|
||||
|
|
@ -8271,6 +8304,10 @@ Filter:MAX7422xUA
|
|||
Filter:MAX7423xUA
|
||||
Filter:MAX7424xUA
|
||||
Filter:MAX7425xUA
|
||||
Filter:MAX7426xPA
|
||||
Filter:MAX7426xUA
|
||||
Filter:MAX7427xPA
|
||||
Filter:MAX7427xUA
|
||||
Filter:MAX7480xPA
|
||||
Filter:MAX7480xSA
|
||||
Filter:P300PL104M275xC222
|
||||
|
|
@ -9659,8 +9696,9 @@ Logic_Programmable:PAL20L10xxNS
|
|||
Logic_Programmable:PAL20L8
|
||||
Logic_Programmable:PAL20R8xx-P
|
||||
Logic_Programmable:PAL20RS10
|
||||
Logic_Programmable:PAL24
|
||||
Logic_Programmable:PAL22V10-xxP
|
||||
Logic_Programmable:PALCE16V8
|
||||
Logic_Programmable:PALCE22V10x-xxP
|
||||
Logic_Programmable:PEEL22CV10AP
|
||||
Logic_Programmable:PEEL22CV10AS
|
||||
MCU_AnalogDevices:ADUC816BSZ
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Norm
|
|||
'eda_exclude_bom' => 'eda_exclude_from_bom',
|
||||
'eda_exclude_board' => 'eda_exclude_from_board',
|
||||
'eda_exclude_sim' => 'eda_exclude_from_sim',
|
||||
'eda_invisible' => 'eda_visibility',
|
||||
//NOTE: "eda_invisible" is intentionally NOT mapped here: it is the *inverse* of
|
||||
//"eda_visibility", so a plain key rename would store the wrong value. It is handled
|
||||
//(and inverted) explicitly in applyEdaFields().
|
||||
];
|
||||
|
||||
public function __construct(
|
||||
|
|
@ -235,6 +237,9 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Norm
|
|||
}
|
||||
if (isset($data['eda_visibility']) && $data['eda_visibility'] !== '') {
|
||||
$edaInfo->setVisibility(filter_var($data['eda_visibility'], FILTER_VALIDATE_BOOLEAN));
|
||||
} elseif (isset($data['eda_invisible']) && $data['eda_invisible'] !== '') {
|
||||
//"eda_invisible" is the inverse convenience alias of "eda_visibility"
|
||||
$edaInfo->setVisibility(!filter_var($data['eda_invisible'], FILTER_VALIDATE_BOOLEAN));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,16 @@
|
|||
<p>Try following things:</p>
|
||||
<ul>
|
||||
<li>Ensure that you are using the correct URL to access Part-DB.</li>
|
||||
<li>Set the <code>TRUSTED_HOSTS</code> environment variable in your <code>.env.local</code> file (or your docker-compose environment) to a regular expression matching all host names Part-DB should be reachable under, e.g.
|
||||
{% if seen_host %}
|
||||
<code>TRUSTED_HOSTS='^({{ seen_host|replace({'.': '\\.'}) }})$'</code> (if <code>{{ seen_host }}</code> is a host name you trust)
|
||||
{% else %}
|
||||
<code>TRUSTED_HOSTS='^(localhost|example\.com)$'</code>
|
||||
{% endif %}
|
||||
<li>Set the <code>TRUSTED_HOSTS</code> environment variable to a regular expression matching all host names Part-DB should be reachable under. Note that the required quoting differs depending on where you set it:
|
||||
<ul>
|
||||
{% if seen_host %}
|
||||
<li>In your <code>.env.local</code> file, the value must be wrapped in single quotes: <code>TRUSTED_HOSTS='^({{ seen_host|replace({'.': '\\.'}) }})$'</code> (if <code>{{ seen_host }}</code> is a host name you trust)</li>
|
||||
<li>In <code>docker-compose.yaml</code>, the value must NOT be quoted: <code>TRUSTED_HOSTS=^({{ seen_host|replace({'.': '\\.'}) }})$</code> (if <code>{{ seen_host }}</code> is a host name you trust)</li>
|
||||
{% else %}
|
||||
<li>In your <code>.env.local</code> file, the value must be wrapped in single quotes: <code>TRUSTED_HOSTS='^(localhost|example\.com)$'</code></li>
|
||||
<li>In <code>docker-compose.yaml</code>, the value must NOT be quoted: <code>TRUSTED_HOSTS=^(localhost|example\.com)$</code></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</li>
|
||||
<li>If Part-DB is running behind a reverse proxy, also make sure that <code>TRUSTED_PROXIES</code> is configured correctly, so the original host name is forwarded properly.</li>
|
||||
<li>Run <kbd>php bin/console cache:clear</kbd> after changing the configuration.</li>
|
||||
|
|
|
|||
|
|
@ -98,9 +98,12 @@
|
|||
{% if trusted_hosts_unconfigured and is_granted('@system.server_infos') %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<h5><i class="fa-solid fa-triangle-exclamation fa-fw"></i> {% trans %}system.trusted_hosts.unconfigured.title{% endtrans %}</h5>
|
||||
<p class="mb-1">{% trans %}system.trusted_hosts.unconfigured.message{% endtrans %}</p>
|
||||
<p class="mb-0">{% trans %}system.trusted_hosts.unconfigured.suggestion{% endtrans %}
|
||||
<br><code>TRUSTED_HOSTS='^({{ app.request.host|replace({'.': '\\.'}) }})$'</code></p>
|
||||
<p class="mb-1">{% trans %}system.trusted_hosts.unconfigured.message{% endtrans %}
|
||||
{% trans %}system.trusted_hosts.unconfigured.suggestion{% endtrans %}</p>
|
||||
<p class="mb-0">{% trans %}system.trusted_hosts.unconfigured.env_example{% endtrans %}
|
||||
<code>TRUSTED_HOSTS='^({{ app.request.host|replace({'.': '\\.'}) }})$'</code></p>
|
||||
<p class="mb-0">{% trans %}system.trusted_hosts.unconfigured.docker_example{% endtrans %}
|
||||
<code>TRUSTED_HOSTS=^({{ app.request.host|replace({'.': '\\.'}) }})$</code></p>
|
||||
<small>{% trans %}update_manager.new_version_available.only_administrators_can_see{% endtrans %}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -350,6 +350,84 @@ EOT;
|
|||
$this->assertSame('test,test2', $results[0]->getTags());
|
||||
}
|
||||
|
||||
public function testImportAcceptsNestedEdaInfoColumns(): void
|
||||
{
|
||||
//The API / JSON export writes EDA columns as "eda_info.kicad_symbol"; re-importing such a
|
||||
//file must fill the EDA fields (previously these columns were silently dropped).
|
||||
$input = "name;eda_info.kicad_symbol;eda_info.kicad_footprint;eda_info.reference_prefix;eda_info.value\n"
|
||||
."Nested EDA part;Device:L;Inductor_THT:L_Axial_0307;L;100uH";
|
||||
|
||||
$category = new Category();
|
||||
$category->setName('Test EDA category');
|
||||
|
||||
$errors = [];
|
||||
$results = $this->service->importString($input, [
|
||||
'class' => Part::class,
|
||||
'format' => 'csv',
|
||||
'csv_delimiter' => ';',
|
||||
'create_unknown_datastructures' => true,
|
||||
'part_category' => $category,
|
||||
], $errors);
|
||||
|
||||
$this->assertCount(1, $results);
|
||||
$this->assertEmpty($errors);
|
||||
$eda = $results[0]->getEdaInfo();
|
||||
$this->assertSame('Device:L', $eda->getKicadSymbol());
|
||||
$this->assertSame('Inductor_THT:L_Axial_0307', $eda->getKicadFootprint());
|
||||
$this->assertSame('L', $eda->getReferencePrefix());
|
||||
$this->assertSame('100uH', $eda->getValue());
|
||||
}
|
||||
|
||||
public function testImportAcceptsFlatEdaColumns(): void
|
||||
{
|
||||
//The documented flat form (and its short aliases) must keep working.
|
||||
$input = "name;eda_kicad_symbol;kicad_footprint;kicad_reference\n"
|
||||
."Flat EDA part;Device:R;Resistor_SMD:R_0805_2012Metric;R";
|
||||
|
||||
$category = new Category();
|
||||
$category->setName('Test EDA category');
|
||||
|
||||
$errors = [];
|
||||
$results = $this->service->importString($input, [
|
||||
'class' => Part::class,
|
||||
'format' => 'csv',
|
||||
'csv_delimiter' => ';',
|
||||
'create_unknown_datastructures' => true,
|
||||
'part_category' => $category,
|
||||
], $errors);
|
||||
|
||||
$this->assertCount(1, $results);
|
||||
$this->assertEmpty($errors);
|
||||
$eda = $results[0]->getEdaInfo();
|
||||
$this->assertSame('Device:R', $eda->getKicadSymbol());
|
||||
$this->assertSame('Resistor_SMD:R_0805_2012Metric', $eda->getKicadFootprint());
|
||||
$this->assertSame('R', $eda->getReferencePrefix());
|
||||
}
|
||||
|
||||
public function testImportInvisibleAliasInvertsVisibility(): void
|
||||
{
|
||||
//"eda_invisible" is the inverse convenience alias of "eda_visibility": eda_invisible=1
|
||||
//must make the part NOT visible to the EDA tool (visibility=false), not visible.
|
||||
$input = "name;eda_invisible\n"
|
||||
."Hidden EDA part;1";
|
||||
|
||||
$category = new Category();
|
||||
$category->setName('Test EDA category');
|
||||
|
||||
$errors = [];
|
||||
$results = $this->service->importString($input, [
|
||||
'class' => Part::class,
|
||||
'format' => 'csv',
|
||||
'csv_delimiter' => ';',
|
||||
'create_unknown_datastructures' => true,
|
||||
'part_category' => $category,
|
||||
], $errors);
|
||||
|
||||
$this->assertCount(1, $results);
|
||||
$this->assertEmpty($errors);
|
||||
$this->assertFalse($results[0]->getEdaInfo()->getVisibility());
|
||||
}
|
||||
|
||||
public function testImportExcelFileProjects(): void
|
||||
{
|
||||
$spreadsheet = new Spreadsheet();
|
||||
|
|
|
|||
|
|
@ -13710,7 +13710,19 @@ Buerklin-API-Authentication-Server:
|
|||
<unit id="qZ_kgWT" name="system.trusted_hosts.unconfigured.suggestion">
|
||||
<segment state="translated">
|
||||
<source>system.trusted_hosts.unconfigured.suggestion</source>
|
||||
<target>Legen Sie einen regulären Ausdruck fest, der alle Hostnamen abdeckt, unter denen Part-DB erreichbar sein soll, z. B. basierend auf dem Hostnamen, den Sie für den Zugriff auf diese Seite verwendet haben. Dies ist möglich in Ihrer Datei <code>.env.local</code> oder <code>docker-compose.yaml</code>:</target>
|
||||
<target>Legen Sie einen regulären Ausdruck fest, der alle Hostnamen abdeckt, unter denen Part-DB erreichbar sein soll, z. B. basierend auf dem Hostnamen, den Sie für den Zugriff auf diese Seite verwendet haben. Beachten Sie, dass die erforderliche Anführungszeichen-Schreibweise davon abhängt, wo Sie den Wert setzen:</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="ie4thSr" name="system.trusted_hosts.unconfigured.env_example">
|
||||
<segment state="translated">
|
||||
<source>system.trusted_hosts.unconfigured.env_example</source>
|
||||
<target>In Ihrer Datei <code>.env.local</code> muss der Wert in einfache Anführungszeichen eingeschlossen werden:</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="ni3hSTN" name="system.trusted_hosts.unconfigured.docker_example">
|
||||
<segment state="translated">
|
||||
<source>system.trusted_hosts.unconfigured.docker_example</source>
|
||||
<target>In <code>docker-compose.yaml</code> darf der Wert NICHT in Anführungszeichen stehen:</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="cEwxoSj" name="info_providers.provider_key">
|
||||
|
|
|
|||
|
|
@ -13712,7 +13712,19 @@ Buerklin-API Authentication server:
|
|||
<unit id="qZ_kgWT" name="system.trusted_hosts.unconfigured.suggestion">
|
||||
<segment state="translated">
|
||||
<source>system.trusted_hosts.unconfigured.suggestion</source>
|
||||
<target>Set it to a regular expression matching all host names Part-DB should be reachable under in your <code>.env.local</code> or <code>docker-compose.yaml</code> file, e.g. based on the host name you used to access this page:</target>
|
||||
<target>Set it to a regular expression matching all host names Part-DB should be reachable under, e.g. based on the host name you used to access this page. Note that the required quoting differs depending on where you set it:</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="ie4thSr" name="system.trusted_hosts.unconfigured.env_example">
|
||||
<segment state="translated">
|
||||
<source>system.trusted_hosts.unconfigured.env_example</source>
|
||||
<target>In your <code>.env.local</code> file, the value must be wrapped in single quotes:</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="ni3hSTN" name="system.trusted_hosts.unconfigured.docker_example">
|
||||
<segment state="translated">
|
||||
<source>system.trusted_hosts.unconfigured.docker_example</source>
|
||||
<target>In <code>docker-compose.yaml</code>, the value must NOT be quoted:</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="cEwxoSj" name="info_providers.provider_key">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue