Browse Source

tests...

master
Miraty 2 months ago
parent
commit
c489e8b917
9 changed files with 105 additions and 535 deletions
  1. 0
    6
      conf/app.src
  2. 5
    20
      conf/nginx.conf
  3. 0
    430
      conf/php-fpm.conf
  4. 2
    2
      conf/systemd.service
  5. 23
    22
      manifest.json
  6. 1
    1
      scripts/_common.sh
  7. 61
    42
      scripts/install
  8. 13
    10
      scripts/remove
  9. 0
    2
      sources/patches/.gitignore

+ 0
- 6
conf/app.src View File

@@ -1,6 +0,0 @@
1
-SOURCE_URL=url of app's source
2
-SOURCE_SUM=sha256 checksum
3
-SOURCE_SUM_PRG=sha256sum
4
-SOURCE_FORMAT=tar.gz
5
-SOURCE_IN_SUBDIR=true
6
-SOURCE_FILENAME=

+ 5
- 20
conf/nginx.conf View File

@@ -1,33 +1,18 @@
1 1
 #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
2 2
 location __PATH__/ {
3 3
 
4
+
5
+
4 6
   # Path to source
5
-  alias __FINALPATH__/ ;
7
+  #alias __FINALPATH__/ ;
6 8
 
7 9
   # Force usage of https
8 10
   if ($scheme = http) {
9 11
     rewrite ^ https://$server_name$request_uri? permanent;
10 12
   }
11 13
 
12
-### Example PHP configuration (remove it if not used)
13
-  index index.php;
14
-
15
-  # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
16
-  #client_max_body_size 50M;
17
-
18
-  try_files $uri $uri/ index.php;
19
-  location ~ [^/]\.php(/|$) {
20
-    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
21
-    fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
22
-
23
-    fastcgi_index index.php;
24
-    include fastcgi_params;
25
-    fastcgi_param REMOTE_USER $remote_user;
26
-    fastcgi_param PATH_INFO $fastcgi_path_info;
27
-    fastcgi_param SCRIPT_FILENAME $request_filename;
28
-  }
29
-### End of PHP configuration part
30
-
31 14
   # Include SSOWAT user panel.
32 15
   include conf.d/yunohost_panel.conf.inc;
16
+
17
+  proxy_pass http://localhost:3000;
33 18
 }

+ 0
- 430
conf/php-fpm.conf View File

