Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Commit 99c75d8

Browse files
committed
🧾 💸 initial commit
0 parents  commit 99c75d8

8 files changed

Lines changed: 370 additions & 0 deletions

File tree

.flatpakrepo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Flatpak Repo]
2+
Title=etaxzug Flatpak Repository
3+
Url=https://alexanderadam.github.io/etax_flatpak/repo/
4+
GPGKey=<BASE64_GPG_KEY>
5+
Comment=A Flatpak repo for eTax Zug.

.github/workflows/flatpak.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Flatpak CI & Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 🛎️ Checkout code
14+
uses: actions/checkout@v4
15+
- name: 📦 Install Flatpak and flatpak-builder
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y flatpak flatpak-builder
19+
- name: 🏗️ Build Flatpak
20+
run: |
21+
flatpak-builder --repo=repo --force-clean build-dir flatpak/ch.zg.etax.yaml
22+
- name: 🔏 Sign repo (optional)
23+
run: |
24+
if [ -z "$GPG_PRIVATE_KEY" ]; then
25+
echo "::warning::GPG_PRIVATE_KEY secret is not set. Skipping repo signing."
26+
exit 0
27+
fi
28+
echo "$GPG_PRIVATE_KEY" | base64 -d > private.gpg
29+
gpg --import private.gpg
30+
ostree --repo=repo gpg-sign --gpg-sign=YOUR_GPG_KEY_ID
31+
env:
32+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
33+
- name: 🚚 Prepare repo for GitHub Pages
34+
run: |
35+
mkdir -p public
36+
cp -r repo public/
37+
touch public/.nojekyll
38+
- name: 🚀 Deploy to GitHub Pages
39+
uses: peaceiris/actions-gh-pages@v4
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: ./public
43+
publish_branch: gh-pages

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
eTaxZGnP*_64bit.zip
2+
eTaxZGnP*_64bit.sh
3+
etax_head.sh
4+
5+
# Flatpak build artifacts
6+
build-dir/
7+
repo/
8+
tmp/
9+
*.zip
10+
*.sh
11+
*.desktop
12+
*.png
13+
.etaxzug_inst/
14+
.flatpak-builder/
15+
16+
# Editor/IDE
17+
.vscode/
18+
.idea/
19+
*.swp
20+
*.swo
21+
22+
# System
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Python/Node/Java
27+
__pycache__/
28+
node_modules/
29+
*.pyc
30+
*.pyo
31+
*.class
32+
*.o
33+
*.a
34+
*.out
35+
36+
# Logs and temp
37+
*.log
38+
*.tmp
39+
*.bak
40+
*.orig
41+
*.rej
42+
43+
# OS-specific
44+
ehthumbs.db
45+
Icon?
46+
47+
# Misc
48+
*~

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing to eTax Zug Flatpak
2+
3+
Thank you for your interest in contributing!
4+
5+
## How to Contribute
6+
7+
- **Bug Reports:** Please open an issue with detailed steps to reproduce.
8+
- **Feature Requests:** Open an issue describing your idea.
9+
- **Pull Requests:**
10+
1. Fork the repository
11+
2. Create a new branch for your change
12+
3. Make your changes (see below for guidelines)
13+
4. Test your changes locally with `flatpak-builder`
14+
5. Open a pull request
15+
16+
## Guidelines
17+
18+
- Keep the Flatpak manifest (`flatpak/ch.zg.etax.yaml`) up to date and well-commented.
19+
- Test the build and app launch before submitting. I'm using `flatpak-builder --repo=repo --force-clean build-dir flatpak/ch.zg.etax.yaml && flatpak uninstall --user ch.zg.etax -y && flatpak install --user etax-local ch.zg.etax -y && flatpak run ch.zg.etax` to ensure everything works.
20+
- If updating for a new year, update all relevant URLs and file names.
21+
22+
## Resources
23+
24+
- [Flatpak Documentation](https://docs.flatpak.org/en/latest/)
25+
- [Flatpak Manifest Guide](https://docs.flatpak.org/en/latest/first-build.html)
26+
27+
## License
28+
29+
This repository only packages the official eTax Zug app. All rights to the app remain with the canton Zug.

README.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# 🧾 eTax Zug Flatpak 🚀
2+
3+
**Production Ready**: This Flatpak package downloads and runs the official eTax Zug app in a sandboxed environment—no more tax-ing installations! For advanced packaging or yearly updates, see `flatpak/README-flatpak-advanced.md`.
4+
5+
This repository packages the official eTax Zug Java desktop application as a Flatpak for easy installation and sandboxing on Linux systems. Filing your taxes has never been so… contained! 🥳
6+
7+
## Features 🏆
8+
9+
- Downloads the official installer from [the canton Zug website](https://zg.ch/de/steuern-finanzen/steuern/natuerliche-personen/steuererklaerung-ausfuellen) (no shady business—just Swiss precision!)
10+
- Runs the original installer (no funny business, except in this README)
11+
- Sandboxed and isolated from the rest of your system (your other apps won't get "taxed")
12+
13+
## Quick Start - From Zero to Tax Hero 🏁
14+
15+
Install Flatpak (if not already installed)
16+
17+
```sh
18+
sudo apt install flatpak # Debian/Ubuntu
19+
# or
20+
sudo dnf install flatpak # Fedora
21+
```
22+
23+
### From Flatpak Remote
24+
25+
1. **Add the Flatpak repo:**
26+
27+
```sh
28+
flatpak remote-add --user --if-not-exists etaxzug https://alexanderadam.github.io/etax_flatpak/repo/
29+
```
30+
31+
2. **(Optional) Import the GPG key:**
32+
33+
Download the key:
34+
```
35+
wget https://alexanderadam.github.io/etax_flatpak/repo/gpgkey
36+
flatpak remote-modify --gpg-import=repo/gpgkey etaxzug
37+
```
38+
39+
3. **Install the app:**
40+
41+
```sh
42+
flatpak install --user etaxzug ch.zg.etax
43+
```
44+
45+
4. **Run eTax Zug:**
46+
47+
```sh
48+
flatpak run ch.zg.etax
49+
```
50+
51+
## 🔑 Repository Info
52+
53+
- **Repo URL:** https://alexanderadam.github.io/etax_flatpak/repo/
54+
- **GPG Key:** See above or `.flatpakrepo` file.
55+
56+
57+
### From Repository
58+
59+
#### 1️⃣ Clone the repository
60+
61+
```sh
62+
git clone https://github.com/alexanderadam/etax_flatpak.git
63+
cd etax_flatpak
64+
```
65+
66+
#### 2️⃣ Build the Flatpak (it’s a taxing job, but someone’s gotta do it)
67+
68+
```sh
69+
flatpak-builder --user --install --force-clean build-dir flatpak/ch.zg.etax.yaml
70+
```
71+
72+
## Run eTax Zug (and relax, you’re in a sandbox 😎)
73+
74+
```sh
75+
flatpak run ch.zg.etax
76+
```
77+
78+
## How it works (extra-data) 🧙‍♂️
79+
80+
- [The Flatpak manifest uses `extra-data`](https://docs.flatpak.org/en/latest/module-sources.html#extra-data) to download the official eTax Zug installer zip at install time.
81+
- A post-install script extracts the shell installer and installs the Java app and desktop file inside the Flatpak.
82+
83+
## Updating for a new year 🗓️
84+
85+
New year, new taxes! To update for a new tax year, just update the Flatpak manifest URL, SHA256, and filenames to match the new official eTax Zug release. See the Flatpak manifest and launcher script for details. For development and contribution, see `CONTRIBUTING.md`. (Don’t worry, it’s less work than your tax return!)
86+
87+
## Support & Troubleshooting 🛟
88+
89+
If you encounter issues, please [open an issue on GitHub](https://github.com/alexanderadam/etax_flatpak/issues). For advanced troubleshooting, see `flatpak/README-flatpak-advanced.md`.
90+
91+
## Repository Structure
92+
93+
- [`flatpak/`](flatpak/) — Contains all Flatpak-specific files:
94+
- [`ch.zg.etax.yaml`](flatpak/ch.zg.etax.yaml) — Main Flatpak manifest (YAML format).
95+
- [`ch.zg.etax.post-install.sh`](flatpak/ch.zg.etax.post-install.sh) — Post-install script for extracting and patching the app after download.
96+
- [`etaxzug.sh`](flatpak/etaxzug.sh) — Launcher script for the eTax Zug app inside the Flatpak sandbox.
97+
- [`README.md`](flatpak/README.md) — Flatpak usage and packaging notes.
98+
99+
- [`build-dir/`](build-dir/) — Temporary build output directory created by `flatpak-builder`. Not tracked in git.
100+
- [`files/`](build-dir/files/) — Contains staged files for the Flatpak build.
101+
- [`export/`](build-dir/export/) — Used for exported files during build.
102+
- [`metadata`](build-dir/metadata) — Flatpak metadata for the build.
103+
104+
- [`repo/`](repo/) — OSTree Flatpak repository. This is what gets published to GitHub Pages for user installation.
105+
- [`config`](repo/config), [`summary`](repo/summary), [`objects/`](repo/objects/), etc. — Standard OSTree repo structure.
106+
107+
- [`.github/workflows/`](.github/workflows/) — GitHub Actions CI/CD workflows for building and publishing the Flatpak repo.
108+
- [`flatpak.yml`](.github/workflows/flatpak.yml) — Main workflow for build and deploy.
109+
110+
- [`.flatpakrepo`](.flatpakrepo) — Metadata file for users to add the repo to Flatpak.
111+
112+
- [`build.sh`](build.sh) — Local build and export script for maintainers.
113+
114+
- [`README.md`](README.md) — Main documentation and user instructions.
115+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — Contribution guidelines for maintainers.
116+
- [`.gitignore`](.gitignore) — Excludes build artifacts, temp files, and other unnecessary files from git.
117+
118+
Other files and directories may be present for specific releases, tests, or local development. See the README for user instructions and this file for advanced packaging details.
119+
120+
## License 📜
121+
122+
This repo only packages [the official eTax Zug app](https://zg.ch/de/steuern-finanzen/steuern/natuerliche-personen/steuererklaerung-ausfuellen). All rights to the app remain with the canton Zug.

flatpak/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Flatpak Manifest for eTax Zug
2+
3+
This directory contains the Flatpak manifest for packaging the official eTax Zug Java desktop application.
4+
5+
## Manifest: `ch.zg.etax.yaml`
6+
7+
- Downloads the official installer zip from canton Zug website
8+
- Extracts and runs the shell installer in a sandboxed build
9+
- Installs the Java app and desktop entry into the Flatpak
10+
11+
## How to Build Locally
12+
13+
1. **Install Flatpak and flatpak-builder**
14+
```sh
15+
sudo apt install flatpak flatpak-builder # Debian/Ubuntu
16+
# or
17+
sudo dnf install flatpak flatpak-builder # Fedora
18+
```
19+
20+
2. **Build and install the Flatpak**
21+
```sh
22+
flatpak-builder --user --install --force-clean build-dir ch.zg.etax.yaml
23+
```
24+
25+
3. **Run the app**
26+
```sh
27+
flatpak run ch.zg.etax
28+
```
29+
30+
## Manifest Details
31+
32+
- **App ID:** `ch.zg.etax`
33+
- **Runtime:** `org.freedesktop.Platform` (23.08)
34+
- **SDK:** `org.freedesktop.Sdk`
35+
- **Command:** `etaxzug` (the Java launcher script)
36+
- **Desktop file:** `ch.zg.etax.desktop`
37+
- **Icon:** `ch.zg.etax.png`
38+
39+
40+
## Updating for a New Year
41+
42+
- Change the year and URLs in `ch.zg.etax.yaml`.
43+
- Update the desktop file and icon names if needed.
44+
45+
## Troubleshooting
46+
47+
- If the installer fails, check the build logs for errors.
48+
49+
## Advanced Flatpak Packaging Notes
50+
51+
### How the Installer is Handled
52+
53+
- The official eTax Zug installer is a shell script inside a zip archive.
54+
- The Flatpak manifest downloads the zip, extracts the shell script, and runs it with `--target ./etaxzug_inst --noexec` to extract files without running the full installer interactively.
55+
- All files are copied into `/app` inside the Flatpak.
56+
57+
### Desktop Integration
58+
59+
- The `.desktop` file is renamed to `ch.zg.etax.desktop` and updated so the `Exec` line uses the Flatpak launcher script.
60+
- The icon is renamed to `ch.zg.etax.png` for Flatpak.
61+
62+
### Java Runtime
63+
64+
- The app uses the system Java runtime provided by the Flatpak runtime (`org.freedesktop.Platform`).
65+
- If the app requires a specific Java version, update the manifest to add a Java extension.
66+
67+
### Customizations
68+
69+
- The launcher script (`etaxzug.sh`) ensures the app is started with the correct working directory and arguments.
70+
- You can patch the desktop file or icon as needed in the build commands.
71+
72+
### Updating for a New Year
73+
74+
- Change the year in the manifest, URLs, and file names.
75+
- Test the installer extraction and app launch.
76+
77+
### Debugging
78+
79+
- Use `flatpak run --command=sh ch.zg.etax` to get a shell inside the sandbox for troubleshooting.
80+
- Check `/app` for installed files and logs.
81+
82+
## License
83+
84+
This manifest only packages the official eTax Zug app. All rights to the app remain with the canton Zug.

flatpak/ch.zg.etax.png

338 Bytes
Loading

flatpak/ch.zg.etax.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
add-extensions:
2+
org.freedesktop.Sdk.Extension.openjdk:
3+
directory: /app/extensions/org.freedesktop.Sdk.Extension.openjdk
4+
version: '24.08.22'
5+
app-id: ch.zg.etax
6+
runtime: org.freedesktop.Platform
7+
runtime-version: '24.08.22'
8+
sdk: org.freedesktop.Sdk
9+
command: etaxzug
10+
finish-args:
11+
- --share=network
12+
- --filesystem=home
13+
- --device=dri
14+
- --socket=x11
15+
- --socket=wayland
16+
modules:
17+
18+
- name: etaxzug-extra-data
19+
buildsystem: simple
20+
build-commands:
21+
- install -Dm755 etaxzug.sh /app/bin/etaxzug
22+
- install -Dm644 ch.zg.etax.desktop /app/share/applications/ch.zg.etax.desktop
23+
- install -Dm644 ch.zg.etax.png /app/share/icons/hicolor/256x256/apps/ch.zg.etax.png
24+
sources:
25+
- type: extra-data
26+
url: https://etaxdownload.zg.ch/2024/eTaxZGnP2024_64bit.zip
27+
sha256: bb1554de35b1f934ff8a3d0e352d1337b2369291f603617ff253ec3c7599ad5b
28+
size: 115853309
29+
filename: etax_installer.zip
30+
- type: file
31+
path: etaxzug.sh
32+
- type: file
33+
path: ch.zg.etax.desktop
34+
- type: file
35+
path: ch.zg.etax.png
36+
version: '2025.1'
37+
comment: |
38+
- 2025 release: Initial release.
39+
- See CHANGELOG in README.md for details.

0 commit comments

Comments
 (0)