6 Commits

Author SHA1 Message Date
a1e748c0a9 Merge pull request 'feat: allow user to choose how links behave' (#16) from remove-target-blank into master
All checks were successful
Docker Image CI / build (push) Successful in 6m48s
Reviewed-on: #16
2024-06-14 00:46:09 +02:00
4f2c810a2f feat: allow user to choose how links behave
All checks were successful
Docker Image CI / build (pull_request) Successful in 6m55s
2024-06-13 17:43:18 -05:00
3ce6daea15 Merge pull request 'feat: drop universe, add gremlins repos' (#12) from repos-update into master
All checks were successful
Docker Image CI / build (push) Successful in 7m25s
Reviewed-on: #12
Reviewed-by: artoo <artoo@artixlinux.org>
Reviewed-by: nikolar <nikolar@artixlinux.org>
2024-06-14 00:17:31 +02:00
16fd963c8d use printf instead of echo
All checks were successful
Docker Image CI / build (pull_request) Successful in 7m44s
2024-06-13 17:09:44 -05:00
6d3cd0566e feat: drop universe, add gremlins repos
All checks were successful
Docker Image CI / build (pull_request) Successful in 7m20s
2024-06-13 15:40:48 -05:00
42fd6f186f Back to development: 0.1.2 (#11)
All checks were successful
Docker Image CI / build (push) Successful in 7m22s
Reviewed-on: #11
2024-06-13 17:40:29 +02:00
10 changed files with 53 additions and 24 deletions

View File

@@ -73,7 +73,8 @@ jobs:
with:
images: |
${{ env.ABSOLUTE_DH_IMAGE }}
${{ env.ABSOLUTE_IMAGE }}
# ${{ env.ABSOLUTE_IMAGE }}
##unexpected status from PUT request: 413 Request Entity Too Large
tags: |
type=raw,value=latest
type=semver,pattern={{version}}

6
Cargo.lock generated
View File

@@ -410,7 +410,7 @@ dependencies = [
[[package]]
name = "artix-gitea"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"actix-web",
"awc",
@@ -420,7 +420,7 @@ dependencies = [
[[package]]
name = "artix-pkglib"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"alpm",
"alpm-utils",
@@ -430,7 +430,7 @@ dependencies = [
[[package]]
name = "artixweb_packages"
version = "0.1.1"
version = "0.1.2"
dependencies = [
"actix-files",
"actix-identity",

View File

@@ -44,10 +44,14 @@ EXPOSE 1936/tcp
RUN pacman -Sy --noconfirm postgresql-libs \
&& set -x \
&& echo -e "[lib32]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& echo -e "[universe]\nServer = https://universe.artixlinux.org/\$arch" >> /etc/pacman.conf \
&& pacman -Syu --noconfirm \
&& pacman -Scc --noconfirm
&& pacman -Scc --noconfirm \
&& printf "[lib32]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[system-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[world-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[galaxy-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[lib32-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& pacman -Sy --noconfirm
WORKDIR /usr/share/artixweb_packages
COPY --from=0 /usr/share/artixweb_packages ./

View File

@@ -8,7 +8,7 @@ homepage = "https://packages.artixlinux.org"
keywords = ["artix", "packages", "gitea"]
license = "MIT OR Apache-2.0"
edition = "2021"
version = "0.1.1"
version = "0.1.2"
[lib]
name = "artix_gitea"

View File

@@ -8,7 +8,7 @@ homepage = "https://packages.artixlinux.org"
keywords = ["artix", "packages"]
license = "MIT OR Apache-2.0"
edition = "2021"
version = "0.1.1"
version = "0.1.2"
[lib]
name = "artix_pkglib"

View File

@@ -7,7 +7,7 @@ repository = "gitea.artixlinux.org/artix/artixweb_packages"
keywords = ["artix", "packages"]
license = "MIT OR Apache-2.0"
edition = "2021"
version = "0.1.1"
version = "0.1.2"
[[bin]]
name = "artixweb_packages"
@@ -15,8 +15,8 @@ test = false
bench = false
[dependencies]
artix-gitea = { path = "../artix-gitea", version = "=0.1.1" }
artix-pkglib = { path = "../artix-pkglib", version = "=0.1.1" }
artix-gitea = { path = "../artix-gitea", version = "=0.1.2" }
artix-pkglib = { path = "../artix-pkglib", version = "=0.1.2" }
actix-files = "0.6.0"
actix-identity = "0.4"

View File

@@ -73,7 +73,16 @@ fn generate_random_token() -> String {
token
}
const DATABASESS: [&str; 5] = ["system", "world", "galaxy", "universe", "lib32"];
const DATABASESS: [&str; 8] = [
"system",
"world",
"galaxy",
"lib32",
"system-gremlins",
"world-gremlins",
"galaxy-gremlins",
"lib32-gremlins"
];
const MIN_PASSWORD_LENGTH: usize = 8;
/// Syncs the configured databases

View File

@@ -23,6 +23,7 @@ use super::packages::{get_packages_inner, Response};
#[template(path = "base_index.html")]
struct BaseTemplate {
packages: Vec<Response>,
repos: Vec<String>,
limit: usize,
query: String,
user_email: String,
@@ -33,6 +34,7 @@ struct BaseTemplate {
#[template(path = "packages_nav.html")]
struct PackagesNavigation {
packages: Vec<Response>,
repos: Vec<String>,
total: usize,
offset: usize,
limit: usize,
@@ -62,7 +64,16 @@ pub async fn index(
String::new()
};
let valid_repos = vec!["world", "galaxy", "system", "universe", "lib32"];
let valid_repos = vec![
"system",
"world",
"galaxy",
"lib32",
"system-gremlins",
"world-gremlins",
"galaxy-gremlins",
"lib32-gremlins"
];
for parameter in query.0 {
let key: &str = &parameter.0;
match key {
@@ -116,6 +127,7 @@ pub async fn index(
PackagesNavigation {
user_email,
packages: result.0,
repos,
total: result.1,
query: query_url.join("&"),
total_pages: if limit > 0 {
@@ -140,8 +152,8 @@ pub async fn index(
#[allow(clippy::unnecessary_wraps)]
mod filters {
pub fn selected_repo(query: &str, repo: &str) -> ::askama::Result<bool> {
Ok(query.to_lowercase().contains(&repo.to_lowercase()))
pub fn selected_repo(repos: &Vec<String>, repo: &str) -> ::askama::Result<bool> {
Ok(repos.iter().any(|r| r == repo))
}
pub fn details_url(pkg_name: &str) -> ::askama::Result<String> {

View File

@@ -10,11 +10,14 @@
<div>
<label for="repo_name" title="Repositories to include in the search">Repositories</label>
<select id="repo_name" name="repo" multiple="">
<option value="World" {% if query|selected_repo("World") %} selected {% endif %}>World</option>
<option value="Galaxy" {% if query|selected_repo("Galaxy") %} selected {% endif %}>Galaxy</option>
<option value="System" {% if query|selected_repo("System") %} selected {% endif %}>System</option>
<option value="Universe" {% if query|selected_repo("Universe") %} selected {% endif %}>Universe</option>
<option value="Lib32" {% if query|selected_repo("Lib32") %} selected {% endif %}>Lib32</option>
<option value="system" {% if repos|selected_repo("system") %} selected {% endif %}>System</option>
<option value="world" {% if repos|selected_repo("world") %} selected {% endif %}>World</option>
<option value="galaxy" {% if repos|selected_repo("galaxy") %} selected {% endif %}>Galaxy</option>
<option value="lib32" {% if repos|selected_repo("lib32") %} selected {% endif %}>Lib32</option>
<option value="system-gremlins" {% if repos|selected_repo("system-gremlins") %} selected {% endif %}>System-Gremlins</option>
<option value="world-gremlins" {% if repos|selected_repo("world-gremlins") %} selected {% endif %}>World-Gremlins</option>
<option value="galaxy-gremlins" {% if repos|selected_repo("galaxy-gremlins") %} selected {% endif %}>Galaxy-Gremlins</option>
<option value="lib32-gremlins" {% if repos|selected_repo("lib32-gremlins") %} selected {% endif %}>Lib32-Gremlins</option>
</select>
</div>
<div>

View File

@@ -35,8 +35,8 @@
<h2>{{ pkg.package_name }}-{{ pkg.version }} {% if pkg.flagged %}(<span class="flagged">flagged</span>){% endif %}</h2>
<section role="action_panel" class="action_panel">
<h4>Actions Panel</h4>
<section role="action"><a href="{{ pkg.gitea_url }}" target="blank">View Package Sources</a></section>
<section role="action"><a href="{{ pkg.gitea_url }}/graph" target="blank">View Package Changes</a></section>
<section role="action"><a href="{{ pkg.gitea_url }}">View Package Sources</a></section>
<section role="action"><a href="{{ pkg.gitea_url }}/graph">View Package Changes</a></section>
{% if !pkg.flagged %}
<section role="action"><a href="/flag_package/{{ pkg.package_name }}/{{ pkg.version }}">Flag package out-of-date</a></section>
{% else %}
@@ -65,7 +65,7 @@
<section role="value">{{ pkg.replaces|provides_or_replaces }}</section>
{% endif %}
<section role="key">Upstream URL:</section>
<section role="value"><a href="{{ pkg.upstream_url }}" target="_blank">{{ pkg.upstream_url }}</a></section>
<section role="value"><a href="{{ pkg.upstream_url }}">{{ pkg.upstream_url }}</a></section>
<section role="key">Size:</section>
<section role="value">{{ pkg.size|human_readable }} MB</section>
<section role="key">Installed Size:</section>