Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
10eb370
Replace `yarn` with `just` (WIP)
sgoumaz Aug 11, 2022
d82f1e0
Lint code with `semistandard`
sgoumaz Aug 11, 2022
08dcdac
Refactor folder names for clarity
sgoumaz Aug 11, 2022
1b59f4b
Apply linting to code in `src-overrides/`
sgoumaz Aug 11, 2022
bb8c15c
starting opener job on 1.8.0-rc6
perki Sep 30, 2022
8ae4c74
Augmenting test config and README
perki Sep 30, 2022
9434620
Merge remote-tracking branch 'origin/refactor/dev-env' into release/1.8
perki Sep 30, 2022
a6c8786
Switch to just
perki Sep 30, 2022
5868f4b
Updated readme to reflect just changes
perki Sep 30, 2022
89dc736
6 tests failing on api-server + all cache and mall
perki Sep 30, 2022
5adbde1
All api-server tests passing
perki Sep 30, 2022
c3b9d7a
missing some changes
perki Sep 30, 2022
12d0279
Putting opener back to work without flow for register step1
Mar 10, 2023
8ca6b20
Removing flow
Mar 13, 2023
5eba3b5
Adding tests
Mar 13, 2023
aed5376
Updating public_html outisde of "dist"
Mar 14, 2023
32051e1
fixing register
Mar 16, 2023
33daea5
Cleaning up
Mar 17, 2023
8f2f191
Merge remote-tracking branch 'origin/master' into release/1.8
Mar 17, 2023
ae8d1da
Updated service-mail
Mar 17, 2023
cc404c5
removing trailing yarn stuff
Mar 17, 2023
869214d
Update GH workflows
sgoumaz Mar 20, 2023
aa56838
Rename `src-overrides` to `overrides`
sgoumaz Mar 27, 2023
57641a3
Rename scripts for consistency with core
sgoumaz Mar 27, 2023
b8e057e
Add install step to CI workflow (to be reviewed again)
sgoumaz Mar 27, 2023
e3d70f5
Use latest core & register
sgoumaz May 1, 2023
339d418
Multiple updates to prepare 1.9.0-open
Jun 21, 2023
184289d
updating CI ubuntu and node versions
Jun 21, 2023
e72e3c0
Update recla renew and backup scripts
Jun 21, 2023
aefb615
Remove unneeded `lodash` and update dependencies
sgoumaz Jul 12, 2023
75e3976
Fix linting issues
sgoumaz Jul 12, 2023
078073c
updated opener
Sep 28, 2023
fbb9984
Makcing check_email work
Oct 2, 2023
5b99bb0
Updating config and features
Oct 3, 2023
94af0cc
Update repositor hashes and release.yml
Oct 4, 2023
701449c
re-adjusting avaliableCore for tests and cleaning up package.json
Oct 4, 2023
a30276e
fixing user tests
Oct 6, 2023
de8b677
relying on start mongo script from service-core
Oct 9, 2023
c219543
Starting mongo with --fork during CI
Oct 9, 2023
c83b2b4
updated service-core
Oct 11, 2023
9e7d7ac
corrected check_username
Oct 12, 2023
99ca5ed
1.9.0 candidate
Oct 13, 2023
8824919
Removing just from requirements
Nov 21, 2023
3b10c64
Making databse work again
Nov 21, 2023
6b897fb
Updated README
Nov 22, 2023
92f9dab
Using buildin SSL for Native setup
Nov 28, 2023
180cc9a
removing unused entry in package.json
Nov 28, 2023
1084f7f
strong Docker refactor
Nov 29, 2023
3de2341
continung docker refactor
Nov 29, 2023
5e605fc
Continuing Docker refactor
Nov 29, 2023
d22cabf
Finalizing 1.0.0 first release
Nov 30, 2023
a636298
pdated to latest version of components and fixed autoget script
Jan 11, 2024
88b413d
Updated event types and support references
Jan 16, 2024
2fa3e0a
rec-la => backloop.dev
Feb 27, 2024
977f3df
updated service-mail and service-register
Feb 27, 2024
0c53117
initaiting 1.9.2
Apr 11, 2024
64cc706
adding change log
Apr 11, 2024
09608b4
Updating service core
Apr 12, 2024
a166ebd
ready for v1.9.2
May 22, 2024
3283d83
publishing 1.9.2
May 22, 2024
f9c6e0d
Open sourcing
Feb 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 17 additions & 32 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: Open Pryv.io tests
name: Open Pryv.io CI

on:
on:
pull_request:
branches:
- master
- '*'
push:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [16.4.1]
node-version: [18.16.0]

