Skip to content

Commit 2e7e697

Browse files
committed
mise à jour de l'application pour avoir une interface cohérente
1 parent fa299c3 commit 2e7e697

112 files changed

Lines changed: 12560 additions & 1120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,76 @@
11
# Local configuration for init_mac (NOT COMMITTED)
22
# Copy this file to .env.local and adapt the paths
33

4-
# Path to the synchronized folder (OneDrive, Synology Drive, Dropbox, etc.)
4+
# Path to the synchronized drive root (OneDrive, Synology Drive, Dropbox, etc.)
5+
# The shared Ok Computer data will live in SYNC_DIR/ok_computer_shared/.
6+
# Used by dotfiles.sh and by the app's manual dotfiles actions.
7+
# This does not install any cron job and does not auto-sync by itself.
8+
# TYPE: path
59
# Examples:
6-
# SYNC_DIR="$HOME/OneDrive/dotfiles"
7-
# SYNC_DIR="$HOME/SynologyDrive/dotfiles"
8-
# SYNC_DIR="$HOME/Dropbox/dotfiles"
10+
# SYNC_DIR="$HOME/OneDrive"
11+
# SYNC_DIR="$HOME/SynologyDrive"
12+
# SYNC_DIR="$HOME/Dropbox"
913
SYNC_DIR=""
1014

11-
# Path to your custom synchronized packages.conf (optional)
15+
# Path to your custom synchronized packages.conf directory (optional)
16+
# If unset and SYNC_DIR is configured, the shared default becomes:
17+
# SYNC_DIR/ok_computer_shared/packages.conf
18+
# TYPE: path (optional)
1219
# If set, this file will be used instead of src/packages.conf.example
1320
# Examples:
14-
# PACKAGES_CONF_DIR="$HOME/OneDrive/ok_computer"
15-
# PACKAGES_CONF_DIR="$HOME/SynologyDrive/ok_computer"
21+
# PACKAGES_CONF_DIR="$HOME/OneDrive/ok_computer_shared"
22+
# PACKAGES_CONF_DIR="$HOME/SynologyDrive/ok_computer_shared"
1623
PACKAGES_CONF_DIR=""
1724

1825
# Path to the synchronized Obsidian vault (optional)
26+
# TYPE: path (optional)
1927
# Examples:
2028
# OBSIDIAN_VAULT="$HOME/OneDrive/Obsidian"
2129
# OBSIDIAN_VAULT="$HOME/SynologyDrive/Obsidian"
2230
OBSIDIAN_VAULT=""
2331

2432
# Path to synchronized VS Code settings (optional)
33+
# TYPE: path (optional)
2534
# Examples:
2635
# VSCODE_CONFIG="$HOME/OneDrive/VSCode"
2736
# VSCODE_CONFIG="$HOME/SynologyDrive/VSCode"
2837
VSCODE_CONFIG=""
2938

30-
# Storage type (optional, for logs)
31-
# SYNC_TYPE="onedrive"
32-
SYNC_TYPE=""
33-
34-
# Enable dotfiles synchronization (true/false)
39+
# Enable the dotfiles feature in the app.
40+
# Dotfiles synchronization remains manual: Init, Setup, Sync and Restore are user-triggered.
41+
# No automatic cron is installed for dotfiles.
42+
# TYPE: boolean (true/false)
3543
ENABLE_DOTFILES_SYNC=false
3644

45+
# Preferred dotfiles workflow in the app.
46+
# TYPE: enum(drive, zip)
47+
# drive: use SYNC_DIR/ok_computer_shared as the shared folder and run dotfiles actions manually
48+
# zip: use export/import ZIP snapshots for migration or backup
49+
DOTFILES_SYNC_MODE="drive"
50+
3751
# Wi-Fi from KeePassXC (optional)
52+
# WIFI_KDBX_DB: TYPE: path to .kdbx file (optional)
53+
# WIFI_KDBX_GROUP: TYPE: string — KeePassXC group name (optional)
54+
# WIFI_KDBX_KEY_FILE: TYPE: path — keyfile for the vault (optional)
55+
# WIFI_KDBX_ASK_PASS: TYPE: boolean/int — 1 to prompt for password interactively
3856
# Example: WIFI_KDBX_DB="$HOME/OneDrive/vaults/wifi.kdbx"
39-
# Optional: WIFI_KDBX_GROUP="Wi-Fi" (group name in the vault)
40-
# Optional: WIFI_KDBX_KEY_FILE="/path/to/keyfile" (if vault uses a keyfile)
41-
# Optional: WIFI_KDBX_DRY_RUN=1 to simulate without applying
42-
# Optional: WIFI_KDBX_ASK_PASS=1 to force interactive password prompt (do not store secrets in env)
4357
WIFI_KDBX_DB=""
4458
WIFI_KDBX_GROUP="Wifi"
4559
WIFI_KDBX_KEY_FILE=""
46-
WIFI_KDBX_DRY_RUN=0
4760
WIFI_KDBX_ASK_PASS=1
4861

