Commit graph

3,982 commits

Author SHA1 Message Date
4053451bfd projects-dir.mk: Disable --create-remote-user-repos
Creating user repositories is hard to test. Not sure if the concept
will survive the current workflow changes, disable it for now.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 18:10:55 +01:00
9283479489 make, scripts: Don't unconditionally clone with proactiveAuth=basic
Don't unconditionally add proactiveAuth=basic to Git's config during
clone, but only if cloning happens after authentication.

This saves unauthenticated users funny password prompts. On the other
hand, this makes a server setting persistent which could be changed
on the server.

  URL =~ /api/  (or so) => 401, followed by Basic Auth
  URL !=~ /api/ (or so) => Redirect or free access, depending on resource

Currently all resources, including API, are accessible by either
basic auth or a Cookie, but basic auth needs to be present in the
first request, which throws off some clients (notably Git without
proactiveAuth=basic).

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 17:32:04 +01:00
fc02dad92c projects-dir-minimal.mk: Default PROJECTS_DIR_REMOTE_BASE to jw-build's remote
If jw-build is already cloned, infect all other repositories with its
remote via PROJECTS_DIR_REMOTE_BASE.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 16:54:04 +01:00
561905bab7 projects-dir.mk: Fix empty JANWARE_USER error
JW_BUILD_SSH_EXTRA_OPTS contains a -l $(JANWARE_USER), which make ssh
break if $(JANWARE_USER) is empty. Fix that case.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 16:33:18 +01:00
c37f2aaca3 pgit.sh: Deprecate CentOS 7
CentOS 7's Git doesn\'t understand -C, consider that obsolete and don't
cd into a directory any longer.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 16:15:26 +01:00
f4106e9da2 build.lib.cmds.SSHClient: Fix dtor exception
SSHClient's destructor raises an exception because of broken
os.environ syntax, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 15:48:13 +01:00
99dca58e1d projects-dir.mk: Make GIT_ASKPASS absolute
The GIT_ASKPASS environment variable can point to a relative path,
and since pgit.sh currently does a chdir, it needs to be made an
absolute path.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 15:28:05 +01:00
e46ab382e9 pgit.sh: Set http.proactiveAuth=basic
For git clone, use and persist the http.proactiveAuth=basic config
option, because it's needed for janware.com servers.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 15:07:17 +01:00
7d436f1c76 projects-dir[-minimal].mk: Go from PROJECTS_DIR_REMOTE_BASE
Currently, the primary discriminating criterion on how to handle a
set of remote repositories is whether or not JANWARE_USER is defined.
The canonical way to do that is PROJECTS_DIR_REMOTE_BASE, though, so
go from that definition.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 13:52:41 +01:00
babf58e2dd build.lib.cmds.SSHClient: Finish __init_askpass()
Finish and test the __init_askpass() method, works.

