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

MErge Main to Dev #10

Merged
merged 51 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
bb5954a
Merge pull request #5 from geniusdynamics/dev
compgeniuses Aug 7, 2024
7f541ab
Add HRM
compgeniuses Aug 8, 2024
1dc720b
Add HrMS app to Bench
compgeniuses Aug 8, 2024
4e4d761
move get app to configurator
compgeniuses Aug 8, 2024
5a4e473
Redefine where install hrm is executed from
compgeniuses Aug 8, 2024
be7912a
define app install hrms
compgeniuses Aug 8, 2024
6a0db84
add get app
compgeniuses Aug 8, 2024
1e0d227
change hrms version to 15
compgeniuses Aug 8, 2024
1cf6c60
redefine frontend
compgeniuses Aug 8, 2024
96e95a7
test, add multiple apps
compgeniuses Aug 8, 2024
80617d9
remove hrms
compgeniuses Aug 8, 2024
4f9a134
hrm
compgeniuses Aug 8, 2024
ffce259
redefine order
compgeniuses Aug 8, 2024
92cf977
remove define developer mode 0
compgeniuses Aug 8, 2024
b0a1554
add ;
compgeniuses Aug 8, 2024
be1dbed
remove install hrms
compgeniuses Aug 8, 2024
b5f2221
feat: updated create-site
kemboi22 Aug 8, 2024
27023c4
change image
compgeniuses Aug 9, 2024
dec6005
test installl hrms from other images arnadeem/erpnext-hrms
compgeniuses Aug 9, 2024
f196d11
update relative image location
compgeniuses Aug 9, 2024
10a3fb7
feat: added genius dynamics build-images.sh
kemboi22 Aug 9, 2024
7f3bda7
Merge remote-tracking branch 'origin/hrm' into hrm
kemboi22 Aug 9, 2024
b45c81b
feat: added genius dynamics build-images.sh
kemboi22 Aug 9, 2024
d721334
feat: added hrms and payments
kemboi22 Aug 9, 2024
9427f66
feat: back to default
kemboi22 Aug 10, 2024
7cf7473
feat: updated Repo Images
kemboi22 Aug 10, 2024
d5f1eff
feat: updated to use CUSTOM_ERPNEXT_IMAGE
kemboi22 Aug 10, 2024
c51befc
feat: added multi selection to selected to be use in installing modules
kemboi22 Aug 11, 2024
3ff49ed
feat: added erpnext-modules.env
kemboi22 Aug 11, 2024
6a01903
feat: passed erpnext-modules.env
kemboi22 Aug 11, 2024
14a6981
feat: ability to read erpnext-modules.env
kemboi22 Aug 11, 2024
e02d671
feat: loop thru ERP NEXT modules and install
kemboi22 Aug 11, 2024
9a9ca58
feat: read configurations
kemboi22 Aug 11, 2024
60e2922
feat: updated the setting to correct values
kemboi22 Aug 11, 2024
4fa5e42
feat: changed from json array to bash array
kemboi22 Aug 11, 2024
05cde6d
feat: updated Settings.vue
kemboi22 Aug 11, 2024
3fa23fa
feat: updated Settings.vue
kemboi22 Aug 11, 2024
b3e7b82
feat: display selected modules
kemboi22 Aug 11, 2024
78fbe7f
feat: updated mariadb-app.service
kemboi22 Aug 11, 2024
414a7a6
feat: few changes in create-site
kemboi22 Aug 11, 2024
07bbb8f
feat: few changes in create-site
kemboi22 Aug 11, 2024
d0f5fbb
feat: changes in 20read
kemboi22 Aug 11, 2024
155e128
feat: few changes in the setting of erpnext modules
kemboi22 Aug 11, 2024
ac716ef
feat: added other Settings.vue
kemboi22 Aug 11, 2024
d6075d1
feat: added health care
kemboi22 Aug 11, 2024
f9d56cd
Adjust Apps order
compgeniuses Aug 11, 2024
303d871
Update image Build version with tagged
compgeniuses Aug 11, 2024
d9e2a03
update docker image org
compgeniuses Aug 12, 2024
3045bf7
re-define proper apps names, for csf_ke and pdf_on_submit
compgeniuses Aug 12, 2024
2e2b173
Additionally, Add CRM
compgeniuses Aug 12, 2024
8bd1723
Merge pull request #8 from geniusdynamics/hrm
compgeniuses Aug 12, 2024
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
4 changes: 2 additions & 2 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ images=()
repobase="${REPOBASE:-ghcr.io/geniusdynamics}"
# Configure the image name
reponame="erpnext"
app_version="v15.31.5"
app_version="v15.32.1-ns.1"
# Create a new empty container image
container=$(buildah from scratch)