4962
# Automatic update schedule (24-hour)
63+
# TYPE: number (ranges documented)
5064
# AUTO_UPDATE_HOUR: hour in 0-23 (default 21)
5165
# AUTO_UPDATE_MINUTE: minute in 0-59 (default 0)
5266
# Example: AUTO_UPDATE_HOUR=21
5367
# AUTO_UPDATE_MINUTE=30
5468
AUTO_UPDATE_HOUR=21
5569
AUTO_UPDATE_MINUTE=0
5670

71+
# In-app update activation (cross-platform)
72+
# TYPE: boolean
73+
# AUTO_UPDATE_ENABLED: true/false
74+
# Note: update execution is driven by a system cron job managed by the app.
75+
AUTO_UPDATE_ENABLED=false
76+

.github/workflows/build-ui.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Build UI executables
1+
name: build-ui
22

33
on:
44
push:
5+
branches: ["main"]
56
pull_request:
6-
release:
7-
types: [published]
7+
workflow_dispatch:
88

99
jobs:
1010
build:
@@ -17,41 +17,35 @@ jobs:
1717
- uses: actions/checkout@v4
1818

1919
- name: Set up Python
20-
uses: actions/setup-python@v4
20+
uses: actions/setup-python@v5
2121
with:
2222
python-version: '3.11'
2323

2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install -r ui/requirements.txt
27+
python -m pip install -r ui/requirements.txt -r ui/requirements.conf
2828
2929
- name: Build executable
3030
run: |
31-
# choose separator for add-data
3231
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then SEP=';'; else SEP=':'; fi
33-
python -m PyInstaller --name ok_computer_ui-${{ matrix.os }} --onefile \
32+
cd ui
33+
python -m PyInstaller --name ok_computer_ui-${{ matrix.os }} --onedir --noconfirm --clean \
3434
--noconsole \
35-
--add-data "ui/templates${SEP}templates" \
36-
--add-data "ui/static${SEP}static" \
35+
--add-data "../.env.example${SEP}." \
36+
--add-data "templates${SEP}templates" \
37+
--add-data "static${SEP}static" \
38+
--add-data "../src${SEP}src" \
3739
--collect-submodules flask \
3840
--hidden-import socket \
3941
--hidden-import webview \
4042
--hidden-import webview.platforms.cocoa \
4143
--hidden-import webview.platforms.winforms \
42-
ui/app.py
44+
app.py
4345
shell: bash
4446

