xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit 66c13a18b41d19e41e48aac537b735963bbb1f5a

Minor changes all over the place.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2016-01-02 23:03
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2016-01-02 23:03
Parent(s): 0fb57c1d20aebfaaa6c1c48125b39aa8d7765923
Signing key:
Tree: e1ac9fb82c6ae7c394b30452b6d4104c9bc5088e
File Lines added Lines deleted
README 1 1
TODO 2 1
docker/Dockerfile 26 0
docker/Dockerfile-postgresql 18 0
docker/README 35 0
docker/TODO 3 0
docker/build.sh 9 0
docker/postgresql-start.sh 29 0
docker/rg.sh 39 0
inc/bug.inc.php 3 1
inc/rights.inc.php 1 1
root/themes/default/main.css 7 1
root/themes/default/repo/bug/show.html 7 8
samples/config.php 6 2
File README changed (mode: 100644) (index 5182de9..9f60a81)
79 79 - Check also the config file (/etc/rocketgit/config.php) and set - Check also the config file (/etc/rocketgit/config.php) and set
80 80 correctly the rg_sql string. correctly the rg_sql string.
81 81 - If the web server and the db are not on the same host, you need to - If the web server and the db are not on the same host, you need to
82 replace 127.0.0.1/::1 with your "safe network". You may want to use
82 replace 127.0.0.1 and ::1 with your "safe network". You may want to use
83 83 md5 for authentication. Also, you may want to change 'listen_addresses' md5 for authentication. Also, you may want to change 'listen_addresses'
84 84 to '*'. You may also want to activate SSL. Check PostgreSQL manual. to '*'. You may also want to activate SSL. Check PostgreSQL manual.
85 85
File TODO changed (mode: 100644) (index a2a5fd7..b5ca29e)
2 2 [ ] [ ]
3 3
4 4 == BEFORE NEXT RELEASE == == BEFORE NEXT RELEASE ==
5 [ ] Why we do not connect to local named socket for postgres?!
6 [ ] Comment out "DEBUG list:" line.
5 7 [ ] Somehow, test if we use rg_xss_safe if a 'HTML:' var is set. [ ] Somehow, test if we use rg_xss_safe if a 'HTML:' var is set.
6 8 [ ] ssh: not documented in hints [ ] ssh: not documented in hints
7 9 [ ] I do not have rights to del_undel bugs, but I am still getting the [ ] I do not have rights to del_undel bugs, but I am still getting the
 
