aboutsummaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorGiteaBot <teabot@gitea.io>2022-01-02 00:28:42 +0000
committerGiteaBot <teabot@gitea.io>2022-01-02 00:28:42 +0000
commit6a3611cc3d3b2e401464a855f4630f606f52eb67 (patch)
tree9e50a07c7a003b1e61af7fa877a4d563f8ac271f /options
parent7db2f110adbd020e70c56497306cfbda8806d109 (diff)
downloadgitea-6a3611cc3d3b2e401464a855f4630f606f52eb67.tar.gz
gitea-6a3611cc3d3b2e401464a855f4630f606f52eb67.zip
[skip ci] Updated licenses and gitignores
Diffstat (limited to 'options')
-rw-r--r--options/gitignore/Jekyll3
-rw-r--r--options/gitignore/Umbraco13
-rw-r--r--options/gitignore/VisualStudioCode2
-rw-r--r--options/gitignore/core38
-rw-r--r--options/license/App-s2p5
-rw-r--r--options/license/DL-DE-BY-2.045
6 files changed, 105 insertions, 1 deletions
diff --git a/options/gitignore/Jekyll b/options/gitignore/Jekyll
index 2ca868298c..74a9223a45 100644
--- a/options/gitignore/Jekyll
+++ b/options/gitignore/Jekyll
@@ -2,3 +2,6 @@ _site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata
+# Ignore folders generated by Bundler
+.bundle/
+vendor/
diff --git a/options/gitignore/Umbraco b/options/gitignore/Umbraco
index cea9c890c3..86b91f300d 100644
--- a/options/gitignore/Umbraco
+++ b/options/gitignore/Umbraco
@@ -34,3 +34,16 @@
# Ignore the Models Builder models out of date flag
**/ood.flag
+
+# NEW for version 9 .Net 5 (Core)
+#ignore umbraco backoffice assest from wwwroot
+**/wwwroot/umbraco/
+
+#ignore umbraco data/views/settings
+**/umbraco/
+
+#include default location for modelsbuilder output
+!**/umbraco/models
+
+#include default location for packages
+!**/umbraco/Data/packages \ No newline at end of file
diff --git a/options/gitignore/VisualStudioCode b/options/gitignore/VisualStudioCode
index 7478c2746e..45fce1d71c 100644
--- a/options/gitignore/VisualStudioCode
+++ b/options/gitignore/VisualStudioCode
@@ -1,4 +1,4 @@
-.vscode/
+.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
diff --git a/options/gitignore/core b/options/gitignore/core
new file mode 100644
index 0000000000..c4d93934ad
--- /dev/null
+++ b/options/gitignore/core
@@ -0,0 +1,38 @@
+*.swp
+*.*~
+project.lock.json
+.DS_Store
+*.pyc
+nupkg/
+
+# Visual Studio Code
+.vscode
+
+# Rider
+.idea
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+build/
+bld/
+[Bb]in/
+[Oo]bj/
+[Oo]ut/
+msbuild.log
+msbuild.err
+msbuild.wrn
+
+# Visual Studio 2015
+.vs/
+
diff --git a/options/license/App-s2p b/options/license/App-s2p
new file mode 100644
index 0000000000..b19eabf068
--- /dev/null
+++ b/options/license/App-s2p
@@ -0,0 +1,5 @@
+COPYRIGHT and LICENSE
+
+This program is free and open software. You may use, modify,
+distribute, and sell this program (and any modified variants) in any
+way you wish, provided you do not restrict others from doing the same.
diff --git a/options/license/DL-DE-BY-2.0 b/options/license/DL-DE-BY-2.0
new file mode 100644
index 0000000000..20c3a19c2f
--- /dev/null
+++ b/options/license/DL-DE-BY-2.0
@@ -0,0 +1,45 @@
+DL-DE->BY-2.0
+Datenlizenz Deutschland – Namensnennung – Version 2.0
+
+(1) Jede Nutzung ist unter den Bedingungen dieser „Datenlizenz Deutschland – Namensnennung – Version 2.0" zulässig.
+
+Die bereitgestellten Daten und Metadaten dürfen für die kommerzielle und nicht kommerzielle Nutzung insbesondere
+
+ vervielfältigt, ausgedruckt, präsentiert, verändert, bearbeitet sowie an Dritte übermittelt werden;
+ mit eigenen Daten und Daten Anderer zusammengeführt und zu selbständigen neuen Datensätzen verbunden werden;
+ in interne und externe Geschäftsprozesse, Produkte und Anwendungen in öffentlichen und nicht öffentlichen elektronischen Netzwerken eingebunden werden.
+
+(2) Bei der Nutzung ist sicherzustellen, dass folgende Angaben als Quellenvermerk enthalten sind:
+
+ Bezeichnung des Bereitstellers nach dessen Maßgabe,
+ der Vermerk „Datenlizenz Deutschland – Namensnennung – Version 2.0" oder „dl-de/by-2-0" mit Verweis auf den Lizenztext unter www.govdata.de/dl-de/by-2-0 sowie
+ einen Verweis auf den Datensatz (URI).
+
+Dies gilt nur soweit die datenhaltende Stelle die Angaben 1. bis 3. zum Quellenvermerk bereitstellt.
+
+(3) Veränderungen, Bearbeitungen, neue Gestaltungen oder sonstige Abwandlungen sind im Quellenvermerk mit dem Hinweis zu versehen, dass die Daten geändert wurden.
+
+
+Data licence Germany – attribution – version 2.0
+
+(1) Any use will be permitted provided it fulfils the requirements of this "Data licence Germany – attribution – Version 2.0".
+
+The data and meta-data provided may, for commercial and non-commercial use, in particular
+
+ be copied, printed, presented, altered, processed and transmitted to third parties;
+ be merged with own data and with the data of others and be combined to form new and independent datasets;
+ be integrated in internal and external business processes, products and applications in public and non-public electronic networks.
+
+(2) The user must ensure that the source note contains the following information:
+
+ the name of the provider,
+ the annotation "Data licence Germany – attribution – Version 2.0" or "dl-de/by-2-0" referring to the licence text available at www.govdata.de/dl-de/by-2-0, and
+ a reference to the dataset (URI).
+
+This applies only if the entity keeping the data provides the pieces of information 1-3 for the source note.
+
+(3) Changes, editing, new designs or other amendments must be marked as such in the source note.
+
+
+
+URL: http://www.govdata.de/dl-de/by-2-0
ion> Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/Log/File.php
blob: d53484f086d6a39f7480137b4cdd3d307e061a1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
/**
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 *
 * @author Robin McCorkell <robin@mccorkell.me.uk>
 * @author Thomas Pulzer <t.pulzer@kniel.de>
 *
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

namespace OC\Core\Command\Log;

use \OCP\IConfig;

use Stecman\Component\Symfony\Console\BashCompletion\Completion;
use Stecman\Component\Symfony\Console\BashCompletion\Completion\ShellPathCompletion;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class File extends Command implements Completion\CompletionAwareInterface {

	/** @var IConfig */
	protected $config;

	public function __construct(IConfig $config) {
		$this->config = $config;
		parent::__construct();
	}

	protected function configure() {
		$this
			->setName('log:file')
			->setDescription('manipulate logging backend')
			->addOption(
				'enable',
				null,
				InputOption::VALUE_NONE,
				'enable this logging backend'
			)
			->addOption(
				'file',
				null,
				InputOption::VALUE_REQUIRED,
				'set the log file path'
			)
			->addOption(
				'rotate-size',
				null,
				InputOption::VALUE_REQUIRED,
				'set the file size for log rotation, 0 = disabled'
			)
		;
	}

	protected function execute(InputInterface $input, OutputInterface $output) {
		$toBeSet = [];

		if ($input->getOption('enable')) {
			$toBeSet['log_type'] = 'file';
		}

		if ($file = $input->getOption('file')) {
			$toBeSet['logfile'] = $file;
		}

		if (($rotateSize = $input->getOption('rotate-size')) !== null) {
			$rotateSize = \OCP\Util::computerFileSize($rotateSize);
			$this->validateRotateSize($rotateSize);
			$toBeSet['log_rotate_size'] = $rotateSize;
		}

		// set config
		foreach ($toBeSet as $option => $value) {
			$this->config->setSystemValue($option, $value);
		}

		// display config
		// TODO: Drop backwards compatibility for config in the future
		$logType = $this->config->getSystemValue('log_type', 'file');
		if ($logType === 'file' || $logType === 'owncloud') {
			$enabledText = 'enabled';
		} else {
			$enabledText = 'disabled';
		}
		$output->writeln('Log backend file: '.$enabledText);

		$dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data');
		$defaultLogFile = rtrim($dataDir, '/').'/nextcloud.log';
		$output->writeln('Log file: '.$this->config->getSystemValue('logfile', $defaultLogFile));

		$rotateSize = $this->config->getSystemValue('log_rotate_size', 0);
		if ($rotateSize) {
			$rotateString = \OCP\Util::humanFileSize($rotateSize);
		} else {
			$rotateString = 'disabled';
		}
		$output->writeln('Rotate at: '.$rotateString);
	}

	/**
	 * @param mixed $rotateSize
	 * @throws \InvalidArgumentException
	 */
	protected function validateRotateSize(&$rotateSize) {
		if ($rotateSize === false) {
			throw new \InvalidArgumentException('Error parsing log rotation file size');
		}
		$rotateSize = (int) $rotateSize;
		if ($rotateSize < 0) {
			throw new \InvalidArgumentException('Log rotation file size must be non-negative');
		}
	}

	/**
	 * @param string $optionName
	 * @param CompletionContext $context
	 * @return string[]
	 */
	public function completeOptionValues($optionName, CompletionContext $context) {
		if ($optionName === 'file') {
			$helper = new ShellPathCompletion(
				$this->getName(),
				'file',
				Completion::TYPE_OPTION
			);
			return $helper->run();
		} else if ($optionName === 'rotate-size') {
			return [0];
		}
		return [];
	}

	/**
	 * @param string $argumentName
	 * @param CompletionContext $context
	 * @return string[]
	 */
	public function completeArgumentValues($argumentName, CompletionContext $context) {
		return [];
	}
}