|
|
| (3 intermediate revisions by 2 users not shown) |
| Line 5: |
Line 5: |
| Following example code initializes a simple PeerTube instance | | Following example code initializes a simple PeerTube instance |
|
| |
|
| {{file|/etc/nixos/configuration.nix|nix|<nowiki> | | {{file|||<nowiki> |
| networking.extraHosts = '' | | networking.extraHosts = '' |
| 127.0.0.1 peertube.local | | 127.0.0.1 peertube.local |
| ''; | | ''; |
|
| |
|
| environment.etc = {
| | services.peertube = { |
| "peertube/password-posgressql-db".text = "test123"; | | enable = true; |
| "peertube/password-redis-db".text = "test123"; | | localDomain = "peertube.local"; |
| | enableWebHttps = false; |
| | database.createLocally = true; |
| | redis.createLocally = true; |
| | settings = { |
| | listen.hostname = "0.0.0.0"; |
| | instance.name = "PeerTube Test Server"; |
| | }; |
| }; | | }; |
| | </nowiki>|name=/etc/nixos/configuration.nix|lang=nix}} |
|
| |
|
| services = {
| | After that open http://peertube.local:9000 in your browser to access PeerTube. The default administrator username is <code>root</code>. The initial password will be logged into the system journal, see the output of <code>journalctl -u peertube</code>. |
| | |
| peertube = {
| |
| enable = true;
| |
| localDomain = "peertube.local";
| |
| enableWebHttps = false;
| |
| database = {
| |
| host = "127.0.0.1";
| |
| name = "peertube_local";
| |
| user = "peertube_test";
| |
| passwordFile = "/etc/peertube/password-posgressql-db";
| |
| };
| |
| redis = {
| |
| host = "127.0.0.1";
| |
| port = 31638;
| |
| passwordFile = "/etc/peertube/password-redis-db";
| |
| };
| |
| settings = {
| |
| listen.hostname = "0.0.0.0";
| |
| instance.name = "PeerTube Test Server";
| |
| };
| |
| };
| |
| | |
| postgresql = {
| |
| enable = true;
| |
| enableTCPIP = true;
| |
| authentication = ''
| |
| hostnossl peertube_local peertube_test 127.0.0.1/32 md5
| |
| '';
| |
| initialScript = pkgs.writeText "postgresql_init.sql" ''
| |
| CREATE ROLE peertube_test LOGIN PASSWORD 'test123';
| |
| CREATE DATABASE peertube_local TEMPLATE template0 ENCODING UTF8;
| |
| GRANT ALL PRIVILEGES ON DATABASE peertube_local TO peertube_test;
| |
| \connect peertube_local
| |
| CREATE EXTENSION IF NOT EXISTS pg_trgm;
| |
| CREATE EXTENSION IF NOT EXISTS unaccent;
| |
| '';
| |
| };
| |
|
| |
|
| redis.servers.peertube = {
| |
| enable = true;
| |
| bind = "0.0.0.0";
| |
| requirePass = "test123";
| |
| port = 31638;
| |
| };
| |
|
| |
|
| };
| | [[Category:Web Applications]] |
| </nowiki>}}
| | [[Category:Server]] |
| | |
| After that open http://peertube.local:9000 in your browser to access PeerTube. The default administrator username is <code>root</code>. The initial password will be logged into the system journal, see the output of <code>journalctl -u peertube</code>.
| |