172 174 [ ] ip: comma/space: not ENTER? [ ] ip: comma/space: not ENTER?
173 175 [ ] admin: button to pause events processing. and a reason? [ ] admin: button to pause events processing. and a reason?
174 176 [ ] pr: Add 'reviewers' to a pull request. [ ] pr: Add 'reviewers' to a pull request.
175 [ ] Set a timezone if not set to avoid stupid php warnings.
176 177 [ ] Add a second part, documenting php-fpm. [ ] Add a second part, documenting php-fpm.
177 178 [ ] Paul: Notify all users (watchers and maybe the ones that had access) [ ] Paul: Notify all users (watchers and maybe the ones that had access)
178 179 that a repo was deleted. that a repo was deleted.
File docker/Dockerfile added (mode: 100644) (index 0000000..691e4fb)
1 FROM fedora:23
2 MAINTAINER Catalin(ux) M. BOIE <catab-docker@embedromix.ro>
3
4 EXPOSE 80
5 EXPOSE 443
6 EXPOSE 22
7 EXPOSE 9418
8
9 RUN dnf -y upgrade --best --allowerasing
10 RUN dnf -y install http://kernel.embedromix.ro/dinorepo-0.0.10-1.noarch.rpm
11 RUN dnf -y install rocketgit
12 RUN dnf -y install psmisc procps-ng sendmail php-opcache
13
14
15 COPY rg.sh /
16
17 RUN sed -i -e 's|;opcache.enable_cli=.*|opcache.enable_cli=1|' /etc/php.d/10-opcache.ini
18 RUN sed -i -e 's|;opcache.enable_cli=.*|opcache.enable_cli=1|' /etc/php-zts.d/10-opcache.ini
19 RUN grep -q ^rocketgit ${dir}/etc/mail/trusted-users || echo "rocketgit" >> /etc/mail/trusted-users
20 RUN grep -q ^apache ${dir}/etc/mail/trusted-users || echo "apache" >> /etc/mail/trusted-users
21
22
23 VOLUME /var/lib/rocketgit
24 VOLUME /home/rocketgit
25
26 CMD ["/rg.sh"]
File docker/Dockerfile-postgresql added (mode: 100644) (index 0000000..efd7f43)
1 FROM fedora:23
2 MAINTAINER Catalin(ux) M. BOIE <catab-docker@embedromix.ro>
3
4 EXPOSE 5432
5
6 RUN dnf -y install postgresql-server
7
8 USER postgres
9 ENV LANG en_US.utf8
10 ENV PGDATA /var/lib/pgsql/data
11
12 RUN initdb --data-checksums
13
14 VOLUME /var/lib/postgresql/data
15
16 COPY postgresql-start.sh /
17
18 CMD ["/postgresql-start.sh"]
File docker/README added (mode: 100644) (index 0000000..edfef3a)
1 == me ==
2 docker run -d -P --name rp rocketgit-postgresql
3 docker logs rp
4
5 docker run -d -P --name rg --link rp rocketgit
6 docker rm rp
7
8 docker exec -it rg bash
9
10 == doc ==
11 docker inspect
12 docker info
13 docker search xxx
14 docker pull fedora
15 docker images
16 docker commit
17 docker push username/image_name
18 docker ps -l
19 docker run -name aaa my_img echo "aaa"
20 docker stop aaa
21 docker rm
22
23 Running an interactive shell:
24 docker run -i -t fedora /bin/bash
25 docker run --interactive=true --tty=true fedora /bin/bash
26
27 Ctrl-p + Ctrl-q to detach
28
29 docker logs aaa
30
31 docker kill aaa
32
33 docker run -p 4444
34 docker port $JOB
35
File docker/TODO added (mode: 100644) (index 0000000..cbefb16)
1 [ ] Fix rocketgit link
2 [ ] Specify docker build http://...
3 [ ]
File docker/build.sh added (mode: 100755) (index 0000000..41b6aa9)
1 #!/bin/bash
2
3 set -e
4
5 echo "Building rocketgit-postgresql..."
6 docker build --tag="rocketgit-postgresql" -f Dockerfile-postgresql .
7
8 echo "Building rocketgit..."
9 docker build --tag="rocketgit" .
File docker/postgresql-start.sh added (mode: 100755) (index 0000000..5ff1049)
1 #!/bin/bash
2
3 set -e
4 set -u
5
6 # This file is included in the docker build by Dockerfile-postgresql
7
8 if [ ! -r "${PGDATA}/init_done.txt" ]; then
9 echo "host all all 0.0.0.0/0 trust" >> ${PGDATA}/pg_hba.conf
10 echo "listen_addresses='*'" >> ${PGDATA}/postgresql.conf
11
12 echo "Starting postgres..."
13 postgres &
14
15 sleep 10
16
17 echo "Creating user..."
18 psql --command "CREATE USER rocketgit WITH SUPERUSER PASSWORD 'rock';"
19
20 echo "Creating database..."
21 createdb -O rocketgit rocketgit
22
23 echo "Running..."
24 touch "${PGDATA}/init_done.txt"
25 wait
26 else
27 echo "PostgreSQL is already configured; running..."
28 postgres
29 fi
File docker/rg.sh added (mode: 100755) (index 0000000..915459d)
1 #!/bin/bash
2
3 # This file will be included in docker 'rocketgit' Dockerfile
4
5 while [ 1 ]; do
6 if [ "`ps ax|grep -v grep|grep http`" = "" ]; then
7 echo "Running httpd..."
8 httpd
9 if [ "${?}" != "0" ]; then
10 echo "ERROR: could not start httpd!"
11 fi
12 fi
13
14 if [ "`ps ax|grep -v grep|grep cron`" = "" ]; then
15 echo "Running cron..."
16 crond
17 if [ "${?}" != "0" ]; then
18 echo "ERROR: could not start crond!"
19 fi
20 fi
21
22 if [ "`ps ax|grep -v grep|grep sendmail`" = "" ]; then
23 echo "Running sendmail..."
24 /usr/sbin/sendmail -bd -q1h
25 if [ "${?}" != "0" ]; then
26 echo "ERROR: could not start sendmail!"
27 fi
28 fi
29
30 if [ "`ps ax|grep -v grep|grep xinetd`" = "" ]; then
31 echo "Running xinetd..."
32 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
33 if [ "${?}" != "0" ]; then
34 echo "ERROR: could not start xinetd!"
35 fi
36 fi
37
38 sleep 30
39 done
File inc/bug.inc.php changed (mode: 100644) (index 7b60ca6..db37959)
... ... function rg_bug_cosmetic($db, &$row)
301 301 $row['owner'] = $_ui['username']; $row['owner'] = $_ui['username'];
302 302 } }
303 303
304 if (isset($row['body']))
304 if (isset($row['body']) && !empty($row['body']))
305 305 $row['HTML:body_nlbr'] = nl2br(rg_xss_safe($row['body'])); $row['HTML:body_nlbr'] = nl2br(rg_xss_safe($row['body']));
306 else
307 $row['HTML:body_nlbr'] = 'n/a';
306 308
307 309 if (isset($row['itime'])) if (isset($row['itime']))
308 310 $row['creation'] = gmdate("Y-m-d H:i", $row['itime']); $row['creation'] = gmdate("Y-m-d H:i", $row['itime']);
File inc/rights.inc.php changed (mode: 100644) (index 15de716..6ade197)
... ... function rg_rights_split_ip($ip)
470 470 $ip2 = $ip; $ip2 = $ip;
471 471 } }
472 472
473 $ip2 = rg_ip_fix($ip2);
473 $ip2 = rg_fix_ip($ip2);
474 474 if (preg_match('/^[a-fA-F0-9:]*$/D', $ip2) === 1) { /* ipv6 */ if (preg_match('/^[a-fA-F0-9:]*$/D', $ip2) === 1) { /* ipv6 */
475 475 if ($ret['prefix_len'] == -1) { if ($ret['prefix_len'] == -1) {
476 476 $ret['prefix_len'] = 128; $ret['prefix_len'] = 128;
File root/themes/default/main.css changed (mode: 100644) (index 35b01c4..0dbcb50)
... ... legend { padding: 0px 2pt; }
346 346 margin: 3px 0px; margin: 3px 0px;
347 347 } }
348 348
349 .repo_body { display: block; }
349 .repo_body {
350 display: flex;
351 flex-flow: column nowrap;
352 }
350 353
351 354 .urls { padding: 3px 0px; margin: 5px 0px; } .urls { padding: 3px 0px; margin: 5px 0px; }
352 355 .urls ul { list-style-type: none; } .urls ul { list-style-type: none; }
 
... ... legend { padding: 0px 2pt; }
408 411
409 412
410 413 .bug { .bug {
414 display: flex;
415 flex-flow: column nowrap;
416 align-items: flex-start;
411 417 margin-top: 5px; margin-top: 5px;
412 418 } }
413 419 .bug_body { .bug_body {
File root/themes/default/repo/bug/show.html changed (mode: 100644) (index d78de81..99951fc)
3 3 <div class="bug_title"> <div class="bug_title">
4 4 #@@bug::bug_id@@ - @@bug::title@@ #@@bug::bug_id@@ - @@bug::title@@
5 5
6 <!-- some buttons: watch/unwatch/etc. -->
7 6 <div class="form_inline"> <div class="form_inline">
8 @@if(@@allow_bug_add@@ == 1){{
9 @@edit_form@@
10 @@close_form@@
11 @@del_form@@
12 }}
13 @@watch_form@@ @@watch_error@@
14 @@button_error@@
7 @@if(@@allow_bug_add@@ == 1){{
8 @@edit_form@@
9 @@close_form@@
10 @@del_form@@
11 }}
12 @@watch_form@@ @@watch_error@@
13 @@button_error@@
15 14 </div> </div>
16 15 </div> </div>
17 16 State: @@bug::state_text@@<br /> State: @@bug::state_text@@<br />
File samples/config.php changed (mode: 100644) (index 6dae9c2..52ec9dd)
5 5 $rg_base = "/home/rocketgit"; $rg_base = "/home/rocketgit";
6 6
7 7 // Database // Database
8 $rg_sql = "host=localhost user=rocketgit dbname=rocketgit"
9 . " connect_timeout=10";
10 8 $rg_sql_debug = 1; $rg_sql_debug = 1;
9 $rg_sql = 'user=rocketgit dbname=rocketgit connect_timeout=10';
10 $docker_addr = getenv('RP_PORT_5432_TCP_ADDR');
11 if ($docker_addr !== FALSE) {
12 $rg_sql .= ' host=' . $docker_addr;
13 $rg_sql .= ' port=' . getenv('RP_PORT_5432_TCP_PORT');
14 }
11 15
12 16 // Session // Session
13 17 $rg_session_time = 3600; $rg_session_time = 3600;
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master