profile
viewpoint
Davide Bortolami ddavidebor Fermium LABS srl ( @fermiumlabs ) Padua, Italy fermiumlabs.com Love electronics, horses, economics and clever solutions to complicated problems. Horses, in particular, are notoriously hard to program.

frappe/frappe_docker 250

Docker images for production and development setups of the Frappe framework and ERPNext

frappe/erpnext_documentation 34

ERPNext User Documentation

frappe/frappe_io 32

Website for Frappe

ddavidebor/nRF51822-OSX-ST_LINK_V2-Flasher-Script 5

A simple script to flash nRF51822 BLE IC using a 2$ ST-LINK V2 programmer

ddavidebor/PicLib 2

Libraries for microchip PIC microcontroller, such as PIC16F876a made to run on XC8 compiler

ddavidebor/frappe 0

Low Code Open Source Framework in Python and JS

ddavidebor/frappe_docker 0

Docker image for frappe-bench

ddavidebor/github-issue-templates 0

:symbols: A collection of GitHub issue and pull request templates

ddavidebor/jupyterlab_app 0

A native app for JupyterLab, based on electron.

ddavidebor/pH-Meter 0

A pH-Meter based on a pic16f876a and a ADS1015 ADC

startedjessfraz/onion

started time in 33 minutes

issue commentfrappe/frappe_docker

Automatic database backup feature doesn't seem to work in single bench install.

https://github.com/crazy-max/swarm-cronjob this already does the cron

It runs 1 service to watch for labels and run cron.

If we make it part of yml it'll will work

hazkaz

comment created time in 4 hours

Pull request review commentleam-tech/renovation_core

