diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5faeee06..011a9c3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: rust: - - 1.43.1 # MSRV + - 1.44.1 # MSRV steps: - name: Checkout @@ -30,9 +30,9 @@ jobs: - name: System dependencies run: | sudo apt-get update - sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev libsqlite3-dev libgtk-3-dev + sudo apt-get install -y gcc make libsqlite3-dev libgtk-3-dev - mkdir ~/.cargo/release + mkdir -p ~/.cargo/release - name: Rust toolchain uses: actions-rs/toolchain@v1 @@ -48,12 +48,11 @@ jobs: command: build - name: Create binary - uses: actions-rs/cargo@v1 env: - CARGO_TARGET_DIR: ~/.cargo - with: - command: install - args: --path=. --root=. + DESTDIR: '~/authenticator-rs-deb' + run: | + sudo mkdir -p $DESTDIR + RELEASE_VERSION=${{ github.event.release.tag_name }} DESTDIR=$DESTDIR make debian-pkg - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -61,6 +60,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: '${{ github.event.release.upload_url }}' - asset_path: ./bin/authenticator-rs - asset_name: 'authenticator-rs-${{ github.event.release.tag_name }}-x86_64' + asset_path: 'authenticator-rs-${{ github.event.release.tag_name }}-x86-64.deb' + asset_name: 'authenticator-rs-${{ github.event.release.tag_name }}-x86-64.deb' asset_content_type: application/octet-stream diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5581d405..ece6ae86 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: rust: - - 1.44.0 # MSRV + - 1.44.1 # MSRV steps: - name: Checkout diff --git a/.gitignore b/.gitignore index da58e2bc..8f3ae1a4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ Cargo.lock *~ *# +*.deb +*.swp diff --git a/Makefile b/Makefile index 4f2a2372..bd8668dd 100644 --- a/Makefile +++ b/Makefile @@ -16,15 +16,15 @@ sharedir=$(DESTDIR)$(PREFIX)/share .PHONY : clean clean-all install uninstall # Build the application -target/release/gDiceRoller : src +target/release/authenticator-rs : src cargo build --release # Install onto the system -install : target/release/gDiceRoller +install : target/release/authenticator-rs # Create the bindir, if need be mkdir -p $(bindir) # Install binary - $(INSTALL_PROGRAM) target/release/gDiceRoller $(bindir)/codes.nora.gDiceRoller + $(INSTALL_PROGRAM) target/release/authenticator-rs $(bindir)/authenticator-rs # Create the sharedir and subfolders, if need be mkdir -p $(sharedir)/icons/hicolor/scalable/apps/ mkdir -p $(sharedir)/icons/hicolor/64x64/apps/ @@ -32,28 +32,28 @@ install : target/release/gDiceRoller mkdir -p $(sharedir)/applications/ mkdir -p $(sharedir)/metainfo/ # Install icons - $(INSTALL_DATA) data/codes.nora.gDiceRoller.svg $(sharedir)/icons/hicolor/scalable/apps/codes.nora.gDiceRoller.svg - $(INSTALL_DATA) data/codes.nora.gDiceRoller.64.png $(sharedir)/icons/hicolor/64x64/apps/codes.nora.gDiceRoller.png - $(INSTALL_DATA) data/codes.nora.gDiceRoller.128.png $(sharedir)/icons/hicolor/128x128/apps/codes.nora.gDiceRoller.png + $(INSTALL_DATA) data/uk.co.grumlimited.authenticator-rs.svg $(sharedir)/icons/hicolor/scalable/apps/uk.co.grumlimited.authenticator-rs.svg + $(INSTALL_DATA) data/uk.co.grumlimited.authenticator-rs.64.png $(sharedir)/icons/hicolor/64x64/apps/uk.co.grumlimited.authenticator-rs.png + $(INSTALL_DATA) data/uk.co.grumlimited.authenticator-rs.128.png $(sharedir)/icons/hicolor/128x128/apps/uk.co.grumlimited.authenticator-rs.png # Force icon cache refresh touch $(sharedir)/icons/hicolor # Install application meta-data - $(INSTALL_DATA) data/codes.nora.gDiceRoller.appdata.xml $(sharedir)/metainfo/codes.nora.gDiceRoller.appdata.xml + $(INSTALL_DATA) data/uk.co.grumlimited.authenticator-rs.appdata.xml $(sharedir)/metainfo/uk.co.grumlimited.authenticator-rs.appdata.xml # Install desktop file - $(INSTALL_DATA) data/codes.nora.gDiceRoller.desktop $(sharedir)/applications/codes.nora.gDiceRoller.desktop + $(INSTALL_DATA) data/uk.co.grumlimited.authenticator-rs.desktop $(sharedir)/applications/uk.co.grumlimited.authenticator-rs.desktop # Remove an existing install from the system uninstall : # Remove the desktop file - rm -f $(sharedir)/applications/codes.nora.gDiceRoller.desktop + rm -f $(sharedir)/applications/uk.co.grumlimited.authenticator-rs.desktop # Remove the application metadata - rm -f $(sharedir)/metainfo/codes.nora.gDiceRoller.appdata.xml + rm -f $(sharedir)/metainfo/uk.co.grumlimited.authenticator-rs.appdata.xml # Remove the icon - rm -f $(sharedir)/icons/hicolor/scalable/apps/codes.nora.gDiceRoller.svg - rm -f $(sharedir)/icons/hicolor/64x64/apps/codes.nora.gDiceRoller.png - rm -f $(sharedir)/icons/hicolor/128x128/apps/codes.nora.gDiceRoller.png + rm -f $(sharedir)/icons/hicolor/scalable/apps/uk.co.grumlimited.authenticator-rs.svg + rm -f $(sharedir)/icons/hicolor/64x64/apps/uk.co.grumlimited.authenticator-rs.png + rm -f $(sharedir)/icons/hicolor/128x128/apps/uk.co.grumlimited.authenticator-rs.png # Remove the binary - rm -f $(bindir)/bin/codes.nora.gDiceRoller + rm -f $(bindir)/bin/authenticator-rs # Remove all files clean-all : clean @@ -63,3 +63,11 @@ clean-all : clean clean : rm -rf target/* +debian-pkg : install + mkdir -p $(DESTDIR)/DEBIAN + cp data/deb/control $(DESTDIR)/DEBIAN/ + echo "Version: $(RELEASE_VERSION)" >> $(DESTDIR)/DEBIAN/control + cp data/deb/postinst $(DESTDIR)/DEBIAN/ + chmod 775 $(DESTDIR)/DEBIAN/postinst + dpkg-deb --build $(DESTDIR) authenticator-rs-$(RELEASE_VERSION)-x86-64.deb + diff --git a/README.md b/README.md index f731ec73..028c50a6 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ in the latest versions of python shipped with [Arch Linux](https://www.archlinux It is by no means as feature-rich as its python relative, more like a diamond in the rough. Well, maybe not a diamond, but definitely in the rough... -![authenticator-rs](./authenticator-rs-main.png "Main view") -![authenticator-rs](./authenticator-rs-edit-account.png "Main view") -![authenticator-rs](./authenticator-rs-add-group.png "Main view") +![authenticator-rs](./authenticator-rs-main.png "Main view") +![authenticator-rs](./authenticator-rs-edit-account.png "Main view") +![authenticator-rs](./authenticator-rs-add-group.png "Main view") ## License @@ -23,43 +23,15 @@ Authenticator-rs is published under the [GNU GENERAL PUBLIC LICENSE v3](./README ## Changelog -### 0.0.6 +See [releases](https://github.com/grumlimited/authenticator-rs/releases). -* Plain GTK3 version -* Not production-ready. Missing lots of UI input validation. +## Installing -### 0.0.5 - -* Last Iced version - -### 0.0.4 - -* Editing existing accounts - -### 0.0.3 - -* SQLite backend! _(deleting/updating accounts coming soon! )_ - -### 0.0.2 - -* Adding new accounts -* More error handling - -### 0.0.1 - -_Only tested on Linux (Arch Linux to be specific)._ - -* Initial release; -* Generating TOTP tokens for multiple accounts, every 30 seconds; -* Copy and pasting tokens to clipboard. - -## Running +#### Debian Download from the [release](https://github.com/grumlimited/authenticator-rs/releases) page. - chmod +x ./authenticator-rs-0.0.6-x86_64 - - ./authenticator-rs-0.0.6-x86_64 + dpkg -i authenticator-rs-x.x.x-x86-64.deb ## Building @@ -68,4 +40,9 @@ Download from the [release](https://github.com/grumlimited/authenticator-rs/rele cargo install --path=. $HOME/.cargo/bin/authenticator-rust - \ No newline at end of file + +## Assets + +Icon files are from [authenticator](https://gitlab.gnome.org/World/Authenticator). + +Original GTK template from [Nora Codes - gDiceRoller](https://nora.codes/tutorial/speedy-desktop-apps-with-gtk-and-rust/) . \ No newline at end of file diff --git a/authenticator-rs-add-group.png b/authenticator-rs-add-group.png index 0c110f41..e09fbb40 100644 Binary files a/authenticator-rs-add-group.png and b/authenticator-rs-add-group.png differ diff --git a/authenticator-rs-edit-account.png b/authenticator-rs-edit-account.png index d8287110..c9f91112 100644 Binary files a/authenticator-rs-edit-account.png and b/authenticator-rs-edit-account.png differ diff --git a/authenticator-rs-main.png b/authenticator-rs-main.png index 333d4e6a..4649e978 100644 Binary files a/authenticator-rs-main.png and b/authenticator-rs-main.png differ diff --git a/data/deb/control b/data/deb/control new file mode 100644 index 00000000..f3e38ee8 --- /dev/null +++ b/data/deb/control @@ -0,0 +1,8 @@ +Package: authenticator-rs +Section: development +Priority: optional +Architecture: all +Depends: libgtk-3-0, libsqlite3-0 +Maintainer: rgallet_at_grumlimited.co.uk +Description: MFA Authenticator + Authenticator-rs is a TOTP-MFA application written in Rust and GTK3. diff --git a/data/deb/postinst b/data/deb/postinst new file mode 100644 index 00000000..a14c260f --- /dev/null +++ b/data/deb/postinst @@ -0,0 +1,5 @@ +#!/bin/sh + +chmod +x /usr/bin/authenticator-rs + +exit 0 diff --git a/data/uk.co.grumlimited.authenticator-rs.128.png b/data/uk.co.grumlimited.authenticator-rs.128.png index cdb907e5..e979f31a 100644 Binary files a/data/uk.co.grumlimited.authenticator-rs.128.png and b/data/uk.co.grumlimited.authenticator-rs.128.png differ diff --git a/data/uk.co.grumlimited.authenticator-rs.64.png b/data/uk.co.grumlimited.authenticator-rs.64.png index a849f6ec..3f53a629 100644 Binary files a/data/uk.co.grumlimited.authenticator-rs.64.png and b/data/uk.co.grumlimited.authenticator-rs.64.png differ diff --git a/data/uk.co.grumlimited.authenticator-rs.desktop b/data/uk.co.grumlimited.authenticator-rs.desktop index 125e18be..263fe1df 100644 --- a/data/uk.co.grumlimited.authenticator-rs.desktop +++ b/data/uk.co.grumlimited.authenticator-rs.desktop @@ -1,9 +1,9 @@ [Desktop Entry] -Name=Dice Roller -GenericName=Dice Roller -Comment=Roll dice of many different shapes and sizes in all possible combinations. -Categories=Game;GTK -Icon=codes.nora.gDiceRoller -Exec=codes.nora.gDiceRoller +Name=Authenticator RS +GenericName=Authenticator RS +Comment=MFA authenticator +Categories=Office;GTK +Icon=uk.co.grumlimited.authenticator-rs +Exec=uk.co.grumlimited.authenticator-rs Terminal=false Type=Application diff --git a/data/uk.co.grumlimited.authenticator-rs.svg b/data/uk.co.grumlimited.authenticator-rs.svg index 2bfec52a..65f719f5 100644 --- a/data/uk.co.grumlimited.authenticator-rs.svg +++ b/data/uk.co.grumlimited.authenticator-rs.svg @@ -1,122 +1,320 @@ - - - - - - - - - - - image/svg+xml - - - - + + Adwaita Icon Template + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mainwindow.glade b/src/mainwindow.glade index bfac4a5d..595df0b9 100644 --- a/src/mainwindow.glade +++ b/src/mainwindow.glade @@ -42,7 +42,6 @@ main_box True False - 10 vertical @@ -53,27 +52,49 @@ False True - 1 + 0 - - accounts_container + True - False - vertical - 25 + True + edit_account_input_secret_scrollable + never + out + 600 + True + True - - - - + + True + False + 10 + True + + + accounts_container + 250 + True + False + True + vertical + 25 + + + + + + + + + False - False - 2 + True + 1 diff --git a/src/model/account.rs b/src/model/account.rs index 6007424b..05e4266c 100644 --- a/src/model/account.rs +++ b/src/model/account.rs @@ -64,7 +64,8 @@ impl Account { .width_chars(19) .single_line_mode(true) .max_width_chars(50) - .xalign(0.05_f32) + .hexpand(true) + .xalign(0.0) .build(); let image = gtk::ImageBuilder::new().icon_name("edit-copy").build();