1679313480
Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.
Check out home-assistant.io for a demo, installation instructions, tutorials and documentation.
The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the section on architecture and the section on creating your own components.
If you run into issues while using Home Assistant or during development of a component, check the Home Assistant help section of our website for further help and information.
Author: Home-assistant
Source Code: https://github.com/home-assistant/core
License: Apache-2.0 license
1678796520
Люди используют Raspberry Pi для самых разных целей. Что привлекло ваше внимание?
Недавно я был на телефонном разговоре, где было сказано, что сообщество открытого исходного кода — это сочетание любопытства и культуры решений. А любопытство лежит в основе нашего решения проблем. Мы используем много открытого исходного кода при решении задач любого масштаба, включая Linux , работающий на невероятно удобном Raspberry Pi.
У всех нас такой разный жизненный опыт, поэтому я спросил наше сообщество писателей о самом любопытном использовании Raspberry Pi, с которым они когда-либо сталкивались. У меня есть предчувствие, что некоторые из этих фантастических сборок вдохновят других.
Для меня Raspberry Pi стал отличным инструментом для добавления дополнительных ресурсов для разработки в мою домашнюю сеть. Если я хочу создать новый веб-сайт или поэкспериментировать с новым программным инструментом, мне не нужно загружать свой настольный Linux-компьютер кучей пакетов, которые я могу использовать только один раз во время эксперимента. Вместо этого я установил его на свой Raspberry Pi.
Если я думаю, что собираюсь сделать что-то рискованное, я использую резервную загрузочную среду. У меня есть две карты microSD, что позволяет мне подключить одну к Raspberry Pi, пока я настраиваю вторую microSD для любых экспериментов, которые хочу. Дополнительная карта памяти microSD стоит не так дорого, но она экономит массу времени, когда я хочу поэкспериментировать со вторым изображением. Просто выключите, поменяйте местами карты microSD, перезагрузитесь, и я сразу же работаю над специальной тестовой системой.
Когда я не экспериментирую, мой Raspberry Pi действует как сервер печати, чтобы поместить мой принтер без WiFi в нашу домашнюю сеть. Это также удобный файловый сервер через SSH, так что я могу быстро делать резервные копии своих важных файлов.
Самое удивительное, что я видел в Raspberry Pi, это то, что он нормализовал и превратил в товар идею маленьких компьютеров и сделал их по-настоящему и практически доступными для людей.
До Raspberry Pi у нас были похожие малоплатные компьютеры, но они, как правило, были нишевыми, дорогими и почти недоступными с точки зрения программного обеспечения. Raspberry Pi был дешевым и дешевым до такой степени, что любой мог получить его для проекта (игнорируя текущий раунд unobtainium, через который он проходил). Когда это было дешево, люди работали над проблемами программного обеспечения и делали его достаточно хорошим для решения многих основных вычислительных задач, вплоть до возможности выделить для задачи полноценный и настоящий компьютер, а не только микроконтроллер.
У нас есть множество хороших, дешевых, малоплатных компьютеров, и это уступает место возни, играм и экспериментам . Люди готовы пробовать новые идеи, даже стимулируя разработку аппаратного обеспечения для любителей, чтобы поддержать эти идеи.
Честно говоря, это, безусловно, самая удивительная и радикальная вещь, которую я видел от Raspberry Pi: как она коренным образом изменила всеобщее представление о том, что такое вычисления, на уровне того, в чем Raspberry Pi превосходит в любом случае, и породила не только свою собственную экосистему, но теперь бесчисленное множество других в разнообразии.
В 2018 году у нас с младшим братом было несколько ульев, и мы использовали Raspberry Pi и различные датчики для контроля температуры и влажности в наших ульях. Мы также планировали установить весы для улья, чтобы наблюдать за производством меда летом и измерять вес зимой, чтобы увидеть, достаточно ли еды у пчел. Мы так и не удосужились это сделать.
Наше небольшое решение для мониторинга было основано на Raspberry Pi 2 Model B, работало на Raspbian Stretch (на основе Debian 9) и имело подключенный датчик температуры и влажности (DHT11). У нас в ульях было по три-четыре таких датчика для измерения температуры на летке, под крышкой и в самой нижней рамке. Мы подключили датчик напрямую к Pi и использовали библиотеку датчиков Python_DHT для чтения данных. Мы также настроили InfluxDB , Telegraf и, наконец, Grafana для визуализации данных.
Если вы хотите узнать больше о нашей настройке, мы опубликовали статью о нашем маленьком решении для мониторинга в Linux Magazine .
Одна вещь, которую я хотел бы создать с помощью Raspberry Pi, — это симуляция того, как программировать машинный язык на старом компьютере с использованием «выключателей и огней». Это выглядит довольно просто, используя контакты GPIO на Raspberry Pi. Например, их онлайн-руководство показывает примеры использования GPIO для включения и выключения светодиода или использования кнопок для ввода данных. Я думаю, что это должно быть возможно с некоторыми светодиодами и переключателями, а также с небольшой программой, работающей на Raspberry Pi, для эмуляции компьютера в старом стиле. Но у меня не хватает свободного времени для работы над подобным проектом, поэтому я написал Toy CPU для его эмуляции.
Когда моей дочери было четыре года, она попросила на Рождество музыкальную шкатулку «Тролли». Она прекрасно представляла это в своей голове. Он должен быть розовым и блестящим с ее именем. Когда она открывала коробку, играла музыкальная тема из популярного фильма. В ящике она могла хранить своих троллей и другие сокровища. После поиска повсюду в Интернете и в магазинах я не смог найти ни одного, который соответствовал бы ее воображению. Мы с мужем решили, что можем сами построить такую в нашем собственном магазине игрушек (т.е. в его домашнем офисе). Центром всего этого был, конечно же, Raspberry Pi. Он использовал датчики света и скрипт Python, чтобы песня звучала в нужный момент. Мы незаметно поместили технику на дно музыкальной шкатулки и украсили ее с учетом ее эстетики. В том году праздничное волшебство стало возможным благодаря открытому исходному коду!
— Лорен Притчетт
Оригинальный источник статьи: https://opensource.com/
1678792680
人们将 Raspberry Pi 用于各种各样的事情。什么引起了你的注意?
最近,我接到一个电话,有人说开源社区是好奇心和解决方案文化的结合。而好奇心是我们解决问题的基础。在解决各种规模的问题时,我们使用了大量的开源软件,其中包括在极其方便的 Raspberry Pi 上运行的Linux 。
我们都有如此不同的生活经历,所以我向我们的作家社区询问了他们遇到过的最奇怪的 Raspberry Pi 用法。我有一种预感,其中一些出色的构建会激发其他人的灵感。
对我来说,Raspberry Pi 是一个很好的工具,可以在我的家庭网络上添加额外的开发资源。如果我想创建一个新网站 或试验一个新的软件工具,我不必让我的桌面 Linux 机器陷入一堆我可能只在试验时使用一次的软件包。相反,我在我的 Raspberry Pi 上设置了它。
如果我认为我要做一些有风险的事情,我会使用备份引导环境。我有两张 microSD 卡,这让我可以将一张插入 Raspberry Pi,同时设置第二张 microSD 来做我想做的任何实验。额外的 microSD 并没有那么贵,但是当我想在第二张图像上进行试验时,它可以节省大量时间。只需关机、更换 microSD 卡、重新启动,我就会立即开始使用专用测试系统。
当我不进行实验时,我的 Raspberry Pi 充当打印服务器,将我的非 WiFi 打印机连接到我们的家庭网络。它也是一个方便的 SSH 文件服务器,因此我可以快速备份我的重要文件。
我所看到的关于 Raspberry Pi 的最令人惊奇的事情是它规范化和商品化了小型计算机的概念,并使它们真正和实用地为人们所用。
在 Raspberry Pi 出现之前,我们有类似的小型计算机,但它们往往是小众的、昂贵的,而且从软件的角度来看几乎无法接近。Raspberry Pi 很便宜,而且便宜到任何人都可以轻而易举地为一个项目获得一个(忽略它正在经历的当前一轮 unobtainium)。一旦它变得便宜,人们就会解决软件挑战并使其足够好以解决许多基本的计算任务,直到能够将完整和真实的计算机专用于一项任务,而不仅仅是一个微控制器。
我们有大量优质、便宜的小型计算机,这让位于修补、玩弄和 试验。人们愿意尝试新的想法,甚至鼓励更多的爱好者硬件开发来支持这些想法。
老实说,这是迄今为止我从 Raspberry Pi 看到的最令人惊奇和最激进的事情:它如何从根本上改变了每个人对什么计算的看法,不管怎样,在 Raspberry Pi 所擅长的水平上,它不仅引起了它自己的生态系统,但现在无数其他的多样性。
2018年,我和弟弟有几个蜂箱,用树莓派和各种传感器监测蜂箱的温度和湿度。我们还计划实施蜂巢秤,以在夏季观察蜂蜜产量并在冬季测量重量以查看蜜蜂是否有足够的食物。我们从来没有抽出时间去做那件事。
我们的小型监控解决方案基于 Raspberry Pi 2 Model B,运行 Raspbian Stretch(基于 Debian 9),并连接了温度和湿度传感器 (DHT11)。我们在蜂箱中安装了三四个这样的传感器,用于测量入口孔、盖子下方和最低框架中的温度。我们将传感器直接连接到 Pi,并使用 Python_DHT 传感器库读取数据。我们还设置了InfluxDB、Telegraf,最后是 Grafana来可视化数据。
如果您想了解更多关于我们的设置,我们在Linux Magazine上发表了一篇关于我们的小型监控解决方案的文章。
我很想用 Raspberry Pi 创建的一件事是模拟如何使用“开关和灯”将机器语言编程到老式计算机中。使用 Raspberry Pi 上的 GPIO 引脚,这看起来相当简单。例如,他们的在线手册展示了如何使用 GPIO 打开和关闭 LED 或使用按钮获取输入的示例。我认为应该可以通过一些 LED 和开关,以及在 Raspberry Pi 上运行的一个小程序来模拟老式计算机。但是我没有空闲时间来处理这样的项目,这就是我编写Toy CPU来模拟它的原因。
我女儿四岁时,她要了一个“巨魔音乐盒”作为圣诞节礼物。她可以在脑海中完美地描绘出来。它会是粉红色的,闪闪发光,上面有她的名字。当她打开盒子时,会播放流行电影的主题曲。她可以将她的巨魔和其他宝藏存放在盒子里。在网上和实体店里到处找,都没有找到符合她想象的。我丈夫和我决定我们可以在我们自己的玩具店(即他的家庭办公室)中自己建造一个。当然,这一切的中心是 Raspberry Pi。他使用光传感器和 Python 脚本让歌曲在恰当的时刻播放。我们将技术谨慎地放置在音乐盒的底部,并根据她的审美进行装饰。那一年,开源使节日魔法成为可能!
——劳伦·普里切特
文章原文出处:https: //opensource.com/
1678788906
People use the Raspberry Pi for all kinds of things. What's caught your attention?
Recently, I was on a call where it was said that the open source community is a combination of curiosity and a culture of solutions. And curiosity is the basis of our problem-solving. We use a lot of open source when solving problems of all sizes, and that includes Linux running on the supremely convenient Raspberry Pi.
We all have such different lived experiences, so I asked our community of writers about the most curious use of a Raspberry Pi they've ever encountered. I have a hunch that some of these fantastic builds will spark an idea for others.
For me, the Raspberry Pi has been a great tool to add extra development resources on my home network. If I want to create a new website or experiment with a new software tool, I don't have to bog down my desktop Linux machine with a bunch of packages that I might only use once while experimenting. Instead, I set it up on my Raspberry Pi.
If I think I'm going to do something risky, I use a backup boot environment. I have two microSD cards, which allows me to have one plugged into the Raspberry Pi while I set up the second microSD to do whatever experimenting I want to do. The extra microSD doesn't cost that much, but it saves a ton of time for the times when I want to experiment on a second image. Just shutdown, swap microSD cards, reboot, and immediately I'm working on a dedicated test system.
When I'm not experimenting, my Raspberry Pi acts as a print server to put my non-WiFi printer on our home network. It is also a handy file server over SSH so that I can make quick backups of my important files.
— Jim Hall
The most amazing thing I've seen about the Raspberry Pi is that it normalized and commoditized the idea of the small-board computers and made them genuinely and practically available to folks.
Before the Raspberry Pi, we had small-board computers in a similar fashion, but they tended to be niche, expensive, and nigh unapproachable from a software perspective. The Raspberry Pi was cheap, and cheap to the point of making it trivial for anyone to get one for a project (ignoring the current round of unobtainium it's been going through). Once it was cheap, people worked around the software challenges and made it good enough to solve many basic computing tasks, down to being able to dedicate a full and real computer to a task, not just a microcontroller.
We've got a plethora of good, cheap-ish, small-board computers, and this gives way to tinkering, toying, and experimenting. People are willing to try new ideas, even spurring more hobbyist hardware development to support these ideas.
Honestly, that is by far the most amazing and radical thing I've seen from the Raspberry Pi: how it's fundamentally changed everyone's perception of what computing, at the level of what the Raspberry Pi excels at anyway, is and given rise not only to its own ecosystem but now countless others in diversity.
In 2018, my younger brother and I used to have several beehives and used a Raspberry Pi and various sensors to monitor the temperature and humidity of our hives. We also planned to implement a hive scale to observe honey production in summer and measure the weight in winter to see if the bees had enough food left. We never got around to doing that.
Our little monitoring solution was based on a Raspberry Pi 2 Model B, ran Raspbian Stretch (based on Debian 9), and had a temperature and humidity sensor connected (DHT11). We had three or four of those sensors in the hives to measure the temperature at the entrance hole, under the lid, and in the lowest frame. We connected the sensor directly to the Pi and used the Python_DHT sensor library to read the data. We also set up InfluxDB, Telegraf, and finally, Grafana to visualize the data.
If you want to know more about our setup, we published an article on our little monitoring solution in Linux Magazine.
One thing I would love to create with the Raspberry Pi is a simulation of how to program machine language into an old-style computer using "switches and lights." This looks to be fairly straightforward using the GPIO pins on the Raspberry Pi. For example, their online manual shows examples of how to use GPIO to switch an LED on and off or to use buttons to get input. I think it should be possible with some LEDs and switches, plus a small program running on the Raspberry Pi to emulate the old-style computer. But I lack the free time to work on a project like this, which is why I wrote the Toy CPU to emulate it.
— Jim Hall
When my daughter was four, she asked for a "Trolls music box" for Christmas. She could picture it perfectly in her head. It would be pink and sparkly with her name on it. When she opened the box, the theme song from the popular movie would play. She could store her trolls and other treasures in the box. After searching everywhere online and in stores, I could not find one that measured up to her imagination. My husband and I decided we could build one ourselves in our own toyshop (i.e., his home office). The center of it all was, of course, the Raspberry Pi. He used light sensors and a Python script to make the song play at just the right moment. We placed the tech discreetly in the bottom of the music box and decorated it with her aesthetic in mind. That year, holiday magic was made possible with open source!
Original article source at: https://opensource.com/
1678783260
Lightweight justice for your single-board computer!
optimised • simplified • for everyone
Ready to run optimised software choices with dietpi-software
Feature-rich configuration tool for your device with dietpi-config.
DietPi is an extremely lightweight Debian-based OS. It is highly optimised for minimal CPU and RAM resource usage, ensuring your SBC always runs at its maximum potential.
The dietpi programs use lightweight whiptail menus. You'll spend more time enjoying DietPi and applications you need and less time staring at the command line.
Use dietpi-software
to quick and easy install Ready to Run & Optimised applications for your system. DietPi will do all the necessary configurations, including starting the services. Few highlights: Desktop Environments, Remote Desktop Access, Media Systems & Players, BitTorrent & Downloading, Cloud & Backup, Gaming & Emulation, Social & Search, Camera & Surveillance, Networking, System Stats & Management, Home Automation, Hardware & Voice Projects, Webserver Stacks, DNS Servers / Pi-hole, File Servers, Printing and much more.
Use dietpi-services
to control which installed software has higher or lower priority levels (nice, affinity, policy scheduler).
dietpi-update
automatically checks for updates and informs you when they are available. Update instantly, without having to write a new image. DietPi automation allows you to completely automate a DietPi installation with no user input, simply by configuring dietpi.txt
before powering on.
The full list of code contributors can be viewed here.
Joined Q3 2017
Project lead (20/02/2019 and onwards), source code contributor, bug fixes, software improvements, DietPi forum administrator.
Project founder and previous project lead (19/02/2019 and previous), source code contributor and tester.
Joined 2016-06-08
DietPi forum co-administrator, management, support, testing and valuable feedback.
Joined 2017-07-26
Creator and maintainer of the first Clonezilla based installer images for x86_64 UEFI systems.
Joined Q4 2019
DietPi forum moderator, support, testing, bug reports + investigation and valuable feedback.
Joined Q4 2019
NanoPi image creator, tester and bug reports.
Joined 2020-05-31
DietPi documentation author, product manager, SEO and DietPi visibility recommendations.
Joined 2020-10-11
Source code contributor, creator of the DietPi-Dashboard and many software implementations.
Joined 2018-04-16
Creator and maintainer of the first DietPi Hyper-V images.
Since 2016-09-02
Joint venture to bring you the ultimate Amiga experience on your SBC, running lightweight and optimised DietPi at its core: https://github.com/MichaIng/DietPi/issues/474
Joined 2016-01-01
Contributions to the DietPi in general, in-depth testing, bug finding and valuable feedback, forum moderator.
Joined 2016-03-20
DietPi forum moderator and version history maintainer on forums.
Joined 2018-03-01
Contributions to the DietPi in general, including source code, testing, new devices, forum moderator.
Joined 2015-10-10
Provided dietpi.com web hosting for 1 year until April 17th 2016. Additionally: forum moderator, testing, bug reporting.
Joined 2016-04-01
Contributions to the DietPi in general, including source code and VirtualBox image creation/conversion.
Joined 2016-10-01
Created the first DietPi image for NanoPi M3/T3.
Git coders, please use the active development branch: dev
Are you able to:
dietpi-software
install system?If so, let us know! We are always looking for talented people who believe in the DietPi project, and, wish to contribute in any way you can.
Also read our contribute page for an overview of way to support DietPi.
DietPi Copyright (C) 2022 Contributors
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/
/var/lib/dietpi/
/var/tmp/dietpi/
/boot/dietpi/
/boot/dietpi.txt
/boot/config.txt
(RPi)/boot/boot.ini
(Odroid)dietpi-
The above GPLv2 documentation also applies to all mentioned files!
Links to hardware and software manufacturers, sources and build instructions used in DietPi:
Author: MichaIng
Source Code: https://github.com/MichaIng/DietPi
License: GPL-2.0 license
#shell #bash #lightweight #debian #optimization #raspberrypi
1678382280
Установите NextcloudPi на свой Raspberry Pi менее чем за 30 минут, синхронизируйте свои мобильные устройства с вашим собственным Nextcloud и получите полный цифровой суверенитет и конфиденциальность.
Теперь вы можете попрощаться с крупными коммерческими облачными провайдерами и управлять своими встречами, контактами и другими данными в собственной домашней сети. Установите NextcloudPi на свой Raspberry Pi менее чем за 30 минут, синхронизируйте свои мобильные устройства с вашим собственным Nextcloud и получите полный цифровой суверенитет и конфиденциальность!
Я помню, как в 2012 году на рынке появился первый Raspberry Pi. Мои друзья из Linux и я были в полном восторге: крошечный компьютер, доступный за небольшие деньги, но с достаточной вычислительной мощностью, чтобы быть полезным. На нем также работает полноценная система Linux! Мы начали всевозможные проекты DIY, настроили медиацентры , веб-серверы , блоги, центры управления для наших умных домов и даже решение для мониторинга пчелиных ульев.
В декабре прошлого года я решил установить и запустить собственное облако на Raspberry Pi. Немного покопавшись, я остановился на NextcloudPi , готовом экземпляре Nextcloud . Программное обеспечение с открытым исходным кодом работает не только на Raspberry Pi, но и на многих других одноплатных компьютерах и других операционных системах.
В этой статье показано, как установить и настроить NextcloudPi. Я также объясню, как защитить систему, и расскажу о различных методах резервного копирования и восстановления.
В дополнение к этому руководству вы можете узнать, как синхронизировать данные из Google Workspace и Apple iCloud с Nextcloud в моих предыдущих статьях.
Чтобы запустить NextcloudPi на Raspberry Pi, вам понадобится как минимум Raspberry Pi 2. Однако более новые модели, такие как Raspberry Pi 3, Pi 3+ и особенно Raspberry Pi 4, намного быстрее. Дома я использую Raspberry Pi 3, модель B+ с 64-битным четырехъядерным процессором (1,4 ГГц) и 1 ГБ оперативной памяти. Поскольку я не использую графическую среду рабочего стола, этого оборудования вполне достаточно для моих целей (максимум 10 пользователей/устройств).
Что еще тебе нужно? Вот контрольный список:
Карта microSD с минимальным объемом 8 ГБ
Компьютер для записи образа NextcloudPi на SD-карту.
Кабель Ethernet (NextcloudPi также работает через WLAN, но прямое соединение намного стабильнее и быстрее)
Необязательное дополнительное внешнее хранилище для хранения данных собственного облака. Это зависит от количества данных, которые у вас есть. Вы должны выбрать USB-накопитель или внешний жесткий диск достаточного объема.
Обычно вам не нужен монитор или внешняя клавиатура. После того, как вы записали образ NextcloudPi на SD-карту, остальная часть настройки и работы выполняется с помощью веб-интерфейса. Вы также можете получить доступ к Raspberry Pi через SSH из Linux, Windows и macOS. Вы также можете получить к нему доступ с мобильных устройств.
Конечно, вы всегда можете установить Nextcloud на ОС Raspberry Pi (ранее Raspbian) или другую операционную систему на мини-компьютер. Однако это означает, что вам нужно установить операционную систему, настроить сервер базы данных и базу данных — сложная задача, которая отпугивает многих новичков. С NextcloudPi этот процесс проще и быстрее. Проект с открытым исходным кодом предлагает готовые образы для различных одноплатных компьютеров. Он также имеет сценарий установки, который позволяет вам настроить собственное облако в кратчайшие сроки.
NextcloudPi снимает с вас много работы. Он устанавливает и настраивает Nextcloud, чтобы вы могли сразу приступить к работе. Разработчики опубликовали список поддерживаемого оборудования/систем на своем сайте . Например, Raspberry Pi (все модели, также есть образы Berryboot для запуска NextcloudPi напрямую с внешнего жесткого диска), Odroid, Rock64, RockPro64, Banana Pi и так далее. Они также предлагают образ контейнера
В дополнение к текущей версии Nextcloud, NextcloudPi включает в себя веб-сервер с предварительно настроенным подключением к базе данных. Интерфейс администрирования для веб-браузера также включен, чтобы новички могли быстро сориентироваться. Те, кто предпочитает администрирование из командной строки, могут активировать доступ по SSH. NextcloudPi имеет ряд полезных предустановок, в том числе автоматическую переадресацию HTTPS, HSTS (HTTP Strict-Transport-Security, механизм безопасности для соединений HTTPS), расширения PHP для повышения производительности и многое другое. Мастер настройки поможет вам с первыми шагами и форматированием внешнего USB-носителя, а также с доступом извне с использованием различных служб динамического DNS.
Сам Nextcloud имеет ряд предустановленных приложений, включая календарь, адресную книгу, панель инструментов, обмен файлами, средство просмотра PDF, управление изображениями и файлами, заметки и задачи, а также действия Nextcloud.
Репозиторий GitHub содержит готовые образы для Raspberry Pi и других устройств. После загрузки и распаковки zipфайла вы можете использовать ddкоманду в Linux или macOS для записи образа на SD-карту:
sudo dd bs=4M conv=fsync if=NextCloudPi[…].img of=/dev/mmcblkXX
Замените имя устройства SD-карты правильным именем. Будьте внимательны при выборе правильного имени устройства, т.к. ddне запрашивает подтверждения!
Кроме того, вы можете использовать программу Etcher с открытым исходным кодом для записи образа на SD-карту. Он работает на Linux, Windows и macOS. Просто выберите образ на жестком диске ( Flash from file ) или введите адрес образа NextcloudPi в GitHub ( Flash from URL ). После этого нажмите Select target , выберите SD-карту , и Flash начнет процесс записи.
(Хайке Юрзик, CC BY-SA 4.0)
Вставьте подготовленную SD-карту в слот Raspberry Pi, подключите кабель Ethernet к свободному порту на сетевом коммутаторе или маршрутизаторе и подключите Raspberry Pi к источнику питания для его загрузки. Во-первых, вам нужно узнать IP-адрес Raspberry Pi. Таким образом вы получаете доступ как к веб-интерфейсу для настройки NextcloudPi, так и к самому Nextcloud.
Если вы используете маршрутизатор, оснащенный DHCP-сервером, вы можете посмотреть в интерфейсе администрирования маршрутизатора, какой адрес он назначил Raspberry Pi.
В качестве альтернативы используйте сетевой сканер, напримерnmap
Откройте веб-браузер и введите IP-адрес или имя хоста вашего Pi. Откроется мастер настройки. По умолчанию NextcloudPi имеет только самозаверяющий сертификат SSL/TLS, который не был подписан известным центром сертификации (ЦС). Большинство веб-браузеров предупреждают об использовании таких самозаверяющих сертификатов. В этом случае можно проигнорировать предупреждение, принять риск и продолжить.
Далее вы увидите экран активации NextcloudPi. Веб-интерфейс содержит информацию о двух созданных учетных записях: одну для администратора NextcloudPi и одну для Nextcloud. На этом этапе рекомендуется делать заметки или сохранять пароли в менеджере паролей, чтобы вы могли изменить их позже. Нажмите кнопку «Активировать» , войдите в систему как пользователь ncpвместе с соответствующим паролем, чтобы запустить мастер настройки.
(Хайке Юрзик, CC BY-SA 4.0)
При первом переходе к Pi в браузере нажмите кнопку «Выполнить» , чтобы запустить мастер настройки.
(Хайке Юрзик, CC BY-SA 4.0)
Перейдите на вкладку «Конфигурация USB» , чтобы настроить внешнее USB-устройство (например, внешний жесткий диск или USB-накопитель) для данных Nextcloud. Если на USB-носителе уже есть подходящая файловая система (Ext2, Ext3, Ext4 или Btrfs), вы можете продолжить, нажав Пропустить. В противном случае проинструктируйте NextcloudPi с помощью Format USB
На вкладке «Внешний доступ» вы можете настроить NextcloudPi, чтобы к системе можно было получить доступ извне (из Интернета). На этом этапе я рекомендую выбрать no . Вы всегда можете подключить различные службы динамического DNS через меню СЕТИ NextcloudPi . После этого последнего шага начальная настройка завершена. На вкладке «Готово» есть две ссылки для доступа к вашей новой установке Nextcloud и панели управления NextcloudPi:
https://nextcloudpi.local : ваш Nextcloud
https://nextcloudpi.local:4443 : интерфейс администрирования NextcloudPi.
Интерфейс администрирования NextcloudPi очень интуитивно понятен. В строке меню отображается номер версии, переключатель языка, функция поиска и значки, которые ссылаются на вашу собственную установку Nextcloud. Вы также можете найти информацию о системе, получить доступ к существующим резервным копиям и снимкам, отобразить обзор конфигурации Nextcloud, файлы журнала и перезапустить мастер настройки. Используйте значок справа, чтобы выключить или перезапустить операционную систему.
На левой боковой панели есть семь меню, содержащих основные параметры для управления системой NextcloudPi:
РЕЗЕРВНОЕ КОПИРОВАНИЕ : резервное копирование (автоматическое), настройка носителя для резервного копирования, определение расписания резервного копирования, экспорт и импорт конфигурации NextcloudPi, создание моментального снимка файловой системы Btrfs, восстановление существующих резервных копий.
КОНФИГУРАЦИЯ
СЕТЬ : активация NFS, SSH-доступа, различных DNS-сервисов и провайдеров, TLS/SSL-сертификатов с Let’s Encrypt, переадресация портов для доступа извне, статический IP-адрес, доверенные прокси-серверы и Samba
БЕЗОПАСНОСТЬ : Настройте брандмауэр и систему предотвращения вторжений Fail2ban и инициируйте ручную проверку безопасности.
СИСТЕМА
ИНСТРУМЕНТЫ : использует различные утилиты для исправления разрешений файлов данных Nextcloud, форматирования USB-накопителей (файловая система Btrfs) и включения и выключения режима обслуживания Nextcloud.
ОБНОВЛЕНИЯ : включает автоматические обновления Nextcloud и NextcloudPi, уведомления о новых версиях и регулярные обновления всех установленных приложений Nextcloud, обновляет текущий экземпляр до новой версии Nextcloud, устанавливает обновления NextcloudPi и активирует автоматическую установку обновлений безопасности.
Вы можете войти в свой Nextcloud с именем пользователя ncpи паролем, отображаемыми в окне активации. Панель инструментов Nextcloud предлагает быстрый доступ к определенным файлам и папкам, вашему календарю и вашему онлайн-статусу (в сети, нет на месте, не беспокоить и т. д.). Вы также можете выбрать свое местоположение для прогноза погоды.
Все установленные приложения Nextcloud перечислены в верхней строке меню: « Файлы», «Фотографии», «Активность», «Контакты», «Календарь», «Заметки» и т. д. Если вы выберете приложение, меню на левой боковой панели предоставит фильтры и связанные с ним задачи. Например, в приложении «Файлы» вы получаете функции поиска и фильтры, которые обеспечивают быстрый доступ к вашим собственным файлам и папкам или к тем, к которым вам предоставлен доступ. С другой стороны, в приложении «Контакты» есть кнопка для создания новых контактов и управления группами и кругами. В левом нижнем углу вы можете получить доступ к настройкам приложения.
Все пользователи Nextcloud могут найти свои личные настройки, щелкнув изображение профиля или инициалы имени пользователя в правом верхнем углу. Учетная запись администратора ncp также может (удалять) устанавливать приложения, управлять учетными записями пользователей и выполнять другие административные задачи.
(Хайке Юрзик, CC BY-SA 4.0)
Перед началом импорта адресной книги и календарей рекомендуется создать новую учетную запись пользователя без прав администратора для повседневной работы. Из соображений безопасности вам следует использовать учетную запись ncp только тогда, когда вы что-то меняете в конфигурации. Это включает в себя установку и обновление приложений Nextcloud, создание пользователей и групп и так далее.
Чтобы создать нового пользователя, нажмите на значок с буквой N в правом верхнем углу, чтобы открыть настройки, и выберите там запись «Пользователи» . На левой боковой панели нажмите кнопку «Новый пользователь» , введите имя пользователя, имя и фамилию, пароль и адрес электронной почты. Вы также можете добавить учетную запись в существующую группу. В поле Квота по умолчанию вы можете указать, сколько места на жестком диске предоставляется пользователю в облаке.
Как только вы запустите Nextcloud, вы сможете синхронизировать свои устройства Android или Apple. Вы можете прочитать о том, как это сделать, в моих предыдущих статьях « Переход с Google Workspace на Nextcloud» и «Переход с iCloud на Nextcloud» .
Даже если вы работаете с Nextcloud только в локальной сети и никакие сервисы недоступны извне, важно предусмотреть дополнительные меры безопасности. Вот некоторые предложения:
Активируйте доступ по SSH . Чтобы включить доступ по SSH для Raspberry Pi, перейдите в раздел СЕТЬ > SSH в веб-интерфейсе NextcloudPi. Установите флажок «Активный» и введите пароль для учетной записи pi. Наконец, нажмите «Применить» , чтобы запустить службу SSH на Raspberry Pi. По умолчанию пароль raspberry установлен для пользователя pi. Вы должны изменить его на что-то другое. После первого входа через SSH система предложит вам сменить и этот пароль!
Настройте брандмауэр . Вы можете активировать брандмауэр в разделе «Безопасность» > «UFW» . Несложный брандмауэр (UFW) — это интерфейс для мощного, но довольно сложного брандмауэра Netfilter Iptables. Разработчики NextcloudPi упрощают настройку, вводя в веб-интерфейсе три основных порта, которые должен разрешать UFW: 80 (HTTP), 443 (HTTPS) и 22 (SSH). Нажмите «Активно» , а затем «Применить» , чтобы запустить брандмауэр. В диалоговом окне вы можете увидеть сообщения от операционной системы о добавленных правилах.
Fail2ban : Если вы используете Nextcloud только в своей домашней сети, вы можете обойтись без настройки. Если, с другой стороны, Nextcloud доступен из Интернета, то настройте эту дополнительную меру защиты через SECURITY/fail2ban . Fail2ban защищает сервисы от DoS-атак. Для этого программа блокирует IP-адреса после определенного количества неудачных попыток подключения — сначала временно, а затем навсегда.
Сертификаты TLS/SSL . По умолчанию NextcloudPi включает самозаверяющие сертификаты SSL/TLS. Это может привести к появлению предупреждения. В случае NextcloudPi в вашей локальной сети предупреждение носит чисто технический характер, и вы можете определить исключение для соответствующего веб-браузера. Кроме того, вы можете сгенерировать действительные сертификаты TLS/SSL с помощью центра сертификации Let's Encrypt (или настроить свой собственный центр сертификации).
Включить 2FA для Nextcloud : Вы можете активировать двухфакторную аутентификацию (2FA) через меню Администрирование > Безопасность . В разделе безопасности каталога приложений Nextcloud есть множество приложений, которые настраивают второй фактор для входа в систему — предоставляемый приложением или аппаратным обеспечением (например, с помощью YubiKey). Если вы включили двухфакторную аутентификацию, установите пароль приложения в разделе «Личные данные» > «Безопасность» . Вы можете использовать этот пароль для аутентификации на устройствах Apple или Android, чтобы синхронизация контактов и календарей прошла успешно. В целях безопасности пароль отображается только один раз.
Политики паролей : Вы также можете настроить политики паролей для Nextcloud в Администрирование > Безопасность . Например, вы можете определить минимальную длину пароля, количество дней до истечения срока действия пароля пользователя и количество попыток входа в систему до блокировки учетной записи. Кроме того, вы можете запретить общие пароли и принудительно использовать комбинации прописных и строчных букв, цифр и специальных символов.
(Хайке Юрзик, CC BY-SA 4.0)
Для безопасности операционной системы важно своевременно устанавливать обновления безопасности. Всего для NextcloudPi существует три разных обновления: обновления NextcloudPi, обновления Nextcloud и установленные приложения. Также есть обновления для базовой операционной системы (ОС Raspberry Pi). Используйте меню «Обновления» в интерфейсе NextcloudPi, чтобы активировать уведомления о новых версиях, автоматических обновлениях и ручных обновлениях приложений Nextcloud.
Теперь, когда у вас есть собственное облако, в идеале в ваших собственных четырех стенах — это конец настройки. На этом статья могла бы закончиться. Могло бы, если бы не еще одна существенная тема для обсуждения: резервные копии! Небольшие SD-карты в Raspberry Pi особенно подвержены аппаратным дефектам по сравнению со стандартными дисками, но могут быть и другие причины отказа оборудования. NextcloudPi содержит все необходимые инструменты для автоматического создания резервных копий и их восстановления в экстренной ситуации.
Вы можете немедленно сделать резервную копию своих данных в любое время через веб-интерфейс NextcloudPi. Для этого откройте запись nc-backup в меню BACKUPS . Резервные копии лучше делать на внешнем USB-накопителе, чем на SD-карте — внешний жесткий диск не только больше места, но и надежнее. Чтобы создать полную резервную копию, включающую не только конфигурацию NextcloudPi, но и базу данных Nextcloud, приложения Nextcloud и данные пользователей (календарь, контакты и другие файлы), установите флажок Включить данные . При желании сжимайте данные, поставив галочку в поле Сжать . Альтернативой полной резервной копии является простой экспорт конфигурации NextcloudPi через пункт меню BACKUPS > nc-export-ncp.. Таким образом вы сохраняете только настройки NextcloudPi — без базы данных Nextcloud, ее конфигурации и пользовательских данных.
Чтобы упростить задачу, вы можете активировать автоматическое резервное копирование ( BACKUPS > nc-backup-auto ). Опять же, вам решать, хотите ли вы включать данные пользователей и хотите ли вы сжимать резервные копии. В настройках по умолчанию NextcloudPi создает полную резервную копию каждые семь дней после нажатия кнопки «Применить» . Через четыре недели он перезаписывает самую старую версию. Оба метода, ручное резервное копирование и автоматическое резервное копирование, имеют то преимущество, что их можно настроить быстро. Однако резервные копии могут — в зависимости от объема данных в вашем Nextcloud — занимать много места, даже если они сжаты. По мере роста объема данных NextcloudPi также требуется больше времени для создания резервных копий. В это время облако находится в режиме обслуживания и не может быть использовано.
В качестве альтернативы вы можете создавать добавочные резервные копии, создавая и синхронизируя моментальные снимки Btrfs. Этот метод резервного копирования экономит место на диске и значительно более эффективен, чем другие подходы. Особенно для больших объемов данных в облаке. У этого варианта есть реальное преимущество: во время резервного копирования Nextcloud не нужно переводить в режим обслуживания, поэтому нет простоя. B-tree FS (также называемая Butter FS) представляет собой так называемую файловую систему с копированием при записи (COW) и позволяет создавать моментальные снимки текущих данных из работающей системы. Это замороженные изображения подобъема в момент создания. Они не требуют дополнительного места на диске.
Обратите внимание: для этого каталог данных Nextcloud необходимо перенести с SD-карты (или другого носителя данных) на USB-накопитель с файловой системой Btrfs. Возможно, вы уже настроили это в мастере настройки, в противном случае вы можете переместить данные:
Отформатируйте внешний USB-накопитель в файловой системе Btrfs ( ИНСТРУМЕНТЫ > nc-format-USB ).
Переместите каталог данных Nextcloud на внешний USB-диск ( CONFIG > nc-datadir ). Вы должны увидеть сообщение The NC data directory has been moved successfullyв окне ниже.
В качестве теста теперь вы можете создать моментальный снимок ( BACKUPS > nc-snapshot ) перед активацией функции автоматического моментального снимка.
Для автоматического создания моментальных снимков откройте запись nc-snapshot-auto в меню BACKUPS , установите флажок Active и нажмите Apply . NextcloudPi теперь автоматически создает моментальный снимок Btrfs каталога данных Nextcloud каждый час.
Новые клонированные каталоги всегда занимают столько дополнительного места для хранения, сколько новых файлов было добавлено с момента последнего снимка, поэтому все это чрезвычайно эффективно с точки зрения пространства. Вы можете постепенно отправлять моментальные снимки в другую файловую систему Btrfs. NextcloudPi поддерживает вас с настройкой ( BACKUPS > nc-snapshot-sync ). Вы можете выбрать либо другой внешний диск, либо каталог на удаленном компьютере. Это должно быть доступно через SSH (без пароля), и диск также должен быть отформатирован с помощью Btrfs.
После того, как вы настроили свою стратегию резервного копирования, вы всегда должны проверять, можете ли вы восстановить свои данные с помощью веб-интерфейса NextcloudPi. Практически для всех представленных здесь способов есть соответствующий пункт меню для восстановления:
nc-import-ncp: импортировать конфигурацию NextcloudPi
nc-restore-snapshot : восстановить конкретный снимок
nc-restore : восстановить полную резервную копию вашего Nextcloud
(Хайке Юрзик, CC BY-SA 4.0)
Существует активное сообщество Nextcloud:
Темы NextcloudPi на форуме Nextcloud
Отчеты об ошибках и запросы функций для NextcloudPi
Разработчики NextcloudPi создали веб-сайт , объясняющий, какие вопросы и где лучше задавать.
NextcloudPi предлагает экономичную и надежную альтернативу коммерческим облачным провайдерам. Установив его на Raspberry Pi, вы сможете контролировать свои данные и обеспечивать конфиденциальность. Благодаря совместимости с устройствами Android и Apple он упрощает синхронизацию ваших встреч, контактов и других данных. Процесс установки прост и может быть завершен менее чем за 30 минут. Приняв необходимые меры для защиты системы и внедрив методы резервного копирования и восстановления, вы можете быть спокойны, зная, что ваши данные в безопасности.
Для получения более подробной информации о NextcloudPi вы можете ознакомиться с моей книгой Nextcloud на Raspberry Pi: настройте собственное облако с помощью NextcloudPi . Он содержит подробное руководство по настройке и использованию NextcloudPi и поможет вам получить максимальную отдачу от вашего личного облачного решения — сделайте первый шаг к цифровому суверенитету!
Оригинальный источник статьи: https://opensource.com/
1678378320
在不到 30 分钟的时间内在您的 Raspberry Pi 上安装 NextcloudPi,将您的移动设备与您自己的 Nextcloud 同步,并获得完全的数字主权和隐私。
您现在可以告别大型商业云提供商,并在您自己的家庭网络中管理您的约会、联系人和其他数据。在不到 30 分钟的时间内在您的 Raspberry Pi 上安装 NextcloudPi,将您的移动设备与您自己的 Nextcloud 同步,并获得完全的数字主权和隐私!
我记得当第一台 Raspberry Pi 于 2012 年上市时。我和我的 Linux 朋友都非常激动:一台微型计算机,价格低廉,但具有足够的计算能力以供使用。它也有一个成熟的 Linux 系统在上面运行!我们开始了各种 DIY 项目,建立了媒体中心、网络服务器、博客、智能家居控制中心,甚至是蜂箱监控解决方案。
去年 12 月,我决定在 Raspberry Pi 上安装并运行我自己的云。经过一番挖掘,我选择了NextcloudPi ,它是Nextcloud的现成实例。开源软件不仅可以在 Raspberry Pi 上运行,还可以在许多其他单板计算机和其他操作系统上运行。
本文介绍如何安装和配置 NextcloudPi。我还解释了如何保护系统并讨论不同的备份和恢复方法。
除了本教程之外,您还可以在我之前的文章中查看如何将Google Workspace和Apple iCloud中的数据与 Nextcloud 同步。
要在 Raspberry Pi 上运行 NextcloudPi,您至少需要一个 Raspberry Pi 2。但是,较新的型号,如 Raspberry Pi 3、Pi 3+,尤其是 Raspberry Pi 4,速度要快得多。在我家,我使用 Raspberry Pi 3,型号 B+,配备 64 位四核处理器 (1.4 GHz) 和 1 GB 内存。由于我不使用图形桌面环境,因此该设备完全足以满足我的目的(最多 10 个用户/设备)。
你还需要什么?这是一个清单:
最小容量为 8 GB 的 microSD 卡
一台电脑,将 NextcloudPi 镜像写入 SD 卡
以太网电缆(NextcloudPi 也可以通过 WLAN 工作,但直接连接更稳定、更快)
可选的附加外部存储,用于存储您自己的云数据。这取决于您拥有的数据量。您应该选择足够大的 USB 记忆棒或外部硬盘驱动器
通常,您不需要显示器或外接键盘。将 NextcloudPi 映像刷入 SD 卡后,其余设置和操作通过 Web 界面完成。您还可以通过 SSH 从 Linux、Windows 和 macOS 访问 Raspberry Pi。您也可以从您的移动设备访问它。
当然,您始终可以在 Raspberry Pi OS(以前称为 Raspbian)或迷你计算机上的其他操作系统上安装 Nextcloud。然而,这意味着您必须安装操作系统、设置数据库服务器和数据库——这是一项让许多初学者望而却步的复杂任务。使用 NextcloudPi,这个过程更容易、更快。该开源项目为各种单板计算机提供了现成的图像。它还具有一个安装脚本,可让您立即设置自己的云。
NextcloudPi 可以减轻您的大量工作。它会安装和配置 Nextcloud,以便您可以立即开始。开发人员已在其网站上发布了支持的硬件/系统列表。例如Raspberry Pi(所有型号,也有Berryboot镜像可以直接从外接硬盘运行NextcloudPi)、Odroid、Rock64、RockPro64、Banana Pi等。他们还提供容器镜像,可以在运行容器的所有架构和操作系统上运行。
除了当前的 Nextcloud 版本之外,NextcloudPi 还包括一个带有预配置数据库连接的 Web 服务器。还包括一个 Web 浏览器的管理界面,以便初学者可以快速找到自己的出路。那些喜欢在命令行上进行管理的人可以激活 SSH 访问。NextcloudPi 有许多有用的预设,包括自动 HTTPS 转发、HSTS(HTTP Strict-Transport-Security,一种用于 HTTPS 连接的安全机制)、用于提高性能的 PHP 扩展等等。配置向导可帮助您完成第一步、格式化外部 USB 媒体以及使用各种动态 DNS 服务从外部访问。
Nextcloud 本身有许多预装的应用程序,包括日历、地址簿、仪表板、文件共享、PDF 查看器、图像和文件管理、笔记和任务以及 Nextcloud 活动。
GitHub存储库包含适用于 Raspberry Pi 和其他设备的现成图像。下载并解压zip文件后,可以dd在Linux或macOS上使用命令将镜像写入SD卡:
sudo dd bs=4M conv=fsync if=NextCloudPi[…].img of=/dev/mmcblkXX
用正确的名称替换 SD 卡的设备名称。小心选择正确的设备名称,因为dd不要求确认!
或者,您可以使用开源程序Etcher将映像写入 SD 卡。它在 Linux、Windows 和 macOS 上运行。只需选择硬盘驱动器上的图像(Flash from file)或在 GitHub 中输入 NextcloudPi 图像的地址(Flash from URL)。之后点击选择目标,选择SD卡,Flash开始写入过程。
(Heike Jurzik,CC BY-SA 4.0)
将准备好的SD卡插入树莓派的插槽中,将以太网线连接到网络交换机或路由器上的空闲端口,并将树莓派连接到电源启动。首先,您需要找出树莓派的 IP 地址。这就是您访问用于设置 NextcloudPi 和 Nextcloud 本身的 Web 界面的方式。
如果您使用的是配备了 DHCP 服务器的路由器,您可以在路由器的管理界面中查看它分配给 Raspberry Pi 的地址。
或者,使用网络扫描仪,如nmap或者,使用命令行中的
打开网络浏览器并输入 Pi 的 IP 地址或主机名。这将打开配置向导。默认情况下,NextcloudPi 只有一个自签名的 SSL/TLS 证书,尚未由已知的证书颁发机构 (CA) 签名。大多数 Web 浏览器都会针对此类自签名证书发出警告。在这种情况下,忽略警告、接受风险并继续是安全的。
接下来,您会看到 NextcloudPi 激活屏幕。Web 界面包含有关它创建的两个帐户的信息:一个用于 NextcloudPi 管理员,一个用于 Nextcloud。此时,最好记下密码或将密码保存在密码管理器中,以便日后更改。单击“激活”按钮,以用户身份登录ncp并使用相关密码启动配置向导。
(Heike Jurzik,CC BY-SA 4.0)
第一次在浏览器中导航到 Pi 时,单击“运行”按钮启动配置向导。
(Heike Jurzik,CC BY-SA 4.0)
切换到USB 配置选项卡,为 Nextcloud 数据设置外部 USB 设备(例如,外部硬盘或 U 盘)。如果 USB 介质已经有合适的文件系统(Ext2、Ext3、Ext4 或 Btrfs),您可以单击跳过继续。否则,使用格式 USB指示 NextcloudPi使用 Btrfs 文件系统格式化磁盘。警告!格式化会删除媒体上的所有数据!
在外部访问选项卡中,您可以设置 NextcloudPi,以便可以从外部(互联网)访问系统。此时,我建议选择no。您始终可以通过 NextcloudPi网络菜单连接各种动态 DNS 服务。在这最后一步之后,初始设置就完成了。Finish选项卡提供了两个链接来访问您的新 Nextcloud 安装和 NextcloudPi 仪表板:
https://nextcloudpi.local:你的 Nextcloud
https://nextcloudpi.local:4443:NextcloudPi 管理界面
NextcloudPi 管理界面非常直观。菜单栏显示版本号、语言切换器、搜索功能以及链接到您自己的 Nextcloud 安装的图标。您还可以找到有关系统的信息、访问现有备份和快照、显示 Nextcloud 配置概览、日志文件以及重新启动配置向导。使用最右侧的图标关闭或重新启动操作系统。
在左侧边栏中,有七个菜单包含用于管理 NextcloudPi 系统的基本选项:
BACKUPS:(自动)备份、配置备份媒体、定义备份计划、导出和导入 NextcloudPi 配置、创建 Btrfs 文件系统的快照、恢复现有备份
配置:显示和(重新)设置管理员帐户 ncp 的密码,将 Nextcloud 数据库移动到外部(USB)设备,移动 Nextcloud 数据目录,强制安全 HTTPS 连接,使用干净的配置重新启动 Nextcloud,并配置系统限制
网络:激活 NFS、SSH 访问、各种 DNS 服务和提供程序、带 Let's Encrypt 的 TLS/SSL 证书、用于从外部访问的端口转发、静态 IP 地址、受信任的代理服务器和 Samba
SECURITY : 配置防火墙和入侵防御系统Fail2ban,并启动手动安全检查
系统 : 开启Prometheus监控和自动挂载USB设备,检查外接硬盘状态并将系统日志保存在RAM中保护SD卡,定义swap空间的大小和位置,开启压缩RAM提升交换性能
工具:使用各种实用程序来修复 Nextcloud 数据文件的权限、格式化 USB 驱动器(Btrfs 文件系统)以及打开和关闭 Nextcloud 的维护模式
更新:启用自动 Nextcloud 和 NextcloudPi 更新,有关新版本的通知和所有已安装 Nextcloud 应用程序的定期更新,将当前实例更新到新的 Nextcloud 版本,安装 NextcloudPi 更新,并激活安全更新的自动安装
ncp您可以使用激活窗口中显示的用户名和密码登录 Nextcloud 。Nextcloud 仪表板提供对某些文件和文件夹、您的日历以及您的在线状态(在线、离开、请勿打扰等)的快速访问。您还可以选择天气预报的位置。
所有已安装的 Nextcloud 应用程序都列在顶部菜单栏中:文件、照片、活动、联系人、日历、便笺等。如果您选择一个应用程序,左侧边栏中的菜单会提供与之关联的过滤器和任务。例如,在文件应用程序中,您可以获得搜索功能和过滤器,可以快速访问您自己的文件和文件夹或与您共享的文件和文件夹。另一方面,在联系人应用程序中,有一个用于创建新联系人以及管理组和圈子的按钮。在左下角,您可以访问应用程序的设置。
所有 Nextcloud 用户都可以通过单击右上角的个人资料图片或用户名的首字母来找到他们的个人设置。管理员帐户 ncp 还可以(卸载)安装应用程序、管理用户帐户和执行其他管理任务。
(Heike Jurzik,CC BY-SA 4.0)
在开始导入地址簿和日历之前,最好创建一个没有管理员权限的新用户帐户来进行日常工作。出于安全原因,您应该只在更改配置时使用 ncp 帐户。这包括安装和更新 Nextcloud 应用程序、创建用户和组等。
要创建新用户,请单击右上角带有N 的图标以打开设置并选择那里的用户条目。在左侧边栏中,单击新用户按钮,输入用户名、名字和姓氏、密码和电子邮件地址。您还可以将帐户添加到现有组中。在默认配额字段中,您可以定义在云中授予用户多少硬盘空间。
一旦启动并运行 Nextcloud,您就可以同步您的 Android 或 Apple 设备。您可以在我之前的文章从 Google Workspace 切换到 Nextcloud和 从 iCloud 切换到 Nextcloud 中了解如何执行此操作。
即使您仅在本地网络中运行 Nextcloud 并且无法从外部访问任何服务,考虑额外的安全措施也是至关重要的。以下是一些建议:
激活 SSH 访问:要为 Raspberry Pi 启用 SSH 访问,请转到NextcloudPi Web 界面中的网络 > SSH 。单击活动复选框并输入 pi 帐户的密码。最后点击Apply,在树莓派上启动SSH服务。默认情况下,密码 raspberry 是为用户 pi 设置的。您必须将其更改为不同的内容。首次通过 SSH 登录后,系统也会提示您更改此密码!
设置防火墙:您可以在“安全”>“UFW”部分激活防火墙。简单防火墙 (UFW) 是功能强大但相当复杂的 Netfilter 防火墙 Iptables 的前端。NextcloudPi 开发人员通过在 UFW 应允许的 Web 界面中输入三个基本端口来简化设置:80 (HTTP)、443 (HTTPS) 和 22 (SSH)。单击活动,然后单击应用以启动防火墙。在对话窗口中,您可以看到来自操作系统的有关添加规则的消息。
Fail2ban:如果您只在家庭网络上使用 Nextcloud,则无需设置即可。另一方面,如果可以从 Internet 访问 Nextcloud,则通过SECURITY / fail2ban设置此附加保护措施。Fail2ban 保护服务免受 DoS 攻击。为此,该程序会在一定次数的连接尝试失败后阻止 IP 地址——首先是暂时的,然后是永久的。
TLS/SSL 证书:默认情况下,NextcloudPi 包含自签名 SSL/TLS 证书。这可能会导致警告。对于本地网络中的 NextcloudPi,警告只是技术问题,您可以为相应的 Web 浏览器定义例外。或者,您可以使用Let's Encrypt证书颁发机构(或设置您自己的证书颁发机构)生成有效的 TLS/SSL 证书。
为 Nextcloud 启用 2FA :您可以通过菜单Administration > Security激活双因素身份验证(2FA) 。在Nextcloud 应用程序目录的安全部分 ,有许多应用程序设置了第二个登录因素——由应用程序或硬件提供(例如,使用 YubiKey)。如果您启用了双因素身份验证,请在Personal > Security下设置应用程序密码。您可以在苹果或安卓设备中使用此密码进行身份验证,以便联系人和日历同步成功。出于安全原因,密码只显示一次。
密码策略:您还可以在Administration > Security中为 Nextcloud 设置密码策略。例如,您可以定义最短密码长度、用户密码到期前的天数以及帐户被阻止前的登录尝试次数。此外,您可以禁止使用普通密码并强制使用大小写、数字和特殊字符的组合。
(Heike Jurzik,CC BY-SA 4.0)
为了操作系统的安全,必须及时安装安全更新。对于 NextcloudPi,一共有三种不同的更新:NextcloudPi 更新、Nextcloud 更新和安装的应用程序。还有底层操作系统(Raspberry Pi OS)的更新。使用NextcloudPi 界面中的菜单更新来激活有关 Nextcloud 应用程序的新版本、自动更新和手动更新的通知。
现在您有了自己的云,最好是在您自己的四堵墙内——设置到此结束。文章到这里就可以结束了。它可以,也就是说,如果没有一个更重要的话题要讨论:备份!与标准磁盘相比,Raspberry Pi 中的小型 SD 卡特别容易出现硬件故障,但也可能有其他原因导致硬件故障。NextcloudPi 包含所有必要的工具来创建自动备份并在紧急情况下恢复它们。
您可以随时通过 NextcloudPi 网络界面立即备份您的数据。为此,请从BACKUPS菜单中打开nc-backup条目。备份在外部 USB 设备上比在 SD 卡上更好——外部硬盘驱动器不仅空间更大,而且更可靠。要创建不仅包括 NextcloudPi 配置还包括 Nextcloud 数据库、Nextcloud 应用程序和用户数据(日历、联系人和其他文件)的完整备份,请激活包含数据复选框。可选择通过勾选Compress复选框来压缩数据。完整备份的替代方法是通过菜单项BACKUPS > nc-export-ncp简单地导出 NextcloudPi 配置. 这样您只保存 NextcloudPi 设置——没有 Nextcloud 数据库、它的配置和用户数据。
为了使事情变得更容易,您可以激活自动备份(BACKUPS > nc-backup-auto)。同样,是否要包含用户数据以及是否要压缩备份都取决于您。在默认设置中,NextcloudPi 在单击Apply后每 7 天创建一次完整备份。四个星期后,它会覆盖最旧的版本。手动备份和自动备份这两种方法都具有可以快速设置的优点。然而,备份可能——取决于你的 Nextcloud 中的数据量——占用大量空间,即使它们被压缩。随着数据量的增长,NextcloudPi 也需要更多时间来创建备份。这段时间云处于维护模式,无法使用。
或者,您可以通过创建和同步 Btrfs 快照来创建增量备份。这种备份方法可以节省磁盘空间,并且性能明显高于其他方法。特别是对于云中的大量数据。这种变体有一个真正的优势:在备份期间,Nextcloud 不必进入维护模式,因此没有停机时间。B-tree FS(也称为 Butter FS)是所谓的写时复制文件系统(COW),允许从正在运行的系统创建当前数据的快照。这些是创建时子体积的冻结图像。它们不需要任何额外的磁盘空间。
请注意:为此,必须将 Nextcloud 数据目录从 SD 卡(或其他数据介质)移动到具有 Btrfs 文件系统的 USB 驱动器。您可能已经在配置向导中配置了这个,否则您可以移动数据:
使用 Btrfs 文件系统格式化外部 USB 驱动器 ( TOOLS > nc-format-USB )。
将 Nextcloud 数据目录移动到外部 USB 磁盘 ( CONFIG > nc-datadir )。The NC data directory has been moved successfully您应该在下面的窗口中看到该消息。
作为测试,您现在可以在激活自动快照功能之前创建快照 ( BACKUPS > nc-snapshot )。
要自动创建快照,请从BACKUPS菜单中打开nc-snapshot-auto条目,选中Active并单击Apply。NextcloudPi 现在每小时自动为 Nextcloud 数据目录创建一个 Btrfs 快照。
新克隆的目录只会占用与自上次快照以来添加的新文件一样多的额外存储空间——因此整个过程在空间方面非常高效。您可以将快照增量发送到另一个 Btrfs 文件系统。NextcloudPi 支持您进行设置 ( BACKUPS > nc-snapshot-sync )。您可以选择另一个外部驱动器或远程计算机上的目录。这必须可以通过 SSH(无需密码)访问,并且磁盘还必须使用 Btrfs 进行格式化。
设置备份策略后,您应该始终测试是否可以使用 NextcloudPi 网络界面恢复数据。对于此处介绍的几乎所有方法,都有相应的恢复菜单项:
nc-import-ncp:导入您的 NextcloudPi 配置
nc-restore-snapshot:恢复特定的快照
nc-restore:恢复 Nextcloud 的完整备份
(Heike Jurzik,CC BY-SA 4.0)
那里有一个活跃的 Nextcloud 社区:
Nextcloud 论坛中的NextcloudPi 主题
NextcloudPi 的错误报告和功能请求
NextcloudPi 开发人员建立了一个网站,解释哪些问题最适合在何处提出。
NextcloudPi 为商业云提供商提供了一种经济高效且功能强大的替代方案。通过将其安装在 Raspberry Pi 上,您可以控制您的数据并确保隐私。由于它与 Android 和 Apple 设备兼容,因此可以轻松同步您的约会、联系人和其他数据。安装过程非常简单,可在 30 分钟内完成。通过采取必要的步骤来保护系统并实施备份和恢复方法,您可以放心地知道您的数据是安全的。
有关 NextcloudPi 的更多深入信息,您可以查看我的书Nextcloud on the Raspberry Pi:Set up your own cloud with NextcloudPi。它提供了设置和使用 NextcloudPi 的全面指南,并将帮助您充分利用您的个人云解决方案——迈出迈向数字主权的第一步!
文章原文出处:https: //opensource.com/
1678374240
Install NextcloudPi on your Raspberry Pi in less than 30 minutes, synchronize your mobile devices with your own Nextcloud, and gain total digital sovereignty and privacy.
You can now say goodbye to big commercial cloud providers and manage your appointments, contacts, and other data in your own home network. Install NextcloudPi on your Raspberry Pi in less than 30 minutes, synchronize your mobile devices with your own Nextcloud, and gain total digital sovereignty and privacy!
I remember when the first Raspberry Pi hit the market in 2012. My Linux friends and I were absolutely thrilled: a tiny computer, available for little money, but with enough computing power to be useful. It has a fully-fledged Linux system running on it, too! We started all sorts of DIY projects, set up media centers, web servers, blogs, control centers for our smart homes, and even a monitoring solution for bee hives.
Last year in December, I decided to install and run my own cloud on the Raspberry Pi. After some digging around, I settled on NextcloudPi, a ready-made instance of Nextcloud. The open source software runs not only on the Raspberry Pi, but on many other single-board computers and other operating systems.
This article shows how to install and configure NextcloudPi. I also explain how to secure the system and talk about different backup and restore methods.
In addition to this tutorial, you can check out how to synchronize data from Google Workspace and Apple iCloud with Nextcloud in my previous articles.
To run NextcloudPi on a Raspberry Pi, you need at least a Raspberry Pi 2. However, newer models like the Raspberry Pi 3, Pi 3+, and especially the Raspberry Pi 4 are much faster. At my home, I use a Raspberry Pi 3, Model B+ with a 64 Bit quad-core processor (1,4 GHz) and 1 GB of RAM. Since I don't use a graphical desktop environment, this equipment is completely sufficient for my purposes (maximum 10 users/devices).
What else do you need? Here is a checklist:
A microSD card with 8 GB minimum capacity
A computer to write the NextcloudPi image to the SD card
An Ethernet cable (NextcloudPi also works via WLAN, but a direct connection is much more stable and faster)
An optional additional external storage to store the data of your own cloud. This depends on the amount of data you have. You should choose a USB stick or an external hard drive of sufficient size
Normally, you don't need a monitor or an external keyboard. After you have flashed the NextcloudPi image onto the SD card, the rest of the setup and operation is done with a web interface. You can also access the Raspberry Pi over SSH from Linux, Windows, and macOS. You can also access it from your mobile devices.
Of course, you can always install Nextcloud on Raspberry Pi OS (formerly Raspbian) or another operating system on the mini computer. However, this means you have to install the operating system, set up a database server and a database — a complex task that scares off many beginners. The process is easier and faster with NextcloudPi. The open source project offers ready-made images for various single-board computers. It also has an installation script that allows you to set up your own cloud in no time at all.
NextcloudPi takes a lot of work off your hands. It installs and configures Nextcloud so that you can start right away. The developers have published a list of supported hardware/systems on their website. For example, Raspberry Pi (all models, there are also Berryboot images to run NextcloudPi directly from an external hard drive), Odroid, Rock64, RockPro64, Banana Pi, and so on. They also offer a container image that runs on all architectures and operating systems that run containers.
In addition to the current Nextcloud version, NextcloudPi includes a web server with a pre-configured database connection. An administration interface for the web browser is also included so that beginners can quickly find their way around. Those who prefer administration on the command-line can activate SSH access. NextcloudPi has a number of useful presets, including automatic HTTPS forwarding, HSTS (HTTP Strict-Transport-Security, a security mechanism for HTTPS connections), PHP extensions to improve performance, and more. The configuration wizard assists you with the first steps and the formatting of external USB media as well as access from outside using various Dynamic DNS services.
Nextcloud itself has a number of pre-installed apps, including a calendar, address book, dashboard, file sharing, PDF viewer, image and file management, notes and tasks, and Nextcloud Activities.
The GitHub repository contains ready-made images for the Raspberry Pi and other devices. After downloading and unpacking the zip
file, you can use the dd
command on Linux or macOS to write the image to the SD card:
sudo dd bs=4M conv=fsync if=NextCloudPi[…].img of=/dev/mmcblkXX
Replace the device name of the SD card with the correct name. Be careful to choose the correct device name, because dd
does not ask for confirmation!
Alternatively, you can use the open source program Etcher to write the image to the SD card. It runs on Linux, Windows, and macOS. Simply select the image on your hard drive (Flash from file) or enter the address of the NextcloudPi image in GitHub (Flash from URL). After that, click Select target, select the SD card, and Flash starts the writing process.
(Heike Jurzik, CC BY-SA 4.0)
Insert the prepared SD card into the slot of the Raspberry Pi, connect the Ethernet cable to a free port on your network switch or router, and connect the Raspberry Pi to the power supply to boot it. First, you need to find out the IP address of the Raspberry Pi. This is how you access both the web interface for setting up NextcloudPi and Nextcloud itself.
If you are using a router equipped with a DHCP server, you can look in the router's administration interface to see which address it has assigned to the Raspberry Pi.
Alternatively, use a network scanner like nmap
on the command-line to find out the IP.
Open a web browser and enter the IP address or hostname of your Pi. This opens the configuration wizard. By default, NextcloudPi only has a self-signed SSL/TLS certificate that hasn't been signed by a known certificate authority (CA). Most web browsers warn against such self-signed certificates. In this case, it's safe to ignore the warning, accept the risk and continue.
Next, you see the NextcloudPi Activation screen. The web interface contains information about the two accounts it has created: one for the NextcloudPi administrator and one for Nextcloud. At this point, it's a good idea to take notes or save the passwords in a password manager so you can change them later. Click on the Activate button, log in as the user ncp
along with the associated password to start the configuration wizard.
(Heike Jurzik, CC BY-SA 4.0)
The first time you navigate to your Pi in your browser, click the Run button to start the configuration wizard.
(Heike Jurzik, CC BY-SA 4.0)
Switch to the USB Configuration tab to set up an external USB device (for example, an external hard disk or a USB stick) for the Nextcloud data. If the USB medium already has a suitable file system (Ext2, Ext3, Ext4 or Btrfs), you can continue by clicking Skip. Otherwise, instruct NextcloudPi with the Format USB button to format the disk with the Btrfs file system. Caution! Formatting erases all data on medium!
In the External access tab, you can set up NextcloudPi so that the system can be accessed from outside (the internet). At this point, I recommend selecting no. You can always connect various dynamic DNS services through the NextcloudPi NETWORKING menu. After this last step, the initial setup is complete. The Finish tab offers two links to access your new Nextcloud installation and the NextcloudPi dashboard:
https://nextcloudpi.local: your Nextcloud
https://nextcloudpi.local:4443: NextcloudPi administration interface
The NextcloudPi administration interface is very intuitive. The menu bar shows the version number, a language switcher, a search function, and icons that link to your own Nextcloud installation. You can also find information about the system, access existing backups and snapshots, display an overview of the Nextcloud configuration, log files, and re-start the configuration wizard. Use the icon on the far right to shut down or restart the operating system.
In the left sidebar, there are seven menus containing essential options for managing the NextcloudPi system:
BACKUPS: (Automatic) backups, configure backup media, define a backup schedule, export and import the NextcloudPi configuration, create a snapshot of the Btrfs file system, restore existing backups
CONFIG: Display and (re)set the password for the administrator account ncp, move the Nextcloud database to an external (USB) device, move the Nextcloud data directory, force secure HTTPS connections, restart Nextcloud with a clean configuration, and configure system limits
NETWORKING: Activate NFS, SSH access, various DNS services and providers, TLS/SSL certificates with Let's Encrypt, port forwarding for access from the outside, a static IP address, trusted proxy servers, and Samba
SECURITY: Configure the firewall and the intrusion prevention system Fail2ban, and initiate a manual security check
SYSTEM: Activate the monitoring for Prometheus and automatic mounting of USB devices, check the status of external hard disks and save the system logs in RAM to protect the SD card, define the size and location of the swap space, and activate compressed RAM to improve swap performance
TOOLS: Uses various utilities for fixing permissions of Nextcloud data files, formatting USB drives (Btrfs file system) and switching Nextcloud's maintenance mode on and off
UPDATES: Enables automatic Nextcloud and NextcloudPi updates, notifications about new versions and regular updates of all installed Nextcloud apps, update the current instance to a new Nextcloud version, install NextcloudPi updates, and activate the automatic installation of security updates
You can log into your Nextcloud with the username ncp
and the password displayed in the activation window. The Nextcloud dashboard offers quick access to certain files and folders, your calendar, and your online status (Online, Away, Do not disturb, and so on). You can also select your location for a weather forecast.
All installed Nextcloud apps are listed in the top menu bar: Files, Photos, Activity, Contacts, Calendar, Notes, and so on. If you select an app, a menu in the left sidebar provides filters and tasks associated with it. In the Files app, for example, you get search functions and filters that provide quick access to your own files and folders or those shared with you. In the Contacts app, on the other hand, there is a button for creating new contacts and managing groups and circles. At the bottom left, you can access the app's settings.
All Nextcloud users can find their personal settings by clicking on the profile picture or the initials of the username in the top right corner. The administrator account ncp may also (un)install apps, manage user accounts, and perform other administrative tasks.
(Heike Jurzik, CC BY-SA 4.0)
Before you start importing your address book and calendars, it's a good idea to create a new user account without administrator privileges for your daily work. For security reasons, you should only use the ncp account when you change something in the configuration. This includes installing and updating Nextcloud apps, creating users and groups, and so on.
To create a new user, click on the icon with the N in the top right corner to open the settings and select the Users entry there. In the left sidebar, click the New user button, enter the username, first and last name, a password, and an email address. You can also add the account to an existing group. In the Default quota field, you can define how much hard disk space is granted to the user in the cloud.
Once you have Nextcloud up and running, you can synchronize your Android or Apple devices. You can read about how to do that in my previous articles, Switch from Google Workspace to Nextcloud and Switch from iCloud to Nextcloud.
Even if you operate Nextcloud in the local network only and no services are accessible from the outside, it's vital to consider additional security measures. Here are some suggestions:
Activate SSH access: To enable SSH access for the Raspberry Pi, go to NETWORKING > SSH in the NextcloudPi web interface. Click the Active checkbox and enter a password for the pi account. Finally, click Apply to start the SSH service on the Raspberry Pi. By default, the password raspberry is set up for the user pi. You must change it to something different. After your first login through SSH, the system prompts you to change this password as well!
Set up a Firewall: You can activate the firewall in the Security > UFW section. The Uncomplicated Firewall (UFW) is a frontend for the powerful but quite complex Netfilter firewall Iptables. The NextcloudPi developers simplify the setup by entering the three essential ports in the web interface that UFW should allow: 80 (HTTP), 443 (HTTPS), and 22 (SSH). Click Active and then Apply to start the firewall. In the dialogue window you can see messages from the operating system about added rules.
Fail2ban: If you only use Nextcloud on your home network, you can do without the setup. If, on the other hand, Nextcloud is accessible from the Internet, then set up this additional protective measure via SECURITY / fail2ban. Fail2ban secures services against DoS attacks. For this purpose, the program blocks IP addresses after a certain number of failed connection attempts — first temporarily and then permanently.
TLS/SSL Certificates: By default, NextcloudPi includes self-signed SSL/TLS certificates.This can lead to a warning. In the case of NextcloudPi in your local network, the warning is merely a technicality and you can define an exception for the respective web browser. Alternatively, you can generate valid TLS/SSL certificates with the Let's Encrypt certification authority (or set up your own Certification Authority).
Enable 2FA for Nextcloud: You can activate the two-factor authentication (2FA) through the menu Administration > Security. In the security section of the Nextcloud app catalog, there are numerous apps that set up a second factor for logging in — provided by an app or as hardware (with a YubiKey, for example). If you have enabled two-factor authentication, set up an app password under Personal > Security. You can use this password for authentication in the Apple or Android devices so that the synchronization of contacts and calendars succeeds. For security reasons, the password is only displayed once.
Password Policies: You can also set up password policies for Nextcloud in Administration > Security. For example, you can define a minimum password length, the number of days until a user password expires, and the number of login attempts before an account gets blocked. Additionally, you can forbid common passwords and enforce combinations of upper and lower case, numeric, and special characters.
(Heike Jurzik, CC BY-SA 4.0)
For the security of an operating system, it is essential to install security updates promptly. For NextcloudPi, there are a total of three different updates: NextcloudPi updates, Nextcloud updates, and the apps installed. There are also updates for the underlying operating system (Raspberry Pi OS). Use the menu Updates in the NextcloudPi interface to activate notifications about new versions, automatic updates, and manual updates of Nextcloud apps.
Now that you have your own cloud, ideally within your own four walls — that's the end of the setup. The article could end right here. It could, that is, if there weren't one more essential topic to discuss: backups! The small SD cards in the Raspberry Pi are particularly prone to hardware defects compared to standard disks, but there can also be other reasons for hardware failure. NextcloudPi contains all the necessary tools to create automated backups and restore them in an emergency.
You can immediately back up your data at any time via the NextcloudPi web interface. To do this, open the nc-backup entry from the BACKUPS menu. The backups are better off on an external USB device than on the SD card — an external hard drive not only has more space but is also more reliable. To create a full backup that includes not only the NextcloudPi configuration but also the Nextcloud database, the Nextcloud apps and the users' data (calendar, contacts, and other files), activate the Include data checkbox. Optionally compress the data by ticking the checkbox Compress. An alternative to the full backup is to simply export the NextcloudPi configuration via the menu entry BACKUPS > nc-export-ncp. This way you only save the NextcloudPi settings — without the Nextcloud database, its configuration, and user data.
To make things easier, you can activate automatic backups (BACKUPS > nc-backup-auto). Again, it's up to you whether you want to include the users' data and whether you want to compress the backups. In the default settings, NextcloudPi creates a full backup every seven days after clicking Apply. After four weeks, it overwrites the oldest version. Both methods, the manual backup and the automatic backup, have the advantage that they can be set up quickly. However, the backups can — depending on the amount of data in your Nextcloud — take up a large amount of space, even if they are compressed. As the amount of data grows, NextcloudPi also needs more time to create the backups. The cloud is in maintenance mode during this time and cannot be used.
As an alternative, you can create incremental backups by creating and synchronizing Btrfs snapshots. This backup method saves disk space and is significantly more performant than the other approaches. Especially for large amounts of data in the cloud. This variant has a real advantage: during the backup, Nextcloud does not have to be put into maintenance mode, so there is no downtime. The B-tree FS (also called Butter FS) is a so-called Copy-On-Write file system (COW) and allows snapshots of the current data to be created from the running system. These are frozen images of a subvolume at the time of creation. They do not require any additional disk space.
Please note: To do this, the Nextcloud data directory must be moved from the SD card (or another data medium) to a USB drive with a Btrfs file system. You may have already configured this in the configuration wizard, otherwise you can move the data:
Format the external USB drive with the Btrfs file system (TOOLS > nc-format-USB).
Move the Nextcloud data directory to the external USB disk (CONFIG > nc-datadir). You should see the message The NC data directory has been moved successfully
in the window below.
As a test, you can now create a snapshot (BACKUPS > nc-snapshot) before activating the automatic snapshots feature.
To create the snapshots automatically, open the nc-snapshot-auto entry from the BACKUPS menu, check Active and click Apply. NextcloudPi now automatically creates a Btrfs snapshot of the Nextcloud data directory every hour.
The newly cloned directories only ever take up as much additional storage space as new files have been added since the last snapshot — so the whole thing is extremely efficient in terms of space. You can incrementally send the snapshots to another Btrfs file system. NextcloudPi supports you with the setup (BACKUPS > nc-snapshot-sync). You can choose either another external drive or a directory on a remote computer. This must be accessible over SSH (without a password) and the disk must also be formatted with Btrfs.
After you have set up your backup strategy, you should always test whether you can restore your data with the NextcloudPi web interface. For almost all methods presented here, there is a corresponding menu item for recovery:
nc-import-ncp: import your NextcloudPi configuration
nc-restore-snapshot: restore a specific snapshot
nc-restore: restore a full backup of your Nextcloud
(Heike Jurzik, CC BY-SA 4.0)
There is an active Nextcloud community out there:
NextcloudPi topics in the Nextcloud forum
Bug reports and feature requests for NextcloudPi
The NextcloudPi developers have put together a website explaining which questions are best asked where.
NextcloudPi offers a cost-effective and robust alternative to commercial cloud providers. By installing it on a Raspberry Pi, you can have control over your data and ensure privacy. With its compatibility with Android and Apple devices, it makes it easy to synchronize your appointments, contacts, and other data. The installation process is straightforward and can be completed in under 30 minutes. By taking the necessary steps to secure the system and implementing backup and restore methods, you can have peace of mind knowing your data is safe.
For more in-depth information on NextcloudPi, you can check out my book Nextcloud on the Raspberry Pi: Set up your own cloud with NextcloudPi. It provides a comprehensive guide to setting up and using NextcloudPi, and will help you get the most out of your personal cloud solution — take the first step towards digital sovereignty!
Original article source at: https://opensource.com/
1677939720
A trivia vending machine made with a Raspberry Pi
As an educator working at a public library, I keep my eyes peeled for interesting uses of the Raspberry Pi. From where I sit, the Trivia Vending Machine project out of Dallas, Texas, is one of the most creative and interesting uses of these amazing devices. Using a Raspberry Pi to replace the coin box on a food vending machine is a stroke of genius by Greg Needel and his team. The potential uses of this idea are far-reaching. Check out this short YouTube video to see the Trivia Vending Machine in action.
The original Trivia Vending Machine focused on science questions, but you could build a Trivia Vending Machine with any questions—history, civics, literature, and so on. The most engaging uses will be if you encourage students to write their own questions—and answer each others' questions. And consider this: Instead of disbursing food, the vending machine could disburse coupons to local businesses. One way I earn a living is by teaching guitar lessons, and I'd gladly donate a guitar lesson as a coupon for a Trivia Vending Machine. However, a student must rack up a suitable amount of points to earn one of my guitar lessons.
Stretch your imagination a little further. Would it be possible to have logic puzzles for students to solve to get food (or coupons) from the vending machine? Yes, that would not be difficult to create. Maybe Sudoku puzzles, Wordle, KenKen, Sokoban, or any other puzzle. Students could play these puzzles with a touch screen. How about chess? Sure, students could solve chess puzzles to get food (or coupons).
Did you notice in the video that the original Trivia Vending Machine is large and heavy? Designing a smaller one—perhaps one-third the size that fits on a rolling cart—could make for easier transport between schools, libraries, museums, and maker faires.
The inside of a Trivia Vending Machine is composed of stepper motors. You can buy these used on the web. A web search for "used vending machine motors" turns up the Vending World and the VendMedic websites.
If you are a member of a makerspace, tell your fellow members about the Trivia Vending Machine. It's an open invention, not patented, so anyone can build it. (Thank you, Greg Needel.) I imagine the coding for such a device is not too difficult. It would be lovely if someone could create a GitHub repository of such code—and maybe some accompanying explanatory screencasts.
Although the Trivia Vending Machine did not win an award in the Red Bull Creations contest, this invention is still award-worthy. Someone should track down Greg Needel and give him a suitable prize. What should that award look like? It might look like $25k or $50k. I say three cheers for Greg Needel and his creative team. They took the Raspberry Pi in the direction that the inventors of this computer intended—a tinkerer's delight. Bold and beautiful. Bold, beautiful, and open. Could you ask for anything more?
One last thing. The Trivia Vending Machine was created several years ago with an early Raspberry Pi model. Current Raspberry Pi computers are much faster and more responsive. So, any lags in the interaction you notice in the above-mentioned video no longer exist on today's Raspberry Pi models.
Oh, I want one of those candy bars so bad. I'm smacking my lips together. Remind me; how many points do I need to earn to get a Snickers bar? Whatever it takes. I'll do whatever it takes.
Original article source at: https://opensource.com/
1677861780
This academic experiment using Raspberry Pi clusters introduces parallel and distributed computing (PDC) concepts to distance learning students.
Since the Raspberry Pi's launch, creators have based countless computer science education projects on the humble pocket-sized system on a chip. These have included many projects exploring low-cost Raspberry Pi clusters to introduce parallel and distributed computing (PDC) concepts.
The UK Open University (OU) provides distance education to students of diverse ages, experiences, and backgrounds, which raises some issues not faced in more traditional universities. The OU experiment using Raspberry Pi clusters to introduce PDC concepts to distance learning students began in 2019 and has been featured in an academic paper but deserves to be known more widely.
The project uses Raspberry Pi clusters based on the OctaPi instructions, released under a Creative Commons Licence by GCHQ. Eight Raspberry Pis are connected in a private network using a router and a switch. One of the Raspberry Pis acts as the lead, while the others are servers providing results back to the lead device. Programs written in Python run on the lead Pi, and the dispy
package distributes activities across cores in the cluster.
Three programs have been developed for the clusters, and you can download them from the Git repository.
Two of the programs are text-based and linked to search problems: The traveling salesperson and password hashing. As complete search problems, these are ideal for teaching PDC concepts. The third program is graphical. The image combiner takes three images as input, with non-overlapping obstructions. It constructs an image without any obstructions by comparing the RGBA values pixel-by-pixel across the three images and selecting the median.
The Open University is a distance learning institution, so students access the clusters through a web interface. Remote access to the clusters uses the OpenSTEM Labs infrastructure at the university. Ten clusters (eight built with Pi 4, two built with Pi 3B+) are installed into racks, with webcams pointed at each cluster.
The students select which program to run, the number of cores to use, and the parameters for the selected program. As output, they see the time the program takes to run on an individual Raspberry Pi compared to the cluster using the number of cores selected. The student also sees the output from the program, either the password hashing result, the minimal and maximal traveling salesperson route, or the non-occluded image.
(Peter Cheer, CC BY-SA 4.0)
A webcam shows a live stream of the cluster. The lead Pi has an LED display to show the program's state as it runs. The webcam makes it clear to students that they are experimenting with real dedicated hardware rather than getting simulated or pre-recorded results.
(Peter Cheer, CC BY-SA 4.0)
Each program has two activities associated with it, illustrating different aspects of program design and PDC operations. One of the main learning points is that PDC computing can provide significant performance advantages but at a cost in the time and resources taken to divide and distribute a problem and, in reverse, to recombine the results. The second learning point is that efficiency is significantly affected by the program design.
Currently, the use of the Raspberry Pi clusters is optional. Based on the findings so far, though, students enjoy it and are motivated by having remote access to physical hardware.
One student has said, "It was really interesting to be able to use real clusters instead of having it virtualized."
Another adds, "It was really exciting to be able to actually see a cluster working and see the real effects of working with multiple cores. It was great to be able to try this out for myself, not just to read the theory about it!"
Students are using the clusters to undertake learning activities designed to teach the principles of PDC rather than writing and running their own programs. The experience of developing a low-cost Raspberry Pi cluster for use with open-distance university students demonstrates the benefits remote practical activities can have for teaching PDC concepts and engaging students.
When I asked Daniel Gooch, one of the team members behind the project, about it, he said: "For me, where we differ is that we've taken an existing set of Raspberry Pi instructions and worked on integrating in additional wrap-around material to ensure it can cope with the distance and scale we operate on."
Original article source at: https://opensource.com/
1677759133
Stream live video from webcams with a Raspberry Pi and restream videos to social networks.
There are various reasons to stream live video transmissions from webcams. The Raspberry Pi platform is perfect for such applications. It requires little power for continuous applications such as live-streaming servers. Communication with a Raspicam camera module, USB cam, or other network video signals is possible. The system is an RTMP, HLS, and SRT server. This article shows how to set up the Raspberry Pi as a streaming server to use HLS streaming. You need a video source to use it as a streaming server.
Even without a Raspberry Pi, you can do the steps described here. In addition, there are further installation instructions for Windows, Linux, and macOS available.
The application is datarhei Restreamer, a graphical user interface for the datarhei Core. The datarhei Core runs the well-known media framework FFmpeg under the hood. The easiest way to start with datarhei Restreamer is to install the official Docker container. The download and installation of the program via Docker Hub are automatic with the pull
command. Restreamer starts immediately after the installation. If you don't have a Raspberry Pi, use one of the other Docker containers on the datarhei Restreamer GitHub page (e.g., AMD64 or GPU Cuda support).
datarhei Restreamer and datarhei Core are both open source software under the Apache License 2.0.
Here's the command for an installation on a Raspberry Pi 3 and above with GPU support:
docker run -d --restart=always --name restreamer \
-v /opt/restreamer/config:/core/config -v /opt/restreamer/data:/core/data \
--privileged \
-p 8080:8080 -p 8181:8181 \
-p 1935:1935 -p 1936:1936 \
-p 6000:6000/udp \
datarhei/restreamer:rpi-latest
Regardless of which command you use, you only need the --privileged
option to access local devices, like a USB camera.
After installation, connect the Raspberry Pi to the local network. Then open the web-based GUI in a browser by navigating to http://device-ip:8181/ui.
You should see the following screen:
(Sven Erbeck, CC BY-SA 4.0)
Assign the password, and the system is ready for the first login. A wizard is starting to configure the first video source.
Hint: The above Docker command permanently stores the configuration data with the login name and password in the /opt/restreamer/config
folder.
The application consists of three logical parts: Video input, system dashboard, and video output. The video input and output run independently of each other.
The wizard will help you to create a video source right from the start. This can be a USB video source, the Raspberry Pi camera, or a network source like an IP cam or an m3u8 file from a network. HLS, RTMP, and real-time SRT protocol are ready to use. The wizard helps to configure the video resolution and sound correctly. In the last step, you can assign different licenses from Creative Commons. It is worth taking a look at the video signal settings. You will find several options, like transcoding or rotating the video for vertical video platforms.
After successfully creating the video signal, you will land in the dashboard.
(Sven Erbeck, CC BY-SA 4.0)
It is the central starting point for all other settings. To see the program's full functionality, you can switch to expert mode in system preferences.
The dashboard contains the following:
There are different ways to play the video signal.
The publication website is the simplest, immediately-ready, and internally hosted landing page by Restreamer. The player page can also transmit to Chromecast and AirPlay. Basic settings like adjusting the background image and adding a logo in the player are possible directly in the Restreamer. Those who know HTML can customize the page for themselves. Advanced users can inject code to use the site with external modules like a chat. A statistics module under the video player shows the active viewers and all views. The Share button supports the distribution of the live stream. HTTPS certificates for the website are active with Let's Encrypt without much effort. With a simple port forwarding for HTTPS to the LAN IP of the Raspberry Pi, the website is publicly accessible.
(Sven Erbeck, CC BY-SA 4.0)
The publication services are a great way to restream content. There are numerous ready-made modules for popular websites like YouTube, Twitch, or PeerTube. Likewise, for other streaming software, to popular CDNs. Complete control over the video protocols allows streaming to all RTMP, HLS, and SRT-capable destination addresses. An HTML snippet code with the video player works on web pages.
(Sven Erbeck, CC BY-SA 4.0)
This article shows how to turn the Raspberry Pi into a streaming server. The Raspberry Pi platform allows you to interact with various video signals in a power-saving way. The pre-settings make it easy to configure the server, and advanced users can make some adjustments to the system. You can use it for restreaming, hosting for live-streaming on a website, or integration into system landscapes with OBS. Using different video sources and transport protocols offer great flexibility as a basis for a project and make this system highly customizable. Furthermore, the datarhei Core with FFmpeg makes it easy for software developers to extend all application processes.
The program turns the Raspberry Pi into a dedicated streaming server. Depending on your internet upload, you can live stream to websites or multi-stream to different video networks independently and without an additional video provider.
Test a fully functional demo before installation on the project website with the login name admin and password demo.
Original article source at: https://opensource.com/
1677487440
Take your data out of the hands of proprietary corporations and into your own hands with open source solutions.
Back in the old days, there was no cloud. Everything was on your phone. Maybe you had a microSD card that you backed up everything on. Eventually, the SD card would stop working, and you lost everything unless you'd saved it on a writable CD or DVD or stored it on your PC. Self-hosting was tough in those days, and it was expensive. Software wasn't as accessible as it is now.
Today, it's common for phones not to have an SD card slot. The good news is that software is good enough that you can back up everything you own on a single Raspberry Pi, spare laptop, or mini-PC.
You can own your own data and data stack by self-hosting. Containers and personal cloud software make it possible. In this article, I share several of my favorite ways to make that happen.
A container is software consisting of everything required for an application to work. Each container acts as its own computer and doesn't affect other containers or software on your host server. With this technology, you can keep your software up to date without breaking your system. It also allows you to control where data is stored, making backing up your data easy.
Learning to use containers can be intimidating. I started with Docker, although many other container engines exist, including Podman and Istio. It didn't take long for me to get the hang of it. I found that containers make self-hosting services easier than ever. If you're familiar with installing applications on the Linux terminal, you'll get the hang of it quickly.
One of the easiest ways to back up your data is through Syncthing. This open source software synchronizes data across different devices. Select the folder you want to exist on two (or more) devices, and then that data and any changes to it are reliably kept updated on each device.
This isn't just a convenient way to share data; it's also a backup scheme. Should one hard drive go down, you have a copy of your important data on another device. Once you restore the broken PC, you can reconnect with Syncthing, and it synchronizes everything you lost. Syncthing is useful for storing data on multiple devices in different locations, including on machines outside your house (at a friend or family member's home, for instance). It's also a great off-site backup tool.
Nextcloud is an open source alternative to Google Drive or Dropbox. It's also multi-user, so once you install Nextcloud, you can set up distinct logins for each user. There are a variety of Nextcloud apps for phones and PCs. You can auto-synchronize your photos and then view photos from the app or a web browser. You can mark files public to share them with the rest of the internet.
Similar to Syncthing, a client can also synchronize files between your server and your desktop or laptop. Nextcloud also has components to let you manage contacts and calendars, and of course, you can synchronize them between other devices.
In fact, you can install many kinds of apps on Nextcloud, including programs to store notes, manage email, chat with others, and more. The Nextcloud environment includes an "app store" of open source applications.
If you're interested in managing your own media server, then you're in luck. Jellyfin takes your media, like movies, TV shows, and music, and makes them available to any device you allow access. You can use Jellyfin to scrape the web for metadata, automatically retrieving cover art and media information.
Jellyfin also works without the internet. When your internet goes out and you can't connect to your favorite streaming service, you can use your local network to connect to your Jellyfin server and watch or listen to your media. I have had this happen, and I can attest that it's a great way to keep yourself and your family entertained.
These are just a few services you can install on any Linux PC or laptop. You need a server that's always on to ensure your services are constantly available. That doesn't necessitate a major investment, though. You can use many kinds of computers as Linux servers. The easiest and most inexpensive is a Raspberry Pi, which has excellent support with a helpful and enthusiastic community.
Getting a Raspberry Pi set up is "as easy as pie," thanks to the Raspberry Pi imager. It only needs about 5W of power, so it doesn't take much energy to keep it running. There are many similar low-powered devices, including the Odroid, Orange Pi, and Rockpi.
You can also install Linux on any PC or laptop and run it as a server. It's a great way to repurpose old computers.
Finally, you could use a Virtual Private Server (VPS). A VPS is a "slice" of space on a server located in a big data center. You pay rent on the server space and maintain it as you wish.
When you put data on the cloud, it can be used without your control or consent. It may even be used without your knowledge. I don't foresee that issue improving.
We don't need private companies handling our data anymore. You can often replace corporate services to reduce the amount of data you're giving away.
In my opinion, we should all own our data, and we need to do it correctly, with open source. We can host services for personal use and for family and friends. I synchronize my calendar and contacts with my personal server (a Raspberry Pi in my home). I think it's worth fighting for, and there's no better time than right now.
Original article source at: https://opensource.com/
1676557140
This tutorial explains how to install and configure an FTP server on Raspberry Pi that you use to share files between your devices. We’ll use vsftpd, which a stable, secure, and fast FTP server. We will also show you how to configure vsftpd to restrict users to their home directory and encrypt the entire transmission with SSL/TLS.
For this project, you should have Raspbian installed on your Raspberry Pi . Running an FTP server doesn’t require a graphical interface, so our recommendation is to use the Raspbian Lite image and enable SSH .
The vsftpd package is available in the standard Raspbian repositories. To install it, run the following commands:
sudo apt update
sudo apt install vsftpd
The ftp service will automatically start after the installation process is complete. To verify it, print the service status:
sudo systemctl status vsftpd
The output will look something like below, showing that the vsftpd service is active and running:
vsftpd.service - vsftpd FTP server
Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-10-21 19:00:41 BST; 9s ago
...
The vsftpd server can be configured by editing the /etc/vsftpd.conf
file.
Most of the settings are well documented inside the configuration file. For all available options, visit the official vsftpd page.
Start by opening the vsftpd configuration file:
sudo nano /etc/vsftpd.conf
To ensure that only the local users can access the FTP server, search for the anonymous_enable
and local_enable
directives and verify your configuration match to lines below:
/etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
Locate and uncomment the write_enable
directive to allow changes to the filesystem, such as uploading and removing files.
/etc/vsftpd.conf
write_enable=YES
To prevent the FTP users from accessing files outside of their home directories, uncomment the chroot
directive.
/etc/vsftpd.conf
chroot_local_user=YES
When the chroot feature is active, vsftpd will refuse to upload files if the directory that the users are locked in is writable.
Use one of the solutions below to make the chroot environment writable:
Method 1. - The recommended option to allow upload is to keep chroot enabled and configure FTP directories. In this example, we will create an ftp
directory inside the user home, which will serve as the chroot and a writable uploads
directory for uploading files.
/etc/vsftpd.conf
user_sub_token=$USER
local_root=/home/$USER/ftp
Method 2. - Another option is to add the following directive in the vsftpd configuration file. Use this option if you must to grant writable access to your user to its home directory.
/etc/vsftpd.conf
allow_writeable_chroot=YES
By default, vsftpd uses active mode. To use passive mode, set the minimum and maximum range of ports:
/etc/vsftpd.conf
pasv_min_port=30000
pasv_max_port=31000
vsftpd can use any port for passive FTP connections. When the passive mode is enabled, the FTP client opens a connection to the server on a random port in the range you have chosen.
You can configure vsftpd to permit only certain users to log in. To do so, add the following lines at the end of the file:
/etc/vsftpd.conf
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO
When this feature is enabled, you need to explicitly specify which users can log in by adding the user names to the /etc/vsftpd.user_list
file (one user per line).
To encrypt the FTP transmissions with SSL/TLS, you’ll need to have an SSL certificate and configure the FTP server to use it.
You can use an existing SSL certificate signed by a trusted Certificate Authority or create a self-signed certificate.
If you have a domain or subdomain pointing to the FTP server’s IP address, you can easily generate a free Let’s Encrypt SSL certificate.
In this tutorial, we will generate a self-signed SSL certificate using the openssl
command.
Run the following command to create a 2048-bit private key and self signed certificate valid for 10 years. Both the private key and the certificate will be saved in a same file:
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem
Once the files are created, open the configuration file:
sudo nano /etc/vsftpd.conf
Find the rsa_cert_file
and rsa_private_key_file
directives, change their values to the pam
file path and set the ssl_enable
directive to YES
:
/etc/vsftpd.conf
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
If not specified otherwise, the FTP server will use only TLS to make secure connections.
Once you are done configuring the server, the vsftpd configuration file (excluding comments) should look something like this:
/etc/vsftpd.conf
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_min_port=30000
pasv_max_port=31000
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
Save the file and restart the vsftpd service for changes to take effect:
sudo systemctl restart vsftpd
If you are running a UFW firewall , you’ll need to allow FTP traffic.
To open port 21
(FTP command port), port 20
(FTP data port), and 30000-31000
(Passive ports range), run the following commands:
sudo ufw allow 20:21/tcp
sudo ufw allow 30000:31000/tcp
Reload the UFW rules by disabling and re-enabling UFW:
sudo ufw disable
sudo ufw enable
To test the FTP server, we will create a new user.
allow_writeable_chroot=YES
in your configuration file, skip the 3rd step.Create a new user named newftpuser
:
sudo adduser newftpuser
When prompted, set the user password.
Add the user to the allowed FTP users list:
echo "newftpuser" | sudo tee -a /etc/vsftpd.user_list
Create the FTP directory tree and set the correct permissions :
sudo mkdir -p /home/newftpuser/ftp/upload
sudo chmod 550 /home/newftpuser/ftp
sudo chmod 750 /home/newftpuser/ftp/upload
sudo chown -R newftpuser: /home/newftpuser/ftp
As discussed in the previous section, the user will be able to upload files to the ftp/upload
directory.
At this point, your FTP server is fully functional, and you should be able to connect to your server using any FTP client such as FileZilla .
By default, when creating a user, if not explicitly specified the user will have SSH access to the device. To disable shell access, create a new shell that will simply print a message telling the user that their account is limited to FTP access only.
Create the /bin/ftponly
shell and make it executable:
echo -e '#!/bin/sh\necho "This account is limited to FTP access only."' | sudo tee -a /bin/ftponly
sudo chmod a+x /bin/ftponly
Append the new shell to the list of valid shells in the /etc/shells
file:
echo "/bin/ftponly" | sudo tee -a /etc/shells
Change the user shell to /bin/ftponly
:
sudo usermod newftpuser -s /bin/ftponly
Use the same command to change the shell of all users you want to give only FTP access.
We’ve shown you how to install and configure a secure and fast FTP server on your Raspberry Pi system.
If you have any questions or feedback, feel free to leave a comment.
Original article source at: https://linuxize.com/
1676152680
openFrameworks is a C++ toolkit for creative coding. If you are new to OF, welcome!
This release of OF comes with several folders:
docs
has some documentation around OF usage, per platform things to consider, etc. You should definitely take a look in there; for example, if you are on OSX, read the osx.md. apps
and examples
are where projects go -- examples
contains a variety of projects that show you how to use OF, and apps
is where your own projects will go. libs
contains the libraries that OF uses, including the openframeworks core itself. addons
are for additional functionality that's not part of the core. export
is for DLLs and dylibs that need to be put in each compiled project. The scripts
folder has the templates and small scripts for automating OF per platform. project generator
is a GUI based tool for making new projects - this folder is only there in packaged releases.
One idea that's important is that OF releases are designed to be self-contained. You can put them anywhere on your hard drive, but it's not possible to mix different releases of OF together, so please keep each release (0.8.0, 0.8.1) separate. Projects may generally work from release to release, but this is not guaranteed. Because OF is self-contained, there's extensive use of local file paths (ie, ../../../) throughout OF. It's important to be aware of how directories are structured. A common error is to take a project and move it so that it's a level below or above where it used to be compared to the root of OF. This means that links such as ../../../libs will break.
The openframeworks forum:
http://forum.openframeworks.cc/
is a warm and friendly place. Please ask or answer a question. The most important part of this project is that it's a community, more than just a tool, so please join us! Also, this is free software, and we learn so much about what is hard, what doesn't make sense, what is useful, etc. The most basic questions are acceptable here! Don't worry, just join the conversation. Learning in OF is social, it's hard to do it alone, but together we can get far!
Our GitHub site is active:
https://github.com/openframeworks/openFrameworks
if you have bugs or feature requests, consider opening an issue. If you are a developer and want to help, pull requests are warmly welcome. Please read the contributing guide for guidelines:
https://github.com/openframeworks/openFrameworks/blob/master/CONTRIBUTING.md
We also have a developer's mailing list, which is useful for discussing issues around the development and future of OF.
To grab a copy of openFrameworks for your platform, check the download page on the main site.
If you are working with the Git repository, the stable
branch of the OF repository corresponds to the most recent release, with a few important differences:
apps/projectGenerator/
.If you want to work with the openFrameworks GitHub repository, you need to download the external dependencies and you should use the project generator to create project files for all the code in examples/
. To generate the project files with the project generator enable the 'Advanced Options' in the settings tab, then use 'Update Multiple' to update the projects for the examples/
folder path in the repo.
To set up the project generator submodule within the OF repo, use the command git submodule init
then git submodule update
whilst inside the openFrameworks repo.
For more info on working with the Project Generator, for per-platform readmes, and more information, see the documentation.
openFrameworks uses Semantic Versioning, although strict adherence will only come into effect at version 1.0.0.
Platform | Master branch | Stable branch |
---|---|---|
Windows MSYS2 | ||
Windows Visual Studio | ||
Linux 64 & Arm | ||
Emscripten | ||
macos | ||
iOS & tvOS | ||
Android Arm7 |
Author: openframeworks
Source Code: https://github.com/openframeworks/openFrameworks
License: View license
1676136540
raylib is highly inspired by Borland BGI graphics lib and by XNA framework and it's specially well suited for prototyping, tooling, graphical applications, embedded systems and education.
NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.
This is a basic raylib example, it creates a window and it draws the text "Congrats! You created your first window!"
in the middle of the screen. Check this example running live on web here.
#include "raylib.h"
int main(void)
{
InitWindow(800, 450, "raylib [core] example - basic window");
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}
raylib binary releases for Windows, Linux, macOS, Android and HTML5 are available at the Github Releases page.
raylib is also available via multiple package managers on multiple OS distributions.
raylib Wiki contains detailed instructions on building and usage on multiple platforms.
Note that the Wiki is open for edit, if you find some issues while building raylib for your target platform, feel free to edit the Wiki or open an issue related to it.
raylib has been developed on Windows platform using Notepad++ and MinGW GCC compiler but it can be used with other IDEs on multiple platforms.
Projects directory contains several ready-to-use project templates to build raylib and code examples with multiple IDEs.
Note that there are lots of IDEs supported, some of the provided templates could require some review, so please, if you find some issue with a template or you think they could be improved, feel free to send a PR or open a related issue.
raylib is designed to be learned using the examples as the main reference. There is no standard API documentation but there is a cheatsheet containing all the functions available on the library a short description of each one of them, input parameters and result value names should be intuitive enough to understand how each function works.
Some additional documentation about raylib design can be found in raylib GitHub Wiki. Here are the relevant links:
raylib is present in several networks and raylib community is growing everyday. If you are using raylib and enjoying it, feel free to join us in any of these networks. The most active network is our Discord server! :)
Ready to learn? Jump to code examples!
Author: raysan5
Source Code: https://github.com/raysan5/raylib
License: Zlib license