Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .azure-pipelines/templates/log4tc/build-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ parameters:
default: 'Log4Tc.sln'
- name: dotnet_framework
type: string
default: 'net8.0'
default: 'net10.0'
- name: dotnet_configuration
type: string
default: 'Release'
Expand All @@ -33,9 +33,27 @@ steps:
displayName: 'publish linux-x64 files'
artifact: 'log4TC-linux-x64'

- script: dotnet publish ${{ parameters.solution_path }}Mbc.Log4Tc.Service/Mbc.Log4Tc.Service.csproj --framework ${{ parameters.dotnet_framework }} --configuration ${{ parameters.dotnet_configuration }} --self-contained true --runtime linux-x64 -t:CreateDeb
displayName: "publish log4TC linux-x64 deb"

- script: dotnet publish ${{ parameters.solution_path }}Mbc.Log4Tc.Service/Mbc.Log4Tc.Service.csproj --framework ${{ parameters.dotnet_framework }} --configuration ${{ parameters.dotnet_configuration }} --self-contained true --runtime linux-arm64 --output $(Build.ArtifactStagingDirectory)/log4TC/linux-arm64
displayName: "publish log4TC linux-arm64 self-contained"

- publish: $(Build.ArtifactStagingDirectory)/log4TC/linux-arm64
displayName: 'publish linux-arm64 files'
artifact: 'log4TC-linux-arm64'

- script: dotnet publish ${{ parameters.solution_path }}Mbc.Log4Tc.Service/Mbc.Log4Tc.Service.csproj --framework ${{ parameters.dotnet_framework }} --configuration ${{ parameters.dotnet_configuration }} --self-contained true --runtime linux-arm64 -t:CreateDeb
displayName: "publish log4TC linux-arm64 deb"

- task: CopyFiles@2
displayName: 'Copy deb Setup files'
inputs:
Contents: '**/bin/${{ parameters.dotnet_configuration }}/**/*.deb'
TargetFolder: '$(Build.ArtifactStagingDirectory)/log4TC/deb'
CleanTargetFolder: false
flattenFolders: true

- publish: $(Build.ArtifactStagingDirectory)/log4TC/deb
displayName: 'publish deb files'
artifact: 'log4TC-deb'
2 changes: 1 addition & 1 deletion .azure-pipelines/templates/log4tc/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ parameters:
default: 'Log4Tc.sln'
- name: dotnet_framework
type: string
default: 'net8.0'
default: 'net10.0'
- name: dotnet_configuration
type: string
default: 'Release'
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/templates/log4tc/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ parameters:
default: 'Log4Tc.sln'
- name: dotnet_framework
type: string
default: 'net8.0'
default: 'net10.0'
- name: dotnet_configuration
type: string
default: 'Release'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,7 @@ ASALocalRun/
.mfractor/

.mono

# GPG private keys - must never be committed
*-privatekey.asc
*.gpg.key
38 changes: 31 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,36 @@ By contributing, you agree that your contributions will be licensed under its Ap
## References
This document was adapted from briandk's excellent [contribution guidelines template](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62).

## Build
## publish deb packages

**Requirements**
- VS2019
with aptly is it possible to create a deb repository to host the deb packages. This can then be published to the static website of github pages.

```powershell
cd .\source\Log4Tc\
.\build.cake
```
```bash
# navigate to the aptly configuration directory
cd source/aptly/

# Create a local aptly repository (only needs to be done once)
aptly repo create -config=aptly.conf -component=main -distribution=stable log4tc

# add deb packages to the repository
aptly repo add -config=aptly.conf log4tc *.deb

# Generate GPG key for signing (one-time setup) and publish
export GPG_KEY_ID=D3042271F3CDB50E

# publish the repository to a local directory with GPG signing
aptly publish repo -config=aptly.conf -architectures="amd64,arm64" -gpg-key="$GPG_KEY_ID" log4tc

# The contents of the public directory can then be copied to the gh-pages branch of the github repository
cp -r /root/.aptly/public/* /tmp/deb/

# Now you can add following line to apt /etc/apt/sources.list.d/log4tc.list:
# deb https://mbc-engineering.github.io/log4TC/deb/ stable main

# or in the new format /etc/apt/sources.list.d/log4tc.sources:
# Types: deb
# URIs: https://mbc-engineering.github.io/log4TC/deb
# Suites: stable
# Components: main
# Trusted: yes
```
101 changes: 101 additions & 0 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ resources:
endpoint: github.com_bqstony
name: mbc-engineering/log4TC
ref: gh-pages
- repository: deb-repo-repo
type: github
endpoint: github.com_bqstony
name: mbc-engineering/log4TC
ref: deb-repo
# self is the trigger repo + branch

