Compare commits
No commits in common. "b382571c0d723c4e7ee9ee2cae375289015bf475" and "0db4f4c4abce421fefe7e8d5e01fae93e317c93d" have entirely different histories.
b382571c0d
...
0db4f4c4ab
10 changed files with 141 additions and 14 deletions
|
@ -122,6 +122,9 @@
|
||||||
AWS_ENDPOINT_URL = "https://s3.cy7.sh";
|
AWS_ENDPOINT_URL = "https://s3.cy7.sh";
|
||||||
AWS_ACCESS_KEY_ID = "$(cat /run/secrets/aws/key_id)";
|
AWS_ACCESS_KEY_ID = "$(cat /run/secrets/aws/key_id)";
|
||||||
AWS_SECRET_ACCESS_KEY = "$(cat /run/secrets/aws/key_secret)";
|
AWS_SECRET_ACCESS_KEY = "$(cat /run/secrets/aws/key_secret)";
|
||||||
|
|
||||||
|
# bitwarden ssh agent
|
||||||
|
SSH_AUTH_SOCK = "$HOME/.bitwarden-ssh-agent.sock";
|
||||||
};
|
};
|
||||||
|
|
||||||
home.sessionPath = [
|
home.sessionPath = [
|
||||||
|
@ -149,15 +152,4 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nix-index-database.comma.enable = true;
|
programs.nix-index-database.comma.enable = true;
|
||||||
|
|
||||||
programs.neovim = {
|
|
||||||
enable = true;
|
|
||||||
viAlias = true;
|
|
||||||
vimAlias = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.ssh = {
|
|
||||||
enable = true;
|
|
||||||
addKeysToAgent = "yes";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,7 +329,6 @@
|
||||||
curl
|
curl
|
||||||
pcre2
|
pcre2
|
||||||
gsettings-desktop-schemas
|
gsettings-desktop-schemas
|
||||||
fzf
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
programs.evolution.enable = true;
|
programs.evolution.enable = true;
|
||||||
|
@ -391,6 +390,4 @@
|
||||||
nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
|
nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
|
||||||
programs.fuse.userAllowOther = true;
|
programs.fuse.userAllowOther = true;
|
||||||
nix.settings.sandbox = false;
|
nix.settings.sandbox = false;
|
||||||
|
|
||||||
programs.ssh.startAgent = true;
|
|
||||||
}
|
}
|
||||||
|
|
7
overlay/attic/default.nix
Normal file
7
overlay/attic/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
final: prev: {
|
||||||
|
attic-server = prev.attic-server.overrideAttrs {
|
||||||
|
patches = [
|
||||||
|
./prefetch-8-chunks.patch
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
14
overlay/attic/prefetch-8-chunks.patch
Normal file
14
overlay/attic/prefetch-8-chunks.patch
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
diff --git a/server/src/api/binary_cache.rs b/server/src/api/binary_cache.rs
|
||||||
|
index 02e4857..b522154 100644
|
||||||
|
--- a/server/src/api/binary_cache.rs
|
||||||
|
+++ b/server/src/api/binary_cache.rs
|
||||||
|
@@ -215,7 +215,7 @@ async fn get_nar(
|
||||||
|
let chunk = chunks[0].as_ref().unwrap();
|
||||||
|
let remote_file = &chunk.remote_file.0;
|
||||||
|
let storage = state.storage().await?;
|
||||||
|
- match storage.download_file_db(remote_file, false).await? {
|
||||||
|
+ match storage.download_file_db(remote_file, true).await? {
|
||||||
|
Download::Url(url) => Ok(Redirect::temporary(&url).into_response()),
|
||||||
|
Download::AsyncRead(stream) => {
|
||||||
|
let stream = ReaderStream::new(stream).map_err(|e| {
|
||||||
|
|
9
overlay/bitwarden/default.nix
Normal file
9
overlay/bitwarden/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
final: prev: {
|
||||||
|
bitwarden-desktop = prev.bitwarden-desktop.overrideAttrs (
|
||||||
|
finalAttrs: prevAttrs: {
|
||||||
|
patches = prevAttrs.patches ++ [
|
||||||
|
./ssh-agent-no-confirm.patch
|
||||||
|
];
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
34
overlay/bitwarden/ssh-agent-no-confirm.patch
Normal file
34
overlay/bitwarden/ssh-agent-no-confirm.patch
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
diff --git a/apps/desktop/desktop_native/core/src/ssh_agent/mod.rs b/core/src/ssh_agent/mod.rs
|
||||||
|
index 4e304cc..8203dca 100644
|
||||||
|
--- a/apps/desktop/desktop_native/core/src/ssh_agent/mod.rs
|
||||||
|
+++ b/apps/desktop/desktop_native/core/src/ssh_agent/mod.rs
|
||||||
|
@@ -44,28 +44,7 @@ impl ssh_agent::Agent<peerinfo::models::PeerInfo> for BitwardenDesktopAgent {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
- let request_id = self.get_request_id().await;
|
||||||
|
- println!(
|
||||||
|
- "[SSH Agent] Confirming request from application: {}",
|
||||||
|
- info.process_name()
|
||||||
|
- );
|
||||||
|
-
|
||||||
|
- let mut rx_channel = self.get_ui_response_rx.lock().await.resubscribe();
|
||||||
|
- self.show_ui_request_tx
|
||||||
|
- .send(SshAgentUIRequest {
|
||||||
|
- request_id,
|
||||||
|
- cipher_id: Some(ssh_key.cipher_uuid.clone()),
|
||||||
|
- process_name: info.process_name().to_string(),
|
||||||
|
- is_list: false,
|
||||||
|
- })
|
||||||
|
- .await
|
||||||
|
- .expect("Should send request to ui");
|
||||||
|
- while let Ok((id, response)) = rx_channel.recv().await {
|
||||||
|
- if id == request_id {
|
||||||
|
- return response;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- false
|
||||||
|
+ true
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn can_list(&self, info: &peerinfo::models::PeerInfo) -> bool {
|
|
@ -1,4 +1,12 @@
|
||||||
{ inputs }:
|
{ inputs }:
|
||||||
|
let
|
||||||
|
overlays = [
|
||||||
|
./zipline
|
||||||
|
./bitwarden
|
||||||
|
./attic
|
||||||
|
];
|
||||||
|
importedOverlays = map (m: import m) overlays;
|
||||||
|
in
|
||||||
[
|
[
|
||||||
(
|
(
|
||||||
final: prev:
|
final: prev:
|
||||||
|
|
14
overlay/vscode.nix
Normal file
14
overlay/vscode.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
final: prev: {
|
||||||
|
vscode-extensions = prev.vscode-extensions // {
|
||||||
|
github = prev.vscode-extensions.github // {
|
||||||
|
codespaces = prev.vscode-utils.buildVscodeMarketplaceExtension {
|
||||||
|
mktplcRef = {
|
||||||
|
publisher = "github";
|
||||||
|
name = "codespaces";
|
||||||
|
version = "1.17.3";
|
||||||
|
hash = "sha256-idJFYHJ4yeqpFZBX55Y0v1yfzgqyhS0MrC4yIto7i7w=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
7
overlay/zipline/default.nix
Normal file
7
overlay/zipline/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
final: prev: {
|
||||||
|
zipline = prev.zipline.overrideAttrs {
|
||||||
|
patches = [
|
||||||
|
./no-check-bucket.patch
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
45
overlay/zipline/no-check-bucket.patch
Normal file
45
overlay/zipline/no-check-bucket.patch
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
diff --git a/src/lib/datasource/S3.ts b/src/lib/datasource/S3.ts
|
||||||
|
index 089dd64..39dd8f4 100644
|
||||||
|
--- a/src/lib/datasource/S3.ts
|
||||||
|
+++ b/src/lib/datasource/S3.ts
|
||||||
|
@@ -4,7 +4,6 @@ import {
|
||||||
|
DeleteObjectCommand,
|
||||||
|
DeleteObjectsCommand,
|
||||||
|
GetObjectCommand,
|
||||||
|
- ListBucketsCommand,
|
||||||
|
ListObjectsCommand,
|
||||||
|
PutObjectCommand,
|
||||||
|
S3Client,
|
||||||
|
@@ -38,32 +37,6 @@ export class S3Datasource extends Datasource {
|
||||||
|
endpoint: this.options.endpoint ?? undefined,
|
||||||
|
forcePathStyle: this.options.forcePathStyle ?? false,
|
||||||
|
});
|
||||||
|
-
|
||||||
|
- this.ensureBucketExists();
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- private async ensureBucketExists() {
|
||||||
|
- try {
|
||||||
|
- const res = await this.client.send(new ListBucketsCommand());
|
||||||
|
- if (res.$metadata.httpStatusCode !== 200) {
|
||||||
|
- this.logger
|
||||||
|
- .error('there was an error while listing buckets', res.$metadata as Record<string, unknown>)
|
||||||
|
- .error('zipline will now exit');
|
||||||
|
- process.exit(1);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (!res.Buckets?.find((bucket) => bucket.Name === this.options.bucket)) {
|
||||||
|
- this.logger.error(`bucket ${this.options.bucket} does not exist`).error('zipline will now exit');
|
||||||
|
- process.exit(1);
|
||||||
|
- }
|
||||||
|
- } catch (e) {
|
||||||
|
- this.logger
|
||||||
|
- .error('there was an error while listing buckets', e as Record<string, unknown>)
|
||||||
|
- .error('zipline will now exit');
|
||||||
|
- process.exit(1);
|
||||||
|
- } finally {
|
||||||
|
- this.logger.debug(`bucket ${this.options.bucket} exists`);
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
|
||||||
|
public async get(file: string): Promise<Readable | null> {
|
Loading…
Add table
Add a link
Reference in a new issue