I've got a DS718+ serving my development environment, PHP/MySQL on the bundled Nginx. Everything seems to work after lots of messing around except I'm used to a SCSS compiler that detects changes and automatically recompiles. I can't seem to find anything on Synology that does this.
I could do:
A Docker. This requires too much work to maintain and overhead to run.
phpSCSS. I'd have to change my source to serve SCSS and compile on the fly, which breaks my existing dev (and prod) environments.
Local compilation of SCSS. Then my Synology no longer represents a self-contained development environment.
Does anyone have a working solution or a recommendation?
I guess you would like a full-version linux platform like debian on synology. So that you can do whatever you want like you do before on your linux boxes.
I recommend you use debian-chroot on synology.
I have compiled a suite of debian-chroot for DSM6.x on almost synology platforms, you can install it on your DS718+ follows https://github.com/OKit-Scripts-Projects/DSM.Customizations/blob/master/App.Debian-Chroot.md
Once you have a debian-8 on your DS718+, you can do anything like before, such as a self-contained development environment.
If there is any problem, feel free to ask me here or open an issue on my github repo.
Use Synology Client,and create a local folder naming the folder as it appears on the nas on your pc where you will hold the project files. If you create a two way sync the two folder will mirror each other, and any changes will automatically update.
Related
Im developing my first go project and i need to develop it on a remote linux server. Its something small and this is why i need something really simple, but 3rd day now im trying to setup my goland with no success. Starting to wonder if i need it at all here.
I already setup my SSH terminal and my SFTP. The problem is that im not sure how to write my code locally, build it locally and upload to the server or build it on the server. This is what i tried:
Tried to develop with remote file manager and remote terminal, just using goland as editor. The problem here is that if goland meets some missing package, it will give me errors, maybe here i can somehow ignore this?
Tried to write it locally, sync with remote on every save and compile it from the terminal, but this will create an issie with missing packages, but in general it works.
Tried to write it locally, compile it remotely from the Run options. The problem here is that i want to write my install.go file locally and upload it to /root/project/install as compiled file, but its creating some temporary files, tried even to overwrite my -o file from the "Go tool arguments", but it just adds the path to the existent one.
Tried to write it locally and compile it locally and then upload it to the server, but cant find the way for such thing at all.
Maybe dlv, but it looks like a simple issue, hope i wont have to install additional software on the server because of this.
Is some of those options valid or im missing another options? I hope you understood what i really want.
Thank you in advance!
but 3rd day now im trying to setup my goland with no success. Starting to wonder if i need it at all here
You don't need it.
Tried to write it locally and compile it locally and then upload it to the server, but cant find the way for such thing at all.
This is what you want. The only thing you need to install on your server is the executable from go build, built for the server's architecture, which you can copy over SFTP.
When you want to run your program locally, you will use go build to produce an executable that you can run.
When you build for the remote server, you will want to set GOOS and GOARCH to the values appropriate for your server:
GOOS=linux GOARCH=amd64 go build -o my-project.linux-amd64
If your server is ARM, substitute arm64 for amd64.
Then copy my-project.linux-amd64 to the server and it will be able to successfully run there.
Im developing my first go project
Then make sure to understand this point: go executables don't need go libraries at runtime.
This is a big selling point for Go, and is different from an interpreted language like Python, Javascript, Ruby, and also different from languages that run in a software virtual machine like JVM (Java) or BEAM (Erlang) baed VMs.
As a newcomer to go, please make sure to read the tutorial.
Save yourself a lot of hassle and Write tests right away as you develop your first project. These should be your primary way of demonstrating functionality as you work on your project.
A little backstory:
I am creating my first Go web app for school. The professor said that I could use Go. I asked him if I could use the latest version, 1.13, rather than the version installed on the server, 1.10, to leverage the module management feature and the updated errors module. He did not say that I was restricted to 1.10 and even gave me the contact information of the server admin. I reached out to the server admin with my professor CC'd and he said he doesn't want to update the server's version of Go in the middle of the semester. He then included instructions on how to download, install, and use whatever version of Go that I need in my home directory.
Pick your version:
https://golang.org/dl/
Set it up for your own use:
https://golang.org/doc/install
I installed go 1.13 and updated my own envvars to reflect this version and everything works.
Well, the other requirement is that I have to hand my professor my project and that it has to compile on the server. I am thinking that if I hand him a bundle and give him directions on how to build it, then I've technically met the requirements of the project so far.
My question is, does Go have anything that takes my Go v1.13 environment and packages everything up so that the project can compile on the target server? I have only been able to find solutions along the lines of "just copy the project binary to your production server" but that doesn't help me. I need it to compile on the production server. Besides, I tried copying my binary to the production server and it couldn't find my html templates (stored in ./ui/html/ directory) but I guess that will be solved in this discussion or saved for another SO question later.
student#universityserver:~$ ./web
INFO 2019/09/22 10:21:52 Starting server on :5089
INFO 2019/09/22 10:23:03 <ipaddress>:63527 - HTTP/1.1 GET /
ERROR 2019/09/22 10:23:03 handlers.go:29: open ./ui/html/home.page.tmpl: no such file or directory
The only thing I can think of right now is to basically add everything they need (the go amd64 binary distribution and all modules) and write a script that handles it all (extract go in local folder, export envvars, build, etc.)
Dear, Professor.
Copy this tarball to your home directory, extract, run build_my_goapp.sh script.
Sincerely,
Your student
The answer in my case was that I can supply a Makefile that does anything I need it to do.
(It's actually good practice, if not an expectation, of a project that is turned in.)
The requirements were that my project needs to compile on the server and that I had to supply a Makefile. Therefore, any downloading, installing, and setting up of a Go environment for my project can be done, as long as everything happens in the user's environment and is not something that needs sudo to install correctly. The server does not have Docker.
Good evening,
This question is has to do with the PHP composer packet management. I have installed in on our test environment (xampp) without any issues and have downloaded the necessary package without any problems (package name: mpdf). After I issue the command to get the package, the vendor package showed up as it should have and my project worked great.
Fast forward, we are not ready to deploy this whole application to a linux(ubuntu 16.04) box using a versioning system (svn) and all the files that were on the test system have been deployed to production. The only problem is that the specific parts of our site on production that needs the mpdf package does not work.
My question is this, even though the vendor folder was also copies to production using SVN, is there anything else for us to do to make this work on the production box?
I am mainly speaking about any necessary steps that might need to performed on the ubuntu box?
Thank for all the help in advance,
George Eivaz
I figured out what the issue was. It had to do with the permissions not being correct on Ubuntu.
This may be a stupid question but after a fair bit of googling i and still unsure weather i should be removing the the composer.phar file after installation. Is the files just part of the installation or required to run the application ?
The Composer executable is used to manage your dependencies, which is mostly "update" and "install". The result is an autogenerated autoloader and a complete tree of files from the required packages of the application.
The executable itself is not part of the application and therefore is not needed to run it. For security reasons it should not be present on the live servers unless you really know it has to be there, because it seems like a good idea to not give an attacker some useful tools into their hands.
The proper places to have the executable are your development environment (in order to add new packages and update the old ones) and the deployment server that puts the application onto the live server (otherwise you cannot install the packages that your application runs with).
I know that people tend to create a workflow that simply pushes a branch to production, and a post-transmit hook then runs composer install, but this is dangerous from a reliability standpoint: What if Github has an unexpected downtime and you push to production, unable to download the new packages? In this scenario, the server doing the deployment actually is the production server and so requires a copy of the Composer executable, but I explained that this is no ideal setup.
I would like to have a desktop PC and a laptop available for development. I am using XAMPP on the desktop which I use as my main workstation, however I'd like to just change location and be able to continue working on the laptop. It seems that it is possible to move the /htdocs folder to Dropbox so the XAMPP instances on both devices would use the same shared folder. That would be a part-solution, what about the question of databases, how would I go about that? I'm sure there are others who work in a similar fashion, so I'd like some pointers on how to set this up properly. Thanks
Your best bet is to set up version control. Given that you seem to assume you will basically always be networked, you might like to use github or bitbucket to create your "central" repository, and use your favourite DVCS to push changes between the repositories.
Conceptually the simplest, although perhaps not the best, depending on how you like to develop is to push all changes through the "master", and have both of your computers pull from there. Using mercurial or git, you can also push directly between the repositories on both of your computers.
I use bitbucket because it offers free, private repositories (github is free, but the free version only allows public repositories).
This also gives you the advantage of an offsite backup.
Try using a SVN or CVS solution...
You can use a development environment which is virtulized and have a high availability.
There are some virtualization services like (amazon, Microsoft) which you can utilize (They are paid services) .
If viruilization is not possible, you might want to maintain the scripts for the database in a version control tool . So when you switch commit the database changes in the version control tool , rerun the database scrips on the laptop to upgrade the database with latest information.
Also same thing applies for HTTP files.
If the database creation script is out of question you might want to create a database snapshot with raw datafile , which should be checked in into version control tool before switch and checkout on the other machine . Refer following link on which files you want to check-in into version control tool.
http://dev.mysql.com/doc/refman/5.0/en/replication-howto-rawdata.html
You could include a virtual machine in your Dropbox folder. This way you can encapsulate your development environment in a single file and take it with you wherever you want.
I have done that with an Ubuntu VM and never had a problem.