steps:
- name: Install `just`
uses: extractions/setup-just@v1

- name: Checkout repository with submodules
uses: actions/checkout@v2
with:
Expand All @@ -31,45 +33,28 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# mainly used so that next step does not fail on "git clone git@github.com:pryv/open-pryv.io.git dest"
- name: Download Open Pryv.io repository in dest/
uses: actions/checkout@v2
with:
repository: pryv/open-pryv.io
path: dest
clean: false

# there is one private package (lib-reporting) used as npm package, so we need
# there is one private package (lib-reporting) used as npm package, so we need
# to authenticate
- name: Login to github
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.TECH_PRYV_SSH_KEY }}

- name: Setup opener
run: |
yarn setup
yarn install
run: just setup

- name: Generate Open Pryv.io
run: yarn build
- name: Build
run: just build

- name: Setup Open Pryv.io
working-directory: dest
run: |
yarn setup
yarn release

# to remove when we remove components/previews-server
- name: Setup package for previews
working-directory: dest
run: sudo apt-get install graphicsmagick

- name: start MongoDB
working-directory: dest
run: yarn database
./scripts/setup-dev-env
sudo apt-get install graphicsmagick
just install-stable
IS_CI=true ./scripts/start-mongo

- name: Run tests on Open Pryv.io
working-directory: dest
run: |
IS_CI=true yarn test
IS_CI=true just test all
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ nbproject/
*.log
# Pycharm IDE
.idea/
.DS_Store
86 changes: 86 additions & 0 deletions .licenser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
files:
"**/*.js":
header:
startBlock: |
/**
* @license
linePrefix: " * "
endBlock: " */"

"**/package.json":
json:
force:
author: "{AUTHOR_NAME} <{AUTHOR_EMAIL}> ({AUTHOR_WEB})"
license: "{SPDX}"
private: true
defaults:
homepage: "{HOMEPAGE}"
description: "{DESCRIPTION}"
sortPackage: true

siblingLicenseFile:
name: "LICENSE"
license: |
Copyright (C) {YEARS} {AUTHOR_NAME} {AUTHOR_WEB}

This file is part of Open-Pryv.io and released under BSD-Clause-3 License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-3-Clause

"**/README.md":
footer:
startBlock: "\n\n## License\n\n"
linePrefix: ""
endBlock: ""
license: "[{SPDX}](LICENSE)"

ignore:
- .git
- .vscode
- coverage
- node_modules
- dest
- service-core
- service-mail
- service-register

license: |
Copyright (C) {AUTHOR_NAME} {AUTHOR_WEB}
This file is part of Pryv.io and released under BSD-Clause-3 License
Refer to LICENSE file

substitutions:
YEARS:
start: 2019
end: CURRENT_YEAR
AUTHOR_NAME: "Pryv"
AUTHOR_EMAIL: info@pryv.com
AUTHOR_WEB: https://pryv.com
DESCRIPTION: "This package is part of Pryv.io, a Pryv software"
HOMEPAGE: https://pryv.com
SPDX: BSD-3-Clause
12 changes: 6 additions & 6 deletions src/licensing/LICENSE → LICENSE
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Copyright (c) 2020 Pryv S.A. https://pryv.com
Copyright (C) 2019–2025 Pryv https://pryv.com

This file is part of Open-Pryv.io and released under BSD-Clause-3 License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand Down
57 changes: 15 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Pryv.io Opener

Script that releases the open source version of Pryv.io.

Script that releases the open-pryv.io a strip down version of service-core, service-mail and service-register.
As of february 2025 All Pryv.io software has been open-sourced.

## Usage

1. Fetch git dependencies: `yarn setup`
2. Fetch node dependencies: `yarn`
3. Generate open-source release: `yarn build` this step also licenses code with: `yarn license`
1. Fetch git dependencies: `just setup`
2. Fetch node dependencies: `just install`
3. Generate open-source release: `just build`
4. Verify the release in `./dest`

### Update git dependencies
Expand All @@ -20,46 +20,19 @@ For one or more of `service-core`, `service-register`, `service-mail`:
4. `cd ..`
5. git add, commit and push

## Publishing

## License

License settings and script are located in [`licenser/`](licenser/).


## Helpers for developpment

1. In `dest/` run `yarn setup`, `yarn release`, `yarn watch`
2. `dest/dist/components/register` or other component you need to test
- `pushd {your path}/dev-pryv.io-opener/ ; yarn build ; popd ; ../../node_modules/.bin/mocha 'test/**/*.test.js'`
3. to start api-server cd to `dest` and use `cd ../ ; yarn build; cd dest; sleep 2 ; yarn api`
or: `cd ../ ; yarn build; cd dest; sleep 2 ; dist/components/api-server/bin/server --config ./config.yml`