__init_askpass() had never been tested. Finish it and make sure it
works.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 12:42:45 +01:00
f9fe1dbe51 projects-dir-minimal.mk: Add PROJECTS_DIR_REMOTE_USER_SUBPATH = /proj
PROJECTS_DIR_REMOTE_USER_SUBPATH is a janware.com specialty somewhat.
Having subpaths is a Forgejo feature request on Codeberg, though, so
it might also be here to stay.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 12:40:41 +01:00
27e9b23849 build.cmds.CmdListRepos: Support username/password authentication
Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 11:29:50 +01:00
50744fc41e build.cmds.CmdListRepos: Pass -f to curl
curl exits with 0 success status, even if the server returns HTTP
401. Passing -f fixes that and has curl error out with exit code 22.
It doesn't show which error, though.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 10:56:47 +01:00
150bc97fc9 build.lib.util, build.App: Beautify exceptions
Make exceptions somewhat more readable.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 10:44:14 +01:00
9d06e0bf2e CmdGetAuthInfo: Code beautification
Fix clumsy code printing auth info.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 10:26:16 +01:00
41cc712dee projects-dir-minimal.mk: Clone jw-build with proactiveAuth=basic
Pass -c http.proactiveAuth=basic to the initial "git clone jw-build"
invocation. This is necessary while jw-build is still behind
authentication. The restriction will likely be lifted (for jw-build),
but for testing now it's fine, and it doesn't do any harm, either.
With the way janware.com currently operates, it will also necessary
for push over HTTP, so  make it persistent in jw-build's
configuration.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 09:38:24 +01:00
4c35ceb27a projects-dir-minimal.mk: Support JW_BUILD_BRANCH
Pass --branch $(JW_BUILD_BRANCH) to git clone invocations during the
initial cloning of jw-build. Used for testing.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 09:46:47 +01:00
250ef17764 Release 1.0.0-140@suse-tumbleweed/x86_64
Signed-off-by: Janware DevOps <devops@janware.com>
2025-11-20 00:09:49 +00:00
7c3dc53ddc Start version: 1.0.0-140
Signed-off-by: janware DevOps <devops@janware.com>
2025-11-20 00:09:23 +00:00
e95f91aff8 CmdGetAuthInfo: Fix: Suppress user name "None"
Don't print username="None" if there's no such user

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 20:00:13 +01:00
ae01ad6bdf Release 1.0.0-139@suse-tumbleweed/x86_64
Signed-off-by: Janware DevOps <devops@janware.com>
2025-11-19 08:33:24 +00:00
f01cbba53a Start version: 1.0.0-139
Signed-off-by: janware DevOps <devops@janware.com>
2025-11-19 08:32:58 +00:00
6d7d18d9bd projects-dir-minimal.mk: Fix get-user-info infocation
jw-python is invoked with -t (topdir) instead of -p (prefix) for
JANWARE_USER detection, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 09:16:24 +01:00
f750b2cf05 CmdGetAuthInfo: Don't use non-git jw-build
Don't try to use non-git jw-build repositories to retrieve auth info.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 09:15:13 +01:00
bf6a83ccac build.cmds.CmdListRepos: Fix ssh://git.janware.com
A typo breaks enumeration of Git repos on git.janware.com, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:40:24 +01:00
e1a4746ad5 projects-dir-minimal.mk: Use get-auth-info for JANWARE_USER
Default JANWARE_USER to the user retrieved by jw-projects.py get-auth-info.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:37:07 +01:00
1187c10c86 build.cmds.GetAuthInfo: Add module
Add command get-auth-info to jw-projects.py. It is meant to retrieve
JANWARE_USER from an already cloned jw-build tree.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:14:43 +01:00
8de4a90796 projects-dir-minimal.mk: Fix linking after package build
Linking the projects-dir Makefile fails if make pkg-rebuild has been
run on jw-build, because it leaves another projects-dir-minimal.mk
below the dist directory. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:24:58 +01:00
d740f30226 projects-dir[-minimal.mk]: Group PGIT_SH-related variables
Group variables related with pgit.sh (PGIT_SH and PGIT_SH_CLONE)
closer together. Define CLONE_FROM_USER early on.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 21:14:19 +01:00
b7833c928a pgit.sh fix: --create-remote-user-repos parsed incorrectly
--create-remote-user-repos is not recognized because of is not
recognized because of a typo, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 21:12:54 +01:00
d484749b79 cmds.CmdListRepos: Don't import from lib
Don't directly import from lib (i.e. from __init__.py), because that
won't work until "make all" has not run through, i.e. during fresh
checkout.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 20:09:23 +01:00
aac261d782 projects-dir[-minimal].mk: Change usage comment
The usage comments heading projects-dir-minimal.mk and
projects-dir.mk state that for cloning all repositories, JANWARE_USER
needs to be defined. That restriction is now gone, so reflect that in
the comment.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:56:21 +01:00
69132d9246 projects-dir[-minimal].mk: Support PROJECTS_DIR_REMOTE_BASE
Add the variable PROJECTS_DIR_REMOTE_BASE, defaulting to
ssh://git.janware.com/srv/git if REMOTE_USER is defined, and to
https://janware.com/code in case it isn't.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:55:20 +01:00
7d1ff5c6e6 projects-dir.mk: Default PGIT_CLONE_FROM_USER to janware
Clone from user janware if JANWARE_USER is not defined.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:56:02 +01:00
fe81bd209e projects-dir[-minimal].mk: Don't default JANWARE_USER
Do not set JANWARE_USER to $(id -un) in case it's undefined. Instead,
rely on it being set explicitly in the environment if so desired.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:44:57 +01:00
dc5515df09 pgit.sh clone: Use jw-projects.py instead of git-srv-admin.sh
Replace git-srv-admin.sh list-personal-projects by the more universal
"jw-projects.py list-repos" for enumerating repo names. This is a
step towards supporting Git servers other than janware.com.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:40:27 +01:00
1b21e33ded pgit.sh: Support --remote-base
pgit.sh has ssh://$login@git.janware.com/srv/git/$fromuser/proj/$reponame
hard-coded as the remote Git URLs of every cloned project.

