diff --git a/0001-change-authhub-web-service-file-directory.patch b/0001-change-authhub-web-service-file-directory.patch new file mode 100644 index 0000000..9700fc9 --- /dev/null +++ b/0001-change-authhub-web-service-file-directory.patch @@ -0,0 +1,32 @@ +From 32a3d7a83d3f4023bb1594741deedaa4cb9c28d5 Mon Sep 17 00:00:00 2001 +From: hugang <18768366022@163.com> +Date: Mon, 9 Sep 2024 19:48:53 +0800 +Subject: [PATCH] build: update deploy file + +--- + authhub-web.service => oauth2_web/deploy/authhub-web.service | 0 + oauth2_web/deploy/authhub.nginx.conf | 3 ++- + 2 files changed, 2 insertions(+), 1 deletion(-) + rename authhub-web.service => oauth2_web/deploy/authhub-web.service (100%) + +diff --git a/authhub-web.service b/oauth2_web/deploy/authhub-web.service +similarity index 100% +rename from authhub-web.service +rename to oauth2_web/deploy/authhub-web.service +diff --git a/oauth2_web/deploy/authhub.nginx.conf b/oauth2_web/deploy/authhub.nginx.conf +index d9567d7..f9720c3 100644 +--- a/oauth2_web/deploy/authhub.nginx.conf ++++ b/oauth2_web/deploy/authhub.nginx.conf +@@ -14,7 +14,8 @@ server { + root /opt/authhub/web/dist; + expires 30d; + } +- location / { ++ location /authhub { ++ alias /opt/authhub/web/dist + try_files $uri $uri/ /index.html; + if (!-e $request_filename){ + rewrite ^(.*)$ /index.html last; +-- +Gitee + diff --git a/authHub-v1.0.0.tar.gz b/authHub-v1.0.0.tar.gz new file mode 100644 index 0000000..5dbab52 Binary files /dev/null and b/authHub-v1.0.0.tar.gz differ diff --git a/authHub.spec b/authHub.spec new file mode 100644 index 0000000..ced9469 --- /dev/null +++ b/authHub.spec @@ -0,0 +1,71 @@ +Name: authHub +Version: v1.0.0 +Release: 2 +Summary: Authentication authority based on oauth2 +License: MulanPSL2 +URL: https://gitee.com/openeuler/%{name} +Source0: %{name}-%{version}.tar.gz +Source1: node_modules.tar.gz +Patch0001: 0001-change-authhub-web-service-file-directory.patch + +BuildRequires: python3-setuptools +Requires: aops-vulcanus >= v2.1.0 python3-Authlib aops-zeus >= v2.1.0 +Provides: authhub + +%description +authhub is a specialized authentication center built on OAuth2, providing robust authentication and authorization capabilities for secure user access control in your applications.. + +%package -n authhub-web +Summary: Authentication authority web based on oauth2 + +BuildRequires: nodejs +Requires: nginx + +%description -n authhub-web +Authentication authority web based on oauth2 + +%prep +%autosetup -n %{name}-%{version} -p1 +%setup -T -D -a 1 -n %{name}-%{version}/oauth2_web +cd %{_builddir}/%{name}-%{version} + +# build for authhub +%py3_build + +# build for authhub-web +pushd oauth2_web +npm run build +popd + +# install for authhub +%py3_install + +# install for authhub-web +pushd oauth2_web +mkdir -p %{buildroot}/opt/authhub/web/ +cp -r dist %{buildroot}/opt/authhub/web/ +mkdir -p %{buildroot}/%{_sysconfdir}/nginx/conf.d/ +cp deploy/authhub.nginx.conf %{buildroot}/%{_sysconfdir}/nginx/conf.d/ +mkdir -p %{buildroot}/usr/lib/systemd/system +cp -r deploy/authhub-web.service %{buildroot}/usr/lib/systemd/system/ +popd + +%files +%attr(0644,root,root) %{_sysconfdir}/aops/conf.d/authhub.yml +%attr(0755,root,root) %{_unitdir}/authhub.service +%attr(0755, root, root) /opt/aops/database/* +%{python3_sitelib}/authhub*.egg-info +%{python3_sitelib}/oauth2_provider/* + +%files -n authhub-web +%attr(0755, root, root) /opt/authhub/web/dist/* +%attr(0755,root,root) %{_unitdir}/authhub-web.service +%attr(0755,root,root) %{_sysconfdir}/nginx/conf.d/* + +%changelog +* Mon Sep 9 2024 luxuexian - v1.0.0-2 +- change authhub-web.service file directory + +* Mon Sep 9 2024 luxuexian - v1.0.0-1 +- The first version of authHub is released, supporting local +- unified authentication for services such as aops and copilot diff --git a/node_modules.tar.gz b/node_modules.tar.gz new file mode 100644 index 0000000..258336d Binary files /dev/null and b/node_modules.tar.gz differ