Expand Down Expand Up @@ -45,7 +45,7 @@ buildah config --entrypoint=/ \
--label="org.nethserver.authorizations=traefik@node:routeadm" \
--label="org.nethserver.tcp-ports-demand=1" \
--label="org.nethserver.rootfull=0" \
--label="org.nethserver.images=docker.io/mariadb:10.11.5 docker.io/frappe/erpnext:${app_version} docker.io/redis:6.2-alpine" \
--label="org.nethserver.images=docker.io/mariadb:10.11.5 docker.io/geniusdynamics/custom-erpnext:${app_version} docker.io/redis:6.2-alpine" \
"${container}"
# Commit the image
buildah commit "${container}" "${repobase}/${reponame}"
Expand Down
20 changes: 6 additions & 14 deletions imageroot/actions/configure-module/10configure_environment_vars
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,12 @@ import agent
data = json.load(sys.stdin)

#This is specific to you module, so you need to change it accordingly.
# we read a json stdin {"vars1":true, "var2":"foo", "vars3": 3} and we writ it to .config/state/environment
# Upper case to set environment variable and minor case to read from stdin

# this values must exists in the json stdin
# agent.set_env("MAIL_SERVER", data["mail_server"])
# agent.set_env("LDAP_DOMAIN", data["ldap_domain"])
ERP_NEXT_MODULES = data.get("erpSelectedModules", [])

# you can add default values for the following variables
# agent.set_env("MAIL_DOMAIN",data.get("mail_domain",""))
# agent.set_env("WOWORKERSCOUNT",data.get("workers_count",3))
# agent.set_env("AUXILIARYACCOUNT",data.get("auxiliary_account",True))
# agent.set_env("ACTIVESYNC",data.get("activesync",False))
agent.write_envfile("erpnext-modules.env", {
"ERP_NEXT_MODULES": ERP_NEXT_MODULES
})
agent.set_env("ERP_NEXT_MODULES", ERP_NEXT_MODULES)


# Make sure everything is saved inside the environment file
# just before starting systemd unit
#agent.dump_env()
agent.dump_env()
6 changes: 6 additions & 0 deletions imageroot/actions/get-configuration/20read
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ import sys
import json
import agent


# Prepare return variable
config = {}

# Read current configuration from the environment file
config["host"] = os.getenv("TRAEFIK_HOST","")
config["http2https"] = os.getenv("TRAEFIK_HTTP2HTTPS") == "True"
config["lets_encrypt"] = os.getenv("TRAEFIK_LETS_ENCRYPT") == "True"
config["erpSelectedModules"] = os.getenv("ERP_NEXT_MODULES", [])
# Load erpnext-modules.env file

erp_next_modules = "erpnext-modules.env"


# Dump the configuration to stdout
json.dump(config, fp=sys.stdout)
12 changes: 11 additions & 1 deletion imageroot/bin/create-site
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,14 @@
fi
done;
echo "sites/common_site_config.json found";
bench new-site --no-mariadb-socket --admin-password=admin --db-root-password="$MARIADB_ROOT_PASSWORD" --install-app erpnext --set-default frontend;
bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password="$MARIADB_ROOT_PASSWORD" --install-app erpnext --set-default;
# Convert the JSON-like string to a bash array
ERPNEXT_MODULES=$(echo "$ERP_NEXT_MODULES" | tr -d "[]'" | tr -d ' ')
IFS=',' read -r -a ERP_NEXT_MODULES_ARRAY <<< "$ERPNEXT_MODULES"
# Iterate over the array
for module in "${ERP_NEXT_MODULES_ARRAY[@]}"; do
echo "Processing $module"
# Add your logic here, e.g., installing apps
bench --site frontend install-app "$module"
done

2 changes: 1 addition & 1 deletion imageroot/systemd/user/backend.service
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/backend.pid \
--pod-id-file %t/erp-next.pod-id --replace -d --name backend \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
${ERPNEXT_IMAGE}
${CUSTOM_ERPNEXT_IMAGE}