This commit adds support for the global option --remote-base. Passing
it changes the URL to <remote-base>/$fromuser/$reponame..

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:25:46 +01:00
3ed25d5654 scripts: Add symbolic link jw -> ../src/python/jw
Adding a symbolic link to src/python/jw allows jw-projects.py to run
without pointing PYTHONPATH to that module.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 17:52:20 +01:00
370c7e499e projects-dir.mk: Conditionally pass --create-remote-user-repos
Pass --create-remote-user-repos to pgit.sh clone in case JANWARE_USER
is defined, restoring the original behaviour.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 16:39:52 +01:00
aed14fd480 pgit.sh clone: Support --create-remote-user-repos
Add support for --create-user-repos to pgit.sh. It controls whether
or not personal remote repositories on janware.com are created when
cloning from another user.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:37:03 +01:00
9b85b3e8a6 build.cmds.CmdListRepos: Add module
Add the command list-repos to jw-projects.py. It is meant to do the
same thing as "git-srv-adm.sh list-personal-projects", i.e. enumerate
remote Git repositories, but also support additional servers and
protocols.  As of this commit, support for https://github.com and for
forgejo installations over HTTPS is implemented.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:56:14 +01:00
b5ab0a3d26 build.lib.SSHClient: Add module
SSHClient(hostname) is an abstract class for SSH / SCP operations. It
comes with two implementations, SSHClientInternal an SSHClientCmd.
The former needs paramiko installed, which might be a reason to fail
on unprepared systems, the latter is slower and more limited.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:11:31 +01:00
9f15868dd4 build.lib.utils: Add module
Add some utility functions, namely:

  run_cmd(cmd: list[str], wd=None, throw=True, verbose=False) -> str|None
  run_curl(args: list[str], parse_json: bool=True) -> dict|str
  get_username(args: Namespace|None=None, url: str|None=None) -> str
  get_password(args: Namespace|None=None, url: str|None=None, askpass_env: list[str]=[]) -> str

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:07:02 +01:00
bc2033490f jw.build.lib: Add module
Add jw.build.lib as a location for generic utility modules.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:05:58 +01:00
a863bb9747 jw.build.App: Unroll run_from_cmd_module()
run_from_cmd_module() is a helper function used to allow command
selection alongside the legacy and now obsolete method. Unrolling it
is a step towards adding proper argparse subparsers, so do that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:42:16 +01:00
75820eee7c jw.build.App: Fix commands missing from help message
jw-projects.py --help doesn't list the commands, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:41:28 +01:00
b7d88a6e22 py-defs.mk: Default PY_UPDATE_INIT_PY ?= true
Set PY_UPDATE_INIT_PY to true to match jw-build's default behaviour
before the variable was introduced.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:04:29 +01:00
e6757727fa purge-stale-projects.sh: Fix git-srv-admin.sh relies on PATH
git-srv-admin.sh is not necessarily in PATH, notably because
jw-build doesn't add itself to it anylonger, so invoke it with itsits
full path.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 13:15:02 +01:00
4074486735 purge-stale-projects.sh: Re-add purge-stale-projects.sh, needed for purging
Without purge-stale-projects.sh, projects not longer in the upstream
directory don't get purged, so add it back.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 13:10:54 +01:00
0c9fd98009 projects-dir.mk, scripts/Makefile, jw-pkg: Move jw-pkg from jw-build to jw-base
jw-pkg is related to, but strictly speaking not indispensible for building and
packaging software. So, in the attempt have a minimal jw-build, move jw-pkg to
jw-base, and fix all packages that use it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 13:05:43 +01:00