stages:
Expand All @@ -49,6 +54,7 @@ stages:
displayName: 'Publish to github Tag'
dependsOn: Build
condition: succeeded()
#condition: false
jobs:
- deployment: Deploy
pool:
Expand Down Expand Up @@ -120,6 +126,7 @@ stages:
displayName: 'Publish to github pages'
dependsOn: PublishRelease
condition: succeeded()
#condition: false
jobs:
- deployment: Deploy
pool:
Expand Down Expand Up @@ -184,3 +191,97 @@ stages:
git push
displayName: 'Push changes to origin gh-pages branch'
workingDirectory: '$(Build.SourcesDirectory)'


- stage: 'PublishDebOnGitHubPages'
displayName: 'Publish deb repository to github pages'
dependsOn: PublishGitHubPages
#dependsOn: Build
condition: succeeded()
jobs:
- deployment: Deploy
pool:
vmImage: 'ubuntu-24.04'
environment: publish-github-pages
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: log4TC-deb
- checkout: deb-repo-repo
submodules: recursive
persistCredentials: true
- script: |
git config user.email "AutomatedDeploy@bot.com"
git config user.name "AutomatedDeploy"
git fetch
git status
git branch -a
git remote -v
git checkout deb-repo
displayName: 'checkout deb-repo git repo'
workingDirectory: '$(Build.SourcesDirectory)'
- task: DownloadSecureFile@1
name: gpgKey
displayName: 'Download GPG key for signing deb repository'
inputs:
secureFile: 'log4tc-archive-keyring-privatekey.asc'
- script: |
echo 'Install aptly'
sudo apt-get install -qq -y aptly gnupg

echo 'Import GPG key for signing deb repository'
gpg --batch --import $(gpgKey.secureFilePath)
export GPG_KEY_ID=D3042271F3CDB50E

