User login
synology
Synology Mailstation with Multiple domains on a DS207+
Synology Mailstation with Multiple domains on a DS207+
Geheugensteuntjes en een aantal niet gedocumenteerde mogelijkheden..
Iedere gebruiker kan verschillende email-adressen toegewezen krijgen.
Vanuit CLI..
vi /usr/syno/mailstation/etc/aliases
Voeg aliases toe op de volgende manier..
info: pietmajoor
webmaster: pietmajoor
etc..
Dus mail gericht aan de volgende adressen komt altijd bij Piet Majoor in het inboxje.
pietmajoor@mijndomein.nl
info@mijndomein.nl
webmaster@mijndomein.nl
Om de aliases door te voeren..
/usr/syno/mailstation/bin/newaliases
/usr/syno/mailstation/sbin/postfix reload
*****************
Voor meerdere domains (eentje is ingegeven in GUI)..
Vanuit CLI..
vi /usr/syno/mailstation/etc/main.cf
Zoek regel..
mydestination = $myhostname (Dit is dus het domein zoals ingegeven in GUI)
Voor meerdere domeinen voeg je ze toe op de volgende manier..
($myhostname laten staan, dit is de variabele die wordt ingevuld door de GUI ingegeven domein)
mydestination = $myhostname mijndomein1.nl mijndomein2.nl
Note: Elke gebruiker ontvangt mail voor alle domein namen,
dus pietmajoor@mijndomein1.nl, pietmajoor@mijndomein2.nl, etc.
/usr/syno/mailstation/sbin/postfix reload
***********************
Maak gebruik van een relayhost aangezien sommige mailservers mijn
mail niet accepteren.. (o.a. gmail)
Dus nu gaat outgoing mail via de relayhost van isp.
vi /usr/syno/mailstation/etc/main.cf
relayhost = smtp.xs4all.nl
Waarschijnlijk hierom dat port 25 niet open hoeft te staan?
/usr/syno/mailstation/sbin/postfix reload
***************
Router.. ports opengooien.
SMTP TCP 25
POP3 TCP 110
IMAP TCP 143
IMAPS TCP 993
POP3S TCP 995
*********************
XS4all (servicecenter) op nivo 2 zetten (weer teruggezet op nivo 3), bij nivo wordt
port 25 (in/out) niet geblokt. Maar is dus niet meer nodig voor mij.
*********************
Voor checken van geblokte ports etc..
http://canyouseeme.org/
subversion on a ds207+
| Note from Synology:
Using mods will waive the owners right to online technical support, any form of damage resulting from modifying the server will be at the owners responsibility and risk. Improper manipulation or modification of the Synology server can lead to disabling or bricking the Synology Product. |
My goal is to get some sort of 'Personal Documents Revision System' going, also I want some of these scripts to be publicly viewable. Who knows it will help others have even more fun with there Synology ds207+. Worked for me.. Writing this guide also has proven to be a great method to *try* to understand how things work, writing it down helps. Large portions of this guide are taken from other sources.
Tested with the following setup... (Client) 2.6.28-ARCH (Server) Synology Model: DS207+ // Serial number: 85E1N02634 // Firmware version: DSM 2.0-0803 Subversion (Server): 1.5.5 (r34862) Subversion (Client tools): 1.5.6 (r36142) RapidSVN: 0.9.6 WebSVN: 2.1.0
Contents
Preparations
Enable ssl on the ds..
- Log into the Synology Disk Station Manager (MUI) using the Administration account.
- Open the Terminal Services Menu, from the Network Services Folder
- Enable the Telnet or SSH Service to access the CLI (I'll be using ssh)
Pick your terminal client to access the CLI..
Window users may find Putty there best choice, there is even a Linux version available.
From Linux you can open a terminal window and simply.. ssh <IP of your Diskstation> -l root Enter your Administration account's password to login.
Create a user for svnserve daemon
For security reasons it is a good idea to create a separate user just for the Subversion daemon. Use the MUI under Privileges -> User to create a new user. In this guide I will be using svnowner. Give this user a complicated password, which we actually do not need to remember, as we will just spawn svnserve daemon with this user account from inetd, so just set it to some value (for security reasons to something other than the empty value).
Create a new share for your repositories
Use the MUI (Privileges -> Shared Folder) to create a new shared folder. I'll be using svn. Give admin and svnowner read-write permissions and remove all rights from the rest of the users.
Install the ipkg bootstrap
We need to install the bootstrap to be able to *easily* install the Subversion-Server Package. The bootstrap-script will install ipkg (the Itsy Package Management System), this is a pretty cool package management system that resembles dpkg (Debian Package Management System). It is made to provide for a full fledged package manager on low resource devices, like my little ds207+
Important: For the installation of ipkg (via a bootstrap) you need to know the model of your CPU as detailed right here.
In my case I need to get the bootstrap script for a Marvell mv5281 ARM Processor.
Download the script to the current location.. wget http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/syno-x07-bootstrap_1.2-5_arm.xsh
Now run the script and have it download a hole bunch of packages needed to get ipkg functional.. sh syno-x07-bootstrap_1.2-5_arm.xsh
When it's done you can delete the bootstrap-script, you won't need it anymore.. rm syno-x07-bootstrap_1.2-5_arm.xsh
Update the ipkg list of installed packages.. ipkg update
Update the installed ipkg packages (if any) to the latest versions.. ipkg upgrade
We can now install ipkg packages using the command ipkg install <packagename>
To get a list of all available packages.. ipkg list
Filter your search.. ipkg list | grep <searchstring>
Choose your preferred editor
We will need to edit system-files from the Linux command-line interface (CLI). The editor installed by default is vi (basic vi commands). If you're not familiar with vi you may find yourself in trouble since'll you need to spend some time and effort to be able to work with it. You don't want to crap your system because you can't handle the editor! Instead you can use mcedit, this editor is used as a point-and-click editor. This feels a lot like using Notepad on MS-Windows, can't go wrong here.
For this you need to install mc ipkg install mc So from now on where I speak of "vi" you may replace it with "mcedit".
Installing Subversion
Install the subversion server using ipkg, it will install all dependency packages.. ipkg install svn
Configure inetd daemon to spawn Subversion
There are several methodes to have svnserve run as a daemon, on a full fledged server machine I'd use the more traditional method of running svnserve as a standalone daemon. But since I'm using a device with limited RAM the inetd method is the prefered choice. This method uses RAM only when required. Disadvantage over standalone daemon mode is that it takes a bit more time during client connect, as each time the svnserve first needs to be loaded into RAM.
For adding Subversion to inetd, we need to edit the inetd configuration file /etc/inetd.conf.
Add the following line to the file.. svn stream tcp nowait svnowner /opt/bin/svnserve svnserve -i -r /volume1/svn
Match the username svnowner and the repository directory /volume1/svn to your customizations.
Edit /etc/services to include Subversion data
svn 3690/tcp # Subversion svn 3690/udp # Subversion
Setup your firewall to accept connections through port 3690 (is this needed?)
Now reboot your ds.. reboot
Subversion should be running now!
Using Subversion
Create the repository
Log into your Diskstation with SSH and root account. Change your personality to user svnowner with.. su svnowner
|
Note: If you experience an error like: su:cannot run /sbin/nologin:No such file or directory you have to change the login shell for that user like so.. vi /etc/passwd You'll see a line like this: svnowner:x:1028:100:this is svnowner:/var/services/homes/svnowner:/sbin/nologin Change that line to: svnowner:x:1028:100:this is svnowner:/var/services/homes/svnowner:/bin/ash |
Create under /volume1/svn a new repository.. (I chose scripts as it's name) cd /volume1/svn svnadmin create scripts
Set repository permissions
Under /volume1/svn/scripts/conf you will find repository configuration files, interesting for us at the moment are only passwd and svnserve.conf. For testing edit the passwd file to have following contents.. [users] svnuser = svnpw
Notice that the password will be written in clear-text in this file, so for security reasons you might want NOT to use the same credentials as you use in your system as a login account (although if you make sure with chmod 600 passwd that only the user svnowner can access the file, the risk of someone being able to sneak a peak without administrative account or knowing the svnowner password is minimal).
Edit also the svnserve.conf to have following contents: [general] anon-access = read auth-access = write password-db = passwd realm = My Own Little Scripts Repository This will enable anonymous read access.
If you want to disable anonymous access completely, use following line instead.. anon-access=none
Checkout the repository (using in-place 'import')
Make sure you have the subversion client tools installed.
Since I want to have some of my personal configuration files to be under revision control, I will be doing an in-place 'import' (i.e. add a tree to Subversion such that the original data becomes a working copy directly) of the tree that holds these files, most of them are situated beneath /home/<username>.
Change active directory to the path where you want your working copy to be.. cd /home/<username>
Checkout the empty repository we made earlier into /home/<username>, transforming /home/<username> into a working copy.. svn co svn://<IP of your Diskstation>/scripts .
When asked password for svnowner press just Enter. Input username: svnuser and password: svnpw as defined in file passwd.
Now we need to add directories/files we want to be under revision control. For this I'm going to use RapidSVN. But any client will do.
RapidSVN
There is a big list of clients available for subversion , many offering a comfortable gui. One of those clients is RapidSVN, it is cross platform and does it's job fine, I'm going to use this one.
First enter the program preferences to setup your prefered tools that need to be available for RapidSVN to do it's job.
My choices.. Standard Editor: geany Standard Explorer: worker Diff/Merge: meld
From the mainmenu choose "Bookmarks" en select "Add Existing Working Copy..", now select /home/<username> Now you need to selectively add directories/files to be under revision control, clicking the new bookmark on your treeview shows you all available directories/files. Now you can simply right-click (or INS) to add the selected item. "Add recursive" will add all directories/files beneath the selected directory, this may not be what you want, so a simple "add" will add the selected directory and show this directory to the bookmark item in your treeview (after a refresh), now other individual items may be added beneath this directory. After this you have to commit the hole thing and voila.. your done!
WebSVN
Obviously the webserver needs to be available on your ds. Get the latest websvn from it's download location Unpack en upload to your webserver (/volume1/web) "install.html" in your <PATH_TO_WEBSVN>/doc directory will explain the install-steps but I'll explain how I did it anyway.
WebSVN needs diff available on your server, so first install diff.. ipkg install diffutils
If it isn't already, make sure to chmod the cache directory to 0777. This is used to cache RSS files.
Websvn needs to be configured by editing config.php, we need to base this file on distconfig.php.. cp <PATH_TO_WEBSVN>/include/distconfig.php <PATH_TO_WEBSVN>/include/config.php
Open the file with your editor.. vi <PATH_TO_WEBSVN>/include/config.php Add the following line to Section: "Remote repositories".. $config->addRepository('scripts', 'svn://<IP of your Diskstation>/scripts', NULL, 'svnuser', 'svnpw'); Now use your browser to open the newly created repository.. http://<IP of your Diskstation>/<PATH_TO_WEBSVN>
|
Note: I got the following error at the top of my screen.. (including a bunch of php errors) Error running this command: svn --config-dir /tmp --version sh: svn: not found And some PHP related errors.. As ROOT.. vi /usr/syno/etc/php.ini comment the line: safe_mode = Off empty the line: safe_mode_exec_dir = add ":/opt/bin:" to the line: open_basedir Restart Apache.. /usr/syno/apache/bin/httpd -k restart For some reason "restart" doesn't seem to always work, instead I have to explicitly stop/start the http-daemon. /usr/syno/apache/bin/httpd -k stop /usr/syno/apache/bin/httpd -k start |
Now I can view my repository right here.
Sources
Much credit goes to Synology for making such a great device. And credit goes to a lot of individuals having invested there time and effort in experimenting and sharing there knowledge with the community. http://www.synology.com/wiki/index.php/Overview_on_modifying_the_Synolog... http://www.synology.com/wiki/index.php/Step-by-step_guide_to_installing_... http://www.synology.com/enu/forum/viewforum.php?f=44 http://rob.runtothehills.org/archives/25 http://www.nslu2-linux.org/wiki/Main/HomePage http://svnbook.red-bean.com http://news.e-scribe.com/350 http://subversion.tigris.org/faq.html#in-place-import
To do
- GeSHi (1.0.8.1) doesn't seem to work with WebSVN, have to investigate this.
- Getting a full fledged /home backup in place.
- Find a way to have public as well as hidden documents in subversion. Create a separate repo for hidden stuff? (/etc ?)
- ssl
