%global debug_package %{nil} Name: repogoon Version: 0.3.20260109 Release: 1 Summary: Self-hosted Git repository hosting platform BuildArch: %{_target_cpu} License: MPL-2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: nodejs BuildRequires: nodejs-npm Requires: nodejs Requires: nodejs-npm Requires: git-core Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd # Optional dependencies Recommends: nginx Recommends: certbot Suggests: sqlite Suggests: postgresql-server Suggests: mariadb-server %description RepoGoon is a self-hosted Git repository hosting platform built with Node.js and Express. Features include: - Multiple database backends (SQLite, PostgreSQL, MySQL, Oracle, Convex) - YAML-based configuration - LDAP and OIDC authentication support - Dynamic rate limiting - Built-in web interface - CLI management tool (rgoon-ctl) %prep %setup -q %build # Install all dependencies (including dev) for building npm ci # Build the frontend npm run build # Remove dev dependencies for production npm prune --omit=dev %install # Create directories install -d %{buildroot}%{_datadir}/%{name} install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_localstatedir}/lib/%{name} install -d %{buildroot}%{_localstatedir}/lib/%{name}/repos install -d %{buildroot}%{_localstatedir}/lib/%{name}/avatars install -d %{buildroot}%{_localstatedir}/log/%{name} install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_unitdir} install -d %{buildroot}%{_sysconfdir}/nginx/conf.d # Copy application files cp -r server %{buildroot}%{_datadir}/%{name}/ cp -r dist %{buildroot}%{_datadir}/%{name}/ cp -r node_modules %{buildroot}%{_datadir}/%{name}/ cp package.json %{buildroot}%{_datadir}/%{name}/ # Install nginx template install -m 0644 nginx/repogoon.conf.template %{buildroot}%{_datadir}/%{name}/ # Install configuration file install -m 0640 config.yml %{buildroot}%{_sysconfdir}/%{name}/config.yml # Install CLI tool install -m 0755 rgoon-ctl %{buildroot}%{_bindir}/rgoon-ctl # Create symlink for config ln -sf %{_sysconfdir}/%{name}/config.yml %{buildroot}%{_datadir}/%{name}/config.yml # Create symlinks for data directories ln -sf %{_localstatedir}/lib/%{name}/repos %{buildroot}%{_datadir}/%{name}/repos install -d %{buildroot}%{_datadir}/%{name}/public ln -sf %{_localstatedir}/lib/%{name}/avatars %{buildroot}%{_datadir}/%{name}/public/avatars # Install systemd service file cat > %{buildroot}%{_unitdir}/%{name}.service << 'EOF' [Unit] Description=RepoGoon Git Repository Hosting Documentation=https://git.setup-tooling.org/BurningPho3nix/repogoon After=network.target After=postgresql.service mariadb.service [Service] Type=simple User=repogoon Group=repogoon WorkingDirectory=%{_datadir}/%{name} Environment=NODE_ENV=production ExecStart=/usr/bin/node server/index.js Restart=on-failure RestartSec=10 # Security hardening NoNewPrivileges=true ProtectSystem=strict ProtectHome=true ReadWritePaths=%{_localstatedir}/lib/%{name} ReadWritePaths=%{_localstatedir}/log/%{name} PrivateTmp=true # Logging StandardOutput=journal StandardError=journal SyslogIdentifier=repogoon [Install] WantedBy=multi-user.target EOF # Create environment file template cat > %{buildroot}%{_sysconfdir}/%{name}/environment << 'EOF' # RepoGoon environment variables # Uncomment and modify as needed # NODE_ENV=production # REPOGOON_CONFIG=/etc/repogoon/config.yml EOF %pre # Create repogoon user and group getent group repogoon >/dev/null || groupadd -r repogoon getent passwd repogoon >/dev/null || \ useradd -r -g repogoon -d %{_localstatedir}/lib/%{name} \ -s /sbin/nologin -c "RepoGoon service account" repogoon exit 0 %post %systemd_post %{name}.service # Set ownership on first install if [ $1 -eq 1 ]; then chown -R repogoon:repogoon %{_localstatedir}/lib/%{name} chown -R repogoon:repogoon %{_localstatedir}/log/%{name} chown repogoon:repogoon %{_sysconfdir}/%{name}/config.yml echo "" echo "==========================================" echo " RepoGoon installed successfully!" echo "==========================================" echo "" echo "Next steps:" echo " 1. Configure: sudo rgoon-ctl --setup" echo " 2. Start: sudo systemctl start repogoon" echo " 3. Enable on boot: sudo systemctl enable repogoon" echo "" echo "Configuration: /etc/repogoon/config.yml" echo "Data directory: /var/lib/repogoon" echo "Logs: journalctl -u repogoon" echo "" fi %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service # Remove user/group on complete uninstall if [ $1 -eq 0 ]; then userdel repogoon 2>/dev/null || : groupdel repogoon 2>/dev/null || : fi %files %license LICENSE %doc README.md # Application %dir %{_datadir}/%{name} %{_datadir}/%{name}/server %{_datadir}/%{name}/dist %{_datadir}/%{name}/node_modules %{_datadir}/%{name}/package.json %{_datadir}/%{name}/repogoon.conf.template %{_datadir}/%{name}/config.yml %{_datadir}/%{name}/repos %{_datadir}/%{name}/public # CLI tool %{_bindir}/rgoon-ctl # Configuration %dir %{_sysconfdir}/%{name} %config(noreplace) %attr(0640,root,repogoon) %{_sysconfdir}/%{name}/config.yml %config(noreplace) %{_sysconfdir}/%{name}/environment # Systemd %{_unitdir}/%{name}.service # Data directories %dir %attr(0755,repogoon,repogoon) %{_localstatedir}/lib/%{name} %dir %attr(0755,repogoon,repogoon) %{_localstatedir}/lib/%{name}/repos %dir %attr(0755,repogoon,repogoon) %{_localstatedir}/lib/%{name}/avatars %dir %attr(0755,repogoon,repogoon) %{_localstatedir}/log/%{name} %changelog * Fri Jan 10 2026 Package Maintainer - 0.3.20260109-1 - Added YAML configuration system - Added multi-database support (SQLite, PostgreSQL, MySQL, Oracle, Convex) - Added rgoon-ctl CLI management tool - Added LDAP and OIDC authentication support - Added Let's Encrypt auto-renewal support - Added dynamic rate limiting from database - Added RPM packaging with systemd service