Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2025-02 dev log #11

Closed
2 tasks
michielbdejong opened this issue Dec 20, 2024 · 18 comments
Closed
2 tasks

2025-02 dev log #11

michielbdejong opened this issue Dec 20, 2024 · 18 comments

Comments

@michielbdejong
Copy link
Contributor

michielbdejong commented Dec 20, 2024

First working week of the year 2025, plans:

OCM

Solid

@michielbdejong
Copy link
Contributor Author

OK, so I'm working on pondersource/dev-stock#160. Switching to the improve-shell-scripts branch was good, and I was able to add the test easily. The trouble is that the test is failing because OcmStub is not behaving in the way that Nextcloud expects.

Maybe I should try to add a node.js webdav server into it, since I also want to test actual file access, and I don't want my stub to be too brittle.

So the issues involved are:

@michielbdejong
Copy link
Contributor Author

hm, mod_log_forensic worked and then it stopped logging things. Retrying now.

@michielbdejong
Copy link
Contributor Author

@michielbdejong
Copy link
Contributor Author

This should give me the exact request and response that ocm-stub needs to mimic.

@michielbdejong
Copy link
Contributor Author

Now I have the request body of the PROPFIND request but not the response body:

--cb79da64-A--
[06/Jan/2025:16:08:45.487551 +0000] Z3wADSXh2bCPVrmX0miu9AAAAAE 192.168.80.6 58946 192.168.80.5 443
--cb79da64-B--
PROPFIND /remote.php/dav/files/michiel/asdf HTTP/1.1
Host: nextcloud2.docker
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0
Accept: text/plain,application/xml
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Content-Type: text/plain;charset=UTF-8
Content-Length: 742
X-Requested-With: XMLHttpRequest
requesttoken: QMradxUk5eXUxnUBoxXdmRhQEzsn0ZLBbFQbMW5ZOC8=:IZ6cGmF9v5f78RBoykSs9lMZVlUe5Mr3ADk0VFlpU2s=
Depth: 0
Origin: https://nextcloud2.docker
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Connection: keep-alive
Cookie: ochdflk86ng0=65bbe315133f623f7ce899b4066b8c6e; oc_sessionPassphrase=Gi7fSALfEaIuPdfGIB4W4AaGC7de4PWynxq5OkqFpplXSa3ZCf1Dmf3sBc0%2FG%2FuSOBs0TbNJvRQVQ10Etdw2dIgyOVmF1WOstgZa%2BHSpdxKM3OUqy7iTcVKfea70W%2Bng; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=michiel; nc_token=51SWLiDvuvHEHwbiYVXyvLzYFURBW4DR; nc_session_id=65bbe315133f623f7ce899b4066b8c6e
Priority: u=4

--cb79da64-C--
<?xml version="1.0"?>
		<d:propfind xmlns:d="DAV:" xmlns:nc="http://nextcloud.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
			<d:prop>
				<d:getcontentlength /> <d:getcontenttype /> <d:getetag /> <d:getlastmodified /> <d:creationdate /> <d:displayname /> <d:quota-available-bytes /> <d:resourcetype /> <nc:has-preview /> <nc:is-encrypted /> <nc:mount-type /> <oc:comments-unread /> <oc:favorite /> <oc:fileid /> <oc:owner-display-name /> <oc:owner-id /> <oc:permissions /> <oc:size /> <nc:hidden /> <nc:is-mount-root /> <nc:is-federated /> <nc:metadata-files-live-photo /> <nc:share-attributes /> <oc:share-types /> <ocs:share-permissions /> <nc:system-tags />
			</d:prop>
		</d:propfind>
--cb79da64-F--
HTTP/1.1 207 Multi-Status
Strict-Transport-Security: max-age=63072000;
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow
X-XSS-Protection: 1; mode=block
X-Powered-By: PHP/8.2.26
Content-Security-Policy: default-src 'none';
Vary: Brief,Prefer
DAV: 1, 3, extended-mkcol, access-control, calendarserver-principal-property-search, nextcloud-checksum-update, nc-calendar-search, nc-enable-birthday-calendar
X-Request-Id: Z3wADSXh2bCPVrmX0miu9AAAAAE
X-Debug-Token: Z3wADSXh2bCPVrmX0miu9AAAAAE
Content-Encoding: gzip
Content-Length: 661
Keep-Alive: timeout=5, max=91
Connection: Keep-Alive
Content-Type: application/xml; charset=utf-8