@@ -1,430 +0,0 @@
1
-; Start a new pool named 'www'.
2
-; the variable $pool can be used in any directive and will be replaced by the
3
-; pool name ('www' here)
4
-[__NAMETOCHANGE__]
5
-
6
-; Per pool prefix
7
-; It only applies on the following directives:
8
-; - 'access.log'
9
-; - 'slowlog'
10
-; - 'listen' (unixsocket)
11
-; - 'chroot'
12
-; - 'chdir'
13
-; - 'php_values'
14
-; - 'php_admin_values'
15
-; When not set, the global prefix (or /usr) applies instead.
16
-; Note: This directive can also be relative to the global prefix.
17
-; Default Value: none
18
-;prefix = /path/to/pools/$pool
19
-
20
-; Unix user/group of processes
21
-; Note: The user is mandatory. If the group is not set, the default user's group
22
-;       will be used.
23
-user = __USER__
24
-group = __USER__
25
-
26
-; The address on which to accept FastCGI requests.
27
-; Valid syntaxes are:
28
-;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
29
-;                            a specific port;
30
-;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
31
-;                            a specific port;
32
-;   'port'                 - to listen on a TCP socket to all addresses
33
-;                            (IPv6 and IPv4-mapped) on a specific port;
34
-;   '/path/to/unix/socket' - to listen on a unix socket.
35
-; Note: This value is mandatory.
36
-listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock
37
-
38
-; Set listen(2) backlog.
39
-; Default Value: 511 (-1 on FreeBSD and OpenBSD)
40
-;listen.backlog = 511
41
-
42
-; Set permissions for unix socket, if one is used. In Linux, read/write
43
-; permissions must be set in order to allow connections from a web server. Many
44
-; BSD-derived systems allow connections regardless of permissions.
45
-; Default Values: user and group are set as the running user
46
-;                 mode is set to 0660
47
-listen.owner = www-data
48
-listen.group = www-data
49
-;listen.mode = 0660
50
-; When POSIX Access Control Lists are supported you can set them using
51
-; these options, value is a comma separated list of user/group names.
52
-; When set, listen.owner and listen.group are ignored
53
-;listen.acl_users =
54
-;listen.acl_groups =
55
-
56
-; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
57
-; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
58
-; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
59
-; must be separated by a comma. If this value is left blank, connections will be
60
-; accepted from any ip address.
61
-; Default Value: any
62
-;listen.allowed_clients = 127.0.0.1
63
-
64
-; Specify the nice(2) priority to apply to the pool processes (only if set)
65
-; The value can vary from -19 (highest priority) to 20 (lower priority)
66
-; Note: - It will only work if the FPM master process is launched as root
67
-;       - The pool processes will inherit the master process priority
68
-;         unless it specified otherwise
69
-; Default Value: no set
70
-; process.priority = -19
71
-
72
-; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
73
-; or group is differrent than the master process user. It allows to create process
74
-; core dump and ptrace the process for the pool user.
75
-; Default Value: no
76
-; process.dumpable = yes
77
-
78
-; Choose how the process manager will control the number of child processes.
79
-; Possible Values:
80
-;   static  - a fixed number (pm.max_children) of child processes;
81
-;   dynamic - the number of child processes are set dynamically based on the
82
-;             following directives. With this process management, there will be
83
-;             always at least 1 children.
84
-;             pm.max_children      - the maximum number of children that can
85
-;                                    be alive at the same time.
86
-;             pm.start_servers     - the number of children created on startup.
87
-;             pm.min_spare_servers - the minimum number of children in 'idle'
88
-;                                    state (waiting to process). If the number
89
-;                                    of 'idle' processes is less than this
90
-;                                    number then some children will be created.
91
-;             pm.max_spare_servers - the maximum number of children in 'idle'
92
-;                                    state (waiting to process). If the number
93
-;                                    of 'idle' processes is greater than this
94
-;                                    number then some children will be killed.
95
-;  ondemand - no children are created at startup. Children will be forked when
96
-;             new requests will connect. The following parameter are used:
97
-;             pm.max_children           - the maximum number of children that
98
-;                                         can be alive at the same time.
99
-;             pm.process_idle_timeout   - The number of seconds after which
100
-;                                         an idle process will be killed.
101
-; Note: This value is mandatory.
102
-pm = dynamic
103
-
104
-; The number of child processes to be created when pm is set to 'static' and the
105
-; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
106
-; This value sets the limit on the number of simultaneous requests that will be
107
-; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
108
-; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
109
-; CGI. The below defaults are based on a server without much resources. Don't
110
-; forget to tweak pm.* to fit your needs.
111
-; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
112
-; Note: This value is mandatory.
113
-pm.max_children = 5
114
-
115
-; The number of child processes created on startup.
116
-; Note: Used only when pm is set to 'dynamic'
117
-; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
118
-pm.start_servers = 2
119
-
120
-; The desired minimum number of idle server processes.
121
-; Note: Used only when pm is set to 'dynamic'
122
-; Note: Mandatory when pm is set to 'dynamic'
123
-pm.min_spare_servers = 1
124
-
125
-; The desired maximum number of idle server processes.
126
-; Note: Used only when pm is set to 'dynamic'
127
-; Note: Mandatory when pm is set to 'dynamic'
128
-pm.max_spare_servers = 3
129
-
130
-; The number of seconds after which an idle process will be killed.
131
-; Note: Used only when pm is set to 'ondemand'
132
-; Default Value: 10s
133
-;pm.process_idle_timeout = 10s;
134
-
135
-; The number of requests each child process should execute before respawning.
136
-; This can be useful to work around memory leaks in 3rd party libraries. For
137
-; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
138
-; Default Value: 0
139
-;pm.max_requests = 500
140
-
141
-; The URI to view the FPM status page. If this value is not set, no URI will be
142
-; recognized as a status page. It shows the following informations:
143
-;   pool                 - the name of the pool;
144
-;   process manager      - static, dynamic or ondemand;
145
-;   start time           - the date and time FPM has started;
146
-;   start since          - number of seconds since FPM has started;
147
-;   accepted conn        - the number of request accepted by the pool;
148
-;   listen queue         - the number of request in the queue of pending
149
-;                          connections (see backlog in listen(2));
150
-;   max listen queue     - the maximum number of requests in the queue
151
-;                          of pending connections since FPM has started;
152
-;   listen queue len     - the size of the socket queue of pending connections;
153
-;   idle processes       - the number of idle processes;
154
-;   active processes     - the number of active processes;
155
-;   total processes      - the number of idle + active processes;
156
-;   max active processes - the maximum number of active processes since FPM
157
-;                          has started;
158
-;   max children reached - number of times, the process limit has been reached,
159
-;                          when pm tries to start more children (works only for
160
-;                          pm 'dynamic' and 'ondemand');
161
-; Value are updated in real time.
162
-; Example output:
163
-;   pool:                 www
164
-;   process manager:      static
165
-;   start time:           01/Jul/2011:17:53:49 +0200
166
-;   start since:          62636
167
-;   accepted conn:        190460
168
-;   listen queue:         0
169
-;   max listen queue:     1
170
-;   listen queue len:     42
171
-;   idle processes:       4
172
-;   active processes:     11
173
-;   total processes:      15
174
-;   max active processes: 12
175
-;   max children reached: 0
176
-;
177
-; By default the status page output is formatted as text/plain. Passing either
178
-; 'html', 'xml' or 'json' in the query string will return the corresponding
179
-; output syntax. Example:
180
-;   http://www.foo.bar/status
181
-;   http://www.foo.bar/status?json
182
-;   http://www.foo.bar/status?html
183
-;   http://www.foo.bar/status?xml
184
-;
185
-; By default the status page only outputs short status. Passing 'full' in the
186
-; query string will also return status for each pool process.
187
-; Example:
188
-;   http://www.foo.bar/status?full
189
-;   http://www.foo.bar/status?json&full
190
-;   http://www.foo.bar/status?html&full
191
-;   http://www.foo.bar/status?xml&full
192
-; The Full status returns for each process:
193
-;   pid                  - the PID of the process;
194
-;   state                - the state of the process (Idle, Running, ...);
195
-;   start time           - the date and time the process has started;
196
-;   start since          - the number of seconds since the process has started;
197
-;   requests             - the number of requests the process has served;
198
-;   request duration     - the duration in µs of the requests;
199
-;   request method       - the request method (GET, POST, ...);
200
-;   request URI          - the request URI with the query string;
201
-;   content length       - the content length of the request (only with POST);
202
-;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
203
-;   script               - the main script called (or '-' if not set);
204
-;   last request cpu     - the %cpu the last request consumed
205
-;                          it's always 0 if the process is not in Idle state
206
-;                          because CPU calculation is done when the request
207
-;                          processing has terminated;
208
-;   last request memory  - the max amount of memory the last request consumed
209
-;                          it's always 0 if the process is not in Idle state
210
-;                          because memory calculation is done when the request
211
-;                          processing has terminated;
212
-; If the process is in Idle state, then informations are related to the
213
-; last request the process has served. Otherwise informations are related to
214
-; the current request being served.
215
-; Example output:
216
-;   ************************
217
-;   pid:                  31330
218
-;   state:                Running
219
-;   start time:           01/Jul/2011:17:53:49 +0200
220
-;   start since:          63087
221
-;   requests:             12808
222
-;   request duration:     1250261
223
-;   request method:       GET
224
-;   request URI:          /test_mem.php?N=10000
225
-;   content length:       0
226
-;   user:                 -
227
-;   script:               /home/fat/web/docs/php/test_mem.php
228
-;   last request cpu:     0.00
229
-;   last request memory:  0
230
-;
231
-; Note: There is a real-time FPM status monitoring sample web page available
232
-;       It's available in: /usr/share/php/7.0/fpm/status.html
233
-;
234
-; Note: The value must start with a leading slash (/). The value can be
235
-;       anything, but it may not be a good idea to use the .php extension or it
236
-;       may conflict with a real PHP file.
237
-; Default Value: not set
238
-;pm.status_path = /status
239
-
240
-; The ping URI to call the monitoring page of FPM. If this value is not set, no
241
-; URI will be recognized as a ping page. This could be used to test from outside
242
-; that FPM is alive and responding, or to
243
-; - create a graph of FPM availability (rrd or such);
244
-; - remove a server from a group if it is not responding (load balancing);
245
-; - trigger alerts for the operating team (24/7).
246
-; Note: The value must start with a leading slash (/). The value can be
247
-;       anything, but it may not be a good idea to use the .php extension or it
248
-;       may conflict with a real PHP file.
249
-; Default Value: not set
250
-;ping.path = /ping
251
-
252
-; This directive may be used to customize the response of a ping request. The
253
-; response is formatted as text/plain with a 200 response code.
254
-; Default Value: pong
255
-;ping.response = pong
256
-
257
-; The access log file
258
-; Default: not set
259
-;access.log = log/$pool.access.log
260
-
261
-; The access log format.
262
-; The following syntax is allowed
263
-;  %%: the '%' character
264
-;  %C: %CPU used by the request
265
-;      it can accept the following format:
266
-;      - %{user}C for user CPU only
267
-;      - %{system}C for system CPU only
268
-;      - %{total}C  for user + system CPU (default)
269
-;  %d: time taken to serve the request
270
-;      it can accept the following format:
271
-;      - %{seconds}d (default)
272
-;      - %{miliseconds}d
273
-;      - %{mili}d
274
-;      - %{microseconds}d
275
-;      - %{micro}d
276
-;  %e: an environment variable (same as $_ENV or $_SERVER)
277
-;      it must be associated with embraces to specify the name of the env
278
-;      variable. Some exemples:
279
-;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
280
-;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
281
-;  %f: script filename
282
-;  %l: content-length of the request (for POST request only)
283
-;  %m: request method
284
-;  %M: peak of memory allocated by PHP
285
-;      it can accept the following format:
286
-;      - %{bytes}M (default)
287
-;      - %{kilobytes}M
288
-;      - %{kilo}M
289
-;      - %{megabytes}M
290
-;      - %{mega}M
291
-;  %n: pool name
292
-;  %o: output header
293
-;      it must be associated with embraces to specify the name of the header:
294
-;      - %{Content-Type}o
295
-;      - %{X-Powered-By}o
296
-;      - %{Transfert-Encoding}o
297
-;      - ....
298
-;  %p: PID of the child that serviced the request
299
-;  %P: PID of the parent of the child that serviced the request
300
-;  %q: the query string
301
-;  %Q: the '?' character if query string exists
302
-;  %r: the request URI (without the query string, see %q and %Q)
303
-;  %R: remote IP address
304
-;  %s: status (response code)
305
-;  %t: server time the request was received
306
-;      it can accept a strftime(3) format:
307
-;      %d/%b/%Y:%H:%M:%S %z (default)
308
-;      The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
309
-;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
310
-;  %T: time the log has been written (the request has finished)
311
-;      it can accept a strftime(3) format:
312
-;      %d/%b/%Y:%H:%M:%S %z (default)
313
-;      The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
314
-;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
315
-;  %u: remote user
316
-;
317
-; Default: "%R - %u %t \"%m %r\" %s"
318
-;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
319
-
320
-; The log file for slow requests
321
-; Default Value: not set
322
-; Note: slowlog is mandatory if request_slowlog_timeout is set
323
-;slowlog = log/$pool.log.slow
324
-
325
-; The timeout for serving a single request after which a PHP backtrace will be
326
-; dumped to the 'slowlog' file. A value of '0s' means 'off'.
327
-; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
328
-; Default Value: 0
329
-;request_slowlog_timeout = 0
330
-
331
-; The timeout for serving a single request after which the worker process will
332
-; be killed. This option should be used when the 'max_execution_time' ini option
333
-; does not stop script execution for some reason. A value of '0' means 'off'.
334
-; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
335
-; Default Value: 0
336
-request_terminate_timeout = 1d
337
-
338
-; Set open file descriptor rlimit.
339
-; Default Value: system defined value
340
-;rlimit_files = 1024
341
-
342
-; Set max core size rlimit.
343
-; Possible Values: 'unlimited' or an integer greater or equal to 0
344
-; Default Value: system defined value
345
-;rlimit_core = 0
346
-
347
-; Chroot to this directory at the start. This value must be defined as an
348
-; absolute path. When this value is not set, chroot is not used.
349
-; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
350
-; of its subdirectories. If the pool prefix is not set, the global prefix
351
-; will be used instead.
352
-; Note: chrooting is a great security feature and should be used whenever
353
-;       possible. However, all PHP paths will be relative to the chroot
354
-;       (error_log, sessions.save_path, ...).
355
-; Default Value: not set
356
-;chroot =
357
-
358
-; Chdir to this directory at the start.
359
-; Note: relative path can be used.
360
-; Default Value: current directory or / when chroot
361
-chdir = __FINALPATH__
362
-
363
-; Redirect worker stdout and stderr into main error log. If not set, stdout and
364
-; stderr will be redirected to /dev/null according to FastCGI specs.
365
-; Note: on highloaded environement, this can cause some delay in the page
366
-; process time (several ms).
367
-; Default Value: no
368
-;catch_workers_output = yes
369
-
370
-; Clear environment in FPM workers
371
-; Prevents arbitrary environment variables from reaching FPM worker processes
372
-; by clearing the environment in workers before env vars specified in this
373
-; pool configuration are added.
374
-; Setting to "no" will make all environment variables available to PHP code
375
-; via getenv(), $_ENV and $_SERVER.
376
-; Default Value: yes
377
-;clear_env = no
378
-
379
-; Limits the extensions of the main script FPM will allow to parse. This can
380
-; prevent configuration mistakes on the web server side. You should only limit
381
-; FPM to .php extensions to prevent malicious users to use other extensions to
382
-; execute php code.
383
-; Note: set an empty value to allow all extensions.
384
-; Default Value: .php
385
-;security.limit_extensions = .php .php3 .php4 .php5 .php7
386
-
387
-; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
388
-; the current environment.
389
-; Default Value: clean env
390
-;env[HOSTNAME] = $HOSTNAME
391
-;env[PATH] = /usr/local/bin:/usr/bin:/bin
392
-;env[TMP] = /tmp
393
-;env[TMPDIR] = /tmp
394
-;env[TEMP] = /tmp
395
-
396
-; Additional php.ini defines, specific to this pool of workers. These settings
397
-; overwrite the values previously defined in the php.ini. The directives are the
398
-; same as the PHP SAPI:
399
-;   php_value/php_flag             - you can set classic ini defines which can
400
-;                                    be overwritten from PHP call 'ini_set'.
401
-;   php_admin_value/php_admin_flag - these directives won't be overwritten by
402
-;                                     PHP call 'ini_set'
403
-; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
404
-
405
-; Defining 'extension' will load the corresponding shared extension from
406
-; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
407
-; overwrite previously defined php.ini values, but will append the new value
408
-; instead.
409
-
410
-; Note: path INI options can be relative and will be expanded with the prefix
411
-; (pool, global or /usr)
412
-
413
-; Default Value: nothing is defined by default except the values in php.ini and
414
-;                specified at startup with the -d argument
415
-;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
416
-;php_flag[display_errors] = off
417
-;php_admin_value[error_log] = /var/log/fpm-php.www.log
418
-;php_admin_flag[log_errors] = on
419
-;php_admin_value[memory_limit] = 32M
420
-
421
-; Common values to change to increase file upload limit
422
-; php_admin_value[upload_max_filesize] = 50M
423
-; php_admin_value[post_max_size] = 50M
424
-; php_admin_flag[mail.add_x_header] = Off
425
-
426
-; Other common parameters
427
-; php_admin_value[max_execution_time] = 600
428
-; php_admin_value[max_input_time] = 300
429
-; php_admin_value[memory_limit] = 256M
430
-; php_admin_flag[short_open_tag] = On