fix: Handle access_token with socket.io

 function getRenovationUserDetails(socket) {         if (socket.request.headers.authorization) {             // Sending auth token both in header and in query param due to inconsistent behaviour observed             // This ensures that somehow the token gets to the server and is validated for appropriate response-            headers["Authorization"] = socket.request.headers.authorization;+            headers["Authorization"] = socket.request.headers.authorization.replace("JWTToken", "Bearer");             query.token = getJwtToken(socket);

Updated

assemmarwan

comment created time in 4 hours

push eventleam-tech/renovation_core

Assem Marwan

commit sha be2d24b010ce88f0de292e0b60bbbd636a4d808f

fix: token type jwt => bearer - refactor: renamed getJwtToken -> getToken

view details

push time in 4 hours

issue commentfrappe/frappe_docker

Automatic database backup feature doesn't seem to work in single bench install.

Could we have a long running container which just sleeps and runs the cron every 24 hours?

hazkaz

comment created time in 5 hours

issue commentfrappe/frappe_docker

Incorrect PDF View

@revant hi is this still relevent in the latest docker versions? I tried setting the config but it doesn't fix the issue. Do we need to use nginx hostname or something else instead?

khadijazaki2

comment created time in 5 hours

push eventfrappe/frappe_docker

Revant Nandgaonkar

commit sha 555aee2601ad9894d6cdf25a456ca25de8fb1248

fix: sites-vol owned by non-root user fixes permission denied error during site creation

view details

Revant Nandgaonkar

commit sha d9c77df3f2a5f5807c9a42f3e5b2341f22ec46c7

Merge pull request #409 from revant/fix-vol-perm fix: sites-vol owned by non-root user

view details

Revant Nandgaonkar

commit sha 6d32c561c13164d8b0410e036ef682cd50ddb489

Merge pull request #410 from frappe/develop fix: sites-vol permission

view details

push time in 8 hours

PR merged frappe/frappe_docker

fix: sites-vol permission
+1 -1

0 comment

1 changed file

revant

pr closed time in 8 hours

issue closedfrappe/frappe_docker

Crontab permission error when setting up bench with docker on Ubuntu 20.04

<!-- Welcome to the frappe_docker issue tracker! Before creating an issue, please heed the following:

  1. Is your issue relevant to the frappe_docker or the main Frappe framework? https://github.com/frappe/frappe . if It's the latter, publish the issue there.
  2. Use the search function before creating a new issue. Duplicates will be closed and directed to the original discussion.
  3. When making a bug report, make sure you provide all the required information. The easier it is for maintainers to reproduce, the faster it'll be fixed.
  4. If you think you know what the reason for the bug is, share it with us. Maybe put in a PR 😉 -->

Description of the issue

Following steps described on the development setup guide, leads to error with crontab. Read crontab frappe: crontabs/frappe/: fopen: Permission denied

Context information (for bug reports)

Operating system: Ubuntu 20.04 Docker version 20.10.2, build 2291f61 bench --version - 5.2.1

Permissions of crontab executable for reference:

frappe@3dc496fd0165:/workspace/development$ ls -l /etc/crontab
-rw-r--r-- 1 root root 1042 Oct 11  2019 /etc/crontab

frappe@3dc496fd0165:/workspace/development/frappe-bench$ ls -l /usr/bin/crontab
-rwxr-sr-x 1 root crontab 43568 Oct 11  2019 /usr/bin/crontab

Steps to reproduce the issue

  1. Follow the development setup guide till "setup first bench" stage: https://github.com/frappe/frappe_docker/blob/develop/development/README.md#setup-first-bench
  2. Upon setting up first bench you might see this error Read crontab frappe: crontabs/frappe/: fopen: Permission denied

Observed result

Following error occurs when setting up bench: Read crontab frappe: crontabs/frappe/: fopen: Permission denied

Expected result

This error should not occur.

Stacktrace / full error message if available

N/A

closed time in 9 hours

amenat

delete branch frappe/frappe_docker

delete branch : revert-402-arm64

delete time in 9 hours

PR opened frappe/frappe_docker

fix: sites-vol permission
+1 -1

0 comment

1 changed file

pr created time in 9 hours

issue commentfrappe/frappe_docker

Automatic database backup feature doesn't seem to work in single bench install.

ah ok then. I thought only mine was acting up. Thanks for confirming and for the workaround.

hazkaz

comment created time in a day

issue closedfrappe/frappe_docker

Debug mode not work correctly - edit code not update

Description of the issue

When edit a py file, browser not get the modification if dont restart Bench Web

Steps to reproduce the issue

  1. install docker following this guide
  2. enable develop_mode and start Bench Web: This command starts all processes with the exception of Redis (which is already running in separate container) and the web process. The latter can can finally be started from the debugger tab of VSCode by clicking on the "play" button.
  3. edit a py file adding, for example, frappe.msgprint("hi")
  4. refresh your browser. It doesnt show anything
  5. restarting Bench Web
  6. browser show the message

Observed result

no message showing in the browser

Expected result

hi message

Stacktrace / full error message if available

no error appear

closed time in a day

GraficheAquilane2021

issue commentfrappe/frappe_docker

Debug mode not work correctly - edit code not update

If you use debugger feature auto reload won't work

https://github.com/frappe/erpnext/wiki/VSCode-Debugging-for-Frappe-Python#caveats

GraficheAquilane2021

comment created time in a day

issue commentfrappe/frappe_docker

Crontab permission error when setting up bench with docker on Ubuntu 20.04

Try installing the crontab or any other packages as needed.

You can even modify permissions of things using sudo.

sudo is available in the bench devcontainer for convenience.

Ideally this should not happen.

It is not happening on windows machine with docker desktop as well.

amenat

comment created time in a day

push eventfrappe/frappe_docker

Revant Nandgaonkar

commit sha 555aee2601ad9894d6cdf25a456ca25de8fb1248

fix: sites-vol owned by non-root user fixes permission denied error during site creation

view details

Revant Nandgaonkar

commit sha d9c77df3f2a5f5807c9a42f3e5b2341f22ec46c7

Merge pull request #409 from revant/fix-vol-perm fix: sites-vol owned by non-root user

view details

push time in a day

PR merged frappe/frappe_docker

fix: sites-vol owned by non-root user

fixes permission denied error during site creation Error faced in PWD and docker swarm

+1 -1

0 comment

1 changed file

revant

pr closed time in a day

issue commentfrappe/frappe_docker

Automatic database backup feature doesn't seem to work in single bench install.

bench cli sets up a local crontab that does the backups.

In case of docker, there is no crontab that runs in any container. So instead container based solution is recommended as mentioned in previous message.

thanks to Gavin D'Souza and Aditya Hase from frappe team for help

https://github.com/frappe/bench/blob/e16824f23e0afd1d74bf2290a580533239c04064/bench/utils.py#L388-L408

Solution:

  • [ ] edit single-bench and multi-bench compose files to accommodate https://github.com/crazy-max/swarm-cronjob
  • [ ] move backup cronjob part from wiki to docker swarm setup docs
  • [ ] Mention this as part of kubernetes setup docs
hazkaz

comment created time in a day

issue commentfrappe/frappe_docker

Automatic database backup feature doesn't seem to work in single bench install.

I can confirm this issue.

My backups are shown on page because I've a separate CronJob that does the backups every 12 hours.

Workaround: k8s : https://helm.erpnext.com/kubernetes-resources/create-backup-and-push-to-cloud-cronjob docker: https://github.com/frappe/frappe_docker/wiki/Backup-and-Push-to-cloud-Swarm-Cron-job

hazkaz

comment created time in a day

PR opened frappe/frappe_docker

fix: sites-vol owned by non-root user

fixes permission denied error during site creation Error faced in PWD and docker swarm

+1 -1

0 comment

1 changed file

pr created time in a day

issue openedfrappe/frappe_docker

Debug mode not work correctly - edit code not update

Description of the issue

When edit a py file, browser not get the modification if dont restart Bench Web

Steps to reproduce the issue

  1. install docker following this guide
  2. enable develop_mode and start Bench Web: This command starts all processes with the exception of Redis (which is already running in separate container) and the web process. The latter can can finally be started from the debugger tab of VSCode by clicking on the "play" button.
  3. edit a py file adding, for example, frappe.msgprint("hi")
  4. refresh your browser. It doesnt show anything
  5. restarting Bench Web
  6. browser show the message

Observed result

not message showing in the browser

Expected result

hi message

Stacktrace / full error message if available

no error appear

created time in a day

Pull request review commentleam-tech/renovation_core

fix: Handle access_token with socket.io

 function getRenovationUserDetails(socket) {         if (socket.request.headers.authorization) {             // Sending auth token both in header and in query param due to inconsistent behaviour observed             // This ensures that somehow the token gets to the server and is validated for appropriate response-            headers["Authorization"] = socket.request.headers.authorization;+            headers["Authorization"] = socket.request.headers.authorization.replace("JWTToken", "Bearer");             query.token = getJwtToken(socket);

This function may need to be changed to => getJwtToken(socket)

assemmarwan

comment created time in a day

PR opened leam-tech/renovation_core

Reviewers
fix: Handle access_token with socket.io bug

Problem

Socket.io was failing to connect when the authorization header contained access_token. This is because of the previous implementation of JWTToken in which a JWT token was decoded to extract the user which is not the case anymore.

Solution

The solution lies in two places:

socketio.js => Replace the authorization header type from JWTToken -> Bearer realtime.py => Remove JWT decoding and validate using frappe's validate_auth if token is passed, otherwise set the user in frappe.session.user

+18 -20

0 comment

2 changed files

pr created time in a day

create barnchleam-tech/renovation_core

branch : socketio-oauth-handling

created branch time in a day

delete branch leam-tech/renovation_core

delete branch : socketio-oauth-handling

delete time in a day

PR closed leam-tech/renovation_core

Reviewers
fix: Handle Bearer Authorization in SocketIO bug

Problem

Socket.io was failing to connect when the authorization header contained access_token. This is because of the previous implementation of JWTToken in which a JWT token was decoded to extract the user which is not the case anymore.

Solution

The solution lies in two places:

  • socketio.js => Replace the authorization header type from JWTToken -> Bearer
  • realtime.py => Remove JWT decoding and validate using frappe's validate_auth if token is passed, otherwise set the user in frappe.session.user
+0 -0

0 comment

0 changed file

assemmarwan

pr closed time in a day

PR opened leam-tech/renovation_core

Reviewers
fix: Handle Bearer Authorization in SocketIO bug

Problem

Socket.io was failing to connect when the authorization header contained access_token. This is because of the previous implementation of JWTToken in which a JWT token was decoded to extract the user which is not the case anymore.

Solution

The solution lies in two places:

  • socketio.js => Replace the authorization header type from JWTToken -> Bearer
  • realtime.py => Remove JWT decoding and validate using frappe's validate_auth if token is passed, otherwise set the user in frappe.session.user
+0 -0

0 comment

0 changed file

pr created time in a day

create barnchleam-tech/renovation_core

branch : socketio-oauth-handling

created branch time in a day

issue commentfrappe/frappe_docker

Crontab permission error when setting up bench with docker on Ubuntu 20.04

I couldn't reproduce this issue on my machine.

❯ uname -a
Linux revant-laptop 5.10.7-arch1-1 #1 SMP PREEMPT Wed, 13 Jan 2021 12:02:01 +0000 x86_64 GNU/Linux

❯ docker --version
Docker version 20.10.2, build 2291f610ae

removed the frappe/bench:latest image to pull the latest and check.

<details>

<summary>Successful Output</summary>

frappe@4d4a73eca44d:/workspace/development$ bench init --skip-redis-config-generation --frappe-branch version-12 frappe-bench
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

$ /usr/bin/virtualenv -q env -p python3
Already using interpreter /usr/bin/python3

Getting frappe
$ git clone https://github.com/frappe/frappe.git --branch version-12 --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 2649, done.
remote: Counting objects: 100% (2649/2649), done.
remote: Compressing objects: 100% (2471/2471), done.
remote: Total 2649 (delta 354), reused 1037 (delta 128), pack-reused 0
Receiving objects: 100% (2649/2649), 12.44 MiB | 4.09 MiB/s, done.
Resolving deltas: 100% (354/354), done.

Installing frappe
$ frappe-bench/env/bin/pip install -q -U -e frappe-bench/apps/frappe 
$ yarn install
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning " > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
[4/4] Building fresh packages...
Done in 108.30s.
Updating node packages...

Installing node dependencies for frappe
$ yarn install
yarn install v1.22.10
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.50s.
$ bench build
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

yarn run v1.22.10
$ FRAPPE_ENV=production node rollup/build.js
Production mode
✔ Built js/moment-bundle.min.js
✔ Built js/libs.min.js

Building frappe assets...

✔ Built js/checkout.min.js
✔ Built js/dialog.min.js
✔ Built js/modules.min.js
✔ Built js/social.min.js
✔ Built js/web_form.min.js
✔ Built js/chat.js
✔ Built js/list.min.js
✔ Built js/barcode_scanner.min.js
✔ Built frappe/css/email.css
✔ Built js/bootstrap-4-web.min.js
✔ Built js/desk.min.js
✔ Built js/frappe-web.min.js
✔ Built js/frappe-recorder.min.js
✔ Built css/frappe-rtl.css
✔ Built css/printview.css
✔ Built css/form.min.css
✔ Built css/report.min.css
✔ Built css/list.min.css
✔ Built css/module.min.css
✔ Built js/control.min.js
✔ Built css/frappe-chat-web.css
✔ Built css/web_form.css
✔ Built js/form.min.js
✔ Built js/data_import_tools.min.js
✔ Built css/desk.min.css
✔ Built js/report.min.js
✔ Built css/frappe-web-b4.css
✨  Done in 45.784s
Done in 46.67s.
SUCCESS: Bench frappe-bench initialized
frappe@4d4a73eca44d:/workspace/development$ cd frappe-bench/
frappe@4d4a73eca44d:/workspace/development/frappe-bench$ bench set-mariadb-host mariadb
he-host redis-cache:6379
bench set-redis-queue-host redis-queue:6379
bench set-redis-socketio-host redis-socketio:6379WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

frappe@4d4a73eca44d:/workspace/development/frappe-bench$ bench set-redis-cache-host redis-cache:6379
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

frappe@4d4a73eca44d:/workspace/development/frappe-bench$ bench set-redis-queue-host redis-queue:6379
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

frappe@4d4a73eca44d:/workspace/development/frappe-bench$ bench set-redis-socketio-host redis-socketio:6379
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

frappe@4d4a73eca44d:/workspace/development/frappe-bench$ bench new-site mysite.localhost --no-mariadb-socket
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

MySQL root password: 

Installing frappe...
Updating DocTypes for frappe        : [========================================]
Updating country info               : [========================================]
Set Administrator password: 
Re-enter Administrator password: 
*** Scheduler is disabled ***
frappe@4d4a73eca44d:/workspace/development/frappe-bench$ 

</details>

I was able to start bench and login to http://mysite.localhost:8000

amenat

comment created time in a day

more