File Makefile.in changed (mode: 100644) (index 226558b..61b7d07) |
... |
... |
install: all |
33 |
33 |
@mkdir -pv $(I_ETC)/cron.d |
@mkdir -pv $(I_ETC)/cron.d |
34 |
34 |
cp -vd --no-clobber samples/cron $(I_ETC)/cron.d/$(PRJ) |
cp -vd --no-clobber samples/cron $(I_ETC)/cron.d/$(PRJ) |
35 |
35 |
@mkdir -pv $(I_ETC)/httpd/conf.d |
@mkdir -pv $(I_ETC)/httpd/conf.d |
36 |
|
cp -vd --no-clobber samples/rg.conf $(I_ETC)/httpd/conf.d/$(PRJ).conf |
|
|
36 |
|
cp -vd samples/rg.conf $(I_ETC)/httpd/conf.d/$(PRJ).conf.sample |
|
37 |
|
cp -vd samples/nginx.conf $(I_ETC)/nginx/conf.d/$(PRJ).conf.sample |
37 |
38 |
@mkdir -pv $(I_ETC)/$(PRJ) |
@mkdir -pv $(I_ETC)/$(PRJ) |
38 |
|
cp -vd --no-clobber samples/config.php $(I_ETC)/$(PRJ)/ |
|
39 |
39 |
cp -vd samples/config.php $(I_ETC)/$(PRJ)/config.php.sample |
cp -vd samples/config.php $(I_ETC)/$(PRJ)/config.php.sample |
|
40 |
|
cp -vd --no-clobber samples/config.php $(I_ETC)/$(PRJ)/ |
40 |
41 |
cp -vd --no-clobber samples/php-fpm.conf $(I_ETC)/$(PRJ)/ |
cp -vd --no-clobber samples/php-fpm.conf $(I_ETC)/$(PRJ)/ |
41 |
42 |
cp -vd --no-clobber samples/pool.conf $(I_ETC)/$(PRJ)/ |
cp -vd --no-clobber samples/pool.conf $(I_ETC)/$(PRJ)/ |
42 |
|
@mkdir -pv $(I_ETC)/logrotate.d |
|
43 |
|
cp -vd samples/logrotate $(I_ETC)/logrotate.d/$(PRJ) |
|
44 |
43 |
@mkdir -pv $(I_USR)/lib/systemd/system/ |
@mkdir -pv $(I_USR)/lib/systemd/system/ |
45 |
44 |
cp -vd samples/rocketgit-fpm.service $(I_USR)/lib/systemd/system/rocketgit-fpm.service |
cp -vd samples/rocketgit-fpm.service $(I_USR)/lib/systemd/system/rocketgit-fpm.service |
46 |
45 |
@ |
@ |
|
... |
... |
push: |
86 |
85 |
docker: |
docker: |
87 |
86 |
@docker run --name rp --tty --detach \ |
@docker run --name rp --tty --detach \ |
88 |
87 |
rocketgit/rocketgit-postgresql |
rocketgit/rocketgit-postgresql |
|
88 |
|
@(cd docker && sh prepare.sh) |
89 |
89 |
@docker run --name rg --tty --publish-all --link rp --detach \ |
@docker run --name rg --tty --publish-all --link rp --detach \ |
90 |
90 |
--volume ${PWD}:/usr/share/rocketgit:ro \ |
--volume ${PWD}:/usr/share/rocketgit:ro \ |
|
91 |
|
--volume ${PWD}/docker/prepare/nginx.conf:/etc/nginx/conf.d/rocketgit.conf \ |
91 |
92 |
rocketgit/rocketgit |
rocketgit/rocketgit |
|
93 |
|
@echo "Exported ports:" |
92 |
94 |
docker port rg |
docker port rg |
|
95 |
|
@echo |
|
96 |
|
@echo "Add in your /etc/hosts file the docker IP and 'drg' name." |
|
97 |
|
@echo |
|
98 |
|
@echo "To attach to the rg machine: docker exec --tty --interactive rg bash" |
93 |
99 |
|
|
94 |
100 |
.PHONY: docker-stop |
.PHONY: docker-stop |
95 |
101 |
docker-stop: |
docker-stop: |
File rocketgit.spec.in changed (mode: 100644) (index 5815fe0..dd0d012) |
... |
... |
Source: http://kernel.embedromix.ro/us/rocketgit/%{name}-%{version}.tar.gz |
14 |
14 |
URL: https://rocketgit.com/ |
URL: https://rocketgit.com/ |
15 |
15 |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
16 |
16 |
BuildArch: noarch |
BuildArch: noarch |
17 |
|
Requires: httpd, mod_ssl, php-fpm, php-cli, php-pgsql, xinetd |
|
18 |
|
Requires: git, cronie, postgresql-server |
|
|
17 |
|
Requires: httpd-filesystem, nginx-filesystem, php-fpm, php-cli, php-pgsql |
|
18 |
|
Requires: git, cronie, xinetd |
19 |
19 |
Requires: util-linux |
Requires: util-linux |
20 |
20 |
# SELinux stuff |
# SELinux stuff |
21 |
21 |
# https://fedoraproject.org/wiki/SELinux_Policy_Modules_Packaging_Draft?rd=PackagingDrafts/SELinux/PolicyModules |
# https://fedoraproject.org/wiki/SELinux_Policy_Modules_Packaging_Draft?rd=PackagingDrafts/SELinux/PolicyModules |
22 |
22 |
BuildRequires: checkpolicy, selinux-policy-devel, hardlink, systemd, php-cli |
BuildRequires: checkpolicy, selinux-policy-devel, hardlink, systemd, php-cli |
23 |
|
# Needed for Fedora <= 19 |
|
24 |
|
%if "%{selinux_policyver}" != "" |
|
25 |
|
Requires: selinux-policy >= %{selinux_policyver} |
|
26 |
|
%endif |
|
27 |
23 |
Requires(pre): shadow-utils |
Requires(pre): shadow-utils |
28 |
24 |
Requires(post): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles |
Requires(post): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles |
29 |
25 |
Requires(postun): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles |
Requires(postun): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles |
|
... |
... |
done |
50 |
46 |
|
|
51 |
47 |
if [ $1 -ne 0 ]; then |
if [ $1 -ne 0 ]; then |
52 |
48 |
/sbin/service xinetd reload &>/dev/null || : |
/sbin/service xinetd reload &>/dev/null || : |
53 |
|
/sbin/service httpd reload &>/dev/null || : |
|
54 |
49 |
fi |
fi |
55 |
50 |
%systemd_post @PRJ@-fpm.service |
%systemd_post @PRJ@-fpm.service |
56 |
51 |
|
|
|
... |
... |
rm -rf ${RPM_BUILD_ROOT} |
89 |
84 |
%doc README LICENSE Changelog TODO selinux/@PRJ@.* samples/* |
%doc README LICENSE Changelog TODO selinux/@PRJ@.* samples/* |
90 |
85 |
%attr(0700,rocketgit,rocketgit) %dir @ETC@/@PRJ@ |
%attr(0700,rocketgit,rocketgit) %dir @ETC@/@PRJ@ |
91 |
86 |
@ETC@/@PRJ@/config.php.sample |
@ETC@/@PRJ@/config.php.sample |
92 |
|
@ETC@/logrotate.d/rocketgit |
|
|
87 |
|
@ETC@/httpd/conf.d/rocketgit.conf.sample |
|
88 |
|
@ETC@/nginx/conf.d/rocketgit.conf.sample |
93 |
89 |
%config(noreplace) @ETC@/@PRJ@/config.php |
%config(noreplace) @ETC@/@PRJ@/config.php |
94 |
90 |
%config(noreplace) @ETC@/@PRJ@/php-fpm.conf |
%config(noreplace) @ETC@/@PRJ@/php-fpm.conf |
95 |
91 |
%config(noreplace) @ETC@/@PRJ@/pool.conf |
%config(noreplace) @ETC@/@PRJ@/pool.conf |
96 |
92 |
%config(noreplace) @ETC@/cron.d/rocketgit |
%config(noreplace) @ETC@/cron.d/rocketgit |
97 |
93 |
%config(noreplace) @ETC@/xinetd.d/rocketgit |
%config(noreplace) @ETC@/xinetd.d/rocketgit |
98 |
|
%config(noreplace) @ETC@/httpd/conf.d/rocketgit.conf |
|
99 |
94 |
%attr(0700,rocketgit,rocketgit) %dir @VAR_LOG@/@PRJ@ |
%attr(0700,rocketgit,rocketgit) %dir @VAR_LOG@/@PRJ@ |
100 |
95 |
%attr(0755,root,root) %dir @VAR_LIB@/@PRJ@ |
%attr(0755,root,root) %dir @VAR_LIB@/@PRJ@ |
101 |
96 |
%attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/locks |
%attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/locks |
File samples/nginx.conf changed (mode: 100644) (index 933629a..0a57d7e) |
1 |
|
upstream rg-php-fpm { |
|
2 |
|
server unix:/run/php-fpm/rocketgit.sock; |
|
3 |
|
} |
|
|
1 |
|
#upstream rg-php-fpm { |
|
2 |
|
# server unix:/run/php-fpm/rocketgit.sock; |
|
3 |
|
#} |
4 |
4 |
|
|
|
5 |
|
# HTTP server |
5 |
6 |
server { |
server { |
6 |
|
listen 9002; |
|
7 |
|
listen [::]:9002; |
|
8 |
|
server_name rg.domain.tld; |
|
9 |
|
# TODO: ServerAlias equivalent? |
|
|
7 |
|
listen 80 backlog=128 rcvbuf=64k; |
|
8 |
|
listen [::]:80 backlog=128 rcvbuf=64k; |
|
9 |
|
server_name rg.domain.tld # add here, space separated, more names; |
10 |
10 |
server_tokens off; |
server_tokens off; |
11 |
11 |
root /usr/share/rocketgit/root; |
root /usr/share/rocketgit/root; |
12 |
12 |
|
|
|
13 |
|
# TODO - is ok in this context? |
|
14 |
|
client_max_body_size 1000m; |
|
15 |
|
# more than that is written into a file first |
|
16 |
|
client_body_buffer_size 128k; |
|
17 |
|
|
|
18 |
|
# timeouts |
|
19 |
|
client_body_timeout 10; |
|
20 |
|
client_header_timeout 10; |
13 |
21 |
keepalive_timeout 10; |
keepalive_timeout 10; |
|
22 |
|
send_timeout 10; |
14 |
23 |
|
|
15 |
|
client_max_body_size 1m; |
|
|
24 |
|
# Security (ClickJacking) |
|
25 |
|
add_header X-Frame-Options DENY; |
16 |
26 |
|
|
17 |
27 |
access_log /var/log/nginx/rg-access.log; |
access_log /var/log/nginx/rg-access.log; |
18 |
28 |
error_log /var/log/nginx/rg-error.log; |
error_log /var/log/nginx/rg-error.log; |
19 |
29 |
|
|
|
30 |
|
if ($request_method !~ ^(GET|HEAD|POST|OPTIONS)$) { return 444; } |
|
31 |
|
|
|
32 |
|
# Force the use of only one name even if we have more aliases. |
|
33 |
|
# Before un-commenting it, change SERVERNAME and PORT to real values |
|
34 |
|
#if ($host != SERVERNAME) { |
|
35 |
|
# rewrite ^/?(.*)$ http://SERVERNAME:PORT/$1 permanent; |
|
36 |
|
#} |
|
37 |
|
|
20 |
38 |
location ~ ^/(favicon\.ico|themes/.*|robots\.txt|\.well-known/.*)$ { |
location ~ ^/(favicon\.ico|themes/.*|robots\.txt|\.well-known/.*)$ { |
21 |
|
# TODO: what to put here? |
|
22 |
|
expires max; |
|
|
39 |
|
expires 1d; |
23 |
40 |
} |
} |
24 |
41 |
|
|
25 |
42 |
location / { |
location / { |
26 |
|
client_max_body_size 0; |
|
27 |
|
client_body_buffer_size 128k; |
|
28 |
43 |
gzip off; |
gzip off; |
29 |
44 |
|
|
30 |
|
# To allow streaming of the chunked request data to fpm |
|
31 |
|
# TODO: we cannot do this now because php-fpm does not know |
|
32 |
|
# to decode chunked encoding! |
|
33 |
|
#fastcgi_request_buffering off; |
|
|
45 |
|
# To be able to know that the client closed the connection |
|
46 |
|
# TODO: equivalent for apache? |
|
47 |
|
fastcgi_ignore_client_abort off; |
|
48 |
|
|
|
49 |
|
# To allow streaming of the response data to client |
|
50 |
|
fastcgi_buffering off; |
|
51 |
|
|
|
52 |
|
# TODO |
|
53 |
|
fastcgi_keep_conn on; |
|
54 |
|
|
|
55 |
|
include /etc/nginx/fastcgi_params; |
|
56 |
|
fastcgi_param SCRIPT_FILENAME $document_root/index.php$fastcgi_script_name; |
|
57 |
|
|
|
58 |
|
fastcgi_pass unix:/run/php-fpm/rocketgit.sock; |
|
59 |
|
} |
|
60 |
|
} |
|
61 |
|
|
|
62 |
|
# HTTPS server |
|
63 |
|
server { |
|
64 |
|
listen 443 ssl backlog=128 rcvbuf=64k; |
|
65 |
|
listen [::]:443 ssl backlog=128 rcvbuf=64k; |
|
66 |
|
server_name rg.domain.tld # add here, space separated, more names; |
|
67 |
|
server_tokens off; |
|
68 |
|
root /usr/share/rocketgit/root; |
|
69 |
|
|
|
70 |
|
# TODO - is ok in this context? |
|
71 |
|
client_max_body_size 1000m; |
|
72 |
|
# more than that is written into a file first |
|
73 |
|
client_body_buffer_size 128k; |
|
74 |
|
|
|
75 |
|
# timeouts |
|
76 |
|
client_body_timeout 10; |
|
77 |
|
client_header_timeout 10; |
|
78 |
|
keepalive_timeout 10; |
|
79 |
|
send_timeout 10; |
|
80 |
|
|
|
81 |
|
# Security (ClickJacking) |
|
82 |
|
add_header X-Frame-Options DENY; |
|
83 |
|
add_header Strict-Transport-Security "max-age=31536000"; |
|
84 |
|
|
|
85 |
|
access_log /var/log/nginx/rg-ssl-access.log; |
|
86 |
|
error_log /var/log/nginx/rg-ssl-error.log; |
|
87 |
|
|
|
88 |
|
if ($request_method !~ ^(GET|HEAD|POST|OPTIONS)$) { return 444; } |
|
89 |
|
|
|
90 |
|
# Force the use of only one name even if we have more aliases. |
|
91 |
|
# Before un-commenting it, change SERVERNAME and PORT to real values |
|
92 |
|
#if ($host != SERVERNAME) { |
|
93 |
|
# rewrite ^/?(.*)$ http://SERVERNAME:PORT/$1 permanent; |
|
94 |
|
#} |
|
95 |
|
|
|
96 |
|
location ~ ^/(favicon\.ico|themes/.*|robots\.txt|\.well-known/.*)$ { |
|
97 |
|
expires 1d; |
|
98 |
|
} |
|
99 |
|
|
|
100 |
|
location / { |
|
101 |
|
gzip off; |
34 |
102 |
|
|
35 |
103 |
# To be able to know that the client closed the connection |
# To be able to know that the client closed the connection |
36 |
104 |
# TODO: equivalent for apache? |
# TODO: equivalent for apache? |
|
... |
... |
server { |
47 |
115 |
|
|
48 |
116 |
fastcgi_pass unix:/run/php-fpm/rocketgit.sock; |
fastcgi_pass unix:/run/php-fpm/rocketgit.sock; |
49 |
117 |
} |
} |
|
118 |
|
|
|
119 |
|
ssl_certificate /etc/pki/tls/certs/localhost.crt; |
|
120 |
|
ssl_certificate_key /etc/pki/tls/private/localhost.key; |
|
121 |
|
ssl_prefer_server_ciphers on; |
|
122 |
|
# Specify the cyphers to get an A+ on Qualys (ssllabs.com); recommended |
|
123 |
|
# https://www.digicert.com/ssl-support/ssl-enabling-perfect-forward-secrecy.htm |
|
124 |
|
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"; |
|
125 |
|
ssl_protocols TLSv1.2; |
|
126 |
|
ssl_session_cache shared:SSL:1m; |
|
127 |
|
ssl_session_timeout 5m; |
|
128 |
|
|
|
129 |
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning |
|
130 |
|
# To generate pin-sha256 string: openssl s_client -servername <server> -connect <server>:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 |
|
131 |
|
# add_header Public-Key-Pins "pin-sha256=\"base64+primary==\"; pin-sha256=\"base64+backup==\"; max-age=5184000; includeSubDomains; report-uri=\"https://www.example.org/hpkp-report\"" |
|
132 |
|
# add_header Public-Key-Pins-Report-Only ... # to not block users! |
|
133 |
|
|
50 |
134 |
} |
} |