4547
- name: Upload artifact
4648
uses: actions/upload-artifact@v4
4749
with:
4850
name: ok_computer_ui-${{ matrix.os }}
49-
path: dist/*
50-
51-
- name: Upload binaries to GitHub Release
52-
if: github.event_name == 'release'
53-
uses: softprops/action-gh-release@v1
54-
with:
55-
files: dist/**
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
path: ui/dist/**

.github/workflows/release.yml

Lines changed: 114 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,126 @@ on:
55
tags: ["v*"]
66

77
jobs:
8-
build-release:
8+
create-release:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- name: Create GitHub release
14+
uses: softprops/action-gh-release@v2
15+
with:
16+
generate_release_notes: true
17+
draft: false
18+
prerelease: false
19+
20+
cli-bundle:
21+
runs-on: ubuntu-latest
22+
needs: create-release
23+
permissions:
24+
contents: write
1025
steps:
1126
- name: Checkout
1227
uses: actions/checkout@v4
1328

14-
- name: Create source archive
29+
- name: Compute version
30+
id: vars
1531
run: |
16-
mkdir -p release
17-
cp -r src/* release/
32+
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
33+
34+
- name: Build CLI release zip
35+
run: |
36+
rm -rf release
37+
mkdir -p release/ok_computer-cli
38+
cp README.md LICENSE VERSION .env.example okc install_okc.sh release/ok_computer-cli/
39+
cp -R src release/ok_computer-cli/src
1840
cd release
19-
tar -czf ../init-mac-scripts.tar.gz *
20-
cd ..
21-
ls -lh init-mac-scripts.tar.gz
41+
zip -qr "ok_computer-cli-${{ steps.vars.outputs.tag }}.zip" ok_computer-cli
2242
23-
- name: Create release
24-
uses: softprops/action-gh-release@v1
43+
- name: Upload CLI zip to release
44+
uses: softprops/action-gh-release@v2
2545
with:
26-
files: init-mac-scripts.tar.gz
27-
draft: false
28-
prerelease: false
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
files: release/ok_computer-cli-${{ steps.vars.outputs.tag }}.zip
47+
48+
ui-bundle:
49+
needs: create-release
50+
permissions:
51+
contents: write
52+
runs-on: ${{ matrix.os }}
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
include:
57+
- os: macos-latest
58+
asset_suffix: macos
59+
- os: ubuntu-latest
60+
asset_suffix: linux
61+
- os: windows-latest
62+
asset_suffix: windows
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Set up Python
69+
uses: actions/setup-python@v5
70+
with:
71+
python-version: '3.11'
72+
73+
- name: Install UI build dependencies
74+
run: |
75+
python -m pip install --upgrade pip
76+
python -m pip install -r ui/requirements.txt -r ui/requirements.conf
77+
78+
- name: Compute version
79+
id: vars
80+
shell: bash
81+
run: |
82+
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
83+
84+
- name: Build UI bundle
85+
shell: bash
86+
run: |
87+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then SEP=';'; else SEP=':'; fi
88+
cd ui
89+
ICON_ARGS=()
90+
if [[ "${{ matrix.os }}" == "macos-latest" && -f "assets/logo.icns" ]]; then
91+
ICON_ARGS=(--icon "assets/logo.icns")
92+
fi
93+
python -m PyInstaller --name ok_computer_ui --onedir --noconfirm --clean \
94+
--noconsole \
95+
"${ICON_ARGS[@]}" \
96+
--add-data "../.env.example${SEP}." \
97+
--add-data "templates${SEP}templates" \
98+
--add-data "static${SEP}static" \
99+
--add-data "../src${SEP}src" \
100+
--collect-submodules flask \
101+
--hidden-import socket \
102+
--hidden-import webview \
103+
--hidden-import webview.platforms.cocoa \
104+
--hidden-import webview.platforms.winforms \
105+
app.py
106+
107+
- name: Archive macOS app
108+
if: matrix.os == 'macos-latest'
109+
run: |
110+
mkdir -p release
111+
ditto -c -k --sequesterRsrc --keepParent ui/dist/ok_computer_ui.app release/ok_computer-ui-${{ matrix.asset_suffix }}-${{ steps.vars.outputs.tag }}.zip
112+
113+
- name: Archive Linux bundle
114+
if: matrix.os == 'ubuntu-latest'
115+
run: |
116+
mkdir -p release
117+
cd ui/dist
118+
zip -qr ../../release/ok_computer-ui-${{ matrix.asset_suffix }}-${{ steps.vars.outputs.tag }}.zip ok_computer_ui
119+
120+
- name: Archive Windows bundle
121+
if: matrix.os == 'windows-latest'
122+
shell: pwsh
123+
run: |
124+
New-Item -ItemType Directory -Force -Path release | Out-Null
125+
Compress-Archive -Path ui/dist/ok_computer_ui/* -DestinationPath release/ok_computer-ui-${{ matrix.asset_suffix }}-${{ steps.vars.outputs.tag }}.zip -Force
126+
127+
- name: Upload UI bundle to release
128+
uses: softprops/action-gh-release@v2
129+
with:
130+
files: release/ok_computer-ui-${{ matrix.asset_suffix }}-${{ steps.vars.outputs.tag }}.zip

0 commit comments

Comments
 (0)