+ 2
- 2
conf/systemd.service View File

@@ -1,5 +1,5 @@
1 1
 [Unit]
2
-Description=Small description of the service
2
+Description=An alternative Web interface for YouTube
3 3
 After=network.target
4 4
 
5 5
 [Service]
@@ -7,7 +7,7 @@ Type=simple
7 7
 User=__APP__
8 8
 Group=__APP__
9 9
 WorkingDirectory=__FINALPATH__/
10
-ExecStart=__FINALPATH__/script >> /var/log/__APP__/__APP__.log 2>&1
10
+ExecStart=__FINALPATH__/invidious >> /var/log/__APP__/__APP__.log 2>&1
11 11
 
12 12
 [Install]
13 13
 WantedBy=multi-user.target

+ 23
- 22
manifest.json View File

@@ -1,27 +1,26 @@
1 1
 {
2
-    "name": "YunoHost example app",
3
-    "id": "ynhexample",
2
+    "name": "Invidious",
3
+    "id": "invidious",
4 4
     "packaging_format": 1,
5 5
     "description": {
6
-        "en": "Example package for YunoHost application.",
7
-        "fr": "Exemple de package d’application pour YunoHost."
6
+        "en": "An alternative Web interface for YouTube",
7
+        "fr": "Une interface Web alternative pour YouTube"
8 8
     },
9
-    "version": "1.0~ynh1",
10
-    "url": "https://example.com",
11
-    "license": "free",
9
+    "version": "0.19.1~ynh1",
10
+    "url": "https://github.com/omarroth/invidious/",
11
+    "license": "AGPL-3.0-or-later",
12 12
     "maintainer": {
13
-        "name": "John doe",
14
-        "email": "john.doe@example.com",
15
-        "url": "http://example.com"
13
+        "name": "Miraty",
14
+        "email": "miraty@antopie.org",
15
+        "url": "https://www.antopie.org"
16 16
     },
17 17
     "requirements": {
18
-        "yunohost": ">= 3.4"
18
+        "yunohost": ">= 3.6"
19 19
     },
20 20
     "multi_instance": true,
21 21
     "services": [
22 22
         "nginx",
23
-        "php7.0-fpm",
24
-        "mysql"
23
+        "postgresql"
25 24
     ],
26 25
     "arguments": {
27 26
         "install" : [
@@ -29,20 +28,20 @@
29 28
                 "name": "domain",
30 29
                 "type": "domain",
31 30
                 "ask": {
32
-                    "en": "Choose a domain name for ynhexample",
33
-                    "fr": "Choisissez un nom de domaine pour ynhexample"
31
+                    "en": "Choose a domain name for Invidious",
32
+                    "fr": "Choisissez un nom de domaine pour Invidious"
34 33
                 },
35
-                "example": "example.com"
34
+                "example": "yt.example.org"
36 35
             },
37 36
             {
38 37
                 "name": "path",
39 38
                 "type": "path",
40 39
                 "ask": {
41
-                    "en": "Choose a path for ynhexample",
42
-                    "fr": "Choisissez un chemin pour ynhexample"
40
+                    "en": "Choose a path for Invidious",
41
+                    "fr": "Choisissez un chemin pour Invidious"
43 42
                 },
44
-                "example": "/example",
45
-                "default": "/example"
43
+                "example": "/invidious",
44
+                "default": "/invidious"
46 45
             },
47 46
             {
48 47
                 "name": "admin",
@@ -51,7 +50,8 @@
51 50
                     "en": "Choose an admin user",
52 51
                     "fr": "Choisissez l’administrateur"
53 52
                 },
54
-                "example": "johndoe"
53
+                "example": "chnorris",
54
+                "default": "miraty"
55 55
             },
56 56
             {
57 57
                 "name": "is_public",
@@ -83,7 +83,8 @@
83 83
                     "en": "Use the help field to add an information for the admin about this question.",
84 84
                     "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question."
85 85
                 },
86
-                "example": "Choose a password"
86
+                "example": "Choose a password",
87
+                "default": "ezaruioezcahxaufkejhvbzft"
87 88
             }