ExecStop=/usr/bin/podman stop --ignore --cidfile %t/backend.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP backend
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/configurator.service
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/configurator.pid \
-v logs:/home/frappe/frappe-bench/logs \
-v %S/bin/configurator:/configurator:Z \
--env-file=%S/state/configurator.env \
${ERPNEXT_IMAGE} /bin/bash -c "/configurator"
${CUSTOM_ERPNEXT_IMAGE} /bin/bash -c "/configurator"
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/configurator.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP configurator
SyslogIdentifier=%u
Expand Down
3 changes: 2 additions & 1 deletion imageroot/systemd/user/create-site.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/create-site.pid \
-v logs:/home/frappe/frappe-bench/logs \
-v %S/bin/create-site:/create-site:Z \
--env-file=%S/state/database.env \
${ERPNEXT_IMAGE} /bin/bash -c "/create-site"
--env-file=%S/state/erpnext-modules.env \
${CUSTOM_ERPNEXT_IMAGE} /bin/bash -c "/create-site"
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/create-site.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP create-site
SyslogIdentifier=%u
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/frontend.service
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/frontend.pid \
-e UPSTREAM_REAL_IP_RECURSIVE=off \
-e PROXY_READ_TIMEOUT=120 \
-e CLIENT_MAX_BODY_SIZE=50m \
${ERPNEXT_IMAGE} nginx-entrypoint.sh
${CUSTOM_ERPNEXT_IMAGE} nginx-entrypoint.sh
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/frontend.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP frontend
SyslogIdentifier=%u
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/mariadb-app.service
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/mariadb-app.pid \
${MARIADB_IMAGE} \
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --skip-character-set-client-handshake
ExecStartPost=/usr/bin/podman exec mariadb-app /bin/bash -c 'printf "[client] \npassword=${MARIADB_ROOT_PASSWORD}" > /root/.my.cnf'
ExecStartPost=/usr/bin/podman exec mariadb-app /bin/bash -c "while ! mysqladmin ping -h localhost -P 3306 -u root; do sleep 1; done"
#ExecStartPost=/usr/bin/podman exec mariadb-app /bin/bash -c "while ! mysqladmin ping -h localhost -P 3306 -u root; do sleep 1; done"
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/mariadb-app.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/mariadb-app.ctr-id
ExecReload=/usr/bin/podman kill -s HUP mariadb-app
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/queue-long.service
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/queue-long.pid \
--pod-id-file %t/erp-next.pod-id --replace -d --name queue-long \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
${ERPNEXT_IMAGE} bench worker --queue long,default,short
${CUSTOM_ERPNEXT_IMAGE} bench worker --queue long,default,short
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/queue-long.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP queue-long
SyslogIdentifier=%u
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/queue-short.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/queue-short.pid \
--pod-id-file %t/erp-next.pod-id --replace -d --name queue-short \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
${ERPNEXT_IMAGE} bench worker --queue short,default
${CUSTOM_ERPNEXT_IMAGE} bench worker --queue short,default
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/queue-short.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP queue-short
SyslogIdentifier=%u
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/scheduler.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/scheduler.pid \
--pod-id-file %t/erp-next.pod-id --replace -d --name scheduler \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
${ERPNEXT_IMAGE} bench schedule
${CUSTOM_ERPNEXT_IMAGE} bench schedule
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/scheduler.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP scheduler
SyslogIdentifier=%u
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/websocket.service
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/websocket.pid \
--pod-id-file %t/erp-next.pod-id --replace -d --name websocket \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
${ERPNEXT_IMAGE} node /home/frappe/frappe-bench/apps/frappe/socketio.js
${CUSTOM_ERPNEXT_IMAGE} node /home/frappe/frappe-bench/apps/frappe/socketio.js
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/websocket.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP websocket
SyslogIdentifier=%u
Expand Down
52 changes: 52 additions & 0 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,30 @@
$t("settings.enabled")
}}</template>
</cv-toggle>
<div>Selected Modules: {{erpSelectedModules}} </div>
<cv-multi-select
:label="'ERP Next Modules to be installed'"
:options="erpNextModules"
:title="'ERP Next Modules to be installed'"
v-model="erpSelectedModules"
>
</cv-multi-select>
<!-- advanced options -->
<cv-accordion ref="accordion" class="maxwidth mg-bottom">
<cv-accordion-item :open="toggleAccordion[0]">
<template slot="title">{{ $t("settings.advanced") }}</template>
<template slot="content">

