phillopp
(Philip)
July 9, 2024, 8:49pm
1
Hello everybody,
I’m trying myself in making a Nethserver 8 App. I decided to test it with Gitlab CE.
Currently I’m able to install the app and configure the normal host URL so I can access the webinterface.
Next I wanted to generate a config file for e.g. LDAP. I wrote some code for this in a separat action step file in my configure-module folder. But I think it’s not executed, because there is no file and for testing purpose I set some env-variables that are also not set.
Can somebody please help me? Is there a special parameter that I need to set that my new step is executed? Am I doing something wrong?
My source-code is here on Github
2 Likes
LayLow
(LayLow)
July 9, 2024, 9:25pm
2
Hi and welcom!
Please explain what you are trying to achieve (Authenticate again local LDAP account provider?)
I am not able to assist you, but I know that @stephdl may have some pointers for you.
Again, welcome!
HTH
mrmarkuz
(Markus Neuberger)
July 9, 2024, 9:45pm
3
imageroot/actions/configure-module/30ldap
isn’t executable.
Just add the right permission:
chmod +x imageroot/actions/configure-module/30ldap
3 Likes
Hello @phillopp wonderful to have you in the community.
IN the future, take note of these Kickstart to get you up to speed faster.
FOr MariaDB Based Apps: GitHub - stephdl/ns8-kickstart-mariadb: NethServer 8 module template
For PostgreSQL Based Apps: GitHub - stephdl/ns8-kickstart-postgresql
Thank you for your Contribution.
LayLow
(LayLow)
July 10, 2024, 1:18pm
5
Just curious, how can one tell from looking at the Github code pls?
hehehe, you can. IF you clone it to your Software dev tool, you could, as well as when running the app in NS8.
I faced alot o those issues when i was first starting to build Modules.
An easy solution i found, Instead of Creating new files and Folders, I just copy existing ones, and rename files and content. it will carry over all the permissions necessary.
I have since moved to developing NS8 Apps on LInux, though, USed to be on Windows… what a Pain
phillopp
(Philip)
July 10, 2024, 3:43pm
7
Thank you! That was the solution
On macOS I needed to execute git update-index --chmod=+x imageroot/actions/configure-module/30ldap
that git recognized the change
2 Likes
mrmarkuz
(Markus Neuberger)
July 11, 2024, 8:08am
8
Github shows if a file is executable:
You’re welcome. Thank you for providing another NS8 app.
3 Likes
Hello @phillopp just tested your App. with the release Alpha Release 0.0.30
the isntallation went well.
configuruation worked fine, with Ldap, though an error, i couldnt catch was thrown…
I was able to login with Ldap Uer, worked well.couldnt do anything else, as the user must be verified.
I think you need to also deifne Email parameters for Gitlab.
Gitlab side
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "${GITLAB_SMTP_ADDRESS}"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "${GITLAB_SMTP_USER_NAME}"
gitlab_rails['smtp_password'] = "${GITLAB_SMTP_PASSWORD}"
gitlab_rails['smtp_domain'] = "${GITLAB_SMTP_ADDRESS}"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['gitlab_email_from'] = "${GITLAB_EMAIL_FROM}"
gitlab_rails['gitlab_email_reply_to'] = "${GITLAB_EMAIL_REPLY_TO}"
NS8 side example>
# Configure email configurations
rdb = agent.redis_connect(use_replica=True)
smtp_settings = agent.get_smarthost_settings(rdb)
# environment:
# # Mail
# - MAIL_HOST=${MAIL_HOST}
# - MAIL_USERNAME=${MAIL_USERNAME}
# - MAIL_PASSWORD=${MAIL_PASSWORD}
# - MAIL_PORT=${MAIL_PORT}
# - MAIL_SECURE=${MAIL_SECURE}
# - MAIL_FROM_NAME=${MAIL_FROM_NAME}
# - MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS}
email_config = {
"MAIL_HOST": smtp_settings['host'],
"MAIL_USERNAME": smtp_settings['username'],
"MAIL_PASSWORD": smtp_settings['password'],
"MAIL_PORT": smtp_settings['port'],
"MAIL_SECURE": smtp_settings['encrypt_smtp'],
"MAIL_FROM_NAME": data.get("MAIL_FROM_NAME", f"BigcapitalHQ {smtp_settings['username']}"),
"MAIL_FROM_ADDRESS": data.get("MAIL_FROM_ADDRESS", f"{smtp_settings['username']}"),
}
agent.write_envfile('email.env', email_config)
stephdl
(Stéphane de Labrusse)
September 12, 2024, 4:37pm
10
hello @phillopp I am a big fan
2 Likes