88 89
         ]
89 90
     }

+ 1
- 1
scripts/_common.sh View File

@@ -5,7 +5,7 @@
5 5
 #=================================================
6 6
 
7 7
 # dependencies used by the app
8
-pkg_dependencies="deb1 deb2"
8
+pkg_dependencies="crystal libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev librsvg2-dev postgresql imagemagick libsqlite3-dev"
9 9
 
10 10
 #=================================================
11 11
 # PERSONAL HELPERS

+ 61
- 42
scripts/install View File

@@ -104,9 +104,29 @@ ynh_print_info "Installing dependencies..."
104 104
 ynh_install_app_dependencies $pkg_dependencies
105 105
 
106 106
 #=================================================
107
+# DOWNLOAD, CHECK AND UNPACK SOURCE
108
+#=================================================
109
+#ynh_print_info "Setting up source files..."
110
+
111
+### `ynh_setup_source` is used to install an app from a zip or tar.gz file,
112
+### downloaded from an upstream source, like a git repository.
113
+### `ynh_setup_source` use the file conf/app.src
114
+
115
+#ynh_app_setting_set $app final_path $final_path
116
+# Download, check integrity, uncompress and patch the source from app.src
117
+#ynh_setup_source "$final_path"
118
+
119
+cd /var/www/
120
+git clone https://github.com/omarroth/invidious
121
+cd /var/www/invidious/
122
+git checkout tags/0.19.1
123
+cd /home/invidious_ynh/scripts/
124
+
125
+
126
+#=================================================
107 127
 # CREATE A MYSQL DATABASE
