Differences between revisions 1 and 16 (spanning 15 versions)
Revision 1 as of 2018-09-02 20:13:22
Size: 11192
Editor: ?Average-User-Prototype
Comment: draft: page for info and guides on software/web development with Debian
Revision 16 as of 2019-07-17 12:13:03
Size: 0
Editor: ?ThomasLange
Comment: Travis said, he will not work any more on this page.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:

This page helps with web development under Debian. It lists and recommends tools (for being FOSS and/or efficient and/or secure) which could be used, describes how to set them up and how to properly configure and use them.

It aims to help with software development under Debian in general, with development of cross-platform (Debian compatible) software and to provide up to date step-by-step guides for optimal convenience, efficiency and security even for beginners. It is a continuously improving guide which indexes, evaluates and aggregates tools and information scattered across the web.

##and with running Debian servers. [[WebServers]] [[Apache]]


== Sandboxing and software distribution ==
 * Sandbox applications with firejail:<<BR>>{{{git clone https://github.com/netblue30/firejail.git}}}<<BR>>
{{{cd firejail}}}<<BR>>
{{{export CC=/usr/local/bin/gcc-6}}}<<BR>>
{{{./configure && make && sudo make install-strip}}}<<BR>>

 * Learn about [[Flatpak]] and [[https://flathub.org/home|Flathub]].<<BR>>[[https://flatpak.org/setup/Debian/|Install Flatpak]]. There might also be a GUI frontend for Flatpak packages such as the Software Manager in Linux Mint which has a category dedicated to these packages.
 * There are also Snappy (snaps) and AppImage but those are not as good as Flatpak. For example AppImage does not sandbox and has larger application files; Snappy is run centrally by Canonical (parent company of Ubuntu).

== Documentation ==
 * Wiki such as MediaWiki: https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Debian_or_Ubuntu

== Issue management ==
 * [[GitLab]]: https://about.gitlab.com/installation/#debian

== Collaborative programming ==
 * Git such as GitLab:
 * See Tox under ''Tools''

== Desktop and mobile applications ==
 * You can use [[https://electronjs.org/|Electron]] to build cross platform desktop apps with JavaScript, HTML, and CSS

== IDE ==

=== Eclipse ===
 * Install<<BR>>https://www.eclipse.org/downloads/packages/release/photon/r/eclipse-ide-javascript-and-web-developers
<<BR>>{{{tar zxf eclipse-inst-linux64.tar.gz}}}<<BR>>
{{{sudo tar zxf eclipse-inst-linux64.tar.gz}}}<<BR>>
{{{cd eclipse-installer}}}<<BR>>
 * If the firejail profile {{{sudo kate /etc/firejail/eclipse.profile}}} looks like this:
{{{include /etc/firejail/globals.local}}}<<BR>>
{{{noblacklist ${HOME}/yourprogrammingfolders/*}}}<<BR>>
{{{noblacklist ${HOME}/.gitconfig}}}<<BR>>
{{{noblacklist ${HOME}/.java}}}<<BR>>
{{{caps.drop all}}}<<BR>>
{{{protocol unix,inet,inet6}}}<<BR>>
{{{shell none}}}<<BR>>
{{{# private-tmp}}}<<BR>>
{{{# noexec /tmp breaks 'Eclipse'}}}<<BR>>
{{{#noexec /tmp}}}<<BR>>
You can run eclipse like this: {{{firejail --profile=/etc/firejail/eclipse.profile /eclipse/locationofeclipse}}}
 * Create a launch icon
 * Check for updates
 * https://stackoverflow.com/questions/5531402/newbie-in-eclipse-i-dont-have-dynamic-web-project-i-am-under-linux-ubuntu http://www.gulland.com/wp/?p=31
 * [[https://stackoverflow.com/questions/7614612/is-there-an-eclipse-editor-for-sasss-scss-files-or-syntax-coloring-plugin/12322531#12322531|Enable syntax-coloring for scss files]]
 * [[https://stackoverflow.com/a/34965851/3424416|Make scss files compile automatically to css]]

=== NetBeans ===

=== PhpStorm ===
 * Install snapd: {{{sudo apt install snapd}}}
 * Edit snap.profile: {{{sudo kate /etc/firejail/snap.profile}}} so it looks like this:<<BR>>
{{{include /etc/firejail/disable-common.inc}}}<<BR>>
{{{include /etc/firejail/disable-passwdmgr.inc}}}<<BR>>
{{{include /etc/firejail/disable-programs.inc}}}<<BR>>
{{{whitelist ${HOME}/snap}}}<<BR>>
{{{whitelist ${HOME}/.PhpStorm2018.2/}}}<<BR>>
{{{include /etc/firejail/whitelist-common.inc}}}<<BR>>
 * Install PhpStorm: {{{sudo firejail --profile=/etc/firejail/snap.profile snap install phpstorm --classic}}}<<BR>>
 * Update it: {{{sudo firejail snap refresh}}}<<BR>>
 * Run it: {{{firejail --profile=/etc/firejail/phpStorm.profile /snap/bin/phpstorm}}}
 * Create a launch icon

== Browser ==
 * Firefox-ESR is in Debian's repositories. Firejail has a pre-configured profile for it. You could add {{{whitelist /home/USERNAME/node_modules/}}} to it.
 * Chromium is in Debian's repositories. It's firejail profile could look like this:<<BR>>
{{{include /etc/firejail/chromium.local}}}<<BR>>
{{{include /etc/firejail/globals.local}}}<<BR>>
{{{noblacklist ${HOME}/.cache/chromium}}}<<BR>>
{{{noblacklist ${HOME}/.config/chromium}}}<<BR>>
{{{noblacklist ${HOME}/.config/chromium-flags.conf}}}<<BR>>
{{{noblacklist ${HOME}/.pki}}}<<BR>>
{{{include /etc/firejail/disable-common.inc}}}<<BR>>
{{{include /etc/firejail/disable-devel.inc}}}<<BR>>
{{{include /etc/firejail/disable-programs.inc}}}<<BR>>
{{{mkdir ${HOME}/.cache/chromium}}}<<BR>>
{{{mkdir ${HOME}/.config/chromium}}}<<BR>>
{{{mkdir ${HOME}/.pki}}}<<BR>>
{{{whitelist ${DOWNLOADS}}}}<<BR>>
{{{whitelist /home/USERNAME/node_modules/}}}<<BR>>
{{{whitelist ${HOME}/.cache/chromium}}}<<BR>>
{{{whitelist ${HOME}/.config/chromium}}}<<BR>>
{{{whitelist ${HOME}/.config/chromium-flags.conf}}}<<BR>>
{{{whitelist ${HOME}/.pki}}}<<BR>>
{{{include /etc/firejail/whitelist-common.inc}}}<<BR>>
{{{include /etc/firejail/whitelist-var-common.inc}}}<<BR>>
{{{caps.keep sys_chroot,sys_admin}}}<<BR>>
{{{shell none}}}<<BR>>
{{{# private-bin chromium,chromium-browser,chromedriver}}}<<BR>>
{{{# private-tmp - problems with multiple browser sessions}}}<<BR>>
{{{noexec ${HOME}}}}<<BR>>
{{{noexec /tmp}}}<<BR>>

== NPM ==
##* Install the latest node after adding the repository:<<BR>>{{{curl -sL https://deb.nodesource.com/setup_10.x | bash -}}}<<BR>>{{{sudo apt-get install -y nodejs}}}
 * Install the node package manager (NPM) with NVM using [[https://github.com/creationix/nvm|the install script]]:<<BR>>
{{{curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash}}}<<BR>>
{{{export NVM_DIR="$HOME/.nvm"}}}<<BR>>
{{{[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm}}}<<BR>>
{{{command -v nvm}}}<<BR>>
{{{nvm install node}}}<<BR>>
{{{nvm use node}}}<<BR>>

##transclude code mini-snippets from GitHub?

== Web frameworks ==

=== Laravel ===
''(Needs to be tested)''

{{{sudo wget https://github.com/laravel/laravel/archive/v5.5.28.zip}}}<<BR>>
{{{sha256sum v5.5.28.zip}}}<<BR>>
{{{unzip v5.5.28.zip}}}<<BR>>
{{{cd laravel-5.5.28/}}}<<BR>>
{{{sudo mkdir /var/www/html/laravel-5.5.28/vendor}}}<<BR>>
{{{sudo mkdir /var/www/html/laravel-5.5.28/vendor/symfony}}}<<BR>>
{{{sudo mkdir /var/www/html/laravel-5.5.28/vendor/symfony/thanks}}}<<BR>>
{{{chown -R www-data.www-data /var/www/html/laravel}}}<<BR>>
{{{sudo chmod -R 755 /var/www/html/laravel-5.5.28/}}}<<BR>>
{{{sudo su www-data}}}<<BR>>
{{{composer config}}}<<BR>>
{{{sudo chown -R username.username /var/www/html/laravel-5.5.28/}}}<<BR>>
{{{composer install}}}<<BR>>
{{{sudo chown -R www-data.www-data /var/www/html/laravel-5.5.28/}}}<<BR>>
{{{sudo chmod -R 755 /var/www/html/laravel-5.5.28/}}}<<BR>>
{{{sudo cp .env.example .env}}}<<BR>>
{{{sudo chown -R www-data.www-data .env}}}<<BR>>
{{{sudo php artisan key:generate}}}<<BR>>
{{{sudo service apache2 restart}}}<<BR>>
{{{sudo php artisan make:auth}}}<<BR>>
{{{php artisan migrate}}}<<BR>>
{{{sudo kate .env}}}<<BR>>
{{{sudo php artisan make:migration create_links_table --create=links}}}<<BR>>
{{{sudo php artisan migrate}}}<<BR>>
{{{php artisan serve}}}<<BR>>
{{{sudo mysqladmin -u root -p status}}}<<BR>>
{{{sudo mysql -u root}}}<<BR>>
{{{sudo php artisan migrate}}}<<BR>>
{{{sudo kate /var/www/html/laravel-5.5.28/app/Providers/AppServiceProvider.php}}}<<BR>>
{{{sudo php artisan migrate}}}<<BR>>
{{{php artisan tinker}}}<<BR>>
{{{sudo php artisan migrate}}}<<BR>>
{{{php artisan migrate:fresh}}}<<BR>>
{{{sudo php artisan make:model --factory Link}}}<<BR>>
{{{sudo kate /var/www/html/laravel-5.5.28/database/factories/LinkFactory.php}}}<<BR>>
{{{sudo php artisan make:seeder LinksTableSeeder}}}<<BR>>
{{{sudo kate /var/www/html/laravel-5.5.28/database/seeds/LinksTableSeeder.php}}}<<BR>>
{{{sudo kate /var/www/html/laravel-5.5.28/database/seeds/DatabaseSeeder.php}}}<<BR>>
{{{sudo php artisan migrate:fresh --seed}}}<<BR>>
{{{php artisan tinker}}}<<BR>>
{{{sudo kate /var/www/html/laravel-5.5.28/routes/web.php}}}<<BR>>
{{{sudo kate /var/www/html/laravel-5.5.28/resources/views/welcome.blade.php}}}<<BR>>

=== VueJs ===
{{{cd project-directory}}}<<BR>>
{{{npm install vue-cli vue vue-resource}}}<<BR>>
{{{vue init webpack my-project}}}<<BR>>
{{{npm run start}}}<<BR>>
##npm run dev

== NTP ==
sudo apt-get install ntp<<BR>>
ntpq -p<<BR>>
add firewall rules<<BR>>
sudo dpkg-reconfigure tzdata<<BR>>

== IDS, log-scanning, vulnerability-protection and server-management ==

=== Webmin ===
{{{sudo kate /etc/apt/sources.list}}} and add: {{{deb https://download.webmin.com/download/repository sarge contrib}}}<<BR>>

{{{wget http://www.webmin.com/jcameron-key.asc}}}<<BR>>
{{{sudo apt-key add jcameron-key.asc}}}<<BR>>
{{{sudo apt-get install apt-transport-https}}}<<BR>>
{{{sudo apt-get update}}}<<BR>>
{{{sudo apt-get install webmin}}}<<BR>>
{{{sudo kate /etc/webmin/miniserv.conf}}}<<BR>>
{{{sudo service webmin restart}}}<<BR>>

== REST client ==
{{{echo "deb https://dl.bintray.com/getinsomnia/Insomnia /" | sudo tee -a /etc/apt/sources.list.d/insomnia.list}}}<<BR>>
{{{wget --quiet -O - https://insomnia.rest/keys/debian-public.key.asc | sudo apt-key add -}}}<<BR>>
{{{sudo apt-get update}}}<<BR>>
{{{sudo apt-get install insomnia}}}<<BR>>
{{{sudo kate /etc/firejail/insomnia.profile}}}<<BR>>
should look like this:<<BR>>
{{{include /etc/firejail/globals.local}}}<<BR>>
{{{include /etc/firejail/disable-common.inc}}}<<BR>>
{{{include /etc/firejail/disable-passwdmgr.inc}}}<<BR>>
{{{include /etc/firejail/disable-programs.inc}}}<<BR>>
{{{caps.drop all}}}<<BR>>
{{{shell none}}}<<BR>>
Then you can run: {{{firejail insomnia}}}<<BR>>
and add an application icon.

== Tools ==

=== Tox ===
You can use it for screen sharing, instant messaging, voice calls, video calls, file sharing and groups.

=== GIMP ===
Image manipulation software that's a FOSS alternative to Photoshop.

=== Inkscape ===
For vector graphics, FOSS alternative to CorelDraw and Adobe Illustrator.

=== VirtualBox ===
{{{deb http://download.virtualbox.org/virtualbox/debian stretch contrib}}}

== See also ==
 * [[Network]]
 * [[SetupGuides/SecurePersonalComputer]]
 * [[LaMp]]
 * [[WordPress]]
 * [[LetsEncrypt]]
 * [[SSH]]

== External links ==
 * https://startbootstrap.com/
 * https://jsfiddle.net/
 * https://developers.google.com/web/progressive-web-apps/checklist