catalinux / rgfs (public) (License: GPLv3) (since 2020-11-11) (hash sha1)
Allows mapping of RocketGit storage area into a local directory
List of commits:
Subject Hash Author Date (UTC)
Allow pushing a name and a repo id 9b48c3ae2a059a1ecd84caf44cea6c551175dd46 Catalin(ux) M. BOIE 2020-11-12 16:14:02
Send also the pkg_repo_id parameter 866c8063866effdabe0aa76fcfb9cc2b3d61b67a Catalin(ux) M. BOIE 2020-11-12 07:54:07
Now we can pass parameters by env 8352d8d09714a3c2af7550ad55517bfa8590a309 Catalin(ux) M. BOIE 2020-11-12 04:48:19
Inistial commit e51779259596117c80f6e7961f4387fdd48f820a Catalin(ux) M. BOIE 2020-11-11 08:18:38
Commit 9b48c3ae2a059a1ecd84caf44cea6c551175dd46 - Allow pushing a name and a repo id
Author: Catalin(ux) M. BOIE
Author date (UTC): 2020-11-12 16:14
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2020-11-12 16:14
Parent(s): 866c8063866effdabe0aa76fcfb9cc2b3d61b67a
Signing key:
Tree: b28db0edc429f00097af02cdea41dbc93b10dd19
File Lines added Lines deleted
rgfs.c 22 6
File rgfs.c changed (mode: 100644) (index 3d3ce12..59f779a)
23 23 #include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
24 24 #include <gnutls/x509.h> #include <gnutls/x509.h>
25 25
26 // a way to distinguish between clients
27 static char *rgfs_name = "unk";
26 28 static unsigned int rgfs_pkg_repo_id = 0; static unsigned int rgfs_pkg_repo_id = 0;
27 29 static char *rgfs_key = ""; static char *rgfs_key = "";
28 30 static int rgfs_port = 443; static int rgfs_port = 443;
 
... ... static int rgfs_tls(void)
299 301 break; break;
300 302 xlog("Server version: %hhu.\n", buf[4]); xlog("Server version: %hhu.\n", buf[4]);
301 303
304 xlog("Sending name...\n");
305 len = strlen(rgfs_name);
306 buf[0] = 0xFE; // type=SEND_NAME
307 buf[1] = len >> 8; // len H
308 buf[2] = len; // len L
309 memcpy(buf + 3, rgfs_name, len);
310 r = rgfs_send(buf, 3 + len);
311 if (r <= 0)
312 break;
313
302 314 xlog("Sending pkg_repo_id and key...\n"); xlog("Sending pkg_repo_id and key...\n");
303 315 len = strlen(rgfs_key); len = strlen(rgfs_key);
304 316 buf[0] = 0xFF; // type=SEND_KEY buf[0] = 0xFF; // type=SEND_KEY
305 buf[1] = len >> 8; // len H
306 buf[2] = len; // len L
317 buf[1] = (4 + len) >> 8; // len H
318 buf[2] = 4 + len; // len L
307 319 buf[3] = rgfs_pkg_repo_id >> 24; buf[3] = rgfs_pkg_repo_id >> 24;
308 320 buf[4] = rgfs_pkg_repo_id >> 16; buf[4] = rgfs_pkg_repo_id >> 16;
309 321 buf[5] = rgfs_pkg_repo_id >> 8; buf[5] = rgfs_pkg_repo_id >> 8;
 
... ... int main(int argc, char *argv[])
930 942 int r; int r;
931 943 char *s; char *s;
932 944
933 s = getenv("RGFS_PKG_RPEO_ID");
945 s = getenv("RGFS_NAME");
946 if (s)
947 rgfs_name = s;
948
949 s = getenv("RGFS_PKG_REPO_ID");
934 950 if (s) if (s)
935 951 rgfs_pkg_repo_id = atol(s); rgfs_pkg_repo_id = atol(s);
936 952
 
... ... int main(int argc, char *argv[])
945 961 s = getenv("RGFS_LOG"); s = getenv("RGFS_LOG");
946 962 if (s) if (s)
947 963 rgfs_log = s; rgfs_log = s;
948 rgfs_log_fd = open(rgfs_log, O_CREAT | O_WRONLY | O_APPEND, 0600);
964 rgfs_log_fd = open(rgfs_log, O_CREAT | O_WRONLY | O_TRUNC | O_APPEND, 0600);
949 965
950 966 s = getenv("RGFS_PORT"); s = getenv("RGFS_PORT");
951 967 if (s) if (s)
 
... ... int main(int argc, char *argv[])
959 975 if (s) if (s)
960 976 rgfs_url = s; rgfs_url = s;
961 977
962 xlog("server=%s port=%d url=%s pkg_repo_id=%u\n",
963 rgfs_server, rgfs_port, rgfs_url, rgfs_pkg_repo_id);
978 xlog("name=%s server=%s port=%d url=%s pkg_repo_id=%u\n",
979 rgfs_name, rgfs_server, rgfs_port, rgfs_url, rgfs_pkg_repo_id);
964 980
965 981 if (gnutls_check_version("3.4.6") == NULL) { if (gnutls_check_version("3.4.6") == NULL) {
966 982 xlog("GnuTLS 3.4.6 or later is required!\n"); xlog("GnuTLS 3.4.6 or later is required!\n");
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://rocketgit.com/user/catalinux/rgfs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rgfs

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rgfs

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