108 128
 #=================================================
109
-ynh_print_info "Creating a MySQL database..."
129
+#ynh_print_info "Creating a MySQL database..."
110 130
 
111 131
 ### Use these lines if you need a database for the application.
112 132
 ### `ynh_mysql_setup_db` will create a database, an associated user and a ramdom password.
@@ -117,22 +137,31 @@ ynh_print_info "Creating a MySQL database..."
117 137
 ###		- Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script
118 138
 ###		- As well as the section "RESTORE THE MYSQL DATABASE" in the restore script
119 139
 
120
-db_name=$(ynh_sanitize_dbid $app)
121
-ynh_app_setting_set $app db_name $db_name
122
-ynh_mysql_setup_db $db_name $db_name
140
+#db_name=$(ynh_sanitize_dbid $app)
141
+#ynh_app_setting_set $app db_name $db_name
142
+#ynh_mysql_setup_db $db_name $db_name
123 143
 
124 144
 #=================================================
125
-# DOWNLOAD, CHECK AND UNPACK SOURCE
145
+# CREATE A POSTGRESQL DATABASE
126 146
 #=================================================
127
-ynh_print_info "Setting up source files..."
147
+ynh_print_info "Creating a PostgreSQL database..."
148
+
149
+ynh_psql_setup_db --db_user=kemal --db_name=invidious
150
+
151
+ynh_psql_test_if_first_run
152
+
153
+ynh_replace_string --match_string="  password: kemal" --replace_string="  password: $db_pwd" --target_file=$final_path/config/config.yml
154
+
155
+ynh_psql_execute_file_as_root --database=invidious --file=/var/www/invidious/config/sql/channels.sql
156
+ynh_psql_execute_file_as_root --database=invidious --file=/var/www/invidious/config/sql/videos.sql
157
+ynh_psql_execute_file_as_root --database=invidious --file=/var/www/invidious/config/sql/channel_videos.sql
158
+ynh_psql_execute_file_as_root --database=invidious --file=/var/www/invidious/config/sql/users.sql
159
+ynh_psql_execute_file_as_root --database=invidious --file=/var/www/invidious/config/sql/session_ids.sql
160
+ynh_psql_execute_file_as_root --database=invidious --file=/var/www/invidious/config/sql/nonces.sql
161
+ynh_psql_execute_file_as_root --database=invidious --file=/var/www/invidious/config/sql/annotations.sql
162
+
128 163
 
