Skip to content

Commit 46531d6

Browse files
authored
F43 (#460)
* make build for fedora 43 * fix missing icon on f43 * handle auth token format change * bump version * update changelogs * update runners lol * update webkit2gtk in runners * update go version, use preinstalled awscli * update coverage action * remove regex test case
1 parent 182585d commit 46531d6

12 files changed

Lines changed: 41 additions & 38 deletions

File tree

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.14.1
2+
current_version = 0.15.0
33
commit = False
44
tag = False
55

.github/workflows/ci.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: push
33
jobs:
44
test:
55
name: Run tests
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-latest
77
timeout-minutes: 30
88
strategy:
99
fail-fast: false
@@ -16,22 +16,20 @@ jobs:
1616

1717
- uses: actions/setup-go@v5
1818
with:
19-
go-version: "1.19"
19+
go-version: "1.25"
2020

2121
- name: Install apt dependencies
2222
run: |
2323
sudo apt update
2424
sudo apt install \
2525
gcc \
2626
pkg-config \
27-
libwebkit2gtk-4.0-dev \
27+
libwebkit2gtk-4.1-dev \
2828
libjson-glib-dev \
2929
make \
3030
wget \
3131
rpm \
32-
awscli \
3332
libreoffice
34-
sudo rm /usr/local/bin/aws # whyyy
3533
3634
- uses: actions/cache@v4
3735
with:
@@ -73,8 +71,8 @@ jobs:
7371
7472
- name: Copy new auth tokens to S3
7573
run: |
76-
/usr/bin/aws s3 cp .auth_tokens.json s3://fusefs-travis/$ACCOUNT_TYPE/
77-
/usr/bin/aws s3 cp fusefs_tests.log s3://fusefs-travis/$ACCOUNT_TYPE/
74+
aws s3 cp .auth_tokens.json s3://fusefs-travis/$ACCOUNT_TYPE/
75+
aws s3 cp fusefs_tests.log s3://fusefs-travis/$ACCOUNT_TYPE/
7876
env:
7977
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
8078
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -88,7 +86,7 @@ jobs:
8886
if: always()
8987

9088
- name: Convert coverage to lcov
91-
uses: jandelgado/gcov2lcov-action@v1.0.5
89+
uses: jandelgado/gcov2lcov-action@v1.2.0
9290
if: always()
9391

9492
- name: Send test coverage to Coveralls
@@ -105,7 +103,7 @@ jobs:
105103
name: Complete Coveralls run
106104
needs: test
107105
if: always()
108-
runs-on: ubuntu-20.04
106+
runs-on: ubuntu-latest
109107
steps:
110108
- name: Coveralls finished
111109
uses: coverallsapp/github-action@v2

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ journalctl --user -u $SERVICE_NAME --since today
170170
## Building onedriver yourself
171171

172172
In addition to the traditional [Go tooling](https://golang.org/dl/), you will
173-
need a C compiler and development headers for `webkit2gtk-4.0` and `json-glib`.
173+
need a C compiler and development headers for `webkit2gtk-4.1` and `json-glib`.
174174
On Fedora, these can be obtained with
175-
`dnf install golang gcc pkg-config webkit2gtk3-devel json-glib-devel`. On
175+
`dnf install golang gcc pkg-config webkit2gtk4.1-devel json-glib-devel`. On
176176
Ubuntu, these dependencies can be installed with
177-
`apt install golang gcc pkg-config libwebkit2gtk-4.0-dev libjson-glib-dev`.
177+
`apt install golang gcc pkg-config libwebkit2gtk-4.1-dev libjson-glib-dev`.
178178

179179
```bash
180180
# to build and run the binary

cgo-helper.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ if [ -n "$CGO_ENABLED" ] && [ "$CGO_ENABLED" -eq 0 ]; then
77
exit 0
88
fi
99

10-
if pkg-config webkit2gtk-4.0; then
11-
sed -i 's/webkit2gtk-4.1/webkit2gtk-4.0/g' fs/graph/oauth2_gtk.go
12-
elif ! pkg-config webkit2gtk-4.1; then
10+
if ! pkg-config webkit2gtk-4.1; then
1311
echo "webkit2gtk development headers must be installed"
1412
exit 1
1513
fi

cmd/common/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/rs/zerolog/log"
1313
)
1414

15-
const version = "0.14.1"
15+
const version = "0.15.0"
1616

1717
var commit string
1818

cmd/onedriver-launcher/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func newMountRow(config common.Config, mount string) (*gtk.ListBoxRow, *gtk.Swit
304304
})
305305

306306
mountpointSettingsBtn, _ := gtk.MenuButtonNew()
307-
icon, _ := gtk.ImageNewFromIconName("emblem-system-symbolic", gtk.ICON_SIZE_BUTTON)
307+
icon, _ := gtk.ImageNewFromIconName("applications-system-symbolic", gtk.ICON_SIZE_BUTTON)
308308
mountpointSettingsBtn.SetImage(icon)
309309
popover, _ := gtk.PopoverNew(mountpointSettingsBtn)
310310
mountpointSettingsBtn.SetPopover(popover)

fs/graph/oauth2.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ package graph
22

33
import (
44
"encoding/json"
5-
"errors"
65
"fmt"
76
"io/ioutil"
87
"net/http"
98
"net/url"
109
"os"
11-
"regexp"
1210
"strings"
1311
"time"
1412

@@ -158,13 +156,13 @@ func getAuthCodeHeadless(a AuthConfig, accountName string) string {
158156

159157
// parseAuthCode is used to parse the auth code out of the redirect the server gives us
160158
// after successful authentication
161-
func parseAuthCode(url string) (string, error) {
162-
rexp := regexp.MustCompile("code=([a-zA-Z0-9-_.])+")
163-
code := rexp.FindString(url)
164-
if len(code) == 0 {
165-
return "", errors.New("invalid auth code")
159+
func parseAuthCode(authURL string) (string, error) {
160+
parsed, err := url.Parse(authURL)
161+
if err != nil {
162+
return "", err
166163
}
167-
return code[5:], nil
164+
params := parsed.Query()
165+
return params.Get("code"), nil
168166
}
169167

170168
// Exchange an auth code for a set of access tokens (returned as a new Auth struct).

fs/graph/oauth2_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@ import (
99
)
1010

1111
func TestAuthCodeFormat(t *testing.T) {
12-
// arbitrary regext test
13-
code, err := parseAuthCode("codecode=asd-965198osATYjfb._knlwoieurow*sdjf")
14-
assert.NoError(t, err)
15-
assert.Equal(t, "asd-965198osATYjfb._knlwoieurow", code,
16-
"Auth code parser did not succeed against arbitrary character test.")
17-
1812
// faked personal auth code
19-
code, err = parseAuthCode("https://login.live.com/oauth20_desktop.srf?code=M.R3_BAY.abcd526-817f-d8e9-590c-1227b45c7be2&lc=4105")
13+
code, err := parseAuthCode("https://login.live.com/oauth20_desktop.srf?code=M.R3_BAY.abcd526-817f-*!$d8e9-590c-1227b45c7be2&lc=4105")
2014
assert.NoError(t, err)
21-
assert.Equal(t, "M.R3_BAY.abcd526-817f-d8e9-590c-1227b45c7be2", code,
15+
assert.Equal(t, "M.R3_BAY.abcd526-817f-*!$d8e9-590c-1227b45c7be2", code,
2216
"Personal auth code did not match expected result.")
2317

2418
// faked business auth code

onedriver.spec

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: onedriver
2-
Version: 0.14.1
2+
Version: 0.15.0
33
Release: 1%{?dist}
44
Summary: A native Linux filesystem for Microsoft Onedrive
55

@@ -15,7 +15,7 @@ BuildRequires: golang >= 1.17.0
1515
BuildRequires: git
1616
BuildRequires: gcc
1717
BuildRequires: pkg-config
18-
BuildRequires: webkit2gtk3-devel
18+
BuildRequires: webkit2gtk4.1-devel
1919
Requires: fuse3
2020

2121
%description
@@ -71,6 +71,12 @@ cp pkg/resources/%{name}.1.gz %{buildroot}/usr/share/man/man1
7171
%attr(644, root, root) /usr/share/man/man1/%{name}.1.gz
7272

7373
%changelog
74+
* Fri Jan 30 2026 Jeff Stafford <jeff.stafford@protonmail.com> - 0.15.0
75+
- Slight refresh of the onedriver UI to look nicer.
76+
- Fix an authentication bug (Microsoft changed the auth format and I was using a
77+
regex to parse the token when I shouldn't have been).
78+
- Update to webkit2gtk-4.1 (what all major distros are using now).
79+
7480
* Wed Oct 18 2023 Jeff Stafford <jeff.stafford@protonmail.com> - 0.14.1
7581
- Fixes a bug with file corruption in some scenarios from version 0.14.0.
7682

pkg/debian/changelog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
onedriver (0.15.0-1) noble; urgency=low
2+
3+
* Slight refresh of the onedriver UI to look nicer.
4+
* Fix an authentication bug (Microsoft changed the auth format and I was
5+
using a regex to parse the token when I shouldn't have been).
6+
* Update to webkit2gtk-4.1 (what all distros are using now).
7+
8+
-- Jeff Stafford <jeff.stafford@protonmail.com> Fri, 30 Jan 2026 15:30:00 -0800
9+
110
onedriver (0.14.1-1) jammy; urgency=low
211

312
* Fixes a bug with file corruption in some scenarios from version 0.14.0.

0 commit comments

Comments
 (0)