--cb79da64-H--
Apache-Handler: application/x-httpd-php
Stopwatch: 1736179725446331 41306 (- - -)
Stopwatch2: 1736179725446331 41306; combined=1, p1=0, p2=0, p3=0, p4=0, p5=1, sr=0, sw=0, l=0, gc=0
Producer: ModSecurity for Apache/2.9.7 (http://www.modsecurity.org/).
Server: Apache/2.4.62 (Debian)
Engine-Mode: "ENABLED"

--cb79da64-Z--

@michielbdejong
Copy link
Contributor Author

Will continue tomorrow!

@michielbdejong
Copy link
Contributor Author

Ah, I can get the response by replaying the request with curl!

@michielbdejong
Copy link
Contributor Author

michielbdejong commented Jan 7, 2025

Added a remote share now, this were the call from nextcloud2.docker to nextcloud1.docker:

Discovery

  • GET /ocm-provider/
  • 200 OK
{"enabled":true,"apiVersion":"1.0-proposal1","endPoint":"https:\/\/nextcloud1.docker\/ocm","resourceTypes":[{"name":"file","shareTypes":["user","group"],"protocols":{"webdav":"\/public.php\/webdav\/"}}]}

Accepted notification

  • POST /ocm/notifcations
{"notificationType":"SHARE_ACCEPTED","resourceType":"file","providerId":"1","notification":{"sharedSecret":"2pZhSqE8DiQLqeI","message":"Recipient accept the share"}}
  • 201 Created

PROPFIND

curl -X 'PROPFIND' -d "@propfind.xml" -H 'Authorization: Basic MnBaaFNxRThEaVFMcWVJOg==' https://nextcloud1.docker/public.php/webdav/

Request body:

<?xml version="1.0" encoding="UTF-8"?>
<d:propfind xmlns:d="DAV:">
  <d:prop xmlns:x="http://owncloud.org/ns" xmlns:x1="http://open-collaboration-services.org/ns">
    <d:getlastmodified/>
    <d:getcontentlength/>
    <d:getcontenttype/>
    <x:permissions xmlns:x="http://owncloud.org/ns"/>
    <x1:share-permissions xmlns:x="http://open-collaboration-services.org/ns"/>
    <d:resourcetype/>
    <d:getetag/>
    <d:quota-available-bytes/>
  </d:prop>
</d:propfind>

Response body:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
  <d:response>
    <d:href>/public.php/webdav/</d:href>
     <d:propstat>
      <d:prop>
        <d:getlastmodified>Tue, 07 Jan 2025 08:26:30 GMT</d:getlastmodified>
        <d:getcontentlength>164</d:getcontentlength>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>RGNVW</oc:permissions>
        <d:resourcetype/>
        <d:getetag>&quot;b134a68c554798adf769917887321c83&quot;</d:getetag>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <x1:share-permissions xmlns:x1="http://open-collaboration-services.org/ns"/>
        <d:quota-available-bytes/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

@michielbdejong
Copy link
Contributor Author

Testing michielbdejong/ocm-stub#9 interactively now with:

./dev/ocm-test-suite.sh share-with ocmstub v1.0.0 dev electron nextcloud v28.0.14
docker exec -it -u root ocmstub1.docker /bin/bash
  • update to the propfind branch
  • restart the container

@michielbdejong
Copy link
Contributor Author

@michielbdejong
Copy link
Contributor Author

@michielbdejong
Copy link
Contributor Author

Seems I have it working in dev now but not in ci. Maybe it's due to the longer filename, I'll try changing that.

@michielbdejong
Copy link
Contributor Author

share-with OCM -> OC10, NC27, NC28 done.
Next: share-link from/to OcmStub.

@michielbdejong
Copy link
Contributor Author

michielbdejong commented Jan 8, 2025

docker build --build-arg CACHEBUST="default" --file ./dockerfiles/ocmstub.Dockerfile --tag pondersource/ocmstub:v1.0.0 .

@michielbdejong
Copy link
Contributor Author

On to Pivot! I'll start with solid-contrib/pivot#47 because that feels pretty fundamental.

@michielbdejong
Copy link
Contributor Author

I need to decide what I want to do with the dev config. Should it be pretty unrelated to prod, so using in-memory storage etc, like the upstream default config? Probably not, it doesn't really help us. We don't have the same use case for dev config as upstream CSS, and people who just want to run a super simple CSS can do that by running npm start on CSS.

What we probably want is a config that is as similar to prod as possible, so only some minor changes that make running on localhost easier:

  • http instead of https
  • using subdomains on lolcathost.de

@michielbdejong
Copy link
Contributor Author

michielbdejong commented Jan 9, 2025

Today was a pretty rough day digging deep into the lands where nothing works. In the end I got out of it by taking a step back, changing my strategy multiple times until I was able to peel off one confounding problem and get a clearer view of the other one, bisecting git history from the last time things were known to work (although comparing configs from three incompatible sources, namely the CSS config generator, older Pivot configs, and the css-mashlib repo), and using lolcathost.de and a self-signed cert, and I was able to close solid-contrib/pivot#47 so that feels worthwhile.

The issues left for https://github.com/solid-contrib/pivot/milestone/1 feel doable for tomorrow, hoping to tag Pivot v1.5.0 according to schedule to finish this week.

@michielbdejong
Copy link
Contributor Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant