Download mods for a Steam game from the Steam Workshop
++steamcmd "+login $USERID" $(for i in $MODLIST; do echo "+download_item $APPID $i"; done) ++
From a2e3bec40f5851be70299e7513967a0f5d042bf9 Mon Sep 17 00:00:00 2001
From: Ivan Davydov First, set up FT on your OpenWrt devices. Then, change the mode of your Keenetic (?) devices to Extender (there are Repeater/Extender and Access Point/Extender, the last is the recommended). Go to the Scroll below to the "Roaming for wireless devices" section. Enable "Fast transition (802.11r)" and write your mobility domain ID converted to the ASCII format. You can use an online converter like this one: https://www.rapidtables.com/convert/number/hex-to-ascii.html. Keep the "Mobility domain key" field unedited. Press the "Save" button. Now you have a so-called "Wi-Fi system" with use of both KeeneticOS and OpenWrt! Вот оно:
+
+ Или в виде файла: 18164.patch.backport-24.10.1.
+Готовые сборки тоже доступны в виде файлов: openwrt-kn-1221-24.10 Debian 12 с последними обновлениями и доступом в Интернет Prosody >= 0.13 PAM (Pluggable Authentication Modules) - API для авторизации в Unix-подобных ОС, по умолчанию использует список пользователей из файла `/etc/passwd`. Все команды выполняются пользователем Выполните эти команды: Начните редактировать файл Найдите строку, начинающуюся с слова Где Дальше найдите строку Теперь перейдите к строке Перейдите к строке, начинающейся с По желанию в строке Найдите строку, начинающуюся с Если вам нужны многопользовательские переписки, на следующей строке добавьте следущее: Последнюю строку можете опустить, если вам не нужно сохранение истории многопользовательских переписок. Если нужна возможность загружать файлы на ваш сервер, дополните конфигурацию следующими строками: В данном случае, лимит размера файла - это 512 МиБ (0,5 ГиБ), а удаляться файлы будут через ~1000 лет.
+Если требуется изменить какое-либо из этих свойств, смотрите комментарии (в Lua они начинаются с двух дефисов) и пробуйте изменять значения. Также заменяйте `example.net` на ваше доменное имя. ACME (Automatic Certificate Management Environment) - это протокол для получения TLS-сертификатов по Web.
+В этом примере используется ACME-клиент acme.sh, так как эта программа более настраиваемая и удостоверяющий центр (далее УЦ) Let's Encrypt (но вы можете использовать любой другой). Выполните следующие команды: В завершении статьи хочется обратить ваше внимание на то, что данная инструкция предоставляется БЕЗ каких-либо гарантий. Если при выполнении указаний из данной инструкции случилось что-то непредвиденное, вы можете обратиться ко мне, но не стоит ожидать какого-либо результата. Debian 12 с последними обновлениями и доступом в Интернет Prosody >= 0.13 PAM (Pluggable Authentication Modules) - API для авторизации в Unix-подобных ОС, по умолчанию использует список пользователей из файла `/etc/passwd`. Все команды выполняются пользователем Выполните эти команды: Начните редактировать файл Найдите строку, начинающуюся с слова Где Дальше найдите строку Теперь перейдите к строке Перейдите к строке, начинающейся с По желанию в строке Найдите строку, начинающуюся с Если вам нужны многопользовательские переписки, на следующей строке добавьте следущее: Последнюю строку можете опустить, если вам не нужно сохранение истории многопользовательских переписок. Если нужна возможность загружать файлы на ваш сервер, дополните конфигурацию следующими строками: В данном случае, лимит размера файла - это 512 МиБ (0,5 ГиБ), а удаляться файлы будут через ~1000 лет.
+Если требуется изменить какое-либо из этих свойств, смотрите комментарии (в Lua они начинаются с двух дефисов) и пробуйте изменять значения. Также заменяйте `example.net` на ваше доменное имя. ACME (Automatic Certificate Management Environment) - это протокол для получения TLS-сертификатов по Web.
+В этом примере используется ACME-клиент acme.sh, так как эта программа более настраиваемая и удостоверяющий центр (далее УЦ) Let's Encrypt (но вы можете использовать любой другой). Выполните следующие команды: В завершении статьи хочется обратить ваше внимание на то, что данная инструкция предоставляется БЕЗ каких-либо гарантий. Если при выполнении указаний из данной инструкции случилось что-то непредвиденное, вы можете обратиться ко мне, но не стоит ожидать какого-либо результата. Вот оно:
+
+ Или в виде файла: 18164.patch.backport-24.10.1.
+Готовые сборки тоже доступны в виде файлов: openwrt-kn-1221-24.10 First, set up FT on your OpenWrt devices. Then, change the mode of your Keenetic (?) devices to Extender (there are Repeater/Extender and Access Point/Extender, the last is the recommended). Go to the Scroll below to the "Roaming for wireless devices" section. Enable "Fast transition (802.11r)" and write your mobility domain ID converted to the ASCII format. You can use an online converter like this one: https://www.rapidtables.com/convert/number/hex-to-ascii.html. Keep the "Mobility domain key" field unedited. Press the "Save" button. Now you have a so-called "Wi-Fi system" with use of both KeeneticOS and OpenWrt! First, set up FT on your OpenWrt devices. Then, change the mode of your Keenetic (?) devices to Extender (there are Repeater/Extender and Access Point/Extender, the last is the recommended). Go to the Scroll below to the "Roaming for wireless devices" section. Enable "Fast transition (802.11r)" and write your mobility domain ID converted to the ASCII format. You can use an online converter like this one: https://www.rapidtables.com/convert/number/hex-to-ascii.html. Keep the "Mobility domain key" field unedited. Press the "Save" button. Now you have a so-called "Wi-Fi system" with use of both KeeneticOS and OpenWrt! Debian 12 с последними обновлениями и доступом в Интернет Prosody >= 0.13 PAM (Pluggable Authentication Modules) - API для авторизации в Unix-подобных ОС, по умолчанию использует список пользователей из файла `/etc/passwd`. Все команды выполняются пользователем Выполните эти команды: Начните редактировать файл Найдите строку, начинающуюся с слова Где Дальше найдите строку Теперь перейдите к строке Перейдите к строке, начинающейся с По желанию в строке Найдите строку, начинающуюся с Если вам нужны многопользовательские переписки, на следующей строке добавьте следущее: Последнюю строку можете опустить, если вам не нужно сохранение истории многопользовательских переписок. Если нужна возможность загружать файлы на ваш сервер, дополните конфигурацию следующими строками: В данном случае, лимит размера файла - это 512 МиБ (0,5 ГиБ), а удаляться файлы будут через ~1000 лет.
+Если требуется изменить какое-либо из этих свойств, смотрите комментарии (в Lua они начинаются с двух дефисов) и пробуйте изменять значения. Также заменяйте `example.net` на ваше доменное имя. ACME (Automatic Certificate Management Environment) - это протокол для получения TLS-сертификатов по Web.
+В этом примере используется ACME-клиент acme.sh, так как эта программа более настраиваемая и удостоверяющий центр (далее УЦ) Let's Encrypt (но вы можете использовать любой другой). Выполните следующие команды: В завершении статьи хочется обратить ваше внимание на то, что данная инструкция предоставляется БЕЗ каких-либо гарантий. Если при выполнении указаний из данной инструкции случилось что-то непредвиденное, вы можете обратиться ко мне, но не стоит ожидать какого-либо результата.Fast Transition (Wi-Fi Roaming) with OpenWrt and KeeneticOS
+
+tested to not work on KeeneticOS v3.8.7 & OpenWrt v23.05.5
+
+Access Point/Extender (Repeater/Extender) > Home segment
menu. Change the settings of the Wi-Fi network to those ones in OpenWrt.OpenWrt 24.10.1 - исправление, добавляющее поддержку Keenetic Launcher (KN-1221)
+
+
+From ef20327e33fb38220ba0bca4418464749305e555 Mon Sep 17 00:00:00 2001
+From: Ivan Davydov
+
+Pubnix - Установка Prosody с PAM-авторизацией
+
+Использованные источники
+
+
+
+
+0. Системные требования
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0,5. Авторизация при помощи ОС
+root
, если не указано иначе.1. Установка
+
+# Установить Prosody
+wget https://prosody.im/files/prosody.sources -O/etc/apt/sources.list.d/prosody.sources
+apt update
+apt install prosody lua5.4 liblua5.4-0 liblua5.4-dev luarocks
+# Добавить привилегии демону Prosody
+usermod -aG shadow prosody
+usermod -aG ssl-cert prosody
+# Установить библиотеку для взаимодействия с POSIX-функциями
+luarocks install luaposix
+# Собрать библиотеку дл/ PAM-аутентификации
+git clone https://github.com/devurandom/lua-pam && cd lua-pam
+make LUA_VERSION=5.4
+cp pam.so /usr/lib/
+# Установить модуль для PAM-аутентификации
+LUA_INCDIR=5.4 prosodyctl install --server=https://modules.prosody.im/rocks/ mod_auth_pam
+
+
+2. Настройка
+/etc/prosody/prosody.cfg.lua
.
+Следуйте этим инструкциям, заменяя example.net
на доменное имя, привязанное к вашему серверу.admins
, и добавьте ваше будущее имя пользователя в фигурные скобки подобным образом:
+admins = { "admin@example.net" }
+
+
+admin
- это ваше имя пользователя в вашей системе.--"mam";
и удалите два дефиса, сделайте то же самое с строкой --"turn_external";
, находящейся ниже.authentication = "internal_hashed"
и замените internal_hashed
на pam
.storage
и поменяйте sql
на internal
(по желанию, в этой инструкции я не рассматриваю настройку с базами данных)archive_expires_after = "1w"
замените 1w
на never
, чтобы истории переписок не удалялись каждую неделю.VirtualHost
и замените localhost
на example.net
.
+Component "conference.example.net" "muc"
+modules_enabled = { "muc_mam", "vcard_muc" }
+
+
+
+Component "upload.example.net" "http_file_share"
+http_file_share_size_limit = 512 * 1024 * 1024 --измеряется в байтах
+http_file_share_expire_after = 60 * 60 * 24 * 31 * 1000 --измеряется в секундах
+
+
+3. Настройка TLS-сертификата
+
+# Эта команда установит acme.sh в директорию ~/.acme.sh, системные
+# файлы не будут затронуты
+wget -O - https://get.acme.sh | sh -s \
+ email=yourveryownlocalpart@example.net
+# Теперь либо перезайдите в систему, либо выполните `exec $0`, если
+# вы уверены в значении переменной `$0`.
+
+# Проверьте, прошла ли установка правильно
+acme.sh -h
+
+# Установить Let's Encrypt в качестве УЦ
+acme.sh --set-default-ca --server \
+ https://acme-v02.api.letsencrypt.org/directory
+
+# Есть два способа подтверждения владения доменом - по HTTP или по
+# DNS.
+# Первый проще, но требует доступ на запись в директорию, содержимое
+# которой доступно по ссылке http://example.net/:
+acme.sh --issue -d example.net -d conference.example.net -d \
+ upload.example.net -w <директория с корнем вашего
+ веб-сервера>
+# А второй, поддерживая Wildcard-сертификаты, позволяет в дальнейшем
+# подключать к вашему XMPP-серверу всевозможные компоненты
+# (транспорты в другие сети, модуль публикации-подписки, он же
+# Publish-Subscribe или просто PubSub и многие другие), но требует
+# доступа к API вашего DNS-регистратора для создания записи,
+# подтверждающей владение доменным именем:
+acme.sh --issue --dnssleep <время в секундах, большее чем TTL> \
+ --dns dns_myapi \
+ -d example.net -d '*.example.net' # Где dns_myapi - это кодовое
+ # имя DNS-провайдера, указанное на
+ # https://github.com/acmesh-official/acme.sh/wiki/dnsapi
+# Но если у вас нет и веб-сервера (или доступа к нему), и доступа к
+# API регистратора, то вы можете внести запись с подтверждением
+# вручную (заметьте, что вам нужно будет это делать каждый раз, когда
+# будет истекать срок действия сертификата):
+# (Перед применением этого способа следует внимательно прочитать
+# следующую страницу:
+# https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode)
+acme.sh --issue --dns -d example.net -d '*.example.net'
+# Теперь примените DNS-запись, выведенную на экран командой выше, и
+# подождите до её распространения. После выполните следующее:
+acme.sh --renew -d example.net -d '*.example.net'
+
+# Почти готово. Теперь осталось установить сертификат:
+mkdir /etc/ssl/private/example.net
+chown root:ssl-cert /etc/ssl/private/example.net
+chmod 750 /etc/ssl/private/example.net
+acme.sh --install-cert \
+ -d example.net -d '*.example.net' \
+ --ca-file /etc/ssl/private/example.net/chain.pem \
+ --cert-file /etc/ssl/private/example.net/cert.pem \
+ --fullchain-file /etc/ssl/private/example.net/fullchain.pem \
+ --key-file /etc/ssl/private/example.net/privkey.pem \
+ --reloadcmd "prosodyctl --root cert import \
+ /etc/ssl/private/example.net"
+
+
+Смотрите также
+
+
+
+
+
+
+Download mods for a Steam game from the Steam Workshop
+
+
+steamcmd "+login $USERID" $(for i in $MODLIST; do echo "+download_item $APPID $i"; done)
+
diff --git a/input/rss.conf b/input/rss.conf
new file mode 100644
index 0000000..64f64b5
--- /dev/null
+++ b/input/rss.conf
@@ -0,0 +1,5 @@
+editor: lotigara@lotigara.ru (lotigara)
+title: Журнал @ веб-сайте самохостера Lotigara
+description:
+language: ru-ru
+copyright: (c) Ivan Davydov 2024-2025. Делайте с этим документом всё, что хотите!
diff --git a/public/_/imgs/test b/public/_/imgs/test
new file mode 100644
index 0000000..d6a2d5c
--- /dev/null
+++ b/public/_/imgs/test
@@ -0,0 +1 @@
+Foo.
diff --git a/public/_/script.js b/public/_/script.js
new file mode 100644
index 0000000..05b3b3a
--- /dev/null
+++ b/public/_/script.js
@@ -0,0 +1,14 @@
+(function(){
+var q = document.querySelector.bind(document);
+var qa = document.querySelectorAll.bind(document);
+window.lib = {};
+lib.elems = {};
+lib.isListPage = !!q('.posts');
+lib.isArticle = !lib.isListPage;
+if (lib.isListPage) {
+lib.elems.posts = [].slice.call(qa('.post'));
+lib.elems.postsContainer = q('.posts');
+} else {
+lib.elems.post = q('.post');
+}
+})();
diff --git a/public/_/style.css b/public/_/style.css
new file mode 100644
index 0000000..3cff5f6
--- /dev/null
+++ b/public/_/style.css
@@ -0,0 +1,80 @@
+@media (max-width: 1199px) and (min-width: 401px) {
+ body {
+ font-size: 32pt;
+ }
+
+ div.content_section_text p::first-letter,div.content::first-letter {
+ font-size: 37pt;
+ }
+
+ /* https://css-tricks.com/responsive-data-tables/ */
+
+ /*
+ * Force table to not be like tables anymore
+ */
+ table, thead, tbody, th, td, tr {
+ display: block;
+ }
+
+ /*
+ * Hide table headers (but not display: none;, for accessibility)
+ */
+ thead tr {
+ position: absolute;
+ top: -9999%;
+ left: -9999%;
+ }
+
+ td {
+ /* Behave like a "row" */
+ border: none;
+ position: relative;
+ padding-left: 50%;
+ }
+
+ td::before {
+ /* Now like a table header */
+ position: absolute;
+ /* Top/left values mimic padding */
+ top: 6px;
+ left: 6px;
+ width: 45%;
+ padding-right: 10px;
+ white-space: nowrap;
+ }
+}
+
+@media only screen and (orientation: landscape)
+and (min-width: 992px)
+and (max-width: 1199px) {
+ body {
+ font-size: 14pt;
+ }
+}
+@media only screen and (orientation: landscape)
+and (min-width: 768px)
+and (max-width: 991px) {
+ body {
+ font-size: 14pt;
+ }
+}
+@media only screen and (orientation: landscape)
+and (min-width: 480px)
+and (max-width: 767px) {
+ body {
+ font-size: 11pt;
+ }
+}
+@media only screen and (orientation: landscape)
+and (max-width: 479px) {
+ body {
+ font-size: 8pt;
+ }
+}
+@media only screen and (orientation: landscape)
+and (min-device-width : 375px)
+and (max-device-width : 667px) {
+ body {
+ font-size: 9.5pt;
+ }
+}
diff --git a/public/blog/0/index.html b/public/blog/0/index.html
new file mode 100644
index 0000000..2bda186
--- /dev/null
+++ b/public/blog/0/index.html
@@ -0,0 +1,598 @@
+
+
+
+
+
+
+ Веб-сайт самохостера Lotigara
+
+Download mods for a Steam game from the Steam Workshop
+
+steamcmd "+login $USERID" $(for i in $MODLIST; do echo "+download_item $APPID $i"; done)
+
+ Pubnix - Установка Prosody с PAM-авторизацией
+ Использованные источники
+
+
+
+
+0. Системные требования
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0,5. Авторизация при помощи ОС
+root
, если не указано иначе.1. Установка
+
+# Установить Prosody
+wget https://prosody.im/files/prosody.sources -O/etc/apt/sources.list.d/prosody.sources
+apt update
+apt install prosody lua5.4 liblua5.4-0 liblua5.4-dev luarocks
+# Добавить привилегии демону Prosody
+usermod -aG shadow prosody
+usermod -aG ssl-cert prosody
+# Установить библиотеку для взаимодействия с POSIX-функциями
+luarocks install luaposix
+# Собрать библиотеку дл/ PAM-аутентификации
+git clone https://github.com/devurandom/lua-pam && cd lua-pam
+make LUA_VERSION=5.4
+cp pam.so /usr/lib/
+# Установить модуль для PAM-аутентификации
+LUA_INCDIR=5.4 prosodyctl install --server=https://modules.prosody.im/rocks/ mod_auth_pam
+
+
+2. Настройка
+/etc/prosody/prosody.cfg.lua
.
+Следуйте этим инструкциям, заменяя example.net
на доменное имя, привязанное к вашему серверу.admins
, и добавьте ваше будущее имя пользователя в фигурные скобки подобным образом:
+admins = { "admin@example.net" }
+
+
+admin
- это ваше имя пользователя в вашей системе.--"mam";
и удалите два дефиса, сделайте то же самое с строкой --"turn_external";
, находящейся ниже.authentication = "internal_hashed"
и замените internal_hashed
на pam
.storage
и поменяйте sql
на internal
(по желанию, в этой инструкции я не рассматриваю настройку с базами данных)archive_expires_after = "1w"
замените 1w
на never
, чтобы истории переписок не удалялись каждую неделю.VirtualHost
и замените localhost
на example.net
.
+Component "conference.example.net" "muc"
+modules_enabled = { "muc_mam", "vcard_muc" }
+
+
+
+Component "upload.example.net" "http_file_share"
+http_file_share_size_limit = 512 * 1024 * 1024 --измеряется в байтах
+http_file_share_expire_after = 60 * 60 * 24 * 31 * 1000 --измеряется в секундах
+
+
+3. Настройка TLS-сертификата
+
+# Эта команда установит acme.sh в директорию ~/.acme.sh, системные
+# файлы не будут затронуты
+wget -O - https://get.acme.sh | sh -s \
+ email=yourveryownlocalpart@example.net
+# Теперь либо перезайдите в систему, либо выполните `exec $0`, если
+# вы уверены в значении переменной `$0`.
+
+# Проверьте, прошла ли установка правильно
+acme.sh -h
+
+# Установить Let's Encrypt в качестве УЦ
+acme.sh --set-default-ca --server \
+ https://acme-v02.api.letsencrypt.org/directory
+
+# Есть два способа подтверждения владения доменом - по HTTP или по
+# DNS.
+# Первый проще, но требует доступ на запись в директорию, содержимое
+# которой доступно по ссылке http://example.net/:
+acme.sh --issue -d example.net -d conference.example.net -d \
+ upload.example.net -w <директория с корнем вашего
+ веб-сервера>
+# А второй, поддерживая Wildcard-сертификаты, позволяет в дальнейшем
+# подключать к вашему XMPP-серверу всевозможные компоненты
+# (транспорты в другие сети, модуль публикации-подписки, он же
+# Publish-Subscribe или просто PubSub и многие другие), но требует
+# доступа к API вашего DNS-регистратора для создания записи,
+# подтверждающей владение доменным именем:
+acme.sh --issue --dnssleep <время в секундах, большее чем TTL> \
+ --dns dns_myapi \
+ -d example.net -d '*.example.net' # Где dns_myapi - это кодовое
+ # имя DNS-провайдера, указанное на
+ # https://github.com/acmesh-official/acme.sh/wiki/dnsapi
+# Но если у вас нет и веб-сервера (или доступа к нему), и доступа к
+# API регистратора, то вы можете внести запись с подтверждением
+# вручную (заметьте, что вам нужно будет это делать каждый раз, когда
+# будет истекать срок действия сертификата):
+# (Перед применением этого способа следует внимательно прочитать
+# следующую страницу:
+# https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode)
+acme.sh --issue --dns -d example.net -d '*.example.net'
+# Теперь примените DNS-запись, выведенную на экран командой выше, и
+# подождите до её распространения. После выполните следующее:
+acme.sh --renew -d example.net -d '*.example.net'
+
+# Почти готово. Теперь осталось установить сертификат:
+mkdir /etc/ssl/private/example.net
+chown root:ssl-cert /etc/ssl/private/example.net
+chmod 750 /etc/ssl/private/example.net
+acme.sh --install-cert \
+ -d example.net -d '*.example.net' \
+ --ca-file /etc/ssl/private/example.net/chain.pem \
+ --cert-file /etc/ssl/private/example.net/cert.pem \
+ --fullchain-file /etc/ssl/private/example.net/fullchain.pem \
+ --key-file /etc/ssl/private/example.net/privkey.pem \
+ --reloadcmd "prosodyctl --root cert import \
+ /etc/ssl/private/example.net"
+
+
+Смотрите также
+
+
+
+
+
+
+OpenWrt 24.10.1 - исправление, добавляющее поддержку Keenetic Launcher (KN-1221)
+
+From ef20327e33fb38220ba0bca4418464749305e555 Mon Sep 17 00:00:00 2001
+From: Ivan Davydov
+
+Fast Transition (Wi-Fi Roaming) with OpenWrt and KeeneticOS
+ tested to not work on KeeneticOS v3.8.7 & OpenWrt v23.05.5
+
+Access Point/Extender (Repeater/Extender) > Home segment
menu. Change the settings of the Wi-Fi network to those ones in OpenWrt.Веб-сайт самохостера Lotigara
+
+Download mods for a Steam game from the Steam Workshop
+
+steamcmd "+login $USERID" $(for i in $MODLIST; do echo "+download_item $APPID $i"; done)
+
+ Веб-сайт самохостера Lotigara
+
+Fast Transition (Wi-Fi Roaming) with OpenWrt and KeeneticOS
+ tested to not work on KeeneticOS v3.8.7 & OpenWrt v23.05.5
+
+Access Point/Extender (Repeater/Extender) > Home segment
menu. Change the settings of the Wi-Fi network to those ones in OpenWrt.
+
+
+0. Системные требования
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0,5. Авторизация при помощи ОС
+root
, если не указано иначе.1. Установка
+
+# Установить Prosody
+wget https://prosody.im/files/prosody.sources -O/etc/apt/sources.list.d/prosody.sources
+apt update
+apt install prosody lua5.4 liblua5.4-0 liblua5.4-dev luarocks
+# Добавить привилегии демону Prosody
+usermod -aG shadow prosody
+usermod -aG ssl-cert prosody
+# Установить библиотеку для взаимодействия с POSIX-функциями
+luarocks install luaposix
+# Собрать библиотеку дл/ PAM-аутентификации
+git clone https://github.com/devurandom/lua-pam && cd lua-pam
+make LUA_VERSION=5.4
+cp pam.so /usr/lib/
+# Установить модуль для PAM-аутентификации
+LUA_INCDIR=5.4 prosodyctl install --server=https://modules.prosody.im/rocks/ mod_auth_pam
+
+
+2. Настройка
+/etc/prosody/prosody.cfg.lua
.
+Следуйте этим инструкциям, заменяя example.net
на доменное имя, привязанное к вашему серверу.admins
, и добавьте ваше будущее имя пользователя в фигурные скобки подобным образом:
+admins = { "admin@example.net" }
+
+
+admin
- это ваше имя пользователя в вашей системе.--"mam";
и удалите два дефиса, сделайте то же самое с строкой --"turn_external";
, находящейся ниже.authentication = "internal_hashed"
и замените internal_hashed
на pam
.storage
и поменяйте sql
на internal
(по желанию, в этой инструкции я не рассматриваю настройку с базами данных)archive_expires_after = "1w"
замените 1w
на never
, чтобы истории переписок не удалялись каждую неделю.VirtualHost
и замените localhost
на example.net
.
+Component "conference.example.net" "muc"
+modules_enabled = { "muc_mam", "vcard_muc" }
+
+
+
+Component "upload.example.net" "http_file_share"
+http_file_share_size_limit = 512 * 1024 * 1024 --измеряется в байтах
+http_file_share_expire_after = 60 * 60 * 24 * 31 * 1000 --измеряется в секундах
+
+
+3. Настройка TLS-сертификата
+
+# Эта команда установит acme.sh в директорию ~/.acme.sh, системные
+# файлы не будут затронуты
+wget -O - https://get.acme.sh | sh -s \
+ email=yourveryownlocalpart@example.net
+# Теперь либо перезайдите в систему, либо выполните `exec $0`, если
+# вы уверены в значении переменной `$0`.
+
+# Проверьте, прошла ли установка правильно
+acme.sh -h
+
+# Установить Let's Encrypt в качестве УЦ
+acme.sh --set-default-ca --server \
+ https://acme-v02.api.letsencrypt.org/directory
+
+# Есть два способа подтверждения владения доменом - по HTTP или по
+# DNS.
+# Первый проще, но требует доступ на запись в директорию, содержимое
+# которой доступно по ссылке http://example.net/:
+acme.sh --issue -d example.net -d conference.example.net -d \
+ upload.example.net -w <директория с корнем вашего
+ веб-сервера>
+# А второй, поддерживая Wildcard-сертификаты, позволяет в дальнейшем
+# подключать к вашему XMPP-серверу всевозможные компоненты
+# (транспорты в другие сети, модуль публикации-подписки, он же
+# Publish-Subscribe или просто PubSub и многие другие), но требует
+# доступа к API вашего DNS-регистратора для создания записи,
+# подтверждающей владение доменным именем:
+acme.sh --issue --dnssleep <время в секундах, большее чем TTL> \
+ --dns dns_myapi \
+ -d example.net -d '*.example.net' # Где dns_myapi - это кодовое
+ # имя DNS-провайдера, указанное на
+ # https://github.com/acmesh-official/acme.sh/wiki/dnsapi
+# Но если у вас нет и веб-сервера (или доступа к нему), и доступа к
+# API регистратора, то вы можете внести запись с подтверждением
+# вручную (заметьте, что вам нужно будет это делать каждый раз, когда
+# будет истекать срок действия сертификата):
+# (Перед применением этого способа следует внимательно прочитать
+# следующую страницу:
+# https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode)
+acme.sh --issue --dns -d example.net -d '*.example.net'
+# Теперь примените DNS-запись, выведенную на экран командой выше, и
+# подождите до её распространения. После выполните следующее:
+acme.sh --renew -d example.net -d '*.example.net'
+
+# Почти готово. Теперь осталось установить сертификат:
+mkdir /etc/ssl/private/example.net
+chown root:ssl-cert /etc/ssl/private/example.net
+chmod 750 /etc/ssl/private/example.net
+acme.sh --install-cert \
+ -d example.net -d '*.example.net' \
+ --ca-file /etc/ssl/private/example.net/chain.pem \
+ --cert-file /etc/ssl/private/example.net/cert.pem \
+ --fullchain-file /etc/ssl/private/example.net/fullchain.pem \
+ --key-file /etc/ssl/private/example.net/privkey.pem \
+ --reloadcmd "prosodyctl --root cert import \
+ /etc/ssl/private/example.net"
+
+
+Смотрите также
+
+
+
+
+
+
+
+From ef20327e33fb38220ba0bca4418464749305e555 Mon Sep 17 00:00:00 2001 +From: Ivan Davydov+ ++Date: Tue, 4 Mar 2025 23:54:13 +0300 +Subject: [PATCH] ramips: mt76x8: add support for Keenetic Launcher (KN-1221) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specification: +SoC: MediaTek MT7628AN +RAM: 128M DDR2, ESMT M14D128168A (2Y) +Flash: 32M, cFeon EN25QH256A (Dual Boot on OEM, concatenated on OpenWrt, +SPI) +Switch: MediaTek MT7628AN, 3 ports 100 Mbps +WiFi: MediaTek MT7628AN 2.4 GHz 802.11n +USB: 1 port USB 2.0 +GPIO: 1 button (Wi-Fi & Reset on OEM, Reset on OpenWrt), 3 LEDs (Power, +Internet, Wi-Fi), USB port power controls + +Disassembly: +There are 2 screws at the bottom near the LEDs hidden by rubber mounts. +After removing the screws, pry the gray plastic part around (it is secured +with latches) and remove it. + +UART Interface: +The UART interface can be connected to the 5 pin located between LAN +ports and the WAN one. +Pins (from the second LAN port to the WAN one): VCC, TX, RX, NC, GND +Settings: 115200, 8N1 + +Flashing via TFTP: +1. Connect your PC and router to the first LAN port, configure PC +interface using IP 192.168.1.2, mask 255.255.255.0 +2. Serve the firmware image (for OpenWrt it is *-squashfs-factory.bin) +renamed to KN-1221_recovery.bin via TFTP +3. Power up the router while pressing Wi-Fi button +4. Release Wi-Fi button when Power LED starts blinking + +To revert back to OEM firmware: +The return to the OEM firmware is carried out by using the methods +described above with the help of the appropriate firmware image found on +osvault.keenetic.net. + +When using OEM bootloader, the firmware image size cannot exceed the size +of one OEM «Firmware_x» partition or Kernel + rootFS size. + +Signed-off-by: Ivan Davydov +Link: https://github.com/openwrt/openwrt/pull/18164 +Signed-off-by: Hauke Mehrtens +--- + .../ramips/dts/mt7628an_keenetic_kn-1221.dts | 209 ++++++++++++++++++ + target/linux/ramips/image/mt76x8.mk | 12 + + .../mt76x8/base-files/etc/board.d/01_leds | 1 + + .../mt76x8/base-files/etc/board.d/02_network | 5 + + 4 files changed, 227 insertions(+) + create mode 100644 target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts + +diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +new file mode 100644 +index 00000000000000..6f5cf96856ed21 +--- /dev/null ++++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +@@ -0,0 +1,209 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "mt7628an.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ compatible = "keenetic,kn-1221", "mediatek,mt7628an-soc"; ++ model = "Keenetic KN-1221"; ++ ++ aliases { ++ label-mac-device = ðernet; ++ ++ led-boot = &led_power; ++ led-failsafe = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_power; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ regulator-usb { ++ compatible = "regulator-fixed"; ++ regulator-name = "USB-power"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_power: power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio 38 GPIO_ACTIVE_LOW>; ++ }; ++ ++ fn { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&gpio 4 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "restart"; ++ gpios = <&gpio 37 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++ ++ virtual_flash { ++ compatible = "mtd-concat"; ++ devices = <&firmware1 &firmware2>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "denx,uimage"; ++ label = "firmware"; ++ reg = <0x0 0x1cc0000>; ++ }; ++ }; ++ }; ++}; ++ ++&state_default { ++ gpio { ++ groups = "i2c", "spi cs1", "gpio", "refclk", "wdt"; ++ function = "gpio"; ++ }; ++}; ++ ++&spi0 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <32000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x30000>; ++ read-only; ++ }; ++ ++ partition@30000 { ++ label = "u-config"; ++ reg = <0x30000 0x10000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "rf-eeprom"; ++ reg = <0x40000 0x10000>; ++ read-only; ++ ++ nvmem-layout { ++ compatible = "fixed-layout"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ eeprom_factory_0: eeprom@0 { ++ reg = <0x0 0x400>; ++ }; ++ ++ macaddr_factory_4: macaddr@4 { ++ reg = <0x4 0x6>; ++ }; ++ }; ++ }; ++ ++ firmware1: partition@50000 { ++ label = "firmware_1"; ++ reg = <0x50000 0xe60000>; ++ }; ++ ++ partition@eb0000 { ++ label = "config_1"; ++ reg = <0xeb0000 0x40000>; ++ read-only; ++ }; ++ ++ partition@ef0000 { ++ label = "storage"; ++ reg = <0xef0000 0x100000>; ++ read-only; ++ }; ++ ++ partition@ff0000 { ++ label = "dump"; ++ reg = <0xff0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1000000 { ++ label = "u-state"; ++ reg = <0x1000000 0x30000>; ++ read-only; ++ }; ++ ++ partition@1030000 { ++ label = "u-config_res"; ++ reg = <0x1030000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1040000 { ++ label = "rf-eeprom_res"; ++ reg = <0x1040000 0x10000>; ++ read-only; ++ }; ++ ++ firmware2: partition@1050000 { ++ label = "firmware_2"; ++ reg = <0x1050000 0xe60000>; ++ }; ++ ++ partition@1eb0000 { ++ label = "Config_2"; ++ reg = <0x1eb0000 0x40000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++ðernet { ++ nvmem-cells = <&macaddr_factory_4>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&esw { ++ mediatek,portmap = <0x3e>; ++ mediatek,portdisable = <0x38>; ++}; ++ ++&wmac { ++ status = "okay"; ++ ++ nvmem-cells = <&eeprom_factory_0>; ++ nvmem-cell-names = "eeprom"; ++}; +diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk +index 8c8cfee23b6cfa..f442148d9ecf10 100644 +--- a/target/linux/ramips/image/mt76x8.mk ++++ b/target/linux/ramips/image/mt76x8.mk +@@ -366,6 +366,18 @@ define Device/jotale_js76x8-32m + endef + TARGET_DEVICES += jotale_js76x8-32m + ++define Device/keenetic_kn-1221 ++ BLOCKSIZE := 64k ++ IMAGE_SIZE := 29440k ++ DEVICE_VENDOR := Keenetic ++ DEVICE_MODEL := KN-1221 ++ DEVICE_PACKAGES := kmod-usb2 ++ IMAGES += factory.bin ++ IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ ++ check-size 14720k | zyimage -d 0x801221 -v "KN-1221" ++endef ++TARGET_DEVICES += keenetic_kn-1221 ++ + define Device/keenetic_kn-1613 + IMAGE_SIZE := 31488k + DEVICE_VENDOR := Keenetic +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +index b87062ae3c5ae5..79f78a2a459487 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +@@ -58,4 +58,5 @@ hiwifi,hc5661a|\ + hiwifi,hc5761a) + ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10" + ;; ++keenetic,kn-1221|\ + keenetic,kn-1613) +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +index fbdc7fb5a2697a..6e6e1310d3495f 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +@@ -131,5 +131,9 @@ ramips_setup_interfaces() + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "6@eth0" + ;; ++ keenetic,kn-1221) ++ ucidef_add_switch "switch0" \ ++ "1:lan" "2:lan" "0:wan" "6@eth0" ++ ;; + keenetic,kn-1613|\ + motorola,mwr03) +@@ -280,5 +280,6 @@ ramips_setup_macs() + totolink,lr1200) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; ++ keenetic,kn-1221|\ + keenetic,kn-1613|\ + zyxel,keenetic-extra-ii) +
+
+ +Или в виде файла: 18164.patch.backport-24.10.1. +Готовые сборки тоже доступны в виде файлов: openwrt-kn-1221-24.10
+]]> +First, set up FT on your OpenWrt devices.
+ +Then, change the mode of your Keenetic (?) devices to Extender (there are Repeater/Extender and Access Point/Extender, the last is the recommended).
+ +Go to the Access Point/Extender (Repeater/Extender) > Home segment
menu. Change the settings of the Wi-Fi network to those ones in OpenWrt.
Scroll below to the "Roaming for wireless devices" section. Enable "Fast transition (802.11r)" and write your mobility domain ID converted to the ASCII format.
+ +You can use an online converter like this one: https://www.rapidtables.com/convert/number/hex-to-ascii.html. Keep the "Mobility domain key" field unedited.
+ +Press the "Save" button. Now you have a so-called "Wi-Fi system" with use of both KeeneticOS and OpenWrt!
+]]>+steamcmd "+login $USERID" $(for i in $MODLIST; do echo "+download_item $APPID $i"; done) ++
Debian 12 с последними обновлениями и доступом в Интернет
Prosody >= 0.13
PAM (Pluggable Authentication Modules) - API для авторизации в Unix-подобных ОС, по умолчанию использует список пользователей из файла `/etc/passwd`.
+ +Все команды выполняются пользователем root
, если не указано иначе.
Выполните эти команды:
+ ++# Установить Prosody +wget https://prosody.im/files/prosody.sources -O/etc/apt/sources.list.d/prosody.sources +apt update +apt install prosody lua5.4 liblua5.4-0 liblua5.4-dev luarocks +# Добавить привилегии демону Prosody +usermod -aG shadow prosody +usermod -aG ssl-cert prosody +# Установить библиотеку для взаимодействия с POSIX-функциями +luarocks install luaposix +# Собрать библиотеку дл/ PAM-аутентификации +git clone https://github.com/devurandom/lua-pam && cd lua-pam +make LUA_VERSION=5.4 +cp pam.so /usr/lib/ +# Установить модуль для PAM-аутентификации +LUA_INCDIR=5.4 prosodyctl install --server=https://modules.prosody.im/rocks/ mod_auth_pam ++ +
Начните редактировать файл /etc/prosody/prosody.cfg.lua
.
+Следуйте этим инструкциям, заменяя example.net
на доменное имя, привязанное к вашему серверу.
Найдите строку, начинающуюся с слова admins
, и добавьте ваше будущее имя пользователя в фигурные скобки подобным образом:
+admins = { "admin@example.net" } ++ +
Где admin
- это ваше имя пользователя в вашей системе.
Дальше найдите строку --"mam";
и удалите два дефиса, сделайте то же самое с строкой --"turn_external";
, находящейся ниже.
Теперь перейдите к строке authentication = "internal_hashed"
и замените internal_hashed
на pam
.
Перейдите к строке, начинающейся с storage
и поменяйте sql
на internal
(по желанию, в этой инструкции я не рассматриваю настройку с базами данных)
По желанию в строке archive_expires_after = "1w"
замените 1w
на never
, чтобы истории переписок не удалялись каждую неделю.
Найдите строку, начинающуюся с VirtualHost
и замените localhost
на example.net
.
Если вам нужны многопользовательские переписки, на следующей строке добавьте следущее:
+ ++Component "conference.example.net" "muc" +modules_enabled = { "muc_mam", "vcard_muc" } ++ +
Последнюю строку можете опустить, если вам не нужно сохранение истории многопользовательских переписок.
+ +Если нужна возможность загружать файлы на ваш сервер, дополните конфигурацию следующими строками:
+ ++Component "upload.example.net" "http_file_share" +http_file_share_size_limit = 512 * 1024 * 1024 --измеряется в байтах +http_file_share_expire_after = 60 * 60 * 24 * 31 * 1000 --измеряется в секундах ++ +
В данном случае, лимит размера файла - это 512 МиБ (0,5 ГиБ), а удаляться файлы будут через ~1000 лет. +Если требуется изменить какое-либо из этих свойств, смотрите комментарии (в Lua они начинаются с двух дефисов) и пробуйте изменять значения.
+ +Также заменяйте `example.net` на ваше доменное имя.
+ +ACME (Automatic Certificate Management Environment) - это протокол для получения TLS-сертификатов по Web. +В этом примере используется ACME-клиент acme.sh, так как эта программа более настраиваемая и удостоверяющий центр (далее УЦ) Let's Encrypt (но вы можете использовать любой другой).
+ +Выполните следующие команды:
++# Эта команда установит acme.sh в директорию ~/.acme.sh, системные +# файлы не будут затронуты +wget -O - https://get.acme.sh | sh -s \ + email=yourveryownlocalpart@example.net +# Теперь либо перезайдите в систему, либо выполните `exec $0`, если +# вы уверены в значении переменной `$0`. + +# Проверьте, прошла ли установка правильно +acme.sh -h + +# Установить Let's Encrypt в качестве УЦ +acme.sh --set-default-ca --server \ + https://acme-v02.api.letsencrypt.org/directory + +# Есть два способа подтверждения владения доменом - по HTTP или по +# DNS. +# Первый проще, но требует доступ на запись в директорию, содержимое +# которой доступно по ссылке http://example.net/: +acme.sh --issue -d example.net -d conference.example.net -d \ + upload.example.net -w <директория с корнем вашего + веб-сервера> +# А второй, поддерживая Wildcard-сертификаты, позволяет в дальнейшем +# подключать к вашему XMPP-серверу всевозможные компоненты +# (транспорты в другие сети, модуль публикации-подписки, он же +# Publish-Subscribe или просто PubSub и многие другие), но требует +# доступа к API вашего DNS-регистратора для создания записи, +# подтверждающей владение доменным именем: +acme.sh --issue --dnssleep <время в секундах, большее чем TTL> \ + --dns dns_myapi \ + -d example.net -d '*.example.net' # Где dns_myapi - это кодовое + # имя DNS-провайдера, указанное на + # https://github.com/acmesh-official/acme.sh/wiki/dnsapi +# Но если у вас нет и веб-сервера (или доступа к нему), и доступа к +# API регистратора, то вы можете внести запись с подтверждением +# вручную (заметьте, что вам нужно будет это делать каждый раз, когда +# будет истекать срок действия сертификата): +# (Перед применением этого способа следует внимательно прочитать +# следующую страницу: +# https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode) +acme.sh --issue --dns -d example.net -d '*.example.net' +# Теперь примените DNS-запись, выведенную на экран командой выше, и +# подождите до её распространения. После выполните следующее: +acme.sh --renew -d example.net -d '*.example.net' + +# Почти готово. Теперь осталось установить сертификат: +mkdir /etc/ssl/private/example.net +chown root:ssl-cert /etc/ssl/private/example.net +chmod 750 /etc/ssl/private/example.net +acme.sh --install-cert \ + -d example.net -d '*.example.net' \ + --ca-file /etc/ssl/private/example.net/chain.pem \ + --cert-file /etc/ssl/private/example.net/cert.pem \ + --fullchain-file /etc/ssl/private/example.net/fullchain.pem \ + --key-file /etc/ssl/private/example.net/privkey.pem \ + --reloadcmd "prosodyctl --root cert import \ + /etc/ssl/private/example.net" ++ +
В завершении статьи хочется обратить ваше внимание на то, что данная инструкция предоставляется БЕЗ каких-либо гарантий. Если при выполнении указаний из данной инструкции случилось что-то непредвиденное, вы можете обратиться ко мне, но не стоит ожидать какого-либо результата.
+Вот оно:
+
+From ef20327e33fb38220ba0bca4418464749305e555 Mon Sep 17 00:00:00 2001 +From: Ivan Davydov+ ++Date: Tue, 4 Mar 2025 23:54:13 +0300 +Subject: [PATCH] ramips: mt76x8: add support for Keenetic Launcher (KN-1221) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specification: +SoC: MediaTek MT7628AN +RAM: 128M DDR2, ESMT M14D128168A (2Y) +Flash: 32M, cFeon EN25QH256A (Dual Boot on OEM, concatenated on OpenWrt, +SPI) +Switch: MediaTek MT7628AN, 3 ports 100 Mbps +WiFi: MediaTek MT7628AN 2.4 GHz 802.11n +USB: 1 port USB 2.0 +GPIO: 1 button (Wi-Fi & Reset on OEM, Reset on OpenWrt), 3 LEDs (Power, +Internet, Wi-Fi), USB port power controls + +Disassembly: +There are 2 screws at the bottom near the LEDs hidden by rubber mounts. +After removing the screws, pry the gray plastic part around (it is secured +with latches) and remove it. + +UART Interface: +The UART interface can be connected to the 5 pin located between LAN +ports and the WAN one. +Pins (from the second LAN port to the WAN one): VCC, TX, RX, NC, GND +Settings: 115200, 8N1 + +Flashing via TFTP: +1. Connect your PC and router to the first LAN port, configure PC +interface using IP 192.168.1.2, mask 255.255.255.0 +2. Serve the firmware image (for OpenWrt it is *-squashfs-factory.bin) +renamed to KN-1221_recovery.bin via TFTP +3. Power up the router while pressing Wi-Fi button +4. Release Wi-Fi button when Power LED starts blinking + +To revert back to OEM firmware: +The return to the OEM firmware is carried out by using the methods +described above with the help of the appropriate firmware image found on +osvault.keenetic.net. + +When using OEM bootloader, the firmware image size cannot exceed the size +of one OEM «Firmware_x» partition or Kernel + rootFS size. + +Signed-off-by: Ivan Davydov +Link: https://github.com/openwrt/openwrt/pull/18164 +Signed-off-by: Hauke Mehrtens +--- + .../ramips/dts/mt7628an_keenetic_kn-1221.dts | 209 ++++++++++++++++++ + target/linux/ramips/image/mt76x8.mk | 12 + + .../mt76x8/base-files/etc/board.d/01_leds | 1 + + .../mt76x8/base-files/etc/board.d/02_network | 5 + + 4 files changed, 227 insertions(+) + create mode 100644 target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts + +diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +new file mode 100644 +index 00000000000000..6f5cf96856ed21 +--- /dev/null ++++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +@@ -0,0 +1,209 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "mt7628an.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ compatible = "keenetic,kn-1221", "mediatek,mt7628an-soc"; ++ model = "Keenetic KN-1221"; ++ ++ aliases { ++ label-mac-device = ðernet; ++ ++ led-boot = &led_power; ++ led-failsafe = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_power; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ regulator-usb { ++ compatible = "regulator-fixed"; ++ regulator-name = "USB-power"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_power: power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio 38 GPIO_ACTIVE_LOW>; ++ }; ++ ++ fn { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&gpio 4 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "restart"; ++ gpios = <&gpio 37 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++ ++ virtual_flash { ++ compatible = "mtd-concat"; ++ devices = <&firmware1 &firmware2>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "denx,uimage"; ++ label = "firmware"; ++ reg = <0x0 0x1cc0000>; ++ }; ++ }; ++ }; ++}; ++ ++&state_default { ++ gpio { ++ groups = "i2c", "spi cs1", "gpio", "refclk", "wdt"; ++ function = "gpio"; ++ }; ++}; ++ ++&spi0 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <32000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x30000>; ++ read-only; ++ }; ++ ++ partition@30000 { ++ label = "u-config"; ++ reg = <0x30000 0x10000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "rf-eeprom"; ++ reg = <0x40000 0x10000>; ++ read-only; ++ ++ nvmem-layout { ++ compatible = "fixed-layout"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ eeprom_factory_0: eeprom@0 { ++ reg = <0x0 0x400>; ++ }; ++ ++ macaddr_factory_4: macaddr@4 { ++ reg = <0x4 0x6>; ++ }; ++ }; ++ }; ++ ++ firmware1: partition@50000 { ++ label = "firmware_1"; ++ reg = <0x50000 0xe60000>; ++ }; ++ ++ partition@eb0000 { ++ label = "config_1"; ++ reg = <0xeb0000 0x40000>; ++ read-only; ++ }; ++ ++ partition@ef0000 { ++ label = "storage"; ++ reg = <0xef0000 0x100000>; ++ read-only; ++ }; ++ ++ partition@ff0000 { ++ label = "dump"; ++ reg = <0xff0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1000000 { ++ label = "u-state"; ++ reg = <0x1000000 0x30000>; ++ read-only; ++ }; ++ ++ partition@1030000 { ++ label = "u-config_res"; ++ reg = <0x1030000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1040000 { ++ label = "rf-eeprom_res"; ++ reg = <0x1040000 0x10000>; ++ read-only; ++ }; ++ ++ firmware2: partition@1050000 { ++ label = "firmware_2"; ++ reg = <0x1050000 0xe60000>; ++ }; ++ ++ partition@1eb0000 { ++ label = "Config_2"; ++ reg = <0x1eb0000 0x40000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++ðernet { ++ nvmem-cells = <&macaddr_factory_4>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&esw { ++ mediatek,portmap = <0x3e>; ++ mediatek,portdisable = <0x38>; ++}; ++ ++&wmac { ++ status = "okay"; ++ ++ nvmem-cells = <&eeprom_factory_0>; ++ nvmem-cell-names = "eeprom"; ++}; +diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk +index 8c8cfee23b6cfa..f442148d9ecf10 100644 +--- a/target/linux/ramips/image/mt76x8.mk ++++ b/target/linux/ramips/image/mt76x8.mk +@@ -366,6 +366,18 @@ define Device/jotale_js76x8-32m + endef + TARGET_DEVICES += jotale_js76x8-32m + ++define Device/keenetic_kn-1221 ++ BLOCKSIZE := 64k ++ IMAGE_SIZE := 29440k ++ DEVICE_VENDOR := Keenetic ++ DEVICE_MODEL := KN-1221 ++ DEVICE_PACKAGES := kmod-usb2 ++ IMAGES += factory.bin ++ IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ ++ check-size 14720k | zyimage -d 0x801221 -v "KN-1221" ++endef ++TARGET_DEVICES += keenetic_kn-1221 ++ + define Device/keenetic_kn-1613 + IMAGE_SIZE := 31488k + DEVICE_VENDOR := Keenetic +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +index b87062ae3c5ae5..79f78a2a459487 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +@@ -58,4 +58,5 @@ hiwifi,hc5661a|\ + hiwifi,hc5761a) + ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10" + ;; ++keenetic,kn-1221|\ + keenetic,kn-1613) +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +index fbdc7fb5a2697a..6e6e1310d3495f 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +@@ -131,5 +131,9 @@ ramips_setup_interfaces() + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "6@eth0" + ;; ++ keenetic,kn-1221) ++ ucidef_add_switch "switch0" \ ++ "1:lan" "2:lan" "0:wan" "6@eth0" ++ ;; + keenetic,kn-1613|\ + motorola,mwr03) +@@ -280,5 +280,6 @@ ramips_setup_macs() + totolink,lr1200) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; ++ keenetic,kn-1221|\ + keenetic,kn-1613|\ + zyxel,keenetic-extra-ii) +
+
+ +Или в виде файла: 18164.patch.backport-24.10.1. +Готовые сборки тоже доступны в виде файлов: openwrt-kn-1221-24.10
+First, set up FT on your OpenWrt devices.
+ +Then, change the mode of your Keenetic (?) devices to Extender (there are Repeater/Extender and Access Point/Extender, the last is the recommended).
+ +Go to the Access Point/Extender (Repeater/Extender) > Home segment
menu. Change the settings of the Wi-Fi network to those ones in OpenWrt.
Scroll below to the "Roaming for wireless devices" section. Enable "Fast transition (802.11r)" and write your mobility domain ID converted to the ASCII format.
+ +You can use an online converter like this one: https://www.rapidtables.com/convert/number/hex-to-ascii.html. Keep the "Mobility domain key" field unedited.
+ +Press the "Save" button. Now you have a so-called "Wi-Fi system" with use of both KeeneticOS and OpenWrt!
+Вот оно:
+
+From ef20327e33fb38220ba0bca4418464749305e555 Mon Sep 17 00:00:00 2001 +From: Ivan Davydov+ ++Date: Tue, 4 Mar 2025 23:54:13 +0300 +Subject: [PATCH] ramips: mt76x8: add support for Keenetic Launcher (KN-1221) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specification: +SoC: MediaTek MT7628AN +RAM: 128M DDR2, ESMT M14D128168A (2Y) +Flash: 32M, cFeon EN25QH256A (Dual Boot on OEM, concatenated on OpenWrt, +SPI) +Switch: MediaTek MT7628AN, 3 ports 100 Mbps +WiFi: MediaTek MT7628AN 2.4 GHz 802.11n +USB: 1 port USB 2.0 +GPIO: 1 button (Wi-Fi & Reset on OEM, Reset on OpenWrt), 3 LEDs (Power, +Internet, Wi-Fi), USB port power controls + +Disassembly: +There are 2 screws at the bottom near the LEDs hidden by rubber mounts. +After removing the screws, pry the gray plastic part around (it is secured +with latches) and remove it. + +UART Interface: +The UART interface can be connected to the 5 pin located between LAN +ports and the WAN one. +Pins (from the second LAN port to the WAN one): VCC, TX, RX, NC, GND +Settings: 115200, 8N1 + +Flashing via TFTP: +1. Connect your PC and router to the first LAN port, configure PC +interface using IP 192.168.1.2, mask 255.255.255.0 +2. Serve the firmware image (for OpenWrt it is *-squashfs-factory.bin) +renamed to KN-1221_recovery.bin via TFTP +3. Power up the router while pressing Wi-Fi button +4. Release Wi-Fi button when Power LED starts blinking + +To revert back to OEM firmware: +The return to the OEM firmware is carried out by using the methods +described above with the help of the appropriate firmware image found on +osvault.keenetic.net. + +When using OEM bootloader, the firmware image size cannot exceed the size +of one OEM «Firmware_x» partition or Kernel + rootFS size. + +Signed-off-by: Ivan Davydov +Link: https://github.com/openwrt/openwrt/pull/18164 +Signed-off-by: Hauke Mehrtens +--- + .../ramips/dts/mt7628an_keenetic_kn-1221.dts | 209 ++++++++++++++++++ + target/linux/ramips/image/mt76x8.mk | 12 + + .../mt76x8/base-files/etc/board.d/01_leds | 1 + + .../mt76x8/base-files/etc/board.d/02_network | 5 + + 4 files changed, 227 insertions(+) + create mode 100644 target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts + +diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +new file mode 100644 +index 00000000000000..6f5cf96856ed21 +--- /dev/null ++++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +@@ -0,0 +1,209 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "mt7628an.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ compatible = "keenetic,kn-1221", "mediatek,mt7628an-soc"; ++ model = "Keenetic KN-1221"; ++ ++ aliases { ++ label-mac-device = ðernet; ++ ++ led-boot = &led_power; ++ led-failsafe = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_power; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ regulator-usb { ++ compatible = "regulator-fixed"; ++ regulator-name = "USB-power"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_power: power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio 38 GPIO_ACTIVE_LOW>; ++ }; ++ ++ fn { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&gpio 4 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "restart"; ++ gpios = <&gpio 37 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++ ++ virtual_flash { ++ compatible = "mtd-concat"; ++ devices = <&firmware1 &firmware2>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "denx,uimage"; ++ label = "firmware"; ++ reg = <0x0 0x1cc0000>; ++ }; ++ }; ++ }; ++}; ++ ++&state_default { ++ gpio { ++ groups = "i2c", "spi cs1", "gpio", "refclk", "wdt"; ++ function = "gpio"; ++ }; ++}; ++ ++&spi0 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <32000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x30000>; ++ read-only; ++ }; ++ ++ partition@30000 { ++ label = "u-config"; ++ reg = <0x30000 0x10000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "rf-eeprom"; ++ reg = <0x40000 0x10000>; ++ read-only; ++ ++ nvmem-layout { ++ compatible = "fixed-layout"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ eeprom_factory_0: eeprom@0 { ++ reg = <0x0 0x400>; ++ }; ++ ++ macaddr_factory_4: macaddr@4 { ++ reg = <0x4 0x6>; ++ }; ++ }; ++ }; ++ ++ firmware1: partition@50000 { ++ label = "firmware_1"; ++ reg = <0x50000 0xe60000>; ++ }; ++ ++ partition@eb0000 { ++ label = "config_1"; ++ reg = <0xeb0000 0x40000>; ++ read-only; ++ }; ++ ++ partition@ef0000 { ++ label = "storage"; ++ reg = <0xef0000 0x100000>; ++ read-only; ++ }; ++ ++ partition@ff0000 { ++ label = "dump"; ++ reg = <0xff0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1000000 { ++ label = "u-state"; ++ reg = <0x1000000 0x30000>; ++ read-only; ++ }; ++ ++ partition@1030000 { ++ label = "u-config_res"; ++ reg = <0x1030000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1040000 { ++ label = "rf-eeprom_res"; ++ reg = <0x1040000 0x10000>; ++ read-only; ++ }; ++ ++ firmware2: partition@1050000 { ++ label = "firmware_2"; ++ reg = <0x1050000 0xe60000>; ++ }; ++ ++ partition@1eb0000 { ++ label = "Config_2"; ++ reg = <0x1eb0000 0x40000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++ðernet { ++ nvmem-cells = <&macaddr_factory_4>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&esw { ++ mediatek,portmap = <0x3e>; ++ mediatek,portdisable = <0x38>; ++}; ++ ++&wmac { ++ status = "okay"; ++ ++ nvmem-cells = <&eeprom_factory_0>; ++ nvmem-cell-names = "eeprom"; ++}; +diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk +index 8c8cfee23b6cfa..f442148d9ecf10 100644 +--- a/target/linux/ramips/image/mt76x8.mk ++++ b/target/linux/ramips/image/mt76x8.mk +@@ -366,6 +366,18 @@ define Device/jotale_js76x8-32m + endef + TARGET_DEVICES += jotale_js76x8-32m + ++define Device/keenetic_kn-1221 ++ BLOCKSIZE := 64k ++ IMAGE_SIZE := 29440k ++ DEVICE_VENDOR := Keenetic ++ DEVICE_MODEL := KN-1221 ++ DEVICE_PACKAGES := kmod-usb2 ++ IMAGES += factory.bin ++ IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ ++ check-size 14720k | zyimage -d 0x801221 -v "KN-1221" ++endef ++TARGET_DEVICES += keenetic_kn-1221 ++ + define Device/keenetic_kn-1613 + IMAGE_SIZE := 31488k + DEVICE_VENDOR := Keenetic +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +index b87062ae3c5ae5..79f78a2a459487 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +@@ -58,4 +58,5 @@ hiwifi,hc5661a|\ + hiwifi,hc5761a) + ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10" + ;; ++keenetic,kn-1221|\ + keenetic,kn-1613) +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +index fbdc7fb5a2697a..6e6e1310d3495f 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +@@ -131,5 +131,9 @@ ramips_setup_interfaces() + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "6@eth0" + ;; ++ keenetic,kn-1221) ++ ucidef_add_switch "switch0" \ ++ "1:lan" "2:lan" "0:wan" "6@eth0" ++ ;; + keenetic,kn-1613|\ + motorola,mwr03) +@@ -280,5 +280,6 @@ ramips_setup_macs() + totolink,lr1200) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; ++ keenetic,kn-1221|\ + keenetic,kn-1613|\ + zyxel,keenetic-extra-ii) +
+
+ +Или в виде файла: 18164.patch.backport-24.10.1. +Готовые сборки тоже доступны в виде файлов: openwrt-kn-1221-24.10
+Debian 12 с последними обновлениями и доступом в Интернет
Prosody >= 0.13
PAM (Pluggable Authentication Modules) - API для авторизации в Unix-подобных ОС, по умолчанию использует список пользователей из файла `/etc/passwd`.
+ +Все команды выполняются пользователем root
, если не указано иначе.
Выполните эти команды:
+ ++# Установить Prosody +wget https://prosody.im/files/prosody.sources -O/etc/apt/sources.list.d/prosody.sources +apt update +apt install prosody lua5.4 liblua5.4-0 liblua5.4-dev luarocks +# Добавить привилегии демону Prosody +usermod -aG shadow prosody +usermod -aG ssl-cert prosody +# Установить библиотеку для взаимодействия с POSIX-функциями +luarocks install luaposix +# Собрать библиотеку дл/ PAM-аутентификации +git clone https://github.com/devurandom/lua-pam && cd lua-pam +make LUA_VERSION=5.4 +cp pam.so /usr/lib/ +# Установить модуль для PAM-аутентификации +LUA_INCDIR=5.4 prosodyctl install --server=https://modules.prosody.im/rocks/ mod_auth_pam ++ +
Начните редактировать файл /etc/prosody/prosody.cfg.lua
.
+Следуйте этим инструкциям, заменяя example.net
на доменное имя, привязанное к вашему серверу.
Найдите строку, начинающуюся с слова admins
, и добавьте ваше будущее имя пользователя в фигурные скобки подобным образом:
+admins = { "admin@example.net" } ++ +
Где admin
- это ваше имя пользователя в вашей системе.
Дальше найдите строку --"mam";
и удалите два дефиса, сделайте то же самое с строкой --"turn_external";
, находящейся ниже.
Теперь перейдите к строке authentication = "internal_hashed"
и замените internal_hashed
на pam
.
Перейдите к строке, начинающейся с storage
и поменяйте sql
на internal
(по желанию, в этой инструкции я не рассматриваю настройку с базами данных)
По желанию в строке archive_expires_after = "1w"
замените 1w
на never
, чтобы истории переписок не удалялись каждую неделю.
Найдите строку, начинающуюся с VirtualHost
и замените localhost
на example.net
.
Если вам нужны многопользовательские переписки, на следующей строке добавьте следущее:
+ ++Component "conference.example.net" "muc" +modules_enabled = { "muc_mam", "vcard_muc" } ++ +
Последнюю строку можете опустить, если вам не нужно сохранение истории многопользовательских переписок.
+ +Если нужна возможность загружать файлы на ваш сервер, дополните конфигурацию следующими строками:
+ ++Component "upload.example.net" "http_file_share" +http_file_share_size_limit = 512 * 1024 * 1024 --измеряется в байтах +http_file_share_expire_after = 60 * 60 * 24 * 31 * 1000 --измеряется в секундах ++ +
В данном случае, лимит размера файла - это 512 МиБ (0,5 ГиБ), а удаляться файлы будут через ~1000 лет. +Если требуется изменить какое-либо из этих свойств, смотрите комментарии (в Lua они начинаются с двух дефисов) и пробуйте изменять значения.
+ +Также заменяйте `example.net` на ваше доменное имя.
+ +ACME (Automatic Certificate Management Environment) - это протокол для получения TLS-сертификатов по Web. +В этом примере используется ACME-клиент acme.sh, так как эта программа более настраиваемая и удостоверяющий центр (далее УЦ) Let's Encrypt (но вы можете использовать любой другой).
+ +Выполните следующие команды:
++# Эта команда установит acme.sh в директорию ~/.acme.sh, системные +# файлы не будут затронуты +wget -O - https://get.acme.sh | sh -s \ + email=yourveryownlocalpart@example.net +# Теперь либо перезайдите в систему, либо выполните `exec $0`, если +# вы уверены в значении переменной `$0`. + +# Проверьте, прошла ли установка правильно +acme.sh -h + +# Установить Let's Encrypt в качестве УЦ +acme.sh --set-default-ca --server \ + https://acme-v02.api.letsencrypt.org/directory + +# Есть два способа подтверждения владения доменом - по HTTP или по +# DNS. +# Первый проще, но требует доступ на запись в директорию, содержимое +# которой доступно по ссылке http://example.net/: +acme.sh --issue -d example.net -d conference.example.net -d \ + upload.example.net -w <директория с корнем вашего + веб-сервера> +# А второй, поддерживая Wildcard-сертификаты, позволяет в дальнейшем +# подключать к вашему XMPP-серверу всевозможные компоненты +# (транспорты в другие сети, модуль публикации-подписки, он же +# Publish-Subscribe или просто PubSub и многие другие), но требует +# доступа к API вашего DNS-регистратора для создания записи, +# подтверждающей владение доменным именем: +acme.sh --issue --dnssleep <время в секундах, большее чем TTL> \ + --dns dns_myapi \ + -d example.net -d '*.example.net' # Где dns_myapi - это кодовое + # имя DNS-провайдера, указанное на + # https://github.com/acmesh-official/acme.sh/wiki/dnsapi +# Но если у вас нет и веб-сервера (или доступа к нему), и доступа к +# API регистратора, то вы можете внести запись с подтверждением +# вручную (заметьте, что вам нужно будет это делать каждый раз, когда +# будет истекать срок действия сертификата): +# (Перед применением этого способа следует внимательно прочитать +# следующую страницу: +# https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode) +acme.sh --issue --dns -d example.net -d '*.example.net' +# Теперь примените DNS-запись, выведенную на экран командой выше, и +# подождите до её распространения. После выполните следующее: +acme.sh --renew -d example.net -d '*.example.net' + +# Почти готово. Теперь осталось установить сертификат: +mkdir /etc/ssl/private/example.net +chown root:ssl-cert /etc/ssl/private/example.net +chmod 750 /etc/ssl/private/example.net +acme.sh --install-cert \ + -d example.net -d '*.example.net' \ + --ca-file /etc/ssl/private/example.net/chain.pem \ + --cert-file /etc/ssl/private/example.net/cert.pem \ + --fullchain-file /etc/ssl/private/example.net/fullchain.pem \ + --key-file /etc/ssl/private/example.net/privkey.pem \ + --reloadcmd "prosodyctl --root cert import \ + /etc/ssl/private/example.net" ++ +
В завершении статьи хочется обратить ваше внимание на то, что данная инструкция предоставляется БЕЗ каких-либо гарантий. Если при выполнении указаний из данной инструкции случилось что-то непредвиденное, вы можете обратиться ко мне, но не стоит ожидать какого-либо результата.
++steamcmd "+login $USERID" $(for i in $MODLIST; do echo "+download_item $APPID $i"; done) ++
Debian 12 с последними обновлениями и доступом в Интернет
Prosody >= 0.13
PAM (Pluggable Authentication Modules) - API для авторизации в Unix-подобных ОС, по умолчанию использует список пользователей из файла `/etc/passwd`.
+ +Все команды выполняются пользователем root
, если не указано иначе.
Выполните эти команды:
+ ++# Установить Prosody +wget https://prosody.im/files/prosody.sources -O/etc/apt/sources.list.d/prosody.sources +apt update +apt install prosody lua5.4 liblua5.4-0 liblua5.4-dev luarocks +# Добавить привилегии демону Prosody +usermod -aG shadow prosody +usermod -aG ssl-cert prosody +# Установить библиотеку для взаимодействия с POSIX-функциями +luarocks install luaposix +# Собрать библиотеку дл/ PAM-аутентификации +git clone https://github.com/devurandom/lua-pam && cd lua-pam +make LUA_VERSION=5.4 +cp pam.so /usr/lib/ +# Установить модуль для PAM-аутентификации +LUA_INCDIR=5.4 prosodyctl install --server=https://modules.prosody.im/rocks/ mod_auth_pam ++ +
Начните редактировать файл /etc/prosody/prosody.cfg.lua
.
+Следуйте этим инструкциям, заменяя example.net
на доменное имя, привязанное к вашему серверу.
Найдите строку, начинающуюся с слова admins
, и добавьте ваше будущее имя пользователя в фигурные скобки подобным образом:
+admins = { "admin@example.net" } ++ +
Где admin
- это ваше имя пользователя в вашей системе.
Дальше найдите строку --"mam";
и удалите два дефиса, сделайте то же самое с строкой --"turn_external";
, находящейся ниже.
Теперь перейдите к строке authentication = "internal_hashed"
и замените internal_hashed
на pam
.
Перейдите к строке, начинающейся с storage
и поменяйте sql
на internal
(по желанию, в этой инструкции я не рассматриваю настройку с базами данных)
По желанию в строке archive_expires_after = "1w"
замените 1w
на never
, чтобы истории переписок не удалялись каждую неделю.
Найдите строку, начинающуюся с VirtualHost
и замените localhost
на example.net
.
Если вам нужны многопользовательские переписки, на следующей строке добавьте следущее:
+ ++Component "conference.example.net" "muc" +modules_enabled = { "muc_mam", "vcard_muc" } ++ +
Последнюю строку можете опустить, если вам не нужно сохранение истории многопользовательских переписок.
+ +Если нужна возможность загружать файлы на ваш сервер, дополните конфигурацию следующими строками:
+ ++Component "upload.example.net" "http_file_share" +http_file_share_size_limit = 512 * 1024 * 1024 --измеряется в байтах +http_file_share_expire_after = 60 * 60 * 24 * 31 * 1000 --измеряется в секундах ++ +
В данном случае, лимит размера файла - это 512 МиБ (0,5 ГиБ), а удаляться файлы будут через ~1000 лет. +Если требуется изменить какое-либо из этих свойств, смотрите комментарии (в Lua они начинаются с двух дефисов) и пробуйте изменять значения.
+ +Также заменяйте `example.net` на ваше доменное имя.
+ +ACME (Automatic Certificate Management Environment) - это протокол для получения TLS-сертификатов по Web. +В этом примере используется ACME-клиент acme.sh, так как эта программа более настраиваемая и удостоверяющий центр (далее УЦ) Let's Encrypt (но вы можете использовать любой другой).
+ +Выполните следующие команды:
++# Эта команда установит acme.sh в директорию ~/.acme.sh, системные +# файлы не будут затронуты +wget -O - https://get.acme.sh | sh -s \ + email=yourveryownlocalpart@example.net +# Теперь либо перезайдите в систему, либо выполните `exec $0`, если +# вы уверены в значении переменной `$0`. + +# Проверьте, прошла ли установка правильно +acme.sh -h + +# Установить Let's Encrypt в качестве УЦ +acme.sh --set-default-ca --server \ + https://acme-v02.api.letsencrypt.org/directory + +# Есть два способа подтверждения владения доменом - по HTTP или по +# DNS. +# Первый проще, но требует доступ на запись в директорию, содержимое +# которой доступно по ссылке http://example.net/: +acme.sh --issue -d example.net -d conference.example.net -d \ + upload.example.net -w <директория с корнем вашего + веб-сервера> +# А второй, поддерживая Wildcard-сертификаты, позволяет в дальнейшем +# подключать к вашему XMPP-серверу всевозможные компоненты +# (транспорты в другие сети, модуль публикации-подписки, он же +# Publish-Subscribe или просто PubSub и многие другие), но требует +# доступа к API вашего DNS-регистратора для создания записи, +# подтверждающей владение доменным именем: +acme.sh --issue --dnssleep <время в секундах, большее чем TTL> \ + --dns dns_myapi \ + -d example.net -d '*.example.net' # Где dns_myapi - это кодовое + # имя DNS-провайдера, указанное на + # https://github.com/acmesh-official/acme.sh/wiki/dnsapi +# Но если у вас нет и веб-сервера (или доступа к нему), и доступа к +# API регистратора, то вы можете внести запись с подтверждением +# вручную (заметьте, что вам нужно будет это делать каждый раз, когда +# будет истекать срок действия сертификата): +# (Перед применением этого способа следует внимательно прочитать +# следующую страницу: +# https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode) +acme.sh --issue --dns -d example.net -d '*.example.net' +# Теперь примените DNS-запись, выведенную на экран командой выше, и +# подождите до её распространения. После выполните следующее: +acme.sh --renew -d example.net -d '*.example.net' + +# Почти готово. Теперь осталось установить сертификат: +mkdir /etc/ssl/private/example.net +chown root:ssl-cert /etc/ssl/private/example.net +chmod 750 /etc/ssl/private/example.net +acme.sh --install-cert \ + -d example.net -d '*.example.net' \ + --ca-file /etc/ssl/private/example.net/chain.pem \ + --cert-file /etc/ssl/private/example.net/cert.pem \ + --fullchain-file /etc/ssl/private/example.net/fullchain.pem \ + --key-file /etc/ssl/private/example.net/privkey.pem \ + --reloadcmd "prosodyctl --root cert import \ + /etc/ssl/private/example.net" ++ +
В завершении статьи хочется обратить ваше внимание на то, что данная инструкция предоставляется БЕЗ каких-либо гарантий. Если при выполнении указаний из данной инструкции случилось что-то непредвиденное, вы можете обратиться ко мне, но не стоит ожидать какого-либо результата.
+Вот оно:
+
+From ef20327e33fb38220ba0bca4418464749305e555 Mon Sep 17 00:00:00 2001 +From: Ivan Davydov+ ++Date: Tue, 4 Mar 2025 23:54:13 +0300 +Subject: [PATCH] ramips: mt76x8: add support for Keenetic Launcher (KN-1221) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specification: +SoC: MediaTek MT7628AN +RAM: 128M DDR2, ESMT M14D128168A (2Y) +Flash: 32M, cFeon EN25QH256A (Dual Boot on OEM, concatenated on OpenWrt, +SPI) +Switch: MediaTek MT7628AN, 3 ports 100 Mbps +WiFi: MediaTek MT7628AN 2.4 GHz 802.11n +USB: 1 port USB 2.0 +GPIO: 1 button (Wi-Fi & Reset on OEM, Reset on OpenWrt), 3 LEDs (Power, +Internet, Wi-Fi), USB port power controls + +Disassembly: +There are 2 screws at the bottom near the LEDs hidden by rubber mounts. +After removing the screws, pry the gray plastic part around (it is secured +with latches) and remove it. + +UART Interface: +The UART interface can be connected to the 5 pin located between LAN +ports and the WAN one. +Pins (from the second LAN port to the WAN one): VCC, TX, RX, NC, GND +Settings: 115200, 8N1 + +Flashing via TFTP: +1. Connect your PC and router to the first LAN port, configure PC +interface using IP 192.168.1.2, mask 255.255.255.0 +2. Serve the firmware image (for OpenWrt it is *-squashfs-factory.bin) +renamed to KN-1221_recovery.bin via TFTP +3. Power up the router while pressing Wi-Fi button +4. Release Wi-Fi button when Power LED starts blinking + +To revert back to OEM firmware: +The return to the OEM firmware is carried out by using the methods +described above with the help of the appropriate firmware image found on +osvault.keenetic.net. + +When using OEM bootloader, the firmware image size cannot exceed the size +of one OEM «Firmware_x» partition or Kernel + rootFS size. + +Signed-off-by: Ivan Davydov +Link: https://github.com/openwrt/openwrt/pull/18164 +Signed-off-by: Hauke Mehrtens +--- + .../ramips/dts/mt7628an_keenetic_kn-1221.dts | 209 ++++++++++++++++++ + target/linux/ramips/image/mt76x8.mk | 12 + + .../mt76x8/base-files/etc/board.d/01_leds | 1 + + .../mt76x8/base-files/etc/board.d/02_network | 5 + + 4 files changed, 227 insertions(+) + create mode 100644 target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts + +diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +new file mode 100644 +index 00000000000000..6f5cf96856ed21 +--- /dev/null ++++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1221.dts +@@ -0,0 +1,209 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "mt7628an.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ compatible = "keenetic,kn-1221", "mediatek,mt7628an-soc"; ++ model = "Keenetic KN-1221"; ++ ++ aliases { ++ label-mac-device = ðernet; ++ ++ led-boot = &led_power; ++ led-failsafe = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_power; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ regulator-usb { ++ compatible = "regulator-fixed"; ++ regulator-name = "USB-power"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_power: power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet { ++ function = LED_FUNCTION_WAN; ++ color = ; ++ gpios = <&gpio 38 GPIO_ACTIVE_LOW>; ++ }; ++ ++ fn { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&gpio 4 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "restart"; ++ gpios = <&gpio 37 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++ ++ virtual_flash { ++ compatible = "mtd-concat"; ++ devices = <&firmware1 &firmware2>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "denx,uimage"; ++ label = "firmware"; ++ reg = <0x0 0x1cc0000>; ++ }; ++ }; ++ }; ++}; ++ ++&state_default { ++ gpio { ++ groups = "i2c", "spi cs1", "gpio", "refclk", "wdt"; ++ function = "gpio"; ++ }; ++}; ++ ++&spi0 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <32000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x30000>; ++ read-only; ++ }; ++ ++ partition@30000 { ++ label = "u-config"; ++ reg = <0x30000 0x10000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "rf-eeprom"; ++ reg = <0x40000 0x10000>; ++ read-only; ++ ++ nvmem-layout { ++ compatible = "fixed-layout"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ eeprom_factory_0: eeprom@0 { ++ reg = <0x0 0x400>; ++ }; ++ ++ macaddr_factory_4: macaddr@4 { ++ reg = <0x4 0x6>; ++ }; ++ }; ++ }; ++ ++ firmware1: partition@50000 { ++ label = "firmware_1"; ++ reg = <0x50000 0xe60000>; ++ }; ++ ++ partition@eb0000 { ++ label = "config_1"; ++ reg = <0xeb0000 0x40000>; ++ read-only; ++ }; ++ ++ partition@ef0000 { ++ label = "storage"; ++ reg = <0xef0000 0x100000>; ++ read-only; ++ }; ++ ++ partition@ff0000 { ++ label = "dump"; ++ reg = <0xff0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1000000 { ++ label = "u-state"; ++ reg = <0x1000000 0x30000>; ++ read-only; ++ }; ++ ++ partition@1030000 { ++ label = "u-config_res"; ++ reg = <0x1030000 0x10000>; ++ read-only; ++ }; ++ ++ partition@1040000 { ++ label = "rf-eeprom_res"; ++ reg = <0x1040000 0x10000>; ++ read-only; ++ }; ++ ++ firmware2: partition@1050000 { ++ label = "firmware_2"; ++ reg = <0x1050000 0xe60000>; ++ }; ++ ++ partition@1eb0000 { ++ label = "Config_2"; ++ reg = <0x1eb0000 0x40000>; ++ read-only; ++ }; ++ }; ++ }; ++}; ++ ++ðernet { ++ nvmem-cells = <&macaddr_factory_4>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&esw { ++ mediatek,portmap = <0x3e>; ++ mediatek,portdisable = <0x38>; ++}; ++ ++&wmac { ++ status = "okay"; ++ ++ nvmem-cells = <&eeprom_factory_0>; ++ nvmem-cell-names = "eeprom"; ++}; +diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk +index 8c8cfee23b6cfa..f442148d9ecf10 100644 +--- a/target/linux/ramips/image/mt76x8.mk ++++ b/target/linux/ramips/image/mt76x8.mk +@@ -366,6 +366,18 @@ define Device/jotale_js76x8-32m + endef + TARGET_DEVICES += jotale_js76x8-32m + ++define Device/keenetic_kn-1221 ++ BLOCKSIZE := 64k ++ IMAGE_SIZE := 29440k ++ DEVICE_VENDOR := Keenetic ++ DEVICE_MODEL := KN-1221 ++ DEVICE_PACKAGES := kmod-usb2 ++ IMAGES += factory.bin ++ IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ ++ check-size 14720k | zyimage -d 0x801221 -v "KN-1221" ++endef ++TARGET_DEVICES += keenetic_kn-1221 ++ + define Device/keenetic_kn-1613 + IMAGE_SIZE := 31488k + DEVICE_VENDOR := Keenetic +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +index b87062ae3c5ae5..79f78a2a459487 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +@@ -58,4 +58,5 @@ hiwifi,hc5661a|\ + hiwifi,hc5761a) + ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10" + ;; ++keenetic,kn-1221|\ + keenetic,kn-1613) +diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +index fbdc7fb5a2697a..6e6e1310d3495f 100644 +--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network ++++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +@@ -131,5 +131,9 @@ ramips_setup_interfaces() + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "6@eth0" + ;; ++ keenetic,kn-1221) ++ ucidef_add_switch "switch0" \ ++ "1:lan" "2:lan" "0:wan" "6@eth0" ++ ;; + keenetic,kn-1613|\ + motorola,mwr03) +@@ -280,5 +280,6 @@ ramips_setup_macs() + totolink,lr1200) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; ++ keenetic,kn-1221|\ + keenetic,kn-1613|\ + zyxel,keenetic-extra-ii) +
+
+ +Или в виде файла: 18164.patch.backport-24.10.1. +Готовые сборки тоже доступны в виде файлов: openwrt-kn-1221-24.10
+First, set up FT on your OpenWrt devices.
+ +Then, change the mode of your Keenetic (?) devices to Extender (there are Repeater/Extender and Access Point/Extender, the last is the recommended).
+ +Go to the Access Point/Extender (Repeater/Extender) > Home segment
menu. Change the settings of the Wi-Fi network to those ones in OpenWrt.
Scroll below to the "Roaming for wireless devices" section. Enable "Fast transition (802.11r)" and write your mobility domain ID converted to the ASCII format.
+ +You can use an online converter like this one: https://www.rapidtables.com/convert/number/hex-to-ascii.html. Keep the "Mobility domain key" field unedited.
+ +Press the "Save" button. Now you have a so-called "Wi-Fi system" with use of both KeeneticOS and OpenWrt!
+