Compare commits
18 Commits
7af312e960
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7517b373f6 | |||
| 58fe2295c3 | |||
| d2eb161045 | |||
| dbb6407cb6 | |||
| 8d6ef37d52 | |||
| 85b8c1cdb5 | |||
| c7516cfd6e | |||
| 3525523167 | |||
| 498b01ddd1 | |||
| 86e34d222a | |||
| 94b85461b3 | |||
| e908f27839 | |||
| cc4b5a4cbf | |||
| e9cfd671ac | |||
| 096a4470c3 | |||
| 9178cd7a63 | |||
| e1de57ecf2 | |||
| bc63b49173 |
13
.gitignore
vendored
Normal file
13
.gitignore
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# .NET
|
||||
**/bin/
|
||||
**/obj/
|
||||
|
||||
# Node
|
||||
node_modules/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
|
||||
# Python
|
||||
__pycache__/
|
||||
*.pyc
|
||||
23
README.md
23
README.md
@@ -1,3 +1,22 @@
|
||||
# alexr_teste
|
||||
### Alex's itschool place
|
||||
|
||||
Teste
|
||||
**Teste**
|
||||
|
||||
- element
|
||||
- element
|
||||
- sub-element
|
||||
* element
|
||||
|
||||
|
||||
1. Primul
|
||||
2. Al doilea
|
||||
3. Al treilea
|
||||
|
||||
|
||||
[Text link](https://example.com)
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
Folosesc `npm run dev`
|
||||
5
bandit_passwords.sh
Executable file
5
bandit_passwords.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Level 0 pw: ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If"
|
||||
echo "Level 1 pw: 263JGJPfgU6LtdEvgfWU1XP5yac29mFx"
|
||||
echo "Level 2 pw: MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx"
|
||||
63
docker-compose.yml
Normal file
63
docker-compose.yml
Normal file
@@ -0,0 +1,63 @@
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./www/app_php:/var/www/src
|
||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
depends_on:
|
||||
- php
|
||||
restart: unless-stopped
|
||||
|
||||
php:
|
||||
image: php:8.3-fpm
|
||||
volumes:
|
||||
- ./www/app_php:/var/www/src
|
||||
restart: unless-stopped
|
||||
|
||||
python:
|
||||
image: python:3.12-slim
|
||||
container_name: alex-python
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- .:/app
|
||||
command: python /app/www/script_python2.py
|
||||
ports:
|
||||
- "8088:8088"
|
||||
restart: unless-stopped
|
||||
dotnet:
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
container_name: alex-dotnet
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./www/programDotNet:/app
|
||||
command: dotnet run --urls http://0.0.0.0:8085
|
||||
ports:
|
||||
- "8085:8085"
|
||||
restart: unless-stopped
|
||||
|
||||
node:
|
||||
image: node:20-alpine
|
||||
container_name: alex-node
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- .:/app
|
||||
environment:
|
||||
- PORT=8090
|
||||
command: node /app/www/node_script.js
|
||||
ports:
|
||||
- "8090:8090"
|
||||
restart: unless-stopped
|
||||
gitea:
|
||||
image: gitea/gitea:latest
|
||||
container_name: alex-gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
ports:
|
||||
- "3000:3000" # Web UI
|
||||
- "222:2222" # SSH access
|
||||
restart: always
|
||||
5
docker/dotnet/Docker
Normal file
5
docker/dotnet/Docker
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
EXPOSE 8088
|
||||
ENTRYPOINT ["dotnet", "SimpleDotnetServer.dll"]
|
||||
22
docker/nginx/default.conf
Normal file
22
docker/nginx/default.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /var/www/src;
|
||||
index index.php index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass php:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
10
docker/php/Dockerfile
Normal file
10
docker/php/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM php:8.4-apache
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
unzip \
|
||||
nano \
|
||||
&& docker-php-ext-install pdo pdo_mysql \
|
||||
&& a2enmod rewrite
|
||||
|
||||
WORKDIR /var/www/html
|
||||
0
gitea/git/.ssh/authorized_keys
Normal file
0
gitea/git/.ssh/authorized_keys
Normal file
1
gitea/git/.ssh/environment
Normal file
1
gitea/git/.ssh/environment
Normal file
@@ -0,0 +1 @@
|
||||
GITEA_CUSTOM=/data/gitea
|
||||
BIN
gitea/gitea/avatars/c361f97850a1e5401e50b2efb6b52880
Normal file
BIN
gitea/gitea/avatars/c361f97850a1e5401e50b2efb6b52880
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
98
gitea/gitea/conf/app.ini
Normal file
98
gitea/gitea/conf/app.ini
Normal file
@@ -0,0 +1,98 @@
|
||||
APP_NAME = Gitea: Git with a cup of tea
|
||||
RUN_MODE = prod
|
||||
RUN_USER = git
|
||||
WORK_PATH = /data/gitea
|
||||
|
||||
[repository]
|
||||
ROOT = /data/git/repositories
|
||||
|
||||
[repository.local]
|
||||
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo
|
||||
|
||||
[repository.upload]
|
||||
TEMP_PATH = /data/gitea/uploads
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = /data/gitea
|
||||
DOMAIN = 192.168.64.4
|
||||
SSH_DOMAIN = 192.168.64.4
|
||||
HTTP_PORT = 3000
|
||||
ROOT_URL = http://192.168.64.4:3000/
|
||||
DISABLE_SSH = false
|
||||
SSH_PORT = 22
|
||||
SSH_LISTEN_PORT = 22
|
||||
LFS_START_SERVER = true
|
||||
LFS_JWT_SECRET = zubenABkxphGHSMZEo4FMMy7gAkQKeOin5gvd5Z4NHE
|
||||
OFFLINE_MODE = true
|
||||
|
||||
[database]
|
||||
PATH = /data/gitea/gitea.db
|
||||
DB_TYPE = mysql
|
||||
HOST = 192.168.64.1:3306
|
||||
NAME = gitea
|
||||
USER = root
|
||||
PASSWD = root
|
||||
LOG_SQL = false
|
||||
SCHEMA =
|
||||
SSL_MODE = disable
|
||||
|
||||
[indexer]
|
||||
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
|
||||
|
||||
[session]
|
||||
PROVIDER_CONFIG = /data/gitea/sessions
|
||||
PROVIDER = file
|
||||
|
||||
[picture]
|
||||
AVATAR_UPLOAD_PATH = /data/gitea/avatars
|
||||
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
|
||||
|
||||
[attachment]
|
||||
PATH = /data/gitea/attachments
|
||||
|
||||
[log]
|
||||
MODE = console
|
||||
LEVEL = info
|
||||
ROOT_PATH = /data/gitea/log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
SECRET_KEY =
|
||||
REVERSE_PROXY_LIMIT = 1
|
||||
REVERSE_PROXY_TRUSTED_PROXIES = *
|
||||
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE3NjU1Mzc4NDd9.Z2bWCWOnj6sB-iN8hmdfbc3-boE85MPC3pFHIrVGgAU
|
||||
PASSWORD_HASH_ALGO = pbkdf2
|
||||
|
||||
[service]
|
||||
DISABLE_REGISTRATION = false
|
||||
REQUIRE_SIGNIN_VIEW = false
|
||||
REGISTER_EMAIL_CONFIRM = false
|
||||
ENABLE_NOTIFY_MAIL = false
|
||||
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
|
||||
ENABLE_CAPTCHA = false
|
||||
DEFAULT_KEEP_EMAIL_PRIVATE = false
|
||||
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
|
||||
DEFAULT_ENABLE_TIMETRACKING = true
|
||||
NO_REPLY_ADDRESS = noreply.localhost
|
||||
|
||||
[lfs]
|
||||
PATH = /data/git/lfs
|
||||
|
||||
[mailer]
|
||||
ENABLED = false
|
||||
|
||||
[openid]
|
||||
ENABLE_OPENID_SIGNIN = true
|
||||
ENABLE_OPENID_SIGNUP = true
|
||||
|
||||
[cron.update_checker]
|
||||
ENABLED = false
|
||||
|
||||
[repository.pull-request]
|
||||
DEFAULT_MERGE_STYLE = merge
|
||||
|
||||
[repository.signing]
|
||||
DEFAULT_TRUST_MODEL = committer
|
||||
|
||||
[oauth2]
|
||||
JWT_SECRET = IRCOsEapdHrUSkbC9DshS4HR36E2FyUKFxhWHvUHZhw
|
||||
22
gitea/gitea/home/.gitconfig
Normal file
22
gitea/gitea/home/.gitconfig
Normal file
@@ -0,0 +1,22 @@
|
||||
[diff]
|
||||
algorithm = histogram
|
||||
[core]
|
||||
logallrefupdates = true
|
||||
quotePath = false
|
||||
commitGraph = true
|
||||
[gc]
|
||||
reflogexpire = 90
|
||||
writeCommitGraph = true
|
||||
[user]
|
||||
name = Gitea
|
||||
email = gitea@fake.local
|
||||
[receive]
|
||||
advertisePushOptions = true
|
||||
procReceiveRefs = refs/for
|
||||
[fetch]
|
||||
writeCommitGraph = true
|
||||
[safe]
|
||||
directory = *
|
||||
[uploadpack]
|
||||
allowfilter = true
|
||||
allowAnySHA1InWant = true
|
||||
1
gitea/gitea/indexers/issues.bleve/index_meta.json
Normal file
1
gitea/gitea/indexers/issues.bleve/index_meta.json
Normal file
@@ -0,0 +1 @@
|
||||
{"storage":"boltdb","index_type":"scorch"}
|
||||
1
gitea/gitea/indexers/issues.bleve/rupture_meta.json
Normal file
1
gitea/gitea/indexers/issues.bleve/rupture_meta.json
Normal file
@@ -0,0 +1 @@
|
||||
{"version":5}
|
||||
BIN
gitea/gitea/indexers/issues.bleve/store/root.bolt
Normal file
BIN
gitea/gitea/indexers/issues.bleve/store/root.bolt
Normal file
Binary file not shown.
52
gitea/gitea/jwt/private.pem
Normal file
52
gitea/gitea/jwt/private.pem
Normal file
@@ -0,0 +1,52 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC4qA+o6jrb7XB8
|
||||
Yyt8H2eXijm5OZkfgkjkLNFWEd5P8M0UbKOsc8NlINjcOl/47Ojkk7dGdwIQAaly
|
||||
ZfyN2U6vT0K/HmFtV745e7eRTIhWmcTs8gNJkziPx1It3OLmfDwBZueH0qC8GX5a
|
||||
aoygbpHwgyB6SlnZmitLISbF2iZT3ShtKX6BxKqxMugKuu5oHrIGIFpgLM0jgbOb
|
||||
c3ahHU1uBQhVtTX2oC+p9EV4K/TMPf39fBRMU/CwpFPlBwftzp6qlnElhFbPFnQq
|
||||
YEqwquDeFxmQyBO15tfFgcnFEPgJ7f2dVjg2DPva+hWdYIlRwip9DLRpP9IVMPnv
|
||||
KpQDjj5U1Z5ViKKD/h1IUXDnTJ35Za5w3hrIm7lC/FgF8mCOnDAUWF2VrY5onFoJ
|
||||
kpcPua8kyrD4l9BC+NyVs6Nh1uB9C1DFuTkBtA44gayt6VubnaFUrPyuH2tv1Zpa
|
||||
dLTgtc9vWiynEgxHESXf5yEqQ+QeMGF2uF6ageeyHCkqPz1AOiHV64uFBdv2z/4u
|
||||
sT4pxQTyNN4kLcvmLz36dkJI02KjZ9N2kgXQy8Nqe5wfpIwrEf0FnGdgTO3zKxTt
|
||||
I9fBOt6RYga6f88akfXbUeSZnypKLi6wAbTtS7Do3Dv53hA46INYEdrwN60M8IWJ
|
||||
o/GTd60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KTaV
|
||||
+UaTDLIQbEfxAXrbq+uWzHWjYDFq487KA/EdiZfaqrTWg75K0qc5c1/JS2/vKXML
|
||||
qYTX5rvSeop412x27zCNMtQ2oDVz0UtmIwH2pUQTjT01GUa18NUSmXX/f3ZaBwst
|
||||
otECggEBAL3w34I72xZV7WaiAWwMnO614LJIOwBZraJlkC370GWc6KbJIvfCbG1X
|
||||
OWbypM2MGO1zAjcw6Fb5k/8WBP/s3nSRhwwzwRe2GhxAi+y9Xdssiz1/mWtDLJsz
|
||||
wRkuZKALGeGBlbL62dyImF7xIK3gsx8NDmVkWucV8/kEewn1z86+L8Af8b0HxGOE
|
||||
SLMSSmWUS1+M6L8EyoEZgQUzKC8EOI9VX+Bz1lVuOntsLbCLYFhOlQgBsU4XoQe7
|
||||
DZvQV3Jsh86yDyQ3oIZ8K9342pQtAbsyvIGW4dy+FF1s9z6uOL/CFOJvyRtAKEaI
|
||||
prpimPYjK83zg8fZzNjZAVujFNnMFUg=
|
||||
-----END PRIVATE KEY-----
|
||||
1
gitea/gitea/queues/common/CURRENT
Normal file
1
gitea/gitea/queues/common/CURRENT
Normal file
@@ -0,0 +1 @@
|
||||
MANIFEST-000000
|
||||
0
gitea/gitea/queues/common/LOCK
Normal file
0
gitea/gitea/queues/common/LOCK
Normal file
6
gitea/gitea/queues/common/LOG
Normal file
6
gitea/gitea/queues/common/LOG
Normal file
@@ -0,0 +1,6 @@
|
||||
=============== Dec 12, 2025 (UTC) ===============
|
||||
11:10:51.541099 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
|
||||
11:10:51.544623 db@open opening
|
||||
11:10:51.544814 version@stat F·[] S·0B[] Sc·[]
|
||||
11:10:51.545556 db@janitor F·2 G·0
|
||||
11:10:51.545580 db@open done T·933.103µs
|
||||
BIN
gitea/gitea/queues/common/MANIFEST-000000
Normal file
BIN
gitea/gitea/queues/common/MANIFEST-000000
Normal file
Binary file not shown.
BIN
gitea/gitea/sessions/9/1/9127745f151ece48
Normal file
BIN
gitea/gitea/sessions/9/1/9127745f151ece48
Normal file
Binary file not shown.
@@ -78,3 +78,4 @@ salut "Alex"
|
||||
echo "O modificare pe branch-ul dev"
|
||||
|
||||
echo "Altă modificare pe branch-ul dev"
|
||||
echo "Pushuit cu cheie ssh fara user si parola"
|
||||
|
||||
1
script.log
Normal file
1
script.log
Normal file
@@ -0,0 +1 @@
|
||||
2025-12-12T06:34:25+00:00 | Daniel | amount=250 | vat=47.5 | total=297.5
|
||||
17
script_python.py
Normal file
17
script_python.py
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
|
||||
def main():
|
||||
cwd = os.getcwd()
|
||||
files = os.listdir(cwd)
|
||||
|
||||
print(f"Folder curent: {cwd}\n")
|
||||
print("Fișiere găsite:")
|
||||
for name in files:
|
||||
print(f" - {name}")
|
||||
|
||||
print(f"\nTotal fișiere/foldere: {len(files)}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
6
toBeDiscussed.md
Normal file
6
toBeDiscussed.md
Normal file
@@ -0,0 +1,6 @@
|
||||
Nu am inteles urmatoarele:
|
||||
|
||||
-de ce nu am folder python in folderul docker?
|
||||
-de ce/cum ruleaza pe imaginea din docker python
|
||||
-in ce caz punem in folderul docker imaginile?
|
||||
-te rog o explicatie asupra structurii docker, docker-compose.yml si src
|
||||
3
www/app_php/index.php
Normal file
3
www/app_php/index.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
phpinfo();
|
||||
|
||||
12
www/node_script.js
Normal file
12
www/node_script.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const http = require("http");
|
||||
|
||||
const PORT = process.env.PORT || 8090;
|
||||
|
||||
const server = http.createServer((req, res) => {
|
||||
res.writeHead(200, { "Content-Type": "text/plain; charset=utf-8" });
|
||||
res.end("Salut! Node.js rulează pe portul " + PORT + "\n");
|
||||
});
|
||||
|
||||
server.listen(PORT, "0.0.0.0", () => {
|
||||
console.log(`Node server: http://0.0.0.0:${PORT}`);
|
||||
});
|
||||
10
www/programDotNet/ProgramDotNet.cs
Normal file
10
www/programDotNet/ProgramDotNet.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// ascultă pe 0.0.0.0:8085
|
||||
builder.WebHost.UseUrls("http://0.0.0.0:8085");
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.MapGet("/", () => "Salut! .NET rulează pe 8085. fisier updatat");
|
||||
|
||||
app.Run();
|
||||
7
www/programDotNet/programDotNet.csproj
Normal file
7
www/programDotNet/programDotNet.csproj
Normal file
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
45
www/script_php.php
Executable file
45
www/script_php.php
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Rulare:
|
||||
* php script.php --name=Daniel --amount=125.50
|
||||
*/
|
||||
|
||||
function usage(): void {
|
||||
echo "Usage: php script.php --name=NAME --amount=NUMBER\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$options = getopt("", ["name:", "amount:"]);
|
||||
$name = $options["name"] ?? null;
|
||||
$amount = $options["amount"] ?? null;
|
||||
|
||||
if ($name === null || $amount === null) {
|
||||
usage();
|
||||
}
|
||||
|
||||
if (!is_numeric($amount)) {
|
||||
fwrite(STDERR, "Error: --amount must be numeric.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$amount = (float)$amount;
|
||||
$vatRate = 0.19; // TVA 19%
|
||||
$vat = round($amount * $vatRate, 2);
|
||||
$total = round($amount + $vat, 2);
|
||||
|
||||
$result = [
|
||||
"name" => $name,
|
||||
"amount" => $amount,
|
||||
"vat" => $vat,
|
||||
"total" => $total,
|
||||
"time" => date("c"),
|
||||
];
|
||||
|
||||
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
|
||||
|
||||
// scrie și un log local
|
||||
$logLine = $result["time"] . " | {$name} | amount={$amount} | vat={$vat} | total={$total}\n";
|
||||
file_put_contents(__DIR__ . "/script.log", $logLine, FILE_APPEND);
|
||||
17
www/script_python2.py
Normal file
17
www/script_python2.py
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
|
||||
class Handler(BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Type", "text/plain; charset=utf-8")
|
||||
self.end_headers()
|
||||
self.wfile.write(b"Salut! Server Python 2 ruleaza pe portul 8088")
|
||||
|
||||
def main():
|
||||
server = HTTPServer(("0.0.0.0", 8088), Handler)
|
||||
print("Python server pornit pe http://0.0.0.0:8088")
|
||||
server.serve_forever()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user