129
-### `ynh_setup_source` is used to install an app from a zip or tar.gz file,
130
-### downloaded from an upstream source, like a git repository.
131
-### `ynh_setup_source` use the file conf/app.src
132 164
 
133
-ynh_app_setting_set $app final_path $final_path
134
-# Download, check integrity, uncompress and patch the source from app.src
135
-ynh_setup_source "$final_path"
136 165
 
137 166
 #=================================================
138 167
 # NGINX CONFIGURATION
@@ -152,30 +181,20 @@ ynh_print_info "Configuring system user..."
152 181
 # Create a system user
153 182
 ynh_system_user_create $app
154 183
 
184
+
155 185
 #=================================================
156
-# PHP-FPM CONFIGURATION
186
+# SPECIFIC SETUP
157 187
 #=================================================
158
-ynh_print_info "Configuring php-fpm..."
159 188
 
160
-### `ynh_add_fpm_config` is used to set up a PHP config.
161
-### You can remove it if your app doesn't use PHP.
162
-### `ynh_add_fpm_config` will use the files conf/php-fpm.conf and conf/php-fpm.ini
163
-### If you're not using these lines:
164
-###		- You can remove these files in conf/.
165
-###		- Remove the section "BACKUP THE PHP-FPM CONFIGURATION" in the backup script
166
-###		- Remove also the section "REMOVE PHP-FPM CONFIGURATION" in the remove script
167
-###		- As well as the section "RESTORE THE PHP-FPM CONFIGURATION" in the restore script
168
-###		With the reload at the end of the script.
169
-###		- And the section "PHP-FPM CONFIGURATION" in the upgrade script
170 189
 
