Skip to content

Commit

Permalink
Debian packaging
Browse files Browse the repository at this point in the history
* Debian packaging
* Some styling fixes
  • Loading branch information
gr211 authored Jun 20, 2020
1 parent 71e2dfb commit 857b470
Show file tree
Hide file tree
Showing 16 changed files with 417 additions and 198 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
rust:
- 1.43.1 # MSRV
- 1.44.1 # MSRV

steps:
- name: Checkout
Expand All @@ -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
Expand All @@ -48,19 +48,18 @@ 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
env:
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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
rust:
- 1.44.0 # MSRV
- 1.44.1 # MSRV

steps:
- name: Checkout
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Cargo.lock

*~
*#
*.deb
*.swp
36 changes: 22 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@ 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/
mkdir -p $(sharedir)/icons/hicolor/128x128/apps/
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
Expand All @@ -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

49 changes: 13 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,25 @@ 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...

<kbd>![authenticator-rs](./authenticator-rs-main.png "Main view")</kbd>
<kbd>![authenticator-rs](./authenticator-rs-edit-account.png "Main view")</kbd>
<kbd>![authenticator-rs](./authenticator-rs-add-group.png "Main view")</kbd>
![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

Authenticator-rs is published under the [GNU GENERAL PUBLIC LICENSE v3](./README.md).

## 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

Expand All @@ -68,4 +40,9 @@ Download from the [release](https://github.com/grumlimited/authenticator-rs/rele
cargo install --path=.

$HOME/.cargo/bin/authenticator-rust


## 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/) .
Binary file modified authenticator-rs-add-group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified authenticator-rs-edit-account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified authenticator-rs-main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions data/deb/control
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions data/deb/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

chmod +x /usr/bin/authenticator-rs

exit 0
Binary file modified data/uk.co.grumlimited.authenticator-rs.128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/uk.co.grumlimited.authenticator-rs.64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions data/uk.co.grumlimited.authenticator-rs.desktop
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 857b470

Please sign in to comment.