Skip to content

Commit

Permalink
chore: mk etc dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Aug 3, 2024
1 parent 9cbef55 commit fd209bc
Show file tree
Hide file tree
Showing 26 changed files with 88 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/latest/download/oranda-installer.sh | sh
oranda build
# Manually added
- run: cp assets/CNAME public/CNAME
- run: cp etc/website/CNAME public/CNAME
# Deploy to our gh-pages branch (creating it if it doesn't exist)
# the "public" dir that oranda made above will become the root dir
# of this branch.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[grafana-badge]: https://img.shields.io/badge/Grafana-Dashboard-orange?style=for-the-badge&logo=grafana
[grafana-url]: https://ymgyt.grafana.net/public-dashboards/863ebddd82c44ddd9a28a68eaac848ff?orgId=1&refresh=1h&from=now-1h&to=now

![Demo](./assets/demo.gif)
![Demo](./etc/demo/demo.gif)

Syndicationd(`synd`) is a TUI feed viewer, based on [feed-rs](https://github.com/feed-rs/feed-rs) and [ratatui](https://github.com/ratatui-org/ratatui).

Expand Down
Binary file removed assets/favicon.ico
Binary file not shown.
56 changes: 28 additions & 28 deletions crates/synd_api/oranda.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"build": {
"static_dir": "assets",
"dist_dir": "website"
},
"styles": {
"theme": "axo_dark",
"favicon": "https://blog.ymgyt.io/favicon.ico"
},
"marketing": {
"social": {
"image": "https://blog.ymgyt.io/images/emoji/crab.png",
"image_alt": "synd",
"twitter_account": "@YAmaguchixt"
}
},
"components": {
"changelog": {
"read_changelog_file": false
},
"artifacts": {
"package_managers": {
"additional": {
"nix": "nix profile install github:ymgyt/syndicationd#synd-api",
"cargo": "cargo install synd-api --locked"
}
}
}
}
"build": {
"static_dir": "etc/website/assets",
"dist_dir": "website"
},
"styles": {
"theme": "axo_dark",
"favicon": "https://blog.ymgyt.io/favicon.ico"
},
"marketing": {
"social": {
"image": "https://blog.ymgyt.io/images/emoji/crab.png",
"image_alt": "synd",
"twitter_account": "@YAmaguchixt"
}
},
"components": {
"changelog": {
"read_changelog_file": false
},
"artifacts": {
"package_managers": {
"additional": {
"nix": "nix profile install github:ymgyt/syndicationd#synd-api",
"cargo": "cargo install synd-api --locked"
}
}
}
}
}
72 changes: 36 additions & 36 deletions crates/synd_term/oranda.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
{
"project": {
"name": "synd-term"
},
"build": {
"static_dir": "assets",
"dist_dir": "website"
},
"styles": {
"theme": "axo_dark",
"favicon": "https://blog.ymgyt.io/favicon.ico"
},
"marketing": {
"social": {
"image": "https://blog.ymgyt.io/images/emoji/crab.png",
"image_alt": "synd",
"twitter_account": "@YAmaguchixt"
}
},
"components": {
"changelog": {
"read_changelog_file": false
},
"mdbook": {
"path": "../../docs"
},
"artifacts": {
"package_managers": {
"additional": {
"nix": "nix profile install github:ymgyt/syndicationd#synd-term",
"pacman": "pacman -S syndicationd",
"cargo": "cargo install synd-term --locked",
"docker": "docker run -it ghcr.io/ymgyt/synd-term"
}
}
}
}
"project": {
"name": "synd-term"
},
"build": {
"static_dir": "etc/website/assets",
"dist_dir": "website"
},
"styles": {
"theme": "axo_dark",
"favicon": "https://blog.ymgyt.io/favicon.ico"
},
"marketing": {
"social": {
"image": "https://blog.ymgyt.io/images/emoji/crab.png",
"image_alt": "synd",
"twitter_account": "@YAmaguchixt"
}
},
"components": {
"changelog": {
"read_changelog_file": false
},
"mdbook": {
"path": "../../docs"
},
"artifacts": {
"package_managers": {
"additional": {
"nix": "nix profile install github:ymgyt/syndicationd#synd-term",
"pacman": "pacman -S syndicationd",
"cargo": "cargo install synd-term --locked",
"docker": "docker run -it ghcr.io/ymgyt/synd-term"
}
}
}
}
}
6 changes: 4 additions & 2 deletions crates/synd_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ pub fn certificate() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("..")
.join("..")
.join(".dev")
.join("etc")
.join("dev")
.join("self_signed_certs")
.join("certificate.pem")
}
Expand All @@ -25,7 +26,8 @@ pub fn private_key() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("..")
.join("..")
.join(".dev")
.join("etc")
.join("dev")
.join("self_signed_certs")
.join("private_key.pem")
}
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion assets/demo.tape → etc/demo/demo.tape
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Output assets/demo.gif
Output etc/demo/demo.gif
Set Shell nu
Set FontSize 17
Set FontFamily "JetBrainsMono Nerd Font"
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion assets/demo_short.tape → etc/demo/demo_short.tape
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Output assets/demo_short.gif
Output etc/demo/demo_short.gif
Set Shell nu
Set FontSize 17
Set FontFamily "JetBrainsMono Nerd Font"
Expand Down
2 changes: 1 addition & 1 deletion assets/vhs_settings.tape → etc/demo/vhs_settings.tape
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Output assets/demo.gif
Output etc/demo/demo.gif
Set Shell nu
Set FontSize 17
Set FontFamily "JetBrainsMono Nerd Font"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions nix/crane.nix → etc/nix/crane.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let