echo 'add deb packages to the repository'
aptly repo add -config=aptly.conf log4tc $(Pipeline.Workspace)/log4TC-deb/*.deb

echo 'publish or update the repository with GPG signing'
if aptly publish list -config=aptly.conf | grep -q '^\s*\*\s*\.\s*stable'; then
aptly publish update -config=aptly.conf -batch -gpg-key="$GPG_KEY_ID" -passphrase="$(GPG_PASSPHRASE)" stable
else
aptly publish repo -config=aptly.conf -batch -architectures="amd64,arm64" -gpg-key="$GPG_KEY_ID" -passphrase="$(GPG_PASSPHRASE)" log4tc
fi

echo 'The contents of the public directory can then be copied to the staging area'
mkdir -p $(Build.ArtifactStagingDirectory)/deb
cp -r repo/public/* $(Build.ArtifactStagingDirectory)/deb/

echo 'Validate signed apt metadata exists'
test -f $(Build.ArtifactStagingDirectory)/deb/dists/stable/Release.gpg
test -f $(Build.ArtifactStagingDirectory)/deb/dists/stable/InRelease

echo 'Copy he GPG public key to the staging area'
cp log4tc-archive-keyring.gpg $(Build.ArtifactStagingDirectory)/deb/
cp log4tc-archive-keyring.asc $(Build.ArtifactStagingDirectory)/deb/
displayName: 'update deb repository with aptly to staging area'
workingDirectory: '$(Build.SourcesDirectory)/source/aptly'
- script: |
git add .
git status
git commit -m "Update deb repository from Release-$(Build.SourceBranchName)"
git push
displayName: 'Push changes to origin deb-repo branch'
workingDirectory: '$(Build.SourcesDirectory)'

- script: |
git checkout gh-pages
displayName: 'checkout gh-pages git repo'
workingDirectory: '$(Build.SourcesDirectory)'

- script: |
echo 'clear old deb files in gh-pages branch'
rm -rf $(Build.SourcesDirectory)/deb/
echo 'The contents of the public directory can then be copied to the gh-pages branch of the github repository'
cp -r $(Build.ArtifactStagingDirectory)/deb/ $(Build.SourcesDirectory)/deb/
displayName: 'copy deb repository to gh-pages git repo'
workingDirectory: '$(Build.SourcesDirectory)'
- script: |
git add .
git status
git commit -m "Update deb files from Release-$(Build.SourceBranchName)"
git push
displayName: 'Push changes to origin gh-pages branch'
workingDirectory: '$(Build.SourcesDirectory)'
15 changes: 14 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<div id="google_translate_element"></div>

# Changelog
## [26.04.26]
### Added
- Verbesserter Linux Support durch Bereitstellung Debian **.deb** Paket. Siehe Anleitung [Linux Installation](https://mbc-engineering.github.io/log4TC/reference/installation.html#linux-installation)

### Fixed
- docs links korrigiert

### Changed
- Aktualisiert auf .NET 10.0 (Siehe [unterstütze Betriebsysteme](https://github.com/dotnet/core/blob/main/release-notes/10.0/supported-os.md)))
- Neuste Beckhoff ADS Library 6.2.521 wird verwendet
- wix setup v7
- update dependencies

## [25.08.26]
### Added
- Stefans blogs hinzugefügt inklusive [Getting Started Video](https://www.youtube.com/embed/aXccFd3cIY0)
Expand All @@ -14,7 +27,7 @@
- Setup TwinCAT Lib installation nur für 2024.
- Neuste Beckhoff ADS Library 6.2.485 wird verwendet
- Neuste Microsoft.ApplicationInsights.WorkerService Library 2.23.0 wird verwendet
- SPS Library umbenannt für um klar die TC Version zu kennzeichnen.
- SPS Library umbenannt um klar die TC Version zu kennzeichnen.

## [25.02.07]
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion docs/docfx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="$(MSBuildProjectDirectory)\DocFxBuild.targets" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

</Project>
83 changes: 74 additions & 9 deletions docs/reference/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

Den aktuellen Release von Log4TC kann [hier](https://github.com/mbc-engineering/log4TC/releases) geladen werden. Achten sie auf die Ziel Architektur x86 bzw x64!

## Voraussetzungen
Es wird [Windows](#windows-installation) und [Linux](#linux-installation) unterstützt.

## Windows Installation
### Voraussetzungen

* [TwinCat 3.1 (min. 4024.00)](https://www.beckhoff.com/de-de/suchergebnisse/?q=TE1000+%7C+TwinCAT+3+Engineering)
* Administrationsrechte für die Installation
Expand All @@ -15,7 +18,7 @@ Den aktuellen Release von Log4TC kann [hier](https://github.com/mbc-engineering/
* [ADS Router - TC1000 | TC3 ADS](https://www.beckhoff.com/de-de/support/downloadfinder/suchergebnis/?download_group=97028369)
* [Verwendet Microsoft .NET 8 (muss nicht installiert werden)](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md)

## Beispiel Installation
### Beispiel Installation

Vorgehen zur Installation auf einem Zielsystem wie einem C6015 mit Windows 10 und einer x64 Architektur.

Expand All @@ -27,9 +30,9 @@ Vorgehen zur Installation auf einem Zielsystem wie einem C6015 mit Windows 10 un

![](assets/setup_successfull.png)

## Features
### Setup Features

### log4TC Service
#### log4TC Service

> [!NOTE]
> Dieses Feature erscheint nur wenn sie ein ADS Router - TC1000 | TC3 ADS installiert haben.
Expand All @@ -41,7 +44,7 @@ Vorgehen zur Installation auf einem Zielsystem wie einem C6015 mit Windows 10 un

![links](assets/setup_service_links.png)

### log4TC TwinCat 3 Bibliothek
#### log4TC TwinCat 3 Bibliothek

> [!NOTE]
> Dieses Feature erscheint nur wenn sie TwinCat 3.1 Engineering (XAE) min. 4024.00 installiert haben.
Expand All @@ -50,15 +53,77 @@ Vorgehen zur Installation auf einem Zielsystem wie einem C6015 mit Windows 10 un

- Installiert die log4TC Twincat 3 Bibliothek lokal
- Bereitet die OEM Lizenz zur Registrierung für die Produktive Benutzung vor
- Kopiert das getting starded Projekt unter `C:\ProgramData\log4TC\gettingstarded`
- Kopiert das getting started Projekt unter `C:\ProgramData\log4TC\gettingstarted`
- Hilfe Links im Startmenü

## Bekannte Fehler
### Bekannte Fehler

## Setup endet mit dem Fehler: `... Setup Wizard endet prematurely because of an error. Your system has not been modified. ...`
#### Setup endet mit dem Fehler: `... Setup Wizard endet prematurely because of an error. Your system has not been modified. ...`

In diesem Fall ist ein Fehler aufgetreten.

![setup end with error](assets/setup_endwitherror.png)

Starten sie das setup erneut mit der Kommandozeile ausgeführt als Administrator. Navigieren Sie in den Ortner mit dem MSI Setup per `cd [folder]`. Geben Sie folgendes ein: `msiexec.exe /i "[setup].msi" /l*v install.log`. Wenden Sie sich anschliessend mit dem `install.log` an uns.
Starten sie das setup erneut mit der Kommandozeile ausgeführt als Administrator. Navigieren Sie in den Ordner mit dem MSI Setup per `cd [folder]`. Geben Sie folgendes ein: `msiexec.exe /i "[setup].msi" /l*v install.log`. Wenden Sie sich anschliessend mit dem `install.log` an uns.

## Linux Installation

> [!NOTE]
> Aktuell wird nur die Installation des log4TC Service auf Debian Distributionen unterstützt.
> Somit auch für die Beckhoff RT Linux® distribution

1. Hinzufügen des log4TC sources in apt sources listen:

Zuerst den GPG-Schlüssel herunterladen und als keyring installieren:
```bash
sudo install -d -m 0755 /etc/apt/keyrings
wget -qO- https://mbc-engineering.github.io/log4TC/deb/log4tc-archive-keyring.gpg | sudo tee /etc/apt/keyrings/log4tc-archive-keyring.gpg > /dev/null
sudo chmod 0644 /etc/apt/keyrings/log4tc-archive-keyring.gpg
```

> ASCII-kodierten Format (.asc) Schlüssel kann auch heruntergeladen werden unter: https://mbc-engineering.github.io/log4TC/deb/log4tc-archive-keyring.asc

Optional: Fingerprint prüfen (muss mit `D3042271F3CDB50E` enden):
```bash
gpg --show-keys --with-fingerprint /etc/apt/keyrings/log4tc-archive-keyring.gpg
```

**Legacy list format** `/etc/apt/sources.list.d/log4tc.list`:
```bash
deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/log4tc-archive-keyring.gpg] https://mbc-engineering.github.io/log4TC/deb stable main
```

**New format** `/etc/apt/sources.list.d/log4tc.sources`:
```bash
Types: deb
URIs: https://mbc-engineering.github.io/log4TC/deb
Suites: stable
Components: main
Architectures: amd64 arm64
Signed-By: /etc/apt/keyrings/log4tc-archive-keyring.gpg
```
Comment thread
bqstony marked this conversation as resolved.
> Ohne Signaturprüfung kann `Trusted: yes` verwendet werden. Dies wird nicht empfohlen.

1. Aktualisieren der apt package listen:
```bash
sudo apt update
```

1. Installation des log4TC Service:
```bash
sudo apt install Mbc.Log4Tc.Service
```

1. Anpassen der Konfigurationsdateien nach Wunsch
1. `/etc/log4tc/config/appsettings.json`
2. `/etc/log4tc/config/NLog.config`

2. Überprüfen des log4TC Service status:
```bash
sudo systemctl status Mbc.Log4Tc.Service.service
```
1. Bei Fehler internal logs prüfen:
```bash
sudo journalctl -u Mbc.Log4Tc.Service.service
ls /var/log/log4tc
```
Loading
Loading