171
-# Create a dedicated php-fpm config
172
-ynh_add_fpm_config
190
+#sudo -i -u invidious
191
+cd /var/www/invidious/
192
+shards update && shards install
193
+crystal build src/invidious.cr --release
194
+cd /home/invidious_ynh/scripts/
195
+#exit
173 196
 
174 197
 #=================================================
175
-# SPECIFIC SETUP
176
-#=================================================
177
-# ...
178
-#=================================================
179 198
 
180 199
 #=================================================
181 200
 # SETUP SYSTEMD
@@ -206,26 +225,26 @@ ynh_add_systemd_config
206 225
 ### forms.
207 226
 
208 227
 # Set right permissions for curl install
209
-chown -R $app: $final_path
228
+#chown -R $app: $final_path
210 229
 
211 230
 # Set the app as temporarily public for curl call
212
-ynh_print_info "Configuring SSOwat..."
213
-ynh_app_setting_set $app skipped_uris "/"
231
+#ynh_print_info "Configuring SSOwat..."
232
+#ynh_app_setting_set $app skipped_uris "/"
214 233
 # Reload SSOwat config
215
-yunohost app ssowatconf
234
+#yunohost app ssowatconf
216 235
 
217 236
 # Reload Nginx
218
-systemctl reload nginx
237
+#systemctl reload nginx
219 238
 