syndTerm = craneLib.buildPackage (individualCrateArgs // (let
crate = craneLib.crateNameFromCargoToml {
cargoToml = ../crates/synd_term/Cargo.toml;
cargoToml = ../../crates/synd_term/Cargo.toml;
};
in {
inherit (crate) pname version;
Expand All @@ -46,7 +46,7 @@ let

syndApi = craneLib.buildPackage (individualCrateArgs // (let
crate = craneLib.crateNameFromCargoToml {
cargoToml = ../crates/synd_api/Cargo.toml;
cargoToml = ../../crates/synd_api/Cargo.toml;
};
in {
inherit (crate) pname version;
Expand Down Expand Up @@ -82,7 +82,7 @@ in {
cargoAuditExtraArgs = let
ignoreAdvisories = lib.concatStrings (lib.strings.intersperse " "
(map (x: "--ignore ${x}") (builtins.fromTOML
(builtins.readFile ../.cargo/audit.toml)).advisories.ignore));
(builtins.readFile ../../.cargo/audit.toml)).advisories.ignore));
in "${ignoreAdvisories}";
};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added etc/website/assets/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(craneLib.filterCargoSources path type);
};

synd = pkgs.callPackage ./nix/crane.nix {
synd = pkgs.callPackage ./etc/nix/crane.nix {
inherit src craneLib advisory-db;
};

Expand Down Expand Up @@ -79,7 +79,7 @@
in {
checks = {
inherit (synd.checks) clippy nextest audit fmt;
typo = pkgs.callPackage ./nix/typo.nix { };
typo = pkgs.callPackage ./etc/nix/typo.nix { };
};

packages = {
Expand Down
20 changes: 10 additions & 10 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ feed_dir := "crates/synd_feed"
o11y_dir := "crates/synd_o11y"
api_dir := "crates/synd_api"

demo_tape := "assets/demo.tape"
demo_tape := "etc/demo/demo.tape"

arch := arch()
os := if os() == "macos" { "darwin" } else { "linux" }
Expand Down Expand Up @@ -67,7 +67,7 @@ test *flags:

# Run integration test by insta
integration *test_filter:
@nu scripts/integration.nu {{ test_filter }}
@nu etc/scripts/integration.nu {{ test_filter }}

# Run integration test with debugging
integration-debug *case:
Expand Down Expand Up @@ -137,7 +137,7 @@ gen-gql:
# Run kvsd
kvsd:
KVSD_LOG=info nix run github:ymgyt/kvsd/426ddaf5a6356551f0945b7ca3c48366580928d9 -- server \
--disable-tls --config .dev/kvsd_config.yaml \
--disable-tls --config etc/dev/kvsd_config.yaml \
--username {{ kvsd_user }} \
--kvsd-dir .kvsd

Expand All @@ -150,7 +150,7 @@ api *flags:
OTEL_RESOURCE_ATTRIBUTES="service.namespace=syndlocal,deployment.environment=local" \
cargo run --features opentelemetry-stdout,introspection -- \
--kvsd-host 127.0.0.1 --kvsd-port 7379 --kvsd-username {{ kvsd_user }} --kvsd-password secret \
--tls-cert ../../.dev/self_signed_certs/certificate.pem --tls-key ../../.dev/self_signed_certs/private_key.pem \
--tls-cert ../../etc/dev/self_signed_certs/certificate.pem --tls-key ../../etc/dev/self_signed_certs/private_key.pem \
--show-code-location=true --show-target=false --trace-sampler-ratio "1.0" {{ flags }}

# Run term
Expand All @@ -159,11 +159,11 @@ term *flags:

# Run opentelemetry-collector-contrib
@otelcol config:
otelcontribcol --config=file:.dev/otelcol/{{ config }}
otelcontribcol --config=file:etc/dev/otelcol/{{ config }}

# Run backends
backend:
zellij action new-tab --layout .dev/backend_layout.kdl
zellij action new-tab --layout etc/dev/backend_layout.kdl

# Record demo
demo *flags:
Expand All @@ -172,18 +172,18 @@ demo *flags:
# Convert demo to gif
# --rederer=resvg need to render nerd fonts and CJK
demo2gif *flags:
LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" nix run nixpkgs#asciinema-agg -- demo.cast assets/demo.gif --renderer=resvg {{ flags }}
LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" nix run nixpkgs#asciinema-agg -- demo.cast etc/demo/demo.gif --renderer=resvg {{ flags }}
rm demo.cast

demo-vhs-record *flags:
cat assets/vhs_settings.tape out> {{ demo_tape }}
cat etc/demo/vhs_settings.tape out> {{ demo_tape }}
nix run nixpkgs#vhs -- record --shell nu out>> {{ demo_tape }}

demo-vhs-gif:
nix run nixpkgs#vhs -- {{ demo_tape }}

demo-vhs-gif-short:
nix run nixpkgs#vhs -- assets/demo_short.tape --output assets/demo_short.gif
nix run nixpkgs#vhs -- etc/demo/demo_short.tape --output etc/demo/demo_short.gif

changelog-auth:
GIT_CLIFF__GIT__TAG_PATTERN="synd-auth-v.*" \
Expand Down Expand Up @@ -272,7 +272,7 @@ docker-login:

# Reinstall synd-term
reinstall:
@nu scripts/reinstall.nu
@nu etc/scripts/reinstall.nu

# Build ebpf program
build-ebpf *flags:
Expand Down

0 comments on commit fd209bc

Please # to comment.