<div v-for="module in erpNextModules" :key="module.value">
<cv-toggle
:label="module.value"
:value="module.value"
v-model="erpSelectedModules"
:disabled="loading.getConfiguration || loading.configureModule"
class="mg-bottom">

</cv-toggle>
</div>
</template>
</cv-accordion-item>
</cv-accordion>
Expand Down Expand Up @@ -125,6 +144,37 @@ export default {
host: "",
isLetsEncryptEnabled: false,
isHttpToHttpsEnabled: true,
erpNextModules:[
{ "label": "Insights", "value": "insights", "name": "insights", "disabled": false },
{ "label": "Hrms", "value": "hrms", "name": "hrms", "disabled": false },
{ "label": "Nl Attendance Timesheet", "value": "nl_attendance_timesheet", "name": "nl-attendance-timesheet", "disabled": false },
{ "label": "Nl Piece Rate Pay", "value": "nl_piece_rate_pay", "name": "nl-piece-rate-pay", "disabled": false },
{ "label": "Wiki", "value": "wiki", "name": "wiki", "disabled": false },
{ "label": "HealthCare", "value": "healthcare", "name": "healthcare", "disabled": false },
{ "label": "PropertyMS", "value": "propms", "name": "propms", "disabled": false },
{ "label": "Education", "value": "education", "name": "education", "disabled": false },
{ "label": "LMS", "value": "lms", "name": "lms", "disabled": false },
{ "label": "Webshop", "value": "webshop", "name": "webshop", "disabled": false },
{ "label": "Helpdesk", "value": "helpdesk", "name": "helpdesk", "disabled": false },
{ "label": "CRM", "value": "crm", "name": "crm", "disabled": false },
{ "label": "payments", "value": "payments", "name": "payments", "disabled": false },
{ "label": "Paystack", "value": "frappe_paystack", "name": "frappe_paystack", "disabled": false },
{ "label": "Mpesa Payments", "value": "frappe_mpesa_payments", "name": "frappe-mpesa-payments", "disabled": false },
{ "label": "Mpesa B2C", "value": "navari_mpesa_b2c", "name": "navari-mpesa-b2c", "disabled": false },
{ "label": "Kenya Compliance", "value": "kenya_compliance", "name": "kenya-compliance", "disabled": false },
{ "label": "Csf Ke", "value": "csf_ke", "name": "csf_ke", "disabled": false },
{ "label": "Lending", "value": "lending", "name": "lending", "disabled": false },
{ "label": "Whatsapp", "value": "frappe_whatsapp", "name": "frappe_whatsapp", "disabled": false },
{ "label": "PibiDav", "value": "pibidav", "name": "pibidav", "disabled": false },
{ "label": "PibiCard", "value": "pibicard", "name": "pibicard", "disabled": false },
{ "label": "Pibicut", "value": "pibicut", "name": "pibicut", "disabled": false },
{ "label": "Print Designer", "value": "print_designer", "name": "print_designer", "disabled": false },
{ "label": "PDF on submit", "value": "pdf_on_submit", "name": "pdf_on_submit", "disabled": false },
{ "label": "Jobcard Planning", "value": "jobcard_planning", "name": "jobcard_planning", "disabled": false },
{ "label": "Whitelabel", "value": "whitelabel", "name": "whitelabel", "disabled": false },
]
,
erpSelectedModules: [],
loading: {
getConfiguration: false,
configureModule: false,
Expand Down Expand Up @@ -202,6 +252,7 @@ export default {
this.host = config.host;
this.isLetsEncryptEnabled = config.lets_encrypt;
this.isHttpToHttpsEnabled = config.http2https;
this.erpSelectedModules = config.erpSelectedModules;

this.loading.getConfiguration = false;
this.focusElement("host");
Expand Down Expand Up @@ -271,6 +322,7 @@ export default {
host: this.host,
lets_encrypt: this.isLetsEncryptEnabled,
http2https: this.isHttpToHttpsEnabled,
erpSelectedModules: this.erpSelectedModules,
},
extra: {
title: this.$t("settings.instance_configuration", {
Expand Down
Loading