Compare commits

...

25 Commits

Author SHA1 Message Date
Prateek Sunal
a59ca2bdf0 fix(auth): also move the pacman build to artifacts 2024-06-22 23:32:54 +05:30
Neeraj Gupta
47ad7c7827 [auth] Update logs (#2258)
## Description

## Tests
2024-06-22 23:09:51 +05:30
Prateek Sunal
516c67e6e9 [FIX(auth)] Run pacman build on beta, fix deps (#2257)
## Description

- Only Build pacman for beta releases
- Fix dependencies
- Bump version
2024-06-22 23:06:49 +05:30
Prateek Sunal
e7970df6cf chore: bump version 2024-06-22 23:00:36 +05:30
Prateek Sunal
3ac4294c2c fix(auth): only run pacman build on beta, fix deps 2024-06-22 22:59:49 +05:30
Neeraj Gupta
c8451ecc64 [auth] Update logs 2024-06-22 22:47:38 +05:30
Prateek Sunal
f5a31397f3 chore(auth): bump to v3.0.16 2024-06-22 22:41:58 +05:30
Prateek Sunal
11b443a3f9 fix(auth): bundle metainfo linux 2024-06-22 22:41:58 +05:30
Manav Rathi
c95605127d [server] Allow replication without Cloudflare worker (#2254)
## Description
I recently started self hosting an instance of Ente. All went well until
I tried to enable replication.

This PR adds an option that allows replication to be enabled without a
Cloudflare worker, useful for self hosting.

## Tests
It doesn't look like there are any automated tests that I can add to,
but let me know if I'm wrong. Otherwise, I tested this on my own
instance and it's working as expected.
2024-06-22 22:35:31 +05:30
Neeraj Gupta
7bce4e25ae Update adding-icons.md 2024-06-22 22:34:30 +05:30
Victor Benincasa
19383ad360 Warning about icon sizes and instructions on matching the icon to the issuer. 2024-06-22 22:34:30 +05:30
Prateek Sunal
0b426fc1ab [FEAT] Auth goodies for linux (#2255)
## Description

- Pacman Build for Arch linux (Alpha)
- Add metainfo for linux
- Fix RPM build
2024-06-22 22:31:03 +05:30
Kermina Awad
81b07e772d make replication.worker-url optional 2024-06-22 12:49:35 -04:00
Prateek Sunal
65770ff58b fix(auth): update script for pacman 2024-06-22 22:13:15 +05:30
Prateek Sunal
bf926fe4b6 feat(auth): add appdata for ente_auth 2024-06-22 22:13:00 +05:30
Victor Benincasa
de36d1f9fb Additional optimizations in file size and icon quality. 2024-06-22 20:20:24 +05:30
Victor Benincasa
18fb24fcd2 Additional optimizations in file size and icon quality. 2024-06-22 20:19:23 +05:30
Manav Rathi
5687f75b0b [web] Fix for the staging deployment change (#2253)
Fix for https://github.com/ente-io/ente/pull/2252

> Error: An error occurred trying to start process '/usr/bin/bash' with
working
  directory '/home/runner/work/ente/ente/web'. No such file or directory
2024-06-22 18:58:39 +05:30
Manav Rathi
be82595e82 [web] Fix for the staging deployment change
Fix for https://github.com/ente-io/ente/pull/2252

> Error: An error occurred trying to start process '/usr/bin/bash' with working
  directory '/home/runner/work/ente/ente/web'. No such file or directory
2024-06-22 18:57:18 +05:30
Manav Rathi
d200bce7ea [web] Deploy to staging from staging/web branch if it exists (#2252)
This allows us to temporarily deploy arbitrary branches to staging by
pushing to a staging/web branch. Removing that branch reverts to the
existing and default behaviour of deploying main.

Untested (need to deploy and trigger)

Refs:

-
942f6a9fe9
-
https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context
-
https://stackoverflow.com/questions/57819539/github-actions-how-to-share-a-calculated-value-between-job-steps
2024-06-22 18:49:01 +05:30
Manav Rathi
05e490aa91 [web] Build the staging/web branch when deploying if it exists
This allows us to temporarily deploy arbitrary branches to staging by pushing to
a staging/web branch. Removing that branch reverts to the existing and default
behaviour of deploying main.

Untested (need to deploy and trigger)

Refs:

- 942f6a9fe9
- https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context
- https://stackoverflow.com/questions/57819539/github-actions-how-to-share-a-calculated-value-between-job-steps
2024-06-22 18:47:53 +05:30
Neeraj Gupta
32757c3fb6 [auth] Lint fix (#2248)
## Description

## Tests
2024-06-22 16:56:02 +05:30
Neeraj Gupta
411e444295 [auth] Lint fix 2024-06-22 16:54:58 +05:30
Prateek Sunal
077d509c23 feat(workflow/auth): update source of flutter_distributor 2024-06-18 00:58:58 +05:30
Prateek Sunal
062b3f7176 feat(auth/linux): add pacman build 2024-06-18 00:58:42 +05:30
14 changed files with 142 additions and 1578 deletions

View File

@@ -145,7 +145,7 @@ jobs:
- name: Install dependencies for desktop build
run: |
sudo apt-get update -y
sudo apt-get install -y libsecret-1-dev libsodium-dev libwebkit2gtk-4.0-dev libfuse2 ninja-build libgtk-3-dev dpkg-dev pkg-config rpm patchelf libsqlite3-dev locate libayatana-appindicator3-dev libffi-dev libtiff5
sudo apt-get install -y libsecret-1-dev libsodium-dev libwebkit2gtk-4.0-dev libfuse2 ninja-build libgtk-3-dev dpkg-dev pkg-config rpm patchelf libsqlite3-dev locate libayatana-appindicator3-dev libffi-dev libtiff5 xz-utils libarchive-tools
sudo updatedb --localpaths='/usr/lib/x86_64-linux-gnu'
- name: Install appimagetool
@@ -157,10 +157,16 @@ jobs:
- name: Build desktop app
run: |
flutter config --enable-linux-desktop
dart pub global activate flutter_distributor
# dart pub global activate flutter_distributor
dart pub global activate --source git https://github.com/prateekmedia/flutter_distributor --git-ref pacman --git-path packages/flutter_distributor
# Run below command if it is a beta or nightly
if [[ ${{ github.ref }} =~ beta|nightly ]]; then
flutter_distributor package --platform=linux --targets=pacman --skip-clean
mv dist/**/*-*-linux.pacman artifacts/ente-${{ github.ref_name }}-x86_64.pacman
fi
flutter_distributor package --platform=linux --targets=rpm --skip-clean
flutter_distributor package --platform=linux --targets=appimage --skip-clean
mv dist/**/*-*-linux.rpm artifacts/ente-${{ github.ref_name }}-x86_64.rpm
flutter_distributor package --platform=linux --targets=appimage --skip-clean
mv dist/**/*-*-linux.AppImage artifacts/ente-${{ github.ref_name }}-x86_64.AppImage
- name: Generate checksums

View File

@@ -1,5 +1,7 @@
name: "Deploy staging (web)"
# Builds the "staging/web" branch if it exists, "main" otherwise.
on:
schedule:
# Run everyday at ~3:00 PM IST
@@ -18,9 +20,20 @@ jobs:
working-directory: web
steps:
- name: Checkout code
- name: Determine branch to build
id: select-branch
working-directory: ${{ github.workspace }}
run: |
if git ls-remote --exit-code --heads https://github.com/ente-io/ente refs/heads/staging/web; then
echo "branch=staging/web" >> $GITHUB_OUTPUT
else
echo "branch=main" >> $GITHUB_OUTPUT
fi
- name: Checkout ${{ steps.select-branch.outputs.branch }}
uses: actions/checkout@v4
with:
ref: ${{ steps.select-branch.outputs.branch }}
submodules: recursive
- name: Setup node and enable yarn caching

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 959 B

View File

@@ -7,6 +7,15 @@ If you would like to add your own custom icon, please open a pull-request with
the relevant SVG placed within `assets/custom-icons/icons` and add the
corresponding entry within `assets/custom-icons/_data/custom-icons.json`.
Please be careful to upload small and optimized icon files. If your icon file
is over 50KB, it is likely not optimized.
Note that the correspondence between the icon and the issuer is based on the name
of the issuer provided by the user, excluding spaces. Only the text before the
first dot "." or left parentheses "(" will be used for icon matching.
e.g. Issuer name provided: "github.com (Main account)" - Then "github" will be
used for matching.
This JSON file contains the following attributes:
| Attribute | Usecase | Required |

View File

@@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:logging/logging.dart';
/*
Reference from
@@ -9,6 +9,7 @@ https://github.com/realm/realm-dart/blob/main/packages/realm_dart/lib/src/handle
https://github.com/realm/realm-dart/pull/1378
*/
HttpClient windowsHttpClient() {
final logger = Logger("WindowsHttpClient");
const isrgRootX1CertPEM = // The root certificate used by lets encrypt
'''
subject=CN=ISRG Root X1,O=Internet Security Research Group,C=US
@@ -48,14 +49,16 @@ Dfvp7OOGAN6dEOM4+qR9sdjoSYKEBpsr6GtPAQw4dy753ec5
if (Platform.isWindows) {
final context = SecurityContext(withTrustedRoots: true);
try {
logger.info('Adding certificate to trusted certificates');
context.setTrustedCertificatesBytes(
const AsciiEncoder().convert(isrgRootX1CertPEM),
);
debugPrint("Certificate added to trusted certificates");
logger.info("Certificate added to trusted certificates");
return HttpClient(context: context);
} on TlsException catch (e) {
debugPrint(
"Error adding certificate to trusted certificates: ${e.osError?.message}");
logger.warning(
"Error adding certificate to trusted certificates: ${e.osError?.message}",
);
// certificate is already trusted. Nothing to do here
if (e.osError?.message.contains("CERT_ALREADY_IN_HASH_TABLE") != true) {
rethrow;

View File

@@ -1,6 +1,8 @@
display_name: Auth
license: GPLv3
metainfo: linux/packaging/ente_auth.appdata.xml
icon: assets/icons/auth-icon.png
keywords:

View File

@@ -10,6 +10,8 @@ license: GPLv3
icon: assets/icons/auth-icon.png
installed_size: 36000
metainfo: linux/packaging/ente_auth.appdata.xml
dependencies:
- libwebkit2gtk-4.0-37
- libsqlite3-0

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>ente_auth</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>AGPL-3.0</project_license>
<name>Ente Auth</name>
<summary>Open source 2FA authenticator, with end-to-end encrypted backups</summary>
<description>
<p>Auth provides end-to-end encrypted cloud backups so you don't have to worry about losing your tokens. Our cryptography has been externally audited.</p>
<p>Auth has an app for every platform. Mobile, desktop and web. Your codes sync across all your devices, end-to-end encrypted.</p>
<p>Auth also comes with Offline mode, tags, icons, pins, import/export and more</p>
</description>
<launchable type="desktop-id">ente_auth.desktop</launchable>
<url type="homepage">https://ente.io/auth</url>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/ente-io/ente/main/.github/assets/auth.png</image>
</screenshot>
</screenshots>
<releases>
<release version="3.0.12" date="2024-06-17"/>
</releases>
<provides>
<id>ente_auth.desktop</id>
</provides>
<content_rating type="oars-1.0" />
<developer id="io.github.ente-io.ente">
<name>Ente.io Developers</name>
</developer>
<update_contact>human@ente.io</update_contact>
</component>

View File

@@ -0,0 +1,58 @@
display_name: Auth
package_name: auth
maintainer:
name: Ente.io Developers
email: human@ente.io
licenses:
- GPLv3
icon: assets/icons/auth-icon.png
installed_size: 36000
metainfo: linux/packaging/ente_auth.appdata.xml
dependencies:
- c-ares
- ffmpeg
- gtk3
- http-parser
- libevent
- libvpx
- libxslt
- libxss
- minizip
- nss
- re2
- snappy
- libnotify
- libappindicator-gtk3
keywords:
- Authentication
- 2FA
generic_name: Ente Authentication
categories:
- Utility
supported_mime_type:
- x-scheme-handler/enteauth
postinstall_scripts:
- gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
- update-desktop-database -q
- if [ ! -e /usr/lib/libsodium.so.23 ]; then
- ln -s /usr/lib/libsodium.so /usr/lib/libsodium.so.23
- fi
postuninstall_scripts:
- post_install
postremove_scripts:
- gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
- update-desktop-database -q
- if [ -e /usr/lib/libsodium.so.23 ]; then
- rm /usr/lib/libsodium.so.23
- fi
startup_notify: false

View File

@@ -9,6 +9,8 @@ url: https://github.com/ente-io/ente
display_name: Auth
metainfo: linux/packaging/ente_auth.appdata.xml
requires:
- libsqlite3x
- webkit2gtk4.0

View File

@@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
version: 3.0.15+315
version: 3.0.17+317
publish_to: none
environment:

View File

@@ -317,7 +317,7 @@ internal:
replication:
enabled: false
# The Cloudflare worker to use to download files from the primary hot
# bucket. Must be specified if replication is enabled.
# bucket. If this isn't specified, files will be downloaded directly.
worker-url:
# Number of go routines to spawn for replication
# This is not related to the worker-url above.

View File

@@ -87,10 +87,11 @@ func (c *ReplicationController3) StartReplication() error {
workerURL := viper.GetString("replication.worker-url")
if workerURL == "" {
return fmt.Errorf("replication.worker-url was not defined")
log.Infof("replication.worker-url was not defined, files will downloaded directly during replication")
} else {
log.Infof("Worker URL to download objects for replication v3 is: %s", workerURL)
}
c.workerURL = workerURL
log.Infof("Worker URL to download objects for replication v3 is: %s", workerURL)
c.createMetrics()
err := c.createTemporaryStorage()
@@ -414,7 +415,7 @@ func (c *ReplicationController3) downloadFromB2ViaWorker(objectKey string, file
q.Add("src", presignedEncodedURL)
request.URL.RawQuery = q.Encode()
if c.S3Config.AreLocalBuckets() {
if c.S3Config.AreLocalBuckets() || c.workerURL == "" {
originalURL := request.URL
request, err = http.NewRequest("GET", presignedURL, nil)
if err != nil {