Script for basic automatic configuration (single domain)

Hi,

I did a few scripts to automate the installation AND the configuration of Yunohost.
These were initially used to simplify my tests servers, but I decided to “improve” and share them.

Please be kind, these are my first scripts (more or less) and I had to discover quite a few things…

Each scripts should be independant.
If you don’t have yunohost installed on your Debian 7, simply start with 1 and then 2.
If you have just finished to install yunohost on your Debian, start by script 2.

Anyway, the pre-required are :

    - If you have your own ssl certificate and crt PEM files, simply place them in the folder conf_ssl - If you decided to go for the opendkim script, then you will need to modify your DNS accordingly.

The configuration let you add an extra user ssh (to be different from admin, which is too easy to guess). Please note that this user must be different from you web Yunohost users.

It also install a nice bash (well, nice for me ! :slight_smile: )

    1. Installation of Yunohost with a few extra goodies such as
    - Grab the latest git rep of yunohost - Automatically launch install_yunohost_v2 - Use of OVH mirror servers - change timezone
    2. master
    - One script to run them all in one go ! yeah
    3. base system
    - Add a user named to your choice to connect via ssh which is not admin - Don't forget that this user name will not be able to be used by yunohost in the web interface - Add of bash-completion - Add a specific bashrc for root and the user created to have great colours - Update sshd_config to have a specific port (to your liking) - Only allow the user to connect from ssh - Adjust your timezone
    4. installation of your ssl certificates
    - You HAVE TO copy the ssl key and crt into the folder conf_ssl so that they would be automatically installed in /etc/yunohost/certs - Give the right permissions - Please note that the files MUST be in PEM format - Please note that the files MUST be name key.pem and crt.pem and placed in the folder conf_ssl
    5 opendkim
    - Install opendkim - Configure opendkim with your domain name - Indicate the DKIM key to put in your DNS - Indicate the SPF key to put in your DNS
    6. Apticron.sh
    - Install apticron - Configure sender and receiver email - Adjust cron job to receive messages only once a day (instead of once every hour by default !)
    7. Jail2Ban
    - We simply activate emails to be sent once an IP has been blocked

In essence, once all of this is done, I manage everything from the web interface !

Don’t forget to reboot after all these scripts.

I am more than open to comments. There must be lots of things wrong and which could be much better. Just let me know and share your experience !

    Github rep : https://github.com/polytan02/yunohost_auto_config_basic Zip file : https://github.com/polytan02/yunohost_auto_config_basic/archive/yunohost_autoconf_single_domain-5.2.zip

To copy these files on your server, simply do :
apt-get update
apt-get install git
git clone https://github.com/polytan02/yunohost_auto_config_basic
cd yunohost_auto_config_basic/
and run script 1 or 2, depending on what you want to do…

Add of apitcron script.

I completely changed my scripts so that it would “suits” most people looking at a simple single domain installation.
We can now skip the bits you don’t want to do :wink:

J’ai completement revu tous mes scripts pour qu’ils soient plus simples et plus conviviaux. Je suppose que ça servira à plus de personnes (potentiellement) qui souhaitent monter un yunohost mono domaine simple.
On peut maintenant passer les configurations qu’on ne veut pas.

Dites moi ce que vous en pensez !

Version 4.1 released.

https://github.com/polytan02/yunohost_auto_config_basic/archive/yunohost_autoconf_single_domain-4.1.zip

Version 5.2 released.

https://github.com/polytan02/yunohost_auto_config_basic/archive/yunohost_autoconf_single_domain-5.2.zip

Version 7.0 released.

https://github.com/polytan02/yunohost_auto_config_basic/archive/yunohost_auto_config_basic-7.0.zip

Key new features include :

  • ssl and opendkim scripts can be rerunned to manage multiple domains created by yunohost
  • ssl script let you activate dhparam for nginx (multi domain also)
  • Possibility to change the hostname
  • Possibility to activate dhparam in nginx

For the multi domain capability, all you have to do is re-run scripts ssl or opendkim.

Hi,
I try to execut that script : [https://yunohost.org/#/dkim_fr][1]
but i have the error when i enter the second line :
[FAILED] TrustedHosts not found in folder conf_opendkim

an idea ?
[1]: https://yunohost.org/#/dkim_fr

Hi Niko,

I understand why you have this error.

Please can you do :

git clone https://github.com/polytan02/yunohost_auto_config_basic (if not done previously)
cd yunohost_auto_config_basic (to enter the folder)
./5_opendkim.sh(to launch the script)

This should run normally.

Please let me know if this work. I will update the documentation accordingly.

Hello,
Thanks for the answer. Finally i have re-install yunohost because i had install 2 domain and i find on the forum that it is not recommanded.
I have follow the first post on my new install and it works fine.
Thanks

Release of version 8.0 !

  • If SSH port is changed, new validation by YunoHost system before using it
  • Cleaning of the code to remove all verbose aspect (now that it seems stable enough)
  • New cleaning script launched once everything else is done ! :smile:

https://github.com/polytan02/yunohost_auto_config_basic/archive/yunohost_auto_config_basic-8.0.zip

Next step : french version !

Hi @maxime

@tuxmouraille suggested to change the path of openvpn ca.pem, crt.pem, key.pem, dh.pem to the original ssl backed up ssl OpenVPN Problème de connexion . Did your script backed up the original ssl ?

Hi there,

Yes, my script makes a backup, but it was in a different folder. I modified my script to use the same as the yunohost doc : Folder for the backup

Also, I make a local backup. this folder is located where you have your scripts in a subfolder called backup_ssl. I modified the script so that it makes a different folder each time, just so that you can “back track” the use : Local backup

Release 11.0 is now available !


https://github.com/polytan02/yunohost_auto_config_basic/archive/yunohost_auto_config_basic-11.0.zip

  • Script 3 : Ability to install and configure screen with great colours
  • Script 3 : Ability to install and configure tmux with great colours

@maxime

Thank you for the update.

how do you change hostname?

@MothGirlMusic : Thank you for your interest and your question.

However, could you open a new topic ? This topic is 4 years old and it’s not a good idea to “reopen it”. Try to explain your problem from scratch (you will get more help) – add a link to this topic if you want, but this problem is quite old and has surely been fixed, so your problem may surely be different.

I lock this topic.

1 Like