220 239
 # Installation with curl
221
-ynh_print_info "Finalizing installation..."
222
-ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
240
+#ynh_print_info "Finalizing installation..."
241
+#ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
223 242
 
224 243
 # Remove the public access
225
-if [ $is_public -eq 0 ]
226
-then
227
-	ynh_app_setting_delete $app skipped_uris
228
-fi
244
+#if [ $is_public -eq 0 ]
245
+#then
246
+#	ynh_app_setting_delete $app skipped_uris
247
+#fi
229 248
 
230 249
 #=================================================
231 250
 # MODIFY A CONFIG FILE
@@ -234,7 +253,7 @@ fi
234 253
 ### `ynh_replace_string` is used to replace a string in a file.
235 254
 ### (It's compatible with sed regular expressions syntax)
236 255
 
237
-ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE"
256
+#ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE"
238 257
 
239 258
 #=================================================
240 259
 # STORE THE CONFIG FILE CHECKSUM

+ 13
- 10
scripts/remove View File

@@ -46,10 +46,20 @@ ynh_remove_systemd_config
46 46
 #=================================================
47 47
 # REMOVE THE MYSQL DATABASE
48 48
 #=================================================
49
-ynh_print_info "Removing the MySQL database"
49
+#ynh_print_info "Removing the MySQL database"
50 50
 
51 51
 # Remove a database if it exists, along with the associated user
52
-ynh_mysql_remove_db $db_user $db_name
52
+#ynh_mysql_remove_db $db_user $db_name
53
+
54
+#=================================================
55
+# REMOVE THE POSTGRESQL DATABASE
56
+#=================================================
57
+ynh_print_info "Removing the PostgreSQL database"
58
+
59
+ynh_psql_remove_db --db_user=kemal --db_name=invidious
60
+ynh_psql_remove_db --db_user=invidious --db_name=invidious
61
+ynh_psql_remove_db --db_user=kemal --db_name=kemal
62
+ynh_psql_remove_db --db_user=invidious --db_name=kemal
53 63
 
54 64
 #=================================================
55 65
 # REMOVE DEPENDENCIES
@@ -65,7 +75,7 @@ ynh_remove_app_dependencies
65 75
 ynh_print_info "Removing app main directory"
66 76
 
67 77
 # Remove the app directory securely
68
-ynh_secure_remove "$final_path"
78
+ynh_secure_remove --file=/var/www/invidious
69 79
 
70 80
 #=================================================
71 81
 # REMOVE NGINX CONFIGURATION
@@ -75,13 +85,6 @@ ynh_print_info "Removing nginx web server configuration"
75 85
 # Remove the dedicated nginx config
76 86
 ynh_remove_nginx_config
77 87
 
78
-#=================================================
79
-# REMOVE PHP-FPM CONFIGURATION
80
-#=================================================
81
-ynh_print_info "Removing php-fpm configuration"
82
-
83
-# Remove the dedicated php-fpm config
84
-ynh_remove_fpm_config
85 88
 
86 89
 #=================================================
87 90
 # REMOVE LOGROTATE CONFIGURATION

+ 0
- 2
sources/patches/.gitignore View File

@@ -1,2 +0,0 @@
1
-*~
2
-*.sw[op]

Loading…
Cancel
Save