## Design
As per 1.9.0 integrated release has been removed. Github script `release-orig.yml` has been kept for reference.

### service-core
Publish docker containers:
- build the containers from `dest/docker`
- build the tarball with the confing with `build_tarball.sh`
- publish the containers `docker push "pryvio/open-pryv.io-api:{TAG}` & `docker push "pryvio/open-pryv.io-mail:{TAG}`
- Commit the content of `dest`
- Publish on github: push `dest` content

Changes made on **service-core** legacy code base to make it openable

#### Integration of register as a component (used if DNSLESS = true)

- Added `/reg` route in `routes/Path.js`
- Module is loaded directly from `server.js` with `expressApp` and `applications` parameters

### service-regiser

Changes made on **service-core** legacy code base to make it openable

This task had a very small impact on the code of register as the **node-app-opener** was able to strip out the necessary code.

Note the **striping comments** in `routes/admin.js` and `routes/user.js` that are used to remove parts of the code during build process of the open version.

Example:

The code between `// START - CLEAN ...` and `// END - CLEAN ...` will be removed
## License

```javascript
// START - CLEAN FOR OPENSOURCE
const invitationToken = require('../storage/invitations');
// END - CLEAN FOR OPENSOURCE
```
[BSD-3-Clause](LICENSE)
8 changes: 7 additions & 1 deletion src/index.js → build/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/**
* @license
* Copyright (C) Pryv https://pryv.com
* This file is part of Pryv.io and released under BSD-Clause-3 License
* Refer to LICENSE file
*/
const serviceCore = require('./service-core');
const serviceMail = require('./service-mail');
const serviceRegister = require('./service-register');
const root = require('./root');
(async () => { 
(async () => {
await serviceCore();
await serviceRegister();
await serviceMail();
Expand Down
52 changes: 52 additions & 0 deletions build/lib/json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* @license
* Copyright (C) Pryv https://pryv.com
* This file is part of Pryv.io and released under BSD-Clause-3 License
* Refer to LICENSE file
*/
const path = require('path');
const fs = require('fs');

module.exports = function (destDir) {
return function (task) {
const fileDest = path.resolve(destDir, task.target);
const jsonStringContent = fs.readFileSync(fileDest, { encoding: 'utf8' });
let dest = JSON.parse(jsonStringContent);
if (task.json.merge) {
mergeDeep(dest, task.json.merge);
}
fs.writeFileSync(fileDest, JSON.stringify(dest, null, 2));
};
};

/**
* Simple object check.
* @param item
* @returns {boolean}
*/
function isObject(item) {
return (item && typeof item === 'object' && !Array.isArray(item));
}

/**
* Deep merge two objects.
* @param target
* @param ...sources
*/
function mergeDeep(target, ...sources) {
if (!sources.length) return target;
const source = sources.shift();

if (isObject(target) && isObject(source)) {
for (const key in source) {
if (isObject(source[key])) {
if (!target[key]) Object.assign(target, { [key]: {} });
mergeDeep(target[key], source[key]);
} else {
Object.assign(target, { [key]: source[key] });
}
}
}

return mergeDeep(target, ...sources);
}
16 changes: 11 additions & 5 deletions src/lib/rsync.js → build/lib/rsync.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
/**
* @license
* Copyright (C) Pryv https://pryv.com
* This file is part of Pryv.io and released under BSD-Clause-3 License
* Refer to LICENSE file
*/
const Rsync = require('rsync');
const path = require('path');
const mkdirp = require('mkdirp');

module.exports = async function rsync(task, srcDir, destDir) {
module.exports = async function rsync (task, srcDir, destDir) {
const src = path.resolve(srcDir, task.target);
let dest = path.resolve(destDir);
if (! task.rsyncUseDestDir) {
if (!task.rsyncUseDestDir) {
dest = path.dirname(path.resolve(destDir, task.target));
}
console.log(src + ' >>>> ' + dest);
mkdirp(dest);
const r = new Rsync()
.set('a')
//.progress()
// .progress()
.source(src)
.destination(dest);

if (!task.noDelete) r.delete();
if (task.excludes) r.exclude(task.excludes);
if (task.patterns) r.patterns(task.patterns);

await new Promise((resolve, reject) => {
r.execute(function (error, code, cmd) {
if (error) return reject(error);
Expand All @@ -30,4 +36,4 @@ module.exports = async function rsync(task, srcDir, destDir) {
process.stderr.write(data);
});
});
}
};
Loading
Loading