Skip to content

Commit

Permalink
docs: Add pod README.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Jul 23, 2021
1 parent 98e1441 commit 38620f2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pods/generate/GenerateUtil.ts
Expand Up @@ -13,7 +13,7 @@ import type { ResourcesGenerator } from './ResourcesGenerator';
*/
export async function addGeneratedResources(identifier: ResourceIdentifier, settings: NodeJS.Dict<string>,
generator: ResourcesGenerator, store: ResourceStore): Promise<number> {
const resources = generator.generate(identifier, settings);
const resources = generator.generate(identifier, { podBaseUrl: identifier.path, ...settings });
let count = 0;
for await (const { identifier: resourceId, representation } of resources) {
await store.setRepresentation(resourceId, representation);
Expand Down
22 changes: 22 additions & 0 deletions templates/pod/README$.md.hbs
@@ -0,0 +1,22 @@
# Welcome to your pod

## A place to store your data
Your pod is a **secure storage space** for your documents and data.
<br>
You can choose to share those with other people and apps.

As the owner of this pod,
identified by <a href="{{webId}}">{{webId}}</a>,
you have access to all of your documents.

## Working with your pod
The easiest way to interact with pods
is through Solid apps.
<br>
For example,
you can open your pod in [Databrowser](https://solid.github.io/mashlib/dist/browse.html?uri={{podBaseUrl}}).

## Learn more
The [Solid website](https://solidproject.org/)
and the people on its [forum](https://forum.solidproject.org/)
will be glad to help you on your journey.
12 changes: 12 additions & 0 deletions templates/pod/README.acl.hbs
@@ -0,0 +1,12 @@
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.

<#public>
acl:accessTo <./README>;
acl:agentClass foaf:Agent;
acl:mode acl:Read.

<#owner>
acl:accessTo <./README>;
acl:agent <{{webId}}>;
acl:mode acl:Read, acl:Write, acl:Control.
5 changes: 4 additions & 1 deletion test/unit/pods/ConfigPodManager.test.ts
Expand Up @@ -55,7 +55,10 @@ describe('A ConfigPodManager', (): void => {
expect(podGenerator.generate).toHaveBeenCalledTimes(1);
expect(podGenerator.generate).toHaveBeenLastCalledWith(identifier, settings);
expect(resourcesGenerator.generate).toHaveBeenCalledTimes(1);
expect(resourcesGenerator.generate).toHaveBeenLastCalledWith(identifier, settings);
expect(resourcesGenerator.generate).toHaveBeenLastCalledWith(identifier, {
podBaseUrl: 'http://test.com/alice/',
...settings,
});
expect(store.setRepresentation).toHaveBeenCalledTimes(2);
expect(store.setRepresentation).toHaveBeenCalledWith({ path: '/path/' }, '/');
expect(store.setRepresentation).toHaveBeenLastCalledWith({ path: '/path/foo' }, '/foo');
Expand Down

0 comments on commit 38620f2

Please sign in to comment.